@graphrefly/graphrefly 0.28.0 → 0.30.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 (284) hide show
  1. package/dist/{cascading-D9WG1-9L.d.ts → cascading-BszPheHD.d.ts} +1 -1
  2. package/dist/{cascading-B-5zmAUv.d.cts → cascading-dNCtjW8j.d.cts} +1 -1
  3. package/dist/{chunk-OAWLCNJJ.js → chunk-2GQREQ6C.js} +1 -1
  4. package/dist/{chunk-DBGGMN3D.js → chunk-33FA6V4B.js} +1 -1
  5. package/dist/chunk-3NEPQO2E.js +43 -0
  6. package/dist/{chunk-UWJE5FQA.js → chunk-4C2OR2GH.js} +11 -11
  7. package/dist/chunk-4JJCCD5S.js +2 -0
  8. package/dist/{chunk-GHJJR5P4.js → chunk-4OFIQ66T.js} +1 -1
  9. package/dist/{chunk-PIOGHC63.js → chunk-567NWZ3T.js} +1 -1
  10. package/dist/chunk-5JDE5JHE.js +1 -0
  11. package/dist/{chunk-ETWTCCJI.js → chunk-5Z4HDCO6.js} +1 -1
  12. package/dist/{chunk-Y2EMPB3I.js → chunk-73Z3W2RN.js} +1 -1
  13. package/dist/{chunk-CRXTH3SH.js → chunk-7JDLFI6N.js} +1 -1
  14. package/dist/{chunk-DQA3UIQ2.js → chunk-7TDOES3L.js} +1 -1
  15. package/dist/{chunk-LBTDSCCO.js → chunk-AMBYCIOH.js} +1 -1
  16. package/dist/{chunk-D7A7DBE4.js → chunk-AUY2YKCO.js} +1 -1
  17. package/dist/{chunk-FNYWM6JC.js → chunk-AV3PIDFQ.js} +1 -1
  18. package/dist/{chunk-UMBIDLJ4.js → chunk-BA5URFYW.js} +1 -1
  19. package/dist/chunk-BKPLTBL5.js +1 -0
  20. package/dist/{chunk-UPXUCFMX.js → chunk-BZP5T4X6.js} +1 -1
  21. package/dist/{chunk-WQ2BN6X6.js → chunk-DDPYNMGG.js} +1 -1
  22. package/dist/{chunk-LQ3Y5NJS.js → chunk-GJR3P6JG.js} +1 -1
  23. package/dist/{chunk-3R5HFPX7.js → chunk-GLSM33ZM.js} +1 -1
  24. package/dist/{chunk-2FOAM3OR.js → chunk-GNCBXARM.js} +1 -1
  25. package/dist/{chunk-K2GNMCQT.js → chunk-ISCENNXS.js} +1 -1
  26. package/dist/{chunk-UPHHLMHE.js → chunk-IUK4EFCE.js} +1 -1
  27. package/dist/{chunk-ERLIRFPA.js → chunk-KA6MMXIY.js} +1 -1
  28. package/dist/{chunk-2PMCKKRK.js → chunk-KASHOCF5.js} +1 -1
  29. package/dist/chunk-LI3E75VE.js +64 -0
  30. package/dist/chunk-MGKAO4EK.js +7 -0
  31. package/dist/{chunk-ZV2DXV5A.js → chunk-NSG4C6BF.js} +1 -1
  32. package/dist/{chunk-4GKB4OUJ.js → chunk-OL33ZI6R.js} +1 -1
  33. package/dist/{chunk-76A3HVQE.js → chunk-P7JXGKDO.js} +1 -1
  34. package/dist/{chunk-U3AICJKU.js → chunk-RD52SNH2.js} +1 -1
  35. package/dist/{chunk-CWLN3X3N.js → chunk-SHYH5SXV.js} +1 -1
  36. package/dist/{chunk-VTPVOGHH.js → chunk-SLMYTGTU.js} +1 -1
  37. package/dist/{chunk-OYHGKYQM.js → chunk-T5SHIKJD.js} +1 -1
  38. package/dist/{chunk-VPYBOXVT.js → chunk-TWMEGG45.js} +1 -1
  39. package/dist/chunk-VIEUJSTT.js +1 -0
  40. package/dist/{chunk-SC3U7ETD.js → chunk-VWPRPPKR.js} +1 -1
  41. package/dist/chunk-W4TSQ6RJ.js +1 -0
  42. package/dist/{chunk-OBKQQA5I.js → chunk-WANIEEKV.js} +1 -1
  43. package/dist/{chunk-XAUNPIMX.js → chunk-XHVB6G6M.js} +1 -1
  44. package/dist/{chunk-MIQTDPY4.js → chunk-XQAXYVXX.js} +1 -1
  45. package/dist/{chunk-MTTAAPCK.js → chunk-Y32RJO24.js} +1 -1
  46. package/dist/{chunk-S35VARIR.js → chunk-Y36UZ5VS.js} +1 -1
  47. package/dist/compat/index.cjs +13 -12
  48. package/dist/compat/index.d.cts +14 -14
  49. package/dist/compat/index.d.ts +14 -14
  50. package/dist/compat/index.js +1 -1
  51. package/dist/compat/jotai/index.cjs +1 -1
  52. package/dist/compat/jotai/index.d.cts +2 -2
  53. package/dist/compat/jotai/index.d.ts +2 -2
  54. package/dist/compat/jotai/index.js +1 -1
  55. package/dist/compat/nanostores/index.cjs +1 -1
  56. package/dist/compat/nanostores/index.d.cts +2 -2
  57. package/dist/compat/nanostores/index.d.ts +2 -2
  58. package/dist/compat/nanostores/index.js +1 -1
  59. package/dist/compat/nestjs/index.cjs +13 -12
  60. package/dist/compat/nestjs/index.d.cts +6 -6
  61. package/dist/compat/nestjs/index.d.ts +6 -6
  62. package/dist/compat/nestjs/index.js +1 -1
  63. package/dist/compat/react/index.d.cts +2 -2
  64. package/dist/compat/react/index.d.ts +2 -2
  65. package/dist/compat/solid/index.d.cts +2 -2
  66. package/dist/compat/solid/index.d.ts +2 -2
  67. package/dist/compat/svelte/index.d.cts +2 -2
  68. package/dist/compat/svelte/index.d.ts +2 -2
  69. package/dist/compat/vue/index.d.cts +2 -2
  70. package/dist/compat/vue/index.d.ts +2 -2
  71. package/dist/compat/zustand/index.cjs +7 -6
  72. package/dist/compat/zustand/index.d.cts +4 -4
  73. package/dist/compat/zustand/index.d.ts +4 -4
  74. package/dist/compat/zustand/index.js +1 -1
  75. package/dist/{composite-BhbKHbOS.d.ts → composite-DGspwCqk.d.ts} +2 -2
  76. package/dist/{composite-B-xqw4Kk.d.cts → composite-nrRumJ7l.d.cts} +2 -2
  77. package/dist/core/index.cjs +1 -1
  78. package/dist/core/index.d.cts +4 -4
  79. package/dist/core/index.d.ts +4 -4
  80. package/dist/core/index.js +1 -1
  81. package/dist/extra/browser.cjs +1 -1
  82. package/dist/extra/browser.d.cts +1 -1
  83. package/dist/extra/browser.d.ts +1 -1
  84. package/dist/extra/browser.js +1 -1
  85. package/dist/extra/index.cjs +20 -19
  86. package/dist/extra/index.d.cts +9 -9
  87. package/dist/extra/index.d.ts +9 -9
  88. package/dist/extra/index.js +1 -1
  89. package/dist/extra/node.cjs +3 -3
  90. package/dist/extra/node.d.cts +1 -1
  91. package/dist/extra/node.d.ts +1 -1
  92. package/dist/extra/node.js +1 -1
  93. package/dist/extra/operators.cjs +1 -1
  94. package/dist/extra/operators.d.cts +1 -1
  95. package/dist/extra/operators.d.ts +1 -1
  96. package/dist/extra/operators.js +1 -1
  97. package/dist/extra/reactive.cjs +1 -1
  98. package/dist/extra/reactive.d.cts +3 -3
  99. package/dist/extra/reactive.d.ts +3 -3
  100. package/dist/extra/reactive.js +1 -1
  101. package/dist/extra/sources.cjs +1 -1
  102. package/dist/extra/sources.d.cts +1 -1
  103. package/dist/extra/sources.d.ts +1 -1
  104. package/dist/extra/sources.js +1 -1
  105. package/dist/extra/storage-browser.cjs +1 -1
  106. package/dist/extra/storage-browser.d.cts +1 -1
  107. package/dist/extra/storage-browser.d.ts +1 -1
  108. package/dist/extra/storage-browser.js +1 -1
  109. package/dist/graph/index.cjs +7 -6
  110. package/dist/graph/index.d.cts +5 -5
  111. package/dist/graph/index.d.ts +5 -5
  112. package/dist/graph/index.js +1 -1
  113. package/dist/{graph-D48Qw9Cg.d.cts → graph-C4Uxwv0T.d.cts} +22 -6
  114. package/dist/{graph-BZGRXwOm.d.ts → graph-CWeI0aHd.d.ts} +22 -6
  115. package/dist/{index-u15meRxL.d.cts → index-9iguV3bF.d.cts} +2 -2
  116. package/dist/{index-DyxjtScX.d.cts → index-B-z8WaSd.d.cts} +2 -2
  117. package/dist/{index-BgyGlizc.d.ts → index-B2HBxvMb.d.ts} +4 -4
  118. package/dist/{index-CzobVSMr.d.ts → index-B5iVOD7w.d.ts} +2 -2
  119. package/dist/{index-rX8HBM5h.d.cts → index-B8Aj_z8S.d.cts} +2 -2
  120. package/dist/{index-D-YB-Vl3.d.ts → index-BANwzwBV.d.ts} +3 -3
  121. package/dist/{index-HDpJe9hX.d.ts → index-BBINVimG.d.ts} +3 -3
  122. package/dist/{index-8FSVk4Uf.d.ts → index-BEpRsvhg.d.ts} +4 -4
  123. package/dist/{index-CHEswufn.d.cts → index-BHu_Wba0.d.cts} +4 -4
  124. package/dist/{index-ZftwfxJM.d.ts → index-BJHQUCZx.d.ts} +7 -7
  125. package/dist/{index-DUqMOlKZ.d.cts → index-BS220yqj.d.cts} +7 -7
  126. package/dist/{index-BWJV63ti.d.ts → index-BX22kvjh.d.ts} +1 -1
  127. package/dist/{index-DfyOkTvs.d.ts → index-BXbQUn4n.d.ts} +2 -2
  128. package/dist/{index-O6TgGUBV.d.cts → index-BpFWP7Bq.d.cts} +3 -3
  129. package/dist/{index-BxJ86YZZ.d.cts → index-Bs3-LC83.d.cts} +3 -3
  130. package/dist/{index-DiOXyAwt.d.ts → index-Bvi5uJxX.d.ts} +1 -1
  131. package/dist/{index-Bqachn9_.d.ts → index-ByPnK85n.d.ts} +1 -1
  132. package/dist/{index-CRO83MmV.d.cts → index-BydMDMf7.d.cts} +1 -1
  133. package/dist/{index-ROpQmGjE.d.ts → index-C5Ghnp5B.d.ts} +3 -3
  134. package/dist/{index-umtoWT8K.d.ts → index-C6NBfXj-.d.ts} +6 -5
  135. package/dist/{index-pXrDMpRO.d.cts → index-C98oJsEs.d.cts} +2 -2
  136. package/dist/{index-B2pwesl9.d.cts → index-CDK5RsV5.d.cts} +1 -1
  137. package/dist/{index-Czq6ynh8.d.ts → index-CFW32Dy1.d.ts} +3 -3
  138. package/dist/{index-Cyojz0AE.d.cts → index-CIXaiYDE.d.cts} +1 -1
  139. package/dist/{index-Oi8d8w4R.d.cts → index-CRAkoq-y.d.cts} +1 -1
  140. package/dist/{index-CpgYhnrG.d.ts → index-Cc8VQIgL.d.ts} +2 -2
  141. package/dist/{index-vscRDkjW.d.cts → index-CcpEvuPl.d.cts} +2 -2
  142. package/dist/{index-BpA5c4G9.d.ts → index-CfFYyLR8.d.ts} +4 -4
  143. package/dist/{index-9oDeHH2u.d.cts → index-ClB7TCfL.d.cts} +2 -2
  144. package/dist/{index-BHvIquRZ.d.ts → index-ClgKmOHe.d.ts} +592 -492
  145. package/dist/{index-DpHe5e0Q.d.ts → index-CotRMjtJ.d.ts} +2 -2
  146. package/dist/{index-B1AmmSlb.d.ts → index-CrC7urhX.d.ts} +1 -1
  147. package/dist/{index-B0c4cmIO.d.ts → index-CvS9IuTG.d.ts} +2 -2
  148. package/dist/{index-rHJSKsU8.d.cts → index-Cy7eFeIX.d.cts} +2 -2
  149. package/dist/{index-BVHOrDwO.d.ts → index-D0C_USMR.d.ts} +1 -1
  150. package/dist/{index-DEwTb_fm.d.cts → index-D6ajK8Mh.d.cts} +592 -492
  151. package/dist/{index-DL-rYJrx.d.cts → index-D7XxY1Ff.d.cts} +1 -1
  152. package/dist/{index-DAlweici.d.ts → index-D9HrBx2J.d.ts} +2 -2
  153. package/dist/{index-fM6y00vT.d.cts → index-D9Y_u6BG.d.cts} +3 -3
  154. package/dist/{index-DcXZBF5a.d.cts → index-DBQUKh59.d.cts} +4 -4
  155. package/dist/{index-D_NwnRYS.d.cts → index-DDo-eqQ4.d.cts} +1 -1
  156. package/dist/{index-m-yHof5p.d.ts → index-DGb1awva.d.ts} +4 -4
  157. package/dist/{index-DxsnAMWD.d.cts → index-DR3gf_DG.d.cts} +9 -9
  158. package/dist/{index-dtN7YA2x.d.cts → index-DVNLe3pS.d.cts} +3 -3
  159. package/dist/{index-Btib9rsU.d.ts → index-Dljd76bC.d.ts} +275 -9
  160. package/dist/{index-DP4ZTkdw.d.ts → index-DnrZghBB.d.ts} +3 -3
  161. package/dist/{index-DaLJvH8Z.d.ts → index-Docdiu9a.d.ts} +3 -3
  162. package/dist/{index-BpIFjILY.d.cts → index-DylQCKEL.d.cts} +4 -4
  163. package/dist/{index-B_agccPe.d.cts → index-FBqTfL_S.d.cts} +1 -1
  164. package/dist/{index-DraikLjn.d.ts → index-FrYrV-Vf.d.ts} +2 -2
  165. package/dist/{index-sm373fsH.d.ts → index-IZ3l_vQ9.d.ts} +2 -2
  166. package/dist/{index-BwM9BEkt.d.ts → index-Ip3q9T9x.d.ts} +1 -1
  167. package/dist/{index-CloUk1kY.d.ts → index-RQg6lTrN.d.ts} +9 -9
  168. package/dist/{index-CEXXwWVH.d.cts → index-SSGqF8mI.d.cts} +2 -2
  169. package/dist/{index-rnwQly8X.d.cts → index-UZO988ox.d.cts} +6 -5
  170. package/dist/{index-C73n7lo-.d.cts → index-iBp74eGU.d.cts} +3 -3
  171. package/dist/{index-tbf2gKHd.d.cts → index-lKuLYmHO.d.cts} +3 -3
  172. package/dist/{index-CMn8S8Hw.d.ts → index-wIx1Jisk.d.ts} +1 -1
  173. package/dist/{index-cByzxQIC.d.cts → index-yIdWFo2b.d.cts} +4 -4
  174. package/dist/{index-RukJ4DLS.d.cts → index-ybtSyjWB.d.cts} +275 -9
  175. package/dist/index.cjs +53 -52
  176. package/dist/index.d.cts +42 -42
  177. package/dist/index.d.ts +42 -42
  178. package/dist/index.js +1 -1
  179. package/dist/{meta-CwesDrMD.d.ts → meta-BMwx3ExI.d.ts} +1 -1
  180. package/dist/{meta-Cgj6zeji.d.cts → meta-COtmHLwT.d.cts} +1 -1
  181. package/dist/{node-Cc1TniY8.d.ts → node-BVV7G1bq.d.cts} +59 -2
  182. package/dist/{node-Cc1TniY8.d.cts → node-BVV7G1bq.d.ts} +59 -2
  183. package/dist/{observable-glXQoGj2.d.cts → observable-BrUAPeH_.d.cts} +1 -1
  184. package/dist/{observable-Ct-gJ9jI.d.ts → observable-ITikPXz3.d.ts} +1 -1
  185. package/dist/patterns/ai/browser.d.cts +3 -3
  186. package/dist/patterns/ai/browser.d.ts +3 -3
  187. package/dist/patterns/ai/browser.js +1 -1
  188. package/dist/patterns/ai/index.cjs +25 -24
  189. package/dist/patterns/ai/index.d.cts +15 -15
  190. package/dist/patterns/ai/index.d.ts +15 -15
  191. package/dist/patterns/ai/index.js +1 -1
  192. package/dist/patterns/ai/node.d.cts +1 -1
  193. package/dist/patterns/ai/node.d.ts +1 -1
  194. package/dist/patterns/ai/node.js +1 -1
  195. package/dist/patterns/audit/index.cjs +7 -6
  196. package/dist/patterns/audit/index.d.cts +5 -5
  197. package/dist/patterns/audit/index.d.ts +5 -5
  198. package/dist/patterns/audit/index.js +1 -1
  199. package/dist/patterns/cqrs/index.cjs +7 -6
  200. package/dist/patterns/cqrs/index.d.cts +4 -4
  201. package/dist/patterns/cqrs/index.d.ts +4 -4
  202. package/dist/patterns/cqrs/index.js +1 -1
  203. package/dist/patterns/demo-shell/index.cjs +8 -7
  204. package/dist/patterns/demo-shell/index.d.cts +5 -5
  205. package/dist/patterns/demo-shell/index.d.ts +5 -5
  206. package/dist/patterns/demo-shell/index.js +1 -1
  207. package/dist/patterns/domain-templates/index.cjs +7 -6
  208. package/dist/patterns/domain-templates/index.d.cts +4 -4
  209. package/dist/patterns/domain-templates/index.d.ts +4 -4
  210. package/dist/patterns/domain-templates/index.js +1 -1
  211. package/dist/patterns/graphspec/index.cjs +26 -25
  212. package/dist/patterns/graphspec/index.d.cts +4 -4
  213. package/dist/patterns/graphspec/index.d.ts +4 -4
  214. package/dist/patterns/graphspec/index.js +1 -1
  215. package/dist/patterns/guarded-execution/index.cjs +7 -6
  216. package/dist/patterns/guarded-execution/index.d.cts +6 -6
  217. package/dist/patterns/guarded-execution/index.d.ts +6 -6
  218. package/dist/patterns/guarded-execution/index.js +1 -1
  219. package/dist/patterns/harness/index.cjs +11 -10
  220. package/dist/patterns/harness/index.d.cts +10 -7
  221. package/dist/patterns/harness/index.d.ts +10 -7
  222. package/dist/patterns/harness/index.js +1 -1
  223. package/dist/patterns/job-queue/index.cjs +7 -6
  224. package/dist/patterns/job-queue/index.d.cts +4 -4
  225. package/dist/patterns/job-queue/index.d.ts +4 -4
  226. package/dist/patterns/job-queue/index.js +1 -1
  227. package/dist/patterns/lens/index.cjs +7 -6
  228. package/dist/patterns/lens/index.d.cts +6 -6
  229. package/dist/patterns/lens/index.d.ts +6 -6
  230. package/dist/patterns/lens/index.js +1 -1
  231. package/dist/patterns/memory/index.cjs +7 -6
  232. package/dist/patterns/memory/index.d.cts +4 -4
  233. package/dist/patterns/memory/index.d.ts +4 -4
  234. package/dist/patterns/memory/index.js +1 -1
  235. package/dist/patterns/messaging/index.cjs +7 -6
  236. package/dist/patterns/messaging/index.d.cts +4 -4
  237. package/dist/patterns/messaging/index.d.ts +4 -4
  238. package/dist/patterns/messaging/index.js +1 -1
  239. package/dist/patterns/orchestration/index.cjs +7 -6
  240. package/dist/patterns/orchestration/index.d.cts +5 -5
  241. package/dist/patterns/orchestration/index.d.ts +5 -5
  242. package/dist/patterns/orchestration/index.js +1 -1
  243. package/dist/patterns/reactive-layout/index.cjs +8 -7
  244. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  245. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  246. package/dist/patterns/reactive-layout/index.js +1 -1
  247. package/dist/patterns/reduction/index.cjs +7 -6
  248. package/dist/patterns/reduction/index.d.cts +4 -4
  249. package/dist/patterns/reduction/index.d.ts +4 -4
  250. package/dist/patterns/reduction/index.js +1 -1
  251. package/dist/patterns/refine-loop/index.cjs +9 -8
  252. package/dist/patterns/refine-loop/index.d.cts +5 -5
  253. package/dist/patterns/refine-loop/index.d.ts +5 -5
  254. package/dist/patterns/refine-loop/index.js +1 -1
  255. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  256. package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
  257. package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
  258. package/dist/patterns/resilient-pipeline/index.js +1 -1
  259. package/dist/patterns/surface/index.cjs +14 -13
  260. package/dist/patterns/surface/index.d.cts +5 -5
  261. package/dist/patterns/surface/index.d.ts +5 -5
  262. package/dist/patterns/surface/index.js +1 -1
  263. package/dist/{reactive-layout-CpYb5qLP.d.cts → reactive-layout-5oEn8lHM.d.cts} +2 -2
  264. package/dist/{reactive-layout-D8u4wuUR.d.ts → reactive-layout-BAr6-_o5.d.ts} +2 -2
  265. package/dist/{reactive-log-DPzuUDj5.d.cts → reactive-log-5jFeNRmd.d.cts} +1 -1
  266. package/dist/{reactive-log-YuH9VYN8.d.ts → reactive-log-BOJDCI5x.d.ts} +1 -1
  267. package/dist/{reactive-map-CdbNoSgP.d.ts → reactive-map-BvDrRuwt.d.ts} +1 -1
  268. package/dist/{reactive-map-DUeRmb9d.d.cts → reactive-map-CmlPPKHN.d.cts} +1 -1
  269. package/dist/{resilience-CGRzhnD3.d.ts → resilience-CludlzcP.d.ts} +1 -1
  270. package/dist/{resilience-Ba5-b4WD.d.cts → resilience-Q6Bt_7y0.d.cts} +1 -1
  271. package/dist/{resilience-QAHKANT5.js → resilience-XRUF267O.js} +1 -1
  272. package/dist/{sugar-BV0htudb.d.cts → sugar-BHbAACDG.d.ts} +10 -12
  273. package/dist/{sugar-Dtyrq2_q.d.ts → sugar-CqR6DJ7v.d.cts} +10 -12
  274. package/dist/{topology-tree-DROUdq5B.d.cts → topology-tree-CVREibAc.d.cts} +1 -1
  275. package/dist/{topology-tree-CYHOwQZ_.d.ts → topology-tree-CkjojcB6.d.ts} +1 -1
  276. package/package.json +1 -1
  277. package/dist/chunk-6V3SEX2I.js +0 -1
  278. package/dist/chunk-7H6LGFUG.js +0 -64
  279. package/dist/chunk-CKCSDI7T.js +0 -6
  280. package/dist/chunk-QWAPKG3O.js +0 -2
  281. package/dist/chunk-RHESUC3V.js +0 -43
  282. package/dist/chunk-V6YQICXZ.js +0 -1
  283. package/dist/chunk-Z4HDAS2Q.js +0 -1
  284. package/dist/chunk-ZB5EHBIO.js +0 -1
