@graphrefly/graphrefly 0.34.0 → 0.35.0

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 (333) hide show
  1. package/dist/{cascading-DKIb6Pk8.d.cts → cascading-B25wxpRa.d.cts} +3 -3
  2. package/dist/{cascading-Bg0a4VSf.d.ts → cascading-BsJ4GbnS.d.ts} +3 -3
  3. package/dist/{chunk-TZLEMGAK.js → chunk-2Y3DKIZL.js} +2 -2
  4. package/dist/chunk-3OT7K33Q.js +1 -0
  5. package/dist/chunk-53XJ2S6D.js +1 -0
  6. package/dist/chunk-5CPPC75H.js +1 -0
  7. package/dist/chunk-5KPIYVCC.js +7 -0
  8. package/dist/{chunk-GAOX6OPT.js → chunk-5XZRCS2M.js} +1 -1
  9. package/dist/{chunk-C5DINHNP.js → chunk-6G5YD37E.js} +1 -1
  10. package/dist/{chunk-WBWBY6LI.js → chunk-6SVKZ7VI.js} +1 -1
  11. package/dist/chunk-A5HZZYRK.js +1 -0
  12. package/dist/chunk-BGEY3PXH.js +1 -0
  13. package/dist/chunk-CD4CB6S7.js +1 -0
  14. package/dist/chunk-CE72X3WO.js +1 -0
  15. package/dist/chunk-CUQFO6MT.js +1 -0
  16. package/dist/chunk-D5RFJOZ2.js +1 -0
  17. package/dist/{chunk-A3GDELMY.js → chunk-E5YSBQSF.js} +7 -7
  18. package/dist/{chunk-SFIM774L.js → chunk-EUE7ELFQ.js} +1 -1
  19. package/dist/chunk-F3IGTWCQ.js +1 -0
  20. package/dist/chunk-F672GV32.js +1 -0
  21. package/dist/{chunk-GCUYSIM4.js → chunk-GWOKTENT.js} +1 -1
  22. package/dist/{chunk-4NYSEUKV.js → chunk-J6TGRQUP.js} +1 -1
  23. package/dist/{chunk-4F564IPP.js → chunk-JJTF75VS.js} +1 -1
  24. package/dist/{chunk-BY4WKPKM.js → chunk-JUJEPZOI.js} +1 -1
  25. package/dist/{chunk-65WWQ5CB.js → chunk-M5UC63ZI.js} +5 -5
  26. package/dist/chunk-MQZWA3DF.js +1 -0
  27. package/dist/chunk-MYFR67PY.js +18 -0
  28. package/dist/{chunk-KN2UMFT6.js → chunk-PCD2MU7X.js} +1 -1
  29. package/dist/{chunk-YDWTVO4E.js → chunk-PIIUJIF7.js} +1 -1
  30. package/dist/chunk-PVUTRA5K.js +5 -0
  31. package/dist/chunk-Q7EUZ6NN.js +1 -0
  32. package/dist/chunk-RLMYS3XZ.js +1 -0
  33. package/dist/chunk-RRFOCAH6.js +1 -0
  34. package/dist/{chunk-Q46YJCQH.js → chunk-T6RPUERH.js} +1 -1
  35. package/dist/{chunk-IPNJDNE7.js → chunk-T7GWBGOO.js} +1 -1
  36. package/dist/{chunk-U2T2XWDA.js → chunk-U347KVM4.js} +1 -1
  37. package/dist/chunk-UAMWD4GG.js +1 -0
  38. package/dist/chunk-VN6RDSK2.js +1 -0
  39. package/dist/{chunk-CJMFZXIZ.js → chunk-W2ZU226Q.js} +1 -1
  40. package/dist/{chunk-UF746BQ4.js → chunk-XINLP35X.js} +1 -1
  41. package/dist/{chunk-TONEKQM3.js → chunk-XMDNNSMK.js} +1 -1
  42. package/dist/{chunk-INXDSJRC.js → chunk-YOUAVGHJ.js} +1 -1
  43. package/dist/chunk-YV2A2VWG.js +1 -0
  44. package/dist/{chunk-PBN426RU.js → chunk-ZGVA2SR5.js} +1 -1
  45. package/dist/compat/index.cjs +10 -10
  46. package/dist/compat/index.d.cts +17 -14
  47. package/dist/compat/index.d.ts +17 -14
  48. package/dist/compat/index.js +1 -1
  49. package/dist/compat/jotai/index.d.cts +2 -2
  50. package/dist/compat/jotai/index.d.ts +2 -2
  51. package/dist/compat/nanostores/index.d.cts +2 -2
  52. package/dist/compat/nanostores/index.d.ts +2 -2
  53. package/dist/compat/nestjs/index.cjs +12 -12
  54. package/dist/compat/nestjs/index.d.cts +9 -6
  55. package/dist/compat/nestjs/index.d.ts +9 -6
  56. package/dist/compat/nestjs/index.js +1 -1
  57. package/dist/compat/react/index.d.cts +2 -2
  58. package/dist/compat/react/index.d.ts +2 -2
  59. package/dist/compat/solid/index.d.cts +2 -2
  60. package/dist/compat/solid/index.d.ts +2 -2
  61. package/dist/compat/svelte/index.d.cts +2 -2
  62. package/dist/compat/svelte/index.d.ts +2 -2
  63. package/dist/compat/vue/index.d.cts +2 -2
  64. package/dist/compat/vue/index.d.ts +2 -2
  65. package/dist/compat/zustand/index.cjs +7 -7
  66. package/dist/compat/zustand/index.d.cts +5 -4
  67. package/dist/compat/zustand/index.d.ts +5 -4
  68. package/dist/compat/zustand/index.js +1 -1
  69. package/dist/{composite-BPDU_XV1.d.ts → composite-CT_mApQD.d.ts} +2 -2
  70. package/dist/{composite-CmvdhTJe.d.cts → composite-_XckYx2e.d.cts} +2 -2
  71. package/dist/{content-addressed-storage-DqIWCmZG.d.cts → content-addressed-storage-4-ST1tYk.d.cts} +5 -5
  72. package/dist/{content-addressed-storage-BUiREIuj.d.ts → content-addressed-storage-DuYMjV7o.d.ts} +5 -5
  73. package/dist/core/index.d.cts +4 -4
  74. package/dist/core/index.d.ts +4 -4
  75. package/dist/extra/browser.cjs +1 -1
  76. package/dist/extra/browser.d.cts +4 -3
  77. package/dist/extra/browser.d.ts +4 -3
  78. package/dist/extra/browser.js +1 -1
  79. package/dist/extra/index.cjs +19 -19
  80. package/dist/extra/index.d.cts +13 -12
  81. package/dist/extra/index.d.ts +13 -12
  82. package/dist/extra/index.js +1 -1
  83. package/dist/extra/node.cjs +2 -3
  84. package/dist/extra/node.d.cts +3 -3
  85. package/dist/extra/node.d.ts +3 -3
  86. package/dist/extra/node.js +2 -2
  87. package/dist/extra/operators.cjs +1 -1
  88. package/dist/extra/operators.d.cts +1 -1
  89. package/dist/extra/operators.d.ts +1 -1
  90. package/dist/extra/operators.js +1 -1
  91. package/dist/extra/reactive.cjs +1 -1
  92. package/dist/extra/reactive.d.cts +4 -3
  93. package/dist/extra/reactive.d.ts +4 -3
  94. package/dist/extra/reactive.js +1 -1
  95. package/dist/extra/sources.cjs +1 -1
  96. package/dist/extra/sources.d.cts +57 -2
  97. package/dist/extra/sources.d.ts +57 -2
  98. package/dist/extra/sources.js +1 -1
  99. package/dist/extra/storage-browser.cjs +1 -1
  100. package/dist/extra/storage-browser.d.cts +8 -42
  101. package/dist/extra/storage-browser.d.ts +8 -42
  102. package/dist/extra/storage-browser.js +1 -1
  103. package/dist/extra/storage-core.cjs +1 -1
  104. package/dist/extra/storage-core.d.cts +13 -83
  105. package/dist/extra/storage-core.d.ts +13 -83
  106. package/dist/extra/storage-core.js +1 -1
  107. package/dist/extra/storage-node.cjs +1 -2
  108. package/dist/extra/storage-node.d.cts +1 -59
  109. package/dist/extra/storage-node.d.ts +1 -59
  110. package/dist/extra/storage-node.js +0 -1
  111. package/dist/extra/storage-tiers-browser.cjs +1 -0
  112. package/dist/extra/storage-tiers-browser.d.cts +49 -0
  113. package/dist/extra/storage-tiers-browser.d.ts +49 -0
  114. package/dist/extra/storage-tiers-browser.js +1 -0
  115. package/dist/extra/storage-tiers-node.cjs +1 -0
  116. package/dist/extra/storage-tiers-node.d.cts +86 -0
  117. package/dist/extra/storage-tiers-node.d.ts +86 -0
  118. package/dist/extra/storage-tiers-node.js +1 -0
  119. package/dist/extra/storage-tiers.cjs +1 -0
  120. package/dist/extra/storage-tiers.d.cts +284 -0
  121. package/dist/extra/storage-tiers.d.ts +284 -0
  122. package/dist/extra/storage-tiers.js +1 -0
  123. package/dist/{fallback-mYSd8vQo.d.ts → fallback-DuEXfA4F.d.ts} +14 -14
  124. package/dist/{fallback-9YznPvPP.d.cts → fallback-axI2cXwt.d.cts} +14 -14
  125. package/dist/graph/index.cjs +3 -3
  126. package/dist/graph/index.d.cts +6 -5
  127. package/dist/graph/index.d.ts +6 -5
  128. package/dist/graph/index.js +1 -1
  129. package/dist/{graph-BROUZPG9.d.ts → graph-Cv-8x0ZI.d.ts} +28 -16
  130. package/dist/{graph-DaoydJ_u.d.cts → graph-kTltt95s.d.cts} +28 -16
  131. package/dist/imperative-audit-ahAE65a9.d.cts +28 -0
  132. package/dist/imperative-audit-ahAE65a9.d.ts +28 -0
  133. package/dist/{index-CI5fULSz.d.ts → index-8OxXae3g.d.ts} +1 -1
  134. package/dist/{index-CQ1gt4rn.d.cts → index-9xhIaM-w.d.cts} +1 -1
  135. package/dist/{index-DhWrMTI6.d.cts → index-B3D_z0Z6.d.cts} +1 -1
  136. package/dist/{index-Ccv_61jG.d.cts → index-B3Dfl5sS.d.cts} +110 -27
  137. package/dist/{index-Dia4yc2y.d.ts → index-B4s70vYf.d.ts} +4 -4
  138. package/dist/{index-Db21wuaD.d.ts → index-B5UR87KG.d.ts} +3 -3
  139. package/dist/{index-DuvQAU02.d.ts → index-BBdwz2BW.d.ts} +2 -2
  140. package/dist/{index-B5eS17Bz.d.ts → index-BEvsFlfH.d.ts} +47 -32
  141. package/dist/{index-BUtCR0k6.d.ts → index-BF-ssbJB.d.ts} +7 -7
  142. package/dist/{index-ClKm7CFB.d.cts → index-BFuVcqL8.d.cts} +1 -1
  143. package/dist/{index-BkfL5MXh.d.cts → index-BWH17rK_.d.cts} +3 -3
  144. package/dist/{index-CD7qmvSf.d.ts → index-BZ1V5GzX.d.ts} +3 -3
  145. package/dist/{index-BDEhWLF4.d.cts → index-BhkPzu-Z.d.cts} +4 -4
  146. package/dist/{index-CNxdDb2e.d.ts → index-Bilohojo.d.ts} +3 -3
  147. package/dist/{index-zA1uVtk0.d.ts → index-BiomL7AW.d.ts} +1 -1
  148. package/dist/{index-BWiX5foT.d.ts → index-BjWZARLy.d.ts} +1 -1
  149. package/dist/{index-IxinNgAH.d.cts → index-BkbawFkI.d.cts} +16 -15
  150. package/dist/{index-RJX4snyi.d.cts → index-BlRVj-7Q.d.cts} +21 -21
  151. package/dist/index-BpFwRAf9.d.cts +26 -0
  152. package/dist/{index-Ds3Rz9m9.d.cts → index-BsZlbHM5.d.cts} +3 -3
  153. package/dist/{index-BFHpNSsV.d.ts → index-BtY2QVDf.d.cts} +8 -7
  154. package/dist/{index-BsxqmV6u.d.ts → index-BuMzxRO2.d.ts} +2 -2
  155. package/dist/{index-C5uMGVJw.d.ts → index-BwYGLgmI.d.ts} +4 -4
  156. package/dist/{index-3L3RC3VJ.d.ts → index-C40wA8zt.d.ts} +7 -7
  157. package/dist/{index-Bi4ZP6Hc.d.ts → index-C9xF16gc.d.ts} +110 -27
  158. package/dist/index-CAIhFfws.d.ts +171 -0
  159. package/dist/{index-BRisOxlx.d.ts → index-CDvC1m5p.d.ts} +1 -1
  160. package/dist/index-CGKs5ixV.d.cts +287 -0
  161. package/dist/{index-ygRFoyrN.d.ts → index-CI_yjtua.d.ts} +2 -2
  162. package/dist/{index-DxEcY7Om.d.ts → index-CIcu6fIR.d.ts} +1 -1
  163. package/dist/{index-CQtnGFrZ.d.cts → index-CfOSES72.d.cts} +7 -7
  164. package/dist/{index-Bd2AjMQY.d.ts → index-Cot94_82.d.ts} +21 -21
  165. package/dist/{index-B1hFhK1K.d.cts → index-CpZKtdMw.d.cts} +1 -1
  166. package/dist/{index-BO6t0HjV.d.cts → index-CqSJ25A9.d.cts} +1 -1
  167. package/dist/{index-Jgl7ev9I.d.cts → index-CzC0G0C3.d.cts} +9 -9
  168. package/dist/{index-p0bkNfby.d.cts → index-D6JRP-1_.d.cts} +3 -3
  169. package/dist/{index-D23g00HE.d.cts → index-D7r_vd0b.d.cts} +4 -4
  170. package/dist/{index-Cp91Sxbo.d.cts → index-D8IyqHvT.d.cts} +3 -3
  171. package/dist/{index-iKsmdnq6.d.cts → index-D9qoEOj_.d.cts} +2 -2
  172. package/dist/index-DBmBtqAN.d.ts +461 -0
  173. package/dist/{index-nP13Qe6T.d.ts → index-DFe2Pk2u.d.ts} +1 -1
  174. package/dist/{index-Cn3taOmp.d.cts → index-DKp1CIbG.d.cts} +2 -2
  175. package/dist/{index-CoR-tOZA.d.cts → index-DSD6xnbT.d.ts} +8 -7
  176. package/dist/{index-DheNs40A.d.ts → index-DXSLMoma.d.ts} +2 -2
  177. package/dist/{index-ZIQaKIdY.d.cts → index-DXZsXxtU.d.cts} +47 -32
  178. package/dist/{index-BVTjuKeP.d.cts → index-D_QQ_dTD.d.cts} +1 -1
  179. package/dist/{index-ChZvMC4M.d.cts → index-DeyzuqAi.d.cts} +7 -7
  180. package/dist/{index-Chi9IiHJ.d.ts → index-DlccEIi3.d.ts} +3 -3
  181. package/dist/{index-DR3XqZlV.d.cts → index-DmtWMP0X.d.cts} +1 -1
  182. package/dist/{index-CbCNoogR.d.ts → index-Dp69u0ym.d.ts} +16 -15
  183. package/dist/{index-b4a6Sg0R.d.ts → index-DwNNufVa.d.ts} +4 -4
  184. package/dist/{index-D80nGRb9.d.ts → index-DzYTXMBz.d.ts} +3 -3
  185. package/dist/index-DzgS5uYi.d.ts +26 -0
  186. package/dist/{index-B-KCkW4M.d.cts → index-GaW6Welt.d.cts} +4 -4
  187. package/dist/{index-DupIl9wI.d.ts → index-JYtN9uqM.d.ts} +1 -1
  188. package/dist/{index-Ced0dphF.d.ts → index-KNAMYngu.d.ts} +9 -9
  189. package/dist/{index-BpjQanLs.d.cts → index-PluovH45.d.cts} +2 -2
  190. package/dist/index-Qq-G9B6g.d.cts +171 -0
  191. package/dist/{index-yJY9thRY.d.cts → index-XxSeddWP.d.cts} +2 -2
  192. package/dist/{index-C8_bnDBZ.d.cts → index-ZhKyR8co.d.cts} +3 -3
  193. package/dist/index-hXKhbfh-.d.ts +287 -0
  194. package/dist/index-zK_mN1D-.d.cts +461 -0
  195. package/dist/index.cjs +59 -59
  196. package/dist/index.d.cts +53 -49
  197. package/dist/index.d.ts +53 -49
  198. package/dist/index.js +1 -1
  199. package/dist/{meta-BdjSt8ky.d.cts → meta-BGO6C7K9.d.cts} +1 -1
  200. package/dist/{meta-CtDjj7cU.d.ts → meta-CC6EPdpK.d.ts} +1 -1
  201. package/dist/{node-8qx0kgYt.d.cts → node-fSc-hCv8.d.cts} +1 -1
  202. package/dist/{node-8qx0kgYt.d.ts → node-fSc-hCv8.d.ts} +1 -1
  203. package/dist/{observable-B6Ba-TTI.d.cts → observable-Cqty11jG.d.cts} +1 -1
  204. package/dist/{observable-DOniYM2B.d.ts → observable-EAV_rNfM.d.ts} +1 -1
  205. package/dist/patterns/ai/browser.cjs +5 -5
  206. package/dist/patterns/ai/browser.d.cts +4 -4
  207. package/dist/patterns/ai/browser.d.ts +4 -4
  208. package/dist/patterns/ai/browser.js +1 -1
  209. package/dist/patterns/ai/index.cjs +19 -19
  210. package/dist/patterns/ai/index.d.cts +19 -17
  211. package/dist/patterns/ai/index.d.ts +19 -17
  212. package/dist/patterns/ai/index.js +1 -1
  213. package/dist/patterns/ai/node.cjs +1 -2
  214. package/dist/patterns/ai/node.d.cts +9 -9
  215. package/dist/patterns/ai/node.d.ts +9 -9
  216. package/dist/patterns/ai/node.js +1 -1
  217. package/dist/patterns/audit/index.cjs +6 -6
  218. package/dist/patterns/audit/index.d.cts +7 -5
  219. package/dist/patterns/audit/index.d.ts +7 -5
  220. package/dist/patterns/audit/index.js +1 -1
  221. package/dist/patterns/cqrs/index.cjs +7 -7
  222. package/dist/patterns/cqrs/index.d.cts +7 -4
  223. package/dist/patterns/cqrs/index.d.ts +7 -4
  224. package/dist/patterns/cqrs/index.js +1 -1
  225. package/dist/patterns/demo-shell/index.cjs +8 -8
  226. package/dist/patterns/demo-shell/index.d.cts +6 -5
  227. package/dist/patterns/demo-shell/index.d.ts +6 -5
  228. package/dist/patterns/demo-shell/index.js +1 -1
  229. package/dist/patterns/domain-templates/index.cjs +5 -5
  230. package/dist/patterns/domain-templates/index.d.cts +5 -4
  231. package/dist/patterns/domain-templates/index.d.ts +5 -4
  232. package/dist/patterns/domain-templates/index.js +1 -1
  233. package/dist/patterns/graphspec/index.cjs +20 -20
  234. package/dist/patterns/graphspec/index.d.cts +6 -5
  235. package/dist/patterns/graphspec/index.d.ts +6 -5
  236. package/dist/patterns/graphspec/index.js +1 -1
  237. package/dist/patterns/guarded-execution/index.cjs +7 -7
  238. package/dist/patterns/guarded-execution/index.d.cts +8 -6
  239. package/dist/patterns/guarded-execution/index.d.ts +8 -6
  240. package/dist/patterns/guarded-execution/index.js +1 -1
  241. package/dist/patterns/harness/index.cjs +12 -12
  242. package/dist/patterns/harness/index.d.cts +13 -10
  243. package/dist/patterns/harness/index.d.ts +13 -10
  244. package/dist/patterns/harness/index.js +1 -1
  245. package/dist/patterns/job-queue/index.cjs +7 -7
  246. package/dist/patterns/job-queue/index.d.cts +8 -4
  247. package/dist/patterns/job-queue/index.d.ts +8 -4
  248. package/dist/patterns/job-queue/index.js +1 -1
  249. package/dist/patterns/lens/index.cjs +4 -4
  250. package/dist/patterns/lens/index.d.cts +7 -6
  251. package/dist/patterns/lens/index.d.ts +7 -6
  252. package/dist/patterns/lens/index.js +1 -1
  253. package/dist/patterns/memory/index.cjs +1 -1
  254. package/dist/patterns/memory/index.d.cts +5 -4
  255. package/dist/patterns/memory/index.d.ts +5 -4
  256. package/dist/patterns/memory/index.js +1 -1
  257. package/dist/patterns/messaging/index.cjs +7 -7
  258. package/dist/patterns/messaging/index.d.cts +6 -4
  259. package/dist/patterns/messaging/index.d.ts +6 -4
  260. package/dist/patterns/messaging/index.js +1 -1
  261. package/dist/patterns/orchestration/index.cjs +7 -7
  262. package/dist/patterns/orchestration/index.d.cts +8 -5
  263. package/dist/patterns/orchestration/index.d.ts +8 -5
  264. package/dist/patterns/orchestration/index.js +1 -1
  265. package/dist/patterns/process/index.cjs +1 -0
  266. package/dist/patterns/process/index.d.cts +10 -0
  267. package/dist/patterns/process/index.d.ts +10 -0
  268. package/dist/patterns/process/index.js +1 -0
  269. package/dist/patterns/reactive-layout/index.cjs +5 -5
  270. package/dist/patterns/reactive-layout/index.d.cts +6 -5
  271. package/dist/patterns/reactive-layout/index.d.ts +6 -5
  272. package/dist/patterns/reactive-layout/index.js +1 -1
  273. package/dist/patterns/reduction/index.cjs +1 -1
  274. package/dist/patterns/reduction/index.d.cts +5 -4
  275. package/dist/patterns/reduction/index.d.ts +5 -4
  276. package/dist/patterns/reduction/index.js +1 -1
  277. package/dist/patterns/refine-loop/index.cjs +8 -8
  278. package/dist/patterns/refine-loop/index.d.cts +7 -5
  279. package/dist/patterns/refine-loop/index.d.ts +7 -5
  280. package/dist/patterns/refine-loop/index.js +1 -1
  281. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  282. package/dist/patterns/resilient-pipeline/index.d.cts +7 -6
  283. package/dist/patterns/resilient-pipeline/index.d.ts +7 -6
  284. package/dist/patterns/resilient-pipeline/index.js +1 -1
  285. package/dist/patterns/surface/index.cjs +11 -11
  286. package/dist/patterns/surface/index.d.cts +7 -6
  287. package/dist/patterns/surface/index.d.ts +7 -6
  288. package/dist/patterns/surface/index.js +1 -1
  289. package/dist/pipeline-graph-B85HUrWg.d.cts +120 -0
  290. package/dist/pipeline-graph-HOTU4UG0.d.ts +120 -0
  291. package/dist/{reactive-layout-DBJ3Vz-m.d.ts → reactive-layout-Btv0-efV.d.ts} +2 -2
  292. package/dist/{reactive-layout-Dk9AOQb_.d.cts → reactive-layout-D9zqqaqK.d.cts} +2 -2
  293. package/dist/reactive-log-ByBb8g6A.d.ts +188 -0
  294. package/dist/reactive-log-CgbNqksB.d.cts +188 -0
  295. package/dist/{reactive-map-LjwjcFaW.d.ts → reactive-map-CHyeCf4D.d.ts} +1 -1
  296. package/dist/{reactive-map-Cm89Hk0c.d.cts → reactive-map-DmgeADH8.d.cts} +1 -1
  297. package/dist/{resilience-RjDIHZNZ.d.ts → resilience-BWP2c7Af.d.cts} +27 -45
  298. package/dist/{resilience-N_VtLf7W.d.cts → resilience-Bys63Cpd.d.ts} +27 -45
  299. package/dist/resilience-OBU472D2.js +1 -0
  300. package/dist/{sugar-CQkn_rxB.d.ts → sugar-D13E2M_z.d.ts} +1 -1
  301. package/dist/{sugar-DVEYhR7a.d.cts → sugar-DgaGJcI6.d.cts} +1 -1
  302. package/dist/{topology-tree-BB6oJxMz.d.cts → topology-tree-C50l9ARE.d.cts} +1 -1
  303. package/dist/{topology-tree-CAFOG5S5.d.ts → topology-tree-CJsT24DP.d.ts} +1 -1
  304. package/dist/{types-Cp_4coR_.d.cts → types-BMSGPlpO.d.cts} +1 -1
  305. package/dist/{types-B2LfBvNc.d.ts → types-CidcBDuk.d.ts} +1 -1
  306. package/package.json +41 -1
  307. package/dist/chunk-2JO6LXFT.js +0 -7
  308. package/dist/chunk-2LZ6DL45.js +0 -1
  309. package/dist/chunk-3JXNEPCD.js +0 -2
  310. package/dist/chunk-3Y4BXFFR.js +0 -1
  311. package/dist/chunk-55T3K37W.js +0 -1
  312. package/dist/chunk-6HQ6HVTF.js +0 -1
  313. package/dist/chunk-7Q2WPFQ7.js +0 -1
  314. package/dist/chunk-FKRPIRE6.js +0 -1
  315. package/dist/chunk-HTBOCKVD.js +0 -1
  316. package/dist/chunk-I6VIH3VA.js +0 -1
  317. package/dist/chunk-IB64M7VP.js +0 -1
  318. package/dist/chunk-IJFSR4NU.js +0 -1
  319. package/dist/chunk-LOF5HSD3.js +0 -18
  320. package/dist/chunk-T2TB37TW.js +0 -1
  321. package/dist/chunk-T7EQPKOP.js +0 -1
  322. package/dist/chunk-Y63GWRHO.js +0 -5
  323. package/dist/chunk-YUBV7EEE.js +0 -1
  324. package/dist/index-C2Dey3L-.d.cts +0 -152
  325. package/dist/index-ClJUZAOr.d.cts +0 -101
  326. package/dist/index-Cq7Uqgu4.d.ts +0 -192
  327. package/dist/index-Dtpr2FIB.d.ts +0 -101
  328. package/dist/index-HvJ90_tX.d.ts +0 -152
  329. package/dist/index-wcfc7W-f.d.cts +0 -192
  330. package/dist/reactive-log-CWC7jO4J.d.cts +0 -190
  331. package/dist/reactive-log-CqaBg8nf.d.ts +0 -190
  332. package/dist/resilience-7UZHSSGC.js +0 -1
  333. /package/dist/{chunk-L3KUKDZC.js → chunk-O32GJOUJ.js} +0 -0
