semiotic 3.13.1 → 3.13.3

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 (276) hide show
  1. package/README.md +48 -48
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/dist/mcp-server.js +4 -4
  4. package/ai/reference.md +23 -12
  5. package/ai/schema.json +258 -96
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/task-packets/compare-category-totals.json +5 -5
  8. package/ai/task-packets/compare-category-totals.md +2 -2
  9. package/ai/task-packets/correct-published-chart.json +5 -5
  10. package/ai/task-packets/correct-published-chart.md +2 -2
  11. package/ai/task-packets/index.json +6 -6
  12. package/ai/task-packets/update-live-chart.json +5 -5
  13. package/ai/task-packets/update-live-chart.md +2 -2
  14. package/dist/c-2YFVDRU4.min.js +1 -0
  15. package/dist/c-4OVDIXAR.min.js +1 -0
  16. package/dist/c-57IIWW46.min.js +1 -0
  17. package/dist/c-5HTUQRJT.min.js +1 -0
  18. package/dist/c-5NAU4JAY.min.js +1 -0
  19. package/dist/c-62UTMRQE.min.js +1 -0
  20. package/dist/c-6QV6F3U7.min.js +1 -0
  21. package/dist/c-73ORHEHO.min.js +1 -0
  22. package/dist/c-7S46KBYD.min.js +2 -0
  23. package/dist/c-AJSS332Z.min.js +2 -0
  24. package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
  25. package/dist/c-B3X2IJRQ.min.js +1 -0
  26. package/dist/c-BLLDBVFK.min.js +38 -0
  27. package/dist/c-BQWX6NBX.min.js +1 -0
  28. package/dist/c-C7TT4J7K.min.js +1 -0
  29. package/dist/c-CJ5GA7DM.min.js +1 -0
  30. package/dist/c-D7YDFHLY.min.js +1 -0
  31. package/dist/c-DHNROAXY.min.js +1 -0
  32. package/dist/c-DMDFJQU4.min.js +1 -0
  33. package/dist/{c-RAIBDXDV.min.js → c-FRVHZIGR.min.js} +1 -1
  34. package/dist/{c-I54V24WG.min.js → c-HAZCVHI7.min.js} +1 -1
  35. package/dist/c-HN5U72U7.min.js +1 -0
  36. package/dist/c-JA5F7ITS.min.js +1 -0
  37. package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
  38. package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
  39. package/dist/{c-HGWITEJI.min.js → c-KJGJEOSV.min.js} +1 -1
  40. package/dist/c-LDGV6TDQ.min.js +1 -0
  41. package/dist/c-LW3GP7RY.min.js +1 -0
  42. package/dist/c-M2TPZE7P.min.js +1 -0
  43. package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
  44. package/dist/c-OA6RJZ7S.min.js +1 -0
  45. package/dist/c-OBBSIOYU.min.js +1 -0
  46. package/dist/c-OMTJIC3P.min.js +1 -0
  47. package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
  48. package/dist/{c-XZJWL7UL.min.js → c-QSEAAHEU.min.js} +1 -1
  49. package/dist/c-RQWI623R.min.js +1 -0
  50. package/dist/{c-62JIVHK5.min.js → c-RWFADOKS.min.js} +1 -1
  51. package/dist/c-TFESQSWE.min.js +1 -0
  52. package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
  53. package/dist/{c-4P2EM44G.min.js → c-TOXWQRXS.min.js} +3 -3
  54. package/dist/c-TX53234M.min.js +1 -0
  55. package/dist/c-TZBEQ5UY.min.js +1 -0
  56. package/dist/c-UALVQIIJ.min.js +1 -0
  57. package/dist/c-VBDWHTC7.min.js +1 -0
  58. package/dist/c-VBIPDCE7.min.js +1 -0
  59. package/dist/c-WTNRBWZZ.min.js +51 -0
  60. package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
  61. package/dist/c-XPNBS3W2.min.js +1 -0
  62. package/dist/c-XT3G3YWU.min.js +1 -0
  63. package/dist/c-YCBCZFOC.min.js +1 -0
  64. package/dist/c-ZBSL4Y32.min.js +1 -0
  65. package/dist/c-ZP6O6UHV.min.js +1 -0
  66. package/dist/c-ZVL7ULNH.min.js +1 -0
  67. package/dist/components/ChartErrorBoundary.d.ts +5 -1
  68. package/dist/components/ai/intentWeights.d.ts +22 -0
  69. package/dist/components/ai/streamSchema.d.ts +98 -0
  70. package/dist/components/ai/streamingTypes.d.ts +27 -4
  71. package/dist/components/ai/suggestCharts.d.ts +10 -2
  72. package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
  73. package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
  74. package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
  75. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
  76. package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
  77. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
  78. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
  79. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
  80. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
  81. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
  82. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
  83. package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
  84. package/dist/components/charts/realtime/aggregate.d.ts +11 -12
  85. package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
  86. package/dist/components/charts/realtime/eventTime.d.ts +7 -1
  87. package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
  88. package/dist/components/charts/shared/ChartError.d.ts +4 -6
  89. package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
  90. package/dist/components/charts/shared/axisExtent.d.ts +2 -1
  91. package/dist/components/charts/shared/chartMode.d.ts +2 -2
  92. package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
  93. package/dist/components/charts/shared/types.d.ts +4 -1
  94. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
  95. package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
  96. package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
  97. package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
  98. package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
  99. package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
  100. package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
  101. package/dist/components/legendGeometry.d.ts +148 -0
  102. package/dist/components/legendLayout.d.ts +20 -38
  103. package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
  104. package/dist/components/realtime/SlidingExtent.d.ts +18 -0
  105. package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
  106. package/dist/components/realtime/renderers/types.d.ts +1 -0
  107. package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
  108. package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
  109. package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
  110. package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
  111. package/dist/components/recipes/compositional/metrics.d.ts +2 -2
  112. package/dist/components/recipes/compositional/projection.d.ts +3 -1
  113. package/dist/components/recipes/compositional/routing.d.ts +3 -1
  114. package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
  115. package/dist/components/recipes/compositional/topology.d.ts +2 -0
  116. package/dist/components/recipes/compositional/types.d.ts +10 -1
  117. package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
  118. package/dist/components/semiotic-ai-core.d.ts +3 -2
  119. package/dist/components/semiotic-ai-stream.d.ts +3 -2
  120. package/dist/components/semiotic-network-zoom.d.ts +1 -1
  121. package/dist/components/semiotic-recipes-react.d.ts +2 -0
  122. package/dist/components/semiotic-utils-core.d.ts +2 -0
  123. package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
  124. package/dist/components/server/staticLegend.d.ts +5 -0
  125. package/dist/components/server/staticLegendText.d.ts +13 -0
  126. package/dist/components/server/staticSVGChrome.d.ts +2 -2
  127. package/dist/components/store/ThemeStore.d.ts +4 -1
  128. package/dist/components/store/themeCore.d.ts +2 -0
  129. package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
  130. package/dist/components/stream/FrameRuntime.d.ts +3 -0
  131. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  132. package/dist/components/stream/IngestActivity.d.ts +9 -0
  133. package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
  134. package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
  135. package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
  136. package/dist/components/stream/PipelineStore.d.ts +8 -3
  137. package/dist/components/stream/accessibleDataRows.d.ts +1 -0
  138. package/dist/components/stream/axisTickUtils.d.ts +25 -5
  139. package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
  140. package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
  141. package/dist/components/stream/geoTypes.d.ts +2 -0
  142. package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
  143. package/dist/components/stream/hitTestUtils.d.ts +7 -0
  144. package/dist/components/stream/keyboardNav.d.ts +3 -1
  145. package/dist/components/stream/mediaQuery.d.ts +2 -0
  146. package/dist/components/stream/navigationGraph.d.ts +10 -3
  147. package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
  148. package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
  149. package/dist/components/stream/networkNavGroups.d.ts +3 -0
  150. package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
  151. package/dist/components/stream/networkSceneTypes.d.ts +10 -0
  152. package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
  153. package/dist/components/stream/networkTypes.d.ts +2 -0
  154. package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
  155. package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
  156. package/dist/components/stream/networkZoom/types.d.ts +10 -0
  157. package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
  158. package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
  159. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
  160. package/dist/components/stream/ordinalTypes.d.ts +11 -2
  161. package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
  162. package/dist/components/stream/pipelineConfig.d.ts +7 -0
  163. package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
  164. package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
  165. package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
  166. package/dist/components/stream/pipelineTransitions.d.ts +1 -13
  167. package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
  168. package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
  169. package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
  170. package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
  171. package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
  172. package/dist/components/stream/roundScaleDomain.d.ts +9 -0
  173. package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
  174. package/dist/components/stream/shallowEqual.d.ts +2 -0
  175. package/dist/components/stream/stalenessBands.d.ts +1 -1
  176. package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
  177. package/dist/components/stream/types.d.ts +10 -2
  178. package/dist/components/stream/useFrame.d.ts +7 -4
  179. package/dist/components/stream/useMediaPreferences.d.ts +1 -4
  180. package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
  181. package/dist/components/stream/useStalenessCheck.d.ts +5 -3
  182. package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
  183. package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
  184. package/dist/components/stream/xyDateTicks.d.ts +33 -4
  185. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  186. package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
  187. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
  188. package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
  189. package/dist/components/types/legendTypes.d.ts +12 -1
  190. package/dist/geo.min.js +155 -152
  191. package/dist/geo.module.min.js +1 -1
  192. package/dist/network.module.min.js +1 -1
  193. package/dist/ordinal.module.min.js +1 -1
  194. package/dist/physics.module.min.js +1 -1
  195. package/dist/processSankeyLayoutWorker.js +1 -1
  196. package/dist/semiotic-ai-core.d.ts +3 -2
  197. package/dist/semiotic-ai-core.min.js +5 -5
  198. package/dist/semiotic-ai-core.module.min.js +4 -4
  199. package/dist/semiotic-ai.module.min.js +2 -2
  200. package/dist/semiotic-artifact.min.js +6 -6
  201. package/dist/semiotic-artifact.module.min.js +5 -5
  202. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  203. package/dist/semiotic-atlas.module.min.js +1 -1
  204. package/dist/semiotic-client-cjs-shared.min.js +1021 -1024
  205. package/dist/semiotic-client-compositional.module.min.js +1 -1
  206. package/dist/semiotic-client-shared.module.min.js +1 -1
  207. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
  208. package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
  209. package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
  210. package/dist/semiotic-line.module.min.js +1 -1
  211. package/dist/semiotic-network-zoom.d.ts +1 -1
  212. package/dist/semiotic-network-zoom.min.js +7 -7
  213. package/dist/semiotic-network-zoom.module.min.js +1 -1
  214. package/dist/semiotic-realtime-core.module.min.js +1 -1
  215. package/dist/semiotic-realtime-react.module.min.js +1 -1
  216. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
  217. package/dist/semiotic-recipes-core.module.min.js +1 -1
  218. package/dist/semiotic-recipes-react.d.ts +2 -0
  219. package/dist/semiotic-recipes-react.min.js +8 -8
  220. package/dist/semiotic-server-edge-node.module.min.js +3 -3
  221. package/dist/semiotic-server-edge.min.js +399 -397
  222. package/dist/semiotic-server-edge.module.min.js +3 -3
  223. package/dist/semiotic-server-node.min.js +399 -397
  224. package/dist/semiotic-themes-core.min.js +2 -2
  225. package/dist/semiotic-themes-core.module.min.js +1 -1
  226. package/dist/semiotic-themes.min.js +2 -2
  227. package/dist/semiotic-themes.module.min.js +1 -1
  228. package/dist/semiotic-utils-core.d.ts +2 -0
  229. package/dist/semiotic-utils-core.min.js +11 -11
  230. package/dist/semiotic-utils-core.module.min.js +3 -3
  231. package/dist/semiotic-value.module.min.js +1 -1
  232. package/dist/semiotic.module.min.js +1 -1
  233. package/dist/server.min.js +399 -397
  234. package/dist/server.module.min.js +3 -3
  235. package/dist/xy.module.min.js +1 -1
  236. package/package.json +11 -11
  237. package/dist/c-2M2OPWVA.min.js +0 -37
  238. package/dist/c-2N7IU2NY.min.js +0 -1
  239. package/dist/c-3UXQGCQT.min.js +0 -1
  240. package/dist/c-4RVDKSMQ.min.js +0 -1
  241. package/dist/c-4YPPVFZH.min.js +0 -1
  242. package/dist/c-6WJKNYIG.min.js +0 -1
  243. package/dist/c-7UN2WUMI.min.js +0 -1
  244. package/dist/c-AQUX6L2O.min.js +0 -1
  245. package/dist/c-BR5QDUCR.min.js +0 -1
  246. package/dist/c-C3YQVUB6.min.js +0 -1
  247. package/dist/c-COP4OISO.min.js +0 -1
  248. package/dist/c-ENRZPF5E.min.js +0 -1
  249. package/dist/c-FAOZZE77.min.js +0 -1
  250. package/dist/c-HBLICBM6.min.js +0 -1
  251. package/dist/c-I4BEWAKT.min.js +0 -1
  252. package/dist/c-IDCFMBA4.min.js +0 -2
  253. package/dist/c-KLJDKRD5.min.js +0 -1
  254. package/dist/c-LEICSI5V.min.js +0 -1
  255. package/dist/c-MOK4RWNO.min.js +0 -1
  256. package/dist/c-N2TVSOYL.min.js +0 -2
  257. package/dist/c-NHZ2E3CI.min.js +0 -1
  258. package/dist/c-OIJL2WZH.min.js +0 -1
  259. package/dist/c-OSLNYZ3Q.min.js +0 -51
  260. package/dist/c-OWRVBUSL.min.js +0 -1
  261. package/dist/c-QIVKWHDL.min.js +0 -1
  262. package/dist/c-QUAEYF34.min.js +0 -1
  263. package/dist/c-RDFFLRKC.min.js +0 -1
  264. package/dist/c-RTU5425Z.min.js +0 -1
  265. package/dist/c-SIQVOV6A.min.js +0 -1
  266. package/dist/c-SU6Z75M2.min.js +0 -1
  267. package/dist/c-SWVXFUDL.min.js +0 -1
  268. package/dist/c-TC47SNSI.min.js +0 -1
  269. package/dist/c-VLWWXOM5.min.js +0 -1
  270. package/dist/c-VNFIRKU5.min.js +0 -1
  271. package/dist/c-W5ATXREF.min.js +0 -1
  272. package/dist/c-WFX456JK.min.js +0 -5
  273. package/dist/c-WSWMQDFZ.min.js +0 -1
  274. package/dist/c-XORVM6C5.min.js +0 -1
  275. package/dist/c-YGTMWEEF.min.js +0 -1
  276. package/dist/c-ZDCTFRA6.min.js +0 -1