@@ -1 +1 @@
1
- "use strict";var K=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var Re=(t,e)=>{for(var n in e)K(t,n,{get:e[n],enumerable:!0})},Ce=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!Oe.call(t,r)&&r!==n&&K(t,r,{get:()=>e[r],enumerable:!(s=Se(e,r))||s.enumerable});return t};var Ie=t=>Ce(K({},"__esModule",{value:!0}),t);var Ze={};Re(Ze,{fromIDBRequest:()=>Ye,fromIDBTransaction:()=>Ke,indexedDbStorage:()=>Xe});module.exports=Ie(Ze);var G=Symbol.for("graphrefly/START"),_=Symbol.for("graphrefly/DATA"),A=Symbol.for("graphrefly/DIRTY"),E=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),S=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),v=Symbol.for("graphrefly/COMPLETE"),h=Symbol.for("graphrefly/ERROR"),D=Object.freeze([A]),J=Object.freeze([E]),Fe=Object.freeze([M]),X=Object.freeze([G]),Ge=Object.freeze([v]),He=Object.freeze([N]),Z=Object.freeze([D]),le=Object.freeze([J]),ce=Object.freeze([Fe]),ue=Object.freeze([Ge]),Q=Object.freeze([He]);var Le={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 fe(t){t.registerCodec(Le)}var Ve={type:"system",id:""};function B(t){if(t==null)return Ve;let{type:e,id:n,...s}=t;return{type:e??"system",id:n??"",...s}}var ee=0,Pe=!1,he=[],pe=[],ge=[],Be=[];function _e(){return ee>0||Pe}function ye(){return ee>0}function me(t){ee>0?Be.push(t):t()}function U(t,e,n){if(e.length===0)return;if(e.length===1){let l=n(e[0][0]);if(l<3||!_e()){t(e);return}(l>=5?ge:l===4?pe:he).push(()=>t(e));return}let s=e.length,r=s,o=s,i=s,a=0;for(;a<s&&n(e[a][0])<3;)a++;for(r=a;a<s&&n(e[a][0])===3;)a++;for(o=a;a<s&&n(e[a][0])===4;)a++;i=a;let d=_e();if(r>0){let l=e.slice(0,r);t(l)}if(o>r){let l=e.slice(r,o);d?he.push(()=>t(l)):t(l)}if(i>o){let l=e.slice(o,i);d?pe.push(()=>t(l)):t(l)}if(s>i){let l=e.slice(i,s);d?ge.push(()=>t(l)):t(l)}}function be(){return Date.now()*1e6}var W=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_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 s=this._messageTypes.get(n);return s!=null?s.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}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.")}};function ve(t){t.registerMessageType(G,{tier:0,wireCrossing:!1}),t.registerMessageType(A,{tier:1,wireCrossing:!1}),t.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(S,{tier:2,wireCrossing:!1}),t.registerMessageType(H,{tier:2,wireCrossing:!1}),t.registerMessageType(_,{tier:3,wireCrossing:!0}),t.registerMessageType(E,{tier:3,wireCrossing:!0}),t.registerMessageType(v,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(h,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(N,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var O=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 ne(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(ne);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=ne(t[n]);return e}return null}var Ue=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]),We=new TextEncoder;function je(t){let e=We.encode(t),n=e.length,s=n*8,r=n+9+63&-64,o=new Uint8Array(r);o.set(e),o[n]=128;let i=new DataView(o.buffer);i.setUint32(r-4,s>>>0,!1),i.setUint32(r-8,Math.floor(s/4294967296)>>>0,!1);let a=1779033703,d=3144134277,l=1013904242,c=2773480762,u=1359893119,f=2600822924,g=528734635,y=1541459225,k=new Uint32Array(64),b=(x,m)=>x>>>m|x<<32-m;for(let x=0;x<r;x+=64){for(let p=0;p<16;p++)k[p]=i.getUint32(x+p*4,!1);for(let p=16;p<64;p++){let I=k[p-15],F=k[p-2],P=b(I,7)^b(I,18)^I>>>3,Y=b(F,17)^b(F,19)^F>>>10;k[p]=k[p-16]+P+k[p-7]+Y>>>0}let m=a,R=d,C=l,$=c,T=u,L=f,V=g,q=y;for(let p=0;p<64;p++){let I=b(T,6)^b(T,11)^b(T,25),F=T&L^~T&V,P=q+I+F+Ue[p]+k[p]>>>0,Y=b(m,2)^b(m,13)^b(m,22),Ee=m&R^m&C^R&C,Me=Y+Ee>>>0;q=V,V=L,L=T,T=$+P>>>0,$=C,C=R,R=m,m=P+Me>>>0}a=a+m>>>0,d=d+R>>>0,l=l+C>>>0,c=c+$>>>0,u=u+T>>>0,f=f+L>>>0,g=g+V>>>0,y=y+q>>>0}let w=x=>x.toString(16).padStart(8,"0");return w(a)+w(d)+w(l)+w(c)+w(u)+w(f)+w(g)+w(y)}function te(t){let e=ne(t??null),n=JSON.stringify(e);return je(n).slice(0,16)}function ze(){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 se(t,e,n){let s=n?.id??ze();if(t===0)return{id:s,version:0};let o=(n?.hash??te)(e);return{id:s,version:0,cid:o,prev:null}}function we(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var xe=()=>{},Te=100;function Ne(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function re(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function j(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}var $e=(t,e,n,s)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},qe=(t,e,n,s)=>{let r=t;if(r._status==="completed"||r._status==="errored")return;let o=r._cached,i=o===void 0?[X]:[X,[_,o]];r._status==="dirty"&&i.push(D),U(e,i,r._config.tierOf)},ie=new W({onMessage:$e,onSubscribe:qe});ve(ie);fe(ie);var z=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;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,s){this._config=s.config??ie,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=n,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??te;let r=s.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?se(r,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Ne);let o={};for(let[a,d]of Object.entries(s.meta??{})){let l={initial:d,name:`${s.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};s.guard!=null&&(l.guard=s.guard),o[a]=new t([],void 0,l)}Object.freeze(o),this.meta=o,this._hasMeta=Object.keys(o).length>0;let i=this;this._actions={emit(a){i._emit([[_,a]])},down(a){i._emit(j(a))},up(a){i._emitUp(j(a))}},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 s=this._versioningLevel;if(s!=null&&e<=s)return;let r=n?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let o=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??n?.id,d=i?.version??0,l=se(e,o,{id:a,hash:r});l.version=d,this._versioning=l,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=B(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!n&&!s)return;let r=B(e?.actor),o=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,o))throw new O({actor:r,action:o,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(r,o))throw new O({actor:r,action:o,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:be()}}down(e,n){let s=j(e);s.length!==0&&(this._checkGuard(n),this._emit(s))}emit(e,n){this._checkGuard(n),this._emit([[_,e]])}up(e,n){if(this._deps.length===0)return;let s=j(e);if(s.length===0)return;this._checkGuard(n);let r=n??{internal:!0};this._validateUpTiers(s);for(let o of this._deps)o.node.up?.(s,r)}_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 s of e){let r=n(s[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} 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 d=B(n);if(!this._guard(d,"observe"))throw new O({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){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 d of this._deps)re(d)}this._sinkCount+=1;let o;try{o=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof o=="function")try{o()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof o=="function"&&o(),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 s=0;s<e;s++){let r=s,o=this._deps[s];o.unsub=xe,o.unsub=o.node.subscribe(i=>{if(o.unsub===null)return;let a=this._config.tierOf,d=!1;for(let l of i)a(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),n++}}catch(s){this._deps[n].unsub=null;for(let r=0;r<n;r++){let o=this._deps[r];if(o.unsub!=null){let i=o.unsub;o.unsub=null;try{i()}catch{}re(o)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let n=this._deps.length,s=Ne(e);if(this._deps.push(s),this._sinks==null)return n;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z),s.unsub=xe;try{s.unsub=e.subscribe(r=>{if(s.unsub===null)return;let o=this._config.tierOf,i=!1;for(let a of r)o(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(r){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(s){this._emit([[h,this._wrapFnError("cleanup threw",s)]])}else if(n!=null&&typeof n=="object"){let s=n.deactivate;if(typeof s=="function")try{s()}catch(r){this._emit([[h,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let s of this._deps){if(s.unsub!=null){let r=s.unsub;s.unsub=null;try{r()}catch{}}re(s)}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 s=this._deps[e],r=n[0];if(this._inspectorHooks!=null){let o={kind:"dep_message",depIndex:e,message:n};for(let i of this._inspectorHooks)i(o)}if(r!==G){if(r===A){this._depDirtied(s);return}if(r===M){this._depInvalidated(s),this._emit(ce);return}if(r===S||r===H){this._emit([n]);return}if(r===N){this._emit(Q);return}if(r===_)this._depSettledAsData(s,n[1]);else if(r===E)this._depSettledAsResolved(s);else if(r===v)this._depSettledAsTerminal(s,!0);else if(r===h)this._depSettledAsTerminal(s,n[1]);else{this._emit([n]);return}if(!this._fn){(r===_||r===E)&&this._emit([n]),(r===v||r===h)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z))}_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._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(le),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([[h,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(ue)}_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(i){this._emit([[h,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(a){this._emit([[h,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),s=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=n[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let r=this._deps.map(i=>i.terminal),o={prevData:s,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:n,prevData:s};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(n,this._actions,o);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let a=i;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[h,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Te?(this._rerunDepth=0,this._emit([[h,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Te} \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 s=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[D,e[0]]:e;let s=!0,r=!1,o=!1,i=-1;for(let d of e){let l=n(d[0]);l<i&&(s=!1),l===3&&(r=!0),d[0]===A&&(o=!0),i=l}let a=e;if(!s){let d=e.map((l,c)=>({m:l,i:c,tier:n(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),a=d.map(l=>l.m)}if(r&&!o&&this._status!=="dirty"){let d=0;for(;d<a.length&&n(a[d][0])===0;)d++;return d===0?[D,...a]:[...a.slice(0,d),D,...a.slice(d)]}return a}_emit(e){if(e.length===0)return;let n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(d=>d[0]===N||d[0]===M);if(a.length===0)return;n=a}n=this._frameBatch(n);let r=null;for(let a=0;a<n.length;a++){let d=n[a],l=d[0];if(l!==S&&l!==H){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===S?"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 u=d[1];if(l===S)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))c=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let f=this._pauseBuffer;this._pauseBuffer=[],this._emit(f)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(d):r==null&&(r=n.slice(0,a))}if(r!=null){if(r.length===0)return;n=r}if(this._hasMeta&&n.some(a=>a[0]===N))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Q)}catch{}let{finalMessages:o,equalsError:i}=this._updateState(n);if(o.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:o})}catch{}}if(o.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,d=[];for(let l of o){let c=a(l[0]);c<3||c===5?d.push(l):this._pauseBuffer.push(l)}d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(o);i!=null&&this._emit([[h,i]])}_updateState(e){let n=this._config.tierOf,s,r,o=-1,i=0;for(let c of e)n(c[0])===3&&i++;let a=i<=1,d=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===_){d=c;break}}for(let c=0;c<e.length;c++){let u=e[c],f=u[0];if(f===_){if(u.length>=2){let g=!1;if(a&&this._cached!==void 0)try{g=this._equals(this._cached,u[1])}catch(y){r=this._wrapFnError("equals threw",y),o=c;break}if(g){s==null&&(s=e.slice(0,c)),s.push(J),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(d<0||c===d)&&we(this._versioning,u[1],this._hashFn)}this._status="settled",s?.push(u)}else if(s?.push(u),f===A)this._status="dirty";else if(f===E)this._status="resolved";else if(f===v)this._status="completed";else if(f===h)this._status="errored";else if(f===M){this._cached=void 0,this._status="dirty";let g=this._cleanup;if(typeof g=="function"){this._cleanup=void 0;try{g()}catch{}}else if(g!=null&&typeof g=="object"){let y=g.invalidate;if(typeof y=="function")try{y()}catch{}}}else f===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=o>=0?s??e.slice(0,o):s??e;return r!=null?{finalMessages:l,equalsError:r}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let s of n)s(e)};_dispatchOrAccumulate(e){if(ye()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],me(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}U(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);U(this._deliverToSinks,n,this._config.tierOf)}},ke=t=>Array.isArray(t),oe=t=>typeof t=="object"&&t!=null&&!Array.isArray(t);function Ae(t,e,n){let s=ke(t)?t:[],r=typeof t=="function"?t:typeof e=="function"?e:void 0,o={};return ke(t)?o=(oe(e)?e:n)??{}:oe(t)?o=t:o=(oe(e)?e:n)??{},new z(s,r,o)}function ae(t,e){return Ae((s,r,o)=>t(r,o)??void 0,{describeKind:"producer",...e})}function Ye(t){return ae(e=>{let n=!1,s=()=>{t.onsuccess=null,t.onerror=null};return t.onsuccess=()=>{n||(n=!0,s(),e.down([[_,t.result],[v]]))},t.onerror=()=>{n||(n=!0,s(),e.down([[h,t.error??new Error("IndexedDB request failed")]]))},()=>{n=!0,s()}})}function Ke(t){return ae(e=>{let n=!1,s=()=>{t.oncomplete=null,t.onerror=null,t.onabort=null};return t.oncomplete=()=>{n||(n=!0,s(),e.down([[_,void 0],[v]]))},t.onerror=()=>{n||(n=!0,s(),e.down([[h,t.error??new Error("IndexedDB transaction failed")]]))},t.onabort=()=>{n||(n=!0,s(),e.down([[h,t.error??new Error("IndexedDB transaction aborted")]]))},()=>{n=!0,s()}})}function Je(t,e,n){return new Promise((s,r)=>{if(typeof indexedDB>"u"){r(new TypeError("indexedDB is not available in this environment"));return}let o=indexedDB.open(t,n);o.onupgradeneeded=()=>{let i=o.result;i.objectStoreNames.contains(e)||i.createObjectStore(e)},o.onsuccess=()=>s(o.result),o.onerror=()=>r(o.error??new Error("IndexedDB open failed"))})}function de(t,e,n,s,r){return Je(t,e,n).then(o=>new Promise((i,a)=>{let d=o.transaction(e,s),l=d.objectStore(e),c=r(l),u,f=!1,g=!1,y=()=>{!f||!g||(o.close(),i(u))};c.onsuccess=()=>{u=c.result,f=!0,y()},c.onerror=()=>{o.close(),a(c.error??new Error("IndexedDB request failed"))},d.oncomplete=()=>{if(g=!0,!f){o.close(),a(new Error("IndexedDB transaction completed without request result"));return}y()},d.onerror=()=>{o.close(),a(d.error??new Error("IndexedDB transaction failed"))},d.onabort=()=>{o.close(),a(d.error??new Error("IndexedDB transaction aborted"))}}))}function Xe(t){let{dbName:e,storeName:n}=t,s=t.version??1,r=t.key??"graphrefly_checkpoint";return{async save(o,i){await de(e,n,s,"readwrite",a=>a.put(i,r))},async load(o){let i=await de(e,n,s,"readonly",a=>a.get(r));return i==null||typeof i!="object"||Array.isArray(i)?null:i},async clear(o){await de(e,n,s,"readwrite",i=>i.delete(r))}}}0&&(module.exports={fromIDBRequest,fromIDBTransaction,indexedDbStorage});
1
+ "use strict";var K=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var Re=(n,e)=>{for(var t in e)K(n,t,{get:e[t],enumerable:!0})},Ce=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!Oe.call(n,r)&&r!==t&&K(n,r,{get:()=>e[r],enumerable:!(s=Se(e,r))||s.enumerable});return n};var Ie=n=>Ce(K({},"__esModule",{value:!0}),n);var Ze={};Re(Ze,{fromIDBRequest:()=>Ye,fromIDBTransaction:()=>Ke,indexedDbStorage:()=>Xe});module.exports=Ie(Ze);var G=Symbol.for("graphrefly/START"),_=Symbol.for("graphrefly/DATA"),k=Symbol.for("graphrefly/DIRTY"),E=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),S=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),v=Symbol.for("graphrefly/COMPLETE"),f=Symbol.for("graphrefly/ERROR"),D=Object.freeze([k]),J=Object.freeze([E]),Fe=Object.freeze([M]),X=Object.freeze([G]),Ge=Object.freeze([v]),He=Object.freeze([N]),Z=Object.freeze([D]),le=Object.freeze([J]),ce=Object.freeze([Fe]),ue=Object.freeze([Ge]),Q=Object.freeze([He]);var Le={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 fe(n){n.registerCodec(Le)}var Ve={type:"system",id:""};function B(n){if(n==null)return Ve;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}var ee=0,Pe=!1,he=[],pe=[],ge=[],Be=[];function _e(){return ee>0||Pe}function ye(){return ee>0}function be(n){ee>0?Be.push(n):n()}function U(n,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!_e()){n(e);return}(l>=5?ge:l===4?pe:he).push(()=>n(e));return}let s=e.length,r=s,i=s,a=s,o=0;for(;o<s&&t(e[o][0])<3;)o++;for(r=o;o<s&&t(e[o][0])===3;)o++;for(i=o;o<s&&t(e[o][0])===4;)o++;a=o;let d=_e();if(r>0){let l=e.slice(0,r);n(l)}if(i>r){let l=e.slice(r,i);d?he.push(()=>n(l)):n(l)}if(a>i){let l=e.slice(i,a);d?pe.push(()=>n(l)):n(l)}if(s>a){let l=e.slice(a,s);d?ge.push(()=>n(l)):n(l)}}function me(){return Date.now()*1e6}var W=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_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 s=this._messageTypes.get(t);return s!=null?s.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}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.")}};function ve(n){n.registerMessageType(G,{tier:0,wireCrossing:!1}),n.registerMessageType(k,{tier:1,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(S,{tier:2,wireCrossing:!1}),n.registerMessageType(H,{tier:2,wireCrossing:!1}),n.registerMessageType(_,{tier:3,wireCrossing:!0}),n.registerMessageType(E,{tier:3,wireCrossing:!0}),n.registerMessageType(v,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(f,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(N,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var O=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 te(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(te);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=te(n[t]);return e}return null}var Ue=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]),We=new TextEncoder;function je(n){let e=We.encode(n),t=e.length,s=t*8,r=t+9+63&-64,i=new Uint8Array(r);i.set(e),i[t]=128;let a=new DataView(i.buffer);a.setUint32(r-4,s>>>0,!1),a.setUint32(r-8,Math.floor(s/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,u=1359893119,h=2600822924,g=528734635,y=1541459225,A=new Uint32Array(64),m=(x,b)=>x>>>b|x<<32-b;for(let x=0;x<r;x+=64){for(let p=0;p<16;p++)A[p]=a.getUint32(x+p*4,!1);for(let p=16;p<64;p++){let I=A[p-15],F=A[p-2],P=m(I,7)^m(I,18)^I>>>3,Y=m(F,17)^m(F,19)^F>>>10;A[p]=A[p-16]+P+A[p-7]+Y>>>0}let b=o,R=d,C=l,$=c,T=u,L=h,V=g,q=y;for(let p=0;p<64;p++){let I=m(T,6)^m(T,11)^m(T,25),F=T&L^~T&V,P=q+I+F+Ue[p]+A[p]>>>0,Y=m(b,2)^m(b,13)^m(b,22),Ee=b&R^b&C^R&C,Me=Y+Ee>>>0;q=V,V=L,L=T,T=$+P>>>0,$=C,C=R,R=b,b=P+Me>>>0}o=o+b>>>0,d=d+R>>>0,l=l+C>>>0,c=c+$>>>0,u=u+T>>>0,h=h+L>>>0,g=g+V>>>0,y=y+q>>>0}let w=x=>x.toString(16).padStart(8,"0");return w(o)+w(d)+w(l)+w(c)+w(u)+w(h)+w(g)+w(y)}function ne(n){let e=te(n??null),t=JSON.stringify(e);return je(t).slice(0,16)}function ze(){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 se(n,e,t){let s=t?.id??ze();if(n===0)return{id:s,version:0};let i=(t?.hash??ne)(e);return{id:s,version:0,cid:i,prev:null}}function we(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var xe=()=>{},Te=100;function Ne(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function re(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function j(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}var $e=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},qe=(n,e,t,s)=>{let r=n;if(r._status==="completed"||r._status==="errored")return;let i=r._cached,a=i===void 0?[X]:[X,[_,i]];r._status==="dirty"&&a.push(D),U(e,a,r._config.tierOf)},ie=new W({onMessage:$e,onSubscribe:qe});ve(ie);fe(ie);var z=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,s){this._config=s.config??ie,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=t,this._partial=s.partial??!1,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??ne;let r=s.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?se(r,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Ne);let i={};for(let[o,d]of Object.entries(s.meta??{})){let l={initial:d,name:`${s.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};s.guard!=null&&(l.guard=s.guard),i[o]=new n([],void 0,l)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let a=this;this._actions={emit(o){a._emit([[_,o]])},down(o){a._emit(j(o))},up(o){a._emitUp(j(o))}},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 s=this._versioningLevel;if(s!=null&&e<=s)return;let r=t?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let i=this._cached===void 0?void 0:this._cached,a=this._versioning,o=a?.id??t?.id,d=a?.version??0,l=se(e,i,{id:o,hash:r});l.version=d,this._versioning=l,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=B(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!t&&!s)return;let r=B(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,i))throw new O({actor:r,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(r,i))throw new O({actor:r,action:i,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:me()}}down(e,t){let s=j(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[_,e]])}up(e,t){if(this._deps.length===0)return;let s=j(e);if(s.length===0)return;this._checkGuard(t);let r=t??{internal:!0};this._validateUpTiers(s);for(let i of this._deps)i.node.up?.(s,r)}_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 s of e){let r=t(s[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} 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 d=B(t);if(!this._guard(d,"observe"))throw new O({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){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 d of this._deps)re(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),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 s=0;s<e;s++){let r=s,i=this._deps[s];i.unsub=xe,i.unsub=i.node.subscribe(a=>{if(i.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of a)o(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(s){this._deps[t].unsub=null;for(let r=0;r<t;r++){let i=this._deps[r];if(i.unsub!=null){let a=i.unsub;i.unsub=null;try{a()}catch{}re(i)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let t=this._deps.length,s=Ne(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z),s.unsub=xe;try{s.unsub=e.subscribe(r=>{if(s.unsub===null)return;let i=this._config.tierOf,a=!1;for(let o of r)i(o[0])>=3&&(a=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(r){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(s){this._emit([[f,this._wrapFnError("cleanup threw",s)]])}else if(t!=null&&typeof t=="object"){let s=t.deactivate;if(typeof s=="function")try{s()}catch(r){this._emit([[f,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let s of this._deps){if(s.unsub!=null){let r=s.unsub;s.unsub=null;try{r()}catch{}}re(s)}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 s=this._deps[e],r=t[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(i)}if(r!==G){if(r===k){this._depDirtied(s);return}if(r===M){this._depInvalidated(s),this._emit(ce);return}if(r===S||r===H){this._emit([t]);return}if(r===N){this._emit(Q);return}if(r===_)this._depSettledAsData(s,t[1]);else if(r===E)this._depSettledAsResolved(s);else if(r===v)this._depSettledAsTerminal(s,!0);else if(r===f)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(r===_||r===E)&&this._emit([t]),(r===v||r===f)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z))}_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(le),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([[f,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(ue)}_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(a){this._emit([[f,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(o){this._emit([[f,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),s=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let o=t[a];o!=null&&o.length>0&&(this._deps[a].prevData=o[o.length-1])}let r=this._deps.map(a=>a.terminal),i={prevData:s,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:s};for(let o of this._inspectorHooks)o(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,i);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let o=a;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[f,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Te?(this._rerunDepth=0,this._emit([[f,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Te} \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 s=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[D,e[0]]:e;let s=!0,r=!1,i=!1,a=-1;for(let d of e){let l=t(d[0]);l<a&&(s=!1),l===3&&(r=!0),d[0]===k&&(i=!0),a=l}let o=e;if(!s){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),o=d.map(l=>l.m)}if(r&&!i&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[D,...o]:[...o.slice(0,d),D,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;for(let o=0;o<e.length;o++){let d=e[o];if(d[0]===f&&d[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 o=e.filter(d=>d[0]===N||d[0]===M);if(o.length===0)return;t=o}t=this._frameBatch(t);let r=null;for(let o=0;o<t.length;o++){let d=t[o],l=d[0];if(l!==S&&l!==H){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===S?"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 u=d[1];if(l===S)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))c=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let h=this._pauseBuffer;this._pauseBuffer=[],this._emit(h)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(d):r==null&&(r=t.slice(0,o))}if(r!=null){if(r.length===0)return;t=r}if(this._hasMeta&&t.some(o=>o[0]===N))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(Q)}catch{}let{finalMessages:i,equalsError:a}=this._updateState(t);if(i.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of i)o(l[0])===3?this._pauseBuffer.push(l):d.push(l);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(i);a!=null&&this._emit([[f,a]])}_updateState(e){let t=this._config.tierOf,s,r,i=-1,a=0;for(let c of e)t(c[0])===3&&a++;let o=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===_){d=c;break}}for(let c=0;c<e.length;c++){let u=e[c],h=u[0];if(h===_){if(u.length>=2){let g=!1;if(o&&this._cached!==void 0)try{g=this._equals(this._cached,u[1])}catch(y){r=this._wrapFnError("equals threw",y),i=c;break}if(g){s==null&&(s=e.slice(0,c)),s.push(J),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(d<0||c===d)&&we(this._versioning,u[1],this._hashFn)}this._status="settled",s?.push(u)}else if(s?.push(u),h===k)this._status="dirty";else if(h===E)this._status="resolved";else if(h===v)this._status="completed";else if(h===f)this._status="errored";else if(h===M){this._cached=void 0,this._status="dirty";let g=this._cleanup;if(typeof g=="function"){this._cleanup=void 0;try{g()}catch{}}else if(g!=null&&typeof g=="object"){let y=g.invalidate;if(typeof y=="function")try{y()}catch{}}}else h===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=i>=0?s??e.slice(0,i):s??e;return r!=null?{finalMessages:l,equalsError:r}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let s of t)s(e)};_dispatchOrAccumulate(e){if(ye()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],be(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}U(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);U(this._deliverToSinks,t,this._config.tierOf)}},Ae=n=>Array.isArray(n),oe=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function ke(n,e,t){let s=Ae(n)?n:[],r=typeof n=="function"?n:typeof e=="function"?e:void 0,i={};return Ae(n)?i=(oe(e)?e:t)??{}:oe(n)?i=n:i=(oe(e)?e:t)??{},new z(s,r,i)}function ae(n,e){return ke((s,r,i)=>n(r,i)??void 0,{describeKind:"producer",...e})}function Ye(n){return ae(e=>{let t=!1,s=()=>{n.onsuccess=null,n.onerror=null};return n.onsuccess=()=>{t||(t=!0,s(),e.down([[_,n.result],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB request failed")]]))},()=>{t=!0,s()}})}function Ke(n){return ae(e=>{let t=!1,s=()=>{n.oncomplete=null,n.onerror=null,n.onabort=null};return n.oncomplete=()=>{t||(t=!0,s(),e.down([[_,void 0],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB transaction failed")]]))},n.onabort=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB transaction aborted")]]))},()=>{t=!0,s()}})}function Je(n,e,t){return new Promise((s,r)=>{if(typeof indexedDB>"u"){r(new TypeError("indexedDB is not available in this environment"));return}let i=indexedDB.open(n,t);i.onupgradeneeded=()=>{let a=i.result;a.objectStoreNames.contains(e)||a.createObjectStore(e)},i.onsuccess=()=>s(i.result),i.onerror=()=>r(i.error??new Error("IndexedDB open failed"))})}function de(n,e,t,s,r){return Je(n,e,t).then(i=>new Promise((a,o)=>{let d=i.transaction(e,s),l=d.objectStore(e),c=r(l),u,h=!1,g=!1,y=()=>{!h||!g||(i.close(),a(u))};c.onsuccess=()=>{u=c.result,h=!0,y()},c.onerror=()=>{i.close(),o(c.error??new Error("IndexedDB request failed"))},d.oncomplete=()=>{if(g=!0,!h){i.close(),o(new Error("IndexedDB transaction completed without request result"));return}y()},d.onerror=()=>{i.close(),o(d.error??new Error("IndexedDB transaction failed"))},d.onabort=()=>{i.close(),o(d.error??new Error("IndexedDB transaction aborted"))}}))}function Xe(n){let{dbName:e,storeName:t}=n,s=n.version??1,r=n.key??"graphrefly_checkpoint";return{async save(i,a){await de(e,t,s,"readwrite",o=>o.put(a,r))},async load(i){let a=await de(e,t,s,"readonly",o=>o.get(r));return a==null||typeof a!="object"||Array.isArray(a)?null:a},async clear(i){await de(e,t,s,"readwrite",a=>a.delete(r))}}}0&&(module.exports={fromIDBRequest,fromIDBTransaction,indexedDbStorage});
@@ -1,4 +1,4 @@
1
- import { a as Node } from '../node-Cc1TniY8.cjs';
1
+ import { a as Node } from '../node-BVV7G1bq.cjs';
2
2
  import { StorageTier } from './storage-core.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as Node } from '../node-Cc1TniY8.js';
1
+ import { a as Node } from '../node-BVV7G1bq.js';
2
2
  import { StorageTier } from './storage-core.js';
3
3
 
4
4
  /**
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-DQA3UIQ2.js";import"../chunk-ZB5EHBIO.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as fromIDBRequest,b as fromIDBTransaction,c as indexedDbStorage};
1
+ import{a,b,c}from"../chunk-7TDOES3L.js";import"../chunk-W4TSQ6RJ.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as fromIDBRequest,b as fromIDBTransaction,c as indexedDbStorage};