@@ -1,7 +1,9 @@
1
- import '../../node-8qx0kgYt.cjs';
1
+ import '../../node-fSc-hCv8.cjs';
2
2
  import '../../extra/sources.cjs';
3
- import '../../graph-DaoydJ_u.cjs';
4
- import '../../index-Ccv_61jG.cjs';
5
- export { A as AnalyzeEvent, B as BlindVariationContext, d as BlindVariationOptions, C as ConvergenceOptions, D as DatasetItem, e as DecideEvent, f as ErrorCritiqueContext, g as ErrorCritiqueOptions, a as EvalResult, h as EvaluateEvent, E as Evaluator, F as Feedback, G as GenerateEvent, I as Iteration, j as RefineLoopGraph, b as RefineLoopOptions, c as RefineStatus, R as RefineStrategy, k as blindVariation, l as errorCritique, r as refineLoop } from '../../index-ChZvMC4M.cjs';
6
- import '../../meta-BdjSt8ky.cjs';
3
+ import '../../graph-kTltt95s.cjs';
4
+ import '../../index-B3Dfl5sS.cjs';
5
+ export { A as AnalyzeEvent, B as BlindVariationContext, d as BlindVariationOptions, C as ConvergenceOptions, D as DatasetItem, e as DecideEvent, f as ErrorCritiqueContext, g as ErrorCritiqueOptions, a as EvalResult, h as EvaluateEvent, E as Evaluator, F as Feedback, G as GenerateEvent, I as Iteration, j as RefineLoopGraph, b as RefineLoopOptions, c as RefineStatus, R as RefineStrategy, k as blindVariation, l as errorCritique, r as refineLoop } from '../../index-DeyzuqAi.cjs';
6
+ import '../../meta-BGO6C7K9.cjs';
7
7
  import '../../extra/storage-core.cjs';
