semiotic 3.10.1 → 3.10.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 (353) hide show
  1. package/README.md +64 -63
  2. package/ai/artifact-surface-inventory.json +4 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/mcp-server.js +25 -24
  5. package/ai/examples.md +28 -0
  6. package/ai/reference.md +9 -4
  7. package/ai/schema.json +121 -5
  8. package/ai/surface-manifest.json +3 -2
  9. package/ai/system-prompt.md +1 -1
  10. package/ai/task-packets/compare-category-totals.json +7 -53
  11. package/ai/task-packets/compare-category-totals.md +4 -4
  12. package/ai/task-packets/correct-published-chart.json +7 -53
  13. package/ai/task-packets/correct-published-chart.md +4 -4
  14. package/ai/task-packets/index.json +9 -9
  15. package/ai/task-packets/update-live-chart.json +8 -54
  16. package/ai/task-packets/update-live-chart.md +4 -4
  17. package/dist/c-27DCB5T6.min.js +18 -0
  18. package/dist/c-2MONF2P6.min.js +1 -0
  19. package/dist/c-3AGX252H.min.js +1 -0
  20. package/dist/c-3B6JZEZT.min.js +1 -0
  21. package/dist/c-3BYZXCX3.min.js +4 -0
  22. package/dist/c-3DIPZJDO.min.js +1 -0
  23. package/dist/c-3FOUMWLR.min.js +1 -0
  24. package/dist/c-3NA6I656.min.js +2 -0
  25. package/dist/c-3OFVBWQY.min.js +1 -0
  26. package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
  27. package/dist/c-3PPO7ZJF.min.js +4 -0
  28. package/dist/c-3YEW2PK6.min.js +1 -0
  29. package/dist/c-43XNOQNQ.min.js +391 -0
  30. package/dist/c-4JKDJUYD.min.js +1 -0
  31. package/dist/c-4LKK5YWB.min.js +1 -0
  32. package/dist/c-4V3CD337.min.js +1 -0
  33. package/dist/c-4XLHPQTP.min.js +1 -0
  34. package/dist/c-5NYONM6V.min.js +5 -0
  35. package/dist/c-5PIKBUMF.min.js +1 -0
  36. package/dist/c-6IVBV5NO.min.js +1 -0
  37. package/dist/c-7APWCEPL.min.js +1 -0
  38. package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
  39. package/dist/c-ABMGCCLT.min.js +1 -0
  40. package/dist/c-AINGQGUN.min.js +1 -0
  41. package/dist/c-AXJ2QI3F.min.js +1 -0
  42. package/dist/c-BQYD7T4E.min.js +1 -0
  43. package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
  44. package/dist/c-C4SXYFXL.min.js +1 -0
  45. package/dist/c-CLDCKFBE.min.js +1 -0
  46. package/dist/c-CLJCJSFU.min.js +1 -0
  47. package/dist/c-CLLCX3PT.min.js +2 -0
  48. package/dist/c-CO4NDAD6.min.js +51 -0
  49. package/dist/c-ECHBKW7U.min.js +1 -0
  50. package/dist/c-EPJWM2UT.min.js +1 -0
  51. package/dist/c-FD2BXSRG.min.js +1 -0
  52. package/dist/c-FHNY57SO.min.js +209 -0
  53. package/dist/c-FMCUQ6JX.min.js +1 -0
  54. package/dist/c-FOTTQHOO.min.js +1 -0
  55. package/dist/c-FU7A5KSY.min.js +1 -0
  56. package/dist/c-GHN6IR4Y.min.js +1 -0
  57. package/dist/{c-J6DVC236.min.js → c-GK263BF4.min.js} +1 -1
  58. package/dist/c-GSCO3FWL.min.js +1 -0
  59. package/dist/c-GYLOSK7M.min.js +1 -0
  60. package/dist/c-HK4OSLZA.min.js +1 -0
  61. package/dist/c-HLGTD5SJ.min.js +1 -0
  62. package/dist/c-HNHKIMIV.min.js +61 -0
  63. package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
  64. package/dist/c-IIV73MUW.min.js +1 -0
  65. package/dist/c-IJCZGUG6.min.js +31 -0
  66. package/dist/c-ISA6IJ6V.min.js +41 -0
  67. package/dist/c-JC76YAHB.min.js +33 -0
  68. package/dist/c-JJKRER47.min.js +1 -0
  69. package/dist/c-JO6AYCU4.min.js +1 -0
  70. package/dist/c-JOPGDP6N.min.js +1 -0
  71. package/dist/c-JWHPG6S2.min.js +1 -0
  72. package/dist/c-JXVYIXTV.min.js +1 -0
  73. package/dist/c-K2ZIYDI3.min.js +1 -0
  74. package/dist/c-K37JAIWA.min.js +4 -0
  75. package/dist/c-KXH7LFIL.min.js +26 -0
  76. package/dist/c-M43PK7K4.min.js +1 -0
  77. package/dist/c-MTX2AO5S.min.js +1 -0
  78. package/dist/c-N5WT7TXG.min.js +1 -0
  79. package/dist/c-NATWERHZ.min.js +1 -0
  80. package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
  81. package/dist/c-OVQB75PE.min.js +1 -0
  82. package/dist/c-P3SKRNZN.min.js +1 -0
  83. package/dist/c-P5NXQWIM.min.js +1 -0
  84. package/dist/c-P7BQMVQQ.min.js +1 -0
  85. package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
  86. package/dist/c-PITYSOPK.min.js +1 -0
  87. package/dist/c-QPO24R7Q.min.js +1 -0
  88. package/dist/c-QXLDCATV.min.js +1 -0
  89. package/dist/c-R2HUSWKB.min.js +1 -0
  90. package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
  91. package/dist/c-RZPP5ERV.min.js +1 -0
  92. package/dist/c-SAP5KY6R.min.js +9 -0
  93. package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
  94. package/dist/c-SQNEVNWT.min.js +1 -0
  95. package/dist/c-STHZWF3D.min.js +1 -0
  96. package/dist/c-TIDKVMMZ.min.js +1 -0
  97. package/dist/c-TIMGODBG.min.js +1 -0
  98. package/dist/c-TR7OHUAO.min.js +2 -0
  99. package/dist/c-TVKZC4BY.min.js +1 -0
  100. package/dist/c-U5XVLSHN.min.js +1 -0
  101. package/dist/c-U6NLVFN4.min.js +1 -0
  102. package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
  103. package/dist/c-UMGHCBH5.min.js +114 -0
  104. package/dist/c-UOPPO26M.min.js +1 -0
  105. package/dist/c-UUDAON4Z.min.js +1 -0
  106. package/dist/c-V32TPPY2.min.js +1 -0
  107. package/dist/c-V5KFJWQQ.min.js +1 -0
  108. package/dist/c-VEMCBQZZ.min.js +100 -0
  109. package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
  110. package/dist/c-WD2RL76M.min.js +116 -0
  111. package/dist/c-Y342FJ6K.min.js +1 -0
  112. package/dist/c-YL7HJL5J.min.js +1 -0
  113. package/dist/c-YM6CT4LJ.min.js +1 -0
  114. package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
  115. package/dist/c-YQVOKPKR.min.js +1 -0
  116. package/dist/c-YRJ3BJQZ.min.js +1 -0
  117. package/dist/c-YT5KPVNP.min.js +1 -0
  118. package/dist/c-Z6GRGS53.min.js +1 -0
  119. package/dist/c-ZVOFLE2P.min.js +46 -0
  120. package/dist/components/CategoryColors.d.ts +7 -0
  121. package/dist/components/LinkedCharts.d.ts +2 -1
  122. package/dist/components/ai/audienceProfile.d.ts +18 -1
  123. package/dist/components/ai/describeChart.d.ts +5 -1
  124. package/dist/components/ai/intentManifest.d.ts +16 -0
  125. package/dist/components/ai/intentRegistry.d.ts +12 -0
  126. package/dist/components/ai/intents.d.ts +6 -6
  127. package/dist/components/ai/streamSchema.d.ts +19 -0
  128. package/dist/components/ai/streamingTypes.d.ts +57 -11
  129. package/dist/components/ai/suggestCharts.d.ts +1 -1
  130. package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
  131. package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
  132. package/dist/components/ai/variantDiscovery.d.ts +1 -1
  133. package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
  134. package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
  135. package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
  136. package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
  137. package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
  138. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
  139. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
  140. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
  141. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
  142. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
  143. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
  144. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
  145. package/dist/components/charts/realtime/aggregate.d.ts +11 -1
  146. package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
  147. package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
  148. package/dist/components/charts/shared/directLabels.d.ts +12 -0
  149. package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
  150. package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
  151. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  152. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
  153. package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
  154. package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
  155. package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
  156. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
  157. package/dist/components/charts/xy/LineChart.d.ts +4 -1
  158. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  159. package/dist/components/data/transforms.d.ts +1 -0
  160. package/dist/components/realtime/HyperLogLog.d.ts +19 -0
  161. package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
  162. package/dist/components/realtime/TDigest.d.ts +22 -0
  163. package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
  164. package/dist/components/realtime/applyChangelog.d.ts +38 -0
  165. package/dist/components/realtime/minHeap.d.ts +3 -0
  166. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +1 -1
  167. package/dist/components/recipes/layout1d.d.ts +2 -20
  168. package/dist/components/recipes/minGapPlacement.d.ts +20 -0
  169. package/dist/components/semiotic-ai-core.d.ts +8 -3
  170. package/dist/components/semiotic-ai-stream.d.ts +10 -0
  171. package/dist/components/semiotic-ai.d.ts +4 -6
  172. package/dist/components/semiotic-realtime-core.d.ts +6 -2
  173. package/dist/components/semiotic-stream-types.d.ts +14 -0
  174. package/dist/components/semiotic-xy.d.ts +1 -0
  175. package/dist/components/semiotic.d.ts +3 -11
  176. package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
  177. package/dist/components/server/rasterizeSVG.d.ts +2 -0
  178. package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
  179. package/dist/components/server/renderEvidence.d.ts +4 -0
  180. package/dist/components/server/serverChartConfigs.d.ts +5 -0
  181. package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
  182. package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
  183. package/dist/components/server/staticAnnotations.d.ts +9 -0
  184. package/dist/components/stream/SceneGraph.d.ts +3 -3
  185. package/dist/components/stream/StalenessBadge.d.ts +5 -2
  186. package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
  187. package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
  188. package/dist/components/stream/pipelineTransitions.d.ts +5 -35
  189. package/dist/components/stream/seriesGeometry.d.ts +2 -1
  190. package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
  191. package/dist/components/stream/types.d.ts +25 -2
  192. package/dist/components/text/axisLabelAssessment.d.ts +15 -0
  193. package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
  194. package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
  195. package/dist/components/text/labelMeasurement.d.ts +19 -0
  196. package/dist/components/text/labelPlacement.d.ts +71 -0
  197. package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
  198. package/dist/components/text/useLabelMeasurer.d.ts +3 -0
  199. package/dist/controls.module.min.js +71 -1
  200. package/dist/geo.min.js +231 -1
  201. package/dist/geo.module.min.js +31 -1
  202. package/dist/network.module.min.js +1 -1
  203. package/dist/ordinal.module.min.js +1 -1
  204. package/dist/physics-matter.module.min.js +1 -1
  205. package/dist/physics-rapier.module.min.js +1 -1
  206. package/dist/physics.module.min.js +1 -1
  207. package/dist/physicsWorker.js +1 -1
  208. package/dist/rough.min.js +2 -1
  209. package/dist/rough.module.min.js +2 -1
  210. package/dist/semiotic-access.module.min.js +1 -1
  211. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
  212. package/dist/semiotic-ai-core.d.ts +8 -3
  213. package/dist/semiotic-ai-core.min.js +4 -1
  214. package/dist/semiotic-ai-core.module.min.js +4 -1
  215. package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
  216. package/dist/semiotic-ai.d.ts +4 -6
  217. package/dist/semiotic-ai.module.min.js +14 -1
  218. package/dist/semiotic-artifact-react.min.js +269 -1
  219. package/dist/semiotic-artifact-react.module.min.js +137 -1
  220. package/dist/semiotic-artifact.min.js +3 -1
  221. package/dist/semiotic-artifact.module.min.js +3 -1
  222. package/dist/semiotic-atlas-core.min.js +2 -1
  223. package/dist/semiotic-atlas-core.module.min.js +1 -1
  224. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  225. package/dist/semiotic-atlas.module.min.js +11 -1
  226. package/dist/semiotic-client-cjs-shared.min.js +1530 -1
  227. package/dist/semiotic-client-glyph.module.min.js +3 -1
  228. package/dist/semiotic-client-responsive.module.min.js +1 -1
  229. package/dist/semiotic-client-shared.module.min.js +1 -1
  230. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
  231. package/dist/semiotic-data.min.js +1 -1
  232. package/dist/semiotic-data.module.min.js +1 -1
  233. package/dist/semiotic-evidence.min.js +3 -1
  234. package/dist/semiotic-evidence.module.min.js +3 -1
  235. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
  236. package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
  237. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  238. package/dist/semiotic-experimental-vacp.min.js +1 -1
  239. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  240. package/dist/semiotic-line.module.min.js +1 -1
  241. package/dist/semiotic-realtime-core.d.ts +6 -2
  242. package/dist/semiotic-realtime-core.module.min.js +1 -1
  243. package/dist/semiotic-realtime-react.module.min.js +1 -1
  244. package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
  245. package/dist/semiotic-recipes-core.module.min.js +72 -1
  246. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  247. package/dist/semiotic-recipes-react.min.js +3 -1
  248. package/dist/semiotic-server-edge-node.module.min.js +391 -1
  249. package/dist/semiotic-server-edge.min.js +651 -1
  250. package/dist/semiotic-server-edge.module.min.js +372 -1
  251. package/dist/semiotic-server-node.min.js +651 -1
  252. package/dist/semiotic-server-node.module.min.js +1 -1
  253. package/dist/semiotic-text.min.js +1 -1
  254. package/dist/semiotic-text.module.min.js +1 -1
  255. package/dist/semiotic-themes-core.min.js +1 -1
  256. package/dist/semiotic-themes-core.module.min.js +1 -1
  257. package/dist/semiotic-themes.min.js +1 -1
  258. package/dist/semiotic-themes.module.min.js +1 -1
  259. package/dist/semiotic-utils-core.min.js +11 -1
  260. package/dist/semiotic-utils-core.module.min.js +8 -1
  261. package/dist/semiotic-value.module.min.js +15 -1
  262. package/dist/semiotic-xy.d.ts +1 -0
  263. package/dist/semiotic.d.ts +3 -11
  264. package/dist/semiotic.module.min.js +10 -1
  265. package/dist/server.min.js +651 -1
  266. package/dist/server.module.min.js +1 -1
  267. package/dist/xy.module.min.js +1 -1
  268. package/package.json +8 -7
  269. package/dist/c-2N7IU2NY.min.js +0 -1
  270. package/dist/c-2RL2QPZJ.min.js +0 -1
  271. package/dist/c-2WK7YJLL.min.js +0 -1
  272. package/dist/c-45CQWZZ6.min.js +0 -1
  273. package/dist/c-4BRHKVKV.min.js +0 -1
  274. package/dist/c-7242NXSG.min.js +0 -1
  275. package/dist/c-7DVPSB5C.min.js +0 -1
  276. package/dist/c-7EGHJU2F.min.js +0 -1
  277. package/dist/c-A7OGOFSL.min.js +0 -1
  278. package/dist/c-AFBSWT77.min.js +0 -1
  279. package/dist/c-AH5HWZWS.min.js +0 -1
  280. package/dist/c-AJ7EC32V.min.js +0 -1
  281. package/dist/c-AQADQNY7.min.js +0 -1
  282. package/dist/c-ATM475SA.min.js +0 -1
  283. package/dist/c-AVO3Q7T7.min.js +0 -1
  284. package/dist/c-B7GW7IHJ.min.js +0 -1
  285. package/dist/c-BNFJMDHN.min.js +0 -1
  286. package/dist/c-BOHCQILI.min.js +0 -1
  287. package/dist/c-C3TZLTZK.min.js +0 -1
  288. package/dist/c-CGQAQWBV.min.js +0 -1
  289. package/dist/c-CPV4N35K.min.js +0 -1
  290. package/dist/c-DIPEYUOW.min.js +0 -1
  291. package/dist/c-E4JDJH4I.min.js +0 -1
  292. package/dist/c-E72OTUZU.min.js +0 -1
  293. package/dist/c-E7I2L7CU.min.js +0 -1
  294. package/dist/c-ELDWAO2V.min.js +0 -1
  295. package/dist/c-EUBTECGM.min.js +0 -1
  296. package/dist/c-EUMPMDCS.min.js +0 -1
  297. package/dist/c-EZZT2WAE.min.js +0 -1
  298. package/dist/c-FHBVFCQB.min.js +0 -1
  299. package/dist/c-G4HCO2IQ.min.js +0 -1
  300. package/dist/c-G5VIJEOK.min.js +0 -1
  301. package/dist/c-GHVOXAYH.min.js +0 -1
  302. package/dist/c-GXV3C3MO.min.js +0 -1
  303. package/dist/c-HHTK2R75.min.js +0 -1
  304. package/dist/c-HLLFJYTY.min.js +0 -1
  305. package/dist/c-HP4ZFM47.min.js +0 -1
  306. package/dist/c-HPOYKCCG.min.js +0 -1
  307. package/dist/c-HYDTS5OP.min.js +0 -1
  308. package/dist/c-I4QJ6YLM.min.js +0 -1
  309. package/dist/c-IK33LNZ6.min.js +0 -1
  310. package/dist/c-IK3PZHRY.min.js +0 -1
  311. package/dist/c-JIMJF6F6.min.js +0 -1
  312. package/dist/c-JUKIWTBJ.min.js +0 -1
  313. package/dist/c-KKPMHAZC.min.js +0 -1
  314. package/dist/c-L6WNDBHV.min.js +0 -1
  315. package/dist/c-LDEX5OFW.min.js +0 -1
  316. package/dist/c-LESEUVC5.min.js +0 -1
  317. package/dist/c-LYQMZMZQ.min.js +0 -1
  318. package/dist/c-MB6CV5NC.min.js +0 -1
  319. package/dist/c-MOKJOIPE.min.js +0 -1
  320. package/dist/c-N3FXLRNT.min.js +0 -1
  321. package/dist/c-N5NPTJVJ.min.js +0 -1
  322. package/dist/c-NHBL4J67.min.js +0 -1
  323. package/dist/c-ODG6TFSY.min.js +0 -1
  324. package/dist/c-PRIKOLTE.min.js +0 -1
  325. package/dist/c-PSKKFZNP.min.js +0 -1
  326. package/dist/c-PSNI6KAZ.min.js +0 -1
  327. package/dist/c-QAVFOEUY.min.js +0 -1
  328. package/dist/c-R2P4RR7Q.min.js +0 -1
  329. package/dist/c-RFC7UAG7.min.js +0 -1
  330. package/dist/c-S3AZX5PP.min.js +0 -1
  331. package/dist/c-SGAURYHG.min.js +0 -1
  332. package/dist/c-SJMWU6UX.min.js +0 -1
  333. package/dist/c-STIIGQOD.min.js +0 -1
  334. package/dist/c-T2ASIJVZ.min.js +0 -1
  335. package/dist/c-T2V7O2LO.min.js +0 -1
  336. package/dist/c-TKG2NP7G.min.js +0 -1
  337. package/dist/c-TX3THUTO.min.js +0 -1
  338. package/dist/c-TX7XJM3Z.min.js +0 -1
  339. package/dist/c-UC7SIU2W.min.js +0 -1
  340. package/dist/c-UMXSJIOV.min.js +0 -1
  341. package/dist/c-VRSXMLYF.min.js +0 -1
  342. package/dist/c-VSLWSAN2.min.js +0 -1
  343. package/dist/c-VXLOLYTO.min.js +0 -1
  344. package/dist/c-W4ZUKSEQ.min.js +0 -1
  345. package/dist/c-WCBRPILW.min.js +0 -1
  346. package/dist/c-WGHT7OCY.min.js +0 -1
  347. package/dist/c-WWCW3APR.min.js +0 -1
  348. package/dist/c-XSB27XPS.min.js +0 -1
  349. package/dist/c-Y6PYUMFU.min.js +0 -1
  350. package/dist/c-YDECTEUW.min.js +0 -1
  351. package/dist/c-YF3YKVQI.min.js +0 -1
  352. package/dist/c-YLZIV3VS.min.js +0 -1
  353. package/dist/c-ZIVPFTOC.min.js +0 -1