@@ -0,0 +1 @@
1
+ import{d as e,b as t}from"./c-DEWMXCOF.min.js";import{c as r,b as i,d as n}from"./c-6X7RO4GU.min.js";import{a as s}from"./c-WC7UNQPQ.min.js";import{a as o}from"./c-TSMTCW2K.min.js";import{b as a,c as l}from"./c-PTFHNN34.min.js";import{a as c}from"./c-FBV4S363.min.js";import{a as d}from"./c-V4XMSLC3.min.js";import{b as u}from"./c-DHNROAXY.min.js";import{c as h}from"./c-LDGV6TDQ.min.js";import{b as y,f as g,g as p,a as f,e as m,N as v,L as b,O as x,M as w,H as k,t as _,w as S,u as C,v as E,h as R,E as N,y as T,D as A,p as I,m as M,l as P,o as D,A as L,C as W,j as O,P as F,r as B,s as z}from"./c-OBBSIOYU.min.js";import{a as j,c as $,b as Y}from"./c-TX53234M.min.js";import{a as H,c as X}from"./c-363Q2L4Z.min.js";import{a as V,b as G}from"./c-O7SPJAUO.min.js";import{k as Q,l as q,b as K,aK as U,ao as Z,aA as J,aT as ee,ak as te,Z as re,W as ie,X as ne,V as se,F as oe,a_ as ae,E as le,Q as ce,K as de,J as ue,I as he,U as ye,A as ge,as as pe,ap as fe,az as me,at as ve,ay as be,av as xe,aF as we,aE as ke,aW as _e,aX as Se,af as Ce,ai as Ee,ae as Re,a$ as Ne,aC as Te,al as Ae,am as Ie,an as Me,m as Pe,n as De,aG as Le,ag as We,G as Oe,aU as Fe,aj as Be,o as ze,bd as je,aH as $e}from"./c-62UTMRQE.min.js";import{a as Ye}from"./c-WUAFPLTD.min.js";import{c as He}from"./c-ZP6O6UHV.min.js";import{a as Xe,m as Ve}from"./c-WPL6PGP3.min.js";import{i as Ge,k as Qe,c as qe,q as Ke,u as Ue,v as Ze,w as Je}from"./c-JDI7HKEM.min.js";import{a as et,i as tt,b as rt}from"./c-ELGOCAEY.min.js";import{h as it,r as nt}from"./c-HN5U72U7.min.js";import{r as st,D as ot,y as at,E as lt,h as ct}from"./c-B3X2IJRQ.min.js";import{d as dt,e as ut,c as ht,b as yt}from"./c-YCBCZFOC.min.js";import*as gt from"react";import{useRef as pt,useCallback as ft,useSyncExternalStore as mt,useLayoutEffect as vt,useId as bt,useState as xt,useReducer as wt,useEffect as kt,memo as _t,forwardRef as St,useMemo as Ct,useImperativeHandle as Et}from"react";import{jsx as Rt,Fragment as Nt,jsxs as Tt}from"react/jsx-runtime";import{quadtree as At}from"d3-quadtree";import{interpolateNumber as It}from"d3-interpolate";import{arc as Mt}from"d3-shape";var Pt={type:"flat",matrix:[1,0,0,1,0,0],lift:0,scale:1,bounds:null,project:(e,t)=>[e,t],unproject:(e,t)=>[e,t],depth:(e,t)=>t,groundTransform:"matrix(1 0 0 1 0 0)",billboardTransform:(e,t)=>`translate(${e},${t})`},Dt=/*#__PURE__*/Symbol.for("semiotic.networkPerspectiveContext");function Lt(){let e=globalThis;return e[Dt]??(e[Dt]=gt.createContext(Pt))}function Wt(){return gt.useContext(Lt())}function Ot(e,t,r){return t&&null!=e&&!1!==e?Rt(Ft,{frame:t,mode:r,children:e}):e}function Ft({frame:e,mode:t,children:r}){if(!e)return Rt(Nt,{children:r});let i=Lt();return Rt(i.Provider,{value:e,children:"ground"===t?Rt("g",{transform:e.groundTransform,children:r}):r})}function Bt(e,t,r){return"function"==typeof t?t(e):e[t??r]}function zt(e,t){let r=Bt(e,t.edgeIdAccessor,"id");if("string"!=typeof r||!r)throw new Error("IDENTITY_EDGE_ID: edgeIdentity=id requires nonempty string edge IDs.");return JSON.stringify(["id",r])}function jt(e){let t=null==e?NaN:Number(e);return Number.isFinite(t)?t:1}function $t(e,t){return null!=e?String(e):("production"!==process.env.NODE_ENV&&console.warn(`[Semiotic] Missing network ${t} ID; skipping this datum.`),null)}function Yt(e,t){let r=$t(Bt(e,t.sourceAccessor,"source"),"source"),i=$t(Bt(e,t.targetAccessor,"target"),"target");if(null===r||null===i){if("id"===t.edgeIdentity)throw new Error("ENDPOINT_OWNER: explicit-ID edges require both owners.");return null}return{source:r,target:i,value:jt(Bt(e,t.valueAccessor,"value")),data:e}}function Ht(e,t,r){if("id"!==r.edgeIdentity)return;let i=Yt(t,r),n="string"==typeof e.source?e.source:e.source.id,s="string"==typeof e.target?e.target:e.target.id;if(zt(t,r)!==e._edgeKey||!i||i.source!==n||i.target!==s)throw new Error("IDENTITY_EDGE_UPDATE: update cannot change edge ID or owners; remove and reinsert the edge.")}var Xt=/*#__PURE__*/new Set(["tree","cluster","treemap","circlepack","partition","orbit"]),Vt=/*#__PURE__*/new Set(["sankey","tree","cluster","treemap","circlepack","partition"]),Gt=class{constructor(e){this.capacity=e,this.particles=new Array(e),this._freeIndices=new Array(e);for(let t=0;t<e;t++)this.particles[t]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices[t]=e-1-t}spawn(e,t=Math.random){let r=this._freeIndices.pop();if(void 0===r)return null;let i=this.particles[r];return i.active=!0,i.t=0,i.offset=t()-.5,i.edgeIndex=e,i.x=0,i.y=0,i}step(e,t,r,i){for(let n=0;n<this.capacity;n++){let s=this.particles[n];if(!s.active)continue;let o=r[s.edgeIndex];if(!o||!o.bezier){s.active=!1,this._freeIndices.push(n);continue}let a=i?i[s.edgeIndex]??1:1,l=o.bezier.circular?.3:1;s.t+=e*t*a*l,s.t>=1?(s.active=!1,this._freeIndices.push(n)):Qt(o.bezier,s.t,s.offset,s)}}countForEdge(e){let t=0;for(let r=0;r<this.capacity;r++)this.particles[r].active&&this.particles[r].edgeIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1;this._freeIndices.length=0;for(let e=this.capacity-1;e>=0;e--)this._freeIndices.push(e)}resize(e){if(e<=this.capacity)return;let t=this.particles;this.particles=new Array(e);for(let r=0;r<e;r++)r<t.length?this.particles[r]=t[r]:(this.particles[r]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices.push(r));this.capacity=e}};function Qt(e,t,r,i){if(e.circular&&e.segments)return void function(e,t,r,i,n){let s=e.length,o=t*s,a=Math.min(Math.floor(o),s-1),l=o-a,[c,d,u,h]=e[a];qt(c,d,u,h,l,n);let y=h.x-c.x,g=h.y-c.y,p=Math.sqrt(y*y+g*g);if(p>.001){let e=-g/p,t=y/p;n.x+=e*r*i*2,n.y+=t*r*i*2}}(e.segments,t,r,e.halfWidth,i);if(!e.points)return i.x=0,void(i.y=0);let[n,s,o,a]=e.points;qt(n,s,o,a,t,i);let l=a.x-n.x,c=a.y-n.y,d=Math.sqrt(l*l+c*c);if(d>.001){let t=-c/d,n=l/d;i.x+=t*r*e.halfWidth*2,i.y+=n*r*e.halfWidth*2}}function qt(e,t,r,i,n,s){let o=1-n,a=o*o,l=a*o,c=n*n,d=c*n;s.x=l*e.x+3*a*n*t.x+3*o*c*r.x+d*i.x,s.y=l*e.y+3*a*n*t.y+3*o*c*r.y+d*i.y}var Kt=/*#__PURE__*/new Set(["sankey","force","chord","tree","cluster","treemap","circlepack","partition","orbit"]);function Ut(e){return Kt.has(e)}var Zt=!1;function Jt(t){e(t)||!Q&&Ut(t)||"production"===process.env.NODE_ENV||Zt||(Zt=!0,console.warn(`[semiotic] StreamNetworkFrame: no layout plugin registered for "${t}". Import the matching chart HOC (which registers its plugin), or call registerBuiltInNetworkLayouts() from "semiotic/network".`))}function er(e){return{id:e,x0:0,x1:0,y0:0,y1:0,__hasPosition:!1,x:0,y:0,width:0,height:0,value:0,data:{id:e},createdByFrame:!0}}function tr(e){if(!e||"object"!=typeof e)return!1;let t=e;if("boolean"!=typeof t.circular||"number"!=typeof t.halfWidth||!Number.isFinite(t.halfWidth))return!1;if(t.circular){if(!Array.isArray(t.segments)||0===t.segments.length)return!1;for(let e of t.segments)if(!rr(e))return!1;return!0}return rr(t.points)}function rr(e){if(!Array.isArray(e)||4!==e.length)return!1;for(let t of e){if(!t||"object"!=typeof t)return!1;let e=t;if("number"!=typeof e.x||!Number.isFinite(e.x)||"number"!=typeof e.y||!Number.isFinite(e.y))return!1}return!0}var ir="rgba(34, 197, 94, 0.7)",nr=2e3,sr={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},or={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},ar=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],lr=["scene-style","data-paint","accessibility","evidence"],cr=(e,t)=>({retainedData:e,invalidations:t}),dr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ur=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],hr=["scene-geometry","data-paint","overlay","accessibility","evidence"],yr=["scene-style","data-paint","accessibility","evidence"],gr=["scene-geometry","data-paint","overlay","accessibility","evidence"],pr=[],fr={chartType:/*#__PURE__*/cr("rebuild",dr),nodeIDAccessor:/*#__PURE__*/cr("rebuild",dr),sourceAccessor:/*#__PURE__*/cr("rebuild",dr),targetAccessor:/*#__PURE__*/cr("rebuild",dr),valueAccessor:/*#__PURE__*/cr("rebuild",dr),edgeIdentity:/*#__PURE__*/cr("rebuild",dr),edgeIdAccessor:/*#__PURE__*/cr("rebuild",dr),childrenAccessor:/*#__PURE__*/cr("rebuild",dr),hierarchySum:/*#__PURE__*/cr("rebuild",dr),orientation:/*#__PURE__*/cr("preserve",ur),nodeAlign:/*#__PURE__*/cr("preserve",ur),nodePaddingRatio:/*#__PURE__*/cr("preserve",ur),nodeWidth:/*#__PURE__*/cr("preserve",ur),edgeSort:/*#__PURE__*/cr("preserve",ur),iterations:/*#__PURE__*/cr("preserve",ur),forceStrength:/*#__PURE__*/cr("preserve",ur),padAngle:/*#__PURE__*/cr("preserve",ur),groupWidth:/*#__PURE__*/cr("preserve",ur),sortGroups:/*#__PURE__*/cr("preserve",ur),treeOrientation:/*#__PURE__*/cr("preserve",ur),edgeType:/*#__PURE__*/cr("preserve",ur),padding:/*#__PURE__*/cr("preserve",ur),paddingTop:/*#__PURE__*/cr("preserve",ur),orbitMode:/*#__PURE__*/cr("preserve",ur),orbitSize:/*#__PURE__*/cr("preserve",ur),orbitSpeed:/*#__PURE__*/cr("preserve",ur),orbitRevolution:/*#__PURE__*/cr("preserve",ur),orbitRevolutionStyle:/*#__PURE__*/cr("preserve",ur),orbitEccentricity:/*#__PURE__*/cr("preserve",ur),orbitShowRings:/*#__PURE__*/cr("preserve",ur),orbitAnimated:/*#__PURE__*/cr("preserve",ur),customNetworkLayout:/*#__PURE__*/cr("preserve",ur),layoutConfig:/*#__PURE__*/cr("preserve",ur),perspective:/*#__PURE__*/cr("preserve",hr),nodeSize:/*#__PURE__*/cr("preserve",hr),nodeSizeRange:/*#__PURE__*/cr("preserve",hr),colorByDepth:/*#__PURE__*/cr("preserve",hr),nodeLabel:/*#__PURE__*/cr("preserve",gr),showLabels:/*#__PURE__*/cr("preserve",gr),labelMode:/*#__PURE__*/cr("preserve",gr),nodeStyle:/*#__PURE__*/cr("preserve",yr),edgeStyle:/*#__PURE__*/cr("preserve",yr),colorBy:/*#__PURE__*/cr("preserve",yr),colorScheme:/*#__PURE__*/cr("preserve",yr),themeCategorical:/*#__PURE__*/cr("preserve",yr),themeSequential:/*#__PURE__*/cr("preserve",yr),themeSelectionOpacity:/*#__PURE__*/cr("preserve",yr),themeSemantic:/*#__PURE__*/cr("preserve",yr),edgeColorBy:/*#__PURE__*/cr("preserve",yr),edgeOpacity:/*#__PURE__*/cr("preserve",yr),showParticles:/*#__PURE__*/cr("preserve",yr),particleStyle:/*#__PURE__*/cr("preserve",yr),decay:/*#__PURE__*/cr("preserve",yr),pulse:/*#__PURE__*/cr("preserve",yr),thresholds:/*#__PURE__*/cr("preserve",yr),staleness:/*#__PURE__*/cr("preserve",yr),layoutSelection:/*#__PURE__*/cr("preserve",yr),clock:/*#__PURE__*/cr("preserve",pr),activityClock:/*#__PURE__*/cr("preserve",pr),random:/*#__PURE__*/cr("preserve",pr),seed:/*#__PURE__*/cr("preserve",pr),tensionConfig:/*#__PURE__*/cr("preserve",pr),transition:/*#__PURE__*/cr("preserve",pr),introAnimation:/*#__PURE__*/cr("preserve",pr),onLayoutError:/*#__PURE__*/cr("preserve",pr),__skipForceSimulation:/*#__PURE__*/cr("preserve",pr),__hierarchyRoot:/*#__PURE__*/cr("preserve",pr),__orbitState:/*#__PURE__*/cr("preserve",pr),__previousPositions:/*#__PURE__*/cr("preserve",pr)},mr=/*#__PURE__*/cr("preserve",ur),vr=class{constructor(){this.tracker=new q}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},ar)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},lr):this.recordNoop("restyle")}recordConfig(e,t){let r=function(e,t){let r="preserve",i=new Set;for(let n of e){let e="force"!==t||"nodeSize"!==n&&"nodeSizeRange"!==n?Object.prototype.hasOwnProperty.call(fr,n)?fr[n]:mr:cr("preserve",ur);"rebuild"===e.retainedData&&(r="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:r,invalidations:i}}(e,t);return this.tracker.record({kind:"config",keys:e},r.invalidations)}};function br(e){return e._edgeKey?.startsWith('["id",')?e._edgeKey:`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`}function xr(e){return{y0:e.y0,y1:e.y1,sankeyWidth:e.sankeyWidth,circularPathData:e.circular&&e.circularPathData?{...e.circularPathData}:void 0}}function wr(e,t=xr(e)){e._prevY0=t.y0,e._prevY1=t.y1,e._prevSankeyWidth=t.sankeyWidth,e._prevCircularPathData=t.circularPathData,e._introFromZero=!1}function kr(e){e._targetY0=e.y0,e._targetY1=e.y1,e._targetSankeyWidth=e.sankeyWidth,e._targetCircularPathData=xr(e).circularPathData;let t=e._targetCircularPathData,r=e._prevCircularPathData;t&&(!r||Math.sign(r.verticalFullExtent-r.sourceY)!==Math.sign(t.verticalFullExtent-t.sourceY))&&(e._prevSankeyWidth||(e._prevY0=_r(e.source,e.y0),e._prevY1=_r(e.target,e.y1)),e._prevCircularPathData={...t},e._prevSankeyWidth=0,e._introFromZero=!0)}function _r(e,t){if("string"==typeof e||void 0===e._prevY0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1)return t;let r=e.y1>e.y0?(t-e.y0)/(e.y1-e.y0):.5;return dt(e._prevY0,e._prevY1,r)}function Sr(e,t){if(void 0===e._targetY0||void 0===e._prevY0||void 0===e._prevSankeyWidth||!(e._prevSankeyWidth>0||e._introFromZero))return;e.y0=dt(e._prevY0,e._targetY0,t),e.y1=dt(e._prevY1,e._targetY1,t),e.sankeyWidth=dt(e._prevSankeyWidth,e._targetSankeyWidth,t);let r=e._targetCircularPathData,i=e._prevCircularPathData;if(!r||!i)return;let n={...r};for(let e of Object.keys(r))n[e]=dt(i[e]??r[e],r[e],t);if("string"!=typeof e.source){let t=e.source.x1-n.sourceX;n.sourceX=e.source.x1,n.rightInnerExtent+=t,n.rightFullExtent+=t,n.sourceWidth=e.source.x1-e.source.x0}if("string"!=typeof e.target){let t=e.target.x0-n.targetX;n.targetX=e.target.x0,n.leftInnerExtent+=t,n.leftFullExtent+=t}n.sourceY=e.y0,n.targetY=e.y1,e.circularPathData=n,e._circularWidth=e.sankeyWidth}function Cr(e){void 0!==e._targetY0&&(e.y0=e._targetY0,e.y1=e._targetY1,e.sankeyWidth=e._targetSankeyWidth,e._targetCircularPathData&&(e.circularPathData={...e._targetCircularPathData},e._circularWidth=e.sankeyWidth)),e._introFromZero=void 0}function Er(e){let t="string"==typeof e?{type:e}:e;return t&&"flat"!==t.type?t:null}var Rr=class{constructor(e){this.restyle=e,this.key=null,this.pending=null}reuse(e,t,r,i,n){let s=function(e,t,r,i){return{geometry:[r,i,...t,e.customNetworkLayout,e.layoutConfig,e.perspective],colors:{semantic:e.themeSemantic,sequential:e.themeSequential,selectionOpacity:e.themeSelectionOpacity,categorical:e.themeCategorical,colorScheme:e.colorScheme},selection:[e.layoutSelection?.isActive??!1,e.layoutSelection?.predicate,null!=e.layoutSelection]}}(e,t,r,i),o=null!==this.key&&st(this.key.selection,s.selection);return this.key&&st(this.key.geometry,s.geometry)&&st(this.key.colors,s.colors)&&(n||o)?(o||this.restyle(e.layoutSelection??null),this.key=s,!0):(this.key=null,this.pending=s,!1)}commit(){this.key=this.pending,this.pending=null}clear(){this.key=null,this.pending=null}};function Nr(e){e.customLayoutBackgrounds=null,e.customLayoutOverlays=null,e.customLayoutHtmlMarks=[],e.lastCustomLayoutResult=null}function Tr(e,t){let r=new WeakMap;for(let t of e)r.set(t,t.style);for(let e of t)r.set(e,e.style);return r}var Ar=class{constructor(){this.frame=null,this.underlay=[],this.edgeLift=0,this.onExtrasReady=null,this.needsRebuild=!1,this.internal=null,this.builds=0,this.warnedFlatDecorations=!1}warnFlatDecorations(e){if("production"===process.env.NODE_ENV||this.warnedFlatDecorations||e.perspective)return;let t=e=>Array.isArray(e)?e.some(t):null!=e&&!1!==e&&""!==e;!t(e.backgrounds)&&!t(e.overlays)||(this.warnedFlatDecorations=!0,console.warn('[semiotic] customNetworkLayout backgrounds/overlays stay flat. Use perspective: "ground", or NetworkPerspectiveGround/Billboard with perspective: "manual".'))}label(e){let t=this.frame?.type;return t&&"flat"!==t?`${e} (${t} perspective)`:e}get transitioning(){return null!=this.internal?.tween}advance(e,t=!1){let r=null!=this.internal?.tween&&(a()?.advance(this,e,t)??!1);return r&&(this.needsRebuild=!0),r}extrasReady(){this.needsRebuild=!0,this.onExtrasReady?.()}reset(){this.frame=null,this.underlay=[],this.edgeLift=0,this.projectParticle=void 0,this.internal=null,this.builds=0,this.needsRebuild=!1}project(e,t,r){this.needsRebuild=!1;let i=0===this.builds++;if(!(e.perspective&&"flat"!==e.perspective||this.internal))return null;let n=a();return n?n.project(this,e,t,r,i):(l().then(()=>this.extrasReady(),()=>{}),null)}},Ir=class extends p{constructor(e){super(),this.nodes=new Map,this.edges=new Map,this.tension=0,this.layoutVersion=0,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutBackgrounds=null,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this.customLayoutHtmlMarks=[],this._customLayoutDiagnosticsWarned=new Set,this._customLayoutCache=new Rr(e=>this.restyleScene(e)),this.perspective=new Ar,this._rawCustomResult=null,this.customLayoutRevision=0,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._nodeQuadtree=null,this._maxNodeRadius=0,this._sceneNodesRevision=0,this._nodeQuadtreeRevision=-1,this._nodesArrCache=null,this._edgesArrCache=null,this._arrCacheVersion=-1,this.particlePool=null,this.incidentEdges=null,this.updateResults=new vr,this.transition=null,this._hasRenderedOnce=!1,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.lastIngestTime=0,this.activity=new f(()=>this.config.activityClock?.()??this.currentTime()),this.nodeTimestamps=new Map,this.edgeTimestamps=new Map,this._decaySortedNodes=null,this._decayAgeMap=null,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this._networkDecayCache=null,this._lastPositionSnapshot=null,this.config={...e},this.tensionConfig={...sr,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new Gt(2e3))}get customLayoutRun(){return this._rawCustomResult}edgeIncidence(){if(this.incidentEdges)return this.incidentEdges;let e=new Map;for(let[t,r]of this.edges){let i="string"==typeof r.source?r.source:r.source.id,n="string"==typeof r.target?r.target:r.target.id;for(let r of[i,n])e.has(r)||e.set(r,new Set),e.get(r).add(t)}return this.incidentEdges=e,e}deleteIndexedEdge(e){let t=this.edges.get(e);if(!t)return;let r="string"==typeof t.source?t.source:t.source.id,i="string"==typeof t.target?t.target:t.target.id;this.incidentEdges?.get(r)?.delete(e),this.incidentEdges?.get(i)?.delete(e),this.edges.delete(e),this.edgeTimestamps.delete(e)}currentTime(){return this.config.clock?.()??ut()}updateConfig(e){this.applyConfig(e)}hasEdgeIdentityChange(e){return r=e,((t=this.config).edgeIdentity??"pair")!==(r.edgeIdentity??"pair")||"id"===r.edgeIdentity&&t.edgeIdAccessor!==r.edgeIdAccessor;var t,r}applyConfig(e,r=!1){let i=this.config,n={...i,...e};if(!r&&this.edges.size&&"id"===i.edgeIdentity&&"id"!==n.edgeIdentity)throw new Error("IDENTITY_EDGE_MODE: clear or replace retained edges before switching to pair identity.");if(!r&&"id"===n.edgeIdentity&&("id"!==i.edgeIdentity||i.edgeIdAccessor!==n.edgeIdAccessor)){let e=function(e,t){let r=new Set;return[...e].map(([e,i])=>{let n=zt(i.data??{},t);if(r.has(n))throw new Error("IDENTITY_DUPLICATE_EDGE: cannot adopt an accessor that repeats existing IDs.");return r.add(n),{previous:e,key:n,edge:i}})}(this.edges,n),t=new Map;for(let{previous:r,key:i}of e){let e=this.edgeTimestamps.get(r);void 0!==e&&t.set(i,e)}this.edges.clear();for(let{key:t,edge:r}of e)r._edgeKey=t,this.edges.set(t,r);this.edgeTimestamps=t,this.incidentEdges=null,this._arrCacheVersion=-1}t(i,n),i.__hierarchyRoot&&(n.__hierarchyRoot=i.__hierarchyRoot),void 0===e.layoutSelection&&null!=i.layoutSelection&&(n.layoutSelection=i.layoutSelection);let s=[...new Set([...Object.keys(i),...Object.keys(n)])].filter(e=>i[e]!==n[e]);this.config=n,this.tensionConfig={...sr,...n.tensionConfig},n.showParticles&&("sankey"===n.chartType||n.customNetworkLayout)&&!this.particlePool&&(this.particlePool=new Gt(2e3)),this.updateResults.recordConfig(s,n.chartType)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}ingestHierarchy(e,t,r){r&&this.applyConfig(r,!0),this._boundedPrevSnapshot=new Map;for(let[e,t]of this.nodes)(0!==t.x0||0!==t.x1||0!==t.y0||0!==t.y1)&&this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this.config.__hierarchyRoot=e,this.runLayout(t),this._boundedPrevSnapshot=null,this.activity.touch(),this.updateResults.recordData("replace",1)}ingestBounded(e,t,r,i){let n=function(e,t,r){let i=new Map;for(let t of e){let e=$t(Bt(t,r.nodeIDAccessor,"id"),"node");null!==e&&(i.has(e)&&"production"!==process.env.NODE_ENV&&console.warn(`[Semiotic] Duplicate network node ID "${e}"; using the last datum.`),i.set(e,t))}let n=[],s=new Set;return t.forEach((e,t)=>{let o="id"===r.edgeIdentity?zt(e,r):void 0;if(o&&s.has(o))throw new Error("IDENTITY_DUPLICATE_EDGE: repeated edge ID in bounded graph.");o&&s.add(o);let a=Yt(e,r);if(a){for(let e of[a.source,a.target])i.has(e)||i.set(e,{id:e});n.push({...a,_edgeKey:o??`${a.source}\0${a.target}\0${t}`})}}),{nodes:i,edges:n}}(e,t,{...this.config,...i?.config});i?.config&&this.applyConfig(i.config,!0),this._boundedPrevSnapshot=new Map;for(let[e,t]of this.nodes)(0!==t.x0||0!==t.x1||0!==t.y0||0!==t.y1)&&this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this._boundedEdgeSnapshot=function(e){let t=new Map;for(let r of e){let e=br(r),i=t.get(e)??[];i.push(xr(r)),t.set(e,i)}return t}(this.edges.values()),this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._arrCacheVersion=-1;for(let[e,t]of n.nodes){let r=er(e);r.data=t,"force"===this.config.chartType&&!this.config.customNetworkLayout&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&(r.x=t.x,r.y=t.y,r.__hasPosition=!0),this.nodes.set(e,r)}for(let e of n.edges){let t=e.data,r={...e,y0:0,y1:0,sankeyWidth:0};t&&"object"==typeof t&&tr(t.bezier)&&(r.bezier=t.bezier),this.edges.set(e._edgeKey,r)}i?.deferLayout||this.runLayout(r),this.activity.touch(),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,r,i){return this.ingestBounded(e,t,r,i),this.updateResults.last}applyForceLayoutPositions(e,t){for(let[t,r]of Object.entries(e)){let e=this.nodes.get(t);e&&(e.x=r.x,e.y=r.y,e.__hasPosition=!0)}this.config.__skipForceSimulation=!0;try{this.runLayout(t)}finally{this.config.__skipForceSimulation=void 0}}edgeKey(e,t){return`${e}\0${t}`}ingestEdge(e){let t=Yt(e,this.config);if(!t)return this.updateResults.recordNoop("ingest"),!1;let{source:r,target:i,value:n}=t,s="id"===this.config.edgeIdentity?zt(e,this.config):this.edgeKey(r,i),o=this.edges.get(s);o&&Ht(o,e,this.config);let a=0===this.nodes.size,l=!1,c=this.currentTime();this.activity.touch(),this.lastIngestTime=c,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(r)||(this.nodes.set(r,er(r)),this.nodeTimestamps.set(r,c),this.tension+=this.tensionConfig.newNode,l=!0),this.nodes.has(i)||(this.nodes.set(i,er(i)),this.nodeTimestamps.set(i,c),this.tension+=this.tensionConfig.newNode,l=!0);let d=!1;o?(o.value="id"===this.config.edgeIdentity?n:o.value+n,o.data="id"===this.config.edgeIdentity?e:{...o.data,...e},this.edgeTimestamps.set(s,c),this.tension+=this.tensionConfig.weightChange,d=!0):(this.incidentEdges=null,this.edges.set(s,{...t,y0:0,y1:0,sankeyWidth:0,_edgeKey:s}),this.edgeTimestamps.set(s,c),this.tension+=this.tensionConfig.newEdge,l=!0);let u=a||l||d||this.tension>=this.tensionConfig.threshold;return l&&(this._arrCacheVersion=-1),this.updateResults.recordData("ingest",1),u}ingestEdgeWithResult(e){return this.ingestEdge(e),this.updateResults.last}runLayout(t){if(this.config.customNetworkLayout)return this.recordTopologyDiff(),void this.layoutVersion++;let r=e(this.config.chartType);if(!r)return void Jt(this.config.chartType);let i=Array.from(this.nodes.values()),n=Array.from(this.edges.values());if(0===i.length&&!r.hierarchical)return;if(this.prepareForRelayout(),r.supportsStreaming&&!r.hierarchical&&(this.config.__previousPositions=this._lastPositionSnapshot??void 0),r.computeLayout(i,n,this.config,t),this.config.__previousPositions=void 0,r.hierarchical&&i.length>0){this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(let e of i)this.nodes.set(e.id,e);for(let e=0;e<n.length;e++){let t=n[e],r="string"==typeof t.source?t.source:t.source.id,i="string"==typeof t.target?t.target:t.target.id,s=t._edgeKey||`${r}\0${i}\0${e}`;t._edgeKey=s,this.edges.set(s,t)}let e=this._boundedPrevSnapshot;if(e&&e.size>0)for(let t of this.nodes.values()){let r=e.get(t.id);r&&(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1)}this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,i=Array.from(this.nodes.values())}this.finalizeLayout();let s=new Map;for(let e of this.nodes.values())Number.isFinite(e.x)&&Number.isFinite(e.y)&&s.set(e.id,{x:e.x,y:e.y});this._lastPositionSnapshot=s,this.saveTargetPositions();let o=i.some(e=>void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1||0!==e._prevY0||0!==e._prevY1)),a=this.config.transition?.duration??this.tensionConfig.transitionDuration,l=Vt.has(this.config.chartType);if(!this._hasRenderedOnce&&this.config.introAnimation&&l&&i.length>0&&a>0){let e="sankey"===this.config.chartType&&"vertical"===this.config.orientation,r=t[e?1:0]/2,i=t[e?0:1]/2;for(let e of this.nodes.values())e._prevX0=r,e._prevX1=r,e._prevY0=i,e._prevY1=i;for(let e of this.edges.values())e._prevY0=i,e._prevY1=i,e._prevSankeyWidth=0,e._introFromZero=!0;this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a}}else o&&a>0&&(this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a});this._hasRenderedOnce=!0,this.recordTopologyDiff(),this.layoutVersion++}recordTopologyDiff(){let e=new Set(this.nodes.keys()),t=new Set(this.edges.keys());this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set;for(let t of e)this.previousNodeIds.has(t)||this.addedNodes.add(t);for(let t of this.previousNodeIds)e.has(t)||this.removedNodes.add(t);for(let e of t)this.previousEdgeKeys.has(e)||this.addedEdges.add(e);for(let e of this.previousEdgeKeys)t.has(e)||this.removedEdges.add(e);(this.addedNodes.size>0||this.removedNodes.size>0||this.addedEdges.size>0||this.removedEdges.size>0)&&(this.lastTopologyChangeTime=this.currentTime()),this.previousNodeIds=e,this.previousEdgeKeys=t}restyleScene(e){let t=function({nodes:e,edges:t,restyle:r,restyleEdge:i,baseStyles:n,selection:s}){let o=!(!r&&!i);if(r)for(let t of e){let e=n.get(t)??t.style,i=r(t,s);t.style=i?{...e,...i}:e}if(i)for(let e of t){let t=n.get(e)??e.style,r=i(e,s);e.style=r?{...t,...r}:t}return o}({nodes:this.sceneNodes,edges:this.sceneEdges,restyle:this._customRestyle,restyleEdge:this._customRestyleEdge,baseStyles:this._baseStyles,selection:e});this.markStylePaintPending(),this.updateResults.recordRestyle(t)}buildScene(t){if(this.config.customNetworkLayout){if(this._customLayoutCache.reuse(this.config,t,this.getUpdateSnapshot().revisions.data,this.layoutVersion,this.hasCustomRestyle))return void(this.perspective.needsRebuild&&this._rawCustomResult&&(this.commitCustomScene(this._rawCustomResult,t),this._sceneNodesRevision++,this.hasCustomRestyle&&(this._baseStyles=Tr(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null))));let e=function({config:e,customLayout:t,size:r,nodes:i,edges:n,previousResult:s,revision:o}){let a=V(e.colorScheme,e.themeCategorical,Xe),l={nodes:i,edges:n,dimensions:{width:r[0],height:r[1],plot:{x:0,y:0,width:r[0],height:r[1]}},theme:{semantic:e.themeSemantic??{},sequential:e.themeSequential,selectionOpacity:e.themeSelectionOpacity,categorical:[...a]},resolveColor:G(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null,perspective:Er(e.perspective)};return g({family:"network",logLabel:"customNetworkLayout",revision:o,hasPreviousResult:null!==s,onLayoutError:e.onLayoutError,run:()=>t(l)})}({config:this.config,customLayout:this.config.customNetworkLayout,size:t,nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values()),previousResult:this.lastCustomLayoutResult,revision:this.layoutVersion});if("failure"===e.kind)return this.lastCustomLayoutFailure=e.diagnostic,void(e.preservedLastGoodScene||(this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.perspective.underlay=[],Nr(this),this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._sceneNodesRevision++));let r=e.result;return this._customLayoutCache.commit(),this._rawCustomResult=r,this.commitCustomScene(r,t),this.customLayoutRevision++,this.lastCustomLayoutFailure=null,this._sceneNodesRevision++,this._customRestyle=r.restyle,this._customRestyleEdge=r.restyleEdge,this.hasCustomRestyle=!(!r.restyle&&!r.restyleEdge),this.hasCustomRestyle&&(this._baseStyles=Tr(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null)),void m({label:"customNetworkLayout",nodes:this.sceneNodes,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned})}this._customLayoutCache.clear(),this._rawCustomResult=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,Nr(this),this.lastCustomLayoutFailure=null;let r=e(this.config.chartType);if(!r)return Jt(this.config.chartType),void this._sceneNodesRevision++;let i=r.hierarchical?Array.from(this.nodes.values()):this.nodesArray,n=r.hierarchical?Array.from(this.edges.values()):this.edgesArray,s=r.buildScene(i,n,this.config,t),o=this.perspective.project(this.config,t,s);this.sceneNodes=o?.sceneNodes??s.sceneNodes,this.sceneEdges=o?.sceneEdges??s.sceneEdges,this.labels=o?.labels??s.labels,this._sceneNodesRevision++}commitCustomScene(e,t){let r=this.perspective.project(this.config,t,{sceneNodes:e.sceneNodes??[],sceneEdges:e.sceneEdges??[],labels:e.labels??[],htmlMarks:e.htmlMarks,bounds:e.perspectiveBounds});r&&this.perspective.warnFlatDecorations(e);let i=r?{...e,sceneNodes:r.sceneNodes,sceneEdges:r.sceneEdges,labels:r.labels,htmlMarks:e.htmlMarks?r.htmlMarks:void 0}:e;this.sceneNodes=i.sceneNodes??[],this.sceneEdges=i.sceneEdges??[],this.labels=i.labels??[],function(e,t){e.customLayoutBackgrounds=t.backgrounds??null,e.customLayoutOverlays=t.overlays??null,e.customLayoutHtmlMarks=t.htmlMarks??[],e.lastCustomLayoutResult=t}(this,i)}advancePerspectiveTransition(e,t=!1){return this.perspective.advance(e,t)}rebuildNodeQuadtree(){let e=0,t=0,r=!1;for(let i of this.sceneNodes)"circle"===i.type&&i.datum&&(e++,i.r>t&&(t=i.r),i.pathD&&!i._perspectiveToken&&(r=!0));if(this._maxNodeRadius=t,r||e<=500)return void(this._nodeQuadtree=null);let i=[];for(let e of this.sceneNodes)"circle"===e.type&&e.datum&&i.push(e);this._nodeQuadtree=At().x(e=>e.cx).y(e=>e.cy).addAll(i)}get nodeQuadtree(){return this._nodeQuadtreeRevision!==this._sceneNodesRevision&&(this.rebuildNodeQuadtree(),this._nodeQuadtreeRevision=this._sceneNodesRevision),this._nodeQuadtree}get maxNodeRadius(){return this.nodeQuadtree,this._maxNodeRadius}_ensureArrays(){this._arrCacheVersion===this.layoutVersion&&this._nodesArrCache&&this._edgesArrCache||(this._nodesArrCache=Array.from(this.nodes.values()),this._edgesArrCache=Array.from(this.edges.values()),this._arrCacheVersion=this.layoutVersion)}get nodesArray(){return this._ensureArrays(),this._nodesArrCache??[]}get edgesArray(){return this._ensureArrays(),this._edgesArrCache??[]}get isAnimating(){return!(!e(this.config.chartType)?.supportsAnimation||!1===this.config.orbitAnimated)}tickAnimation(t,r){let i=e(this.config.chartType);if(!i?.tick)return!1;let n=i.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=i.hierarchical?Array.from(this.edges.values()):this.edgesArray;return i.tick(n,s,this.config,t,r)}cancelIntroAnimation(){this.transition&&this.snapToTargets(),this.transition=null;for(let e of this.nodes.values())e._prevX0=void 0,e._prevX1=void 0,e._prevY0=void 0,e._prevY1=void 0;for(let e of this.edges.values())e._prevY0=void 0,e._prevY1=void 0,e._prevSankeyWidth=void 0,e._prevCircularPathData=void 0,e._introFromZero=!1}advanceTransition(e){if(!this.transition)return!1;let t=ht(e,this.transition),r=yt(t,this.config.transition?.easing);for(let e of this.nodes.values())void 0!==e._targetX0&&void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1)&&(e.x0=dt(e._prevX0,e._targetX0,r),e.x1=dt(e._prevX1,e._targetX1,r),e.y0=dt(e._prevY0,e._targetY0,r),e.y1=dt(e._prevY1,e._targetY1,r));for(let e of this.edges.values())Sr(e,r);return this.rebuildAllBeziers(),!(t>=1&&(this.snapToTargets(),this.transition=null,1))}prepareForRelayout(){let e=this._boundedPrevSnapshot;for(let t of this.nodes.values()){let r=e?.get(t.id);r&&0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1?(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1):(t._prevX0=t.x0,t._prevX1=t.x1,t._prevY0=t.y0,t._prevY1=t.y1)}(function(e,t){for(let r of e){let e=t?.get(br(r))?.shift();wr(r,0===r.sankeyWidth?e:void 0)}})(this.edges.values(),this._boundedEdgeSnapshot),this.nodes.size>0&&(this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null)}finalizeLayout(){let e="vertical"===this.config.orientation?"down":"right";for(let e of this.nodes.values())"treemap"===this.config.chartType||"partition"===this.config.chartType||0!==e.x0||0!==e.x1||0!==e.y0||0!==e.y1?(e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2):(e.x0=e.x-5,e.x1=e.x+5,e.y0=e.y-5,e.y1=e.y+5,e.width=10,e.height=10);for(let t of this.edges.values())t.direction=e,this.updateEdgeBezier(t);this.tension=0}saveTargetPositions(){for(let e of this.nodes.values())e._targetX0=e.x0,e._targetX1=e.x1,e._targetY0=e.y0,e._targetY1=e.y1;for(let e of this.edges.values())kr(e)}restorePreviousPositions(){for(let e of this.nodes.values())void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1)&&(e.x0=e._prevX0,e.x1=e._prevX1,e.y0=e._prevY0,e.y1=e._prevY1);for(let e of this.edges.values())Sr(e,0);this.rebuildAllBeziers()}snapToTargets(){for(let e of this.nodes.values())void 0!==e._targetX0&&(e.x0=e._targetX0,e.x1=e._targetX1,e.y0=e._targetY0,e.y1=e._targetY1);for(let e of this.edges.values())Cr(e);this.rebuildAllBeziers()}updateEdgeBezier(e){!function(e,t,r=.5){let i="string"==typeof e.source?t.get(e.source):e.source,n="string"==typeof e.target?t.get(e.target):e.target;!i||!n||(e.circular&&e.circularPathData?e.bezier=function(e){let t,r=(e._circularWidth||e.sankeyWidth||1)/2,i=e.circularPathData;if(!i)throw new Error("buildCircularBezier requires circularPathData");if(e._circularStub){let e=Math.max(15,Math.min(40,.33*(i.rightFullExtent-i.sourceX))),t=Math.max(15,Math.min(40,.33*(i.targetX-i.leftFullExtent)));return{circular:!0,segments:[[{x:i.sourceX,y:i.sourceY},{x:i.sourceX+.33*e,y:i.sourceY},{x:i.sourceX+.66*e,y:i.sourceY},{x:i.sourceX+e,y:i.sourceY}],[{x:i.targetX-t,y:i.targetY},{x:i.targetX-.66*t,y:i.targetY},{x:i.targetX-.33*t,y:i.targetY},{x:i.targetX,y:i.targetY}]],halfWidth:r}}t="down"===e.direction?[{x:i.sourceY,y:i.sourceX},{x:i.sourceY,y:i.rightFullExtent},{x:i.verticalFullExtent,y:i.rightFullExtent},{x:i.verticalFullExtent,y:i.leftFullExtent},{x:i.targetY,y:i.leftFullExtent},{x:i.targetY,y:i.targetX}]:[{x:i.sourceX,y:i.sourceY},{x:i.rightFullExtent,y:i.sourceY},{x:i.rightFullExtent,y:i.verticalFullExtent},{x:i.leftFullExtent,y:i.verticalFullExtent},{x:i.leftFullExtent,y:i.targetY},{x:i.targetX,y:i.targetY}];let n=[];for(let e=0;e<t.length-1;e++){let r=t[e],i=t[e+1],s=i.x-r.x,o=i.y-r.y;n.push([r,{x:r.x+s/3,y:r.y+o/3},{x:r.x+2*s/3,y:r.y+2*o/3},i])}return{circular:!0,segments:n,halfWidth:r}}(e):e.bezier=function(e,t,r,i=.5){let n=(e.sankeyWidth||1)/2;if("down"===e.direction){let s=t.x1,o=r.x0,a=It(s,o);return{circular:!1,points:[{x:e.y0,y:s},{x:e.y0,y:a(i)},{x:e.y1,y:a(1-i)},{x:e.y1,y:o}],halfWidth:n}}let s=t.x1,o=r.x0,a=It(s,o);return{circular:!1,points:[{x:s,y:e.y0},{x:a(i),y:e.y0},{x:a(1-i),y:e.y1},{x:o,y:e.y1}],halfWidth:n}}(e,i,n,r))}(e,this.nodes,.5)}rebuildAllBeziers(){for(let e of this.nodes.values())e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;for(let e of this.edges.values())this.updateEdgeBezier(e)}applyPulse(e){!function(e){let t=e.pulse;if(!t)return;let r=t.duration??500,i=t.color??"rgba(255,255,255,0.6)",n=t.glowRadius??4,{now:s}=e;for(let t of e.sceneNodes){let o=t.id;if(!o)continue;let a=e.nodeTimestamps.get(o);if(!a)continue;let l=s-a;if(l>=r)continue;let c=1-l/r;t._pulseIntensity=c,t._pulseColor=i,t._pulseGlowRadius=n}for(let t of e.sceneEdges){let n=t.datum;if(!n)continue;let o="object"==typeof n.source?n.source?.id:n.source,a="object"==typeof n.target?n.target?.id:n.target;if(!o||!a)continue;let l=`${o}\0${a}`,c=e.edgeTimestamps.get(l);if(!c)continue;let d=s-c;if(d>=r)continue;let u=1-d/r;t._pulseIntensity=u,t._pulseColor=i}}({sceneNodes:this.sceneNodes,sceneEdges:this.sceneEdges,nodeTimestamps:this.nodeTimestamps,edgeTimestamps:this.edgeTimestamps,pulse:this.config.pulse,now:e})}applyDecay(){this._networkDecayCache||(this._networkDecayCache={sortedNodes:null,ageMap:null}),this._decaySortedNodes||(this._networkDecayCache.sortedNodes=null,this._networkDecayCache.ageMap=null),function(e){let t=e.decay;if(!t)return;let r=e.nodeTimestamps.size;if(r<=1)return;if(!e.cache.sortedNodes){e.cache.sortedNodes=Array.from(e.nodeTimestamps.entries()).sort((e,t)=>e[1]-t[1]);let t=new Map;for(let r=0;r<e.cache.sortedNodes.length;r++)t.set(e.cache.sortedNodes[r][0],r);e.cache.ageMap=t}let i=e.cache.ageMap;for(let n of e.sceneNodes){let e=n.id;if(!e)continue;let s=i.get(e);if(void 0===s)continue;let o=y(t,s,r),a=n.style?.opacity??1;n.style={...n.style,opacity:a*o}}}({sceneNodes:this.sceneNodes,nodeTimestamps:this.nodeTimestamps,decay:this.config.decay,cache:this._networkDecayCache}),this._decaySortedNodes=this._networkDecayCache.sortedNodes,this._decayAgeMap=this._networkDecayCache.ageMap}applyTopologyDiff(e){!function(e){for(let t of e.sceneNodes)t._pulseColor===ir&&(t._pulseIntensity=0,t._pulseColor=void 0,t._pulseGlowRadius=void 0);if(0===e.addedNodes.size)return;let t=e.now-e.lastTopologyChangeTime;if(t>=nr)return;let r=1-t/nr;for(let t of e.sceneNodes){let i=t.id;!i||!e.addedNodes.has(i)||(t._pulseIntensity=Math.max(t._pulseIntensity??0,r),t._pulseColor=ir,t._pulseGlowRadius=8)}}({sceneNodes:this.sceneNodes,addedNodes:this.addedNodes,lastTopologyChangeTime:this.lastTopologyChangeTime,now:e})}get hasActiveTopologyDiff(){return function(e,t,r=(typeof performance<"u"?performance.now():Date.now())){return 0!==e.size&&r-t<nr}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){let t=e.thresholds;if(!t)return;let r=t.warningColor??"#f59e0b",i=t.criticalColor??"#ef4444",n=!1!==t.pulse;for(let s of e.sceneNodes){let o=s.id;if(!o)continue;let a=e.nodes.get(o);if(!a)continue;let l=t.metric(a),c=null;void 0!==t.critical&&l>=t.critical?c=i:void 0!==t.warning&&l>=t.warning&&(c=r),c&&(s.style={...s.style,fill:c},n&&(s._pulseIntensity=.6+.4*Math.sin(e.now/300),s._pulseColor=c,s._pulseGlowRadius=6))}}({sceneNodes:this.sceneNodes,nodes:this.nodes,thresholds:this.config.thresholds,now:e})}get hasActiveThresholds(){return function(e,t){if(!t)return!1;for(let r of e){let e=t.metric(r);if(void 0!==t.warning&&e>=t.warning||void 0!==t.critical&&e>=t.critical)return!0}return!1}(this.nodes.values(),this.config.thresholds)}get hasActivePulses(){return function(e){let t=e.pulse;if(!t||0===e.lastIngestTime)return!1;let r=e.now??(typeof performance<"u"?performance.now():Date.now()),i=t.duration??500;return r-e.lastIngestTime<i}({pulse:this.config.pulse,lastIngestTime:this.lastIngestTime})}getLayoutData(){return{nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values())}}updateNode(e,t){let r=this.nodes.get(e);if(!r)return this.updateResults.recordNoop("update"),null;let i=r.data?{...r.data}:{};return r.data=t(r.data??{}),this.layoutVersion++,this.activity.touch(),this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),i}updateEdge(e,t,r){return this.replaceEdgeData([...this.edges.values()].filter(r=>{let i="string"==typeof r.source?r.source:r.source.id,n="string"==typeof r.target?r.target:r.target.id;return i===e&&n===t}),r)}replaceEdgeData(e,t){let r=[],i=[];for(let r of e){let e=t({...r.data});Ht(r,e,this.config),i.push({edge:r,data:e})}for(let{edge:e,data:t}of i){let i=Bt(e.data??{},this.config.valueAccessor,"value");r.push({...e.data}),e.data=t;let n=Bt(t,this.config.valueAccessor,"value");Object.is(i,n)||(e.value=jt(n))}return r.length>0?(this.layoutVersion++,this.activity.touch(),this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length)):this.updateResults.recordNoop("update"),r}updateEdgeById(e,t){if("id"!==this.config.edgeIdentity)throw new Error("updateEdgeById requires edgeIdentity=id.");let r=this.edges.get(JSON.stringify(["id",e]));return this.replaceEdgeData(r?[r]:[],t)[0]??null}removeNode(e){if(!this.nodes.has(e))return this.updateResults.recordNoop("remove"),!1;this.nodes.delete(e),this.nodeTimestamps.delete(e);for(let t of this.edgeIncidence().get(e)??[])this.deleteIndexedEdge(t);return this.incidentEdges?.delete(e),this.layoutVersion++,this.activity.touch(),this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",1),!0}removeEdge(e,t){let r=[];if(void 0===t){let t=this.config.edgeIdAccessor??("id"===this.config.edgeIdentity?"id":void 0);if(!t)throw new Error("removeEdge(edgeId) requires edgeIdAccessor to be configured. Use removeEdge(sourceId, targetId) instead.");let i="function"==typeof t?t:e=>e?.[t];for(let[t,n]of this.edges)n.data&&i(n.data)===e&&r.push(t)}else for(let[i,n]of this.edges){let s="string"==typeof n.source?n.source:n.source.id,o="string"==typeof n.target?n.target:n.target.id;s===e&&o===t&&r.push(i)}for(let e of r)this.deleteIndexedEdge(e);return r.length>0?(this.layoutVersion++,this.activity.touch(),this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length)):this.updateResults.recordNoop("remove"),r.length>0}clear(){this._customLayoutCache.clear(),this._rawCustomResult=null,this.perspective.underlay=[],this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._decayAgeMap=null,this._nodeQuadtree=null,this._nodesArrCache=null,this._edgesArrCache=null,this._sceneNodesRevision++,this.tension=0,this.layoutVersion++,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],Nr(this),this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.transition=null,this._hasRenderedOnce=!1,this.activity.clear(),this.lastIngestTime=0,this._lastPositionSnapshot=null,this.nodeTimestamps.clear(),this.edgeTimestamps.clear(),this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.particlePool&&this.particlePool.clear(),this.updateResults.recordData("clear")}};function Mr(e,t,r,i,n){return{id:t,className:"stream-network-frame"+(e.className?` ${e.className}`:""),role:"group","aria-busy":i||void 0,"aria-label":e.description||("string"==typeof e.title?e.title:"Network chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:e.responsiveWidth?"100%":r[0],height:e.responsiveHeight?"100%":r[1],overflow:e.viewTransform?"clip":n}}}function Pr(e){return He(e.datum||{},e.x,e.y,{nodeOrEdge:"node"})}var Dr=/^(value|amount|total|count|weight|score)$/i,Lr=/*#__PURE__*/ot(function({data:e}){if("edge"===e.nodeOrEdge){let t=e.data;if(!t)return null;let r="object"==typeof t.source?t.source.id:t.source,i="object"==typeof t.target?t.target.id:t.target,n=t.__chordEdges;return n&&n.length>1?Tt("div",{className:"semiotic-tooltip",style:at,children:[Tt("div",{style:{fontWeight:600},children:["Connections: ",n.length]}),n.map((e,t)=>Tt("div",{style:{marginTop:4,opacity:.8},children:["object"==typeof e.source?e.source.id:e.source," → ","object"==typeof e.target?e.target.id:e.target,": ",e.value.toLocaleString()]},e._edgeKey??t))]}):Tt("div",{className:"semiotic-tooltip",style:at,children:[Tt("div",{style:{fontWeight:600},children:[r," → ",i]}),null!=t.value&&Tt("div",{style:{marginTop:4,opacity:.8},children:["Value:"," ","number"==typeof t.value?t.value.toLocaleString():String(t.value)]})]})}let t=e.data;if(!t)return null;let r=t.__hierarchyNode;if(r){let e=[],i=r;for(;i;){let r=i.data?.name??i.data?.id??t.id;null!=r&&e.unshift(String(r)),i=i.parent}e.length>1&&e.shift();let n=e.length-1;return Tt("div",{className:"semiotic-tooltip",style:at,children:[Rt("div",{children:e.map((e,t)=>Tt("span",{children:[t>0&&Rt("span",{style:{margin:"0 3px",opacity:.5},children:" → "}),t===n?Rt("strong",{children:e}):Rt("span",{style:{opacity:.7},children:e})]},t))}),null!=t.value&&t.value>0&&Rt("div",{style:{marginTop:4,opacity:.8},children:"number"==typeof t.value?t.value.toLocaleString():String(t.value)})]})}let i=(t.sourceLinks?.length||0)+(t.targetLinks?.length||0),n=(t.sourceLinks||[]).reduce((e,t)=>e+(t.value||0),0)+(t.targetLinks||[]).reduce((e,t)=>e+(t.value||0),0),s=t.data??t,o=U(s),a=null!=o.title?String(o.title):t.id,l=o.entries.some(e=>Dr.test(e.key));return Tt("div",{className:"semiotic-tooltip",style:at,children:[Rt("div",{style:{fontWeight:600},children:a}),o.entries.map(e=>Tt("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",k(e.value)]},e.key)),!l&&null!=t.value&&t.value>0&&Tt("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():String(t.value)]}),i>0&&Tt("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",i,n!==i&&` (weighted: ${n.toLocaleString()})`]})]})});function Wr(e){return e?._semioticCamera}function Or(e,t=!1){return Wr(e)?.transformRef(t)}var Fr={x:0,y:0,k:1};function Br(e){return e&&Number.isFinite(e.k)&&e.k>0&&Number.isFinite(e.x)&&Number.isFinite(e.y)?e:Fr}function zr(e,t){return{...e,x:e.x*t.k+t.x,y:e.y*t.k+t.y}}function jr(e,t){return{x:(e.x-t.x)/t.k,y:(e.y-t.y)/t.k,width:e.width/t.k,height:e.height/t.k}}function $r({view:e,width:t,height:r,children:i}){if(!e)return i;let{x:n,y:s,k:o}=Br(e);return Rt("svg",{role:"presentation",width:t,height:r,overflow:"hidden","data-network-view":"",children:Rt("g",{ref:Or(e),transform:`translate(${n},${s}) scale(${o})`,children:i})})}var Yr=()=>()=>{};function Hr(e,t=!0){let r=t?Wr(e):void 0,i=r?.getSnapshot??(()=>Br(e));return mt(r?.subscribe??Yr,i,i)}function Xr(e,t=e.getSnapshot){return gt.useSyncExternalStore(e.subscribe,t,e.getServerSnapshot)}function Vr({hoverStore:e,kbFocusIndexRef:t,store:r}){let i=Xr(e,()=>t.current>=0?e.getSnapshot():null);return Rt(Z,{hoverPoint:i,scene:"edge"===i?.nodeOrEdge?r.sceneEdges:r.sceneNodes})}function Gr({viewTransform:e,hoverStore:t,kbFocusIndexRef:r,focusedNavPointRef:i,enableHover:n,tooltipContent:s,margin:o,size:a,adjustedWidth:l,adjustedHeight:c}){let d=Xr(t),u=r.current>=0,h=i.current,y=Hr(e,!!d),g=d?zr(d,y):null;return Tt(Nt,{children:[Rt(J,{active:u,hoverPoint:g,margin:o,size:a,shape:h?.shape,width:null==h?.w?void 0:h.w*y.k,height:null==h?.h?void 0:h.h*y.k}),n&&Rt(ee,{contentOwnsChrome:lt(s),x:g?.x??0,y:g?.y??0,containerWidth:l,containerHeight:c,margin:o,className:"stream-network-tooltip",zIndex:2,children:null==d?null:s?s(d):Rt(Lr,{data:d})})]})}function Qr(){let e=null,t=new Set;return{getSnapshot:()=>e,getServerSnapshot:()=>null,subscribe:e=>(t.add(e),()=>{t.delete(e)}),set(r){let i="function"==typeof r?r(e):r;e!==i&&(e=i,t.forEach(e=>e()))}}}function qr(e,t,r="slab-face"){let i=e.style.fill;return(e.style.opacity??1)<=0||(e.style.fillOpacity??1)<=0||"string"==typeof i&&/^\s*(none|transparent)\s*$|^rgba\(.*,\s*0(\.0+)?\s*\)$|^#[\da-f]{3}0$|^#[\da-f]{6}00$/i.test(i)?null:e.faces?.map((i,n)=>Rt("path",{"data-perspective-part":r,"data-perspective-face":n,d:i.pathD,fill:"string"==typeof e.style.fill?o(e.style.fill,i.shade):t,fillOpacity:e.style.fillOpacity,opacity:e.style.opacity},`face-${n}`))}function Kr(e,t){switch(e.type){case"circle":case"rect":case"arc":{let r,i=e,n=`net-${i.type}-${t}`,s=`${n}-hatch`,o=Ge(i.style.fill)?Qe(i.style.fill,s):void 0,a={fill:o?`url(#${s})`:ne(i.style.fill),...ie(i.style)},l="circle"===i.type&&i._perspectiveToken;if(i.pathD)r=Rt("path",{"data-perspective-part":l?"token-top":"slab-top",d:i.pathD,...a});else if("circle"===i.type)r=Rt("circle",{cx:i.cx,cy:i.cy,r:i.r,...a});else if("rect"===i.type)r=Rt("rect",{x:i.x,y:i.y,width:i.w,height:i.h,...a});else{let e=Mt().innerRadius(i.innerR).outerRadius(i.outerR).startAngle(i.startAngle+Math.PI/2).endAngle(i.endAngle+Math.PI/2)(se)||"";r=Rt("path",{d:e,transform:`translate(${i.cx},${i.cy})`,...a})}return Tt(gt.Fragment,{children:[o&&Rt("defs",{children:o}),i.pathD&&qr(i,a.fill,l?"token-rim":"slab-face"),r]},n)}case"symbol":{let r=e,i=et(r.symbolType,r.size,r.path),n=r.rotation?`translate(${r.cx},${r.cy}) rotate(${180*r.rotation/Math.PI})`:`translate(${r.cx},${r.cy})`,s=Rt("path",{"data-perspective-part":r._perspectiveToken?"token-top":void 0,d:i,transform:n,fill:r.style.fill?ne(r.style.fill):"none",...ie(r.style)},`net-symbol-${t}`);return r.faces?.length?Tt(gt.Fragment,{children:[qr(r,r.style.fill?ne(r.style.fill):void 0,"token-rim"),s]},`net-symbol-${t}`):s}case"glyph":{let r=e;return re(r,r.cx,r.cy,`net-glyph-${r.id??t}`)}default:return null}}function Ur(e,t){return te(Zr(e,t),e,`network-edge-cursor-${t}`)}function Zr(e,t){switch(e.type){case"line":{let r=e;return Rt("line",{"data-perspective-part":r._perspectivePart,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,stroke:r.style.stroke||"#999",strokeOpacity:r.style.strokeOpacity,strokeWidth:r.style.strokeWidth??1,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity},`net-edge-${t}`)}case"bezier":{let r=e,i=`net-bezier-${t}-hatch`,n=Ge(r.style.fill)?Qe(r.style.fill,i):void 0;return Tt(gt.Fragment,{children:[n&&Rt("defs",{children:n}),Rt("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:n?`url(#${i})`:ne(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity??.5,stroke:r.style.stroke||"none",strokeOpacity:.5*(r.style.strokeOpacity??1),strokeWidth:r.style.strokeWidth,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity})]},`net-edge-${t}`)}case"ribbon":{let r=e,i=`net-ribbon-${t}-hatch`,n=Ge(r.style.fill)?Qe(r.style.fill,i):void 0;return Tt(gt.Fragment,{children:[n&&Rt("defs",{children:n}),Rt("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:n?`url(#${i})`:ne(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity??.5,stroke:r.style.stroke||"none",strokeOpacity:.3*(r.style.strokeOpacity??1),strokeWidth:r.style.strokeWidth,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity})]},`net-edge-${t}`)}case"curved":{let r=e;return Rt("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:ne(r.style.fill,"none"),fillOpacity:r.style.fill&&"none"!==r.style.fill?r.style.fillOpacity??.1:void 0,stroke:r.style.stroke||"#999",strokeOpacity:r.style.strokeOpacity,strokeWidth:r.style.strokeWidth??1,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity},`net-edge-${t}`)}default:return null}}function Jr(e){let t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:String(t)}function ei(e){if("glyph"===e.type&&e.glyph&&"number"==typeof e.size){let t=e.cx??e.x,r=e.cy??e.y;if("number"!=typeof t||"number"!=typeof r)return null;let i=tt(e.glyph,e.size);return{x:t+i.centerDx,y:r+i.centerDy,r:Math.max(1,i.radius)}}let t=e.cx??(null!=e.x&&null!=e.w?e.x+e.w/2:e.x),r=e.cy??(null!=e.y&&null!=e.h?e.y+e.h/2:e.y);return"number"!=typeof t||"number"!=typeof r?null:{x:t,y:r,r:"number"==typeof e.r?Math.max(1,e.r):"number"==typeof e.outerR?Math.max(1,e.outerR):"number"==typeof e.size?Math.max(1,rt(e.size)):Math.max(1,e.w??0,e.h??0)/2}}function ti({annotations:e,sceneNodes:t,viewTransform:r,margin:i,width:n,height:s,activation:o}){let a=Hr(r,e?.some(e=>"widget"===e.type)??!1);return e?.filter(e=>"widget"===e.type&&(null!=e.pointId||null!=e.nodeId)&&t).map((e,l)=>{let c=!0===e._annotationDeferred,d=e.pointId??e.nodeId,u=t.find(e=>e.id===d||e.datum?.id===d||e.datum?.data?.id===d||e.datum?.data?.name===d),h=u&&ei(u);if(!h)return null;let y=zr(h,a);if(r&&(y.x<0||y.y<0||y.x>n||y.y>s))return null;let g=i.left+y.x,p=i.top+y.y,f=e.dx??0,m=e.dy??-16,v=e.width??32,b=e.height??32,x=e.content??Rt("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return Rt("div",{...oe(e,o),className:c?"annotation-deferred":void 0,"data-annotation-disclosure":c?"deferred":void 0,style:{position:"absolute",left:g+f-v/2,top:p+m-b/2,width:v,height:b,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:x},`widget-${l}`)})??null}var ri=/*#__PURE__*/ae(function(e){let{width:t,height:r,totalWidth:i,totalHeight:n,margin:s,labels:o,title:a,description:l,idPrefix:c,decorative:d=!1,legend:u,legendHoverBehavior:h,legendClickBehavior:y,legendHighlightedCategory:g,legendIsolatedCategories:p,legendPosition:f="right",legendLayout:m,foregroundGraphics:v,sceneNodes:b,annotations:x,onAnnotationActivate:w,onObservation:k,chartId:R,chartType:N,autoPlaceAnnotations:T,svgAnnotationRules:A,annotationFrame:I}=e,M=le({onAnnotationActivate:w,onObservation:k,chartId:R,chartType:N}),P=gt.useMemo(()=>{let e=function(e){if(!e)return;let t=[];for(let r of e){let e=ei(r);e&&t.push({pointId:Jr(r),...e})}return t}(b)??[];return{scales:null,width:t,height:r,frameType:"network",pointNodes:e,sceneNodes:b}},[r,b,t]),D=gt.useMemo(()=>{if(!x)return x;let e=_(x);return T?ce({annotations:e,context:P,..."object"==typeof T?T:{}}):e},[x,T,P]),L=gt.useMemo(()=>de("network"),[]),W=D?ue(D.filter(e=>"widget"!==e.type),L,A,P):null,O=!0===D?.some(e=>"widget"===e.type&&!0===e._annotationDeferred),F=bt(),{titleId:B,descId:z,labelledBy:j}=S(c||R||F);return Tt(Nt,{children:[O&&Rt("style",{children:he},"annotation-widget-disclosure-style"),Tt("svg",{"data-semiotic-overlay":"",role:d?"presentation":"img","aria-labelledby":d?void 0:j,width:i,height:n,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[!d&&Tt(Nt,{children:[Rt("title",{id:B,children:C(a,"Network Chart")}),Rt("desc",{id:z,children:E(a,l,{familyPhrase:"network data visualization",fallback:"Network data visualization"})})]}),Rt("g",{transform:`translate(${s.left},${s.top})`,children:Tt($r,{view:e.viewTransform,width:t,height:r,children:[o.map((e,t)=>function(e,t,r="middle",i="auto"){return Rt("text",{x:e.x,y:e.y,textAnchor:e.anchor||r,dominantBaseline:e.baseline||i,fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,transform:e.rotate?`rotate(${Math.round(180*e.rotate/Math.PI*100)/100} ${e.x} ${e.y})`:void 0,style:{pointerEvents:"none"},children:e.text},`net-label-${t}`)}(e,t,"start","middle")),W,v]})}),Rt(ye,{title:a,totalWidth:i,marginTop:s.top}),ge({legend:u,totalWidth:i,totalHeight:n,margin:s,legendPosition:f,title:a,legendLayout:m,legendHoverBehavior:h,legendClickBehavior:y,legendHighlightedCategory:g,legendIsolatedCategories:p})]}),Rt(ti,{annotations:D,sceneNodes:b,viewTransform:e.viewTransform,margin:s,width:t,height:r,activation:M})]})},"NetworkSVGOverlay");function ii(e){return e&&{...e,sceneNodes:e.sceneNodes?.map(e=>({...e})),htmlMarks:e.htmlMarks?.map(e=>({...e}))}}function ni(e){let t=e.getBoundingClientRect();return{x:t.left+e.clientLeft,y:t.top+e.clientTop,width:e.clientWidth,height:e.clientHeight}}function si(e,t){let r=Math.max(e.x,t.x),i=Math.max(e.y,t.y);return{x:r,y:i,width:Math.max(0,Math.min(e.x+e.width,t.x+t.width)-r),height:Math.max(0,Math.min(e.y+e.height,t.y+t.height)-i)}}function oi(e,t){return e.width>0&&e.height>0&&t.x+t.width>=e.x&&t.x<=e.x+e.width&&t.y+t.height>=e.y&&t.y<=e.y+e.height}var ai=[],li=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),ci={position:"absolute",top:0,left:0,pointerEvents:"none"},di=/*#__PURE__*/gt.memo(function({marks:e}){return Rt(Nt,{children:e.map(e=>Rt("div",{className:"semiotic-network-html-mark","data-mark-id":e.id,style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.width,height:e.height,pointerEvents:"none"},children:e.content},e.id))})},(e,t)=>e.marks.length===t.marks.length&&e.marks.every((e,r)=>{let i=t.marks[r];return e.id===i.id&&e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height&&e.content===i.content}));function ui({marks:e,margin:t,selection:r=null,width:i,height:n,viewTransform:s,viewport:o,htmlMarkCulling:a,onViewportChange:l}){let c=gt.useRef(null),[d,u]=gt.useState(null),h=function({containerRef:e,marks:t,width:r,height:i,margin:n,focusedId:s,viewTransform:o,viewport:a,htmlMarkCulling:l,onViewportChange:c}){let d=t??ai,[u,h]=xt(null),y=pt(null);vt(()=>{y.current?.schedule()},[d,r,i,n.left,n.top]),vt(()=>{let t=e.current,r=t?o?t.closest(".stream-network-frame"):function(e,t){if(void 0!==t?.scrollContainer)return t.scrollContainer;if(t?.scrollContainerRef)return t.scrollContainerRef.current;let r=e.ownerDocument.defaultView;for(let t=e.parentElement;t&&r;t=t.parentElement){let e=r.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e.overflow} ${e.overflowX} ${e.overflowY}`))return t}return null}(t,a):null,i=t&&r?function(e,t){let r=e.ownerDocument.defaultView,i=new Map;for(let n of[e.parentElement,t.parentElement])for(let e=n;e;e=e.parentElement){if(e===t||i.has(e))continue;let n=r.getComputedStyle(e),s=/(auto|scroll|overlay|hidden|clip)/.test(n.overflowX||n.overflow),o=/(auto|scroll|overlay|hidden|clip)/.test(n.overflowY||n.overflow);(s||o)&&i.set(e,{element:e,x:s,y:o})}return[...i.values()]}(t,r):[],n=y.current;if(n?.layer!==t||n?.root!==r||n.clips.length!==i.length||!i.every((e,t)=>st(e,n.clips[t])))if(n?.dispose(),y.current=null,t&&r){let e=t.ownerDocument.defaultView,n=null,s=()=>{n=null;let e=function(e,t,r){let i=ni(t);if(i.width<=0||i.height<=0)return null;let n=e.ownerDocument.defaultView,s=si(i,{x:0,y:0,width:n.innerWidth,height:n.innerHeight});for(let e of r){let t=ni(e.element);s=si(s,{x:e.x?t.x:s.x,y:e.y?t.y:s.y,width:e.x?t.width:s.width,height:e.y?t.height:s.height})}let o=e.getBoundingClientRect();return{...s,x:s.x-o.left,y:s.y-o.top}}(t,r,i);h(t=>st(t,e)?t:e)},o=()=>{null===n&&(n=e.requestAnimationFrame(s))};t.ownerDocument.addEventListener("scroll",o,{passive:!0,capture:!0}),e.addEventListener("resize",o,{passive:!0});let a=new ResizeObserver(o),l=new Set([r,t.parentElement,...i.map(e=>e.element)]);for(let e of l)a.observe(e);let c=()=>{null!==n&&e.cancelAnimationFrame(n),a.disconnect(),t.ownerDocument.removeEventListener("scroll",o,!0),e.removeEventListener("resize",o)};y.current={layer:t,root:r,clips:i,schedule:o,dispose:c},s()}else null!==u&&h(null)}),vt(()=>()=>{y.current?.dispose(),y.current=null},[]);let g=Number.isFinite(l?.overscan)&&l.overscan>=0?l.overscan:400,p=ft(()=>{let e=null!=r&&null!=i?{x:0,y:0,width:r,height:i}:null,t=u&&e?si(u,e):u,a=o?t??e:u,c=o&&(t??e)?jr(t??e,Br(o)):t,h=a?{x:a.x-g,y:a.y-g,width:a.width+2*g,height:a.height+2*g}:null,y=o&&h?jr(h,Br(o)):h&&e?si(h,e):h,p=new Set(l?.pinnedIds);null!==s&&p.add(s);let f=!1!==l?.enabled&&y?d.filter(e=>p.has(e.id)||oi(y,e)):d,m={...e?{plotRect:{...e,x:n.left,y:n.top}}:{},visibleRect:c,renderRect:y,visibleMarkIds:c?d.filter(e=>oi(c,e)).map(e=>e.id):null,mountedMarkIds:f.map(e=>e.id)};return{mounted:f,snapshot:m}},[d,u,r,i,g,l?.enabled,l?.pinnedIds,s,o,n.left,n.top]),f=p(),[,m]=wt(e=>e+1,0),v=pt(void 0),b=ft(e=>{c?st(v.current,e)||(v.current=e,c(e)):v.current=void 0},[c]);return kt(()=>{let e=p();li(e.mounted,f.mounted)&&b(e.snapshot)},[p,b,f.mounted]),vt(()=>Wr(o)?.subscribe(()=>{let e=p();li(e.mounted,f.mounted)?b(e.snapshot):m()},!0),[p,b,f.mounted,o]),f.mounted}({containerRef:c,marks:e,width:i,height:n,focusedId:d,viewTransform:s,viewport:o,htmlMarkCulling:a,onViewportChange:l,margin:t});if(gt.useLayoutEffect(()=>{if(null===d||e?.some(e=>e.id===d))return;let t=c.current,r=t?.ownerDocument;r?.activeElement===r?.body&&t?.closest(".stream-network-frame")?.focus({preventScroll:!0}),u(null)},[e,d]),!(e&&0!==e.length||l||null!==d))return null;let y=Br(s),g=Rt("div",{className:"semiotic-network-html-marks",ref:c,onFocusCapture:e=>{let t=e.target.closest("[data-mark-id]");t&&e.currentTarget.contains(t)&&u(t.dataset.markId??null)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||u(null)},style:{...ci,transform:`translate(${t.left}px, ${t.top}px)`,...s?{width:i,height:n,overflow:"clip"}:{}},children:Rt("div",{ref:Or(s,!0),style:{transformOrigin:"0 0",transform:`translate(${y.x}px, ${y.y}px) scale(${y.k})`},children:Rt(di,{marks:h.map(e=>({...e}))})})});return Rt(H,{value:r,children:g})}var hi=/*#__PURE__*/gt.lazy(()=>import("./c-XG4LL2VI.min.js"));function yi(e){let{nodes:t,edges:r,chartTitle:i,chartType:n,tableId:s}=e,o=pe(),{nodeCount:a,edgeCount:l}=function(e,t){let r=0,i=0;for(let t of e)t&&"object"==typeof t&&null!==t.datum&&r++;for(let e of t){if(!e||"object"!=typeof e)continue;let t=e.datum,r=t&&"object"==typeof t&&!Array.isArray(t)&&"__chordEdges"in t?t.__chordEdges:void 0;i+=Array.isArray(r)?r.length:1}return{nodeCount:r,edgeCount:i}}(t,r);return a||l?Rt(fe,{interaction:o,tableId:s,regionLabel:`Data summary for ${i||n}`,countLabel:`${nt(a,"node")}, ${nt(l,"edge")}`,className:it,children:o.isExpanded&&Rt(gt.Suspense,{fallback:Rt("div",{role:"status",children:"Loading data summary…"}),children:Rt(hi,{...e,revealRows:o.revealRows})})}):s?Rt("span",{id:s,tabIndex:-1,style:Ye}):null}function gi(e){return Tt(Nt,{children:[Rt(me,{tableId:e.tableId}),Rt(yi,{...e})]})}function pi(e,t,r,i){let{accessibleTable:n=!0,summary:s,title:o}=e;return Tt(Nt,{children:[n&&Rt(ve,{accessibleTable:n,children:Rt(gi,{sceneRevision:i,nodes:t.sceneNodes,edges:t.sceneEdges,chartType:"Network chart",tableId:r,chartTitle:"string"==typeof o?o:void 0})}),Rt(be,{summary:s})]})}function fi(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function mi(e,t){let r="source-over"===e.globalCompositeOperation;for(let i of t){if(r&&(0===i.style.opacity||0===i.style.strokeOpacity)&&(!i.style.fill||"none"===i.style.fill||0===(i.style.fillOpacity??("curved"===i.type?.1:i.style.opacity)))&&(!("_pulseIntensity"in i)||!i._pulseIntensity))continue;if("line"===i.type){if("none"===i.style.stroke||(i.style.strokeWidth??1)<=0)continue}else if(!i.pathD)continue;let t=e.globalAlpha;if(e.save(),i.style.strokeDasharray&&e.setLineDash(i.style.strokeDasharray.split(/[\s,]+/).map(Number)),i.style.strokeLinecap&&(e.lineCap=i.style.strokeLinecap),"line"===i.type)e.beginPath(),e.moveTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),vi(e,i,t),j(i)&&(e.setLineDash([]),e.strokeStyle=i._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=(i.style.strokeWidth??1)+3*i._pulseIntensity,e.globalAlpha=t*i._pulseIntensity*.4,e.stroke());else{let r=fi(i);"curved"===i.type&&vi(e,i,t,r),bi(e,i,t,r),"curved"!==i.type&&(vi(e,i,t,r),j(i)&&(e.fillStyle=i._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=t*i._pulseIntensity*("bezier"===i.type?.2:.25),e.fill(r)))}e.restore()}}function vi(e,t,r,i){let n="bezier"===t.type||"ribbon"===t.type,s=t.style.strokeWidth??(n?.5:1);if(s<=0||"none"===t.style.stroke||n&&!t.style.stroke)return;let o=t.style.stroke||"#999";e.strokeStyle=qe(e,o)||o,e.lineWidth=s;let a="bezier"===t.type?.5:"ribbon"===t.type?.3:1;e.globalAlpha=r*(t.style.opacity??1)*(t.style.strokeOpacity??1)*a,i?e.stroke(i):e.stroke()}function bi(e,t,r,i){if(!t.style.fill||"none"===t.style.fill)return;let n="bezier"===t.type?t._gradient:void 0;if(n){let r=e.createLinearGradient(n.x0,n.y0??0,n.x1,n.y1??0),i="string"==typeof t.style.fill?t.style.fill:"#999",s=qe(e,i)||i;r.addColorStop(0,1===n.from?s:"transparent"),r.addColorStop(1,1===n.to?s:"transparent"),e.fillStyle=r}else e.fillStyle=Ke(e,t.style.fill,"#007bff");e.globalAlpha=r*(t.style.opacity??1)*(t.style.fillOpacity??("curved"===t.type?.1:.5)),e.fill(i)}var xi=null;function wi(e){if(typeof Path2D>"u"||!e)return null;xi||(xi=new Map);let t=xi.get(e);return t||(t=new Path2D(e),xi.size>2048&&xi.clear(),xi.set(e,t)),t}function ki(e,t,r,i){if(!r?.length||!t.fill)return;let n=e.globalAlpha,s=n*(t.opacity??1)*(t.fillOpacity??1);if(!(s>0))return;let a=Ke(e,t.fill,i),l=a;if("string"!=typeof a||!/^\s*(none|transparent)\s*$/i.test(a)&&(e.fillStyle=a,l=e.fillStyle,!/^rgba\(.*,\s*0(\.0+)?\s*\)$/.test(l))){e.globalAlpha=s;for(let t of r){let r=wi(t.pathD);r&&(e.fillStyle="string"==typeof l?o(l,t.shade):l,e.fill(r))}e.globalAlpha=n}}function _i(e,t,r){let i="source-over"===e.globalCompositeOperation;for(let n of t){if(n.type!==r)continue;let t=n;if("circle"===t.type&&t.r<=0||"rect"===t.type&&(t.w<=0||t.h<=0))continue;let s="arc"===t.type?void 0:t._pulseIntensity;if(i&&Ue(t.style,s))continue;e.save();let o=t.pathD?wi(t.pathD):null;o?ki(e,t.style,t.faces,"#007bff"):"circle"===t.type?(e.beginPath(),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)):"arc"===t.type&&(e.beginPath(),e.arc(t.cx,t.cy,t.outerR,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerR,t.endAngle,t.startAngle,!0),e.closePath()),Ze(e,t.style,"#007bff",()=>{o?e.fill(o):"rect"===t.type?e.fillRect(t.x,t.y,t.w,t.h):e.fill()}),Je(e,t.style,()=>{o?e.stroke(o):"rect"===t.type?e.strokeRect(t.x,t.y,t.w,t.h):e.stroke()}),"circle"===t.type?$(e,t,e.globalAlpha):"rect"===t.type&&Y(e,t,e.globalAlpha,o),e.restore()}}function Si(e,t){if(!t.some(e=>"symbol"===e.type&&e.faces))return void u(e,t);let r=e.globalAlpha;for(let i of t)"symbol"===i.type&&(i.faces&&(ki(e,i.style,i.faces,"#007bff"),e.globalAlpha=r),u(e,[i]))}function Ci(e){return xe(e.sceneNodes.length,e.sceneEdges.length,e.perspective.label("Network chart"))}var Ei=2*Math.PI,Ri=e=>(e%Ei+Ei)%Ei;function Ni(e,t){let r=1-t;return r**3*e[0]+3*r*r*t*e[1]+3*r*t*t*e[2]+t**3*e[3]}function Ti(e,t){let r=e.map(e=>e[0]),i=e.map(e=>e[1]);t(r[0],i[0]),t(r[3],i[3]);for(let e of[r,i]){let n=-e[0]+3*e[1]-3*e[2]+e[3],s=2*(e[0]-2*e[1]+e[2]),o=e[1]-e[0],a=Math.abs(n)<1e-12?0===s?[]:[-o/s]:s*s-4*n*o<0?[]:[(-s+Math.sqrt(s*s-4*n*o))/(2*n),(-s-Math.sqrt(s*s-4*n*o))/(2*n)];for(let e of a)e>0&&e<1&&t(Ni(r,e),Ni(i,e))}}function Ai(e,t,r,i){let[n,s]=r.map(Math.abs);if(i(...e),i(...t),0===n||0===s||e[0]===t[0]&&e[1]===t[1])return;let o=r[2]*Math.PI/180,a=Math.cos(o),l=Math.sin(o),c=(e[0]-t[0])/2,d=(e[1]-t[1])/2,u=a*c+l*d,h=-l*c+a*d,y=Math.hypot(u/n,h/s);y>1&&(n*=y,s*=y);let g=(u/n)**2+(h/s)**2,p=(r[3]===r[4]?-1:1)*Math.sqrt(Math.max(0,(1-g)/g)),f=p*n*h/s,m=-p*s*u/n,v=a*f-l*m+(e[0]+t[0])/2,b=l*f+a*m+(e[1]+t[1])/2,x=Math.atan2((h-m)/s,(u-f)/n),w=Math.atan2((-h-m)/s,(-u-f)/n),k=r[4]?Ri(w-x):-Ri(x-w),_=Math.atan2(-s*l,n*a),S=Math.atan2(s*a,n*l);for(let e of[_,_+Math.PI,S,S+Math.PI])Ri(k>=0?e-x:x-e)<=Math.abs(k)+1e-12&&i(v+n*a*Math.cos(e)-s*l*Math.sin(e),b+n*l*Math.cos(e)+s*a*Math.sin(e))}function Ii(e){let t=0,r="",i="",n=[0,0],s=[0,0],o=[0,0],a=1/0,l=1/0,c=-1/0,d=-1/0,u=(e,t)=>{a=Math.min(a,e),l=Math.min(l,t),c=Math.max(c,e),d=Math.max(d,t)},h=()=>{for(;t<e.length&&/[\s,]/.test(e[t]);)t++},y=(r=!1)=>{h();let i=r?/^[01]/.exec(e.slice(t)):/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(t));return i?(t+=i[0].length,Number(i[0])):NaN};for(;t<e.length&&(h(),t!==e.length);){/[a-z]/i.test(e[t])&&(r=e[t++]);let a=r.toUpperCase(),l=r!==a;if(!i&&"M"!==a)return null;if("Z"===a){u(...n),u(...s),n=[...s],i="Z",r="";continue}let c={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7}[a];if(!c)return null;let d=Array.from({length:c},(e,t)=>y("A"===a&&(3===t||4===t)));if(!d.every(Number.isFinite))return null;let h=e=>[d[e]+(l?n[0]:0),d[e+1]+(l?n[1]:0)],g="H"===a?[d[0]+(l?n[0]:0),n[1]]:"V"===a?[n[0],d[0]+(l?n[1]:0)]:h(c-2),p=[2*n[0]-o[0],2*n[1]-o[1]];if("C"===a||"S"===a){let e="C"===a?h(0):/[CS]/.test(i)?p:n;o=h(c-4),Ti([n,e,o,g],u)}else"Q"===a||"T"===a?(o="Q"===a?h(0):/[QT]/.test(i)?p:n,Ti([n,[n[0]+2*(o[0]-n[0])/3,n[1]+2*(o[1]-n[1])/3],[g[0]+2*(o[0]-g[0])/3,g[1]+2*(o[1]-g[1])/3],g],u)):"A"===a?Ai(n,g,d,u):"M"!==a&&(u(...n),u(...g));n=g,"M"===a&&(s=[...g],r=l?"l":"L"),i=a}return[a,l,c,d].every(Number.isFinite)?{x:a,y:l,w:c-a,h:d-l}:null}var Mi=/*#__PURE__*/new WeakMap;function Pi(e){let t=Mi.get(e);return(!t||t.source!==e.pathD)&&(t={source:e.pathD,box:Ii(e.pathD)},Mi.set(e,t)),t.box}function Di(e){if(1===e.length)return e[0];let t={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0,radius:0,order:-1};for(let r of e)t.x0=Math.min(t.x0,r.x0),t.y0=Math.min(t.y0,r.y0),t.x1=Math.max(t.x1,r.x1),t.y1=Math.max(t.y1,r.y1),t.radius=Math.max(t.radius,r.radius),t.order=Math.max(t.order,r.order);if(e.length<=8)t.children=e.sort((e,t)=>t.order-e.order);else{let r=t.x1-t.x0>=t.y1-t.y0;e.sort((e,t)=>r?e.x0+e.x1-(t.x0+t.x1):e.y0+e.y1-(t.y0+t.y1));let i=e.length>>1;t.children=[Di(e.slice(0,i)),Di(e.slice(i))].sort((e,t)=>t.order-e.order)}return t}function Li(e,t,r,i,n){let s=null,o=-1,a=e=>{if(e.order<=o)return;let l=10*Math.max(i,e.radius)+1e-7;if(!(t<e.x0-l||t>e.x1+l||r<e.y0-l||r>e.y1+l))if(e.children)e.children.forEach(a);else{let t=n(e.order);t&&(s=t,o=e.order)}};return a(e),s}function Wi(e){let t=e.style.strokeWidth??1;return Number.isFinite(t)?Math.max(0,t/2):1/0}var Oi=/*#__PURE__*/new WeakMap;function Fi(e){return[e,null!=e.datum&&!1!==e.interactive,e.style.strokeWidth,!!e.style.fill&&"none"!==e.style.fill,..."line"===e.type?[e.x1,e.y1,e.x2,e.y2]:[e.pathD]]}function Bi(e){let t=e.map(Fi),r=Oi.get(e);if(r&&r.signatures.length===t.length&&t.every((e,t)=>e.length===r.signatures[t].length&&e.every((e,i)=>2===i||Object.is(e,r.signatures[t][i])))){if(t.some((e,t)=>!Object.is(e[2],r.signatures[t][2]))){let t=r=>(r.radius=r.children?Math.max(0,...r.children.map(t)):Wi(e[r.order]),r.radius);t(r.index.root)}return r.signatures=t,r.index}let i=[];e.forEach((e,t)=>{if(null==e.datum||!1===e.interactive)return;let r="line"===e.type?{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}:Pi(e),n=Wi(e);for(let s of function(e,t){if(!t||t.w<256||t.h<256||"line"===e.type||e.style.fill&&"none"!==e.style.fill)return null;let r=e.pathD.match(/[a-zA-Z]|[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g);if(!r||10!==r.length||"M"!==r[0]||"C"!==r[3])return null;let i=[1,4,6,8].map(e=>[Number(r[e]),Number(r[e+1])]),n=[],s=(e,t)=>{let r=e.map(e=>e[0]),i=e.map(e=>e[1]),o=Math.min(...r),a=Math.min(...i),l=Math.max(...r)-o,c=Math.max(...i)-a;if(!t||l<4||c<4)return void n.push({x:o,y:a,w:l,h:c});let d=[e[0]],u=[e[3]];for(;e.length>1;)e=e.slice(1).map((t,r)=>[(t[0]+e[r][0])/2,(t[1]+e[r][1])/2]),d.push(e[0]),u.unshift(e[e.length-1]);s(d,t-1),s(u,t-1)};return s(i,2),n}(e,r)??[r])i.push({x0:s?.x??-1/0,y0:s?.y??-1/0,x1:s?s.x+s.w:1/0,y1:s?s.y+s.h:1/0,radius:n,order:t})});let n={edges:e,root:Di(i)};return Oi.set(e,{index:n,signatures:t}),n}function zi(e){if(!e.length||e.some(e=>"rect"!==e.type||![e.x,e.y,e.w,e.h,e.x+e.w,e.y+e.h].every(e=>Number.isFinite(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER)))return;let t=e;return{nodes:e,root:Di(t.map((e,t)=>({x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h,radius:0,order:t}))),paintOrder:t.some(e=>!!e._hitPath)}}function ji(e,t){return(e.depth??-1)>(t?.depth??-1)}function $i(e,t,r,i){let n=r<=e.r,s=i<=t.r;if(n!==s)return n;if(n&&s){let r=t.r-e.r;if(r&&Math.hypot(e.cx-t.cx,e.cy-t.cy)<=Math.abs(r)+1e-6)return r>0}return r<i||r===i&&ji(e,t)}var Yi={rect:0,circle:1,arc:2,symbol:3,glyph:4};function Hi(e,t){let r=e.w*e.h,i=t.w*t.h;return r<i||r===i&&ji(e,t)}function Xi(e,t,r,i,n=0){return{type:e,mark:t,datum:t.datum,x:r,y:i,distance:n}}function Vi(e,t,r,i,n){if(!e.datum)return null;switch(e.type){case"circle":return e.pathD&&!e._perspectiveToken?Qi(e,t,r,e.cx,e.cy):Gi(e,t,r,e.cx,e.cy,e.r,i,n);case"rect":{let i=function(e,t,r){let i=P(t,r,e);return i.hit?Xi("node",e,i.cx,i.cy):null}(e,t,r);if(!i||!e._hitPath)return i;let n=e._hitPath,[s,o,a,l]=n.transform,c=Ui(n),d=Ki();if(!c||!d||0===a||0===l)return null;let u=(t-s)/a,h=(r-o)/l;if(n.fill&&d.isPointInPath(c,u,h))return i;if(n.strokeWidth>0){let e=d.lineWidth;d.lineWidth=n.strokeWidth;let t=d.isPointInStroke(c,u,h);if(d.lineWidth=e,t)return i}return null}case"arc":return function(e,t,r,i){if(e.pathD)return Qi(e,t,r,t,r);let n=t-e.cx,s=r-e.cy,o=Math.sqrt(n*n+s*s),a=2/i;if(o<e.innerR-a||o>e.outerR+a)return null;if(D(Math.atan2(s,n),e.startAngle,e.endAngle)){let t=(e.startAngle+e.endAngle)/2,r=(e.innerR+e.outerR)/2;return Xi("node",e,e.cx+r*Math.cos(t),e.cy+r*Math.sin(t))}return null}(e,t,r,n);case"symbol":return Gi(e,t,r,e.cx,e.cy,rt(e.size),i,n);case"glyph":{let s=tt(e.glyph,e.size);return Gi(e,t,r,e.cx+s.centerDx,e.cy+s.centerDy,s.radius,i,n)}default:return null}}function Gi(e,t,r,i,n,s,o,a){let l=t-i,c=r-n,d=Math.sqrt(l*l+c*c);return d<=M(s,o,a)?Xi("node",e,i,n,d):null}function Qi(e,t,r,i,n){let s=Ui(e),o=Ki();return s&&o&&o.isPointInPath(s,t,r)?Xi("node",e,i,n):null}var qi=null;function Ki(){if(!qi){let e=document.createElement("canvas");e.width=e.height=1,qi=e.getContext("2d")}return qi}function Ui(e){if(e._cachedPath2D&&e._cachedPath2DSource===e.pathD)return e._cachedPath2D;try{return e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD,e._cachedPath2D}catch{return null}}function Zi(e){let{clientX:t,clientY:r,canvasRect:i,margin:n,adjustedWidth:s,adjustedHeight:o,sceneNodes:a,sceneEdges:l,nodeQuadtree:c,maxNodeRadius:d,hitRadius:u=12,includeEdges:h=!0}=e,y=t-i.left-n.left,g=r-i.top-n.top;if(y<0||y>s||g<0||g>o)return{kind:"miss-outside"};let p=Br(e.viewTransform),f=function(e,t,r,i,n=12,s,o=0,a=!0,l=1,c,d){let u=null,h=d?.nodes===e?d:void 0,y=h?h.paintOrder:e.some(e=>"rect"===e.type&&e._hitPath);if(y&&(s=null),s){let e=I(s,r,i,n,o,e=>e.cx,e=>e.cy,e=>e.r,$i,l);e&&(u=Xi("node",e.node,e.node.cx,e.node.cy,e.distance))}for(let t of h?function(e,t,r){let i=[];return Li(e.root,t,r,0,e=>(i.push(e),null)),i.sort((e,t)=>e-t).map(t=>e.nodes[t])}(h,r,i):e){if(s&&"circle"===t.type)continue;let e=Vi(t,r,i,n,l);if(!e)continue;if(!u||y){u=e;continue}let o=u.mark;(t.type!==o.type?Yi[t.type]>Yi[o.type]:"rect"===t.type?Hi(t,o):"circle"===t.type?$i(t,o,e.distance,u.distance):e.distance<u.distance)&&(u=e)}if(u)return u;if(!a)return null;let g=5/l,p=null,f=-1,m=e=>{let n=t[e];if(null!=n.datum&&!1!==n.interactive){let t=function(e,t,r,i){switch(e.type){case"bezier":case"ribbon":case"curved":return function(e,t,r,i){if(!e.pathD)return null;if(function(e,t,r,i){let n=Pi(e);return!!n&&(t<n.x-i||t>n.x+n.w+i||r<n.y-i||r>n.y+n.h+i)}(e,t,r,10*Math.max(i,(e.style.strokeWidth??1)/2)+1e-7))return null;let n=Ui(e),s=Ki();if(!n||!s)return null;try{if(e.style.fill&&"none"!==e.style.fill&&s.isPointInPath(n,t,r))return Xi("edge",e,t,r);if("none"===e.style.stroke||(e.style.strokeWidth??1)<=0)return null;let o=e.style.strokeWidth??1,a=Math.max(2*i,o),l=s.lineWidth;try{if(s.lineWidth=a,!s.isPointInStroke(n,t,r))return null;for(let i=0;i<4;i++){let l=o+(a-o)*i/4;if(s.lineWidth=l,s.isPointInStroke(n,t,r))return Xi("edge",e,t,r,(l-o)/2)}return Xi("edge",e,t,r,(a-o)/2)}finally{s.lineWidth=l}}catch{}return null}(e,t,r,i);case"line":return function(e,t,r,i){if("none"===e.style.stroke||(e.style.strokeWidth??1)<=0)return null;i=Math.max(i,(e.style.strokeWidth??1)/2);let n=e.x2-e.x1,s=e.y2-e.y1,o=n*n+s*s;if(0===o)return null;let a=((t-e.x1)*n+(r-e.y1)*s)/o;a=Math.max(0,Math.min(1,a));let l=e.x1+a*n,c=e.y1+a*s,d=Math.sqrt((t-l)**2+(r-c)**2);return d<=i?Xi("edge",e,l,c,Math.max(0,d-(e.style.strokeWidth??1)/2)):null}(e,t,r,i);default:return null}}(n,r,i,g);if(t&&(!p||t.distance<p.distance||t.distance===p.distance&&e>f)&&(p=t,f=e),0===t?.distance)return t}return null};if(c?.edges===t)!function(e,t,r,i){let n=new Set;Li(e.root,t,r,i,t=>n.has(t)?null:(n.add(t),((e,t)=>m(t))(e.edges[t],t)))}(c,r,i,g);else for(let e=t.length-1;e>=0&&!m(e);e--);return p}(a,l,(y-p.x)/p.k,(g-p.y)/p.k,u/p.k,c,d,h,p.k,e.edgeIndex,e.rectIndex);if(!f)return{kind:"miss"};let m=f.datum||{};return{kind:"hit",hover:He(m,f.x,f.y,{nodeOrEdge:f.type}),mark:f.mark}}var Ji="StreamNetworkFrame";function en(e,t,r){return e.nodes=Ce(t),e.edges=Ce(r),e.nodes||e.edges}var tn=/*#__PURE__*/new WeakMap;function rn(e){let t=e.lastCustomLayoutResult;if(!t)return void tn.delete(e);let r=e.getUpdateSnapshot().revisions;tn.set(e,{hits:{edgeIndex:!1===t.edgeHitTesting?void 0:Bi(e.sceneEdges),rectIndex:zi(e.sceneNodes)},nodes:e.sceneNodes,edges:e.sceneEdges,geometry:r.sceneGeometry,style:r.sceneStyle})}function nn(e){let t=tn.get(e);if(!t)return;let r=e.getUpdateSnapshot().revisions;return t.geometry===r.sceneGeometry&&t.style===r.sceneStyle&&t.nodes===e.sceneNodes&&t.edges===e.sceneEdges?t.hits:void 0}var sn=[800,600],on=/*#__PURE__*/ae(/*#__PURE__*/_t(/*#__PURE__*/St(function(t,o){let{chartType:a,nodes:l,edges:y,data:g,initialEdges:p,nodeIDAccessor:f="id",sourceAccessor:m="source",targetAccessor:k="target",valueAccessor:_="value",edgeIdAccessor:S,edgeIdentity:C,childrenAccessor:E,hierarchySum:I,orientation:M="horizontal",nodeAlign:P="justify",nodePaddingRatio:D=.05,nodeWidth:j=15,iterations:$=300,forceStrength:Y=.1,layoutExecution:H="auto",layoutLoadingContent:V,onLayoutStateChange:G,padAngle:q=.01,groupWidth:U=20,sortGroups:Z,edgeSort:J,treeOrientation:ee="vertical",edgeType:re="curve",padding:ie,paddingTop:ne,tensionConfig:se,showParticles:oe=!1,particleStyle:ae,renderMode:le,perspective:ce,nodeStyle:de,edgeStyle:ue,colorBy:he,colorScheme:ye="category10",edgeColorBy:ge="source",edgeOpacity:pe=.5,colorByDepth:fe=!1,nodeSize:me=8,nodeSizeRange:ve=[5,20],nodeLabel:be,showLabels:xe=!0,labelMode:Ce,size:Ye=sn,responsiveWidth:He,responsiveHeight:Xe,margin:Ge,background:Qe,maxDevicePixelRatio:Ke,enableHover:Ue=!0,tooltipContent:Ze,customHoverBehavior:Je,customClickBehavior:et,onObservation:tt,annotationObservationCallback:rt,chartId:it,onTopologyChange:nt,annotations:st,onAnnotationActivate:ot,autoPlaceAnnotations:at,svgAnnotationRules:lt,legend:dt,legendPosition:ut,legendLayout:ht,legendHoverBehavior:yt,legendClickBehavior:mt,legendHighlightedCategory:bt,legendIsolatedCategories:wt,legendCategoryAccessor:_t,onCategoriesChange:St,title:At,foregroundGraphics:It,backgroundGraphics:Mt,decay:Pt,pulse:Dt,transition:Lt,animate:Wt,staleness:Ft,frameScheduler:Bt,clock:zt,random:jt,seed:$t,paused:Yt=!1,suspendWhenHidden:Ht=!0,thresholds:Vt,description:Gt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Kt,orbitRevolution:Zt,orbitRevolutionStyle:Jt,orbitEccentricity:er,orbitShowRings:tr,orbitAnimated:rr,customNetworkLayout:ir,onLayoutError:nr,layoutConfig:ar,layoutSelection:lr}=t,cr=Ne(a),dr=pt(!0),ur=Te({sizeProp:Ye,responsiveWidth:He,responsiveHeight:Xe,userMargin:Ge,marginDefault:cr,title:At,legend:dt,legendPosition:ut,legendLayout:ht,legendMarginReserved:t.__legendMarginReservedFor===dt,animate:Wt,transitionProp:Lt,frameScheduler:Bt,clock:zt,random:jt,seed:$t,paused:Yt,suspendWhenHidden:Ht,themeDirtyRef:dr}),{reducedMotionRef:hr,responsiveRef:yr,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,transition:vr,introEnabled:br,tableId:xr,rafRef:wr,renderFnRef:kr,scheduleRender:_r,frameRuntime:Sr,currentTheme:Cr}=ur,{resolvedForeground:Er,resolvedBackground:Rr,themeBackground:Nr,surfaceBackground:Tr}=L({foregroundGraphics:It,backgroundGraphics:Mt,size:gr,margin:pr,scales:null,background:Qe,themeBackgroundColor:Cr.colors.background}),Ar=Ae(),Dr=Ie(),Lr=`${xr}-frame`,[Or,Fr]=xt(()=>!Q&&Dr?document.getElementById(Lr)?.innerHTML??0:0),zr="string"==typeof Or?Or:null,jr=Xt.has(a),Yr=jr?g||(Array.isArray(y)?void 0:y):void 0,Hr=null!=l||null!=y,Xr=!1===Wt,qr=Ct(()=>({...sr,...se,...Xr?{transitionDuration:0}:{}}),[se,Xr]),Zr=Ct(()=>({...or,...ae}),[ae]),Jr=function(e){let t=gt.useRef(null),r=s(e);return(!t.current||t.current.key!==r)&&(t.current={key:r,value:e}),t.current.value}(ce),ei=Ct(()=>function(e){let{currentTheme:t,...r}=e;return{...r,themeCategorical:t?.colors?.categorical,themeSequential:t?.colors?.sequential,themeSelectionOpacity:t?.colors?.selectionOpacity,themeSemantic:ct(t)}}({chartType:a,clock:Sr.now,activityClock:Sr.wallNow,random:jt,seed:$t,nodeIDAccessor:f,sourceAccessor:m,targetAccessor:k,valueAccessor:_,edgeIdAccessor:S,edgeIdentity:C,childrenAccessor:E,hierarchySum:I,orientation:M,nodeAlign:P,nodePaddingRatio:D,nodeWidth:j,iterations:$,forceStrength:Y,padAngle:q,groupWidth:U,sortGroups:Z,edgeSort:J,treeOrientation:ee,edgeType:re,padding:ie,paddingTop:ne,tensionConfig:qr,showParticles:oe,particleStyle:Zr,nodeStyle:de,edgeStyle:ue,nodeLabel:be,showLabels:xe,labelMode:Ce,colorBy:he,colorScheme:ye,edgeColorBy:ge,edgeOpacity:pe,colorByDepth:fe,nodeSize:me,nodeSizeRange:ve,decay:Pt,pulse:Dt,transition:vr,introAnimation:br,staleness:Ft,thresholds:Vt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Kt,orbitRevolution:Zt,orbitRevolutionStyle:Jt,orbitEccentricity:er,orbitShowRings:tr,orbitAnimated:rr,customNetworkLayout:ir,onLayoutError:nr,layoutConfig:ar,perspective:Jr,currentTheme:Cr}),[Jr,a,Sr.now,Sr.wallNow,jt,$t,f,m,k,_,S,C,E,I,M,P,D,j,$,Y,q,U,Z,J,ee,re,ie,ne,qr,oe,Zr,de,ue,be,xe,Ce,he,ye,ge,pe,fe,me,ve,Pt,Dt,vr,br,Ft,Vt,Qt,qt,Kt,Zt,Jt,er,tr,rr,ir,nr,ar,Cr]),ti=Me(ei),ni=Me({chartType:a,nodeIDAccessor:f,sourceAccessor:m,targetAccessor:k,valueAccessor:_,edgeIdAccessor:S,edgeIdentity:C,childrenAccessor:E,hierarchySum:I,orientation:M,nodeAlign:P,nodePaddingRatio:D,nodeWidth:j,iterations:$,forceStrength:Y,nodeSize:"force"===a?me:void 0,nodeSizeRange:"force"===a?ve:void 0,padAngle:q,groupWidth:U,sortGroups:Z,edgeSort:J,treeOrientation:ee,edgeType:re,padding:ie,paddingTop:ne,random:jt,seed:$t,tensionConfig:qr,customNetworkLayout:ir,orbitMode:Qt,orbitSize:qt,orbitEccentricity:er}),si=pt(0),oi=pt(0),ai=pt(!1),li=pt(null);li.current||(li.current=new Ir(ti));let ci=Q||!Ar&&Dr||null!==zr,di=ci&&null===zr?function(e,{nodes:t,edges:r,hierarchy:i},n){let s=new Ir(e);return i?s.ingestHierarchy(i,n):s.ingestBounded(K(t),K(r),n),s.cancelIntroAnimation(),s.buildScene(n),s}(ti,{nodes:l,edges:Array.isArray(y)?y:void 0,hierarchy:Yr},[fr,mr]):null,hi=W(li,_t,St,e=>Array.from(e.nodes.values()).map(e=>e.data?{id:e.id,...e.data}:e)),yi=Pe("StreamNetworkFrame"),gi=ft((e,t,r=!1)=>De(yi.current,e,()=>e.buildScene(t),r),[yi]),[fi]=xt(Qr),vi=fi.set,[bi,xi]=xt(0),[wi,ki]=xt(!1),[Ei,Ri]=xt(!1),Ni=pt(0),Ti=pt(null),Ai=pt(G);Ai.current=G;let Ii=ft((e,t="ready")=>{Fr(e.layoutVersion),Ri(!1),Ai.current?.(t)},[]),Mi=pt(ti);Mi.current=ti;let Pi=pt(null),{customHoverBehavior:Di,customClickBehavior:Li}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:i}){return{customHoverBehavior:ft((t,n)=>{e?.(t,n),_e({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:Ji,chartId:i,context:n})},[e,r,i]),customClickBehavior:ft((e,n)=>{t?.(e,n),Se({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:Ji,chartId:i,context:n})},[t,r,i])}}({customHoverBehavior:Je,customClickBehavior:et,onObservation:tt,chartId:it}),{hoverHandlerRef:Wi,hoverLeaveRef:Oi,onPointerMove:Fi,onPointerLeave:Bi,pointerStateRef:zi}=ur,{kbFocusIndexRef:ji,focusedNavPointRef:$i,neighborIndexRef:Yi,onKeyDown:Hi,onBlur:Xi,refreshKeyboardFocus:Vi}=function(e){let{storeRef:t}=e,r=pt({get scene(){return t.current?.sceneNodes??[]},get version(){return t.current?.layoutVersion??-1}}),i=ft((e,r,i,n)=>v(e,i<0?{flatIndex:-1,group:"",indexInGroup:-1}:b(r,i),r,t.current?.sceneEdges??[],n),[t]);return x({...e,storeRef:r,extractPoints:w,toHover:Pr,nextConnected:i})}({storeRef:li,hoverRef:Pi,setHoverPoint:vi,customHoverBehavior:Di,customClickBehavior:Li,scheduleRender:_r,clearPointerHover:Bi}),Gi=pt({nodes:!1,edges:!1}),Qi=pt(new Map),qi=pt(0),Ki=pt(ye);Ki.current=ye;let Ui=ft(e=>function(e){let{node:t,colorBy:r,colorScheme:i,nodeColorMap:n,colorIndexRef:s}=e;if("function"==typeof r)return String(r(t));if("string"==typeof r&&t.data){let e=t.data[r];if(void 0!==e){if(!n.has(String(e))){let t=Array.isArray(i)?i:Ve;n.set(String(e),t[s.current++%t.length])}return n.get(String(e))}}if(n.has(t.id))return n.get(t.id);let o=Array.isArray(i)?i:Ve,a=r?o[s.current++%o.length]:o[0];return n.set(t.id,a),a}({node:e,colorBy:he,colorScheme:ye,nodeColorMap:Qi.current,colorIndexRef:qi}),[he,ye]),tn=ft(e=>{qi.current=function(e){let{sceneNodes:t,nodes:r,nodeColorMap:i,colorScheme:n}=e;for(let e of t)e.id&&"string"==typeof e.style?.fill&&i.set(e.id,e.style.fill);let s=Array.isArray(n)?n:Ve,o=Array.from(r);for(let e=0;e<o.length;e++){let t=o[e];i.has(t.id)||i.set(t.id,s[e%s.length])}return o.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:Qi.current,colorScheme:Ki.current})},[]),on=pt(null),an=ft((e,t)=>{gi(e,t),rn(e),Vi(),on.current=t,hi(),tn(e),en(Gi.current,e.sceneNodes,e.sceneEdges),dr.current=!1,e.markStylePaintPending()},[gi,hi,tn,Vi]),ln=ft(()=>{li.current?.markStylePaintPending()},[]),{canvasRef:cn,resolutionDirtyRef:dn}=Le(ur,{hydrated:Ar&&null===zr,wasHydratingFromSSR:Dr,storeRef:li,dirtyRef:dr,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:ln,maxDevicePixelRatio:Ke,canvasPaintDependencies:[a,fr,mr,Qe,Mt,le,_r]}),un=(mn=Cr,mn?.colors?.border||mn?.colors?.secondary||mn?.colors?.primary||"#999"),hn=ft(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,li.current?.nodes),[]),yn=ft(e=>function(e){let{edge:t,edgeColorBy:r,getNodeColor:i,resolveEndpoint:n,fallback:s}=e;if("function"==typeof r)return r(t);let o=n(t.source),a=n(t.target);return"target"===r&&a?i(a):o?i(o):s}({edge:e,edgeColorBy:ge,getNodeColor:Ui,resolveEndpoint:hn,fallback:un}),[ge,Ui,un,hn]),gn=ft(e=>function(e){let{edge:t,particleStyleColor:r,particleColorBy:i,hasExplicitParticleColorBy:n,getEdgeColor:s,getNodeColor:o,resolveEndpoint:a,fallback:l}=e;if("function"==typeof r){let e=a(t.source);return e?r(t,e):l}if(!n)return s(t);let c=i,d=a(t.source),u=a(t.target);return"target"===c&&u?o(u):d?o(d):l}({edge:e,particleStyleColor:Zr.color,particleColorBy:Zr.colorBy,hasExplicitParticleColorBy:!!ae?.colorBy,getEdgeColor:yn,getNodeColor:Ui,resolveEndpoint:hn,fallback:un}),[ae?.colorBy,Zr.color,Zr.colorBy,Ui,yn,un,hn]),pn=function(e,t,r,i,n){return("sankey"===e||t)&&r||i||n}(a,!!ir,oe,!!Dt,li.current?.isAnimating??!1),fn=pt(void 0);var mn;kt(()=>{let e=li.current;e&&((Hr||jr&&Yr)&&e.hasEdgeIdentityChange(ti)?fn.current=ti:(e.updateConfig(ti),fn.current=void 0),dr.current=!0,_r())},[ti,Hr,jr,Yr,_r]),function(e,t){gt.useEffect(()=>{if(e)return e.perspective.onExtrasReady=t,()=>{e.perspective.onExtrasReady=null}},[e,t])}(li.current,ft(()=>{dr.current=!0,_r()},[_r])),O(li,lr,dr,_r);let vn=ft(()=>{let e=li.current;if(!e)return;let t=++Ni.current;Ti.current?.abort(),Ti.current=null;let s=[fr,mr],o=(t,r=!1)=>{if(an(e,s),Ii(e,t),nt){let{nodes:t,edges:r}=e.getLayoutData();nt(t,r)}r&&_r()};if("force"===a&&!ir&&!jt&&r()&&i(H,e.nodes.size,e.edges.size,$)){let r=new AbortController;Ti.current=r;let i=e.getLayoutData(),a=n(i.nodes,i.edges,Mi.current,s,e._lastPositionSnapshot);return Ri(!0),Ai.current?.("pending"),import("./c-G3SM44T7.min.js").then(({runForceLayoutWorker:e})=>e(a,r.signal)).then(({positions:i})=>{r.signal.aborted||t!==Ni.current||(Ti.current=null,e.applyForceLayoutPositions(i,s),o("ready",!0))}).catch(i=>{r.signal.aborted||t!==Ni.current||"AbortError"===i.name||(Ti.current=null,e.runLayout(s),o("error",!0))}),r}e.runLayout(s),o("ready")},[fr,mr,an,Ii,nt,_r,a,ir,jt,H,$]),bn=pt(vn);bn.current=vn,function(t,r,i){let n=pt(i);n.current=i,kt(()=>{if(!r&&Ut(t)&&!e(t))return c(()=>import("./c-XT3G3YWU.min.js").then(e=>{e.registerBuiltInNetworkLayouts()}),()=>n.current(),`StreamNetworkFrame layout "${t}"`)},[t,r])}(a,!!ir,()=>{bn.current(),_r()}),kt(()=>()=>{++Ni.current,Ti.current?.abort()},[]);let xn=pt(!1),wn=ft((e=!1)=>!(!e&&!xn.current||(xn.current=!1,vn(),0)),[vn]),kn=ft(()=>wn(!1),[wn]),_n=ft(e=>{let t=li.current;if(!t)return!1;let r=!1,i=xn.current;for(let n of e)null==n||"object"!=typeof n||(r=!0,t.ingestEdge(n)&&(i=!0));let n=wn(i);return r||n},[wn]),Sn=ft(e=>{if(null==e||"object"!=typeof e)return;let t=li.current;if(t){if(t.ingestEdge(e)&&(xn.current=!0),Ti.current&&(++Ni.current,Ti.current.abort(),Ti.current=null,xn.current=!0),!Sr.isActive)return void kn();_r()}},[kn,Sr,_r]),Cn=ft(e=>{_n(e)&&_r()},[_n,_r]);kt(()=>Sr.subscribe(()=>{Sr.isActive||kn()}),[kn,Sr]);let En=ft(()=>{xn.current=!1,++Ni.current,Ti.current?.abort(),Ti.current=null,Ri(!1),Ai.current?.("ready"),li.current?.clear(),hi(),Qi.current.clear(),qi.current=0,Fr(li.current?.layoutVersion??0),vi(null),Pi.current=null,ji.current=-1,$i.current=null,Yi.current=-1,dr.current=!0,_r()},[hi,_r,ji,$i,Yi,vi]),Rn=ft(()=>{li.current&&(wn(!0),_r())},[wn,_r]),Nn=ft(e=>{let t=li.current;if(!t)return[];let r=[];for(let i of e){let e=t.nodes.get(i);e&&(r.push({...e.data??{},id:i}),t.removeNode(i),Qi.current.delete(i))}if(r.length&&Pi.current){let e=new Set(r.map(e=>e.id)),t=Pi.current,i=t.data,n=e=>e&&"object"==typeof e?e.id:e;("node"===t.nodeOrEdge?e.has("function"==typeof f?f(i??{}):i?.[f]):e.has(n(i?.source))||e.has(n(i?.target)))&&(Pi.current=null,vi(null))}return wn(r.length>0)&&_r(),r},[wn,_r,f,vi]),Tn=ft((e,t)=>{let r=[];try{for(let i of e){let e=li.current?.updateNode(i,t);null!=e&&r.push({...e,id:i})}}finally{wn(r.length>0)&&_r()}return r},[wn,_r]);Et(o,()=>({push:Sn,pushMany:Cn,removeNode:e=>Nn([e]).length>0,removeNodes:Nn,updateNodes:Tn,removeEdge:(e,t)=>{let r=li.current?.removeEdge(e,t)??!1;if(r&&Pi.current&&"edge"===Pi.current.nodeOrEdge){let r,i=Pi.current.data,n="object"==typeof i?.source?i.source.id:i?.source,s="object"==typeof i?.target?i.target.id:i?.target;r=void 0!==t?n===e&&s===t:!S&&"id"!==C||!i||("function"==typeof S?S:e=>e?.[S??"id"])(i.data??i)===e,r&&(Pi.current=null,vi(null))}return wn(r)&&_r(),r},updateNode:(e,t)=>{let r=li.current?.updateNode(e,t)??null;return wn(null!==r)&&_r(),r},updateEdge:(e,t,r)=>{let i=li.current?.updateEdge(e,t,r)??[];return wn(i.length>0)&&_r(),i},updateEdgeById:(e,t)=>{let r=li.current?.updateEdgeById(e,t)??null;return wn(null!==r)&&_r(),r},clear:En,getTopology:()=>(kn(),li.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(kn(),li.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(kn(),li.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{kn();let e=li.current;return e?{addedNodes:Array.from(e.addedNodes),removedNodes:Array.from(e.removedNodes),addedEdges:Array.from(e.addedEdges),removedEdges:Array.from(e.removedEdges)}:{addedNodes:[],removedNodes:[],addedEdges:[],removedEdges:[]}},relayout:Rn,getTension:()=>(kn(),li.current?.tension??0)}),[Sn,Cn,En,Rn,kn,wn,Nn,Tn,_r,S,C,vi]),kt(()=>{let e=li.current;if(!e)return;++Ni.current,Ti.current?.abort(),Ti.current=null;let t=fn.current;if(jr&&Yr)xn.current=!1,e.ingestHierarchy(Yr,[fr,mr],t),fn.current=void 0,an(e,[fr,mr]),Ii(e),_r();else{let n=K(l),s=Array.isArray(y)?K(y):[];if(Hr&&(xn.current=!1),0===n.length&&0===s.length){if(Hr&&(e.nodes.size>0||e.edges.size>0)&&En(),t&&(e.updateConfig(t),fn.current=void 0),"force"===a&&!Hr&&e.nodes.size>0){xn.current=!1;let e=bn.current();return()=>e?.abort()}return void Ii(e)}let o=[fr,mr];if("force"===a&&!ir&&r()&&!jt&&i(H,n.length,s.length,$)){e.ingestBounded(n,s,o,{deferLayout:!0,config:t}),fn.current=void 0;let r=bn.current();return()=>r?.abort()}e.ingestBounded(n,s,o,{config:t}),fn.current=void 0,an(e,o),Ii(e),_r()}},[l,y,Hr,Yr,jr,fr,mr,ni,H,$,a,ir,jt,_r,En,an,Ii]);let An=gt.useRef(!1);kt(()=>{An.current||p&&p.length>0&&(An.current=!0,Cn(p))},[p,Cn]),kt(()=>{let e=li.current;if(!e||Ti.current)return;let t=on.current,r=null!==t&&(t[0]!==fr||t[1]!==mr);!dr.current&&!r||(r&&e.runLayout([fr,mr]),an(e,[fr,mr]),Fr(e=>"number"==typeof e?e+1:0),_r())},[Cr,fr,mr,an,_r]);let In=()=>!ir||(li.current?.hasCustomRestyle??!1);Wi.current=e=>{let r=In(),i=cn.current;if(!i)return;let n=li.current;if(!n)return void We(i);let s=Zi({viewTransform:t.viewTransform,clientX:e.clientX,clientY:e.clientY,canvasRect:i.getBoundingClientRect(),margin:pr,adjustedWidth:fr,adjustedHeight:mr,sceneNodes:n.sceneNodes,sceneEdges:n.sceneEdges,...nn(n),nodeQuadtree:n.nodeQuadtree,maxNodeRadius:n.maxNodeRadius,includeEdges:!1!==n.lastCustomLayoutResult?.edgeHitTesting&&(Ue||Gi.current.edges)});if(We(i,"hit"===s.kind?Re(s.mark):void 0),Ue){if("hit"!==s.kind)return void(Pi.current&&(Pi.current=null,vi(null),Di?.(null),r&&_r()));Pi.current=s.hover,vi(s.hover),Di?.(s.hover),r&&_r()}},Oi.current=()=>{if(We(cn.current),Pi.current){let e=In();Pi.current=null,vi(null),Di?.(null),e&&_r()}};let Mn=pt(()=>{});Mn.current=e=>{if(Oe(e.target)||(ur.flushPointerMove(e),!et&&!tt))return;let r=cn.current;if(!r)return;let i=li.current;if(!i)return;let n=Zi({viewTransform:t.viewTransform,clientX:e.clientX,clientY:e.clientY,canvasRect:r.getBoundingClientRect(),margin:pr,adjustedWidth:fr,adjustedHeight:mr,sceneNodes:i.sceneNodes,sceneEdges:i.sceneEdges,...nn(i),nodeQuadtree:i.nodeQuadtree,maxNodeRadius:i.maxNodeRadius,includeEdges:!1!==i.lastCustomLayoutResult?.edgeHitTesting});"hit"===n.kind?Li(n.hover,{type:"activate",inputType:Fe(e.nativeEvent.pointerType)}):"miss"===n.kind&&Li(null)};let Pn=ft(e=>Mn.current(e),[]),Dn=ft(e=>{F(zi,e,Ue,Gi.current.nodes||Gi.current.edges,cn.current,"mouse")&&(ji.current=-1,$i.current=null,Fi(e))},[cn,Ue,Fi,zi,ji,$i]),Ln=pt(null),Wn=ft(e=>{(e.target===cn.current||e.target===Ln.current)&&Dn(e)},[cn,Dn]),On=ft(e=>{Ln.current?.removeEventListener("mousemove",Wn),Ln.current=e,e?.addEventListener("mousemove",Wn)},[Wn]),Fn=function(e,t,r,i){let n=pt(!1),s=pt(!1);return vt(()=>{let o=()=>{i.current<0&&r.current?.(),n.current=!0;try{t.current?.()}finally{n.current=!1}};return(e||s.current)&&o(),s.current=!!e,Wr(e)?.subscribe(o)},[e,t,r,i]),n}(t.viewTransform,kr,Oi,ji),Bn=function(e,t){let r=t?.lastCustomLayoutResult?t.customLayoutRevision:null,i=t?.lastCustomLayoutResult??null,n=pt(null);return n.current??(n.current={store:t,run:r,result:ii(i),output:i}),vt(()=>{let s=n.current,o=s.store!==t||s.run!==r;(o||s.output!==i)&&(n.current={store:t,run:r,result:ii(i),output:i}),o&&Wr(e)?.layoutCommitted?.(i,s.result)}),ft(e=>e!==n.current.store||(e.lastCustomLayoutResult?e.customLayoutRevision:null)!==n.current.run,[])}(t.viewTransform,li.current);if(kr.current=()=>{if(Fn.current||(wr.current=null,kn()),!Sr.isActive&&!Fn.current||Ti.current&&!Fn.current)return;let e=cn.current;if(!e)return;let r=li.current;r&&function(e){let{canvas:t,store:r,sceneRevisionDiagnostics:i,size:n,margin:s,adjustedWidth:o,adjustedHeight:a,background:l,themeBackground:c,maxDevicePixelRatio:y,renderMode:g,hasBackgroundGraphics:p=!1,dirtyRef:f,resolutionDirtyRef:m,lastFrameTimeRef:v,now:b,random:x,reducedMotion:w,showParticles:k,isContinuous:_,animate:S,decay:C,pulse:E,thresholds:R,staleness:N,particleStyle:I,getParticleColor:M,pendingAnnotationFrameRef:P,lastAnnotationFrameTimeRef:D,setAnnotationFrame:L,scheduleNextFrame:W,syncColorMap:O,onSceneOrStyleChange:F}=e,B=t.getContext("2d");if(!B)return;let z=v.current?Math.min((b-v.current)/1e3,.1):.016;e.cameraOnly||(v.current=b);let j=!e.cameraOnly&&null!=r.transition,$=!e.cameraOnly&&r.advanceTransition(w?b+1e6:b),Y=!w&&$,H=j&&!$,X=!w&&!e.cameraOnly&&r.tickAnimation([o,a],z),V=!e.cameraOnly&&r.advancePerspectiveTransition(b,w),G=!e.cameraOnly&&f.current,Q=!e.cameraOnly&&i?.beforeCompute(r.getLastUpdateResult(),Y),q=j||G||X||V;q&&(r.buildScene([o,a]),t.setAttribute("aria-label",Ci(r)),G&&O?.()),Q&&i?.afterCompute(Q,q,!0);let K=k&&!w&&!!r.particlePool,U=!!C||!!E||!!R||!1!==S&&r.hasActiveTopologyDiff||r.hasActivePulses||r.hasActiveThresholds,Z=r.consumeStylePaintPending();(q||Z||e.cameraOnly)&&F?.({inventoryChanged:G||Z,geometryChanged:q});let J=d({dirtyOrRebuilt:q,transitioning:Y,animationTicked:X,continuous:K||_,liveEncoding:U,forced:Z||!0===m?.current||e.cameraOnly});m&&(m.current=!1);let ee=N?.threshold??5e3,te=!!N&&r.activity.elapsed()>ee;if(J){let i=we(y,n);if(!ke(t,n,s,i))return;if(B.clearRect(-s.left,-s.top,n[0],n[1]),T(B,{background:l,themeBackground:c,hasBackgroundGraphics:p,x:-s.left,y:-s.top,width:n[0],height:n[1]}),B.save(),e.viewTransform){let t=Br(e.viewTransform);B.beginPath(),B.rect(0,0,o,a),B.clip(),B.translate(t.x,t.y),B.scale(t.k,t.k)}if(e.cameraOnly||(C&&r.applyDecay(),E&&r.applyPulse(b),R&&r.applyThresholds(b),!1!==S&&r.applyTopologyDiff(b)),te&&(B.globalAlpha=N?.dimOpacity??.5),r.perspective.underlay.length&&mi(B,r.perspective.underlay),A({context:B,nodes:r.sceneEdges,renderMode:g,pixelRatio:i,paintBuiltIn:e=>mi(B,e)}),A({context:B,nodes:r.sceneNodes,renderMode:g,pixelRatio:i,paintBuiltIn:e=>{let t=e;r.perspective.frame?function(e,t){let r=0;for(let i=1;i<=t.length;i++){if(i<t.length&&t[i].type===t[r].type)continue;let n=t[r].type,s=0===r&&i===t.length?t:t.slice(r,i);"symbol"===n?Si(e,s):"glyph"===n?h(e,s):("circle"===n||"rect"===n||"arc"===n)&&_i(e,s,n),r=i}}(B,t):(function(e,t){_i(e,t,"rect")}(B,t),function(e,t){_i(e,t,"circle")}(B,t),function(e,t){_i(e,t,"arc")}(B,t),u(B,t),h(B,t))}}),K&&!te){let t=r.edgesArray;if(t.length>0){e.cameraOnly||function(e,t,r,i,n=Math.random){let s=i.spawnRate??or.spawnRate,o=i.maxPerEdge??or.maxPerEdge;for(let i=0;i<t.length;i++){let a=t[i];if(!a.bezier||e.countForEdge(i)>=o)continue;let l=a.bezier.circular?.3:1,c=a.value*s*r*l,d=Math.floor(c),u=c-d,h=d;n()<u&&h++;for(let t=0;t<h&&!(e.countForEdge(i)>=o);t++)e.spawn(i,n)}}(r.particlePool,t,z,I,x);let i,n=.5*(I.speedMultiplier??1);if(I.proportionalSpeed){let e=t.reduce((e,t)=>Math.max(e,t.value||1),1);i=t.map(t=>.3+(t.value||1)/e*1.7)}e.cameraOnly||r.particlePool.step(z,n,t,i),function(e,t,r,i,n,s){let o=i.radius??or.radius,a=i.opacity??or.opacity,l=e.globalAlpha;e.globalAlpha=l*a;for(let a=0;a<t.particles.length;a++){let l=t.particles[a];if(!l.active)continue;let c,d=r[l.edgeIndex];if(d){if(c="string"==typeof i.color&&"inherit"!==i.color?i.color:n(d),e.fillStyle=qe(e,c)||c,e.beginPath(),s){let[t,r]=s(l.x,l.y,d,l.t);e.arc(t,r,o,0,2*Math.PI)}else e.arc(l.x,l.y,o,0,2*Math.PI);e.fill()}}e.globalAlpha=l}(B,r.particlePool,t,I,M,r.perspective.projectParticle)}}te&&(B.globalAlpha=1),B.restore()}if(e.cameraOnly)return;f.current=!1;let re=G||!!e.layoutCommitPending,ie=q||re||P.current;ie&&(re||H||b-D.current>=33)?(L(e=>e+1),D.current=b,P.current=!1):P.current=!!ie,(_||Y||null!=r.transition||r.perspective.transitioning||X||r.hasActivePulses||r.hasActiveThresholds||!1!==S&&r.hasActiveTopologyDiff||P.current)&&W()}({canvas:e,store:r,sceneRevisionDiagnostics:yi.current,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,background:Qe,themeBackground:Nr,maxDevicePixelRatio:Ke,renderMode:le,viewTransform:t.viewTransform,cameraOnly:Fn.current,layoutCommitPending:Bn(r),hasBackgroundGraphics:!(!Mt&&!r.customLayoutBackgrounds),dirtyRef:dr,resolutionDirtyRef:dn,lastFrameTimeRef:si,now:Sr.now(),random:Sr.random,reducedMotion:!!hr.current,showParticles:oe,isContinuous:pn,animate:Wt,decay:Pt,pulse:Dt,thresholds:Vt,staleness:Ft,particleStyle:Zr,getParticleColor:gn,pendingAnnotationFrameRef:ai,lastAnnotationFrameTimeRef:oi,setAnnotationFrame:xi,scheduleNextFrame:()=>{_r()},syncColorMap:()=>tn(r),onSceneOrStyleChange:({inventoryChanged:i,geometryChanged:n})=>{var s;(i||n)&&rn(r),!1===r.lastCustomLayoutResult?.edgeHitTesting&&"edge"===Pi.current?.nodeOrEdge&&Oi.current(),(i||n)&&Vi(),i&&(en(Gi.current,r.sceneNodes,r.sceneEdges)||We(e)),(Gi.current.nodes||Gi.current.edges)&&(i||n||Fn.current)&&(s={canvas:e,pointer:zi.current,store:r,margin:pr,viewTransform:t.viewTransform,width:fr,height:mr,geometryMoved:n,cursorInventory:Gi.current},Ee(s.canvas,s.pointer,e=>{let t=Zi({clientX:e.clientX,clientY:e.clientY,canvasRect:s.canvas.getBoundingClientRect(),margin:s.margin,adjustedWidth:s.width,adjustedHeight:s.height,sceneNodes:s.store.sceneNodes,sceneEdges:s.store.sceneEdges,...nn(s.store),nodeQuadtree:s.geometryMoved?null:s.store.nodeQuadtree,maxNodeRadius:s.geometryMoved?0:s.store.maxNodeRadius,includeEdges:s.cursorInventory.edges&&!1!==s.store.lastCustomLayoutResult?.edgeHitTesting,viewTransform:s.viewTransform});return"hit"===t.kind?Re(t.mark):void 0}))}})},Be(cn),B(Ft,li,dr,_r,wi,ki),ci)return function({hydrationMarkup:e=null,layoutPending:t,tableId:r,props:i,store:n,responsiveRef:s,size:o,margin:a,adjustedWidth:l,adjustedHeight:c,surfaceBackground:d,resolvedBackground:u,resolvedForeground:h}){let{description:y,title:g,renderMode:p,legend:f,legendPosition:m,legendLayout:v,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k,layoutSelection:_,annotations:S,onAnnotationActivate:C,annotationObservationCallback:E,onObservation:T,chartId:A,autoPlaceAnnotations:I,svgAnnotationRules:M}=i,P=n.sceneNodes,D=n.sceneEdges,L=n.labels,W=n.perspective.frame,O=n.lastCustomLayoutResult?.perspective,F=n.perspective.underlay,B=Mr(i,`${r}-frame`,o,t);return Rt("div",{...B,ref:s,dangerouslySetInnerHTML:null===e?void 0:{__html:e},children:null===e?Tt(Nt,{children:[pi(i,n,r),Tt("div",{role:n.customLayoutHtmlMarks?.length?"group":"img","aria-label":B["aria-label"],children:[Tt("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",width:o[0],height:o[1],style:{position:"absolute",left:0,top:0},children:[d?Rt("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:o[0],height:o[1],fill:d}):null,Rt("g",{transform:`translate(${a.left},${a.top})`,children:Rt($r,{view:i.viewTransform,width:l,height:c,children:R(u,Ot(n.customLayoutBackgrounds,W,O))})}),Rt("g",{transform:`translate(${a.left},${a.top})`,children:Tt($r,{view:i.viewTransform,width:l,height:c,children:[F.map((e,t)=>Ur(e,t+D.length+P.length)),D.map((e,t)=>N({node:e,index:t,renderMode:p,fallback:()=>Ur(e,t)})).filter(Boolean),P.map((e,t)=>N({node:e,index:t,renderMode:p,fallback:()=>function(e,t){return te(Kr(e,t),e,`network-node-cursor-${t}`)}(e,t)})).filter(Boolean)]})})]}),Rt(ri,{decorative:!0,viewTransform:i.viewTransform,width:l,height:c,totalWidth:o[0],totalHeight:o[1],margin:a,labels:L,sceneNodes:P,title:g,description:y,legend:f,legendPosition:m,legendLayout:v,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k,foregroundGraphics:Ot(R(h,Ot(X(n.customLayoutOverlays,_??null),W,O)),W),annotations:S,onAnnotationActivate:C,onObservation:E??T,chartId:A,chartType:"StreamNetworkFrame",autoPlaceAnnotations:I,svgAnnotationRules:M,annotationFrame:0}),Rt(ui,{viewTransform:i.viewTransform,marks:n.customLayoutHtmlMarks,margin:a,selection:_??null,width:l,height:c,viewport:i.viewport,htmlMarkCulling:i.htmlMarkCulling,onViewportChange:i.onViewportChange})]})]}):void 0})}({hydrationMarkup:zr,layoutPending:Ei,tableId:xr,props:t,store:di??li.current,responsiveRef:yr,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,surfaceBackground:Tr,resolvedBackground:Rr,resolvedForeground:Er});let zn=li.current,jn=Mr(t,Lr,gr,Ei,"visible"),$n=zn.perspective.frame,Yn=zn.lastCustomLayoutResult?.perspective;return Tt("div",{...jn,ref:yr,tabIndex:0,onKeyDown:Hi,onBlur:Xi,children:["production"!==process.env.NODE_ENV&&li.current&&Rt(ze,{store:li.current,diagnostics:yi.current}),pi(t,zn,xr,Ei?void 0:zn.getUpdateSnapshot().revisions.accessibility),Rt(Vr,{hoverStore:fi,kbFocusIndexRef:ji,store:zn}),Tt("div",{role:zn.customLayoutHtmlMarks?.length?"group":"img","aria-label":jn["aria-label"],style:{position:"relative",width:"100%",height:"100%"},ref:On,onMouseLeave:Bi,onClick:et||tt?Pn:void 0,children:[Tt("div",{style:{display:"contents"},onMouseMove:Dn,children:[Ei&&!1!==V&&Rt("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:je(!0,gr[0],gr[1],V)}),Rt($e,{size:gr,margin:pr,backdropFill:Tr??void 0,overflowVisible:!0,children:Rt($r,{view:t.viewTransform,width:fr,height:mr,children:R(Rr,Ot(zn.customLayoutBackgrounds,$n,Yn))})})]}),Rt("canvas",{"aria-hidden":"true",ref:cn,"aria-label":Ci(zn),style:{position:"absolute",top:0,left:0}}),Tt("div",{style:{display:"contents"},onMouseMove:Dn,children:[Rt(ri,{decorative:!0,viewTransform:t.viewTransform,width:fr,height:mr,totalWidth:gr[0],totalHeight:gr[1],margin:pr,labels:zn.labels,sceneNodes:zn.sceneNodes,title:At,description:Gt,legend:dt,legendPosition:ut,legendLayout:ht,legendHoverBehavior:yt,legendClickBehavior:mt,legendHighlightedCategory:bt,legendIsolatedCategories:wt,foregroundGraphics:Ot(R(Er,Ot(X(zn.customLayoutOverlays,lr??null),$n,Yn)),$n),annotations:st,onAnnotationActivate:ot,onObservation:rt??tt,chartId:it,chartType:"StreamNetworkFrame",autoPlaceAnnotations:at,svgAnnotationRules:lt,annotationFrame:bi}),Rt(ui,{viewTransform:t.viewTransform,marks:zn.customLayoutHtmlMarks,margin:pr,selection:lr??null,width:fr,height:mr,viewport:t.viewport,htmlMarkCulling:t.htmlMarkCulling,onViewportChange:t.onViewportChange}),Rt(Gr,{viewTransform:t.viewTransform,hoverStore:fi,kbFocusIndexRef:ji,focusedNavPointRef:$i,enableHover:Ue,tooltipContent:Ze,adjustedWidth:fr,adjustedHeight:mr,margin:pr,size:gr})]})]}),Ft?.showBadge&&Rt(z,{isStale:wi,position:Ft.badgePosition,state:Ft.state,settling:Ft.settling})]})})),"StreamNetworkFrame"),an=on;export{Wt as a,an as b};
@@ -0,0 +1 @@
1
+ import{a as t,d as e,e as a,c as i,b as o}from"./c-YCBCZFOC.min.js";function r(t){return[t[0],t[1]]}function l(t,e,a,i){let o,l=new Map;for(let a=0;a<e.length;a++)l.set(e[a],t[a]);for(let t of i){let e=l.get(t);if(e){o=e;break}}let n,h=new Array(a.length),p=new Array(a.length);for(let t=0;t<a.length;t++){p[t]=r(a[t]);let e=l.get(i[t]);if(e)h[t]=r(e),n=e;else{let e=n??o??a[t];h[t]=r(e)}}return{prev:h,target:p}}function n(t,e,a){return e.pathIds&&e.pathIds.length===a?e.pathIds:function(t,e,a){if(Array.isArray(e)&&e.length===a&&0!==a){if(t.getPointId){let a=e.map(e=>String(t.getPointId(e)));if(a.every(t=>t.length>0))return a}if("streaming"===t.runtimeMode){let a=e.map(e=>`x:${t.getX(e)}`);if(new Set(a).size===a.length)return a}}}(t,e.datum,a)}function h(t,e){if(t.length!==e.length)return!0;for(let a=0;a<t.length;a++)if(t[a][0]!==e[a][0]||t[a][1]!==e[a][1])return!0;return!1}function p(e,a,i,o){"line"!==a.type?o.set(i,{topPath:a.topPath.map(r),bottomPath:a.bottomPath.map(r),pathIds:n(e,a,a.topPath.length),...t(a.style)}):o.set(i,{path:a.path.map(r),pathIds:n(e,a,a.path.length),...t(a.style)})}function g(t,e,a,i,o){if(!a)return e._targetOpacity=e.style.opacity??1,e._startOpacity=0,e.style={...e.style,opacity:0},!0;i.add(o);let p="line"===e.type?function(t,e,a){if(!a.path)return!1;let i=n(t,e,e.path.length),o=a.pathIds;if(o&&i&&o.length===a.path.length&&i.length===e.path.length){let t=l(a.path,o,e.path,i);return!(!h(t.prev,t.target)&&void 0===e._introClipFraction||(e._targetPath=t.target,e._prevPath=t.prev,e.path=t.prev.map(r),0))}if(a.path.length===e.path.length){e._targetPath=e.path.map(r),e._prevPath=a.path;for(let t=0;t<e.path.length;t++)e.path[t]=r(a.path[t]);return!0}return!1}(t,e,a):function(t,e,a){if(!a.topPath||!a.bottomPath)return!1;let i=n(t,e,e.topPath.length),o=a.pathIds;if(o&&i&&o.length===a.topPath.length&&i.length===e.topPath.length&&a.bottomPath.length===a.topPath.length&&e.bottomPath.length===e.topPath.length){let t=l(a.topPath,o,e.topPath,i),n=l(a.bottomPath,o,e.bottomPath,i);return!(!h(t.prev,t.target)&&!h(n.prev,n.target)&&void 0===e._introClipFraction||(e._targetTopPath=t.target,e._targetBottomPath=n.target,e._prevTopPath=t.prev,e._prevBottomPath=n.prev,e.topPath=t.prev.map(r),e.bottomPath=n.prev.map(r),0))}if(a.topPath.length===e.topPath.length&&a.bottomPath.length===e.bottomPath.length){e._targetTopPath=e.topPath.map(r),e._targetBottomPath=e.bottomPath.map(r),e._prevTopPath=a.topPath,e._prevBottomPath=a.bottomPath;for(let t=0;t<e.topPath.length;t++)e.topPath[t]=r(a.topPath[t]);for(let t=0;t<e.bottomPath.length;t++)e.bottomPath[t]=r(a.bottomPath[t]);return!0}return!1}(t,e,a);return e._targetOpacity=e.style.opacity??1,e._startOpacity=a.opacity??e.style.opacity??1,p}function s(t,a){if(void 0!==t._targetOpacity){let i=t._startOpacity??0;t.style={...t.style,opacity:e(i,t._targetOpacity,a)}}if(void 0!==t._introClipFraction&&(t._introClipFraction=a),"line"===t.type){let i=t._prevPath,o=t._targetPath;if(i&&o&&i.length===t.path.length)for(let r=0;r<t.path.length;r++)t.path[r][0]=e(i[r][0],o[r][0],a),t.path[r][1]=e(i[r][1],o[r][1],a);return}let i=t._prevTopPath,o=t._prevBottomPath,r=t._targetTopPath,l=t._targetBottomPath;if(i&&r&&i.length===t.topPath.length)for(let o=0;o<t.topPath.length;o++)t.topPath[o][0]=e(i[o][0],r[o][0],a),t.topPath[o][1]=e(i[o][1],r[o][1],a);if(o&&l&&o.length===t.bottomPath.length)for(let i=0;i<t.bottomPath.length;i++)t.bottomPath[i][0]=e(o[i][0],l[i][0],a),t.bottomPath[i][1]=e(o[i][1],l[i][1],a)}function y(t){if("line"===t.type){let e=t._targetPath;if(e)for(let a=0;a<t.path.length;a++)t.path[a]=e[a];return t._prevPath=void 0,t._targetPath=void 0,void(t._introClipFraction=void 0)}let e=t._targetTopPath,a=t._targetBottomPath;if(e)for(let a=0;a<t.topPath.length;a++)t.topPath[a]=e[a];if(a)for(let e=0;e<t.bottomPath.length;e++)t.bottomPath[e]=a[e];t._prevTopPath=void 0,t._prevBottomPath=void 0,t._targetTopPath=void 0,t._targetBottomPath=void 0,t._introClipFraction=void 0}function c(t,e,a){if(e._transitionKey)return e._transitionKey;switch(e.type){case"point":if(e.pointId)return`p:${e.pointId}`;if("streaming"===t.runtimeMode&&e.datum){let a=t.getX(e.datum),i=t.getY(e.datum);if(t.getCategory)return`p:${t.getCategory(e.datum)}:${a}:${i}`;if(null!=a&&null!=i)return`p:${a}:${i}`}return`p:${a}`;case"glyph":return e.pointId?`g:${e.pointId}`:`g:${a}`;case"rect":return`r:${e.group||""}:${e.datum?.binStart??e.datum?.category??a}`;case"heatcell":return`h:${e.x}_${e.y}`;case"candlestick":return null==e.datum?`c:${a}`:`c:${t.getX(e.datum)}`;case"line":return`l:${e.group||"_default"}`;case"area":return`a:${e.group||"_default"}`;default:return null}}function _(t){return t?.opacity??1}function d(e,a,i,o){i.clear(),o.clear();for(let r=0;r<a.length;r++){let l=a[r],n=c(e,l,r);n&&("point"===l.type?i.set(n,{x:l.x,y:l.y,r:l.r,...t(l.style)}):"glyph"===l.type?i.set(n,{x:l.x,y:l.y,r:l.size,...t(l.style),glyph:l.glyph}):"rect"===l.type||"heatcell"===l.type?i.set(n,{x:l.x,y:l.y,w:l.w,h:l.h,...t(l.style)}):"candlestick"===l.type?i.set(n,{x:l.x,y:l.openY,w:l.bodyWidth,openY:l.openY,closeY:l.closeY,highY:l.highY,lowY:l.lowY,...t(l.style)}):("line"===l.type||"area"===l.type)&&p(e,l,n,o))}}function f(e,i,o,l,n,h=a()){if(0===l.size&&0===n.size)return o;let p=i.duration??300;if(o.exitNodes.length>0){let t=new Set(o.exitNodes);o.scene=o.scene.filter(e=>!t.has(e)),o.exitNodes=[]}let s=!1,y=new Set,d=new Set;for(let t=0;t<o.scene.length;t++){let a=o.scene[t],i=c(e,a,t);if(!i)continue;if(a._transitionKey=i,"line"===a.type||"area"===a.type){g(e,a,n.get(i),d,i)&&(s=!0);continue}let r=l.get(i);if("point"===a.type)if(r){y.add(i);let t={x:a.x,y:a.y,r:a.r};a._targetOpacity=_(a.style),(r.x!==t.x||r.y!==t.y||r.r!==t.r)&&(a._targetX=t.x,a._targetY=t.y,a._targetR=t.r,a.x=r.x,a.y=r.y,a.r=r.r??a.r,s=!0)}else a._targetOpacity=_(a.style),a.style={...a.style,opacity:0},s=!0;else if("glyph"===a.type)if(r){y.add(i);let t={x:a.x,y:a.y,size:a.size};a._targetOpacity=_(a.style),(r.x!==t.x||r.y!==t.y||r.r!==t.size)&&(a._targetX=t.x,a._targetY=t.y,a._targetR=t.size,a.x=r.x,a.y=r.y,a.size=r.r??a.size,s=!0)}else a._targetOpacity=_(a.style),a.style={...a.style,opacity:0},s=!0;else if("rect"===a.type)if(r){y.add(i);let t={x:a.x,y:a.y,w:a.w,h:a.h};a._targetOpacity=_(a.style),(r.x!==t.x||r.y!==t.y||r.w!==t.w||r.h!==t.h)&&(a._targetX=t.x,a._targetY=t.y,a._targetW=t.w,a._targetH=t.h,a.x=r.x,a.y=r.y,a.w=r.w??a.w,a.h=r.h??a.h,s=!0)}else a._targetOpacity=_(a.style),a.style={...a.style,opacity:0},s=!0;else if("heatcell"===a.type)if(r){y.add(i);let t={x:a.x,y:a.y,w:a.w,h:a.h};a._targetOpacity=_(a.style),(r.x!==t.x||r.y!==t.y||r.w!==t.w||r.h!==t.h)&&(a._targetX=t.x,a._targetY=t.y,a._targetW=t.w,a._targetH=t.h,a.x=r.x,a.y=r.y,a.w=r.w??a.w,a.h=r.h??a.h,s=!0)}else a._targetOpacity=_(a.style),a.style={...a.style||{},opacity:0},s=!0;else if("candlestick"===a.type)if(r&&null!=r.openY){y.add(i);let t={x:a.x,openY:a.openY,closeY:a.closeY,highY:a.highY,lowY:a.lowY};a._targetOpacity=_(a.style),(r.x!==t.x||r.openY!==t.openY||r.closeY!==t.closeY||r.highY!==t.highY||r.lowY!==t.lowY)&&(a._targetX=t.x,a._targetOpenY=t.openY,a._targetCloseY=t.closeY,a._targetHighY=t.highY,a._targetLowY=t.lowY,a.x=r.x,a.openY=r.openY,a.closeY=r.closeY??a.closeY,a.highY=r.highY??a.highY,a.lowY=r.lowY??a.lowY,s=!0)}else a._targetOpacity=_(a.style),a.style={...a.style||{},opacity:0},s=!0}let f=function(e,a){let i=[];for(let[o,l]of e){if(a.has(o))continue;let e={group:o.slice(2),_startOpacity:l.opacity??1,_targetOpacity:0,_transitionKey:o,datum:null};if(o.startsWith("l:")&&l.path){let a={...e,type:"line",path:l.path.map(r),style:{...t(l),stroke:"#999",strokeWidth:1}};i.push(a)}else if(o.startsWith("a:")&&l.topPath&&l.bottomPath){let a={...e,type:"area",topPath:l.topPath.map(r),bottomPath:l.bottomPath.map(r),style:{...t(l),fill:"#999"}};i.push(a)}}return i}(n,d);f.length&&(o.exitNodes.push(...f),s=!0);for(let[e,a]of l){if(y.has(e))continue;let i={style:t(a),datum:null,_targetOpacity:0,_transitionKey:e};if(e.startsWith("p:")){let t={...i,type:"point",x:a.x,y:a.y,r:a.r??3};o.exitNodes.push(t)}else if(e.startsWith("g:")&&a.glyph){let t={...i,type:"glyph",x:a.x,y:a.y,size:a.r??12,glyph:a.glyph,color:"#999",accent:"#999"};o.exitNodes.push(t)}else if(e.startsWith("r:")){let t={...i,type:"rect",x:a.x,y:a.y,w:a.w??0,h:a.h??0,style:{...i.style,fill:"#999"}};o.exitNodes.push(t)}else if(e.startsWith("h:")){let t={...i,type:"heatcell",x:a.x,y:a.y,w:a.w??0,h:a.h??0,fill:"#999"};o.exitNodes.push(t)}else if(e.startsWith("c:")){let t=a.openY??a.y,e={...i,type:"candlestick",x:a.x,openY:t,closeY:a.closeY??t,highY:a.highY??t,lowY:a.lowY??t,bodyWidth:a.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0};o.exitNodes.push(e)}s=!0}return o.exitNodes.length>0&&(o.scene=[...o.scene,...o.exitNodes]),s&&(o.activeTransition={startTime:h,duration:p}),o}function u(t,a,r,l,n){if(!r.activeTransition)return!1;let h=i(t,r.activeTransition),p="linear"===a.easing?"linear":"ease-out-cubic",g=o(h,p);for(let t of r.scene){let a=t._transitionKey;if("line"!==t.type&&"area"!==t.type){if("point"===t.type){if(void 0!==t._targetOpacity){let i=a?l.get(a):void 0,o=i?i.opacity??1:0;t.style.opacity=e(o,t._targetOpacity,g)}if(void 0===t._targetX||!a)continue;let i=l.get(a);if(!i)continue;t.x=e(i.x,t._targetX,g),t.y=e(i.y,t._targetY,g),void 0!==t._targetR&&void 0!==i.r&&(t.r=e(i.r,t._targetR,g))}else if("glyph"===t.type){if(void 0!==t._targetOpacity){let i=a?l.get(a):void 0,o=i?i.opacity??1:0;t.style.opacity=e(o,t._targetOpacity,g)}if(void 0===t._targetX||!a)continue;let i=l.get(a);if(!i)continue;t.x=e(i.x,t._targetX,g),t.y=e(i.y,t._targetY,g),void 0!==t._targetR&&void 0!==i.r&&(t.size=e(i.r,t._targetR,g))}else if("rect"===t.type){if(void 0!==t._targetOpacity){let i=a?l.get(a):void 0,o=i?i.opacity??1:0;t.style.opacity=e(o,t._targetOpacity,g)}if(void 0===t._targetX||!a)continue;let i=l.get(a);if(!i)continue;t.x=e(i.x,t._targetX,g),t.y=e(i.y,t._targetY,g),void 0!==i.w&&(t.w=e(i.w,t._targetW,g)),void 0!==i.h&&(t.h=e(i.h,t._targetH,g))}else if("heatcell"===t.type){if(void 0!==t._targetOpacity){let i=a?l.get(a):void 0,o=i?i.opacity??1:0;t.style={...t.style||{},opacity:e(o,t._targetOpacity,g)}}if(void 0===t._targetX||!a)continue;let i=l.get(a);if(!i)continue;t.x=e(i.x,t._targetX,g),t.y=e(i.y,t._targetY,g),void 0!==i.w&&(t.w=e(i.w,t._targetW,g)),void 0!==i.h&&(t.h=e(i.h,t._targetH,g))}else if("candlestick"===t.type){if(void 0!==t._targetOpacity){let i=a?l.get(a):void 0,o=i?i.opacity??1:0;t.style={...t.style||{},opacity:e(o,t._targetOpacity,g)}}if(void 0===t._targetX||!a)continue;let i=l.get(a);if(!i)continue;t.x=e(i.x,t._targetX,g),void 0!==i.openY&&(t.openY=e(i.openY,t._targetOpenY,g)),void 0!==i.closeY&&(t.closeY=e(i.closeY,t._targetCloseY,g)),void 0!==i.highY&&(t.highY=e(i.highY,t._targetHighY,g)),void 0!==i.lowY&&(t.lowY=e(i.lowY,t._targetLowY,g))}}else s(t,g)}if(h>=1){for(let t of r.scene){if(void 0!==t._targetOpacity){let e=t._targetOpacity;t.style={...t.style||{},opacity:0===e?0:e},t._targetOpacity=void 0}if("line"!==t.type&&"area"!==t.type){if("point"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,void 0!==t._targetR&&(t.r=t._targetR),t._targetX=void 0,t._targetY=void 0,t._targetR=void 0}else if("glyph"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,void 0!==t._targetR&&(t.size=t._targetR),t._targetX=void 0,t._targetY=void 0,t._targetR=void 0}else if("rect"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}else if("heatcell"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}else if("candlestick"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,void 0!==t._targetOpenY&&(t.openY=t._targetOpenY),void 0!==t._targetCloseY&&(t.closeY=t._targetCloseY),void 0!==t._targetHighY&&(t.highY=t._targetHighY),void 0!==t._targetLowY&&(t.lowY=t._targetLowY),t._targetX=void 0,t._targetOpenY=void 0,t._targetCloseY=void 0,t._targetHighY=void 0,t._targetLowY=void 0}}else y(t)}if(r.exitNodes.length>0){let t=new Set(r.exitNodes);r.scene=r.scene.filter(e=>!t.has(e)),r.exitNodes=[]}return r.activeTransition=null,!1}return!0}var v={snapshotPositions:d,startTransition:f,advanceTransition:u,getNodeIdentity:c};export{u as advanceTransition,c as getNodeIdentity,l as joinPathByIdentity,_ as resolveMarkOpacity,d as snapshotPositions,f as startTransition,v as xyTransitionEngine};