8
+ import '../../extra/storage-tiers.cjs';
9
+ import '../../reactive-log-CgbNqksB.cjs';
@@ -1,7 +1,9 @@
1
- import '../../node-8qx0kgYt.js';
1
+ import '../../node-fSc-hCv8.js';
2
2
  import '../../extra/sources.js';
3
- import '../../graph-BROUZPG9.js';
4
- import '../../index-Bi4ZP6Hc.js';
5
- export { A as AnalyzeEvent, B as BlindVariationContext, d as BlindVariationOptions, C as ConvergenceOptions, D as DatasetItem, e as DecideEvent, f as ErrorCritiqueContext, g as ErrorCritiqueOptions, a as EvalResult, h as EvaluateEvent, E as Evaluator, F as Feedback, G as GenerateEvent, I as Iteration, j as RefineLoopGraph, b as RefineLoopOptions, c as RefineStatus, R as RefineStrategy, k as blindVariation, l as errorCritique, r as refineLoop } from '../../index-BUtCR0k6.js';
6
- import '../../meta-CtDjj7cU.js';
3
+ import '../../graph-Cv-8x0ZI.js';
4
+ import '../../index-C9xF16gc.js';
5
+ export { A as AnalyzeEvent, B as BlindVariationContext, d as BlindVariationOptions, C as ConvergenceOptions, D as DatasetItem, e as DecideEvent, f as ErrorCritiqueContext, g as ErrorCritiqueOptions, a as EvalResult, h as EvaluateEvent, E as Evaluator, F as Feedback, G as GenerateEvent, I as Iteration, j as RefineLoopGraph, b as RefineLoopOptions, c as RefineStatus, R as RefineStrategy, k as blindVariation, l as errorCritique, r as refineLoop } from '../../index-BF-ssbJB.js';
6
+ import '../../meta-CC6EPdpK.js';
7
7
  import '../../extra/storage-core.js';