@@ -1 +0,0 @@
1
- function e(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function t(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function i(e,t,i){return e?"function"==typeof e?{...i,...e(t)}:{...i,...e}:{...i}}function r(e,t){if(2>e.length)return[e];let i=.4*t,r=[],n=[e[0]];for(let t=1;e.length>t;t++){let o=e[t];Math.abs(o[0]-e[t-1][0])>i?(n.length>=2&&r.push(n),n=[o]):n.push(o)}return n.length>=2&&r.push(n),r}function n(e,t,i=24){let r=t[0]-e[0],n=t[1]-e[1],o=Math.sqrt(r*r+n*n);if(0===o)return[e,t];let a=-n/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,h=[];for(let r=0;i>=r;r++){let n=r/i,o=1-n;h.push([o*o*e[0]+2*o*n*c+n*n*t[0],o*o*e[1]+2*o*n*u+n*n*t[1]])}return h}function o(e,t){if(2>e.length)return e;let i=t/2+1,r=[];for(let t=0;e.length>t;t++){let n,o,a=e[t];0===t?(n=e[1][0]-a[0],o=e[1][1]-a[1]):t===e.length-1?(n=a[0]-e[t-1][0],o=a[1]-e[t-1][1]):(n=e[t+1][0]-e[t-1][0],o=e[t+1][1]-e[t-1][1]);let s=Math.sqrt(n*n+o*o)||1;r.push([a[0]+o/s*i,a[1]+-n/s*i])}return r}function a(e,t,i,r,n){let o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];let l=a/s,c=-o/s,u=n/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function s(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&.5>e)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${e+""}.`)}function l(e,t,i,r,n,o,a=0,s=r){if(o){let e=U(o,t,i,r,a);if(e&&!1!==e.node.interactive)return e}else{let n=null,o=1/0;for(let a of e){if("point"!==a.type||!1===a.interactive)continue;let e=a.x-t,s=a.y-i,l=Math.sqrt(e*e+s*s);Q(a.r,r)>=l&&o>l&&(n=a,o=l)}if(n)return{node:n,distance:o}}let l=null,c=1/0;for(let n of e){if("glyph"!==n.type||null==n.datum)continue;let e=dt(n.glyph,n.size),o=n.x+e.centerDx-t,a=n.y+e.centerDy-i,s=Math.sqrt(o*o+a*a);Q(e.radius,r)>=s&&c>s&&(l=n,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){let o=e[r];if("geoarea"!==o.type)continue;let a=o;if(!1===a.interactive)continue;let[[s,l],[c,u]]=a.bounds;if(!(s>t||t>c||l>i||i>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),n.isPointInPath(a._cachedPath2D,t,i)))return{node:a,distance:0}}let u=null,h=1/0;for(let r of e){if("line"!==r.type)continue;let e=r,{path:n}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=i-o,d=i+o;for(let r=0;n.length-1>r;r++){let s=n[r],p=n[r+1],f=s[0],m=s[1],g=p[0],y=p[1];if(a>f&&a>g||f>l&&g>l||c>m&&c>y||m>d&&y>d)continue;let v=te(t,i,f,m,g,y);o>=v&&h>v&&(u=e,h=v)}}return u?{node:u,distance:h}:null}function c(e){let{width:t,height:i,totalWidth:r,totalHeight:n,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P,autoPlaceAnnotations:x,svgAnnotationRules:k,pointNodes:S,geoProjection:C}=e,L=et({onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P}),A=ti([v?.length??0,new Map]),D=v?.length??0;A.current[0]!==D&&(A.current=[D,new Map]);let j=ei(()=>{if(!v||0===v.length)return null;let e=$(v),r=C?e.map(e=>{if(!Array.isArray(e.coordinates)||2>e.coordinates.length)return e;let t=C(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,n={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:i,frameType:"xy",pointNodes:S,stickyPositionCache:A.current[1]},o=x?De({annotations:r,context:n,..."object"==typeof x?x:{}}):r;return Ue(o,Be("xy",L),k,n)},[v,x,k,t,i,S,L,C]),M=a||s||l||u||y||j&&j.length>0,T=ii(),{titleId:B,descId:_,labelledBy:I}=V(c||w||T);return M?ni("svg",{role:"img","aria-labelledby":I,width:r,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[ri("title",{id:B,children:K(s,"Geographic chart")}),ri("desc",{id:_,children:Y(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),ni("g",{transform:"translate("+o.left+","+o.top+")",children:[j,y]}),ri(xe,{title:s,totalWidth:r,marginTop:o.top}),Xe({legend:u,totalWidth:r,totalHeight:n,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f})]}):null}function u([e,t,i]){let r=1<<i;return[e-Math.floor(e/r)*r,t,i]}function h(e,t,i,r,n){return"function"==typeof e?e(t,i,r,n):e.replace("{z}",t+"").replace("{x}",i+"").replace("{y}",r+"").replace("{r}",n>1?"@2x":"")}function d(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function p(e){let t=0;for(let i=1;e.length>i;i++){let r=e[i][0]-e[i-1][0],n=e[i][1]-e[i-1][1];t+=Math.sqrt(r*r+n*n)}return t}function f(e,t){let i=0;for(let r=1;e.length>r;r++){let n=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(n*n+o*o);if(i+a>=t||r===e.length-1){let s=a>0?(t-i)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+n*s,y:e[r-1][1]+o*s,nx:-o/l,ny:n/l}}i+=a}let r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function m(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("glyph"===i.type){let e=i,r=dt(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function g({data:e}){if(!e)return null;if(e.properties)return mi("div",{className:"semiotic-tooltip",style:_e,children:mi("div",{style:{fontWeight:600},children:e.properties.name||e.properties.NAME||e.properties.id||"Feature"})});let t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;let i=Ke(t),r=null!=i.title?i.title+"":null;return null==r&&0===i.entries.length?null:gi("div",{className:"semiotic-tooltip",style:_e,children:[null!=r&&mi("div",{style:{fontWeight:600,marginBottom:i.entries.length?2:0},children:r}),i.entries.map(e=>gi("div",{children:[gi("span",{style:{opacity:.7},children:[e.key,": "]}),mi("span",{style:{fontWeight:600},children:X(e.value)})]},e.key))]})}function y(){if(null!==vi)return vi;if(typeof window>"u")return!1;let e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="u">typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,i="u">typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return vi=e||t||i}function v(){return y()?12:30}function b(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function R(e){return e?e.getContext("2d"):null}function w(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,i=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>i||i>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let r=R(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};let n=l(e.scene,t,i,Ne(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ne(6,e.pointer.pointerType));if(!n)return{kind:"miss"};let{node:o}=n,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,c="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,u="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:i;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:c,y:u}}}function P({graphics:e,size:t,margin:i,readScales:r,tracker:n}){return wi(n.subscribe,n.getSnapshot,n.getSnapshot),Ri.createElement(Ri.Fragment,null,re(e,t,i,r()))}import{useCustomChartScaffold as x}from"./c-TX7XJM3Z.min.js";import{useChartSetup as k}from"./c-RFC7UAG7.min.js";import{resolveNodeColor as S}from"./c-ORLEBW72.min.js";import{lineCanvasRenderer as C}from"./c-R2P4RR7Q.min.js";import{RingBuffer as L,compactTimestampBufferForRemoval as A,computePulseIntensity as D,hasActivePulses as j,pushWithTimestamp as M,refreshIdlePulse as T,setPulseState as B,useGeoKeyboardNavigation as _,useSemanticFrameInteractions as I}from"./c-N3FXLRNT.min.js";import{pointCanvasRenderer as E}from"./c-MOKJOIPE.min.js";import{needsDataCanvasPaint as N,needsInteractionCanvasPaint as F}from"./c-V4XMSLC3.min.js";import{glyphCanvasRenderer as O}from"./c-KKPMHAZC.min.js";import{StalenessBadge as z,attachUpdateResultStore as W,buildBaseMetadataProps as H,buildCustomBehaviorProps as G,composeOverlays as q,computeDecayOpacity as Z,filterAnnotationsByStatus as $,findHitPointInQuadtree as U,formatVal as X,getHitRadius as Q,overlayAccessibleDescription as Y,overlayAccessibleIds as V,overlayAccessibleTitle as K,paintCanvasBackground as J,paintSceneWithBackend as ee,pointToSegmentDistance as te,renderSceneWithBackend as ie,resolveFrameGraphics as re,resolveFrameLayers as ne,runCustomLayoutAttempt as oe,shouldHandleFramePointer as ae,useConfigSync as se,useLayoutSelectionSync as le,useLegendCategoryEmission as ce,useStableShallow as ue,useStalenessCheck as he,warnCustomLayoutDiagnostics as de}from"./c-SGAURYHG.min.js";import{wrapWithCustomLayoutSelection as pe}from"./c-YDECTEUW.min.js";import{renderPathPulse as fe}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as me,resolveCustomLayoutPalette as ge}from"./c-EUBTECGM.min.js";import{AccessibleDataTable as ye,AccessibleTablePortal as ve,AriaLiveTooltip as be,CanvasFrameBackground as Re,FlippingTooltip as we,FocusRing as Pe,SVGChartTitle as xe,SafeRender as ke,SceneRevisionDiagnosticsObserver as Se,ScreenReaderSummary as Ce,SkipToTableLink as Le,UpdateResultTracker as Ae,annotationLayout as De,computeCanvasAriaLabel as je,computeEasing as Me,computeRawProgress as Te,createDefaultAnnotationRules as Be,defaultTooltipStyle as _e,filterSparseArray as Ie,getDevicePixelRatio as Ee,getPointerHitRadius as Ne,glyphNodeToSVG as Fe,isAnnotationActivationTarget as Oe,isServerEnvironment as ze,lerp as We,normalizeTooltip as He,now as Ge,observationInputType as qe,prepareCanvas as Ze,rehitCanvasMarkCursor as $e,renderAnnotationPass as Ue,renderLegendFromConfig as Xe,sceneHasAuthoredCursor as Qe,sceneMarkCursor as Ye,setCanvasMarkCursor as Ve,smartTooltipEntries as Ke,svgFill as Je,useAnnotationActivationOptions as et,useCanvasMarkCursorCleanup as tt,useFrame as it,useFrameCanvasHost as rt,useHydration as nt,useSceneRevisionDiagnostics as ot,useWasHydratingFromSSR as at,withSceneMarkCursor as st}from"./c-ODG6TFSY.min.js";import{STREAMING_PALETTE as lt}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as ct}from"./c-JUKIWTBJ.min.js";import{getMax as ut}from"./c-QA3HMQJP.min.js";import{coerceCanvasFill as ht,glyphHitGeometry as dt,hatchPatternDef as pt,isHatchFill as ft,resolveCSSColor as mt}from"./c-MB6CV5NC.min.js";import{forwardRef as gt,memo as yt,useCallback as vt,useEffect as bt,useMemo as Rt,useRef as wt,useState as Pt}from"react";import{geoPath as xt}from"d3-geo";import{quadtree as kt}from"d3-quadtree";import{geoMercator as St,geoEqualEarth as Ct,geoAlbersUsa as Lt,geoOrthographic as At,geoNaturalEarth1 as Dt,geoEquirectangular as jt}from"d3-geo";var Mt={mercator:St,equalEarth:Ct,albersUsa:Lt,orthographic:At,naturalEarth:Dt,equirectangular:jt};import{scaleLinear as Tt}from"d3-scale";var Bt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],_t=["scene-style","data-paint","accessibility","evidence"],It=(e,t)=>({retainedData:e,invalidations:t}),Et=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Nt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ft=["scene-geometry","data-paint","accessibility","evidence"],Ot=["scene-style","data-paint","accessibility","evidence"],zt=["overlay","accessibility","evidence"],Wt=[],Ht={xAccessor:It("rebuild",Et),yAccessor:It("rebuild",Et),lineDataAccessor:It("rebuild",Et),pointIdAccessor:It("rebuild",Ft),lineIdAccessor:It("rebuild",Ft),windowSize:It("rebuild",Et),projection:It("preserve",Nt),projectionExtent:It("preserve",Nt),fitPadding:It("preserve",Nt),lineType:It("preserve",Nt),flowStyle:It("preserve",Nt),graticule:It("preserve",Nt),projectionTransform:It("preserve",Nt),customLayout:It("preserve",Nt),layoutConfig:It("preserve",Nt),layoutMargin:It("preserve",Nt),areaStyle:It("preserve",Ot),pointStyle:It("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:It("preserve",Ot),colorScheme:It("preserve",Ot),themeCategorical:It("preserve",Ot),themeDiverging:It("preserve",Ot),themeSemantic:It("preserve",Ot),themeSequential:It("preserve",Ot),decay:It("preserve",Ot),pulse:It("preserve",Ot),layoutSelection:It("preserve",Ot),annotations:It("preserve",zt),autoPlaceAnnotations:It("preserve",zt),clock:It("preserve",Wt),transition:It("preserve",Wt),introAnimation:It("preserve",Wt),onLayoutError:It("preserve",Wt)},Gt=It("preserve",Nt),qt=class{constructor(){this.tracker=new Ae}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}},Bt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},_t):this.recordNoop("restyle")}recordConfig(e,t={}){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Ht[r]??Gt;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e),r=new Set(i.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}};import{geoDistance as Zt,geoGraticule as $t,geoInterpolate as Ut}from"d3-geo";var Xt=class l{constructor(e){this.updateResults=new qt,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(e){return{...e,fitPadding:s(e.fitPadding)}}(e)}currentTime(){return this.config.clock?.()??Ge()}getConfiguredWindowSize(){let e=this.config.windowSize??500;if(!Number.isInteger(e)||1>e)throw Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){let t=this.pointBuffer.toArray(),i=this.timestampBuffer?.toArray()??[],r=t.slice(-e),n=i.slice(-r.length),o=this.currentTime();this.pointBuffer=new L(e),this.timestampBuffer=new L(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(n[t]??o)})}this.retainNewestLines(e)}updateConfig(e){let t=function(e){return"fitPadding"in e?{...e,fitPadding:s(e.fitPadding)}:e}(e),i=this.config,r=this.getConfiguredWindowSize(),n=Object.keys(t).filter(e=>t[e]!==i[e]);this.config={...this.config,...t};let o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(n,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});let t=this.getConfiguredWindowSize(),i=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],n=i.slice(-t),o=r.slice(-n.length),a=this.currentTime();this.pointBuffer=new L(t),this.timestampBuffer=new L(t),n.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();M(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();for(let i of e)M(this.pointBuffer,i,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");let t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(let e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){let{lineIdAccessor:t}=this.config;if(!t)throw Error("removeLine() requires lineIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),n=[];return this.lineData=this.lineData.filter(e=>!r.has(i(e)+"")||(n.push(e),!1)),n.length>0?(this.version++,this.updateResults.recordData("remove",n.length)):this.updateResults.recordNoop("remove"),n}getLines(){return this.lineData.slice()}removePoint(e){let{pointIdAccessor:t}=this.config;if(!t)throw Error("removePoint() requires pointIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){let e=e=>r.has(i(e)+"");A(this.pointBuffer,this.timestampBuffer,e);let t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{let e=[];return this.pointData=this.pointData.filter(t=>!r.has(i(t)+"")||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){let t=this._customRestyle;if(t){for(let i of this.scene){let r=this._baseStyles.get(i)??i.style,n=t(i,e);i.style=n?{...r,...n}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){let{config:t}=this,i=this.projection,r=this.geoPath,n=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=function(e){if(!e)return Ct();if("string"==typeof e){let t=Mt[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),Ct())}if("object"==typeof e&&"type"in e){let t=Mt[e.type],i=t?t():Ct();return e.rotate&&"rotate"in i&&i.rotate(e.rotate),e.center&&"center"in i&&i.center(e.center),i}return e}(t.projection),this.geoPath=xt(this.projection),this.fitProjection(e),this.geoPath=xt(this.projection);let c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=i,this.geoPath=r,this.scales=n,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){let t=e.width/2,i=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:i}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(i){let r=this.projection,n=this.config,o=[...this.areas],a=e(n.xAccessor,"lon"),s=e(n.yAccessor,"lat"),l=this.getPoints();if(l.length>0){let e=l.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}let c=t(n.lineDataAccessor);for(let e of this.lineData){let t=c(e);if(t&&t.length>0){let e=t.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==o.length){if(n.projectionExtent){let[[e,t],[o,a]]=n.projectionExtent;r.fitExtent([[0,0],[i.width,i.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[e,t],[e,a],[o,a],[o,t],[e,t]]]}})}else if(r.clipAngle&&(r.clipAngle()??0)>0){let e=n.fitPadding??0,t=Math.min(i.width,i.height);r.scale(t/2-t*e),r.translate([i.width/2,i.height/2])}else{let e=n.fitPadding??0,t=i.width*e,a=i.height*e;r.fitExtent([[t,a],[i.width-t,i.height-a]],{type:"FeatureCollection",features:o})}this.baseScale=r.scale(),this.baseTranslate=r.translate(),this.baseRotation=r.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,o=i.scale(),a=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e.k),i.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(o),i.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,o=i.scale(),a=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e),i.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(o),i.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){let i=this.projection;if(!i||!i.rotate)return;let r=this.geoPath,n=this.scales,o=[...i.rotate()];i.rotate(e),this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.rotate(o),this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){let t=this.projection;!t||!t.rotate||t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,t=0;for(let i of this.scene)"point"===i.type&&!1!==i.interactive&&(t++,i.r>e&&(e=i.r));if(this._maxPointRadius=e,l.QUADTREE_THRESHOLD>=t)return void(this._quadtree=null);let i=Array(t),r=0;for(let e of this.scene)"point"===e.type&&!1!==e.interactive&&(i[r++]=e);this._quadtree=kt().x(e=>e.x).y(e=>e.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(s){this._customLayoutFailedThisBuild=!1;let{config:l}=this,c=this.projection,u=this.geoPath;if(l.customLayout&&this.scales){let e=l.layoutMargin??{top:0,right:0,bottom:0,left:0},t=ge(l.colorScheme,l.themeCategorical,lt),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:s.width,height:s.height,margin:e,plot:{x:0,y:0,width:s.width,height:s.height}},theme:{semantic:l.themeSemantic??{},categorical:[...t]},resolveColor:me(t,l.colorScheme),config:l.layoutConfig??{},selection:l.layoutSelection??null},r=oe({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:l.onLayoutError,run:()=>l.customLayout(i)});if("failure"===r.kind)return this.lastCustomLayoutFailure=r.diagnostic,this._customLayoutFailedThisBuild=!0,r.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let n=r.result,o=n.nodes??[];if(this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null,this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle)for(let e of o){this._baseStyles.set(e,e.style);let t=n.restyle?.(e,l.layoutSelection??null);t&&(e.style={...e.style,...t})}return de({label:"geo customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:s,projection:l,path:c,areas:u,points:h,lines:d,layout:p}){let f=e(s.xAccessor,"lon"),m=e(s.yAccessor,"lat"),g=[],y=function(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(s),v=function(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(s),b=function(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(s);if(s.graticule){let e=!0===s.graticule?{}:s.graticule,t=$t();e.step&&t.step(e.step);let i=c(t())||"";i&&g.push({type:"geoarea",pathData:i,centroid:[p.width/2,p.height/2],bounds:[[0,0],[p.width,p.height]],screenArea:0,style:{fill:"none",stroke:e.stroke||"#e0e0e0",strokeWidth:e.strokeWidth??.5,strokeDasharray:e.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(let e of u){let t=c(e);if(!t)continue;let r=c.centroid(e),n=c.bounds(e),o=c.area(e);g.push({type:"geoarea",pathData:t,centroid:r,bounds:n,screenArea:o,style:i(s.areaStyle,e,y),datum:e,interactive:!0})}let R=t(s.lineDataAccessor);for(let e of d){let t=R(e);if(!t||2>t.length)continue;let c=[];if("geo"===s.lineType){let e=Array(t.length);for(let i=0;t.length>i;i++)e[i]=[f(t[i]),m(t[i])];for(let t=0;e.length-1>t;t++){let i=e[t],r=e[t+1],n=Zt(i,r)||0,o=Math.max(2,Math.ceil(n/(Math.PI/180))),a=Ut(i,r);for(let e=0;o>=e;e++){if(t>0&&0===e)continue;let i=l(a(e/o));null!=i&&c.push(i)}}}else for(let e=0;t.length>e;e++){let i=t[e],r=l([f(i),m(i)]);null!=r&&c.push(r)}if(2>c.length)continue;let u=i(s.lineStyle,e,v),h="number"==typeof u.strokeWidth?u.strokeWidth:1;2!==t.length||2>c.length||"arc"!==s.flowStyle?2===t.length&&c.length>=2&&"offset"===s.flowStyle&&(c="geo"===s.lineType?o(c,h):a(c[0],c[c.length-1],0,0,h)):c=n(c[0],c[c.length-1]);let d=r(c,p.width);if(d.length>1)for(let t of d)2>t.length||g.push({type:"line",path:t,style:{...u,_edgeFade:!0},datum:e});else g.push({type:"line",path:2>c.length&&d[0]||c,style:u,datum:e})}let w=s.pointIdAccessor?"function"==typeof s.pointIdAccessor?s.pointIdAccessor:e=>e[s.pointIdAccessor]:null,P=l.clipAngle?l.clipAngle()??0:0,x=P>0?P*Math.PI/180:null,k=l.rotate?l.rotate():[0,0,0],S="function"==typeof l.center?l.center():[0,0],C=[(S[0]??0)-k[0],(S[1]??0)-k[1]];for(let e of h){let t=f(e),i=m(e);if(null!=x&&Zt([t,i],C)>x)continue;let r=l([t,i]);if(!r)continue;let n=s.pointStyle?s.pointStyle(e):{...b},o={type:"point",x:r[0],y:r[1],r:n.r||4,style:n,datum:e,pointId:w?w(e)+"":void 0};g.push(o)}return g}({config:l,projection:c,path:u,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:s})}applyCartogramTransform(e,t){let i=function(e,t,i,r){let n=e.filter(e=>"point"===e.type);if(2>n.length)return null;let o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;let l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=n.find(e=>e.datum&&l(e.datum)+""==t.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;let h=n.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),d=ut(h,1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){let i=e[t];"geoarea"===i.type&&i.interactive&&e.splice(t,1)}let p="strip"===s?function(e,t,i,r,n){let o=Math.max(3,Math.min(8,.35*n.height)),a=Math.max(1,n.width-2*o),s=n.height/2,l=Tt().domain([0,r]).range([0,a]);t.x=o,t.y=s;let c=[];for(let n of e){if(n===t)continue;if(!n.datum){n.x=o,n.y=s;continue}let e=Number(i(n.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);n.x=a,n.y=s,c.push({node:n,x:a})}c.sort((e,t)=>e.x-t.x);let u=Math.max(0,Math.min(n.height/2-1,6)),h=0;for(;c.length>h;){let e=h+1;for(;c.length>e&&3>Math.abs(c[e].x-c[h].x);)e++;let t=e-h;if(t>1&&u>0)for(let e=0;t>e;e++)c[h+e].node.y=s+(e-(t-1)/2)*Math.min(2.5,2*u/Math.max(1,t-1));h=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}(n,u,c,d,i):function(e,t,i,r,n,o){let a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,h=Tt().domain([0,r]).range([0,u]);for(let o of e){if(o===t||!o.datum)continue;let e=o.x,u=o.y,d=Math.atan2(u-s,e-a),p=Math.hypot(e-a,u-s),f=Number(i(o.datum)),m=isFinite(f)&&f>=0?r>0?h(f):0:p,g=l+Math.cos(d)*m,y=c+Math.sin(d)*m;o.x=e+(g-e)*n,o.y=u+(y-u)*n}return t.x=a+(l-a)*n,t.y=s+(c-s)*n,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}(n,u,c,d,a,i),f=e.filter(e=>"line"===e.type);if(f.length>0){let e=new Map;for(let t of n)null!=t.pointId&&e.set(t.pointId+"",[t.x,t.y]);for(let i of f){let r=i.datum?.source,n=i.datum?.target;if(null!=r&&null!=n){let o=e.get(r+""),a=e.get(n+"");if(o&&a)if("fractional"===t.lineMode&&i.path.length>2){let e=i.path[0],t=i.path[i.path.length-1],r=[o[0]-e[0],o[1]-e[1]],n=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;i.path.length>e;e++)s.push(s[e-1]+Math.hypot(i.path[e][0]-i.path[e-1][0],i.path[e][1]-i.path[e-1][1]));let l=s[s.length-1];i.path=i.path.map((e,t)=>{let o=l>0?s[t]/l:t/(i.path.length-1);return[e[0]+r[0]*(1-o)+n[0]*o,e[1]+r[1]*(1-o)+n[1]*o]})}else i.path=[o,a]}}}return p}(this.scene,e,t,this.areas.length);i&&(this.cartogramLayout=i)}applyDecay(){let e=this.config.decay;if(!e||!this.pointBuffer)return;let t=this.pointBuffer.size;if(0===t)return;let i=this.scene.filter(e=>"point"===e.type);for(let r=0;i.length>r;r++){let n=Z(e,r,t);i[r]._decayOpacity=n,i[r].style={...i[r].style,opacity:n}}}applyPulse(e=this.currentTime()){let t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;let i=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),n=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4,a=!1;for(let s=0;i.length>s&&r.length>s;s++){let l=D(t,r[s],e);a=B(i[s],l,n,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&j(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){let t=this.config.transition?.duration??300;if(0>=t)return;let i=new Map;for(let t of e)"point"===t.type&&t.pointId&&i.set(t.pointId,[t.x,t.y]);let r=this.scene.filter(e=>"point"===e.type),n=!1;for(let e of r)if(e.pointId){let t=i.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(n=!0))}for(let e of r)e.pointId&&!i.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},n=!0);n&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(let e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;let t=Te(e,this.activeTransition),i=Me(t),r=this.scene.filter(e=>"point"===e.type);for(let e of r){if(null!=e._targetX&&null!=e._targetY){let t=e.y;e.x=We(e.x,e._targetX,i),e.y=We(t,e._targetY,i)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*i})}if(t>=1){for(let e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};Xt.QUADTREE_THRESHOLD=500;var Qt=Xt;W(Qt);import{useCallback as Yt,useImperativeHandle as Vt}from"react";import{select as Kt}from"d3-selection";import{zoomIdentity as Jt}from"d3-zoom";import{useMemo as ei,useRef as ti,useId as ii}from"react";import{jsx as ri,jsxs as ni}from"react/jsx-runtime";import*as oi from"react";import{jsx as ai,jsxs as si}from"react/jsx-runtime";import{zoom as li,zoomIdentity as ci}from"d3-zoom";import{select as ui}from"d3-selection";var hi=new WeakMap,di=1,pi=class{constructor(e=256){this.cache=new Map,this.limit=d(e)}setLimit(e){this.limit=d(e),this.cache.size>this.limit&&this.evict()}get(e){let t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(let[i,r]of this.cache)t>r.lastUsed&&(t=r.lastUsed,e=i);if(!e)break;{let t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(let e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},fi=class{constructor(e){this.capacity=e,this.particles=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let i=0;this.capacity>i;i++){let r=this.particles[i];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,i,r){for(let n=0;this.capacity>n;n++){let o=this.particles[n];if(!o.active)continue;let a=i[o.lineIndex];if(!a||2>a.length){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}let s=p(a),l=f(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let i=0;this.capacity>i;i++)this.particles[i].active&&this.particles[i].lineIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1}};import{jsx as mi,jsxs as gi}from"react/jsx-runtime";g.ownsChrome=!0;var yi={top:10,right:10,bottom:10,left:10},vi=null,bi={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"};import*as Ri from"react";import{useSyncExternalStore as wi}from"react";import{jsx as Pi,jsxs as xi}from"react/jsx-runtime";var ki=yt(gt(function(e,t){let{projection:i,projectionExtent:r,fitPadding:n,projectionTransform:o,areas:a,points:s,lines:d,customLayout:p,layoutConfig:f,layoutSelection:x,onLayoutError:k,xAccessor:L,yAccessor:A,lineDataAccessor:D,pointIdAccessor:j,lineIdAccessor:M,lineType:B="geo",flowStyle:W="basic",graticule:H,zoomable:G,zoomExtent:Z,onZoom:$,dragRotate:U,showParticles:X,particleStyle:Q,tileURL:Y,tileAttribution:V,tileCacheSize:K,size:te,width:re,height:oe,responsiveWidth:de,responsiveHeight:me,margin:ge,className:xe,background:ke,maxDevicePixelRatio:Ae,windowSize:De=500,renderMode:Me,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,enableHover:He=!0,hoverAnnotation:Ge,tooltipContent:Ue,allowTooltipOverflow:Xe=!1,customClickBehavior:Ke,customHoverBehavior:et,onObservation:lt,annotationObservationCallback:ut,chartId:dt,annotations:gt,onAnnotationActivate:yt,autoPlaceAnnotations:xt,svgAnnotationRules:kt,decay:St,pulse:Ct,transition:Lt,animate:At,staleness:Dt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t=!1,suspendWhenHidden:It=!0,backgroundGraphics:Et,foregroundGraphics:Nt,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,legendCategoryAccessor:$t,onCategoriesChange:Ut,showAxes:Xt,accessibleTable:ei=!0,description:ti,summary:ii}=e,{customHoverBehavior:ri,customClickBehavior:ni,hasClickBehavior:mi}=I({customHoverBehavior:et,customClickBehavior:Ke,onObservation:lt,chartId:dt,chartType:"StreamGeoFrame"}),gi=te||[re||600,oe||400],vi=wt(!0),wi=it({sizeProp:gi,responsiveWidth:de,responsiveHeight:me,userMargin:ge,marginDefault:yi,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendMarginReserved:e.__legendMarginReservedFor===Ot,animate:At,transitionProp:Lt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t,suspendWhenHidden:It,themeDirtyRef:vi}),{reducedMotionRef:ki,responsiveRef:Si,size:Ci,margin:Li,adjustedWidth:Ai,adjustedHeight:Di,transition:ji,introEnabled:Mi,tableId:Ti,frameRuntime:Bi,rafRef:_i,renderFnRef:Ii,scheduleRender:Ei,currentTheme:Ni}=wi,Fi=nt(),Oi=at(),zi=Rt(()=>Array.isArray(a)?Ie(a):a,[a]),Wi=Rt(()=>Ie(s),[s]),Hi=Rt(()=>Ie(d),[d]),Gi=U??"orthographic"===b(i),qi=Rt(()=>({projection:i,projectionExtent:r,fitPadding:n,xAccessor:L,yAccessor:A,lineDataAccessor:D,lineType:B,flowStyle:W,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,themeSemantic:ct(Ni),themeSequential:Ni?.colors?.sequential,themeDiverging:Ni?.colors?.diverging,themeCategorical:Ni?.colors?.categorical,graticule:H,projectionTransform:o,windowSize:De,clock:Bi.now,decay:St,pulse:Ct,transition:ji,introAnimation:Mi,annotations:gt,pointIdAccessor:j,lineIdAccessor:M,customLayout:p,layoutConfig:f,onLayoutError:k,layoutMargin:Li}),[i,r,n,L,A,D,B,W,Te,Be,_e,We,Ni,H,o,De,Bi.now,St,Ct,ji,Mi,gt,j,M,p,f,k,Li]),Zi=ue(qi),$i=wt(null);$i.current||($i.current=new Qt(Zi));let Ui=$i.current,Xi=wt(null),Qi=Xi.current??(Xi.current=function(e){let t=new Set,i=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>i,sync(e){if(e!==r){r=e,i+=1;for(let e of t)e()}}}}(Ui.scales)),Yi=ze||!Fi&&Oi;Yi&&(zi||s||d)&&(zi&&Ui.setAreas(zi),s&&Ui.setPoints(Wi),d&&Ui.setLines(Hi),Ui.computeScene({width:Ai,height:Di}));let{resolvedForeground:Vi,resolvedBackground:Ki,themeBackground:Ji,surfaceBackground:er}=function({tracker:e,readScales:t,...i}){let r=r=>"function"==typeof r?Ri.createElement(P,{graphics:r,size:i.size,margin:i.margin,readScales:t,tracker:e}):r;return{...ne({...i,resolveScaleAwareGraphics:!1}),resolvedForeground:r(i.foregroundGraphics),resolvedBackground:r(i.backgroundGraphics)}}({foregroundGraphics:Nt,backgroundGraphics:Et,size:Ci,margin:Li,scales:Ui.scales,background:ke,themeBackgroundColor:Ni.colors.background,tracker:Qi,readScales:()=>Ui.scales}),tr=wt(null),ir=wt(null),rr=wt(null);Y&&!rr.current&&(rr.current=new pi(K??256)),rr.current?.setLimit(K??256);let nr=wt(gt),or=wt(null),ar=wt(ci),sr=wt(!1),lr=wt(null),cr=vt(e=>{lr.current=e,Si&&"object"==typeof Si&&(Si.current=e)},[Si]),ur=wt(null),hr=wt(null),dr=wt(null),pr=wt(0);if(X&&!dr.current){let e=Q?.maxPerLine??v();dr.current=new fi(50*e)}let fr=wt(null),mr=wt(!1),gr=wt(null),yr=wt(!1),vr=wt(!1),br=ot("StreamGeoFrame"),Rr=wt(void 0),[wr,Pr]=Pt(null),[,xr]=Pt(0),kr=wt(0),[Sr,Cr]=Pt(!1),Lr=ce($i,$t,Ut,e=>e.getPoints());se($i,Zi,vi,Ei),le($i,x,vi,Ei),bt(()=>{let e=$i.current;e&&(zi&&e.setAreas(zi),s&&e.setPoints(Wi),d&&e.setLines(Hi),vi.current=!0,Ei())},[zi,s,Wi,d,Hi,Ei]),function(e,{storeRef:t,dirtyRef:i,scheduleRender:r,zoomTransformRef:n,containerRef:o,zoomBehaviorRef:a}){let s=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushPoint(e),i.current=!0,r())},[t,i,r]),l=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushMany(n),i.current=!0,r())},[t,i,r]),c=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushLine(e),i.current=!0,r())},[t,i,r]),u=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushManyLines(n),i.current=!0,r())},[t,i,r]),h=Yt(()=>{t.current?.clear(),i.current=!0,r()},[t,i,r]);Vt(e,()=>({push:s,pushMany:l,removePoint:e=>{let n=t.current?.removePoint(e)??[];return n.length>0&&(i.current=!0,r()),n},pushLine:c,pushManyLines:u,removeLine:e=>{let n=t.current?.removeLine(e)??[];return n.length>0&&(i.current=!0,r()),n},getLines:()=>t.current?.getLines()??[],clear:h,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>n.current.k,resetZoom:()=>{let e=o.current;e&&a.current&&Kt(e).call(a.current.transform,Jt)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,h,r,t,i,n,o,a])}(t,{storeRef:$i,dirtyRef:vi,scheduleRender:Ei,zoomTransformRef:ar,containerRef:lr,zoomBehaviorRef:or});let{hoverHandlerRef:Ar,onPointerMove:Dr,onPointerLeave:jr,pointerStateRef:Mr}=wi,{canvasRef:Tr,interactionCanvasRef:Br,resolutionDirtyRef:_r}=rt(wi,{hydrated:Fi,wasHydratingFromSSR:Oi,storeRef:$i,dirtyRef:vi,cleanup:()=>rr.current?.clear(),maxDevicePixelRatio:Ae,canvasPaintDependencies:[Ai,Di,ke,Et,Me,Y,K,Ei]});bt(()=>{Ar.current=e=>{let t=Tr.current;if(!t)return;let i=$i.current;if(!i||!i.scene.length)return void Ve(t);let r=w({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Li,width:Ai,height:Di,scene:i.scene,pointQuadtree:i.quadtree,maxPointRadius:i.maxPointRadius,hitCanvasRef:ir});Ve(t,"hit"===r.kind?Ye(r.node):void 0),He&&!1!==Ge&&("hit"===r.kind?(fr.current=r.hover,gr.current=r.node,Pr(r.hover),ri?.(r.hover),Ei()):("outside"===r.kind||"miss"===r.kind&&fr.current)&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei()))}},[He,Ge,Ai,Di,Li,ri,Ei,Ar,Tr]),wi.hoverLeaveRef.current=()=>{Ve(Tr.current),He&&!1!==Ge&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei())},tt(Tr);let Ir=vt(e=>{if(Oe(e.target)||!ni)return;let t=$i.current;if(!t||!t.scene.length)return void ni(null);let i=e.currentTarget.getBoundingClientRect(),r=e.clientX-i.left-Li.left,n=e.clientY-i.top-Li.top;if(0>r||r>Ai||0>n||n>Di)return void ni(null);ir.current||(ir.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let o=R(ir.current);if(!o)return void ni(null);let a=Ne(30,Rr.current),s=Ne(6,Rr.current),c=l(t.scene,r,n,a,o,t.quadtree,t.maxPointRadius,s);if(c){let e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,i=t?.properties?{...t,...t.properties}:t;return void ni({...i,data:t,properties:t?.properties,__semioticHoverData:!0,x:r,y:n,time:r,value:n},{type:"activate",inputType:qe(Rr.current)})}ni(null)},[Di,Ai,ni,Li]),{kbFocusIndexRef:Er,focusedNavPointRef:Nr,onKeyDown:Fr}=_({storeRef:$i,hoverRef:fr,hoveredNodeRef:gr,setHoverPoint:Pr,customHoverBehavior:ri,customClickBehavior:ni,scheduleRender:Ei}),Or=vt(e=>{ae(Mr,e,He&&!1!==Ge,mr.current,Tr.current)&&(Rr.current=e.pointerType,Er.current=-1,Nr.current=null,Dr(e))},[Tr,He,Ge,Nr,Er,Dr,Mr]),zr=vt(e=>{Rr.current=e.pointerType},[]);Ii.current=()=>{if(_i.current=null,Qi.sync($i.current?.scales??null),!Bi.isActive)return;let e=Tr.current,t=$i.current;if(!e||!t)return;let i=Bi.now(),r=!1,n=hr.current,o=!1;n&&(hr.current=null,t.applyRotation(n,{width:Ai,height:Di}),o=!0);let a=null!=t.activeTransition,s=t.advanceTransition(ki.current?i+1e6:i),l=!ki.current&&s,c=br.current.beforeCompute(t.getLastUpdateResult(),l),d=!1;if(vi.current&&!s){let e={width:Ai,height:Di},i=t.hasProjection(),r=Gi&&i?t.getRotation():null;t.computeScene(e);let n=ar.current,o=1!==n.k||0!==n.x||0!==n.y;Gi&&r?o?(t.setRotation(r),t.applyZoomScale(n.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(n,e),vi.current=!1,d=!0,Lr()}Qi.sync(t.scales),br.current.afterCompute(c,d,!1);let p=Ee(Ae,Ci),f=X&&!ki.current&&!!dr.current,m=t.consumeStylePaintPending();var g;(d||o||m)&&(mr.current=Qe(t.scene),mr.current||Ve(e)),mr.current&&(a||d||o||m)&&$e((g={canvas:e,pointer:Mr.current,store:t,margin:Li,width:Ai,height:Di,hitCanvasRef:ir,geometryMoved:a||d||o}).canvas,g.pointer,e=>{let t=w({pointer:e,canvasRect:g.canvas.getBoundingClientRect(),margin:g.margin,width:g.width,height:g.height,scene:g.store.scene,pointQuadtree:g.geometryMoved?null:g.store.quadtree,maxPointRadius:g.store.maxPointRadius,hitCanvasRef:g.hitCanvasRef});return"hit"===t.kind?Ye(t.node):void 0});let b=T(t,i,d,vr),R=N({dirtyOrRebuilt:d,transitioning:a,continuous:f,liveEncoding:b.changed,forced:o||m||_r.current});if(_r.current=!1,Y&&rr.current){let e=tr.current;if(e&&t.scales?.projection){let i=Ze(e,Ci,Li,p);i&&(i.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),i.save(),i.beginPath(),i.rect(0,0,Ai,Di),i.clip(),function(e,t){let{tileURL:i,projection:r,width:n,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),d=r.translate(),p=function(e){let{size:t,scale:i,translate:r,clampX:n=!0,clampY:o=!0}=e,a=Math.max(Math.log(i)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-i/2,h=r[1]-i/2,d=Math.max(n?0:-1/0,Math.floor((0-u)/c)),p=Math.min(n?l:1/0,Math.ceil((t[0]-u)/c)),f=Math.max(o?0:-1/0,Math.floor((0-h)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-h)/c)),g=[];for(let e=f;m>e;++e)for(let t=d;p>t;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,h/c],scale:c}}({size:[n,o],scale:2*c*Math.PI,translate:d}),f=Ee(l,[n,o]),m=function(e){if("string"==typeof e)return"template:"+e;let t=e,i=hi.get(t);return null==i&&(i=di++,hi.set(t,i)),"provider:"+i}(i),g=!0;for(let t of p.tiles){let[r,n,o]=u(t),l=h(i,o,r,n,f),c=`${m}|dpr:${f}|${o}/${r}/${n}|${l}`,d=a.get(c);if(!d){let e=new Image;e.crossOrigin="anonymous";let t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,d=t}if(!d.loaded){g=!1;continue}if(d.failed)continue;let y=p.scale;e.drawImage(d.img,(t[0]+p.translate[0])*y-.5,(t[1]+p.translate[1])*y-.5,y+1,y+1)}}(i,{tileURL:Y,projection:t.scales.projection,width:Ai,height:Di,tileCache:rr.current,maxDevicePixelRatio:Ae,onTileLoad:()=>Ei()}),i.restore())}}if(R){let n=Ze(e,Ci,Li,p);if(!n)return;n.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),Y||J(n,{background:ke,themeBackground:Ji,hasBackgroundGraphics:!!Et,x:-Li.left,y:-Li.top,width:Ci[0],height:Ci[1]}),n.save(),n.beginPath(),n.rect(0,0,Ai,Di),n.clip();let o=t.scene,a=t.scales,s={width:Ai,height:Di};if(ee({context:n,nodes:o,renderMode:Me,pixelRatio:p,paintBuiltIn:e=>{(function(e,t){let i=t.filter(e=>"geoarea"===e.type);for(let t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));let i=t._cachedPath2D,r=ht(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(i));let n=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&n>0){if(e.strokeStyle=mt(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){let i=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(i)}else e.setLineDash([]);e.stroke(i)}fe(e,t,i),e.globalAlpha=1,e.setLineDash([])}})(n,e),C(n,e,a,s),E(n,e,a,s),O(n,e,a,s)}}),f&&dr.current){let e=dr.current,t=o.filter(e=>"line"===e.type);if(t.length>0){let o=Q||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??v(),l=o.spawnRate??(y()?.06:.15),c=o.radius??2,u=o.opacity??.7,h=i/1e3,d=pr.current>0?Math.min(h-pr.current,.1):.016;pr.current=h;let p=t.map(e=>e.path),f=t.map(e=>e.style.strokeWidth??2);for(let i=0;t.length>i;i++)Bi.random()<l&&e.countForLine(i)<s&&e.spawn(i,Bi.random);e.step(d,a,p,f),n.globalAlpha=u;for(let i=0;e.particles.length>i;i++){let r=e.particles[i];if(!r.active)continue;let a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";n.beginPath(),n.arc(r.x,r.y,c,0,2*Math.PI),n.fillStyle=s,n.fill()}n.globalAlpha=1,r=!0}}n.restore()}(d||a&&!s)&&e.setAttribute("aria-label",je(t.scene,"Geographic chart"));let P=gr.current,x=!(!P||"geoarea"!==P.type&&"point"!==P.type),k=F(x,yr.current),L=Br.current;if(L&&k){let e=Ze(L,Ci,Li,p);if(e){if(e.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),P&&"geoarea"===P.type){let t=new Path2D(P.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(P&&"point"===P.type){let t=P,i=("object"==typeof Ge?Ge:void 0)?.pointColor||S(P);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),i?(e.save(),e.globalAlpha=.4,e.fillStyle=i,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=i||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}yr.current=x}let A=gt!==nr.current;A&&(nr.current=gt),(d||A||a&&gt&&gt.length>0)&&(d||A||a&&!s||i-kr.current>=33)&&(xr(e=>e+1),kr.current=i),(l||null!=t.activeTransition||b.pending||r)&&Ei()},he(Dt,$i,vi,Ei,Bi.now,Sr,Cr),bt(()=>{if("production"!==process.env.NODE_ENV&&Y){let e=b(i);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[Y,i]),bt(()=>{let e=lr.current;if(!G||!e)return or.current&&e&&(ui(e).on(".zoom",null),or.current=null),void(e&&ui(e).on("mousedown.rotate",null).on("touchstart.rotate",null));let[t,i]=Z||[1,8],r={width:Ai,height:Di};if(Gi){let n=ar.current.k,o=e=>{n=Math.max(t,Math.min(i,e)),ar.current=ci.scale(n);let o=$i.current;o&&(o.applyZoomScale(n,r),vi.current=!1,Ei(),o.scales?.projection&&$?.({projection:o.scales.projection,zoom:o.currentZoom}))};or.current={scaleBy:(e,t)=>o(n*t),transform:(e,t)=>o(t?.k??1)};let a=e=>{e.preventDefault(),o(n*(0>e.deltaY?1.1:1/1.1))},s=e=>{let t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*n))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);let l=.4,c=t=>{if(0!==t.button)return;let i=t.target;if(i.closest("button")||i.closest(".stream-geo-zoom-controls"))return;let r=$i.current;if(!r)return;let n=r.getRotation();ur.current={x:t.clientX,y:t.clientY,rotation:[...n]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{let t=ur.current;t&&(hr.current=[t.rotation[0]+(e.clientX-t.x)*l,Math.max(-90,Math.min(90,t.rotation[1]-(e.clientY-t.y)*l)),t.rotation[2]],Ei())},h=t=>{if(!ur.current)return;ur.current=null,e.releasePointerCapture(t.pointerId);let i=hr.current;if(i){hr.current=null;let e=$i.current;e&&(e.applyRotation(i,r),Ei())}let n=$i.current;n?.scales?.projection&&$?.({projection:n.scales.projection,zoom:n.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",h),e.removeEventListener("pointercancel",h),or.current=null}}let n=li().scaleExtent([t,i]).extent([[0,0],[Ci[0],Ci[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{let t=e.transform;ar.current=t,sr.current=!0;let i=$i.current;i&&(i.applyZoomTransform(t,r),vi.current=!1,Ei())}).on("end",e=>{ar.current=e.transform,sr.current=!1;let t=$i.current;t?.scales?.projection&&$?.({projection:t.scales.projection,zoom:t.currentZoom})});return or.current=n,ui(e).call(n),()=>{ui(e).on(".zoom",null)}},[G,Z,Gi,Ci,Ai,Di,Li,$,Ei]);let Wr=He&&!1!==Ge,Hr=Wr&&wr?Ue?Ue(wr):Pi(g,{data:wr}):null,Gr=Hr?Pi(we,{x:wr.x,y:wr.y,containerWidth:Ai,containerHeight:Di,margin:Li,className:"stream-frame-tooltip",zIndex:10,children:Hr}):null;if(Yi){let e=Ui.scene;return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1]},children:[Pi(Ce,{summary:ii}),xi("svg",{xmlns:"http://www.w3.org/2000/svg",width:Ci[0],height:Ci[1],style:{position:"absolute",left:0,top:0},children:[er?Pi("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Ci[0],height:Ci[1],fill:er}):null,Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:Ki}),Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:e.map((e,t)=>ie({node:e,index:t,renderMode:Me,fallback:()=>function(e,t){return st(function(e,t){switch(e.type){case"geoarea":{let i=e;if(!i.pathData)return null;let r=ft(i.style.fill)?pt(i.style.fill,`geoarea-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("path",{d:i.pathData,fill:r?`url(#geoarea-${t}-hatch)`:Je(i.style.fill,"#e0e0e0"),fillOpacity:i.style.fillOpacity??1,stroke:i.style.stroke||"none",strokeWidth:i.style.strokeWidth??.5,strokeDasharray:i.style.strokeDasharray,opacity:(i.style.opacity??1)*(i._decayOpacity??1)})]},"geoarea-"+t)}case"point":{let i=e,r=ft(i.style.fill)?pt(i.style.fill,`geopoint-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("circle",{cx:i.x,cy:i.y,r:i.r,fill:r?`url(#geopoint-${t}-hatch)`:Je(i.style.fill),fillOpacity:i.style.fillOpacity??.8,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,opacity:i._decayOpacity??i.style.opacity??1})]},"point-"+t)}case"line":{let i=e;if(2>i.path.length)return null;let r="M"+i.path.map(e=>`${e[0]},${e[1]}`).join("L");return ai("path",{d:r,fill:"none",stroke:i.style.stroke||"#4e79a7",strokeWidth:i.style.strokeWidth??1.5,strokeDasharray:i.style.strokeDasharray,opacity:i.style.opacity??1},"line-"+t)}case"glyph":return Fe(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}(e,t),e,"geo-cursor-"+t)}(e,t)}))})]}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:!1,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Vi,pe($i.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m(e),geoProjection:$i.current?.scales?.projectedPoint})]})}return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"group","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1],overflow:Xe?"visible":"hidden",...G?{touchAction:"none"}:{}},onKeyDown:Fr,children:["production"!==process.env.NODE_ENV&&$i.current&&Pi(Se,{store:$i.current,diagnostics:br.current}),ei&&xi(ve,{accessibleTable:ei,children:[Pi(Le,{tableId:Ti}),Pi(ye,{scene:$i.current?.scene??[],chartType:"Geographic chart",tableId:Ti,chartTitle:"string"==typeof Ft?Ft:void 0})]}),Pi(Ce,{summary:ii}),Pi(be,{hoverPoint:wr}),xi("div",{role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Or,onPointerLeave:jr,onPointerDown:Wr||mi?zr:void 0,onClick:mi?Ir:void 0,children:[Pi(Re,{size:Ci,margin:Li,backdropFill:er??void 0,children:Ki}),Y&&Pi("canvas",{ref:tr,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi("canvas",{ref:Tr,"aria-label":je($i.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),Pi("canvas",{ref:Br,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:Xt,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Vi,pe($i.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m($i.current?.scene),geoProjection:$i.current?.scales?.projectedPoint}),Dt?.showBadge&&Pi(z,{isStale:Sr,position:Dt.badgePosition}),G&&xi("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Li.bottom+8,left:Li.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[Pi("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1.5)},style:bi,children:"+"}),Pi("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1/1.5)},style:bi,children:"−"})]}),V&&Pi("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Li.bottom+2,right:Li.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:V}),Pi(Pe,{active:Er.current>=0,hoverPoint:wr,margin:Li,size:Ci,shape:Nr.current?.shape,width:Nr.current?.w,height:Nr.current?.h,pathData:Nr.current?.pathData}),Gr]})]})}));ki.displayName="StreamGeoFrame";var Si=ki;import{forwardRef as Ci,useMemo as Li}from"react";import{jsx as Ai}from"react/jsx-runtime";var Di=Ci(function(e,t){let{points:i,areas:r,lines:n,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:h,colorBy:d,colorScheme:p,tooltip:f,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:R,chartId:w,loading:P,loadingContent:S,emptyContent:C,className:L,frameProps:A={}}=e,{frameRef:D,resolved:j,normalizedMargin:M}=x({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=Li(()=>Ie(i),[i]),B=Li(()=>Ie(r),[r]),_=Li(()=>Ie(n),[n]),I=Li(()=>[...T,..._,...B],[T,_,B]),E=k({data:I,rawData:void 0!==i||void 0!==n||void 0!==r?I:void 0,colorBy:d,colorScheme:p,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof d?[d]:[],unwrapData:!1,onObservation:b,onClick:R,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:M,marginDefaults:j.marginDefaults,loading:P,loadingContent:S,emptyContent:C,width:j.width,height:j.height,hasTitle:!!j.title}),N=E.effectiveSelectionHook,F=Li(()=>N?.isActive?{isActive:!0,predicate:N.predicate}:null,[N?.isActive,N?.predicate]);if(E.earlyReturn)return E.earlyReturn;let{width:O,height:z,enableHover:W,title:q,description:Z,summary:$,accessibleTable:U}=j,X=He(f),Q={projection:l,...null!=i&&{points:T},...null!=r&&{areas:B},...null!=n&&{lines:_},xAccessor:c,yAccessor:u,...null!=h&&{lineDataAccessor:h},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:F,colorBy:d,colorScheme:p,size:[O,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:E.margin,enableHover:W,...H({title:q,description:Z,summary:$,accessibleTable:U,className:L,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===f?{tooltipContent:()=>null}:X?{tooltipContent:X}:{},...G({linkedHover:v,selection:y,onObservation:b,onClick:R,hoverHighlight:!1,mobileInteraction:E.mobileInteraction,customHoverBehavior:E.customHoverBehavior,customClickBehavior:E.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};return Ai(ke,{componentName:"GeoCustomChart",width:O,height:z,children:Ai(Si,{ref:D,...Q})})});Di.displayName="GeoCustomChart";export{Si as StreamGeoFrame_default,Di as GeoCustomChart};
@@ -1 +0,0 @@
1
- import{prepareMotifBraid as m,ribbonSupportsRoute as o}from"./c-T2ASIJVZ.min.js";import{assignedDenominator as r}from"./c-FHBVFCQB.min.js";export{r as assignedDenominator,m as prepareMotifBraid,o as ribbonSupportsRoute};
@@ -1 +0,0 @@
1
- function t(t,e){let o=r(e.curve);if(!o||2>e.topPath.length||2>e.bottomPath.length){t.beginPath(),t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let o=1;e.topPath.length>o;o++)t.lineTo(e.topPath[o][0],e.topPath[o][1]);for(let o=e.bottomPath.length-1;o>=0;o--)t.lineTo(e.bottomPath[o][0],e.bottomPath[o][1]);t.closePath()}else{let l=s().x(t=>t[0]).y0((t,o)=>e.bottomPath[o][1]).y1(t=>t[1]).curve(o).context(t);t.beginPath(),l(e.topPath)}}function e(t,e){let o=r(e.curve);if(t.beginPath(),o)n().x(t=>t[0]).y(t=>t[1]).curve(o).context(t)(e.topPath);else{t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let o=1;e.topPath.length>o;o++)t.lineTo(e.topPath[o][0],e.topPath[o][1])}}import{buildThresholdLineSegments as o}from"./c-R2P4RR7Q.min.js";import{renderPathPulse as l}from"./c-W4ZUKSEQ.min.js";import{buildLinearFillGradient as a,resolveCSSColor as h,resolveCanvasFill as i,resolveCurveFactory as r}from"./c-MB6CV5NC.min.js";import{area as s,line as n}from"d3-shape";var p=(r,s,n,p)=>{let P=s.filter(t=>"area"===t.type);for(let s of P){if(2>s.topPath.length)continue;let n=!1;s.clipRect&&(r.save(),r.beginPath(),r.rect(s.clipRect.x,s.clipRect.y,s.clipRect.width,s.clipRect.height),r.clip(),n=!0);let P=s._introClipFraction;void 0!==P&&1>P&&(r.save(),r.beginPath(),r.rect(0,0,p.width*P,p.height),r.clip());let f=i(r,s.style.fill,"#4e79a7"),c=s._decayOpacities,g=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),y=!!s.strokeColorBands?.length;if(c&&c.length===s.topPath.length&&!g&&!y){let t=s.style.fillOpacity??.7;r.fillStyle=f;for(let e=0;s.topPath.length-1>e;e++)r.globalAlpha=.5*(c[e]+c[e+1])*t,r.beginPath(),r.moveTo(s.topPath[e][0],s.topPath[e][1]),r.lineTo(s.topPath[e+1][0],s.topPath[e+1][1]),r.lineTo(s.bottomPath[e+1][0],s.bottomPath[e+1][1]),r.lineTo(s.bottomPath[e][0],s.bottomPath[e][1]),r.closePath(),r.fill();let e=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&e>0){r.strokeStyle=h(r,s.style.stroke)||s.style.stroke,r.lineWidth=e,r.setLineDash([]);for(let t=0;s.topPath.length-1>t;t++)r.globalAlpha=.5*(c[t]+c[t+1]),r.beginPath(),r.moveTo(s.topPath[t][0],s.topPath[t][1]),r.lineTo(s.topPath[t+1][0],s.topPath[t+1][1]),r.stroke()}r.globalAlpha=1;continue}let m=s.style.opacity??1;if(t(r,s),s.fillGradient&&s.fillGradient.stops.length>=2&&s.fillGradient){let t=1/0;for(let e of s.topPath)t>e[1]&&(t=e[1]);let e=-1/0;for(let t of s.bottomPath)t[1]>e&&(e=t[1]);let o=a(r,s.fillGradient,"string"==typeof f?f:"#4e79a7",0,t,0,e);r.fillStyle=o||f,r.globalAlpha=m}else r.globalAlpha=(s.style.fillOpacity??.7)*m,r.fillStyle=f;r.fill(),s._pulseIntensity&&s._pulseIntensity>0&&(t(r,s),l(r,s));let b=s.style.strokeWidth??2;if(s.style.stroke&&"none"!==s.style.stroke&&b>0){r.globalAlpha=m;let t=h(r,s.style.stroke)||s.style.stroke,l=g||y||!s.strokeGradient||2>s.topPath.length?null:a(r,s.strokeGradient,t,s.topPath[0][0],0,s.topPath[s.topPath.length-1][0],0);if(r.lineWidth=b,r.setLineDash([]),y){let o=1/0,l=-1/0;for(let[t]of s.topPath)o=Math.min(o,t),l=Math.max(l,t);let a=r.lineWidth;for(let i of s.strokeColorBands){r.save(),r.beginPath(),r.rect(o-a,i.y,l-o+2*a,i.height),r.clip();let n=i.color??t;r.strokeStyle=h(r,n)||n,r.globalAlpha=m*(i.opacity??1),e(r,s),r.stroke(),r.restore()}}else if(g){let e=o(s.topPath,s.rawValues,s.colorThresholds,t);for(let t of e){r.beginPath(),r.strokeStyle=h(r,t.color)||t.color,r.moveTo(t.path[0][0],t.path[0][1]);for(let e=1;t.path.length>e;e++)r.lineTo(t.path[e][0],t.path[e][1]);r.stroke()}}else r.strokeStyle=l||t,e(r,s),r.stroke()}void 0!==P&&1>P&&r.restore(),n&&r.restore(),r.globalAlpha=1}};export{p as areaCanvasRenderer};
@@ -1 +0,0 @@
1
- function e({label:e="Data range brush",description:t="Use arrow keys to move the selected range, Shift plus an arrow key to resize it, and Escape to clear it.",onAction:i}={}){let n=r.useId().replace(/:/g,""),o=r.useRef(i);return o.current=i,{description:t,descriptionId:"semiotic-brush-description-"+n,svgProps:{role:"region",tabIndex:0,"aria-label":e,"aria-describedby":"semiotic-brush-description-"+n,onKeyDown:r.useCallback(e=>{let r=function(e){return"Escape"===e.key?{type:"clear"}:"ArrowLeft"===e.key?{type:"nudge",direction:"left",resize:e.shiftKey}:"ArrowRight"===e.key?{type:"nudge",direction:"right",resize:e.shiftKey}:"ArrowUp"===e.key?{type:"nudge",direction:"up",resize:e.shiftKey}:"ArrowDown"===e.key?{type:"nudge",direction:"down",resize:e.shiftKey}:null}(e);r&&(e.preventDefault(),o.current?.(r))},[])}}}import*as r from"react";export{e as useBrushAccessibility};
@@ -1 +0,0 @@
1
- function t(t,e){let[n,r]=t.viewBox??F,[i,o]=t.anchor??q,l=r>0?r:1,a=Math.max(0,e)/l,s=(n>0?n:l)*a,u=l*a;return{width:s,height:u,scale:a,offsetX:-i*s,offsetY:-o*u}}function e(e,n){let r=t(e,n),i=[[r.offsetX,r.offsetY],[r.offsetX+r.width,r.offsetY],[r.offsetX,r.offsetY+r.height],[r.offsetX+r.width,r.offsetY+r.height]],o=0;for(let[t,e]of i){let n=Math.sqrt(t*t+e*e);n>o&&(o=n)}return o}function n(t,e,n,r){if("none"!==t)return"color"===t||null==t?e??r:"accent"===t?n:t}function r(t){if(typeof Path2D>"u")return null;N||(N=new Map);let e=N.get(t);if(e)return e;let n=new Path2D(t);return N.size>1024&&N.clear(),N.set(t,n),n}function i(t,e,n=0,r="horizontal"){let[i,o]=t.viewBox??F,l=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,e));return a>l?l>0||1>a?"vertical"===r?{x:0,y:o*(1-a),width:i,height:o*(a-l)}:{x:i*l,y:0,width:i*(a-l),height:o}:null:{x:0,y:0,width:0,height:0}}function o(e,n){let r=t(e,n);return{centerDx:r.offsetX+r.width/2,centerDy:r.offsetY+r.height/2,halfWidth:r.width/2,halfHeight:r.height/2,radius:Math.hypot(r.width,r.height)/2}}function l(t,e,i,o,l,a=t=>t){for(let s of e.parts){let e=r(s.d);if(!e)continue;let u=s.opacity??1,f=t.globalAlpha;1!==u&&(t.globalAlpha=f*u);let c=l?"none"===s.fill?void 0:l:n(s.fill,i,o);c&&(t.fillStyle=a(c),t.fill(e));let h=l?s.stroke&&"none"!==s.stroke?l:void 0:n(s.stroke??"none",i,o);h&&(t.strokeStyle=a(h),t.lineWidth=s.strokeWidth??1,t.lineCap=s.strokeLinecap??"butt",t.lineJoin=s.strokeLinejoin??"miter",t.stroke(e)),1!==u&&(t.globalAlpha=f)}}function a(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle}}function s(t={},e){let n,{background:r="transparent",stroke:i="#000",lineWidth:o=1.5,spacing:l=6,angle:s=45}=t,u={background:r,stroke:i,lineWidth:o,spacing:l,angle:s},f=Math.max(8,Math.ceil(2*l));try{n=function(t){return"u">typeof OffscreenCanvas?new OffscreenCanvas(t,t):(X||(X=document.createElement("canvas")),X.width=t,X.height=t,X)}(f)}catch{return a(u)}let c=n.getContext("2d");if(!c)return a(u);r&&"transparent"!==r?(c.fillStyle=r,c.fillRect(0,0,f,f)):c.clearRect(0,0,f,f),c.strokeStyle=i,c.lineWidth=o,c.lineCap="square";let h=s*Math.PI/180;if(45===s||-45===s){let t=s>0?1:-1;for(let e=-f;2*f>=e;e+=l)c.beginPath(),c.moveTo(e,0),c.lineTo(e+t*f,f),c.stroke()}else{c.save(),c.translate(f/2,f/2),c.rotate(h);let t=2*f;for(let e=-t;t>=e;e+=l)c.beginPath(),c.moveTo(-t,e),c.lineTo(t,e),c.stroke();c.restore()}return(e||c).createPattern(n,"repeat")}function u(t){let e=typeof document>"u"?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};let n=e=>{(function(t){return 0!==t.fontfaces?.length})(e)&&t()};return e.addEventListener("loadingdone",n),()=>e.removeEventListener("loadingdone",n)}function f(t,e){!function(){if(T||typeof window>"u"||typeof document>"u")return;T=!0;let t=t=>{if(!t?.includes("--"))return"";let e=document.createElement("span").style;return e.cssText=t,Array.from(e).filter(t=>t.startsWith("--")).sort().map(t=>`${t}:${e.getPropertyValue(t)}!${e.getPropertyPriority(t)}`).join(";")},e=(e,n)=>{let r=e.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;let i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===e.attributeName&&t(e.oldValue)===t(r.getAttribute("style")))},n=t=>{let n=[];for(let r of B){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){z++;for(let t of n)t.listener()}};if("u">typeof MutationObserver&&document.documentElement&&(I=new MutationObserver(t=>{n(t)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{R=window.matchMedia("(prefers-color-scheme: dark)"),V=()=>n(),"function"==typeof R.addEventListener?R.addEventListener("change",V):"function"==typeof R.addListener&&R.addListener(V)}catch{}D=u(()=>n())}();let n={getElement:t,listener:e};return B.add(n),()=>{B.delete(n)&&0===B.size&&(I?.disconnect(),I=null,R&&V&&("function"==typeof R.removeEventListener?R.removeEventListener("change",V):"function"==typeof R.removeListener&&R.removeListener(V)),R=null,V=null,D?.(),D=null,T=!1)}}function c(t,e){if(!e)return e;let n=function(t){let e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;let n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){let t=n.trim();return t.startsWith("--")?{name:t}:null}let i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}(e);if(!n)return e;let r=()=>n.fallback?c(t,n.fallback):e,i=t.canvas;if(!i)return r();let o=Y.get(i);(!o||o.version!==z)&&(o={version:z,map:new Map},Y.set(i,o));let l=o.map.get(e);if(void 0!==l)return l;let a=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return o.map.set(e,a),a}function h(t){z++}function d(){return z}function p(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function m(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function y(t,e){let n=2166136261,r=m(e);for(let t=0;r.length>t;t++)n^=r.charCodeAt(t),n=Math.imul(n,16777619);return`${t}-hatch-${(n>>>0).toString(36)}`}function g(t,e){let{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:l=45,lineOpacity:a=1}=t,s=Math.max(8,Math.ceil(2*o));return U("pattern",{id:e,width:s,height:s,patternUnits:"userSpaceOnUse",patternTransform:0!==l?`rotate(${l})`:void 0,children:[n&&"transparent"!==n&&G("rect",{width:s,height:s,fill:n}),G("line",{x1:0,y1:0,x2:0,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a}),G("line",{x1:o,y1:0,x2:o,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a})]},e)}function b(t,e,n="#4e79a7"){if(p(t)){let n=y(e,t);return{fill:`url(#${n})`,def:g(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function v(t,e,n,r){if(!t||"object"!=typeof t)return;let i=t;if(!Array.isArray(i.stops))return;let o=i.stops.flatMap(t=>{if(!t||"object"!=typeof t)return[];let{offset:e,color:n,opacity:i}=t;return"number"==typeof e&&Number.isFinite(e)?[{offset:Math.max(0,Math.min(1,e)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((t,e)=>t.offset-e.offset);if(!o.length)return;let l="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,a=e+"-gradient";return{fill:`url(#${a})`,def:G("linearGradient",{id:a,x1:0,y1:0,x2:"horizontal"===l?"100%":0,y2:"vertical"===l?"100%":0,children:o.map((t,e)=>G("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},a)}}function k(t,e,n){if(n)return n;let r=t??"circle";if("chevron"===r)return function(t){let e=1.5*w(t),n=.92*e;return`M0,${-e}L${n},${(.78*e).toFixed(3)}L0,${(.28*e).toFixed(3)}L${-n},${(.78*e).toFixed(3)}Z`}(e);let i=Object.prototype.hasOwnProperty.call(rt,r)?rt[r]:Z;return J(i,Math.max(1,e))()??""}function w(t){return Math.sqrt(Math.max(1,t)/Math.PI)}function M(t,e){let n=new Map,r=0;return i=>{let o=t(i)+"",l=e&&Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(l&&it.has(l))return l;let a=n.get(o);return a||(a=ot[r%ot.length],r++,n.set(o,a)),a}}function x(t,e){let n=t.fillStyle,r="#010203";try{t.fillStyle=r,t.fillStyle=e}catch{return t.fillStyle=n,[78,121,167]}let i=t.fillStyle;if(t.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&e.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];let o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}function W(t){switch(t){case"monotoneX":return lt;case"monotoneY":return at;case"cardinal":return st;case"catmullRom":return ut;case"step":return ft;case"stepBefore":return ct;case"stepAfter":return ht;case"basis":return dt;case"natural":return pt;default:return null}}function $(t,e,n){if(null==e)return n;if(p(e)){let r=function(t,e){let n=t.background??"transparent",r=t.stroke??"#000",i="transparent"===n||"none"===n?n:c(e,n)||n,o=c(e,r)||r||"#000",l="u">typeof window&&window.devicePixelRatio||1,a=`${m(t)}|${i}|${o}@${l}`,u=H.get(a);if(void 0!==u)return u;let f=s({background:i,stroke:o,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle},e),h=p(f)?null:f;return H.set(a,h),h}(e,t);return r||e.background&&c(t,e.background)||n}return"string"!=typeof e?e:c(t,e)||n}function S(t,e,n){let r=$(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=c(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function L(t,e){if(null==e)return;let n=$(t,e,"");return""===n?void 0:n}function O(t,e,n,r,i,o,l){let a=e.stops.filter(t=>Number.isFinite(t.offset)&&(null==t.opacity||Number.isFinite(t.opacity)));if(2>a.length)return null;let s=t.createLinearGradient(r,i,o,l);for(let e of a)s.addColorStop(Math.max(0,Math.min(1,e.offset)),E(t,e,n));return s}function E(t,e,n){let r=e.color??n,i=c(t,r)||r;if(null==e.opacity)return i;let o=Math.max(0,Math.min(1,e.opacity)),[l,a,s]=x(t,i);return`rgba(${l},${a},${s},${o})`}function P(t,e,n,r){e.fill&&(t.fillStyle=$(t,e.fill,n),void 0!==e.fillOpacity&&(t.globalAlpha=(e.opacity??1)*e.fillOpacity),r())}function A(t,e,n){!e.stroke||"none"===e.stroke||(t.strokeStyle=c(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=(e.opacity??1)*(e.strokeOpacity??1),n())}function C(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function j(t){let e=t.cornerRadii;if(!e)return{tl:0,tr:0,br:0,bl:0};let n=Math.min(t.w,t.h)/2,r=t=>Math.max(0,Math.min(t??0,n));return{tl:r(e.tl),tr:r(e.tr),br:r(e.br),bl:r(e.bl)}}var F=[40,40],q=[.5,.5],N=null,X=null,Y=new WeakMap,z=0,T=!1,I=null,R=null,V=null,D=null,B=new Set;import{jsx as G,jsxs as U}from"react/jsx-runtime";var H=new Map;import{symbol as J,symbolCircle as Z,symbolCross as K,symbolDiamond as Q,symbolSquare as _,symbolStar as tt,symbolTriangle as et,symbolWye as nt}from"d3-shape";var rt={circle:Z,square:_,triangle:et,diamond:Q,star:tt,cross:K,wye:nt},it=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),ot=["circle","triangle","diamond","star","square","chevron","cross","wye"];import{curveMonotoneX as lt,curveMonotoneY as at,curveCardinal as st,curveCatmullRom as ut,curveStep as ft,curveStepBefore as ct,curveStepAfter as ht,curveBasis as dt,curveNatural as pt}from"d3-shape";export{k as symbolPathString,w as symbolRadius,M as makeSymbolResolver,t as glyphPlacement,e as glyphExtent,n as resolveGlyphPaint,r as getGlyphPath2D,i as glyphFractionClipRect,o as glyphHitGeometry,l as drawGlyphParts,u as subscribeToCanvasFontInvalidation,f as subscribeToCSSColorInvalidation,c as resolveCSSColor,h as clearCSSColorCache,d as getCSSColorCacheVersion,x as parseCanvasColor,s as createHatchPattern,p as isHatchFill,y as hatchFillId,g as hatchPatternDef,b as resolveSvgFill,v as resolveAnnotationGradient,W as resolveCurveFactory,$ as resolveCanvasFill,S as resolveCanvasPaint,L as coerceCanvasFill,O as buildLinearFillGradient,P as paintNetworkFill,A as paintNetworkStroke,C as hasAnyCornerRadius,j as clampCornerRadii};
@@ -1 +0,0 @@
1
- import{hasPulse as t,renderCirclePulse as e}from"./c-W4ZUKSEQ.min.js";import{resolveCanvasFill as l}from"./c-MB6CV5NC.min.js";var s=(s,o,r,y)=>{let i=o.filter(t=>"point"===t.type);if(0!==i.length){s.save();try{let o=s.globalAlpha,r=[],y="",n=t=>{s.beginPath(),s.arc(t.x,t.y,t.r,0,2*Math.PI),s.globalAlpha=o*(t.style.opacity??t.style.fillOpacity??1),s.fillStyle=l(s,t.style.fill,"#4e79a7"),s.fill();let r=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&r>0&&(s.strokeStyle=l(s,t.style.stroke,t.style.stroke),s.lineWidth=r,s.stroke()),e(s,t)},a=()=>{if(0===r.length)return;if(1===r.length)return n(r[0]),r=[],void(y="");let t=r[0];s.globalAlpha=o*(t.style.opacity??t.style.fillOpacity??1),s.beginPath();for(let t of r)s.moveTo(t.x+t.r,t.y),s.arc(t.x,t.y,t.r,0,2*Math.PI);s.fillStyle=l(s,t.style.fill,"#4e79a7"),s.fill();let e=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&e>0&&(s.strokeStyle=l(s,t.style.stroke,t.style.stroke),s.lineWidth=e,s.stroke()),r=[],y=""};for(let e of i){let l=e.style.opacity??e.style.fillOpacity??1,s=e.style.fill;if(t(e)||null!=s&&"string"!=typeof s||1>l){a(),n(e);continue}let o=e.style.strokeWidth??1,i=`${s??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&o>0?e.style.stroke+"":""}\0${o}\0${e.r}\0${l}`;r.length>0&&i!==y&&a(),y=i,r.push(e),r.length>=2048&&a()}a()}finally{s.restore()}}};export{s as pointCanvasRenderer};
@@ -1 +0,0 @@
1
- function e(e,t,r,i){let n=i.current,s=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,u=!s&&e.hasActivePulsesAt(t),o=!(r||s||!u&&!n)&&e.refreshPulse(t);return i.current=u,{changed:o,pending:u}}function t({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:i,chartType:n}){let s=!(!e&&!r),u=!(!t&&!r),o=H((t,s)=>{e?.(t,s),R({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:n,chartId:i,context:s})},[i,n,e,r]),a=H((e,s)=>{t?.(e,s),w({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:n,chartId:i,context:s})},[i,n,t,r]);return{customHoverBehavior:s?o:void 0,customClickBehavior:u?a:void 0,hasClickBehavior:u}}function r({storeRef:e,hoverRef:t,hoveredNodeRef:r,setHoverPoint:i,customHoverBehavior:n,customClickBehavior:s,scheduleRender:u,extractPoints:o,toHover:a}){let c=T(-1),l=T(null),h=T(null),f=P(f=>{if(x(f))return;let p=e.current;if(!p)return;let y,d=()=>{c.current=-1,l.current=null,t.current=null,r&&(r.current=null),i(null),n?.(null),u()};if(0===p.scene.length)return void(c.current>=0&&d());if(h.current?.version===p.version)y=h.current.graph;else{let e=o(p.scene);if(0===e.length)return void(c.current>=0&&d());y=v(e),h.current={version:p.version,graph:y}}let _=c.current;if(_>=y.flat.length&&(d(),_=-1),("Enter"===f.key||" "===f.key)&&_>=0)return f.preventDefault(),void s?.(a(y.flat[_],p),{type:"activate",inputType:"keyboard"});if(0>_){if("Escape"===f.key||!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(f.key))return;f.preventDefault(),c.current=0;let e=y.flat[0];l.current=e;let r=a(e,p);return t.current=r,i(r),n?.(r,{type:"focus",inputType:"keyboard"}),void u()}let m=z(f.key,A(y,_),y);if(null===m)return;if(f.preventDefault(),0>m)return void d();c.current=m;let g=y.flat[m];l.current=g;let b=a(g,p);t.current=b,i(b),n?.(b,{type:"focus",inputType:"keyboard"}),u()},[s,n,o,t,r,u,i,e,a]);return{kbFocusIndexRef:c,focusedNavPointRef:l,onKeyDown:f}}function i(e){return r({...e,extractPoints:g,toHover:(e,t)=>b({...e,datum:d(e.datum,t.resolvedRibbons)})})}function n({chartType:e,oAccessor:t,rAccessor:i,...n}){return r({...n,extractPoints:m,toHover:r=>({...b(r),__oAccessor:"string"==typeof t?t:void 0,__rAccessor:"string"==typeof i?i:void 0,__chartType:e})})}function s(e){let t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function u({storeRef:e,hoverRef:t,hoveredNodeRef:r,setHoverPoint:i,customHoverBehavior:n,customClickBehavior:u,scheduleRender:o}){let a=T(-1),c=T(null),l=P(l=>{if(x(l))return;let h=e.current;if(!h)return;let f=()=>{a.current=-1,c.current=null,t.current=null,r&&(r.current=null),i(null),n?.(null),o()};if(0===h.scene.length)return void(a.current>=0&&f());let p=_(h.scene);if(0===p.length)return void(a.current>=0&&f());let y=a.current;if(y>=p.length&&(f(),y=-1),("Enter"===l.key||" "===l.key)&&y>=0)return l.preventDefault(),void u?.(s(p[y]),{type:"activate",inputType:"keyboard"});let d=k(l.key,0>y?-1:y,p.length);if(null===d)return;if(l.preventDefault(),0>d)return void f();let v=0>y?0:d;a.current=v;let m=p[v];c.current=m;let g=s(m);t.current=g,i(g),n?.(g,{type:"focus",inputType:"keyboard"}),o()},[u,n,t,r,o,i,e]);return{kbFocusIndexRef:a,focusedNavPointRef:c,onKeyDown:l}}function o(e,t,r){let i=e.duration??500,n=r-t;return i>n?1-n/i:0}function a(e,t,r,i,n,s=("u">typeof performance?performance.now():Date.now())){let u=e.color??"rgba(255,255,255,0.6)",a=e.glowRadius??4,l=!1,h=n??(()=>{let e=new Map;for(let t=0;r.length>t;t++)e.set(r[t],t);return e})();for(let r of t){if("line"===r.type)continue;if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[r.datum],n=0,a=!1;for(let r of t){let t=h.get(r);if(null==t)continue;a=!0;let u=i.get(t);if(null==u)continue;let c=o(e,u,s);c>n&&(n=c)}a&&(l=c(r,n,u)||l);continue}let t=h.get(r.datum);if(null==t)continue;let n=i.get(t);l=c(r,null==n?0:o(e,n,s),u,a)||l}return l}function c(e,t,r,i){let n=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,n=!0),e._pulseColor!==r&&(e._pulseColor=r,n=!0),e._pulseGlowRadius!==i&&(e._pulseGlowRadius=i,n=!0),n):(0!==e._pulseIntensity&&(e._pulseIntensity=0,n=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,n=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,n=!0),n)}function l(e,t,r=("u">typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;let i=e.duration??500,n=t.peek();return null!=n&&i>r-n}function h(e,t,r){e.capacity>=t||(e.resize(t),r&&t>r.capacity&&r.resize(t))}function f(e,t){let r=new D(e.capacity);return e.forEach(()=>r.push(t)),r}function p(e,t,r,i){let n=e.push(t);return r&&r.push(i),n}function y(e,t,r){if(!t||0===t.size)return;let i=new Set;if(e.forEach((e,t)=>{r(e)&&i.add(t)}),0===i.size)return;let n=t.toArray();t.clear();for(let e=0;n.length>e;e++)i.has(e)||t.push(n[e])}import{enrichDatumWithBand as d}from"./c-TKG2NP7G.min.js";import{buildNavGraph as v,extractGeoNavPoints as _,extractOrdinalNavPoints as m,extractXYNavPoints as g,navPointToHover as b,nextGraphIndex as z,nextIndex as k,resolvePosition as A}from"./c-SGAURYHG.min.js";import{emitClickObservations as w,emitHoverObservations as R,isInteractiveKeyboardTarget as x}from"./c-ODG6TFSY.min.js";var D=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let r of e){let e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){let e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");let t=this.toArray(),r=0,i=[];t.length>e&&(r=t.length-e,i=t.slice(0,r)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=r;t.length>e;e++)this.push(t[e]);return i}update(e,t){let r=[],i=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++){let s=(i+n)%this._capacity,u=this.buffer[s];if(e(u)){let e;e="object"!=typeof u||null===u?u:Array.isArray(u)?[...u]:{...u},r.push(e),this.buffer[s]=t(u)}}return r}remove(e){let t=[],r=[];if(this.forEach(i=>{e(i)?r.push(i):t.push(i)}),0===r.length)return r;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return r}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}};import{useCallback as H}from"react";import{useCallback as P,useRef as T}from"react";export{D as RingBuffer,o as computePulseIntensity,a as applyPulse,c as setPulseState,l as hasActivePulses,h as ensureRingBufferCapacity,f as createTimestampBufferForData,p as pushWithTimestamp,y as compactTimestampBufferForRemoval,e as refreshIdlePulse,t as useSemanticFrameInteractions,i as useXYKeyboardNavigation,n as useOrdinalKeyboardNavigation,u as useGeoKeyboardNavigation};
@@ -1 +0,0 @@
1
- function e(e,r,i,o){if(e.circular&&e.segments)return void function(e,r,i,o,s){let n=e.length,a=r*n,l=Math.min(Math.floor(a),n-1),d=a-l,[c,u,h,y]=e[l];t(c,u,h,y,d,s);let g=y.x-c.x,p=y.y-c.y,f=Math.sqrt(g*g+p*p);if(f>.001){let e=g/f;s.x+=-p/f*i*o*2,s.y+=e*i*o*2}}(e.segments,r,i,e.halfWidth,o);if(!e.points)return o.x=0,void(o.y=0);let[s,n,a,l]=e.points;t(s,n,a,l,r,o);let d=l.x-s.x,c=l.y-s.y,u=Math.sqrt(d*d+c*c);if(u>.001){let t=d/u;o.x+=-c/u*i*e.halfWidth*2,o.y+=t*i*e.halfWidth*2}}function t(e,t,r,i,o,s){let n=1-o,a=n*n,l=a*n,d=o*o,c=d*o;s.x=l*e.x+3*a*o*t.x+3*n*d*r.x+c*i.x,s.y=l*e.y+3*a*o*t.y+3*n*d*r.y+c*i.y}function r(e,t){It[e]=t}function i(e){return It[e]}function o(e){i(e)||"production"===process.env.NODE_ENV||Lt||(Lt=!0,console.warn(`[semiotic] StreamNetworkFrame: no layout plugin registered for "${e}". Import the matching chart HOC (which registers its plugin), or call registerBuiltInNetworkLayouts() from "semiotic/network".`))}function s(e){return{id:e,x0:0,x1:0,y0:0,y1:0,x:0,y:0,width:0,height:0,value:0,createdByFrame:!0}}function n(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(!a(e))return!1;return!0}return a(t.points)}function a(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}function l(e){e.customLayoutBackgrounds=null,e.customLayoutOverlays=null,e.customLayoutHtmlMarks=[],e.lastCustomLayoutResult=null}function d(e){let t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:t+""}function c(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=yt(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,_t(e.size)):Math.max(1,e.w??0,e.h??0)/2}}function u(e){let{width:t,height:r,totalWidth:i,totalHeight:o,margin:s,labels:n,title:a,description:l,idPrefix:u,legend:h,legendHoverBehavior:y,legendClickBehavior:g,legendHighlightedCategory:p,legendIsolatedCategories:f,legendPosition:m="right",legendLayout:v,foregroundGraphics:k,sceneNodes:b,annotations:_,onAnnotationActivate:x,onObservation:w,chartId:S,chartType:A,autoPlaceAnnotations:C,svgAnnotationRules:N}=e,R=rt({onAnnotationActivate:x,onObservation:w,chartId:S,chartType:A}),E=tr.useMemo(()=>{let e=function(e){if(!e)return;let t=[];for(let r of e){let e=c(r);e&&t.push({pointId:d(r),...e})}return t}(b)??[];return{scales:null,width:t,height:r,frameType:"network",pointNodes:e,sceneNodes:b}},[r,b,t]),T=tr.useMemo(()=>{if(!_)return _;let e=B(_);return C?Ne({annotations:e,context:E,..."object"==typeof C?C:{}}):e},[_,C,E]),P=tr.useMemo(()=>We("network"),[]),W=T?Ge(T.filter(e=>"widget"!==e.type),P,N,E):null,D=!0===T?.some(e=>"widget"===e.type&&!0===e._annotationDeferred),I=rr(),{titleId:L,descId:M,labelledBy:O}=$(u||S||I);return sr(ir,{children:[D&&or("style",{children:ye},"annotation-widget-disclosure-style"),sr("svg",{role:"img","aria-labelledby":O,width:i,height:o,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[or("title",{id:L,children:V(a,"Network Chart")}),or("desc",{id:M,children:H(a,l,{familyPhrase:"network data visualization",fallback:"Network data visualization"})}),sr("g",{transform:`translate(${s.left},${s.top})`,children:[n.map((e,t)=>or("text",{x:e.x,y:e.y,textAnchor:e.anchor||"start",dominantBaseline:e.baseline||"middle",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,style:{pointerEvents:"none"},children:e.text},"label-"+t)),W,k]}),or(_e,{title:a,totalWidth:i,marginTop:s.top}),Qe({legend:h,totalWidth:i,totalHeight:o,margin:s,legendPosition:m,title:a,legendLayout:v,legendHoverBehavior:y,legendClickBehavior:g,legendHighlightedCategory:p,legendIsolatedCategories:f})]}),T?.filter(e=>"widget"===e.type&&e.nodeId&&b).map((e,t)=>{let r=!0===e._annotationDeferred,i=b.find(t=>t.id===e.nodeId||t.datum?.id===e.nodeId||t.datum?.data?.id===e.nodeId||t.datum?.data?.name===e.nodeId);if(!i)return null;let o=s.left+(i.cx??(null!=i.x&&null!=i.w?i.x+i.w/2:i.x??0)),n=s.top+(i.cy??(null!=i.y&&null!=i.h?i.y+i.h/2:i.y??0)),a=e.dx??0,l=e.dy??-16,d=e.width??32,c=e.height??32,u=e.content??or("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return or("div",{...Ce(e,R),className:r?"annotation-deferred":void 0,"data-annotation-disclosure":r?"deferred":void 0,style:{position:"absolute",left:o+a-d/2,top:n+l-c/2,width:d,height:c,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:u},"widget-"+t)})]})}function h({marks:e,margin:t,selection:r=null,overscan:i=400}){let o=nr.useRef(null),s=function(e,t,r){let[i,o]=nr.useState(null);return nr.useLayoutEffect(()=>{let e=t.current,r=function(e){let t=e?.parentElement??null;for(;t;){let{overflow:e,overflowX:r,overflowY:i}=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e} ${i} ${r}`))return t;t=t.parentElement}return null}(e);if(!e||!r)return void o(null);let i=0,s=()=>{i=0;let t=r.getBoundingClientRect(),s=e.getBoundingClientRect();o(0!==t.width&&0!==t.height?{scroll:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},originX:s.left,originY:s.top}:null)},n=()=>{0===i&&(i=window.requestAnimationFrame(s))};s(),r.addEventListener("scroll",n,{passive:!0});let a=new ResizeObserver(n);return a.observe(r),()=>{0!==i&&window.cancelAnimationFrame(i),r.removeEventListener("scroll",n),a.disconnect()}},[t,e,r]),nr.useMemo(()=>{if(!e||!i)return e;let{scroll:t,originX:o,originY:s}=i,n=t.left-r,a=t.right+r,l=t.top-r,d=t.bottom+r;return e.filter(e=>{let t=o+e.x,r=s+e.y;return!(n>t+e.width||t>a||l>r+e.height||r>d)})},[e,i,r])}(e,o,i);if(!e||0===e.length)return null;let n=ar("div",{className:"semiotic-network-html-marks",ref:o,style:{...lr,transform:`translate(${t.left}px, ${t.top}px)`},children:(s??e).map(e=>ar("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))});return null!=r?ar(ae,{value:r,children:n}):n}function y({props:e,store:t,responsiveRef:r,size:i,margin:o,adjustedWidth:s,adjustedHeight:n,surfaceBackground:a,resolvedBackground:l,resolvedForeground:d}){let{chartType:c,nodes:y,edges:g,data:p,className:f,description:m,title:v,responsiveWidth:k,responsiveHeight:b,summary:_,renderMode:x,legend:w,legendPosition:S,legendLayout:A,legendHoverBehavior:C,legendClickBehavior:N,legendHighlightedCategory:R,legendIsolatedCategories:E,layoutSelection:T,annotations:P,onAnnotationActivate:W,annotationObservationCallback:D,onObservation:L,chartId:M,autoPlaceAnnotations:B,svgAnnotationRules:O}=e;if(t){let e=["tree","cluster","treemap","circlepack","partition","orbit"].includes(c),r=e?p||(Array.isArray(g)?void 0:g):void 0;if(e&&r)t.ingestHierarchy(r,[s,n]),t.buildScene([s,n]);else{let e=Me(y),r=Array.isArray(g)?Me(g):[];(e.length>0||r.length>0)&&(t.ingestBounded(e,r,[s,n]),t.buildScene([s,n]))}}let z=t?.sceneNodes??[],F=t?.sceneEdges??[],Y=t?.labels??[];return gr("div",{ref:r,className:"stream-network-frame"+(f?" "+f:""),role:"img","aria-label":m||("string"==typeof v?v:"Network chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:k?"100%":i[0],height:b?"100%":i[1]},children:[yr(we,{summary:_}),gr("svg",{xmlns:"http://www.w3.org/2000/svg",width:i[0],height:i[1],style:{position:"absolute",left:0,top:0},children:[a?yr("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:i[0],height:i[1],fill:a}):null,yr("g",{transform:`translate(${o.left},${o.top})`,children:I(l,t?.customLayoutBackgrounds)}),gr("g",{transform:`translate(${o.left},${o.top})`,children:[F.map((e,t)=>K({node:e,index:t,renderMode:x,fallback:()=>function(e,t){return dt(function(e,t){switch(e.type){case"line":return ur("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth??1,opacity:e.style.opacity},"net-edge-"+t);case"bezier":{let r=e,i=`net-bezier-${t}-hatch`,o=pt(r.style.fill)?gt(r.style.fill,i):void 0;return hr(dr.Fragment,{children:[o&&ur("defs",{children:o}),ur("path",{d:r.pathD,fill:o?`url(#${i})`:tt(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity,stroke:r.style.stroke||"none",strokeWidth:r.style.strokeWidth,opacity:r.style.opacity})]},"net-edge-"+t)}case"ribbon":{let r=e,i=`net-ribbon-${t}-hatch`,o=pt(r.style.fill)?gt(r.style.fill,i):void 0;return hr(dr.Fragment,{children:[o&&ur("defs",{children:o}),ur("path",{d:r.pathD,fill:o?`url(#${i})`:tt(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity,stroke:r.style.stroke||"none",strokeWidth:r.style.strokeWidth,opacity:r.style.opacity})]},"net-edge-"+t)}case"curved":{let r=e;return ur("path",{d:r.pathD,fill:tt(r.style.fill,"none"),stroke:r.style.stroke||"#999",strokeWidth:r.style.strokeWidth??1,opacity:r.style.opacity},"net-edge-"+t)}default:return null}}(e,t),e,"network-edge-cursor-"+t)}(e,t)})).filter(Boolean),z.map((e,t)=>K({node:e,index:t,renderMode:x,fallback:()=>function(e,t){return dt(function(e,t){switch(e.type){case"circle":{let r=e,i=pt(r.style.fill)?gt(r.style.fill,`net-circle-${t}-hatch`):void 0;return hr(dr.Fragment,{children:[i&&ur("defs",{children:i}),ur("circle",{cx:r.cx,cy:r.cy,r:r.r,fill:i?`url(#net-circle-${t}-hatch)`:tt(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,fillOpacity:r.style.fillOpacity,strokeOpacity:r.style.strokeOpacity,opacity:r.style.opacity})]},"net-circle-"+t)}case"rect":{let r=e,i=pt(r.style.fill)?gt(r.style.fill,`net-rect-${t}-hatch`):void 0;return hr(dr.Fragment,{children:[i&&ur("defs",{children:i}),ur("rect",{x:r.x,y:r.y,width:r.w,height:r.h,fill:i?`url(#net-rect-${t}-hatch)`:tt(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,fillOpacity:r.style.fillOpacity,strokeOpacity:r.style.strokeOpacity,opacity:r.style.opacity})]},"net-rect-"+t)}case"arc":{let r=e,i=cr().innerRadius(r.innerR).outerRadius(r.outerR).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2)(ge)||"",o=pt(r.style.fill)?gt(r.style.fill,`net-arc-${t}-hatch`):void 0;return hr(dr.Fragment,{children:[o&&ur("defs",{children:o}),ur("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:o?`url(#net-arc-${t}-hatch)`:tt(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,fillOpacity:r.style.fillOpacity,strokeOpacity:r.style.strokeOpacity,opacity:r.style.opacity})]},"net-arc-"+t)}case"symbol":{let r=e,i=bt(r.symbolType,r.size,r.path);return ur("path",{d:i,transform:r.rotation?`translate(${r.cx},${r.cy}) rotate(${180*r.rotation/Math.PI})`:`translate(${r.cx},${r.cy})`,fill:r.style.fill?tt(r.style.fill):"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,fillOpacity:r.style.fillOpacity,strokeOpacity:r.style.strokeOpacity,opacity:r.style.opacity},"net-symbol-"+t)}case"glyph":return Oe(e,e.cx,e.cy,"net-glyph-"+(e.id??t));default:return null}}(e,t),e,"network-node-cursor-"+t)}(e,t)})).filter(Boolean),Y.map((e,t)=>function(e,t){return ur("text",{x:e.x,y:e.y,textAnchor:e.anchor||"middle",dominantBaseline:e.baseline||"auto",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,children:e.text},"net-label-"+t)}(e,t)).filter(Boolean)]})]}),yr(u,{width:s,height:n,totalWidth:i[0],totalHeight:i[1],margin:o,labels:Y,sceneNodes:z,title:v,description:m,legend:w,legendPosition:S,legendLayout:A,legendHoverBehavior:C,legendClickBehavior:N,legendHighlightedCategory:R,legendIsolatedCategories:E,foregroundGraphics:I(d,le(t?.customLayoutOverlays,T??null)),annotations:P,onAnnotationActivate:W,onObservation:D??L,chartId:M,chartType:"StreamNetworkFrame",autoPlaceAnnotations:B,svgAnnotationRules:O,annotationFrame:0}),yr(h,{marks:t?.customLayoutHtmlMarks,margin:o,selection:T??null})]})}function g({data:e}){if("edge"===e.nodeOrEdge){let t=e.data;return t?fr("div",{className:"semiotic-tooltip",style:De,children:[fr("div",{style:{fontWeight:600},children:["object"==typeof t.source?t.source.id:t.source," → ","object"==typeof t.target?t.target.id:t.target]}),null!=t.value&&fr("div",{style:{marginTop:4,opacity:.8},children:["Value:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]})]}):null}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(r+""),i=i.parent}e.length>1&&e.shift();let o=e.length-1;return fr("div",{className:"semiotic-tooltip",style:De,children:[pr("div",{children:e.map((e,t)=>fr("span",{children:[t>0&&pr("span",{style:{margin:"0 3px",opacity:.5},children:" → "}),t===o?pr("strong",{children:e}):pr("span",{style:{opacity:.7},children:e})]},t))}),null!=t.value&&t.value>0&&pr("div",{style:{marginTop:4,opacity:.8},children:"number"==typeof t.value?t.value.toLocaleString():t.value+""})]})}let i=(t.sourceLinks?.length||0)+(t.targetLinks?.length||0),o=(t.sourceLinks||[]).reduce((e,t)=>e+(t.value||0),0)+(t.targetLinks||[]).reduce((e,t)=>e+(t.value||0),0),s=et(t.data??t),n=null!=s.title?s.title+"":t.id,a=s.entries.some(e=>mr.test(e.key));return fr("div",{className:"semiotic-tooltip",style:De,children:[pr("div",{style:{fontWeight:600},children:n}),s.entries.map(e=>fr("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",z(e.value)]},e.key)),!a&&null!=t.value&&t.value>0&&fr("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():t.value+""]}),i>0&&fr("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",i,o!==i&&` (weighted: ${o.toLocaleString()})`]})]})}function p(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function f(e,t){if(!t.pathD)return;e.save();let r=p(t);if(t.style.fill&&"none"!==t.style.fill){let i=t._gradient;if(i){let r=e.createLinearGradient(i.x0,i.y0??0,i.x1,i.y1??0),o=t.style.fillOpacity??t.style.opacity??.5,s="string"==typeof t.style.fill?t.style.fill:"#999",n=vt(e,s)||s;r.addColorStop(0,1===i.from?n:"transparent"),r.addColorStop(1,1===i.to?n:"transparent"),e.fillStyle=r,e.globalAlpha=o}else e.fillStyle=kt(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5;e.fill(r)}t.style.stroke&&"none"!==t.style.stroke&&(t.style.strokeWidth??.5)>0&&(e.strokeStyle=vt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.5*(t.style.opacity??1),e.stroke(r)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.2*t._pulseIntensity,e.fill(r)),e.restore()}function m(e,t){if("none"===t.style.stroke||0>=(t.style.strokeWidth??1))return;e.save();let r=t.style.stroke||"#999";e.strokeStyle=vt(e,r)||r,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),t.style.strokeDasharray&&e.setLineDash(t.style.strokeDasharray.split(/[\s,]+/).map(Number)),e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke(),t._pulseIntensity&&t._pulseIntensity>0&&(e.setLineDash([]),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=(t.style.strokeWidth??1)+3*t._pulseIntensity,e.globalAlpha=.4*t._pulseIntensity,e.beginPath(),e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.stroke()),e.restore()}function v(e,t){if(!t.pathD)return;e.save();let r=p(t);t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=kt(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??t.style.opacity??.5,e.fill(r)),t.style.stroke&&"none"!==t.style.stroke&&(t.style.strokeWidth??.5)>0&&(e.strokeStyle=vt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth??.5,e.globalAlpha=.3*(t.style.opacity??1),e.stroke(r)),t._pulseIntensity&&t._pulseIntensity>0&&(e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=.25*t._pulseIntensity,e.fill(r)),e.restore()}function k(e,t){if(!t.pathD)return;e.save();let r=p(t);if("none"!==t.style.stroke&&(t.style.strokeWidth??1)>0){let i=t.style.stroke||"#999";e.strokeStyle=vt(e,i)||i,e.lineWidth=t.style.strokeWidth??1,void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.stroke(r)}t.style.fill&&"none"!==t.style.fill&&(e.fillStyle=kt(e,t.style.fill,"#007bff"),e.globalAlpha=t.style.fillOpacity??.1,e.fill(r)),e.restore()}function b(e,t,r,i=30){if(!e.datum)return null;switch(e.type){case"circle":return function(e,t,r,i=30){let o=t-e.cx,s=r-e.cy,n=Math.sqrt(o*o+s*s);return n>F(e.r,i)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:n}}(e,t,r,i);case"rect":return function(e,t,r){let i=Y(t,r,e);return i.hit?{type:"node",datum:e.datum,x:i.cx,y:i.cy,distance:0}:null}(e,t,r);case"arc":return function(e,t,r){let i=t-e.cx,o=r-e.cy,s=Math.sqrt(i*i+o*o);if(e.innerR-2>s||s>e.outerR+2)return null;let n=X(Math.atan2(o,i)),a=X(e.startAngle),l=X(e.endAngle);if(a>l?n>=a||l>=n:n>=a&&l>=n){let t=(e.startAngle+e.endAngle)/2,r=(e.innerR+e.outerR)/2;return{type:"node",datum:e.datum,x:e.cx+r*Math.cos(t),y:e.cy+r*Math.sin(t),distance:0}}return null}(e,t,r);case"symbol":return function(e,t,r,i=30){let o=t-e.cx,s=r-e.cy,n=Math.sqrt(o*o+s*s);return n>F(_t(e.size),i)?null:{type:"node",datum:e.datum,x:e.cx,y:e.cy,distance:n}}(e,t,r,i);case"glyph":return function(e,t,r,i=30){let o=yt(e.glyph,e.size),s=e.cx+o.centerDx,n=e.cy+o.centerDy,a=t-s,l=r-n,d=Math.sqrt(a*a+l*l);return d>F(o.radius,i)?null:{type:"node",datum:e.datum,x:s,y:n,distance:d}}(e,t,r,i);default:return null}}function _(e,t,r){switch(e.type){case"bezier":case"ribbon":case"curved":return function(e,t,r){if(!e.pathD)return null;let i=function(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}}(e),o=(kr||((vr=document.createElement("canvas")).width=1,vr.height=1,kr=vr.getContext("2d")),kr);if(!i||!o)return null;try{if(o.isPointInPath(i,t,r))return{type:"edge",datum:e.datum,x:t,y:r,distance:0};let s=o.lineWidth;o.lineWidth=10;let n=o.isPointInStroke(i,t,r);if(o.lineWidth=s,n)return{type:"edge",datum:e.datum,x:t,y:r,distance:4}}catch{}return null}(e,t,r);case"line":return function(e,t,r){let i=e.x2-e.x1,o=e.y2-e.y1,s=i*i+o*o;if(0===s)return null;let n=((t-e.x1)*i+(r-e.y1)*o)/s;n=Math.max(0,Math.min(1,n));let a=e.x1+n*i,l=e.y1+n*o,d=Math.sqrt((t-a)**2+(r-l)**2);return d>5?null:{type:"edge",datum:e.datum,x:a,y:l,distance:d}}(e,t,r);default:return null}}function x(e){let{clientX:t,clientY:r,canvasRect:i,margin:o,adjustedWidth:s,adjustedHeight:n,sceneNodes:a,sceneEdges:l,nodeQuadtree:d,maxNodeRadius:c,hitRadius:u=30,includeEdges:h=!0}=e,y=t-i.left-o.left,g=r-i.top-o.top;if(0>y||y>s||0>g||g>n)return{kind:"miss-outside"};let p=function(e,t,r,i,o=30,s,n=0,a=!0){let l=null,d=1/0,c=1/0;if(s){let e=O(s,r,i,o,n,e=>e.cx,e=>e.cy,e=>e.r);e&&(l={mark:e.node,type:"node",datum:e.node.datum,x:e.node.cx,y:e.node.cy,distance:e.distance},d=e.distance)}for(let t of e){if(s&&"circle"===t.type)continue;let e=b(t,r,i,o);if(e)if(e.mark=t,"rect"===t.type){let r=t.w*t.h;c>r&&(l=e,c=r)}else d>e.distance&&(l=e,d=e.distance)}if(l)return l;if(!a)return null;for(let e of t){if(!1===e.interactive)continue;let t=_(e,r,i);t&&(t.mark=e),t&&d>t.distance&&(l=t,d=t.distance)}return l}(a,l,y,g,u,d,c,h);return p?{kind:"hit",hover:Re(p.datum||{},p.x,p.y,{nodeOrEdge:p.type}),mark:p.mark}:{kind:"miss"}}function w(e,t,r){return e.nodes=qe(t),e.edges=qe(r),e.nodes||e.edges}import{canUseForceWorker as S,createFrameForceWorkerRequest as A,shouldUseForceWorker as C}from"./c-MVR3RWF3.min.js";import{needsDataCanvasPaint as N}from"./c-V4XMSLC3.min.js";import{networkSymbolRenderer as R}from"./c-PSKKFZNP.min.js";import{networkGlyphRenderer as E}from"./c-KKPMHAZC.min.js";import{networkFrameDefaultMargin as T}from"./c-2N7IU2NY.min.js";import{StalenessBadge as P,attachUpdateResultStore as W,buildNavGraph as D,composeOverlays as I,computeDecayOpacity as L,extractNetworkNavPoints as M,filterAnnotationsByStatus as B,findHitPointInQuadtree as O,formatVal as z,getHitRadius as F,hitTestRect as Y,nextNetworkIndex as j,normalizeAngle as X,overlayAccessibleDescription as H,overlayAccessibleIds as $,overlayAccessibleTitle as V,paintCanvasBackground as G,paintSceneWithBackend as Q,renderSceneWithBackend as K,resolveFrameLayers as U,resolvePosition as q,runCustomLayoutAttempt as Z,shallowEqualTwoLevel as J,shouldHandleFramePointer as ee,useConfigSync as te,useLayoutSelectionSync as re,useLegendCategoryEmission as ie,useStableShallow as oe,useStalenessCheck as se,warnCustomLayoutDiagnostics as ne}from"./c-SGAURYHG.min.js";import{CustomLayoutSelectionProvider as ae,wrapWithCustomLayoutSelection as le}from"./c-YDECTEUW.min.js";import{renderCirclePulse as de,renderRectPulse as ce}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as ue,resolveCustomLayoutPalette as he}from"./c-EUBTECGM.min.js";import{ANNOTATION_DISCLOSURE_REVEAL_CSS as ye,ARC_NOOP as ge,AccessibleTablePortal as pe,AriaLiveTooltip as fe,CanvasFrameBackground as me,FlippingTooltip as ve,FocusRing as ke,NetworkAccessibleDataTable as be,SVGChartTitle as _e,SceneRevisionDiagnosticsObserver as xe,ScreenReaderSummary as we,SkipToTableLink as Se,UpdateResultTracker as Ae,annotationActivationProps as Ce,annotationLayout as Ne,buildHoverData as Re,computeEasing as Ee,computeNetworkAriaLabel as Te,computeRawProgress as Pe,createDefaultAnnotationRules as We,defaultTooltipStyle as De,emitClickObservations as Ie,emitHoverObservations as Le,filterSparseArray as Me,getDevicePixelRatio as Be,glyphNodeToSVG as Oe,isAnnotationActivationTarget as ze,isInteractiveKeyboardTarget as Fe,isServerEnvironment as Ye,lerp as je,now as Xe,observationInputType as He,prepareCanvas as $e,rehitCanvasMarkCursor as Ve,renderAnnotationPass as Ge,renderLegendFromConfig as Qe,renderLoadingState as Ke,runSceneBuild as Ue,sceneHasAuthoredCursor as qe,sceneMarkCursor as Ze,setCanvasMarkCursor as Je,smartTooltipEntries as et,svgFill as tt,useAnnotationActivationOptions as rt,useCanvasMarkCursorCleanup as it,useFrame as ot,useFrameCanvasHost as st,useHydration as nt,useSceneRevisionDiagnostics as at,useWasHydratingFromSSR as lt,withSceneMarkCursor as dt}from"./c-ODG6TFSY.min.js";import{DEFAULT_COLORS as ct,schemeCategory10 as ut}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as ht}from"./c-JUKIWTBJ.min.js";import{glyphHitGeometry as yt,hatchPatternDef as gt,isHatchFill as pt,paintNetworkFill as ft,paintNetworkStroke as mt,resolveCSSColor as vt,resolveCanvasFill as kt,symbolPathString as bt,symbolRadius as _t}from"./c-MB6CV5NC.min.js";import*as xt from"react";import{useRef as wt,useState as St,useEffect as At,useMemo as Ct,useCallback as Nt,useImperativeHandle as Rt,forwardRef as Et,memo as Tt}from"react";var Pt={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},Wt={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},Dt=class{constructor(e){this.capacity=e,this.particles=Array(e),this._freeIndices=Array(e);for(let t=0;e>t;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(t,r,i,o){for(let s=0;this.capacity>s;s++){let n=this.particles[s];if(!n.active)continue;let a=i[n.edgeIndex];a&&a.bezier?(n.t+=t*r*(o?o[n.edgeIndex]??1:1)*(a.bezier.circular?.3:1),1>n.t?e(a.bezier,n.t,n.offset,n):(n.active=!1,this._freeIndices.push(s))):(n.active=!1,this._freeIndices.push(s))}}countForEdge(e){let t=0;for(let r=0;this.capacity>r;r++)this.particles[r].active&&this.particles[r].edgeIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;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(this.capacity>=e)return;let t=this.particles;this.particles=Array(e);for(let r=0;e>r;r++)t.length>r?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}},It=Object.create(null),Lt=!1;import{quadtree as Mt}from"d3-quadtree";import{interpolateNumber as Bt}from"d3-interpolate";var Ot="rgba(34, 197, 94, 0.7)",zt=2e3,Ft=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yt=["scene-style","data-paint","accessibility","evidence"],jt=(e,t)=>({retainedData:e,invalidations:t}),Xt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ht=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],$t=["scene-geometry","data-paint","overlay","accessibility","evidence"],Vt=["scene-style","data-paint","accessibility","evidence"],Gt=["scene-geometry","data-paint","overlay","accessibility","evidence"],Qt=[],Kt={chartType:jt("rebuild",Xt),nodeIDAccessor:jt("rebuild",Xt),sourceAccessor:jt("rebuild",Xt),targetAccessor:jt("rebuild",Xt),valueAccessor:jt("rebuild",Xt),edgeIdAccessor:jt("rebuild",Xt),childrenAccessor:jt("rebuild",Xt),hierarchySum:jt("rebuild",Xt),orientation:jt("preserve",Ht),nodeAlign:jt("preserve",Ht),nodePaddingRatio:jt("preserve",Ht),nodeWidth:jt("preserve",Ht),edgeSort:jt("preserve",Ht),iterations:jt("preserve",Ht),forceStrength:jt("preserve",Ht),padAngle:jt("preserve",Ht),groupWidth:jt("preserve",Ht),sortGroups:jt("preserve",Ht),treeOrientation:jt("preserve",Ht),edgeType:jt("preserve",Ht),padding:jt("preserve",Ht),paddingTop:jt("preserve",Ht),orbitMode:jt("preserve",Ht),orbitSize:jt("preserve",Ht),orbitSpeed:jt("preserve",Ht),orbitRevolution:jt("preserve",Ht),orbitRevolutionStyle:jt("preserve",Ht),orbitEccentricity:jt("preserve",Ht),orbitShowRings:jt("preserve",Ht),orbitAnimated:jt("preserve",Ht),customNetworkLayout:jt("preserve",Ht),layoutConfig:jt("preserve",Ht),nodeSize:jt("preserve",$t),nodeSizeRange:jt("preserve",$t),colorByDepth:jt("preserve",$t),nodeLabel:jt("preserve",Gt),showLabels:jt("preserve",Gt),labelMode:jt("preserve",Gt),nodeStyle:jt("preserve",Vt),edgeStyle:jt("preserve",Vt),colorBy:jt("preserve",Vt),colorScheme:jt("preserve",Vt),themeCategorical:jt("preserve",Vt),themeSemantic:jt("preserve",Vt),edgeColorBy:jt("preserve",Vt),edgeOpacity:jt("preserve",Vt),showParticles:jt("preserve",Vt),particleStyle:jt("preserve",Vt),decay:jt("preserve",Vt),pulse:jt("preserve",Vt),thresholds:jt("preserve",Vt),staleness:jt("preserve",Vt),layoutSelection:jt("preserve",Vt),clock:jt("preserve",Qt),random:jt("preserve",Qt),seed:jt("preserve",Qt),tensionConfig:jt("preserve",Qt),transition:jt("preserve",Qt),introAnimation:jt("preserve",Qt),onLayoutError:jt("preserve",Qt),__skipForceSimulation:jt("preserve",Qt),__hierarchyRoot:jt("preserve",Qt),__orbitState:jt("preserve",Qt),__previousPositions:jt("preserve",Qt)},Ut=jt("preserve",Ht),qt=class{constructor(){this.tracker=new Ae}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}},Ft)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Yt):this.recordNoop("restyle")}recordConfig(e){let t=function(e){let t="preserve",r=new Set;for(let i of e){let e=Kt[i]??Ut;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)r.add(t)}return{retainedData:t,invalidations:r}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}},Zt=class{constructor(e){this.restyle=e,this.key=null,this.pending=null}reuse(e,t,r,i,o){let s=function(e,t,r,i){return{geometry:[r,i,...t,e.customNetworkLayout,e.layoutConfig],colors:{semantic:e.themeSemantic,categorical:e.themeCategorical,colorScheme:e.colorScheme},selection:[e.layoutSelection?.isActive??!1,e.layoutSelection?.predicate,null!=e.layoutSelection]}}(e,t,r,i),n=null!==this.key&&J(this.key.selection,s.selection);return this.key&&J(this.key.geometry,s.geometry)&&J(this.key.colors,s.colors)&&(o||n)?(n||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}},Jt=class e{constructor(e){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 Zt(e=>this.restyleScene(e)),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.updateResults=new qt,this.transition=null,this._hasRenderedOnce=!1,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.lastIngestTime=0,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={...Pt,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new Dt(2e3))}currentTime(){return this.config.clock?.()??Xe()}updateConfig(e){let t=this.config,r={...t,...e};t.__orbitState&&(r.__orbitState=t.__orbitState),t.__hierarchyRoot&&(r.__hierarchyRoot=t.__hierarchyRoot),void 0===e.layoutSelection&&null!=t.layoutSelection&&(r.layoutSelection=t.layoutSelection);let i=[...new Set([...Object.keys(t),...Object.keys(r)])].filter(e=>t[e]!==r[e]);this.config=r,this.tensionConfig={...Pt,...r.tensionConfig},r.showParticles&&("sankey"===r.chartType||r.customNetworkLayout)&&!this.particlePool&&(this.particlePool=new Dt(2e3)),this.updateResults.recordConfig(i)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}ingestHierarchy(e,t){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.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this.config.__hierarchyRoot=e,this.runLayout(t),this._boundedPrevSnapshot=null,this.updateResults.recordData("replace",1)}ingestBounded(e,t,r,i){let{nodeIDAccessor:o="id",sourceAccessor:a="source",targetAccessor:l="target",valueAccessor:d="value"}=this.config,c="function"==typeof o?o:e=>e[o],u="function"==typeof a?a:e=>e[a],h="function"==typeof l?l:e=>e[l],y="function"==typeof d?d:e=>e[d]??1;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=new Map;for(let[,e]of this.edges)e.sankeyWidth>0&&this._boundedEdgeSnapshot.set(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`,{y0:e.y0,y1:e.y1,sankeyWidth:e.sankeyWidth});this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(let t of e){let e=c(t)+"";this.nodes.set(e,{...s(e),data:t})}for(let e=0;t.length>e;e++){let r=t[e],i=u(r)+"",o=h(r)+"",a=y(r),l=null==a?NaN:Number(a),d=Number.isFinite(l)?l:1;this.nodes.has(i)||this.nodes.set(i,{...s(i),data:r}),this.nodes.has(o)||this.nodes.set(o,{...s(o),data:r});let c=`${i}\0${o}\0${e}`,g={source:i,target:o,value:d,y0:0,y1:0,sankeyWidth:0,data:r,_edgeKey:c};r&&"object"==typeof r&&n(r.bezier)&&(g.bezier=r.bezier),this.edges.set(c,g)}i?.deferLayout||this.runLayout(r),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)}this.config.__skipForceSimulation=!0;try{this.runLayout(t)}finally{this.config.__skipForceSimulation=void 0}}edgeKey(e,t){return`${e}\0${t}`}ingestEdge(e){let{source:t,target:r,value:i}=e,o=0===this.nodes.size,n=!1,a=this.currentTime();this.lastIngestTime=a,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(t)||(this.nodes.set(t,s(t)),this.nodeTimestamps.set(t,a),this.tension+=this.tensionConfig.newNode,n=!0),this.nodes.has(r)||(this.nodes.set(r,s(r)),this.nodeTimestamps.set(r,a),this.tension+=this.tensionConfig.newNode,n=!0);let l=this.edgeKey(t,r),d=this.edges.get(l),c=!1;d?(d.value+=i,this.edgeTimestamps.set(l,a),this.tension+=this.tensionConfig.weightChange,c=!0):(this.edges.set(l,{source:t,target:r,value:i,y0:0,y1:0,sankeyWidth:0}),this.edgeTimestamps.set(l,a),this.tension+=this.tensionConfig.newEdge,n=!0);let u=o||n||c||this.tension>=this.tensionConfig.threshold;return this.updateResults.recordData("ingest",1),u}ingestEdgeWithResult(e){return this.ingestEdge(e),this.updateResults.last}runLayout(e){if(this.config.customNetworkLayout)return this.recordTopologyDiff(),void this.layoutVersion++;let t=i(this.config.chartType);if(!t)return void o(this.config.chartType);let r=Array.from(this.nodes.values()),s=Array.from(this.edges.values());if(0===r.length&&!t.hierarchical)return;if(this.prepareForRelayout(),t.supportsStreaming&&!t.hierarchical){let e=new Map;for(let t of r)void 0!==t._prevX0?e.set(t.id,{x:(t._prevX0??0)+((t._prevX1??0)-(t._prevX0??0))/2,y:(t._prevY0??0)+((t._prevY1??0)-(t._prevY0??0))/2}):(0!==t.x||0!==t.y)&&e.set(t.id,{x:t.x,y:t.y});if(this._lastPositionSnapshot)for(let[t,r]of this._lastPositionSnapshot)e.has(t)||e.set(t,r);this.config.__previousPositions=e.size>0?e:void 0}if(t.computeLayout(r,s,this.config,e),this.config.__previousPositions=void 0,t.hierarchical&&r.length>0){this.nodes.clear(),this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(let e of r)this.nodes.set(e.id,e);for(let e=0;s.length>e;e++){let t=s[e],r=t._edgeKey||`${"string"==typeof t.source?t.source:t.source.id}\0${"string"==typeof t.target?t.target:t.target.id}\0${e}`;t._edgeKey=r,this.edges.set(r,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,r=Array.from(this.nodes.values())}this.finalizeLayout();let n=new Map;for(let e of this.nodes.values())(0!==e.x||0!==e.y)&&n.set(e.id,{x:e.x,y:e.y});this._lastPositionSnapshot=n,this.saveTargetPositions();let a=r.some(e=>void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1||0!==e._prevY0||0!==e._prevY1)),l=this.config.transition?.duration??this.tensionConfig.transitionDuration,d=["sankey","tree","treemap","circlepack","partition"].includes(this.config.chartType);if(!this._hasRenderedOnce&&this.config.introAnimation&&d&&r.length>0&&l>0){let t=e[0]/2,r=e[1]/2;for(let e of this.nodes.values())e._prevX0=t,e._prevX1=t,e._prevY0=r,e._prevY1=r;for(let e of this.edges.values())e._prevY0=r,e._prevY1=r,e._prevSankeyWidth=0,e._introFromZero=!0;this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:l}}else a&&l>0&&(this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:l});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:o,selection:s}){let n=!(!r&&!i);if(r)for(let t of e){let e=o.get(t)??t.style,i=r(t,s);t.style=i?{...e,...i}:e}if(i)for(let e of t){let t=o.get(e)??e.style,r=i(e,s);e.style=r?{...t,...r}:t}return n}({nodes:this.sceneNodes,edges:this.sceneEdges,restyle:this._customRestyle,restyleEdge:this._customRestyleEdge,baseStyles:this._baseStyles,selection:e});this.markStylePaintPending(),this.updateResults.recordRestyle(t)}buildScene(e){if(this.config.customNetworkLayout){if(this._customLayoutCache.reuse(this.config,e,this.getUpdateSnapshot().revisions.data,this.layoutVersion,this.hasCustomRestyle))return;let t=function({config:e,customLayout:t,size:r,nodes:i,edges:o,previousResult:s,revision:n}){let a=he(e.colorScheme,e.themeCategorical,ut),l={nodes:i,edges:o,dimensions:{width:r[0],height:r[1],plot:{x:0,y:0,width:r[0],height:r[1]}},theme:{semantic:e.themeSemantic??{},categorical:[...a]},resolveColor:ue(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};return Z({family:"network",logLabel:"customNetworkLayout",revision:n,hasPreviousResult:null!==s,onLayoutError:e.onLayoutError,run:()=>t(l)})}({config:this.config,customLayout:this.config.customNetworkLayout,size:e,nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values()),previousResult:this.lastCustomLayoutResult,revision:this.layoutVersion});if("failure"===t.kind)return this.lastCustomLayoutFailure=t.diagnostic,void(t.preservedLastGoodScene||(this.sceneNodes=[],this.sceneEdges=[],this.labels=[],l(this),this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._sceneNodesRevision++));let r=t.result;return this._customLayoutCache.commit(),this.sceneNodes=r.sceneNodes??[],this.sceneEdges=r.sceneEdges??[],this.labels=r.labels??[],function(e,t){e.customLayoutBackgrounds=t.backgrounds??null,e.customLayoutOverlays=t.overlays??null,e.customLayoutHtmlMarks=t.htmlMarks??[],e.lastCustomLayoutResult=t}(this,r),this.lastCustomLayoutFailure=null,this._sceneNodesRevision++,this._customRestyle=r.restyle,this._customRestyleEdge=r.restyleEdge,this.hasCustomRestyle=!(!r.restyle&&!r.restyleEdge),this.hasCustomRestyle&&(this._baseStyles=function(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}(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null)),void ne({label:"customNetworkLayout",nodes:this.sceneNodes,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned})}this._customLayoutCache.clear(),this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,l(this),this.lastCustomLayoutFailure=null;let t=i(this.config.chartType);if(!t)return o(this.config.chartType),void this._sceneNodesRevision++;let r=t.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=t.hierarchical?Array.from(this.edges.values()):this.edgesArray,{sceneNodes:n,sceneEdges:a,labels:d}=t.buildScene(r,s,this.config,e);this.sceneNodes=n,this.sceneEdges=a,this.labels=d,this._sceneNodesRevision++}rebuildNodeQuadtree(){let t=0,r=0;for(let e of this.sceneNodes)"circle"===e.type&&e.datum&&(t++,e.r>r&&(r=e.r));if(this._maxNodeRadius=r,e.QUADTREE_THRESHOLD>=t)return void(this._nodeQuadtree=null);let i=[];for(let e of this.sceneNodes)"circle"===e.type&&e.datum&&i.push(e);this._nodeQuadtree=Mt().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._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!(!i(this.config.chartType)?.supportsAnimation||!1===this.config.orbitAnimated)}tickAnimation(e,t){let r=i(this.config.chartType);if(!r?.tick)return!1;let o=r.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=r.hierarchical?Array.from(this.edges.values()):this.edgesArray;return r.tick(o,s,this.config,e,t)}cancelIntroAnimation(){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._introFromZero=!1}advanceTransition(e){if(!this.transition)return!1;let t=Pe(e,this.transition),r=Ee(t);for(let e of this.nodes.values())void 0!==e._targetX0&&void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1)&&(e.x0=je(e._prevX0,e._targetX0,r),e.x1=je(e._prevX1,e._targetX1,r),e.y0=je(e._prevY0,e._targetY0,r),e.y1=je(e._prevY1,e._targetY1,r));for(let e of this.edges.values())void 0!==e._targetY0&&void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&(e._prevSankeyWidth>0||e._introFromZero)&&(e.y0=je(e._prevY0,e._targetY0,r),e.y1=je(e._prevY1,e._targetY1,r),e.sankeyWidth=je(e._prevSankeyWidth,e._targetSankeyWidth,r));return this.rebuildAllBeziers(),1>t||(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)}let t=this._boundedEdgeSnapshot;for(let e of this.edges.values()){if(t&&0===e.sankeyWidth){let r=t.get(`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`);if(r){e._prevY0=r.y0,e._prevY1=r.y1,e._prevSankeyWidth=r.sankeyWidth;continue}}e._prevY0=e.y0,e._prevY1=e.y1,e._prevSankeyWidth=e.sankeyWidth}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())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())e._targetY0=e.y0,e._targetY1=e.y1,e._targetSankeyWidth=e.sankeyWidth}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())void 0!==e._prevY0&&void 0!==e._prevSankeyWidth&&e._prevSankeyWidth>0&&(e.y0=e._prevY0,e.y1=e._prevY1,e.sankeyWidth=e._prevSankeyWidth);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())void 0!==e._targetY0&&(e.y0=e._targetY0,e.y1=e._targetY1,e.sankeyWidth=e._targetSankeyWidth),e._introFromZero=void 0;this.rebuildAllBeziers()}updateEdgeBezier(e){!function(e,t,r=.5){let i="string"==typeof e.source?t.get(e.source):e.source,o="string"==typeof e.target?t.get(e.target):e.target;!i||!o||(e.bezier=e.circular&&e.circularPathData?function(e){let t,r=(e._circularWidth||e.sankeyWidth||1)/2,i=e.circularPathData;if(!i)throw 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 o=[];for(let e=0;t.length-1>e;e++){let r=t[e],i=t[e+1],s=i.x-r.x,n=i.y-r.y;o.push([r,{x:r.x+s/3,y:r.y+n/3},{x:r.x+2*s/3,y:r.y+2*n/3},i])}return{circular:!0,segments:o,halfWidth:r}}(e):function(e,t,r,i=.5){let o=(e.sankeyWidth||1)/2;if("down"===e.direction){let s=t.x1,n=r.x0,a=Bt(s,n);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:n}],halfWidth:o}}let s=t.x1,n=r.x0,a=Bt(s,n);return{circular:!1,points:[{x:s,y:e.y0},{x:a(i),y:e.y0},{x:a(1-i),y:e.y1},{x:n,y:e.y1}],halfWidth:o}}(e,i,o,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)",o=t.glowRadius??4,{now:s}=e;for(let t of e.sceneNodes){let n=t.id;if(!n)continue;let a=e.nodeTimestamps.get(n);if(!a)continue;let l=s-a;r>l&&(t._pulseIntensity=1-l/r,t._pulseColor=i,t._pulseGlowRadius=o)}for(let t of e.sceneEdges){let o=t.datum;if(!o)continue;let n="object"==typeof o.source?o.source?.id:o.source,a="object"==typeof o.target?o.target?.id:o.target;if(!n||!a)continue;let l=e.edgeTimestamps.get(`${n}\0${a}`);if(!l)continue;let d=s-l;r>d&&(t._pulseIntensity=1-d/r,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(1>=r)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;e.cache.sortedNodes.length>r;r++)t.set(e.cache.sortedNodes[r][0],r);e.cache.ageMap=t}let i=e.cache.ageMap;for(let o of e.sceneNodes){let e=o.id;if(!e)continue;let s=i.get(e);if(void 0===s)continue;let n=L(t,s,r);o.style={...o.style,opacity:(o.style?.opacity??1)*n}}}({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===Ot&&(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>=zt)return;let r=1-t/zt;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=Ot,t._pulseGlowRadius=8)}}({sceneNodes:this.sceneNodes,addedNodes:this.addedNodes,lastTopologyChangeTime:this.lastTopologyChangeTime,now:e})}get hasActiveTopologyDiff(){return function(e,t,r=("u">typeof performance?performance.now():Date.now())){return 0!==e.size&&zt>r-t}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){let t=e.thresholds;if(!t)return;let r=t.warningColor??"#f59e0b",i=t.criticalColor??"#ef4444",o=!1!==t.pulse;for(let s of e.sceneNodes){let n=s.id;if(!n)continue;let a=e.nodes.get(n);if(!a)continue;let l=t.metric(a),d=null;void 0===t.critical||t.critical>l?void 0!==t.warning&&l>=t.warning&&(d=r):d=i,d&&(s.style={...s.style,fill:d},o&&(s._pulseIntensity=.6+.4*Math.sin(e.now/300),s._pulseColor=d,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??("u">typeof performance?performance.now():Date.now());return(t.duration??500)>r-e.lastIngestTime}({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.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),i}updateEdge(e,t,r){let i=this.config.valueAccessor,o="function"==typeof i?i:i?e=>e[i]:e=>e.value,s=[];for(let[,i]of this.edges)if(("string"==typeof i.source?i.source:i.source.id)===e&&("string"==typeof i.target?i.target:i.target.id)===t){s.push(i.data?{...i.data}:{}),i.data=r(i.data??{});let e=o(i.data);null!=e&&(i.value=Number(e))}return s.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",s.length)):this.updateResults.recordNoop("update"),s}removeNode(e){if(!this.nodes.has(e))return this.updateResults.recordNoop("remove"),!1;this.nodes.delete(e),this.nodeTimestamps.delete(e);for(let[t,r]of this.edges)(("string"==typeof r.source?r.source:r.source.id)===e||("string"==typeof r.target?r.target:r.target.id)===e)&&(this.edges.delete(t),this.edgeTimestamps.delete(t));return this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",1),!0}removeEdge(e,t){let r=[];if(void 0===t){let t=this.config.edgeIdAccessor;if(!t)throw 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,o]of this.edges)o.data&&i(o.data)===e&&r.push(t)}else for(let[i,o]of this.edges)("string"==typeof o.source?o.source:o.source.id)===e&&("string"==typeof o.target?o.target:o.target.id)===t&&r.push(i);for(let e of r)this.edges.delete(e),this.edgeTimestamps.delete(e);return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length)):this.updateResults.recordNoop("remove"),r.length>0}clear(){this._customLayoutCache.clear(),this.nodes.clear(),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=[],l(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.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")}};Jt.QUADTREE_THRESHOLD=500;var er=Jt;W(er);import*as tr from"react";import{useId as rr}from"react";import{Fragment as ir,jsx as or,jsxs as sr}from"react/jsx-runtime";u.displayName="NetworkSVGOverlay";import*as nr from"react";import{jsx as ar}from"react/jsx-runtime";var lr={position:"absolute",top:0,left:0,pointerEvents:"none"};import*as dr from"react";import{arc as cr}from"d3-shape";import{jsx as ur,jsxs as hr}from"react/jsx-runtime";import{jsx as yr,jsxs as gr}from"react/jsx-runtime";import{jsx as pr,jsxs as fr}from"react/jsx-runtime";var mr=/^(value|amount|total|count|weight|score)$/i;g.ownsChrome=!0;var vr=null,kr=null;import{useCallback as br}from"react";var _r="StreamNetworkFrame";import{jsx as xr,jsxs as wr}from"react/jsx-runtime";var Sr=[800,600],Ar=Tt(Et(function(e,t){let{chartType:r,nodes:i,edges:o,data:s,initialEdges:n,nodeIDAccessor:a="id",sourceAccessor:l="source",targetAccessor:d="target",valueAccessor:c="value",edgeIdAccessor:p,childrenAccessor:b,hierarchySum:_,orientation:W="horizontal",nodeAlign:L="justify",nodePaddingRatio:B=.05,nodeWidth:O=15,iterations:z=300,forceStrength:F=.1,layoutExecution:Y="auto",layoutLoadingContent:X,onLayoutStateChange:H,padAngle:$=.01,groupWidth:V=20,sortGroups:K,edgeSort:Z,treeOrientation:J="vertical",edgeType:ne="curve",padding:ae,paddingTop:ue,tensionConfig:he,showParticles:ye=!1,particleStyle:ge,renderMode:_e,nodeStyle:Ae,edgeStyle:Ce,colorBy:Ne,colorScheme:Ee="category10",edgeColorBy:Pe="source",edgeOpacity:We=.5,colorByDepth:De=!1,nodeSize:Oe=8,nodeSizeRange:je=[5,20],nodeLabel:Xe,showLabels:Ge=!0,labelMode:Qe,size:qe=Sr,responsiveWidth:et,responsiveHeight:tt,margin:rt,className:dt,background:ut,maxDevicePixelRatio:yt,enableHover:gt=!0,tooltipContent:pt,customHoverBehavior:kt,customClickBehavior:bt,onObservation:_t,annotationObservationCallback:Et,chartId:Tt,onTopologyChange:Dt,annotations:It,onAnnotationActivate:Lt,autoPlaceAnnotations:Mt,svgAnnotationRules:Bt,legend:Ot,legendPosition:zt,legendLayout:Ft,legendHoverBehavior:Yt,legendClickBehavior:jt,legendHighlightedCategory:Xt,legendIsolatedCategories:Ht,legendCategoryAccessor:$t,onCategoriesChange:Vt,title:Gt,foregroundGraphics:Qt,backgroundGraphics:Kt,decay:Ut,pulse:qt,transition:Zt,animate:Jt,staleness:tr,frameScheduler:rr,clock:ir,random:or,seed:sr,paused:nr=!1,suspendWhenHidden:ar=!0,thresholds:lr,accessibleTable:dr=!0,description:cr,summary:ur,orbitMode:hr,orbitSize:yr,orbitSpeed:gr,orbitRevolution:pr,orbitRevolutionStyle:fr,orbitEccentricity:mr,orbitShowRings:vr,orbitAnimated:kr,customNetworkLayout:Ar,onLayoutError:Cr,layoutConfig:Nr,layoutSelection:Rr}=e,Er=T(r),Tr=wt(!0),Pr=ot({sizeProp:qe,responsiveWidth:et,responsiveHeight:tt,userMargin:rt,marginDefault:Er,title:Gt,legend:Ot,legendPosition:zt,legendLayout:Ft,legendMarginReserved:e.__legendMarginReservedFor===Ot,animate:Jt,transitionProp:Zt,frameScheduler:rr,clock:ir,random:or,seed:sr,paused:nr,suspendWhenHidden:ar,themeDirtyRef:Tr}),{reducedMotionRef:Wr,responsiveRef:Dr,size:Ir,margin:Lr,adjustedWidth:Mr,adjustedHeight:Br,transition:Or,introEnabled:zr,tableId:Fr,rafRef:Yr,renderFnRef:jr,scheduleRender:Xr,frameRuntime:Hr,currentTheme:$r}=Pr,{resolvedForeground:Vr,resolvedBackground:Gr,themeBackground:Qr,surfaceBackground:Kr}=U({foregroundGraphics:Qt,backgroundGraphics:Kt,size:Ir,margin:Lr,scales:null,background:ut,themeBackgroundColor:$r.colors.background}),Ur=nt(),qr=lt(),Zr=Ct(()=>Me(i),[i]),Jr=Ct(()=>Array.isArray(o)?Me(o):o,[o]),ei=!1===Jt,ti=Ct(()=>({...Pt,...he,...ei?{transitionDuration:0}:{}}),[he,ei]),ri=Ct(()=>({...Wt,...ge}),[ge]),ii=Ct(()=>function(e){let{currentTheme:t,...r}=e;return{...r,themeCategorical:t?.colors?.categorical,themeSemantic:ht(t)}}({chartType:r,clock:Hr.now,random:or,seed:sr,nodeIDAccessor:a,sourceAccessor:l,targetAccessor:d,valueAccessor:c,edgeIdAccessor:p,childrenAccessor:b,hierarchySum:_,orientation:W,nodeAlign:L,nodePaddingRatio:B,nodeWidth:O,iterations:z,forceStrength:F,padAngle:$,groupWidth:V,sortGroups:K,edgeSort:Z,treeOrientation:J,edgeType:ne,padding:ae,paddingTop:ue,tensionConfig:ti,showParticles:ye,particleStyle:ri,nodeStyle:Ae,edgeStyle:Ce,nodeLabel:Xe,showLabels:Ge,labelMode:Qe,colorBy:Ne,colorScheme:Ee,edgeColorBy:Pe,edgeOpacity:We,colorByDepth:De,nodeSize:Oe,nodeSizeRange:je,decay:Ut,pulse:qt,transition:Or,introAnimation:zr,staleness:tr,thresholds:lr,orbitMode:hr,orbitSize:yr,orbitSpeed:gr,orbitRevolution:pr,orbitRevolutionStyle:fr,orbitEccentricity:mr,orbitShowRings:vr,orbitAnimated:kr,customNetworkLayout:Ar,onLayoutError:Cr,layoutConfig:Nr,currentTheme:$r}),[r,Hr.now,or,sr,a,l,d,c,p,b,_,W,L,B,O,z,F,$,V,K,Z,J,ne,ae,ue,ti,ye,ri,Ae,Ce,Xe,Ge,Qe,Ne,Ee,Pe,We,De,Oe,je,Ut,qt,Or,zr,tr,lr,hr,yr,gr,pr,fr,mr,vr,kr,Ar,Cr,Nr,$r]),oi=oe(ii),si=oe({chartType:r,nodeIDAccessor:a,sourceAccessor:l,targetAccessor:d,valueAccessor:c,edgeIdAccessor:p,childrenAccessor:b,hierarchySum:_,orientation:W,nodeAlign:L,nodePaddingRatio:B,nodeWidth:O,iterations:z,forceStrength:F,padAngle:$,groupWidth:V,sortGroups:K,edgeSort:Z,treeOrientation:J,edgeType:ne,padding:ae,paddingTop:ue,random:or,seed:sr,tensionConfig:ti,customNetworkLayout:Ar,orbitMode:hr,orbitSize:yr,orbitEccentricity:mr}),ni=wt(0),ai=wt(0),li=wt(!1),di=wt(null);di.current||(di.current=new er(oi));let ci=ie(di,$t,Vt,e=>Array.from(e.nodes.values()).map(e=>e.data?{id:e.id,...e.data}:e)),ui=at("StreamNetworkFrame"),hi=Nt((e,t,r=!1)=>Ue(ui.current,e,()=>e.buildScene(t),r),[ui]),[yi,gi]=St(null),[pi,fi]=St(0),[mi,vi]=St(0),[ki,bi]=St(!1),[_i,xi]=St(!1),wi=wt(0),Si=wt(null),Ai=wt(!1),Ci=wt(H);Ci.current=H;let Ni=wt(oi);Ni.current=oi;let Ri=wt(null),Ei=wt({nodes:!1,edges:!1}),Ti=wt(new Map),Pi=wt(0),Wi=wt(Ee);Wi.current=Ee;let Di=Nt(e=>function(e){let{node:t,colorBy:r,colorScheme:i,nodeColorMap:o,colorIndexRef:s}=e;if("function"==typeof r)return r(t)+"";if("string"==typeof r&&t.data){let e=t.data[r];if(void 0!==e){if(!o.has(e+"")){let t=Array.isArray(i)?i:ct;o.set(e+"",t[s.current++%t.length])}return o.get(e+"")}}if(o.has(t.id))return o.get(t.id);let n=Array.isArray(i)?i:ct,a=r?n[s.current++%n.length]:n[0];return o.set(t.id,a),a}({node:e,colorBy:Ne,colorScheme:Ee,nodeColorMap:Ti.current,colorIndexRef:Pi}),[Ne,Ee]),Ii=Nt(e=>{Pi.current=function(e){let{sceneNodes:t,nodes:r,nodeColorMap:i,colorScheme:o}=e;for(let e of t)e.id&&"string"==typeof e.style?.fill&&i.set(e.id,e.style.fill);let s=Array.isArray(o)?o:ct,n=Array.from(r);for(let e=0;n.length>e;e++){let t=n[e];i.has(t.id)||i.set(t.id,s[e%s.length])}return n.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:Ti.current,colorScheme:Wi.current})},[]),Li=wt(null),Mi=Nt((e,t)=>{hi(e,t),Li.current=t,ci(),Ii(e),w(Ei.current,e.sceneNodes,e.sceneEdges),Tr.current=!1,e.markStylePaintPending()},[hi,ci,Ii]),Bi=Nt(()=>{di.current?.markStylePaintPending()},[]),{canvasRef:Oi,resolutionDirtyRef:zi}=st(Pr,{hydrated:Ur,wasHydratingFromSSR:qr,storeRef:di,dirtyRef:Tr,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:Bi,maxDevicePixelRatio:yt,canvasPaintDependencies:[r,Mr,Br,ut,Kt,_e,Xr]}),Fi=($i=$r,$i?.colors?.border||$i?.colors?.secondary||$i?.colors?.primary||"#999"),Yi=Nt(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,di.current?.nodes),[]),ji=Nt(e=>function(e){let{edge:t,edgeColorBy:r,getNodeColor:i,resolveEndpoint:o,fallback:s}=e;if("function"==typeof r)return r(t);let n=o(t.source),a=o(t.target);return"target"===r&&a?i(a):n?i(n):s}({edge:e,edgeColorBy:Pe,getNodeColor:Di,resolveEndpoint:Yi,fallback:Fi}),[Pe,Di,Fi,Yi]),Xi=Nt(e=>function(e){let{edge:t,particleStyleColor:r,particleColorBy:i,hasExplicitParticleColorBy:o,getEdgeColor:s,getNodeColor:n,resolveEndpoint:a,fallback:l}=e;if("function"==typeof r){let e=a(t.source);return e?r(t,e):l}if(!o)return s(t);let d=i,c=a(t.source),u=a(t.target);return"target"===d&&u?n(u):c?n(c):l}({edge:e,particleStyleColor:ri.color,particleColorBy:ri.colorBy,hasExplicitParticleColorBy:!!ge?.colorBy,getEdgeColor:ji,getNodeColor:Di,resolveEndpoint:Yi,fallback:Fi}),[ge?.colorBy,ri.color,ri.colorBy,Di,ji,Fi,Yi]),Hi=function(e,t,r,i,o){return("sankey"===e||t)&&r||i||o}(r,!!Ar,ye,!!qt,di.current?.isAnimating??!1);var $i;te(di,oi,Tr,Xr),re(di,Rr,Tr,Xr);let Vi=Nt(()=>{let e=di.current;if(e&&(e.runLayout([Mr,Br]),Mi(e,[Mr,Br]),fi(e.layoutVersion),Dt)){let{nodes:t,edges:r}=e.getLayoutData();Dt(t,r)}},[Mr,Br,Mi,Dt]),Gi=wt(!1),Qi=Nt((e=!1)=>!(!e&&!Gi.current||(Gi.current=!1,Vi(),0)),[Vi]),Ki=Nt(()=>Qi(!1),[Qi]),Ui=Nt(e=>{let t=di.current;if(!t)return!1;let r=!1,i=Gi.current;for(let o of e)null==o||"object"!=typeof o||(r=!0,t.ingestEdge(o)&&(i=!0));let o=Qi(i);return r||o},[Qi]),qi=Nt(e=>{if(null==e||"object"!=typeof e)return;let t=di.current;if(t){if(t.ingestEdge(e)&&(Gi.current=!0),!Hr.isActive)return void Ki();Xr()}},[Ki,Hr,Xr]),Zi=Nt(e=>{Ui(e)&&Xr()},[Ui,Xr]);At(()=>Hr.subscribe(()=>{Hr.isActive||Ki()}),[Ki,Hr]);let Ji=Nt(()=>{Gi.current=!1,di.current?.clear(),ci(),Ti.current.clear(),Pi.current=0,fi(di.current?.layoutVersion??0),gi(null),Ri.current=null,Tr.current=!0,Xr()},[ci,Xr]),eo=Nt(()=>{let e=di.current;e&&(e.tension+=999,Qi(!0),Xr())},[Qi,Xr]);Rt(t,()=>({push:qi,pushMany:Zi,removeNode:e=>{let t=di.current?.removeNode(e)??!1;if(t){let t=Ri.current?.data?"function"==typeof a?a(Ri.current.data):Ri.current.data[a]:void 0;Ri.current&&"node"===Ri.current.nodeOrEdge&&t===e&&(Ri.current=null,gi(null)),Ti.current.delete(e)}return Qi(t)&&Xr(),t},removeEdge:(e,t)=>{let r=di.current?.removeEdge(e,t)??!1;if(r&&Ri.current&&"edge"===Ri.current.nodeOrEdge){let r,i=Ri.current.data;r=void 0!==t?("object"==typeof i?.source?i.source.id:i?.source)===e&&("object"==typeof i?.target?i.target.id:i?.target)===t:!p||!i||("function"==typeof p?p:e=>e?.[p])(i)===e,r&&(Ri.current=null,gi(null))}return Qi(r)&&Xr(),r},updateNode:(e,t)=>{let r=di.current?.updateNode(e,t)??null;return Qi(null!==r)&&Xr(),r},updateEdge:(e,t,r)=>{let i=di.current?.updateEdge(e,t,r)??[];return Qi(i.length>0)&&Xr(),i},clear:Ji,getTopology:()=>(Ki(),di.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(Ki(),di.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(Ki(),di.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{Ki();let e=di.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:eo,getTension:()=>(Ki(),di.current?.tension??0)}),[qi,Zi,Ji,eo,Ki,Qi,a,Xr,p]);let to=["tree","cluster","treemap","circlepack","partition","orbit"].includes(r),ro=to?s||(Array.isArray(o)?void 0:o):void 0;At(()=>{let e=di.current;if(!e)return;let t=++wi.current;if(Si.current?.abort(),Si.current=null,to&&ro)Gi.current=!1,e.ingestHierarchy(ro,[Mr,Br]),Mi(e,[Mr,Br]),fi(e.layoutVersion),xi(!1),Ci.current?.("ready"),Xr();else{let s=Zr,n=Array.isArray(Jr)?Jr:[];if((null!=i||null!=o)&&(Gi.current=!1),0===s.length&&0===n.length)return(null!=i||null!=o)&&(e.nodes.size>0||e.edges.size>0)&&Ji(),xi(!1),void Ci.current?.("ready");let a=[Mr,Br],l="force"===r&&!Ar&&S()&&!or&&C(Y,s.length,n.length,z);if(l&&qr&&!Ai.current&&e.sceneNodes.length>0)return Ai.current=!0,xi(!1),Ci.current?.("ready"),Tr.current=!0,void Xr();if(l){let r=new AbortController;Si.current=r;let i=e._lastPositionSnapshot;e.ingestBounded(s,n,a,{deferLayout:!0});let o=e.getLayoutData(),l=A(o.nodes,o.edges,Ni.current,a,i);return xi(!0),Ci.current?.("pending"),import("./c-XSB27XPS.min.js").then(({runForceLayoutWorker:e})=>e(l,r.signal)).then(({positions:r})=>{t===wi.current&&(Si.current=null,e.applyForceLayoutPositions(r,a),Mi(e,a),xi(!1),Ci.current?.("ready"),fi(e.layoutVersion),Xr())}).catch(r=>{"AbortError"!==r.name&&t===wi.current&&(Si.current=null,e.runLayout(a),Mi(e,a),xi(!1),Ci.current?.("error"),fi(e.layoutVersion),Xr())}),()=>r.abort()}e.ingestBounded(s,n,a),Mi(e,a),fi(e.layoutVersion),xi(!1),Ci.current?.("ready"),Xr()}},[Zr,Jr,i,o,s,ro,to,Mr,Br,si,Y,z,qr,r,Ar,or,Xr,Ji,Mi]);let io=xt.useRef(!1);At(()=>{io.current||n&&n.length>0&&(io.current=!0,Zi(n))},[n,Zi]),At(()=>{let e=di.current;if(!e||Si.current)return;let t=Li.current,r=null!==t&&(t[0]!==Mr||t[1]!==Br);!Tr.current&&!r||(r&&e.runLayout([Mr,Br]),Mi(e,[Mr,Br]),fi(e=>e+1),Xr())},[$r,Mr,Br,Mi,Xr]);let{customHoverBehavior:oo,customClickBehavior:so}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:i}){return{customHoverBehavior:br((t,o)=>{e?.(t,o),Le({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:_r,chartId:i,context:o})},[e,r,i]),customClickBehavior:br((e,o)=>{t?.(e,o),Ie({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:_r,chartId:i,context:o})},[t,r,i])}}({customHoverBehavior:kt,customClickBehavior:bt,onObservation:_t,chartId:Tt}),{hoverHandlerRef:no,hoverLeaveRef:ao,onPointerMove:lo,onPointerLeave:co,pointerStateRef:uo}=Pr,ho=()=>!Ar||(di.current?.hasCustomRestyle??!1);no.current=e=>{let t=ho(),r=Oi.current;if(!r)return;let i=di.current;if(!i)return void Je(r);let o=x({clientX:e.clientX,clientY:e.clientY,canvasRect:r.getBoundingClientRect(),margin:Lr,adjustedWidth:Mr,adjustedHeight:Br,sceneNodes:i.sceneNodes,sceneEdges:i.sceneEdges,nodeQuadtree:i.nodeQuadtree,maxNodeRadius:i.maxNodeRadius,includeEdges:gt||Ei.current.edges});if(Je(r,"hit"===o.kind?Ze(o.mark):void 0),gt){if("hit"!==o.kind)return void(Ri.current&&(Ri.current=null,gi(null),oo?.(null),t&&Xr()));Ri.current=o.hover,gi(o.hover),oo?.(o.hover),t&&Xr()}},ao.current=()=>{if(Je(Oi.current),Ri.current){let e=ho();Ri.current=null,gi(null),oo?.(null),e&&Xr()}};let yo=wt(()=>{});yo.current=e=>{if(ze(e.target)||!bt&&!_t)return;let t=Oi.current;if(!t)return;let r=di.current;if(!r)return;let i=x({clientX:e.clientX,clientY:e.clientY,canvasRect:t.getBoundingClientRect(),margin:Lr,adjustedWidth:Mr,adjustedHeight:Br,sceneNodes:r.sceneNodes,sceneEdges:r.sceneEdges,nodeQuadtree:r.nodeQuadtree,maxNodeRadius:r.maxNodeRadius});"hit"===i.kind?so(i.hover,{type:"activate",inputType:He(e.nativeEvent.pointerType)}):"miss"===i.kind&&so(null)};let go=Nt(e=>yo.current(e),[]),po=wt(-1),fo=wt(null),mo=wt(-1),vo=Nt(e=>{if(Fe(e))return;let t=di.current;if(!t)return;let r=()=>{po.current=-1,fo.current=null,mo.current=-1,Ri.current=null,gi(null),oo?.(null),Xr()},i=M(t.sceneNodes);if(0===i.length)return void(po.current>=0&&r());let o=D(i),s=po.current;if(s>=o.flat.length&&(r(),s=-1)," "===e.key&&s>=0){e.preventDefault();let t=o.flat[s];return void so?.(Re(t.datum||{},t.x,t.y,{nodeOrEdge:"node"}),{type:"activate",inputType:"keyboard"})}if(0>s){if("Escape"===e.key||!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"].includes(e.key))return;e.preventDefault(),po.current=0,mo.current=-1;let t=o.flat[0];fo.current={shape:t.shape,w:t.w,h:t.h};let r=Re(t.datum||{},t.x,t.y,{nodeOrEdge:"node"});return Ri.current=r,gi(r),oo?.(r,{type:"focus",inputType:"keyboard"}),void Xr()}let n=q(o,s),a=j(e.key,n,o,t.sceneEdges??[],mo);if(null===a)return;if(e.preventDefault(),0>a)return void r();po.current=a;let l=o.flat[a];fo.current={shape:l.shape,w:l.w,h:l.h};let d={data:l.datum||{},x:l.x,y:l.y,__semioticHoverData:!0,nodeOrEdge:"node"};Ri.current=d,gi(d),oo?.(d,{type:"focus",inputType:"keyboard"}),Xr()},[so,oo,Xr]),ko=Nt(e=>{ee(uo,e,gt,Ei.current.nodes||Ei.current.edges,Oi.current,"mouse")&&(po.current=-1,fo.current=null,lo(e))},[Oi,gt,lo,uo]);jr.current=()=>{if(Yr.current=null,Ki(),!Hr.isActive||Si.current)return;let e=Oi.current;if(!e)return;let t=di.current;t&&function(e){let{canvas:t,store:r,sceneRevisionDiagnostics:i,size:o,margin:s,adjustedWidth:n,adjustedHeight:a,background:l,themeBackground:d,maxDevicePixelRatio:c,renderMode:u,hasBackgroundGraphics:h=!1,dirtyRef:y,resolutionDirtyRef:g,lastFrameTimeRef:p,now:b,random:_,reducedMotion:x,showParticles:w,isContinuous:S,animate:A,decay:C,pulse:T,thresholds:P,staleness:W,particleStyle:D,getParticleColor:I,pendingAnnotationFrameRef:L,lastAnnotationFrameTimeRef:M,setAnnotationFrame:B,scheduleNextFrame:O,syncColorMap:z,onSceneOrStyleChange:F}=e,Y=t.getContext("2d");if(!Y)return;let j=p.current?Math.min((b-p.current)/1e3,.1):.016;p.current=b;let X=null!=r.transition,H=r.advanceTransition(x?b+1e6:b),$=!x&&H,V=X&&!H,K=!x&&r.tickAnimation([n,a],j),U=y.current,q=i?.beforeCompute(r.getLastUpdateResult(),$),Z=X||U||K;Z&&(r.buildScene([n,a]),U&&z?.()),q&&i?.afterCompute(q,Z,!0);let J=w&&!x&&!!r.particlePool,ee=!!C||!!T||!!P||!1!==A&&r.hasActiveTopologyDiff||r.hasActivePulses||r.hasActiveThresholds,te=r.consumeStylePaintPending();(Z||te)&&F?.({inventoryChanged:U||te,geometryChanged:Z});let re=N({dirtyOrRebuilt:Z,transitioning:$,animationTicked:K,continuous:J||S,liveEncoding:ee,forced:te||!0===g?.current});g&&(g.current=!1);let ie=!!W&&r.lastIngestTime>0&&b-r.lastIngestTime>(W?.threshold??5e3);if(re){let e=Be(c,o);if(!$e(t,o,s,e))return;if(Y.clearRect(-s.left,-s.top,o[0],o[1]),G(Y,{background:l,themeBackground:d,hasBackgroundGraphics:h,x:-s.left,y:-s.top,width:o[0],height:o[1]}),C&&r.applyDecay(),T&&r.applyPulse(b),P&&r.applyThresholds(b),!1!==A&&r.applyTopologyDiff(b),ie&&(Y.globalAlpha=W?.dimOpacity??.5),Q({context:Y,nodes:r.sceneEdges,renderMode:u,pixelRatio:e,paintBuiltIn:e=>function(e,t){for(let r of t)switch(r.type){case"bezier":f(e,r);break;case"line":m(e,r);break;case"ribbon":v(e,r);break;case"curved":k(e,r)}}(Y,e)}),Q({context:Y,nodes:r.sceneNodes,renderMode:u,pixelRatio:e,paintBuiltIn:e=>{let t=e;(function(e,t){for(let r of t){if("rect"!==r.type)continue;let t=r;0>=t.w||0>=t.h||(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),ft(e,t.style,"#007bff",()=>e.fillRect(t.x,t.y,t.w,t.h)),mt(e,t.style,()=>e.strokeRect(t.x,t.y,t.w,t.h)),ce(e,t),e.restore())}})(Y,t),function(e,t){for(let r of t){if("circle"!==r.type)continue;let t=r;0>=t.r||(e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),e.beginPath(),e.arc(t.cx,t.cy,t.r,0,2*Math.PI),ft(e,t.style,"#007bff",()=>e.fill()),mt(e,t.style,()=>e.stroke()),de(e,t),e.restore())}}(Y,t),function(e,t){for(let r of t){if("arc"!==r.type)continue;let t=r;e.save(),void 0!==t.style.opacity&&(e.globalAlpha=t.style.opacity),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(),ft(e,t.style,"#007bff",()=>e.fill()),mt(e,t.style,()=>e.stroke()),e.restore()}}(Y,t),R(Y,t),E(Y,t)}}),J&&!ie){let e=r.edgesArray;if(e.length>0){!function(e,t,r,i,o=Math.random){let s=i.spawnRate??.1,n=i.maxPerEdge??50;for(let i=0;t.length>i;i++){let a=t[i];if(!a.bezier||e.countForEdge(i)>=n)continue;let l=a.value*s*r*(a.bezier.circular?.3:1),d=Math.floor(l),c=l-d,u=d;o()<c&&u++;for(let t=0;u>t&&e.countForEdge(i)<n;t++)e.spawn(i,o)}}(r.particlePool,e,j,D,_);let t,i=.5*(D.speedMultiplier??1);if(D.proportionalSpeed){let r=e.reduce((e,t)=>Math.max(e,t.value||1),1);t=e.map(e=>.3+(e.value||1)/r*1.7)}r.particlePool.step(j,i,e,t),function(e,t,r,i,o){let s=i.radius??3;e.globalAlpha=i.opacity??.7;for(let n=0;t.particles.length>n;n++){let a=t.particles[n];if(!a.active)continue;let l,d=r[a.edgeIndex];d&&(l="string"==typeof i.color&&"inherit"!==i.color?i.color:o(d),e.fillStyle=vt(e,l)||l,e.beginPath(),e.arc(a.x,a.y,s,0,2*Math.PI),e.fill())}e.globalAlpha=1}(Y,r.particlePool,e,D,I)}}ie&&(Y.globalAlpha=1)}y.current=!1,Z&&t.setAttribute("aria-label",Te(r.sceneNodes?.length??0,r.sceneEdges?.length??0,"Network chart"));let oe=Z||L.current;!oe||!V&&33>b-M.current?L.current=!!oe:(B(e=>e+1),M.current=b,L.current=!1),(S||$||null!=r.transition||K||r.hasActivePulses||r.hasActiveThresholds||!1!==A&&r.hasActiveTopologyDiff||L.current)&&O()}({canvas:e,store:t,sceneRevisionDiagnostics:ui.current,size:Ir,margin:Lr,adjustedWidth:Mr,adjustedHeight:Br,background:ut,themeBackground:Qr,maxDevicePixelRatio:yt,renderMode:_e,hasBackgroundGraphics:!(!Kt&&!t.customLayoutBackgrounds),dirtyRef:Tr,resolutionDirtyRef:zi,lastFrameTimeRef:ni,now:Hr.now(),random:Hr.random,reducedMotion:!!Wr.current,showParticles:ye,isContinuous:Hi,animate:Jt,decay:Ut,pulse:qt,thresholds:lr,staleness:tr,particleStyle:ri,getParticleColor:Xi,pendingAnnotationFrameRef:li,lastAnnotationFrameTimeRef:ai,setAnnotationFrame:vi,scheduleNextFrame:()=>{Xr()},syncColorMap:()=>Ii(t),onSceneOrStyleChange:({inventoryChanged:r,geometryChanged:i})=>{var o;r&&(w(Ei.current,t.sceneNodes,t.sceneEdges)||Je(e)),(Ei.current.nodes||Ei.current.edges)&&(r||i)&&Ve((o={canvas:e,pointer:uo.current,store:t,margin:Lr,width:Mr,height:Br,geometryMoved:i,cursorInventory:Ei.current}).canvas,o.pointer,e=>{let t=x({clientX:e.clientX,clientY:e.clientY,canvasRect:o.canvas.getBoundingClientRect(),margin:o.margin,adjustedWidth:o.width,adjustedHeight:o.height,sceneNodes:o.store.sceneNodes,sceneEdges:o.store.sceneEdges,nodeQuadtree:o.geometryMoved?null:o.store.nodeQuadtree,maxNodeRadius:o.geometryMoved?0:o.store.maxNodeRadius,includeEdges:o.cursorInventory.edges});return"hit"===t.kind?Ze(t.mark):void 0})}})},it(Oi),se(tr,di,Tr,Xr,Hr.now,ki,bi);let bo=gt&&yi?xr(ve,{x:yi.x,y:yi.y,containerWidth:Mr,containerHeight:Br,margin:Lr,className:"stream-network-tooltip",zIndex:2,children:pt?pt(yi):xr(g,{data:yi})}):null;if(Ye||!Ur&&qr)return xr(y,{props:e,store:di.current,responsiveRef:Dr,size:Ir,margin:Lr,adjustedWidth:Mr,adjustedHeight:Br,surfaceBackground:Kr,resolvedBackground:Gr,resolvedForeground:Vr});let _o=di.current;return wr("div",{ref:Dr,className:"stream-network-frame"+(dt?" "+dt:""),role:"group","aria-label":cr||("string"==typeof Gt?Gt:"Network chart"),tabIndex:0,"aria-busy":_i||void 0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:et?"100%":Ir[0],height:tt?"100%":Ir[1],overflow:"visible"},onKeyDown:vo,children:["production"!==process.env.NODE_ENV&&di.current&&xr(xe,{store:di.current,diagnostics:ui.current}),dr&&wr(pe,{accessibleTable:dr,children:[xr(Se,{tableId:Fr}),xr(be,{nodes:_o?.sceneNodes??[],edges:_o?.sceneEdges??[],chartType:"Network chart",tableId:Fr,chartTitle:"string"==typeof Gt?Gt:void 0})]}),xr(we,{summary:ur}),xr(fe,{hoverPoint:yi&&{data:("edge"===yi.nodeOrEdge?di.current?.sceneEdges:di.current?.sceneNodes)?.find(e=>e.datum===yi.data)?.accessibleDatum??yi.data}}),wr("div",{role:"img","aria-label":cr||("string"==typeof Gt?Gt:"Network chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:ko,onMouseLeave:co,onClick:bt||_t?go:void 0,children:[_i&&!1!==X&&xr("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:Ke(!0,Ir[0],Ir[1],X)}),xr(me,{size:Ir,margin:Lr,backdropFill:Kr??void 0,overflowVisible:!0,children:I(Gr,_o?.customLayoutBackgrounds)}),xr("canvas",{ref:Oi,"aria-label":Te(_o?.sceneNodes?.length??0,_o?.sceneEdges?.length??0,"Network chart"),style:{position:"absolute",top:0,left:0}}),xr(u,{width:Mr,height:Br,totalWidth:Ir[0],totalHeight:Ir[1],margin:Lr,labels:_o?.labels||[],sceneNodes:_o?.sceneNodes,title:Gt,description:cr,legend:Ot,legendPosition:zt,legendLayout:Ft,legendHoverBehavior:Yt,legendClickBehavior:jt,legendHighlightedCategory:Xt,legendIsolatedCategories:Ht,foregroundGraphics:I(Vr,le(di.current?.customLayoutOverlays,Rr??null)),annotations:It,onAnnotationActivate:Lt,onObservation:Et??_t,chartId:Tt,chartType:"StreamNetworkFrame",autoPlaceAnnotations:Mt,svgAnnotationRules:Bt,annotationFrame:mi}),xr(h,{marks:_o?.customLayoutHtmlMarks,margin:Lr,selection:Rr??null}),xr(ke,{active:po.current>=0,hoverPoint:yi,margin:Lr,size:Ir,shape:fo.current?.shape,width:fo.current?.w,height:fo.current?.h}),bo,tr?.showBadge&&xr(P,{isStale:ki,position:tr.badgePosition})]})]})}));Ar.displayName="StreamNetworkFrame";var Cr=Ar;export{r as registerLayoutPlugin,Cr as StreamNetworkFrame_default};
@@ -1 +0,0 @@
1
- function e({isPushMode:e,colorBy:y,colorScheme:u,showLegend:h,legendPosition:p="right",trackCategoryDomain:C=!0,registerLinkedCategories:S=!0}){let[w,A]=c(0),P=t(),b=n(),j=i(),v=e&&!!y&&(C||j),D="function"==typeof y?m:y,M=f(()=>({lifecycle:{colorByDomainKey:D,isPushMode:e,shouldTrackCategoryDomain:v},categories:new Set,ordered:[]}),[D,e,v]),k=d(e=>y?("function"==typeof y?y(e):e[y])+"":null,[y]),B=d(e=>{if(!v)return;let r=!1;for(let t of e){if(!t||"object"!=typeof t)continue;let e=k(t);null!=e&&!M.categories.has(e)&&(M.categories.add(e),M.ordered.push(e),r=!0)}r&&A(e=>e+1)},[M,k,v]),L=d(e=>{if(!v)return;let r=Array.from(new Set(e.map(String))),t=M.ordered;t.length===r.length&&t.every((e,t)=>e===r[t])||(M.categories=new Set(r),M.ordered=r,A(e=>e+1))},[M,v]),K=d(e=>r=>{B([r]),e(r)},[B]),T=d(e=>r=>{B(r),e(r)},[B]),_=d(()=>{M.categories=new Set,M.ordered=[],A(e=>e+1)},[M]),x=f(()=>v?[...M.ordered]:[],[M,v,w]);o(S&&e&&y?x:[]);let F=f(()=>{if(!e||!y||!1===h)return;let t=M.ordered;if(0===t.length)return;let o=Array.isArray(u)&&u.length>0||"string"==typeof u&&u.length>0?u:b&&b.length>0?b:a,i="string"==typeof y?y:"__streamCat",n=t.map(e=>({[i]:e})),c=g(n,i,o),d=u&&"object"==typeof u&&!Array.isArray(u)?u:void 0;return r({data:n,colorBy:i,colorScale:e=>(P?l(P,e):void 0)??(d?l(d,e):void 0)??c(e)??"#999",getColor:s})},[e,y,h,u,P,b,w,M]),G=f(()=>{if(F)return"right"===p?{right:110}:"left"===p?{left:110}:"top"===p?{top:50}:"bottom"===p?{bottom:80}:{right:110}},[F,p]);return{wrapPush:K,wrapPushMany:T,resetCategories:_,categories:x,categoryDomainProps:v?{legendCategoryAccessor:y,onCategoriesChange:L}:{},streamingLegend:F,streamingMarginAdjust:G}}import{createLegend as r,useCategoryColors as t,useLinkedChartCategories as o,useLinkedChartCategoryRegistryActive as i,useThemeCategorical as n}from"./c-ODG6TFSY.min.js";import{STREAMING_PALETTE as a,createColorScale as g,getColor as s,resolveExplicitColor as l}from"./c-CPV4N35K.min.js";import{useState as c,useCallback as d,useMemo as f}from"react";var m=Symbol("streaming-function-color-domain");export{e as useStreamingLegend};