8
+ import '../../extra/storage-tiers.js';
9
+ import '../../reactive-log-ByBb8g6A.js';
@@ -1 +1 @@
1
- import{a,b,c}from"../../chunk-SFIM774L.js";import"../../chunk-T2TB37TW.js";import"../../chunk-L3KUKDZC.js";import"../../chunk-M27MVZCP.js";import"../../chunk-Q46YJCQH.js";import"../../chunk-HTBOCKVD.js";import"../../chunk-2JO6LXFT.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-4F564IPP.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-T7EQPKOP.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{b as blindVariation,c as errorCritique,a as refineLoop};
1
+ import{a,b,c}from"../../chunk-EUE7ELFQ.js";import"../../chunk-BGEY3PXH.js";import"../../chunk-O32GJOUJ.js";import"../../chunk-T6RPUERH.js";import"../../chunk-M27MVZCP.js";import"../../chunk-5KPIYVCC.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-JJTF75VS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-RLMYS3XZ.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{b as blindVariation,c as errorCritique,a as refineLoop};
@@ -1 +1 @@
1
- "use strict";var fe=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var bt=Object.prototype.hasOwnProperty;var N=(n,e)=>()=>(n&&(e=n(n=0)),e);var yt=(n,e)=>{for(var t in e)fe(n,t,{get:e[t],enumerable:!0})},_t=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of gt(e))!bt.call(n,o)&&o!==t&&fe(n,o,{get:()=>e[o],enumerable:!(r=mt(e,o))||r.enumerable});return n};var wt=n=>_t(fe({},"__esModule",{value:!0}),n);function D(n){return n<0?0:n}function vt(n,e){return e==="none"?n:e==="full"?Math.random()*n:n/2+Math.random()*(n/2)}function Tt(n,e){return n+Math.random()*(e-n)}function xt(n){let e=D(n);return()=>e}function Nt(n,e){let t=D(n),r=e===void 0?t:D(e);return o=>t+r*Math.max(0,o)}function kt(n){let e=D(n?.baseNs??1e8),t=n?.factor!==void 0&&n.factor<1?1:n?.factor??2,r=D(n?.maxDelayNs??30*1e9),o=n?.jitter??"none";return a=>{let s;if(e===0)s=0;else if(t===1)s=e;else{let i=r/e,u=1;for(let d=0;d<Math.max(0,a);d++){if(u>=i){u=i;break}u*=t}s=e*u,s>r&&(s=r)}return vt(s,o)}}function Et(n=100*1e6,e=30*1e9){let t=D(n),r=D(e);function o(a){if(a<=0)return 1;let s=1,i=2;for(let u=1;u<a;u++){let d=s+i;s=i,i=d}return i}return a=>{let s=o(a)*t;return s<=r?s:r}}function St(n=100*1e6,e=30*1e9){return(t,r,o)=>{let s=Math.min(e,(o??n)*3);return Tt(n,s)}}function De(n){if(n==="constant")return xt(1*1e9);if(n==="linear")return Nt(1*1e9);if(n==="exponential")return kt();if(n==="fibonacci")return Et();if(n==="decorrelatedJitter")return St();throw new Error(`Unknown backoff preset: "${String(n)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var M,I,pe=N(()=>{"use strict";M=1e6,I=1e9});function Ie(){return G>0||X}function Fe(){return G>0}function Le(n){G>0?Z.push(n):n()}function he(n){G+=1;let e=!1;try{n()}catch(t){throw e=!0,t}finally{if(G-=1,G===0)if(e){if(!X){let t=Z.splice(0);for(let r of t)try{r()}catch{}F.length=0,L.length=0,V.length=0}}else Ot()}}function Ot(){let n=!X;n&&(X=!0);let e=[],t=0;try{for(;F.length>0||L.length>0||V.length>0||n&&Z.length>0;){if(n&&Z.length>0){let a=Z.splice(0);for(let s of a)try{s()}catch(i){e.push(i)}continue}if(t+=1,t>1e3)throw F.length=0,L.length=0,V.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(F.length>0?F:L.length>0?L:V).splice(0);for(let a of o)try{a()}catch(s){e.push(s)}}}finally{n&&(X=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function re(n,e,t){if(e.length===0)return;if(e.length===1){let d=t(e[0][0]);if(d<3||!Ie()){n(e);return}(d>=5?V:d===4?L:F).push(()=>n(e));return}let r=e.length,o=r,a=r,s=r,i=0;for(;i<r&&t(e[i][0])<3;)i++;for(o=i;i<r&&t(e[i][0])===3;)i++;for(a=i;i<r&&t(e[i][0])===4;)i++;s=i;let u=Ie();if(o>0){let d=e.slice(0,o);n(d)}if(a>o){let d=e.slice(o,a);u?F.push(()=>n(d)):n(d)}if(s>a){let d=e.slice(a,s);u?L.push(()=>n(d)):n(d)}if(r>s){let d=e.slice(s,r);u?V.push(()=>n(d)):n(d)}}var G,X,F,L,V,Z,me=N(()=>{"use strict";G=0,X=!1,F=[],L=[],V=[],Z=[]});function H(){return Math.trunc(performance.now()*1e6)}function Pe(){return Date.now()*1e6}var ge=N(()=>{"use strict"});var Q,g,T,v,P,O,C,S,_,m,U,be,Rt,ye,At,Mt,_e,Be,Ge,Ve,we,W=N(()=>{"use strict";Q=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),T=Symbol.for("graphrefly/DIRTY"),v=Symbol.for("graphrefly/RESOLVED"),P=Symbol.for("graphrefly/INVALIDATE"),O=Symbol.for("graphrefly/PAUSE"),C=Symbol.for("graphrefly/RESUME"),S=Symbol.for("graphrefly/TEARDOWN"),_=Symbol.for("graphrefly/COMPLETE"),m=Symbol.for("graphrefly/ERROR"),U=Object.freeze([T]),be=Object.freeze([v]),Rt=Object.freeze([P]),ye=Object.freeze([Q]),At=Object.freeze([_]),Mt=Object.freeze([S]),_e=Object.freeze([U]),Be=Object.freeze([be]),Ge=Object.freeze([Rt]),Ve=Object.freeze([At]),we=Object.freeze([Mt])});function He(n){n.registerCodec(Ct)}var Ct,Ue=N(()=>{"use strict";Ct={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}}});function oe(n){if(n==null)return Dt;let{type:e,id:t,...r}=n;return{type:e??"system",id:t??"",...r}}var Dt,We=N(()=>{"use strict";Dt={type:"system",id:""}});function $e(n){n.registerMessageType(Q,{tier:0,wireCrossing:!1}),n.registerMessageType(T,{tier:1,wireCrossing:!1}),n.registerMessageType(P,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(O,{tier:2,wireCrossing:!1}),n.registerMessageType(C,{tier:2,wireCrossing:!1}),n.registerMessageType(g,{tier:3,wireCrossing:!0}),n.registerMessageType(v,{tier:3,wireCrossing:!0}),n.registerMessageType(_,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(m,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(S,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var se,je=N(()=>{"use strict";W();se=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let r=this._messageTypes.get(t);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var $,ze=N(()=>{"use strict";$=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function ve(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(ve);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=ve(n[t]);return e}return null}function Lt(n){let e=Ft.encode(n),t=e.length,r=t*8,o=t+9+63&-64,a=new Uint8Array(o);a.set(e),a[t]=128;let s=new DataView(a.buffer);s.setUint32(o-4,r>>>0,!1),s.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,u=3144134277,d=1013904242,c=2773480762,f=1359893119,y=2600822924,p=528734635,w=1541459225,h=new Uint32Array(64),l=(E,k)=>E>>>k|E<<32-k;for(let E=0;E<o;E+=64){for(let x=0;x<16;x++)h[x]=s.getUint32(E+x*4,!1);for(let x=16;x<64;x++){let Y=h[x-15],J=h[x-2],ne=l(Y,7)^l(Y,18)^Y>>>3,le=l(J,17)^l(J,19)^J>>>10;h[x]=h[x-16]+ne+h[x-7]+le>>>0}let k=i,q=u,K=d,de=c,A=f,ee=y,te=p,ce=w;for(let x=0;x<64;x++){let Y=l(A,6)^l(A,11)^l(A,25),J=A&ee^~A&te,ne=ce+Y+J+It[x]+h[x]>>>0,le=l(k,2)^l(k,13)^l(k,22),pt=k&q^k&K^q&K,ht=le+pt>>>0;ce=te,te=ee,ee=A,A=de+ne>>>0,de=K,K=q,q=k,k=ne+ht>>>0}i=i+k>>>0,u=u+q>>>0,d=d+K>>>0,c=c+de>>>0,f=f+A>>>0,y=y+ee>>>0,p=p+te>>>0,w=w+ce>>>0}let b=E=>E.toString(16).padStart(8,"0");return b(i)+b(u)+b(d)+b(c)+b(f)+b(y)+b(p)+b(w)}function Te(n){let e=ve(n??null),t=JSON.stringify(e);return Lt(t).slice(0,16)}function Pt(){let n=globalThis.crypto;if(n?.randomUUID)return n.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function xe(n,e,t){let r=t?.id??Pt();if(n===0)return{id:r,version:0};let a=(t?.hash??Te)(e);return{id:r,version:0,cid:a,prev:null}}function qe(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var It,Ft,Ke=N(()=>{"use strict";It=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ft=new TextEncoder});function Xe(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ne(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function ie(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}function B(n,e,t){let r=Ze(n)?n:[],o=typeof n=="function"?n:typeof e=="function"?e:void 0,a={};return Ze(n)?a=(ke(e)?e:t)??{}:ke(n)?a=n:a=(ke(e)?e:t)??{},new ae(r,o,a)}var Ye,Je,Bt,Gt,Ee,ae,Ze,ke,ue=N(()=>{"use strict";Ue();We();me();ge();je();ze();W();Ke();Ye=()=>{},Je=100;Bt=(n,e,t,r)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},Gt=(n,e,t,r)=>{let o=n;if(o._status==="completed"||o._status==="errored")return;let a=o._cached,s=a===void 0?[ye]:[ye,[g,a]];o._status==="dirty"&&s.push(U),re(e,s,o._config.tierOf)},Ee=new se({onMessage:Bt,onSubscribe:Gt});$e(Ee);He(Ee);ae=class n{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,r){this._config=r.config??Ee,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=t,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Te;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?xe(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Xe);let a={};for(let[i,u]of Object.entries(r.meta??{})){let d={initial:u,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),a[i]=new n([],void 0,d)}Object.freeze(a),this.meta=a,this._hasMeta=Object.keys(a).length>0;let s=this;this._actions={emit(i){s._emit([[g,i]])},down(i){s._emit(ie(i))},up(i){s._emitUp(ie(i))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let o=t?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let a=this._cached===void 0?void 0:this._cached,s=this._versioning,i=s?.id??t?.id,u=s?.version??0,d=xe(e,a,{id:i,hash:o});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=oe(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!t&&!r)return;let o=oe(e?.actor),a=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,a))throw new $({actor:o,action:a,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(o,a))throw new $({actor:o,action:a,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:Pe()}}down(e,t){let r=ie(e);r.length!==0&&(this._checkGuard(t),this._emit(r))}emit(e,t){this._checkGuard(t),this._emit([[g,e]])}up(e,t){if(this._deps.length===0)return;let r=ie(e);if(r.length===0)return;this._checkGuard(t);let o=t??{internal:!0};this._validateUpTiers(r);for(let a of this._deps)a.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let r of e){let o=t(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let u=oe(t);if(!this._guard(u,"observe"))throw new $({actor:u,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)Ne(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let a;try{a=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof a=="function")try{a()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof a=="function"&&a(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let r=0;r<e;r++){let o=r,a=this._deps[r];a.unsub=Ye,a.unsub=a.node.subscribe(s=>{if(a.unsub===null)return;let i=this._config.tierOf,u=!1;for(let d of s)i(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),t++}}catch(r){this._deps[t].unsub=null;for(let o=0;o<t;o++){let a=this._deps[o];if(a.unsub!=null){let s=a.unsub;a.unsub=null;try{s()}catch{}Ne(a)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let t=this._deps.length,r=Xe(e);if(this._deps.push(r),this._sinks==null)return t;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(_e),r.unsub=Ye;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let a=this._config.tierOf,s=!1;for(let i of o)a(i[0])>=3&&(s=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:t},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(r){this._emit([[m,this._wrapFnError("cleanup threw",r)]])}else if(t!=null&&typeof t=="object"){let r=t.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[m,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}Ne(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let r=this._deps[e],o=t[0];if(this._inspectorHooks!=null){let a={kind:"dep_message",depIndex:e,message:t};for(let s of this._inspectorHooks)s(a)}if(o!==Q){if(o===T){this._depDirtied(r);return}if(o===P){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Ge);return}if(o===O||o===C){this._emit([t]);return}if(o===S){this._emit(we);return}if(o===g)this._depSettledAsData(r,t[1]);else if(o===v)this._depSettledAsResolved(r);else if(o===_)this._depSettledAsTerminal(r,!0);else if(o===m)this._depSettledAsTerminal(r,t[1]);else{this._emit([t]);return}if(!this._fn){(o===g||o===v)&&this._emit([t]),(o===_||o===m)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(_e))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Be),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[m,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Ve)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(s){this._emit([[m,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(i){this._emit([[m,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let t=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),r=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let i=t[s];i!=null&&i.length>0&&(this._deps[s].prevData=i[i.length-1])}let o=this._deps.map(s=>s.terminal),a={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:t,prevData:r};for(let i of this._inspectorHooks)i(s)}this._isExecutingFn=!0;try{let s=this._fn(t,this._actions,a);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let i=s;(typeof i.beforeRun=="function"||typeof i.deactivate=="function"||typeof i.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[m,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Je?(this._rerunDepth=0,this._emit([[m,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Je} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let r=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[U,e[0]]:e;let r=!0,o=!1,a=!1,s=-1;for(let u of e){let d=t(u[0]);d<s&&(r=!1),d===3&&(o=!0),u[0]===T&&(a=!0),s=d}let i=e;if(!r){let u=e.map((d,c)=>({m:d,i:c,tier:t(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),i=u.map(d=>d.m)}if(o&&!a&&this._status!=="dirty"){let u=0;for(;u<i.length&&t(i[u][0])===0;)u++;return u===0?[U,...i]:[...i.slice(0,u),U,...i.slice(u)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let u=e[i];if(u[0]===m&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(u=>u[0]===S||u[0]===P);if(i.length===0)return;t=i}t=this._frameBatch(t);let o=null;for(let i=0;i<t.length;i++){let u=t[i],d=u[0];if(d!==O&&d!==C){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===O?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let f=u[1];if(d===O)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))c=!1;else if(this._pauseLocks.delete(f),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let y=this._pauseBuffer;this._pauseBuffer=[],this._emit(y)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?o?.push(u):o==null&&(o=t.slice(0,i))}if(o!=null){if(o.length===0)return;t=o}if(this._hasMeta&&t.some(i=>i[0]===S))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(we)}catch{}let{finalMessages:a,equalsError:s}=this._updateState(t);if(a.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:a})}catch{}}if(a.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,u=[];for(let d of a)i(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(a);s!=null&&this._emit([[m,s]])}_updateState(e){let t=this._config.tierOf,r,o,a=-1,s=0;for(let c of e)t(c[0])===3&&s++;let i=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===g){u=c;break}}for(let c=0;c<e.length;c++){let f=e[c],y=f[0];if(y===g){if(f.length>=2){let p=!1;if(i&&this._cached!==void 0)try{p=this._equals(this._cached,f[1])}catch(w){o=this._wrapFnError("equals threw",w),a=c;break}if(p){r==null&&(r=e.slice(0,c)),r.push(be),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(u<0||c===u)&&qe(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),y===T)this._status="dirty";else if(y===v)this._status="resolved";else if(y===_){this._status="completed";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(y===m){this._status="errored";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(y===P){if(this._cached!==void 0){let w=this._config.rigorRecorder;if(w!=null)try{w.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let p=this._cleanup;if(typeof p=="function"){this._cleanup=void 0;try{p()}catch{}}else if(p!=null&&typeof p=="object"){let w=p.invalidate;if(typeof w=="function")try{w()}catch{}}}else y===S&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=a>=0?r??e.slice(0,a):r??e;return o!=null?{finalMessages:d,equalsError:o}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let r of t)r(e)};_dispatchOrAccumulate(e){if(Fe()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Le(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}re(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);re(this._deliverToSinks,t,this._config.tierOf)}},Ze=n=>Array.isArray(n),ke=n=>typeof n=="object"&&n!=null&&!Array.isArray(n)});function R(n,e){return B((r,o,a)=>n(o,a)??void 0,{describeKind:"producer",...e})}var Se=N(()=>{"use strict";ue()});function Oe(n){return{describeKind:"producer",...n}}function Qe(n,e){return R(t=>{let r=!1;try{for(let o of n){if(r)return;t.emit(o)}r||t.down([[_]])}catch(o){r||t.down([[m,o]])}return()=>{r=!0}},Oe(e))}function Vt(n){return n!=null&&typeof n.then=="function"}function Ht(n,e){let{signal:t,...r}=e??{};return R(o=>{let a=!1,s=()=>{a||(a=!0,o.down([[m,t.reason]]))};if(t?.aborted){s();return}return t?.addEventListener("abort",s,{once:!0}),Promise.resolve(n).then(i=>{a||(a=!0,t?.removeEventListener("abort",s),o.emit(i),o.down([[_]]))},i=>{a||(a=!0,t?.removeEventListener("abort",s),o.down([[m,i]]))}),()=>{a=!0,t?.removeEventListener("abort",s)}},Oe(r))}function Ut(n,e){let{signal:t,...r}=e??{};return R(o=>{let a=new AbortController,s=()=>a.abort(t?.reason);t?.aborted?a.abort(t.reason):t?.addEventListener("abort",s,{once:!0});let i=t??a.signal,u=!1,d=n[Symbol.asyncIterator](),c=()=>{u||i.aborted||Promise.resolve(d.next()).then(f=>{if(!(u||i.aborted)){if(f.done){o.down([[_]]);return}o.emit(f.value),c()}},f=>{!u&&!i.aborted&&o.down([[m,f]])})};return c(),()=>{u=!0,t?.removeEventListener("abort",s),a.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},Oe(r))}function Wt(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"}function et(n,e){if(Wt(n))return n;if(Vt(n))return Ht(n,e);if(n!=null){let t=n;if(typeof t[Symbol.asyncIterator]=="function")return Ut(n,e);if(typeof t[Symbol.iterator]=="function")return Qe(n,e)}return $t(n)}function $t(...n){return Qe(n,void 0)}var tt=N(()=>{"use strict";W();Se()});var j,nt=N(()=>{"use strict";j=class{_timer;_gen=0;start(e,t){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&t()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});function z(n){return{describeKind:"derived",...n}}function jt(n){return n<0?0:n}function Ce(n){return n[1]}function zt(n){if(typeof n!="number"||!Number.isFinite(n))throw new TypeError("backoff strategy must return a finite number");return n<0?0:n}function rt(n,e){let t=e?.count,r=e?.backoff,o=t!==void 0?t:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let a=r===void 0?null:typeof r=="string"?De(r):r;return R(s=>{let i=0,u=!1,d=null,c,f=new j;function y(){c?.(),c=void 0}function p(h){if(u)return;if(i>=o){y(),s.down([[m,h]]);return}let l=a===null?0:a(i,h,d);if(l==null){y(),s.down([[m,h]]);return}let b;try{b=zt(l)}catch{y(),s.down([[m,h]]);return}d=b,i+=1,y();let E=b>0?b/1e6:1;f.start(E,()=>{u||w()})}function w(){f.cancel(),y(),c=n.subscribe(h=>{if(!u)for(let l of h){let b=l[0];if(b===T)s.down([[T]]);else if(b===g)i=0,d=null,s.emit(l[1]);else if(b===v)s.down([[v]]);else if(b===_)y(),s.down([[_]]);else if(b===m){p(Ce(l));return}else s.down([l])}})}return w(),()=>{u=!0,f.cancel(),y()}},{...z(),initial:n.cache})}function ot(n){let e=Math.max(1,n?.failureThreshold??5),t=jt(n?.cooldownNs??30*1e9),r=n?.cooldown??null,o=Math.max(1,n?.halfOpenMax??1),a=n?.now??H,s="closed",i=0,u=0,d=0,c=t,f=0;function y(){if(!r)return t;let h=r(u);return h!==null?h:t}function p(){s="open",c=y(),d=a(),f=0}return{canExecute(){return s==="closed"?!0:s==="open"?a()-d>=c?(s="half-open",f=1,!0):!1:f<o?(f++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",i=0,u=0):s==="closed"&&(i=0)},recordFailure(h){if(s==="half-open"){u++,p();return}s==="closed"&&(i++,i>=e&&p())},get state(){return s},get failureCount(){return i},reset(){s="closed",i=0,u=0,f=0}}}function st(n,e){let t=e?.onOpen??"skip";return r=>{let o=B([],(a,s)=>{function i(){o.meta.breakerState.down([[g,n.state]])}let u=r.subscribe(d=>{for(let c of d){let f=c[0];f===T?s.down([[T]]):f===g?n.canExecute()?(i(),s.emit(c[1])):(i(),t==="error"?s.down([[m,new Re]]):s.down([[v]])):f===v?s.down([[v]]):f===_?(n.recordSuccess(),i(),s.down([[_]])):f===m?(n.recordFailure(Ce(c)),i(),s.down([c])):s.down([c])}});return i(),u},{...z(),meta:{breakerState:n.state},completeWhenDepsComplete:!1,initial:r.cache});return{node:o,breakerState:o.meta.breakerState}}}function qt(n,e){if(n<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let t=n,r=H();function o(a){if(e>0){let s=a-r;t=Math.min(n,t+s/1e9*e)}r=a}return{available(){return o(H()),t},tryConsume(a=1){if(a<=0)return!0;let s=H();return o(s),t>=a?(t-=a,!0):!1},putBack(a=1){a<=0||(o(H()),t=Math.min(n,t+a))}}}function it(n,e){let{maxEvents:t,windowNs:r}=e;if(t<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o!==void 0&&o<1)throw new RangeError("maxBuffer must be >= 1");let a=e.onOverflow??"drop-newest",s=t*1e9/r;return R(i=>{let u=qt(t,s),d=[],c=new j,f=!1,y=1e9/s;function p(){for(;d.length>0;)if(u.tryConsume(1))i.emit(d.shift());else{c.start(Math.max(1,y/1e6),p);return}}let w=n.subscribe(h=>{for(let l of h){if(f)return;let b=l[0];if(b===T)i.down([[T]]);else if(b===g){if(o!==void 0&&d.length>=o){if(a!=="drop-newest")if(a==="drop-oldest")d.shift(),d.push(l[1]);else{f=!0,c.cancel(),d.length=0,i.down([[m,new Ae(o)]]);return}}else d.push(l[1]);p()}else if(b===v)i.down([[v]]);else if(b===_)f=!0,c.cancel(),d.length=0,i.down([[_]]);else if(b===m)f=!0,c.cancel(),d.length=0,i.down([l]);else if(b===S){f=!0,c.cancel(),d.length=0,i.down([l]);return}else i.down([l])}});return()=>{f=!0,c.cancel(),w()}},{...z(),initial:n.cache})}function at(n,e){let t=e?.initialStatus??"pending",r=B([],(o,a)=>{let s=t;return r.meta.status.down([[g,t]]),r.meta.error.down([[g,null]]),n.subscribe(u=>{for(let d of u){let c=d[0];if(c===T)a.down([[T]]);else if(c===g)s==="errored"?he(()=>{r.meta.error.down([[g,null]]),r.meta.status.down([[g,"active"]])}):r.meta.status.down([[g,"active"]]),s="active",a.emit(d[1]);else if(c===v)a.down([[v]]);else if(c===_)r.meta.status.down([[g,"completed"]]),s="completed",a.down([[_]]);else if(c===m){let f=Ce(d);he(()=>{r.meta.error.down([[g,f]]),r.meta.status.down([[g,"errored"]])}),s="errored",a.down([d])}else a.down([d])}})},{...z(),meta:{status:t,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:n.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function Kt(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"}function Yt(n){return n!=null&&typeof n.then=="function"}function Jt(n){return n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function"}function ut(n,e){return R(t=>{let r,o;function a(){o?.(),o=void 0,Kt(e)||Yt(e)||Jt(e)?r=et(e).subscribe(i=>{t.down(i)}):(t.emit(e),t.down([[_]]))}return o=n.subscribe(s=>{for(let i of s){let u=i[0];if(u===T)t.down([[T]]);else if(u===g)t.emit(i[1]);else if(u===v)t.down([[v]]);else if(u===_)t.down([[_]]);else if(u===m){a();return}else if(u===S){r?.(),t.down([i]);return}else t.down([i])}}),()=>{o?.(),r?.()}},{...z(),initial:n.cache})}function dt(n,e){if(e<=0)throw new RangeError("timeoutNs must be > 0");return R(t=>{let r=!1,o=new j;function a(){let i=e/1e6;o.start(i,()=>{r||(r=!0,s(),t.down([[m,new Me(e)]]))})}let s=n.subscribe(i=>{for(let u of i){if(r)return;let d=u[0];if(d===T)t.down([[T]]);else if(d===g)a(),t.emit(u[1]);else if(d===v)t.down([[v]]);else if(d===_){o.cancel(),r=!0,t.down([[_]]);return}else if(d===m){o.cancel(),r=!0,t.down([u]);return}else if(d===S){o.cancel(),r=!0,t.down([u]);return}else t.down([u])}});return a(),()=>{r=!0,o.cancel(),s()}},{...z(),initial:n.cache})}var Re,Ae,Me,ct=N(()=>{"use strict";me();ge();W();ue();Se();pe();tt();nt();Re=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};Ae=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};Me=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Qt={};yt(Qt,{NS_PER_MS:()=>M,NS_PER_SEC:()=>I,resilientPipeline:()=>Zt});module.exports=wt(Qt);pe();ct();W();ue();function lt(n,e,t){return{[n]:!0,[`${n}_type`]:e,...t??{}}}function Xt(n,e){return lt("reduction",n,e)}function ft(n,e,t){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let r=e.map(p=>p.node),o=[n,...r],a=[],s=!1,i=!1,u=Symbol("budget-gate"),d=new Array(e.length);function c(){return e.every((p,w)=>p.check(d[w]))}function f(p){for(;a.length>0&&c();){let w=a[0];a=a.slice(1),p.emit(w)}a.length===0&&i&&(i=!1,p.down([[v]]))}return B([],(p,w)=>{for(let l=0;l<e.length;l++)d[l]=e[l].node.cache;let h=[];for(let l=0;l<o.length;l++){let b=o[l];h.push(b.subscribe(E=>{for(let k of E)y(k,l,w)}))}return()=>{for(let l of h)l()}},{...t,describeKind:"derived",meta:Xt("budget_gate",t?.meta)});function y(p,w,h){let l=p[0];if(w===0){if(l===g)return c()&&a.length===0?h.emit(p[1]):(a.push(p[1]),s||(s=!0,h.up([[O,u]]))),!0;if(l===T)return h.down([[T]]),!0;if(l===v)return a.length===0?h.down([[v]]):i=!0,!0;if(l===_||l===m){for(let b of a)h.emit(b);return a=[],i=!1,s&&(s=!1,h.up([[C,u]])),h.down([p]),!0}return!1}return l===g&&(d[w-1]=p[1]),l===g||l===v?(c()&&a.length>0?(f(h),a.length===0&&s&&(s=!1,h.up([[C,u]]))):!c()&&!s&&a.length>0&&(s=!0,h.up([[O,u]])),!0):l===T?!0:l===m?(h.down([p]),!0):l===_}}function Zt(n,e={}){let t=n;e.rateLimit!=null&&(t=it(t,e.rateLimit)),e.budget!=null&&e.budget.length>0&&(t=ft(t,e.budget));let r;if(e.breaker!=null){let a=ot(e.breaker),s=e.breakerOnOpen??"skip",i=st(a,{onOpen:s})(t);t=i.node,r=i.breakerState}if(e.timeoutMs!=null){if(e.timeoutMs<=0)throw new RangeError("timeoutMs must be > 0");if(e.timeoutMs>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic");t=dt(t,e.timeoutMs*1e6)}e.retry!=null&&(t=rt(t,e.retry)),e.fallback!==void 0&&(t=ut(t,e.fallback));let o=at(t,{initialStatus:e.initialStatus??"pending"});return{node:o.node,status:o.status,error:o.error,breakerState:r}}0&&(module.exports={NS_PER_MS,NS_PER_SEC,resilientPipeline});
1
+ "use strict";var pe=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var yt=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var _t=(t,e)=>{for(var n in e)pe(t,n,{get:e[n],enumerable:!0})},wt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of gt(e))!yt.call(t,o)&&o!==n&&pe(t,o,{get:()=>e[o],enumerable:!(r=bt(e,o))||r.enumerable});return t};var Tt=t=>wt(pe({},"__esModule",{value:!0}),t);function D(t){return t<0?0:t}function vt(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function xt(t,e){return t+Math.random()*(e-t)}function Nt(t){let e=D(t);return()=>e}function kt(t,e){let n=D(t),r=e===void 0?n:D(e);return o=>n+r*Math.max(0,o)}function Et(t){let e=D(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,r=D(t?.maxDelayNs??30*1e9),o=t?.jitter??"none";return a=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let i=r/e,u=1;for(let d=0;d<Math.max(0,a);d++){if(u>=i){u=i;break}u*=n}s=e*u,s>r&&(s=r)}return vt(s,o)}}function St(t=100*1e6,e=30*1e9){let n=D(t),r=D(e);function o(a){if(a<=0)return 1;let s=1,i=2;for(let u=1;u<a;u++){let d=s+i;s=i,i=d}return i}return a=>{let s=o(a)*n;return s<=r?s:r}}function Ot(t=100*1e6,e=30*1e9){return(n,r,o)=>{let s=Math.min(e,(o??t)*3);return xt(t,s)}}function he(t){if(t==="constant")return Nt(1*1e9);if(t==="linear")return kt(1*1e9);if(t==="exponential")return Et();if(t==="fibonacci")return St();if(t==="decorrelatedJitter")return Ot();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var A,F,me=k(()=>{"use strict";A=1e6,F=1e9});function Fe(){return H>0||Z}function Ie(){return H>0}function Le(t){H>0?Q.push(t):t()}function be(t){H+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(H-=1,H===0)if(e){if(!Z){let n=Q.splice(0);for(let r of n)try{r()}catch{}I.length=0,L.length=0,U.length=0}}else Rt()}}function Rt(){let t=!Z;t&&(Z=!0);let e=[],n=0;try{for(;I.length>0||L.length>0||U.length>0||t&&Q.length>0;){if(t&&Q.length>0){let a=Q.splice(0);for(let s of a)try{s()}catch(i){e.push(i)}continue}if(n+=1,n>1e3)throw I.length=0,L.length=0,U.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(I.length>0?I:L.length>0?L:U).splice(0);for(let a of o)try{a()}catch(s){e.push(s)}}}finally{t&&(Z=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function re(t,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!Fe()){t(e);return}(d>=5?U:d===4?L:I).push(()=>t(e));return}let r=e.length,o=r,a=r,s=r,i=0;for(;i<r&&n(e[i][0])<3;)i++;for(o=i;i<r&&n(e[i][0])===3;)i++;for(a=i;i<r&&n(e[i][0])===4;)i++;s=i;let u=Fe();if(o>0){let d=e.slice(0,o);t(d)}if(a>o){let d=e.slice(o,a);u?I.push(()=>t(d)):t(d)}if(s>a){let d=e.slice(a,s);u?L.push(()=>t(d)):t(d)}if(r>s){let d=e.slice(s,r);u?U.push(()=>t(d)):t(d)}}var H,Z,I,L,U,Q,ge=k(()=>{"use strict";H=0,Z=!1,I=[],L=[],U=[],Q=[]});function W(){return Math.trunc(performance.now()*1e6)}function Pe(){return Date.now()*1e6}var ye=k(()=>{"use strict"});var $,y,v,T,P,O,C,S,w,b,j,_e,At,we,Mt,Ct,Te,Be,Ge,Ve,ve,z=k(()=>{"use strict";$=Symbol.for("graphrefly/START"),y=Symbol.for("graphrefly/DATA"),v=Symbol.for("graphrefly/DIRTY"),T=Symbol.for("graphrefly/RESOLVED"),P=Symbol.for("graphrefly/INVALIDATE"),O=Symbol.for("graphrefly/PAUSE"),C=Symbol.for("graphrefly/RESUME"),S=Symbol.for("graphrefly/TEARDOWN"),w=Symbol.for("graphrefly/COMPLETE"),b=Symbol.for("graphrefly/ERROR"),j=Object.freeze([v]),_e=Object.freeze([T]),At=Object.freeze([P]),we=Object.freeze([$]),Mt=Object.freeze([w]),Ct=Object.freeze([S]),Te=Object.freeze([j]),Be=Object.freeze([_e]),Ge=Object.freeze([At]),Ve=Object.freeze([Mt]),ve=Object.freeze([Ct])});function He(t){t.registerCodec(Dt)}var Dt,Ue=k(()=>{"use strict";Dt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function oe(t){if(t==null)return Ft;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Ft,We=k(()=>{"use strict";Ft={type:"system",id:""}});function $e(t){t.registerMessageType($,{tier:0,wireCrossing:!1}),t.registerMessageType(v,{tier:1,wireCrossing:!1}),t.registerMessageType(P,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(O,{tier:2,wireCrossing:!1}),t.registerMessageType(C,{tier:2,wireCrossing:!1}),t.registerMessageType(y,{tier:3,wireCrossing:!0}),t.registerMessageType(T,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(b,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(S,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var se,je=k(()=>{"use strict";z();se=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var q,ze=k(()=>{"use strict";q=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function xe(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(xe);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=xe(t[n]);return e}return null}function Pt(t){let e=Lt.encode(t),n=e.length,r=n*8,o=n+9+63&-64,a=new Uint8Array(o);a.set(e),a[n]=128;let s=new DataView(a.buffer);s.setUint32(o-4,r>>>0,!1),s.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,u=3144134277,d=1013904242,c=2773480762,f=1359893119,g=2600822924,p=528734635,_=1541459225,h=new Uint32Array(64),l=(x,E)=>x>>>E|x<<32-E;for(let x=0;x<o;x+=64){for(let N=0;N<16;N++)h[N]=s.getUint32(x+N*4,!1);for(let N=16;N<64;N++){let J=h[N-15],X=h[N-2],ne=l(J,7)^l(J,18)^J>>>3,fe=l(X,17)^l(X,19)^X>>>10;h[N]=h[N-16]+ne+h[N-7]+fe>>>0}let E=i,K=u,Y=d,ce=c,M=f,ee=g,te=p,le=_;for(let N=0;N<64;N++){let J=l(M,6)^l(M,11)^l(M,25),X=M&ee^~M&te,ne=le+J+X+It[N]+h[N]>>>0,fe=l(E,2)^l(E,13)^l(E,22),ht=E&K^E&Y^K&Y,mt=fe+ht>>>0;le=te,te=ee,ee=M,M=ce+ne>>>0,ce=Y,Y=K,K=E,E=ne+mt>>>0}i=i+E>>>0,u=u+K>>>0,d=d+Y>>>0,c=c+ce>>>0,f=f+M>>>0,g=g+ee>>>0,p=p+te>>>0,_=_+le>>>0}let m=x=>x.toString(16).padStart(8,"0");return m(i)+m(u)+m(d)+m(c)+m(f)+m(g)+m(p)+m(_)}function Ne(t){let e=xe(t??null),n=JSON.stringify(e);return Pt(n).slice(0,16)}function Bt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function ke(t,e,n){let r=n?.id??Bt();if(t===0)return{id:r,version:0};let a=(n?.hash??Ne)(e);return{id:r,version:0,cid:a,prev:null}}function qe(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var It,Lt,Ke=k(()=>{"use strict";It=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Lt=new TextEncoder});function Xe(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ee(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function ie(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function B(t,e,n){let r=Ze(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,a={};return Ze(t)?a=(Se(e)?e:n)??{}:Se(t)?a=t:a=(Se(e)?e:n)??{},new ae(r,o,a)}var Ye,Je,Gt,Vt,Oe,ae,Ze,Se,ue=k(()=>{"use strict";Ue();We();ge();ye();je();ze();z();Ke();Ye=()=>{},Je=100;Gt=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},Vt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let a=o._cached,s=a===void 0?[we]:[we,[y,a]];o._status==="dirty"&&s.push(j),re(e,s,o._config.tierOf)},Oe=new se({onMessage:Gt,onSubscribe:Vt});$e(Oe);He(Oe);ae=class t{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,r){this._config=r.config??Oe,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Ne;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?ke(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Xe);let a={};for(let[i,u]of Object.entries(r.meta??{})){let d={initial:u,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),a[i]=new t([],void 0,d)}Object.freeze(a),this.meta=a,this._hasMeta=Object.keys(a).length>0;let s=this;this._actions={emit(i){s._emit([[y,i]])},down(i){s._emit(ie(i))},up(i){s._emitUp(ie(i))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let a=this._cached===void 0?void 0:this._cached,s=this._versioning,i=s?.id??n?.id,u=s?.version??0,d=ke(e,a,{id:i,hash:o});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=oe(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=oe(e?.actor),a=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,a))throw new q({actor:o,action:a,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(o,a))throw new q({actor:o,action:a,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:Pe()}}down(e,n){let r=ie(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[y,e]])}up(e,n){if(this._deps.length===0)return;let r=ie(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let a of this._deps)a.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let u=oe(n);if(!this._guard(u,"observe"))throw new q({actor:u,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)Ee(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let a;try{a=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof a=="function")try{a()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof a=="function"&&a(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let r=0;r<e;r++){let o=r,a=this._deps[r];a.unsub=Ye,a.unsub=a.node.subscribe(s=>{if(a.unsub===null)return;let i=this._config.tierOf,u=!1;for(let d of s)i(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let a=this._deps[o];if(a.unsub!=null){let s=a.unsub;a.unsub=null;try{s()}catch{}Ee(a)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=Xe(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Te),r.unsub=Ye;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let a=this._config.tierOf,s=!1;for(let i of o)a(i[0])>=3&&(s=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[b,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[b,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}Ee(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let a={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(a)}if(o!==$){if(o===v){this._depDirtied(r);return}if(o===P){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Ge);return}if(o===O||o===C){this._emit([n]);return}if(o===S){this._emit(ve);return}if(o===y)this._depSettledAsData(r,n[1]);else if(o===T)this._depSettledAsResolved(r);else if(o===w)this._depSettledAsTerminal(r,!0);else if(o===b)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===y||o===T)&&this._emit([n]),(o===w||o===b)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Te))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Be),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[b,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ve)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(s){this._emit([[b,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(i){this._emit([[b,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),r=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let i=n[s];i!=null&&i.length>0&&(this._deps[s].prevData=i[i.length-1])}let o=this._deps.map(s=>s.terminal),a={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:r};for(let i of this._inspectorHooks)i(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,a);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let i=s;(typeof i.beforeRun=="function"||typeof i.deactivate=="function"||typeof i.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[b,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Je?(this._rerunDepth=0,this._emit([[b,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Je} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[j,e[0]]:e;let r=!0,o=!1,a=!1,s=-1;for(let u of e){let d=n(u[0]);d<s&&(r=!1),d===3&&(o=!0),u[0]===v&&(a=!0),s=d}let i=e;if(!r){let u=e.map((d,c)=>({m:d,i:c,tier:n(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),i=u.map(d=>d.m)}if(o&&!a&&this._status!=="dirty"){let u=0;for(;u<i.length&&n(i[u][0])===0;)u++;return u===0?[j,...i]:[...i.slice(0,u),j,...i.slice(u)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let u=e[i];if(u[0]===b&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(u=>u[0]===S||u[0]===P);if(i.length===0)return;n=i}n=this._frameBatch(n);let o=null;for(let i=0;i<n.length;i++){let u=n[i],d=u[0];if(d!==O&&d!==C){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===O?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let f=u[1];if(d===O)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))c=!1;else if(this._pauseLocks.delete(f),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let g=this._pauseBuffer;this._pauseBuffer=[],this._emit(g)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?o?.push(u):o==null&&(o=n.slice(0,i))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(i=>i[0]===S))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(ve)}catch{}let{finalMessages:a,equalsError:s}=this._updateState(n);if(a.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:a})}catch{}}if(a.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,u=[];for(let d of a)i(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(a);s!=null&&this._emit([[b,s]])}_updateState(e){let n=this._config.tierOf,r,o,a=-1,s=0;for(let c of e)n(c[0])===3&&s++;let i=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===y){u=c;break}}for(let c=0;c<e.length;c++){let f=e[c],g=f[0];if(g===y){if(f.length>=2){let p=!1;if(i&&this._cached!==void 0)try{p=this._equals(this._cached,f[1])}catch(_){o=this._wrapFnError("equals threw",_),a=c;break}if(p){r==null&&(r=e.slice(0,c)),r.push(_e),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(u<0||c===u)&&qe(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),g===v)this._status="dirty";else if(g===T)this._status="resolved";else if(g===w){this._status="completed";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(g===b){this._status="errored";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(g===P){if(this._cached!==void 0){let _=this._config.rigorRecorder;if(_!=null)try{_.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let p=this._cleanup;if(typeof p=="function"){this._cleanup=void 0;try{p()}catch{}}else if(p!=null&&typeof p=="object"){let _=p.invalidate;if(typeof _=="function")try{_()}catch{}}}else g===S&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=a>=0?r??e.slice(0,a):r??e;return o!=null?{finalMessages:d,equalsError:o}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if(Ie()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Le(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}re(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);re(this._deliverToSinks,n,this._config.tierOf)}},Ze=t=>Array.isArray(t),Se=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function R(t,e){return B((r,o,a)=>t(o,a)??void 0,{describeKind:"producer",...e})}var Re=k(()=>{"use strict";ue()});function Ae(t){return{describeKind:"producer",...t}}function Qe(t,e){return R(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[w]])}catch(o){r||n.down([[b,o]])}return()=>{r=!0}},Ae(e))}function Ht(t){return t!=null&&typeof t.then=="function"}function Ut(t,e){let{signal:n,...r}=e??{};return R(o=>{let a=!1,s=()=>{a||(a=!0,o.down([[b,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(i=>{a||(a=!0,n?.removeEventListener("abort",s),o.emit(i),o.down([[w]]))},i=>{a||(a=!0,n?.removeEventListener("abort",s),o.down([[b,i]]))}),()=>{a=!0,n?.removeEventListener("abort",s)}},Ae(r))}function Wt(t,e){let{signal:n,...r}=e??{};return R(o=>{let a=new AbortController,s=()=>a.abort(n?.reason);n?.aborted?a.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let i=n??a.signal,u=!1,d=t[Symbol.asyncIterator](),c=()=>{u||i.aborted||Promise.resolve(d.next()).then(f=>{if(!(u||i.aborted)){if(f.done){o.down([[w]]);return}o.emit(f.value),c()}},f=>{!u&&!i.aborted&&o.down([[b,f]])})};return c(),()=>{u=!0,n?.removeEventListener("abort",s),a.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},Ae(r))}function $t(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function et(t,e){if($t(t))return t;if(Ht(t))return Ut(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return Wt(t,e);if(typeof n[Symbol.iterator]=="function")return Qe(t,e)}return jt(t)}function jt(...t){return Qe(t,void 0)}var tt=k(()=>{"use strict";z();Re()});var G,nt=k(()=>{"use strict";G=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});function V(t){return{describeKind:"derived",...t}}function zt(t){return t<0?0:t}function de(t){return t[1]}function rt(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function ot(t,e){return typeof t=="function"?Kt(t,e):qt(t,e)}function qt(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let a=r===void 0?null:typeof r=="string"?he(r):r;return R(s=>{let i=0,u=!1,d=null,c,f=new G;function g(){c?.(),c=void 0}function p(h){if(u)return;if(i>=o){g(),s.down([[b,h]]);return}let l=a===null?0:a(i,h,d);if(l==null){g(),s.down([[b,h]]);return}let m;try{m=rt(l)}catch{g(),s.down([[b,h]]);return}d=m,i+=1,g();let x=m>0?m/1e6:1;f.start(x,()=>{u||_()})}function _(){f.cancel(),g(),c=t.subscribe(h=>{if(!u)for(let l of h){let m=l[0];if(m===v)s.down([[v]]);else if(m===y)i=0,d=null,s.emit(l[1]);else if(m===T)s.down([[T]]);else if(m===w)g(),s.down([[w]]);else if(m===b){p(de(l));return}else s.down([l])}})}return _(),()=>{u=!0,f.cancel(),g()}},{...V(),initial:t.cache})}function Kt(t,e){let n=e?.count,r=e?.backoff,o=n!==void 0?n:r===void 0?0:2147483647;if(o<0)throw new RangeError("retry count must be >= 0");let a=r===void 0?null:typeof r=="string"?he(r):r;return R(s=>{let i=0,u=!1,d=null,c,f=new G;function g(){c?.(),c=void 0}function p(h){if(u)return;if(i>=o){g(),s.down([[b,h]]);return}let l=a===null?0:a(i,h,d);if(l==null){g(),s.down([[b,h]]);return}let m;try{m=rt(l)}catch{g(),s.down([[b,h]]);return}d=m,i+=1,g();let x=m>0?m/1e6:1;f.start(x,()=>{u||_()})}function _(){f.cancel(),g();let h;try{h=t()}catch(l){p(l);return}c=h.subscribe(l=>{if(!u)for(let m of l){let x=m[0];if(x===v)s.down([[v]]);else if(x===y)i=0,d=null,s.emit(m[1]);else if(x===T)s.down([[T]]);else if(x===w)g(),s.down([[w]]);else if(x===b){p(de(m));return}else s.down([m])}})}return _(),()=>{u=!0,f.cancel(),g()}},{...V(),initial:e?.initial})}function st(t){let e=Math.max(1,t?.failureThreshold??5),n=zt(t?.cooldownNs??30*1e9),r=t?.cooldown??null,o=Math.max(1,t?.halfOpenMax??1),a=t?.now??W,s="closed",i=0,u=0,d=0,c=n,f=0;function g(){if(!r)return n;let h=r(u);return h!==null?h:n}function p(){s="open",c=g(),d=a(),f=0}return{canExecute(){return s==="closed"?!0:s==="open"?a()-d>=c?(s="half-open",f=1,!0):!1:f<o?(f++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",i=0,u=0):s==="closed"&&(i=0)},recordFailure(h){if(s==="half-open"){u++,p();return}s==="closed"&&(i++,i>=e&&p())},get state(){return s},get failureCount(){return i},reset(){s="closed",i=0,u=0,f=0}}}function it(t,e){let n=e?.onOpen??"skip";return r=>{let o=B([],(a,s)=>{function i(){o.meta.breakerState.down([[y,t.state]])}let u=r.subscribe(d=>{for(let c of d){let f=c[0];f===v?s.down([[v]]):f===y?t.canExecute()?(i(),s.emit(c[1])):(i(),n==="error"?s.down([[b,new Me]]):s.down([[T]])):f===T?s.down([[T]]):f===w?(t.recordSuccess(),i(),s.down([[w]])):f===b?(t.recordFailure(de(c)),i(),s.down([c])):s.down([c])}});return i(),u},{...V(),meta:{breakerState:t.state},completeWhenDepsComplete:!1,initial:r.cache});return{node:o,breakerState:o.meta.breakerState}}}function Yt(t,e){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let n=t,r=W();function o(a){if(e>0){let s=a-r;n=Math.min(t,n+s/1e9*e)}r=a}return{available(){return o(W()),n},tryConsume(a=1){if(a<=0)return!0;let s=W();return o(s),n>=a?(n-=a,!0):!1},putBack(a=1){a<=0||(o(W()),n=Math.min(t,n+a))}}}function at(t,e){let{maxEvents:n,windowNs:r}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o!==void 0&&o<1)throw new RangeError("maxBuffer must be >= 1");let a=e.onOverflow??"drop-newest",s=n*1e9/r;return R(i=>{let u=Yt(n,s),d=[],c=new G,f=!1,g=1e9/s;function p(){for(;d.length>0;)if(u.tryConsume(1))i.emit(d.shift());else{c.start(Math.max(1,g/1e6),p);return}}let _=t.subscribe(h=>{for(let l of h){if(f)return;let m=l[0];if(m===v)i.down([[v]]);else if(m===y){if(o!==void 0&&d.length>=o){if(a!=="drop-newest")if(a==="drop-oldest")d.shift(),d.push(l[1]);else{f=!0,c.cancel(),d.length=0,i.down([[b,new Ce(o)]]);return}}else d.push(l[1]);p()}else if(m===T)i.down([[T]]);else if(m===w)f=!0,c.cancel(),d.length=0,i.down([[w]]);else if(m===b)f=!0,c.cancel(),d.length=0,i.down([l]);else if(m===S){f=!0,c.cancel(),d.length=0,i.down([l]);return}else i.down([l])}});return()=>{f=!0,c.cancel(),_()}},{...V(),initial:t.cache})}function ut(t,e){let n=e?.initialStatus??"pending",r=B([],(o,a)=>{let s=n;return r.meta.status.down([[y,n]]),r.meta.error.down([[y,null]]),t.subscribe(u=>{for(let d of u){let c=d[0];if(c===v)a.down([[v]]);else if(c===y)s==="errored"?be(()=>{r.meta.error.down([[y,null]]),r.meta.status.down([[y,"active"]])}):r.meta.status.down([[y,"active"]]),s="active",a.emit(d[1]);else if(c===T)a.down([[T]]);else if(c===w)r.meta.status.down([[y,"completed"]]),s="completed",a.down([[w]]);else if(c===b){let f=de(d);be(()=>{r.meta.error.down([[y,f]]),r.meta.status.down([[y,"errored"]])}),s="errored",a.down([d])}else a.down([d])}})},{...V(),meta:{status:n,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function Jt(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function Xt(t){return t!=null&&typeof t.then=="function"}function Zt(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function dt(t,e){return R(n=>{let r,o;function a(){o?.(),o=void 0,Jt(e)||Xt(e)||Zt(e)?r=et(e).subscribe(i=>{n.down(i)}):(n.emit(e),n.down([[w]]))}return o=t.subscribe(s=>{for(let i of s){let u=i[0];if(u===v)n.down([[v]]);else if(u===y)n.emit(i[1]);else if(u===T)n.down([[T]]);else if(u===w)n.down([[w]]);else if(u===b){a();return}else if(u===S){r?.(),n.down([i]);return}else n.down([i])}}),()=>{o?.(),r?.()}},{...V(),initial:t.cache})}function ct(t,e){if(e<=0)throw new RangeError("timeoutNs must be > 0");return R(n=>{let r=!1,o=new G;function a(){let i=e/1e6;o.start(i,()=>{r||(r=!0,s(),n.down([[b,new De(e)]]))})}let s=t.subscribe(i=>{for(let u of i){if(r)return;let d=u[0];if(d===v)n.down([[v]]);else if(d===y)a(),n.emit(u[1]);else if(d===T)n.down([[T]]);else if(d===w){o.cancel(),r=!0,n.down([[w]]);return}else if(d===b){o.cancel(),r=!0,n.down([u]);return}else if(d===S){o.cancel(),r=!0,n.down([u]);return}else n.down([u])}});return a(),()=>{r=!0,o.cancel(),s()}},{...V(),initial:t.cache})}var Me,Ce,De,lt=k(()=>{"use strict";ge();ye();z();ue();Re();me();tt();nt();Me=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};Ce=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};De=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var tn={};_t(tn,{NS_PER_MS:()=>A,NS_PER_SEC:()=>F,resilientPipeline:()=>en});module.exports=Tt(tn);me();lt();z();ue();function ft(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}function Qt(t,e){return ft("reduction",t,e)}function pt(t,e,n){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let r=e.map(p=>p.node),o=[t,...r],a=[],s=!1,i=!1,u=Symbol("budget-gate"),d=new Array(e.length);function c(){return e.every((p,_)=>p.check(d[_]))}function f(p){for(;a.length>0&&c();){let _=a[0];a=a.slice(1),p.emit(_)}a.length===0&&i&&(i=!1,p.down([[T]]))}return B([],(p,_)=>{for(let l=0;l<e.length;l++)d[l]=e[l].node.cache;let h=[];for(let l=0;l<o.length;l++){let m=o[l];h.push(m.subscribe(x=>{for(let E of x)g(E,l,_)}))}return()=>{for(let l of h)l()}},{...n,describeKind:"derived",meta:Qt("budget_gate",n?.meta)});function g(p,_,h){let l=p[0];if(_===0){if(l===y)return c()&&a.length===0?h.emit(p[1]):(a.push(p[1]),s||(s=!0,h.up([[O,u]]))),!0;if(l===v)return h.down([[v]]),!0;if(l===T)return a.length===0?h.down([[T]]):i=!0,!0;if(l===w||l===b){for(let m of a)h.emit(m);return a=[],i=!1,s&&(s=!1,h.up([[C,u]])),h.down([p]),!0}return!1}return l===y&&(d[_-1]=p[1]),l===y||l===T?(c()&&a.length>0?(f(h),a.length===0&&s&&(s=!1,h.up([[C,u]]))):!c()&&!s&&a.length>0&&(s=!0,h.up([[O,u]])),!0):l===v?!0:l===b?(h.down([p]),!0):l===w}}function en(t,e={}){let n=t;e.rateLimit!=null&&(n=at(n,e.rateLimit)),e.budget!=null&&e.budget.length>0&&(n=pt(n,e.budget));let r;if(e.breaker!=null){let a=st(e.breaker),s=e.breakerOnOpen??"skip",i=it(a,{onOpen:s})(n);n=i.node,r=i.breakerState}if(e.timeoutMs!=null){if(e.timeoutMs<=0)throw new RangeError("timeoutMs must be > 0");if(e.timeoutMs>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic");n=ct(n,e.timeoutMs*1e6)}e.retry!=null&&(n=ot(n,e.retry)),e.fallback!==void 0&&(n=dt(n,e.fallback));let o=ut(n,{initialStatus:e.initialStatus??"pending"});return{node:o.node,status:o.status,error:o.error,breakerState:r}}0&&(module.exports={NS_PER_MS,NS_PER_SEC,resilientPipeline});
@@ -1,7 +1,8 @@
1
- import '../../node-8qx0kgYt.cjs';
2
- export { N as NS_PER_MS, c as NS_PER_SEC } from '../../resilience-N_VtLf7W.cjs';
3
- import '../../index-yJY9thRY.cjs';
4
- export { R as ResilientPipelineBundle, a as ResilientPipelineOptions, r as resilientPipeline } from '../../index-Ds3Rz9m9.cjs';
5
- import '../../graph-DaoydJ_u.cjs';
6
- import '../../meta-BdjSt8ky.cjs';
1
+ import '../../node-fSc-hCv8.cjs';
2
+ export { N as NS_PER_MS, c as NS_PER_SEC } from '../../resilience-BWP2c7Af.cjs';
3
+ import '../../index-XxSeddWP.cjs';
4
+ export { R as ResilientPipelineBundle, a as ResilientPipelineOptions, r as resilientPipeline } from '../../index-BsZlbHM5.cjs';
5
+ import '../../graph-kTltt95s.cjs';
6
+ import '../../meta-BGO6C7K9.cjs';
7
7
  import '../../extra/storage-core.cjs';
8
+ import '../../extra/storage-tiers.cjs';
@@ -1,7 +1,8 @@
1
- import '../../node-8qx0kgYt.js';
2
- export { N as NS_PER_MS, c as NS_PER_SEC } from '../../resilience-RjDIHZNZ.js';
3
- import '../../index-DheNs40A.js';
4
- export { R as ResilientPipelineBundle, a as ResilientPipelineOptions, r as resilientPipeline } from '../../index-D80nGRb9.js';
5
- import '../../graph-BROUZPG9.js';
6
- import '../../meta-CtDjj7cU.js';
1
+ import '../../node-fSc-hCv8.js';
2
+ export { N as NS_PER_MS, c as NS_PER_SEC } from '../../resilience-Bys63Cpd.js';
3
+ import '../../index-DXSLMoma.js';
4
+ export { R as ResilientPipelineBundle, a as ResilientPipelineOptions, r as resilientPipeline } from '../../index-DzYTXMBz.js';
5
+ import '../../graph-Cv-8x0ZI.js';
6
+ import '../../meta-CC6EPdpK.js';
7
7
  import '../../extra/storage-core.js';
8
+ import '../../extra/storage-tiers.js';
@@ -1 +1 @@
1
- import{a as c}from"../../chunk-55T3K37W.js";import"../../chunk-PBN426RU.js";import"../../chunk-L3KUKDZC.js";import"../../chunk-FKRPIRE6.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-2JO6LXFT.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-4F564IPP.js";import{a,b}from"../../chunk-4VVTGLXJ.js";import"../../chunk-T7EQPKOP.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{a as NS_PER_MS,b as NS_PER_SEC,c as resilientPipeline};
1
+ import{a as c}from"../../chunk-YV2A2VWG.js";import"../../chunk-ZGVA2SR5.js";import"../../chunk-O32GJOUJ.js";import"../../chunk-A5HZZYRK.js";import"../../chunk-5KPIYVCC.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-JJTF75VS.js";import{a,b}from"../../chunk-4VVTGLXJ.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{a as NS_PER_MS,b as NS_PER_SEC,c as resilientPipeline};