semiotic 3.12.0 → 3.12.1

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 (256) hide show
  1. package/README.md +50 -46
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/diagnose-operation.js +3 -3
  5. package/ai/dist/mcp-server.js +1 -1
  6. package/ai/reference.md +15 -3
  7. package/ai/schema.json +908 -96
  8. package/ai/surface-manifest.json +1 -1
  9. package/ai/task-packets/compare-category-totals.json +5 -5
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +5 -5
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +5 -5
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/c-27DCB5T6.min.js +7 -7
  17. package/dist/c-2CKIGFD2.min.js +1 -1
  18. package/dist/c-3FATLOH4.min.js +1 -0
  19. package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
  20. package/dist/c-5FUOKMH6.min.js +7 -0
  21. package/dist/c-AAIPWVQ5.min.js +6 -6
  22. package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
  23. package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
  24. package/dist/c-C67QDKTU.min.js +34 -0
  25. package/dist/c-F76M77YC.min.js +1 -0
  26. package/dist/c-FEVXPKQH.min.js +1 -1
  27. package/dist/c-G42WVQO2.min.js +1 -0
  28. package/dist/c-G5A3YWTN.min.js +66 -0
  29. package/dist/c-H4HVKBU3.min.js +1 -0
  30. package/dist/c-HU3ASFKT.min.js +1 -0
  31. package/dist/c-I4FYCVJB.min.js +391 -0
  32. package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
  33. package/dist/c-IE5EBBP6.min.js +110 -0
  34. package/dist/c-IGONIKZL.min.js +1 -0
  35. package/dist/c-IKPM53JH.min.js +1 -0
  36. package/dist/c-IU4QZ7Y5.min.js +1 -1
  37. package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
  38. package/dist/c-KWJIBJ4R.min.js +1 -0
  39. package/dist/c-LIMFU6RD.min.js +1 -0
  40. package/dist/c-M4T43G76.min.js +1 -0
  41. package/dist/c-M7QUZZCE.min.js +1 -1
  42. package/dist/c-NVSINXE5.min.js +1 -0
  43. package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
  44. package/dist/c-O5GU2R5W.min.js +1 -0
  45. package/dist/c-OC7GNXGZ.min.js +1 -0
  46. package/dist/c-OV5F3DQP.min.js +1 -0
  47. package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
  48. package/dist/c-Q5LZRQGD.min.js +1 -0
  49. package/dist/c-QP3PXK3N.min.js +1 -0
  50. package/dist/c-SGZ7ZD2I.min.js +51 -0
  51. package/dist/c-SSKV5JPW.min.js +1 -1
  52. package/dist/c-THWTHWXU.min.js +37 -0
  53. package/dist/c-TRMNDRC4.min.js +41 -0
  54. package/dist/c-UP656CST.min.js +1 -1
  55. package/dist/c-USYOK5OX.min.js +1 -0
  56. package/dist/c-VI753KBO.min.js +1 -0
  57. package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
  58. package/dist/c-VSOQPII4.min.js +5 -5
  59. package/dist/c-WGDM4ZRP.min.js +26 -0
  60. package/dist/c-XCV7VUU3.min.js +87 -0
  61. package/dist/c-XGDZPYBI.min.js +1 -0
  62. package/dist/c-XI6CLZII.min.js +1 -0
  63. package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
  64. package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
  65. package/dist/c-YWZBFG63.min.js +1 -0
  66. package/dist/c-ZMYO3NZU.min.js +2 -0
  67. package/dist/c-ZO36H5VH.min.js +48 -0
  68. package/dist/components/LinkedCharts.d.ts +6 -1
  69. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  70. package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
  71. package/dist/components/bundling/semioticVite.d.ts +24 -0
  72. package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
  73. package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
  74. package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
  75. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  76. package/dist/components/charts/shared/chartSize.d.ts +58 -0
  77. package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
  78. package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
  79. package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
  80. package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
  81. package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
  82. package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
  83. package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
  84. package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
  85. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  86. package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
  87. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  88. package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
  89. package/dist/components/charts/value/BigNumber.d.ts +0 -8
  90. package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
  91. package/dist/components/realtime/BinAccumulator.d.ts +5 -2
  92. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
  93. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
  94. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
  95. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
  96. package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
  97. package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
  98. package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
  99. package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
  100. package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
  101. package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
  102. package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
  103. package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
  104. package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
  105. package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
  106. package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
  107. package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
  108. package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
  109. package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
  110. package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
  111. package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
  112. package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
  113. package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
  114. package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
  115. package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
  116. package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
  117. package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
  118. package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
  119. package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
  120. package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
  121. package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
  122. package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
  123. package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
  124. package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
  125. package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
  126. package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
  127. package/dist/components/recipes/lineageDag.d.ts +4 -0
  128. package/dist/components/recipes/recipeUtils.d.ts +2 -0
  129. package/dist/components/recipes/transitDiagram.d.ts +2 -61
  130. package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
  131. package/dist/components/semiotic-ai.d.ts +2 -0
  132. package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
  133. package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
  134. package/dist/components/semiotic-geo.d.ts +1 -1
  135. package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
  136. package/dist/components/semiotic-network.d.ts +1 -1
  137. package/dist/components/semiotic-ordinal.d.ts +1 -1
  138. package/dist/components/semiotic-physics.d.ts +1 -1
  139. package/dist/components/semiotic-realtime-core.d.ts +1 -1
  140. package/dist/components/semiotic-realtime-react.d.ts +2 -0
  141. package/dist/components/semiotic-utils-core.d.ts +3 -1
  142. package/dist/components/semiotic-vite.d.ts +2 -0
  143. package/dist/components/semiotic-xy.d.ts +3 -1
  144. package/dist/components/semiotic.d.ts +3 -1
  145. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  146. package/dist/components/server/serverChartConfigShared.d.ts +2 -0
  147. package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
  148. package/dist/components/store/themeCore.d.ts +2 -0
  149. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
  150. package/dist/components/stream/hoverUtils.d.ts +5 -0
  151. package/dist/components/stream/networkCustomLayout.d.ts +3 -0
  152. package/dist/components/stream/networkPerspective.d.ts +2 -0
  153. package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
  154. package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
  155. package/dist/components/stream/networkSceneTypes.d.ts +4 -0
  156. package/dist/components/stream/networkTypes.d.ts +2 -0
  157. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  158. package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
  159. package/dist/components/stream/types.d.ts +2 -0
  160. package/dist/components/stream/useFrame.d.ts +2 -0
  161. package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
  162. package/dist/controls.module.min.js +31 -31
  163. package/dist/geo.min.js +150 -150
  164. package/dist/geo.module.min.js +31 -31
  165. package/dist/network.module.min.js +1 -1
  166. package/dist/ordinal.module.min.js +1 -1
  167. package/dist/physics.module.min.js +1 -1
  168. package/dist/rough.module.min.js +1 -1
  169. package/dist/semiotic-ai-core.min.js +1 -1
  170. package/dist/semiotic-ai-core.module.min.js +1 -1
  171. package/dist/semiotic-ai.d.ts +2 -0
  172. package/dist/semiotic-ai.module.min.js +13 -13
  173. package/dist/semiotic-artifact-react.module.min.js +4 -4
  174. package/dist/semiotic-artifact.min.js +1 -1
  175. package/dist/semiotic-artifact.module.min.js +1 -1
  176. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  177. package/dist/semiotic-atlas.module.min.js +10 -12
  178. package/dist/semiotic-client-cjs-shared.min.js +1078 -925
  179. package/dist/semiotic-client-glyph.module.min.js +2 -2
  180. package/dist/semiotic-client-shared.module.min.js +1 -1
  181. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
  182. package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
  183. package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
  184. package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
  185. package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
  186. package/dist/semiotic-experimental-network-resolution.min.js +2 -0
  187. package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
  188. package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
  189. package/dist/semiotic-geo.d.ts +1 -1
  190. package/dist/semiotic-line.module.min.js +1 -1
  191. package/dist/semiotic-network-perspective-core.d.ts +6 -0
  192. package/dist/semiotic-network-perspective-core.min.js +1 -0
  193. package/dist/semiotic-network-perspective-core.module.min.js +1 -0
  194. package/dist/semiotic-network-perspective.module.min.js +1 -1
  195. package/dist/semiotic-network-placement.min.js +4 -0
  196. package/dist/semiotic-network-placement.module.min.js +4 -0
  197. package/dist/semiotic-network-zoom.module.min.js +1 -1
  198. package/dist/semiotic-network.d.ts +1 -1
  199. package/dist/semiotic-ordinal.d.ts +1 -1
  200. package/dist/semiotic-physics.d.ts +1 -1
  201. package/dist/semiotic-realtime-core.d.ts +1 -1
  202. package/dist/semiotic-realtime-core.module.min.js +1 -1
  203. package/dist/semiotic-realtime-react.d.ts +2 -0
  204. package/dist/semiotic-realtime-react.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
  206. package/dist/semiotic-recipes-core.module.min.js +75 -76
  207. package/dist/semiotic-server-edge-node.module.min.js +391 -392
  208. package/dist/semiotic-server-edge.min.js +387 -388
  209. package/dist/semiotic-server-edge.module.min.js +371 -371
  210. package/dist/semiotic-server-node.min.js +387 -388
  211. package/dist/semiotic-server-node.module.min.js +1 -1
  212. package/dist/semiotic-utils-core.d.ts +3 -1
  213. package/dist/semiotic-utils-core.min.js +12 -11
  214. package/dist/semiotic-utils-core.module.min.js +12 -11
  215. package/dist/semiotic-value.module.min.js +4 -4
  216. package/dist/semiotic-vite.d.ts +2 -0
  217. package/dist/semiotic-vite.min.js +1 -0
  218. package/dist/semiotic-vite.module.min.js +1 -0
  219. package/dist/semiotic-xy.d.ts +3 -1
  220. package/dist/semiotic.d.ts +3 -1
  221. package/dist/semiotic.module.min.js +12 -12
  222. package/dist/server.min.js +387 -388
  223. package/dist/server.module.min.js +1 -1
  224. package/dist/xy.module.min.js +1 -1
  225. package/package.json +42 -13
  226. package/dist/c-2AB65V3L.min.js +0 -1
  227. package/dist/c-2U5JMOPN.min.js +0 -88
  228. package/dist/c-3DCTIRW4.min.js +0 -1
  229. package/dist/c-3OKFRTYM.min.js +0 -1
  230. package/dist/c-3VZHOPFW.min.js +0 -1
  231. package/dist/c-4ZSQIBC7.min.js +0 -1
  232. package/dist/c-5M4RUS7V.min.js +0 -34
  233. package/dist/c-6O5WWP7F.min.js +0 -1
  234. package/dist/c-73TOIYIW.min.js +0 -48
  235. package/dist/c-AE4M7BWH.min.js +0 -1
  236. package/dist/c-AEIK2NFW.min.js +0 -30
  237. package/dist/c-AFQSEIZ4.min.js +0 -4
  238. package/dist/c-BBX7DVVB.min.js +0 -51
  239. package/dist/c-CNYFCSG4.min.js +0 -5
  240. package/dist/c-E6QH2WYE.min.js +0 -1
  241. package/dist/c-GOMQWQJR.min.js +0 -1
  242. package/dist/c-GTYG4PDT.min.js +0 -1
  243. package/dist/c-H23GIKTK.min.js +0 -1
  244. package/dist/c-HQLUUSRJ.min.js +0 -1
  245. package/dist/c-HXUOFDSD.min.js +0 -64
  246. package/dist/c-L3LKYOLK.min.js +0 -1
  247. package/dist/c-MIKDFGKH.min.js +0 -1
  248. package/dist/c-OYSPTIAG.min.js +0 -1
  249. package/dist/c-PWPJNYQP.min.js +0 -1
  250. package/dist/c-QZ5SWKHC.min.js +0 -392
  251. package/dist/c-RXJH4IRX.min.js +0 -41
  252. package/dist/c-SN2D6QMH.min.js +0 -1
  253. package/dist/c-U5YGK6HL.min.js +0 -1
  254. package/dist/c-VIN5ASK2.min.js +0 -37
  255. package/dist/c-XZ3GASUJ.min.js +0 -1
  256. package/dist/c-ZLZZTH4I.min.js +0 -118
@@ -1 +1 @@
1
- import{a as e,b as a,c as s,d as r,e as i,f as t,g as n,h as o,i as m,j as d,k as S,l as c,m as G,n as T,o as h,p as V,q as p}from"./c-QZ5SWKHC.min.js";export{G as generateFrameSVGs,T as generateFrameSequence,h as generatePhysicsFrameSVGs,m as renderChart,d as renderChartWithEvidence,c as renderDashboard,n as renderGeoToStaticSVG,t as renderNetworkToStaticSVG,i as renderOrdinalToStaticSVG,p as renderPhysicsToAnimatedGif,V as renderToAnimatedGif,S as renderToImage,s as renderToStaticSVG,r as renderXYToStaticSVG,e as resolveTheme,o as serializeSvgPrecision,a as themeStyles};
1
+ import{a as e,b as a,c as s,d as r,e as i,f as t,g as n,h as o,i as m,j as d,k as c,l as S,m as G,n as h,o as T,p as V,q as p}from"./c-I4FYCVJB.min.js";export{G as generateFrameSVGs,h as generateFrameSequence,T as generatePhysicsFrameSVGs,m as renderChart,d as renderChartWithEvidence,S as renderDashboard,n as renderGeoToStaticSVG,t as renderNetworkToStaticSVG,i as renderOrdinalToStaticSVG,p as renderPhysicsToAnimatedGif,V as renderToAnimatedGif,c as renderToImage,s as renderToStaticSVG,r as renderXYToStaticSVG,e as resolveTheme,o as serializeSvgPrecision,a as themeStyles};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as s,b as a,e as i}from"./c-E3MKTERA.min.js";import{a as m}from"./c-GTYG4PDT.min.js";import{a as t,b as o,c as r,e as n,f as p,g as e,h as c,i as j,j as l,k as C,l as h,m as D,o as T,p as S,q as B,r as M}from"./c-BBX7DVVB.min.js";import{e as R}from"./c-3VZHOPFW.min.js";import{f as u}from"./c-HXUOFDSD.min.js";import{b as O}from"./c-IU4QZ7Y5.min.js";import{Ba as P,Ca as K,Da as F,Lb as L,Mb as U,Ob as W,Pa as A,Pb as E,Qa as V,Qb as Z,Rb as f,Va as b,ob as G,pb as I,za as J}from"./c-2U5JMOPN.min.js";import{i as Q,j as Y,k as H,l as N}from"./c-SSKV5JPW.min.js";import{d as X,e as g}from"./c-RBWJFQDC.min.js";export{e as AreaChart,C as BubbleChart,p as BumpChart,B as CandlestickChart,o as ConnectedScatterplot,s as DEFAULT_HIT_RADIUS,c as DifferenceChart,l as Heatmap,R as LineChart,D as MinimapChart,S as MultiAxisLineChart,V as MultiLineTooltip,b as MultiPointTooltip,T as QuadrantChart,t as Scatterplot,h as ScatterplotMatrix,j as StackedAreaChart,u as StreamXYFrame,A as Tooltip,P as TooltipRoot,M as WaterfallChart,r as XYCustomChart,f as composeStyleRules,g as glyphExtent,X as glyphPlacement,F as hasOwnTooltipChrome,J as hasTooltipContent,Y as hatchFillId,H as hatchPatternDef,a as hitTargetPoint,i as hitTargetRect,Q as isHatchFill,L as makeRuleValueResolver,U as makeXYRuleContext,K as markTooltipChrome,W as matchesThreshold,n as rankBumpData,m as registerBuiltInXYPlugins,I as resolveResponsiveRules,Z as resolveStyleRules,N as resolveSvgFill,G as responsiveRuleMatches,E as ruleMatches,O as useCustomLayoutSelection};
2
+ import{a as s,b as a,e as i}from"./c-E3MKTERA.min.js";import{a as m}from"./c-IGONIKZL.min.js";import{a as t,b as o,c as r,e as n,f as e,g as p,h as c,i as j,j as l,k as C,l as h,m as S,o as u,p as T,q as L,r as M}from"./c-SGZ7ZD2I.min.js";import{e as D}from"./c-IKPM53JH.min.js";import{f as I}from"./c-G5A3YWTN.min.js";import{b as K}from"./c-IU4QZ7Y5.min.js";import{Ib as R,Jb as U,La as P,Lb as A,Ma as O,Mb as F,Nb as Z,Ob as f,Ra as B,S as N,T as V,kb as b,lb as W}from"./c-XCV7VUU3.min.js";import{i as Y,j as E,k as G,l as J}from"./c-SSKV5JPW.min.js";import{d as X,e as k}from"./c-RBWJFQDC.min.js";import{k as H,o as d,p as g,q as v}from"./c-5FUOKMH6.min.js";export{p as AreaChart,C as BubbleChart,e as BumpChart,L as CandlestickChart,o as ConnectedScatterplot,s as DEFAULT_HIT_RADIUS,c as DifferenceChart,l as Heatmap,D as LineChart,S as MinimapChart,T as MultiAxisLineChart,O as MultiLineTooltip,B as MultiPointTooltip,u as QuadrantChart,t as Scatterplot,h as ScatterplotMatrix,j as StackedAreaChart,I as StreamXYFrame,P as Tooltip,d as TooltipRoot,M as WaterfallChart,r as XYCustomChart,f as composeStyleRules,k as glyphExtent,X as glyphPlacement,v as hasOwnTooltipChrome,H as hasTooltipContent,E as hatchFillId,G as hatchPatternDef,a as hitTargetPoint,i as hitTargetRect,Y as isHatchFill,R as makeRuleValueResolver,U as makeXYRuleContext,g as markTooltipChrome,A as matchesThreshold,n as rankBumpData,m as registerBuiltInXYPlugins,W as resolveResponsiveRules,Z as resolveStyleRules,J as resolveSvgFill,b as responsiveRuleMatches,F as ruleMatches,N as useCrosshairPosition,K as useCustomLayoutSelection,V as useLinkedCrosshair};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semiotic",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
4
4
  "mcpName": "io.github.nteract/semiotic",
5
5
  "description": "Verified generative visualization for React and agents, with deterministic chart validation, repair, rendering evidence, and MCP.",
6
6
  "main": "dist/semiotic.min.js",
@@ -51,6 +51,18 @@
51
51
  "require": "./dist/semiotic-atlas-core.min.js",
52
52
  "default": "./dist/semiotic-atlas-core.module.min.js"
53
53
  },
54
+ "./experimental/network-resolution": {
55
+ "types": "./dist/semiotic-experimental-network-resolution.d.ts",
56
+ "import": "./dist/semiotic-experimental-network-resolution.module.min.js",
57
+ "require": "./dist/semiotic-experimental-network-resolution.min.js",
58
+ "default": "./dist/semiotic-experimental-network-resolution.module.min.js"
59
+ },
60
+ "./experimental/network-resolution/react": {
61
+ "types": "./dist/semiotic-experimental-network-resolution-react.d.ts",
62
+ "import": "./dist/semiotic-experimental-network-resolution-react.module.min.js",
63
+ "require": "./dist/semiotic-experimental-network-resolution-react.min.js",
64
+ "default": "./dist/semiotic-experimental-network-resolution-react.module.min.js"
65
+ },
54
66
  "./network": {
55
67
  "types": "./dist/semiotic-network.d.ts",
56
68
  "import": "./dist/network.module.min.js",
@@ -69,6 +81,12 @@
69
81
  "require": "./dist/semiotic-network-perspective.min.js",
70
82
  "default": "./dist/semiotic-network-perspective.module.min.js"
71
83
  },
84
+ "./network/perspective/core": {
85
+ "types": "./dist/semiotic-network-perspective-core.d.ts",
86
+ "import": "./dist/semiotic-network-perspective-core.module.min.js",
87
+ "require": "./dist/semiotic-network-perspective-core.min.js",
88
+ "default": "./dist/semiotic-network-perspective-core.module.min.js"
89
+ },
72
90
  "./realtime": {
73
91
  "types": "./dist/semiotic-realtime.d.ts",
74
92
  "import": "./dist/realtime.module.min.js",
@@ -269,6 +287,12 @@
269
287
  "require": "./dist/semiotic-value.min.js",
270
288
  "default": "./dist/semiotic-value.module.min.js"
271
289
  },
290
+ "./vite": {
291
+ "types": "./dist/semiotic-vite.d.ts",
292
+ "import": "./dist/semiotic-vite.module.min.js",
293
+ "require": "./dist/semiotic-vite.min.js",
294
+ "default": "./dist/semiotic-vite.module.min.js"
295
+ },
272
296
  "./spec/*": "./spec/*",
273
297
  "./package.json": "./package.json"
274
298
  },
@@ -335,7 +359,7 @@
335
359
  "check:browser-baseline": "node scripts/browser-baseline.mjs --check",
336
360
  "print:browser-baseline": "node scripts/browser-baseline.mjs --print",
337
361
  "test:browser-baseline": "node --test scripts/browser-baseline.test.mjs",
338
- "test:release-infrastructure": "node --test scripts/bench-manifest.test.mjs scripts/bench-results.test.mjs scripts/browser-baseline.test.mjs scripts/check-docs-entry-contract.test.mjs scripts/machine-baseline.test.mjs scripts/npm-trusted-publisher.test.mjs scripts/prerender-determinism.test.mjs scripts/risk-weighted-coverage.test.mjs scripts/vitest-projects.test.mjs",
362
+ "test:release-infrastructure": "node --test scripts/bench-manifest.test.mjs scripts/bench-results.test.mjs scripts/browser-baseline.test.mjs scripts/check-docs-entry-contract.test.mjs scripts/machine-baseline.test.mjs scripts/npm-trusted-publisher.test.mjs scripts/prerender-determinism.test.mjs scripts/risk-weighted-coverage.test.mjs scripts/vitest-projects.test.mjs && npm run test:release-preflight",
339
363
  "baseline:stream-file-sizes": "node scripts/stream-file-size-ratchet.mjs --write",
340
364
  "report:stream-file-sizes": "node scripts/stream-file-size-ratchet.mjs",
341
365
  "test:stream-file-size-ratchet": "node --test scripts/stream-file-size-ratchet.test.mjs",
@@ -385,7 +409,7 @@
385
409
  "typescript:tests": "node scripts/check-test-types.mjs",
386
410
  "typescript:tests:raw": "tsc -p tsconfig.tests.json --noEmit --pretty false",
387
411
  "typescript:mcp": "tsc -p tsconfig.mcp.json --noEmit",
388
- "size": "node --test scripts/lib/minify-library-chunk.test.mjs scripts/lib/strip-pure-bare-imports.test.mjs scripts/network-zoom-bundle.test.mjs scripts/treeshake-isolation.test.mjs && node scripts/check-entry-graph-size.mjs && node scripts/check-multi-import-size.mjs",
412
+ "size": "node --test scripts/lib/minify-library-chunk.test.mjs scripts/lib/strip-pure-bare-imports.test.mjs scripts/network-zoom-bundle.test.mjs scripts/treeshake-isolation.test.mjs scripts/network-perspective-package.test.mjs && node scripts/check-entry-graph-size.mjs && node scripts/check-multi-import-size.mjs",
389
413
  "check:network-zoom-bundle": "node --test scripts/network-zoom-bundle.test.mjs",
390
414
  "check:treeshake-isolation": "node --test scripts/treeshake-isolation.test.mjs",
391
415
  "check:entry-graph-size": "node scripts/check-entry-graph-size.mjs",
@@ -423,6 +447,7 @@
423
447
  "eval:ai": "node scripts/run-ai-evals.mjs",
424
448
  "eval:ai:openai": "node scripts/run-openai-ai-evals.mjs",
425
449
  "eval:ai:orcarouter": "node scripts/run-openai-ai-evals.mjs --provider=orcarouter",
450
+ "eval:ai:cheaperinference": "node scripts/run-openai-ai-evals.mjs --provider=cheaperinference",
426
451
  "eval:ai:trials": "node scripts/summarize-openai-ai-eval-trials.mjs",
427
452
  "test:ai-evals": "node --test scripts/ai-eval-scoring.test.mjs scripts/ai-eval-report-summary.test.mjs scripts/run-openai-ai-evals.test.mjs scripts/summarize-openai-ai-eval-trials.test.mjs",
428
453
  "test:ai:openai": "node --test scripts/run-openai-ai-evals.test.mjs",
@@ -470,7 +495,7 @@
470
495
  "check:cold-consumer": "node scripts/measure-cold-consumer.mjs --check",
471
496
  "check:d3-packaging": "node scripts/check-d3-packaging.mjs",
472
497
  "measure:d3-packaging": "node scripts/measure-d3-packaging.mjs",
473
- "check:preflight": "npm run check:router-alignment && npm run check:playwright-alignment && npm run lint && npm run check:custom-lints && npm run check:file-size && npm run check:test-quality && npm run check:chart-specs && npm run check:artifact-contract && npm run check:capabilities && npm run check:visual-baseline-capabilities && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:docs-playground-controls && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run check:surface && npm run check:ai-surface && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:protected-doc-boundaries",
498
+ "check:preflight": "npm run check:ai-tasks && npm run check:adoption-evals && npm run check:test-discovery && npm run check:router-alignment && npm run check:playwright-alignment && npm run lint && npm run check:custom-lints && npm run check:file-size && npm run check:test-quality && npm run check:chart-specs && npm run check:artifact-contract && npm run check:capabilities && npm run check:visual-baseline-capabilities && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:docs-playground-controls && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run check:surface && npm run check:ai-surface && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:protected-doc-boundaries",
474
499
  "test:production-semantics:from-dist": "node --test scripts/production-semantics.test.mjs scripts/data-semantics-artifacts.test.mjs scripts/statistical-artifacts.test.mjs scripts/aggregation-artifacts.test.mjs scripts/ordinal-domain-artifacts.test.mjs scripts/resize-artifacts.test.mjs scripts/hierarchy-artifacts.test.mjs",
475
500
  "check:package-contracts:from-dist": "npm run test:production-semantics:from-dist && npm run check:package-surface && npm run check:bundle-sizes && npm run check:cold-consumer && npm run size",
476
501
  "check:package-contracts": "npm run dist:prod && npm run check:api-surface && npm run check:package-contracts:from-dist",
@@ -481,15 +506,18 @@
481
506
  "check:readme-dashboard": "npx tsx scripts/generate-readme-dashboard.tsx --check",
482
507
  "check:release-version-alignment": "node scripts/check-release-version-alignment.mjs",
483
508
  "check:typedoc": "typedoc --emit none",
484
- "release:check": "npm run check:release-version-alignment && npm run check:playwright-alignment && npm run lint && npm run check:file-size && npm run typescript && npm run typescript:tests && npm run typescript:mcp && npm run test:examples:source && npm run check:mcp-bundle && npm run build:mcp && npm run test:coverage && npm run test:artifact-cli:from-dist && npm run test:protected-doc-boundaries && npm run test:release-infrastructure && npm run check:chart-specs && npm run check:artifact-contract && npm run check:ai-schema && npm run check:capabilities && npm run check:capability-coverage && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:docs-playground-controls && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run test:mcp-registry-live && npm run check:surface && npm run check:ai-surface && npm run check:agent-skill && npm run check:ai-tasks && npm run test:adoption-evals && npm run check:adoption-evals && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:test-quality && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:typedoc && npm run check:website-build && npm run check:package-surface && npm run check:api-surface && npm run check:api-compat && npm run check:protected-doc-boundaries && npm run check:readme-dashboard && npm run check:bundle-sizes && npm run size && npm run check:pack && npm run check:consumer-compatibility && npm pack --dry-run",
485
- "prepublishOnly": "npm run check:release-version-alignment && npm run check:playwright-alignment && npm run lint && npm run check:file-size && npm run typescript && npm run typescript:tests && npm run typescript:mcp && npm run test:examples:source && npm run check:mcp-bundle && npm run build:mcp && npm run test:coverage && npm run test:artifact-cli:from-dist && npm run test:protected-doc-boundaries && npm run test:release-infrastructure && npm run check:chart-specs && npm run check:artifact-contract && npm run check:ai-schema && npm run check:capabilities && npm run check:capability-coverage && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run test:mcp-registry-live && npm run check:surface && npm run check:ai-surface && npm run check:agent-skill && npm run check:ai-tasks && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:test-quality && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:typedoc && rm -rf dist && npm run check:website-build && npm run check:package-surface && npm run check:api-surface && npm run check:api-compat && npm run check:protected-doc-boundaries && npm run check:readme-dashboard && npm run check:bundle-sizes && npm run size && npm run check:consumer-compatibility",
509
+ "release:check": "npm run check:release-preflight && npm run check:release-version-alignment && npm run check:playwright-alignment && npm run lint && npm run check:file-size && npm run typescript && npm run typescript:tests && npm run typescript:mcp && npm run test:examples:source && npm run check:mcp-bundle && npm run build:mcp && npm run test:coverage && npm run test:artifact-cli:from-dist && npm run test:protected-doc-boundaries && npm run test:release-infrastructure && npm run check:chart-specs && npm run check:artifact-contract && npm run check:ai-schema && npm run check:capabilities && npm run check:capability-coverage && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:docs-playground-controls && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run test:mcp-registry-live && npm run check:surface && npm run check:ai-surface && npm run check:agent-skill && npm run check:ai-tasks && npm run test:adoption-evals && npm run check:adoption-evals && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:test-quality && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:typedoc && npm run check:website-build && npm run check:package-surface && npm run check:api-surface && npm run check:api-compat && npm run check:protected-doc-boundaries && npm run check:readme-dashboard && npm run check:bundle-sizes && npm run size && npm run check:pack && npm run check:consumer-compatibility && npm pack --dry-run",
510
+ "prepublishOnly": "npm run check:release-preflight && npm run check:release-version-alignment && npm run check:playwright-alignment && npm run lint && npm run check:file-size && npm run typescript && npm run typescript:tests && npm run typescript:mcp && npm run test:examples:source && npm run check:mcp-bundle && npm run build:mcp && npm run test:coverage && npm run test:artifact-cli:from-dist && npm run test:protected-doc-boundaries && npm run test:release-infrastructure && npm run check:chart-specs && npm run check:artifact-contract && npm run check:ai-schema && npm run check:capabilities && npm run check:capability-coverage && npm run check:docs-coverage && npm run check:docs-example-integrity && npm run check:docs-prop-tables && npm run check:llms && npm run check:blog-entries && npm run check:ai-reference-coverage && npm run check:context7 && npm run check:mcp-registry && npm run test:mcp-registry-live && npm run check:surface && npm run check:ai-surface && npm run check:agent-skill && npm run check:ai-tasks && npm run check:ai-contracts && npm run check:ai-instructions && npm run check:ssr && npm run check:test-quality && npm run check:jsdoc-coverage && npm run check:ai-examples-coverage && npm run check:typedoc && rm -rf dist && npm run check:website-build && npm run check:package-surface && npm run check:api-surface && npm run check:api-compat && npm run check:protected-doc-boundaries && npm run check:readme-dashboard && npm run check:bundle-sizes && npm run size && npm run check:consumer-compatibility",
486
511
  "check:router-alignment": "node scripts/check-router-alignment.mjs",
487
512
  "docs:ai-tasks": "node scripts/generate-ai-task-packets.mjs",
488
513
  "check:ai-tasks": "node --test scripts/ai-task-packets.test.mjs && node scripts/generate-ai-task-packets.mjs --check",
489
514
  "verify:ai-tasks": "node scripts/verify-ai-tasks.mjs",
490
515
  "prepare:adoption-evals": "node scripts/prepare-adoption-evals.mjs",
491
516
  "check:adoption-evals": "node scripts/prepare-adoption-evals.mjs --check",
492
- "test:adoption-evals": "node --test scripts/prepare-adoption-evals.test.mjs"
517
+ "test:adoption-evals": "node --test scripts/prepare-adoption-evals.test.mjs",
518
+ "check:release-preflight": "node --experimental-strip-types scripts/check-release-preflight.ts",
519
+ "test:release-preflight": "node --experimental-strip-types --test scripts/release-preflight.test.ts",
520
+ "check:test-discovery": "node --test scripts/vitest-projects.test.mjs"
493
521
  },
494
522
  "repository": {
495
523
  "type": "git",
@@ -531,7 +559,7 @@
531
559
  "@eslint/js": "^9.39.5",
532
560
  "@modelcontextprotocol/sdk": "^1.30.0",
533
561
  "@playwright/test": "1.61.1",
534
- "@size-limit/file": "^12.1.0",
562
+ "@size-limit/file": "^14.1.0",
535
563
  "@testing-library/dom": "^10.4.1",
536
564
  "@testing-library/jest-dom": "^7.0.0",
537
565
  "@testing-library/react": "^16.3.2",
@@ -544,7 +572,7 @@
544
572
  "@types/d3-interpolate": "^3.0.0",
545
573
  "@types/d3-quadtree": "^3.0.6",
546
574
  "@types/d3-scale": "^4.0.9",
547
- "@types/d3-selection": "^3.0.0",
575
+ "@types/d3-selection": "^3.0.12",
548
576
  "@types/d3-shape": "^3.1.0",
549
577
  "@types/d3-zoom": "^3.0.8",
550
578
  "@types/node": "^26.1.1",
@@ -565,7 +593,7 @@
565
593
  "eslint-plugin-react": "^7.37.5",
566
594
  "eslint-plugin-react-hooks": "^7.1.1",
567
595
  "ffmpeg-static": "^5.3.0",
568
- "globals": "^17.7.0",
596
+ "globals": "^17.13.0",
569
597
  "gofish-graphics": "^0.1.0-nightly.20260624",
570
598
  "gofish-ir": "^0.1.0-nightly.20260624",
571
599
  "marked": "^18.0.6",
@@ -578,10 +606,10 @@
578
606
  "react-router-dom": "^7.18.1",
579
607
  "roughjs": "^4.6.6",
580
608
  "seedrandom": "^3.0.5",
581
- "size-limit": "^12.1.0",
609
+ "size-limit": "^14.1.0",
582
610
  "terser": "^5.51.2",
583
611
  "tsup": "^8.5.1",
584
- "tsx": "^4.23.1",
612
+ "tsx": "^4.23.15",
585
613
  "typedoc": "^0.28.20",
586
614
  "typescript": "~6.0.3",
587
615
  "typescript-eslint": "^8.63.0",
@@ -657,6 +685,7 @@
657
685
  "overrides": {
658
686
  "esbuild": "0.28.2",
659
687
  "flatted": "3.4.2",
660
- "minimatch": ">=9.0.7"
688
+ "minimatch": ">=9.0.7",
689
+ "seroval": "1.6.8"
661
690
  }
662
691
  }
@@ -1 +0,0 @@
1
- import{a as i,b as m}from"./c-5TAXHW7I.min.js";export{m as default,i as registerNetworkPerspective};
@@ -1,88 +0,0 @@
1
- function e(e,t,n={}){if(!Number.isFinite(t)||t<=0||Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";let i=n.fresh??io.fresh,r=n.aging??io.aging,o=n.stale??io.stale;return e<t*i?"fresh":e<t*r?"aging":e<t*o?"stale":"expired"}function t(e,t,n){if(null!=e)return"function"==typeof e?e(t,n):"object"==typeof e&&null!==e&&"constant"in e?e.constant:t[e]}function n(e){let{data:n,encoding:i}=e,r=[],o=/* @__PURE__ */new Map;return n.forEach((e,n)=>{let a=t(i.id,e,n);if(null==a||""===a)throw new Error(`[semiotic] Motion encoding row ${n} resolved an empty id.`);let l=String(a);if(o.has(l))throw new Error(`[semiotic] Duplicate motion encoding id "${l}".`);let s=t(i.process?.group,e,n),c=t(i.process?.stage,e,n),u=t(i.accessible?.group,e,n)??(null!=s?String(s):null!=c?String(c):void 0),d={};for(let r of Object.keys(i.evidence??{}))d[r]=t(i.evidence?.[r],e,n);let h={id:l,datum:e,time:{arrival:t(i.time?.arrival,e,n),basis:i.time?.basis,unit:i.time?.unit},placement:{x:t(i.placement?.x,e,n),y:t(i.placement?.y,e,n),lane:t(i.placement?.lane,e,n),space:i.placement?.space},kinematics:{velocityX:t(i.kinematics?.velocityX,e,n),velocityY:t(i.kinematics?.velocityY,e,n),space:i.kinematics?.space},process:{group:s,stage:c,target:t(i.process?.target,e,n),work:t(i.process?.work,e,n)},evidence:d,accessible:{description:t(i.accessible?.description,e,n),group:u,label:t(i.accessible?.label,e,n)??l}};r.push(h),o.set(l,h)}),{rows:r,byId:o}}function i(t){let n=t.now-t.arrival;return{age:n,progress:Number.isFinite(n)&&Number.isFinite(t.ttl)&&t.ttl>0?Math.max(0,n)/t.ttl:n===1/0&&Number.isFinite(t.ttl)&&t.ttl>0?1/0:0,lifecycle:e(n,t.ttl,t.thresholds)}}function r(e){let t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||e.extent<=0)return 1;let n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){let i=e.halfLife??e.extent/2,r=i>0?i:e.extent/2;return t+Math.pow(.5,n/r)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function o(e,t){let n=Number.isFinite(e)?e:0,i=Number.isFinite(t)?t:0;return{velocityX:n,velocityY:i,speed:Math.hypot(n,i),direction:Math.atan2(i,n)}}function a(e,t,n){return!Number.isFinite(n)||n<=0?o(0,0):o((t.x-e.x)/n,(t.y-e.y)/n)}function l(e){return"string"==typeof e&&e.includes("var(")}function s(e){let t=ro.exec(e);if(!t)return l(e)?void 0:e;let n=t[1]?.trim();return n?s(n):void 0}function c(e,t){return String(e).length*t*.6}function u(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}function d(e){let{x:t,y:n,text:i,fill:r,fontSize:o=12,fontWeight:a,fontFamily:d,textAnchor:h="start",dominantBaseline:f,background:m,className:p}=e,y=u(m),g=e=>/* @__PURE__ */oo("text",{x:t,y:n,textAnchor:h,dominantBaseline:f,fill:r,fontSize:o,fontWeight:a,fontFamily:d,className:p,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:i});if(!y)return g();if("halo"===y.type)return g({stroke:y.fill??lo,strokeWidth:y.haloWidth??3});let x,b,v=y.padding??{x:6,y:3},w="number"==typeof v?v:v.x,k="number"==typeof v?v:v.y,M=c(i,o),A=M+2*w,S=o+2*k;x="middle"===h?t-M/2-w:"end"===h?t-M-w:t-w,b="middle"===f||"central"===f?n-S/2:"hanging"===f||"text-before-edge"===f?n-k:n-.8*o-k;let $=y.fill??lo,C={};return l($)&&(C.fill=$),l(y.stroke)&&(C.stroke=y.stroke),/* @__PURE__ */ao("g",{className:p,children:[
2
- /* @__PURE__ */oo("rect",{x:x,y:b,width:A,height:S,rx:y.radius??3,ry:y.radius??3,fill:l($)?s($):$,fillOpacity:y.opacity??.85,stroke:l(y.stroke)?s(y.stroke):y.stroke,strokeWidth:y.strokeWidth,...C.fill||C.stroke?{style:C}:{}}),g()]})}function h(e){let t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:String(n)}function f(e){let t=Vr(e=>e.pushObservation),n=so.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return so.useMemo(()=>({...e,onObservation:n}),[n,e])}function m(e){let t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function p(e,t={}){let n=h(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(i){let r=m(i);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function y(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}function g(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(g):!co.isValidElement(e)||e.type!==co.Fragment||g(e.props.children))}function x(e){return e.ownsChrome=!0,e}function b(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function v(e){if("function"==typeof e)return!0===e.ownsChrome;if(!co.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let n=e.props,i=n["data-semiotic-tooltip-chrome"];if(null!=i&&!1!==i&&"false"!==i)return!0;let r=n.style;return!(!r||"object"!=typeof r||!b(r.background)&&!b(r.backgroundColor))}function w(e,t){for(let n of t){let t=e.find(e=>e.lower===n);if(t)return t}}function k(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let n=t.maxEntries??6,i=!1!==t.skipPositional,r=[];for(let[t,n]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(i&&go.has(e)||null==n)continue;let o=typeof n;"string"!==o&&"number"!==o&&"boolean"!==o&&!(n instanceof Date)||r.push({key:t,lower:e,value:n})}if(0===r.length)return{entries:[]};let o=r.findIndex(e=>mo.includes(e.lower)),a=o>=0;o<0&&(o=r.findIndex(e=>"id"===e.lower)),o<0&&(o=r.findIndex(e=>"string"==typeof e.value));let l=o>=0?r[o]:void 0,s=r.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=w(s,po),u=w(s,yo),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of s){if(d.length>=n)break;po.includes(e.lower)||yo.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:l?.key,title:l?.value,entries:d}}function M(e){if(!Number.isFinite(e))return String(e);let t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function A(e){let t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),i=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n,r=mr(i?e.data??{}:e);if(!r||(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r))return null;if(i&&(void 0!==e.allSeries||void 0!==e.xValue)){let t=Jr({...r},Qr(r));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}return r}function S(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function $(e,t){return"function"==typeof t?t(e):e[t]}function C(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?M(e):String(e);if(e instanceof Date)return S(e);if("object"==typeof e&&null!==e){let t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function j(e={}){let{fields:t,title:n,format:i,style:r={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a,l=[];if(n){let t=$(e,n);a=C(t,i)}if(t&&t.length>0)t.forEach(t=>{let n,r,o;"string"==typeof t?(n=t,r=t,o=i):(n=t.label,r=t.accessor||t.key||"",o=t.format||i);let a=$(e,r);l.push({label:n,value:C(a,o)})});else if(!n){let t=["value","y","name","id","label"];for(let n of t)if(void 0!==e[n]){a=C(e[n],i);break}if(!a){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=C(e[t[0]],i))}}/* @__PURE__ */
3
- return bo(fo,{className:o,style:r,children:[a&&/* @__PURE__ */xo("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:a}),l.map((e,t)=>/* @__PURE__ */bo("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&/* @__PURE__ */bo("span",{children:[e.label,": "]}),e.value]},t))]})}}function L(e={}){let{fields:t=[],title:n,format:i,style:r={},className:o="",showLabels:a=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let s=[];if(n){let t=$(e,n);s.push({value:C(t,i)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,r,o;"string"==typeof t?(n=t,r=t,o=i):(n=t.label,r=t.accessor||t.key||"",o=t.format||i);let l=C($(e,r),o);s.push({label:a?n:void 0,value:l})});else{let t=k(e,{skipPositional:!1});null!=t.title&&s.push({label:void 0,value:C(t.title,i),bold:!0}),t.entries.forEach(e=>{s.push({label:a?e.key:void 0,value:C(e.value,i)})})}return Array.isArray(s)&&0!==s.length?/* @__PURE__ */xo(fo,{className:`semiotic-tooltip-multiline ${o}`.trim(),style:r,children:s.map((e,t)=>/* @__PURE__ */bo("div",{style:{marginBottom:t<s.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */bo("strong",{children:[e.label,l]}),e.value]},t))}):null}}function I(e){return"multi"===e||N(e)}function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function z(e){let{tooltip:t,defaultTooltipContent:n,multiDefaultContent:i=O(),customFunctionContext:r="datum"}=e,o=t;return!1===t?{tooltipContent:()=>null}:I(o)?{tooltipContent:(N(o)&&"function"==typeof o.content?F(o.content):void 0)||i,tooltipMode:"multi"}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(o)||n}}function R(e){let{tooltip:t,defaultTooltipContent:n,customFunctionContext:i="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(t)||n}}function O({xFormat:e,yFormat:t}={}){function n(e,t){if(t)try{let n=t(e);if(null!=n)return n}catch{}return C(e)}return i=>{let r=i.allSeries;if(!r||0===r.length){let e=i.data?.value??i.data?.y;/* @__PURE__ */
4
- return xo(fo,{children:/* @__PURE__ */xo("div",{children:n(e,t)})})}let o=i.xValue??i.data?.time??i.data?.x;/* @__PURE__ */
5
- return bo(fo,{children:[null!=o&&/* @__PURE__ */xo("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:n(o,e)}),r.map((e,i)=>/* @__PURE__ */bo("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
6
- /* @__PURE__ */xo("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
7
- /* @__PURE__ */xo("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
8
- /* @__PURE__ */xo("span",{style:{fontWeight:500,fontSize:"0.85em"},children:n(e.value,t&&(n=>t(n,e.group)))})]},i))]})}}function F(e){if(!0!==e){if("function"==typeof e){let t=e,n=e=>{let n=A(e);if(!n)return null;let i=t(n);return g(i)?v(t)||v(i)?i:/* @__PURE__ */xo(fo,{children:i}):null};return v(t)?x(n):n}if(!1===e||void 0===e)return!1;if(N(e)){if("function"==typeof e.content)return!vo&&"production"!==process.env.NODE_ENV&&(vo=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),F(e.content);"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');let t=L();return F(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=j(e);return F(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');let e=L();return F(t=>e(t))}return j()}}function T({componentName:e,message:t,diagnosticHint:n,width:i,height:r}){/* @__PURE__ */
9
- return ko("div",{role:"alert",style:{width:i,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */Mo("div",{style:{textAlign:"center",maxWidth:400},children:[
10
- /* @__PURE__ */ko("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
11
- /* @__PURE__ */ko("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ko("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function W(e,t){return e.displayName=t,e}function E({colors:e,children:t}){/* @__PURE__ */
12
- return Lo(Io.Provider,{value:e,children:t})}function D(e){let t=Co(Io),n=Co(No);return e?n:t}function B(){return Co(Io)}function H(){for(let e of Eo)e()}function P(e,t,n){let i=Wo.positions.get(e);i?.locked||i&&i.xValue===t&&i.sourceId===n||(Wo={positions:new Map(Wo.positions).set(e,{xValue:t,sourceId:n})},H())}function G(e,t){let n=Wo.positions.get(e);if(n?.locked||!n||n.sourceId!==t)return;let i=new Map(Wo.positions);i.delete(e),Wo={positions:i},H()}function _(e,t,n){if(Wo.positions.get(e)?.locked){let t=new Map(Wo.positions);return t.delete(e),Wo={positions:t},H(),!1}return Wo={positions:new Map(Wo.positions).set(e,{xValue:t,sourceId:n,locked:!0})},H(),!0}function V(e,t){let n=Wo.positions.get(e);if(!n?.locked||t&&n.sourceId!==t)return;let i=new Map(Wo.positions);i.delete(e),Wo={positions:i},H()}function Y(){return Wo}function U(e){return Eo.add(e),()=>Eo.delete(e)}function X(){return()=>{}}function q(){return Do}function K(e){let t=To(e?U:X,e?Y:q,e?Y:q);return e?t.positions.get(e)??null:null}function Z(e){let t=Ro(),n=e.clientId||t,{name:i}=e,r=Kr(e=>e.selections.get(i)),o=Kr(e=>e.setClause),a=Kr(e=>e.clearClause),l=Oo(()=>!!r&&r.clauses.size>0,[r]);return{predicate:Oo(()=>r&&0!==r.clauses.size?Xr(r,n):()=>!0,[r,n]),isActive:l,selectPoints:Fo(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"point",values:new Set(i)},r=!0;r&&o(i,{clientId:n,type:"point",fields:t})},[n,i,o]),selectInterval:Fo(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"interval",range:i},r=!0;r&&o(i,{clientId:n,type:"interval",fields:t})},[n,i,o]),clear:Fo(()=>{a(i,n)},[a,i,n]),clientId:n}}function J(e,t){let n=Ro(),i=t||n,r=Kr(e=>e.setClause),o=Kr(e=>e.clearClause);return{selectPoints:Fo(t=>{let n={},o=!1;for(let[e,i]of Object.entries(t))n[e]={type:"point",values:new Set(i)},o=!0;o&&r(e,{clientId:i,type:"point",fields:n})},[e,i,r]),clear:Fo(()=>o(e,i),[e,i,o]),clientId:i}}function Q(e){let t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:r,selectPoints:o,clear:a}=Z({name:t,fields:n});return{onHover:Fo(e=>{if(!e)return void a();let t=eo(e,n);Pr(t)?o(t):a()},[n,o,a]),predicate:i,isActive:r}}function ee(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}function te(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function ne(e){let{name:t,xField:n,yField:i}=e,{predicate:r,isActive:o,selectInterval:a,clear:l}=Z({name:t,fields:[n,i].filter(Boolean)}),s=n&&i?"xyBrush":n?"xBrush":"yBrush",c=Fo(e=>{if(!e)return void l();let t={};"xyBrush"===s&&ee(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),i&&(t[i]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===s&&te(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===s&&te(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),Pr(t)&&a(t)},[s,n,i,a,l]);return{brushInteraction:Oo(()=>({brush:s,during:c,end:c}),[s,c]),predicate:r,isActive:o,clear:l}}function ie(e,t,n){let i=Kr(e=>e.selections.get(t));return Oo(()=>{if(!i||0===i.clauses.size)return e;let t=Xr(i,n);return e.filter(t)},[e,i,n])}function re(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function oe(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function ae(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function le(e,t){let{when:n}=e,i=t.width,r=t.height,o=ae(t),a=oe(t);return!("number"==typeof n.minWidth&&i<n.minWidth||"number"==typeof n.maxWidth&&i>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||r<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function se(e,t){let n={...e,...t};for(let i of["margin","frameProps","mobileSemantics","style"])re(e[i])&&re(t[i])&&(n[i]={...e[i],...t[i]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function ce(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};let i=n.map((e,t)=>({rule:e,index:t})).filter(e=>le(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:i.reduce((e,t)=>se(e,t.rule.transform),e),matches:i}}function ue(e={}){let{limit:t=50,types:n,chartId:i}=e,r=Vr(e=>e.version),o=Vr(e=>e.observations),a=Vr(e=>e.clearObservations),l=Bo(()=>{let e=o;if(n&&n.length>0){let t=new Set(n);e=e.filter(e=>t.has(e.type))}return i&&(e=e.filter(e=>e.chartId===i)),e.length>t&&(e=e.slice(e.length-t)),e},[o,n,i,t,r]);return{observations:l,latest:l.length>0?l[l.length-1]:null,clear:a}}function de(e,t){let n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return Mr(t);let i=e.size;return e.set(t,i),i}function he(e){let t=e?.find(e=>"bottom"===e.orient),n=e?.find(e=>"top"===e.orient),i=e?.find(e=>"left"===e.orient),r=e?.find(e=>"right"===e.orient);return{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r,xAxis:t??n,yAxis:i??r,xOrient:t||!n?"bottom":"top",yOrient:i||!r?"left":"right"}}function fe(e){let t=6;for(let n=1;n<e.length;n++){let i=Math.abs(e[n]-e[n-1]);if(i>0&&Number.isFinite(i)){let r=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(r/i))+1)}}let n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function me(...e){let t;for(let n of e)n&&(t=pe(t)&&pe(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function pe(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function ye(e){return"object"==typeof e&&null!==e&&"gradient"in e}function ge(e,t){let n=t?36:0;return e.top>=n?e:{...e,top:n}}function xe(e,t,n,i,r=8){let o="left"===i||"right"===i,a=i,l="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",s=Math.max(0,(o?n[0]:n[1])-r),c=Math.max(t[a],s-e[l]);e[a]>c&&(e[a]=c)}function be(e){return Math.ceil(7*e.length)}function ve(e,t){if(pe(e)){let n=ze(t),i=100;for(let t of e.legendGroups){t.label&&(i=Math.max(i,be(t.label)));for(let e of t.items)i=Math.max(i,n.swatchSize+n.labelGap+be(e.label))}return i}if(ye(e)){let{gradient:t}=e,n=t.format||fe(t.domain),i=Math.max(be(n(t.domain[0])),be(n(t.domain[1]))),r=t.label?be(t.label):0;return Math.max(100,19+i,r)}return 100}function we(e){return(pe(e)||ye(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function ke(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?ea:Qo:0}function Me(e){return Math.max(0,e?.edgeGutter??3)}function Ae(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function Se(e){let{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r}=he(e.axes),o=!(n&&!t||!1===t?.visible),a=!!n&&!t&&!1!==n.visible,l=!(r&&!i||!1===i?.visible),s=!!r&&!1!==r.visible,c=!1!==e.showAxes;return{hasAxis:c&&o,hasAxisLabel:c&&o&&!!(t?.label??e.xLabel),rotatedTicks:c&&o&&(e.rotatedTicks??!!t?.autoRotate),topAxis:a?{hasAxis:c,hasAxisLabel:c&&!!(n?.label??e.xLabel),rotatedTicks:c&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:l?{hasAxis:c,hasAxisLabel:c&&!!(i?.label??e.yLabel)}:void 0,rightAxis:s?{hasAxis:c,hasAxisLabel:c&&!!(r?.label??e.yLabelRight??e.yLabel)}:void 0}}function $e(e,t){return Se({showAxes:e.showAxes??t.showAxes,xLabel:e.xLabel??t.xLabel,yLabel:e.yLabel??t.yLabel,yLabelRight:e.yLabelRight??t.yLabelRight,axes:e.axes??t.axes})}function Ce(e){let t=e.projection??"vertical",n=!1!==e.showAxes&&"radial"!==t;return{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasValueLabel:e.hasCategoryLabel),leftAxis:{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasCategoryLabel:e.hasValueLabel)}}}function je(e,t,n){if(ye(e))return e.gradient.label?46:26;if(!pe(e))return 20;let i=ze(n),r=Math.max(1,n?.maxWidth??t),o=i.rowHeight;for(let t of e.legendGroups){let e=0,n=0;for(let o of t.items){let t=i.swatchSize+i.labelGap+be(o.label),a=0===n?t:n+i.itemGap+t;n>0&&a>r?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*i.rowHeight,t.label?be(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function Le(e,t,n){return ve(e,t)+we(e)+ke(t,n)+Me(t)}function Ie(e,t){let{legend:n}=t;if(!n)return;let i=t.position??"right",r=je(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+we(n)+Ae("bottom"===i?t.axisChrome:"top"===i?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===i&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===i?t.hasTitle?58:34:0);"right"===i?e.right=Math.max(e.right,o,Le(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===i?e.left=Math.max(e.left,o,Le(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===i?e.top=Math.max(e.top,o,r):e.bottom=Math.max(e.bottom,o,r)}function Ne(e,t){let n=t.position??"right",i="top"===n||"bottom"===n,r=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,i?t.legendLayout?.maxWidth??r:t.reservedWidth??ve(e,t.legendLayout)),a=we(e),l=ke(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),s=Me(t.legendLayout),c=je(e,r,t.legendLayout),u=Ae(t.axisChrome,t.legendLayout),d=Ae(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(s,t.margin.left-l-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){let e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-s,t.totalWidth-t.margin.right+l+a),y:t.margin.top,width:o,height:c}}function ze(e){let t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Re(e,t){let n=24;return e.map(({hasLabel:e,itemCount:i})=>{n+=5;let r,o=n;n+=8,e&&(n+=16,r=n,n+=8);let a=n;return n+=i*t+8,{lineY:o,labelY:r,itemsY:a,endY:n}})}function Oe(e,t,n=!1){let i={...e};for(let e of t??[])!1===e.visible&&("top"!==e.orient||!n)&&(i[e.orient]=0);return i}function Fe({config:e,orientation:t="vertical",width:n=100,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:a,legendInteraction:l}){let{colorFn:s,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||fe(c),m=`grad-legend-${ta.useId()}`,p=!(!i&&!r),y="isolate"===l||void 0===l&&null!=a,[g,x]=ta.useState(0),[b,v]=ta.useState(null),w=ta.useRef([]),k=e=>{let t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),i=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(i)}`,valueRange:[n,i],interactionKey:`${n}:${i}`}},M=(e,n,l)=>{let s="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(s)??!1,u=o===s,d=b===l,h=e=>{let t=(e+5)%5;x(t),w.current[t]?.focus()};/* @__PURE__ */
13
- return na("rect",{ref:e=>{w.current[l]=e},className:"semiotic-gradient-legend-bin",...n,fill:a?.size&&!c||null!=o&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:l===g?0:-1,role:"option","aria-label":e.label,"aria-selected":y?c:void 0,"aria-current":!(y||!u)||void 0,onClick:i?()=>i(e):void 0,onMouseEnter:r?()=>r(e):void 0,onMouseLeave:r?()=>r(null):void 0,onFocus:()=>{x(l),v(l),r?.(e)},onBlur:()=>{v(null),r?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&i)return n.preventDefault(),void i(e);let r="horizontal"===t?"ArrowLeft":"ArrowUp",o="horizontal"===t?"ArrowRight":"ArrowDown";n.key===r||n.key===o?(n.preventDefault(),h(l+(n.key===o?1:-1))):("Home"===n.key||"End"===n.key)&&(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},`gradient-interaction-${l}`)},[A,S]=c,$=ta.useMemo(()=>Array.from({length:65},(e,t)=>{let n=t/64;/* @__PURE__ */
14
- return na("stop",{offset:n,stopColor:s(h?A+n*(S-A):S-n*(S-A))},t)}),[s,A,S,h]),C=h?Math.min(n,200):14,j=h?12:100,L=h?Math.max(0,(n-C)/2):0,I=u?18:0;/* @__PURE__ */
15
- return ia("g",{"aria-label":u||"Gradient legend",role:p?"listbox":void 0,"aria-orientation":p?t:void 0,"aria-multiselectable":!(!p||!y)||void 0,style:Zo,children:[
16
- /* @__PURE__ */na("defs",{children:/* @__PURE__ */na("linearGradient",{id:m,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:$})}),u&&/* @__PURE__ */na("text",{x:h?L+C/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
17
- /* @__PURE__ */na("rect",{x:L,y:I,width:C,height:j,fill:`url(#${m})`,rx:2}),p&&Array.from({length:5},(e,t)=>M(k(t),{x:h?L+t*C/5:0,y:h?I:I+t*j/5,width:h?C/5:C,height:h?j:j/5},t)),[0,1].map(e=>/* @__PURE__ */na("text",{x:h?L+e*C:C+5,y:I+(h?j+12:e?j:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(c[h?e:1-e])},e))]})}function Te(e,t,n,i,r){if("function"==typeof n)return n(e);let o=i(e,t);return"fill"===n?/* @__PURE__ */ra("rect",{style:o,width:r,height:r}):/* @__PURE__ */ra("line",{style:o,x1:0,y1:0,x2:r,y2:r})}function We({swatchSize:e}){/* @__PURE__ */
18
- return ra("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Ee(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function De(e,t,n,i,r,o){let{legendGroup:{type:a="fill",styleFn:l,items:s},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:m,groupIndex:p,onFocusedIndexChange:y,interactive:g,useIsolateAria:x,metrics:{swatchSize:b,labelGap:v}}=e,w=!!h?.size&&h.has(t.label),k=null!=d&&t.label===d;/* @__PURE__ */
19
- return oa("g",{transform:i,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:g?p===f&&n===m?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&x?w:void 0,"aria-current":!(!g||x||!k)||void 0,"aria-label":t.label,onKeyDown:g?e=>{if(("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c?.(t)),e.key===r||e.key===o){e.preventDefault();let t=(n+(e.key===o?1:-1)+s.length)%s.length;y(p,t);let i=e.currentTarget.parentElement?.children[t];i instanceof SVGElement&&i.focus()}}:void 0,onFocus:g?e=>{y(p,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:g?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:g?"pointer":"default",opacity:Ee(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&/* @__PURE__ */ra("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+v+2+7*t.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Te(t,n,a,l,b),w&&/* @__PURE__ */ra(We,{swatchSize:b}),
20
- /* @__PURE__ */ra("text",{y:b/2,x:b+v,dominantBaseline:"central",fontSize:12,style:Jo,fill:"var(--semiotic-text, #333)",children:t.label})]},`legend-item-${n}`)}function Be(e){let{legendGroups:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,legendInteraction:a,title:l="Legend",width:s=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=ze(d),[f,m]=Ko.useState(0),[p,y]=Ko.useState(0),g=Ko.useCallback((e,t)=>{m(e),y(t)},[]),x="vertical"===u?sa({legendGroups:t||[],width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:a,metrics:h}):ca({legendGroups:t||[],title:l,height:c,width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:a,metrics:h}),b=!(!n&&!i);/* @__PURE__ */
21
- return oa("g",{role:b?"listbox":void 0,"aria-multiselectable":!(!b||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:Zo,children:[void 0!==l&&""!==l&&"vertical"===u&&/* @__PURE__ */ra("text",{className:"legend-title",y:16,x:s/2,textAnchor:"middle",fontSize:12,style:Jo,fill:"var(--semiotic-text, #333)",children:l}),x]})}function He(e,t=0,n=1/0,i=0){let r=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(r,n):1/0,a=Number.isFinite(e)?Math.floor(e):r,l=Math.max(r,Math.min(o,a));return i>0&&Number.isFinite(i)?Math.max(r,Math.min(o,Math.round(l/i)*i)):l}function Pe(e,t,n,i={}){let r=ua(null),[o,a]=da(null);ma(()=>{if(!t&&!n)return;let e=r.current;if(!e||typeof ResizeObserver>"u")return;let o=(e,t)=>({w:He(e,i.minWidth,i.maxWidth,i.widthStep),h:He(t,i.minHeight,i.maxHeight,i.heightStep)}),l=e.getBoundingClientRect();(l.width>0||l.height>0)&&a(o(l.width,l.height));let s=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect,i=o(e,n);a(e=>e&&e.w===i.w&&e.h===i.h?e:i)}});return s.observe(e),()=>s.disconnect()},[t,n,i.minWidth,i.maxWidth,i.widthStep,i.minHeight,i.maxHeight,i.heightStep]);let l=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[r,l]}function Ge(){return Po(xa)}function _e(e){let t=/* @__PURE__ */new Set,n=[];for(let i of e)t.has(i)||(t.add(i),n.push(i));return n}function Ve(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ye(e,t){let n=Po(ba),i=_o(),r=_e(e),o=r.map(e=>t?.(e)),a=Uo({categories:[],colors:[]});(!Ve(a.current.categories,r)||!Ve(a.current.colors,o))&&(a.current={categories:r,colors:o});let l=a.current;va(()=>{if(n)return()=>n.unregisterCategories(i)},[n,i]),va(()=>{n&&n.registerCategories(i,l)},[n,i,l])}function Ue(){return null!==Po(ba)}function Xe({categoryColors:e,interaction:t,selectionName:n,field:i}){let r=Object.entries(e),o=r.map(([e])=>e),a=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:r.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:l,clear:s}=Z({name:n,fields:[i],clientId:wa}),{selectPoints:c,clear:u}=Z({name:n,fields:[i],clientId:ka}),d=Kr(e=>e.selections.get(n)),{isolatedCategories:h,highlightedCategory:f}=Yo(()=>{let e=/* @__PURE__ */new Set,t=null,n=d?.clauses.get(wa)?.fields[i];if("point"===n?.type)for(let t of n.values)e.add(String(t));let r=d?.clauses.get(ka)?.fields[i];if("point"===r?.type){let e=r.values.values().next().value;null!=e&&(t=String(e))}return{isolatedCategories:e,highlightedCategory:t}},[d,i]),m=qo(e=>{"highlight"===t&&(e?c({[i]:[e.label]}):u())},[t,i,c,u]),p=qo(e=>{if("isolate"!==t)return;let n=new Set(h);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===o.length?s():l({[i]:Array.from(n)})},[t,i,h,o.length,l,s]),[y,[g]]=Pe([0,0],!0,!1),x=Yo(()=>qe(r.map(([e])=>e),g),[r,g]),b=Math.max(30,22*x+8);return 0===r.length?null:/* @__PURE__ */pa("div",{ref:y,style:{width:"100%",display:"block"},children:/* @__PURE__ */pa("svg",{width:"100%",height:b,style:{display:"block",overflow:"visible"},children:/* @__PURE__ */pa(Be,{legendGroups:a,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?m:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:f,isolatedCategories:h})})})}function qe(e,t){if(!t||0===e.length)return 1;let n=0,i=1;for(let r of e){let e=26+7*r.length;n>0&&n+e>t&&(i++,n=0),n+=e}return i}function Ke({children:e,selections:t,showLegend:n,legendPosition:i="top",legendInteraction:r="none",legendSelectionName:o="legend",legendField:a="category"}){let l=Yo(()=>{if(!t)return;let e=/* @__PURE__ */new Map;for(let[n,i]of Object.entries(t))i.resolution&&e.set(n,{name:n,resolution:i.resolution,clauses:/* @__PURE__ */new Map});return e.size>0?{selections:e}:void 0},[t]),s=B(),c=Gr(e=>e.theme.colors.categorical),u=c.length>0?c:pr,[d,h]=Xo({}),f=Uo(/* @__PURE__ */new Map),m=Yo(()=>({registerCategories:(e,t)=>{h(n=>Ve(n[e]?.categories??[],t.categories)&&Ve(n[e]?.colors??[],t.colors)?n:{...n,[e]:t})},unregisterCategories:e=>{h(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;let n={...t};return delete n[e],n})}}),[]),p=Yo(()=>{let e=[];for(let{categories:t}of Object.values(d))for(let n of t)e.push(n);return _e(e)},[d]),y=Yo(()=>{let e=s??{},t=new Map(f.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),i=p.map(n=>{let i=de(t,n);return[n,br(e,n)??u[i%u.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...i])}},[s,p,u]);va(()=>{f.current=y.categoryIndexes},[y]);let g=y.colors,x=Yo(()=>{let e=/* @__PURE__ */new Map,t=!1;for(let{categories:n,colors:i}of Object.values(d))n.forEach((n,r)=>{let o=i[r];o&&(e.has(n)&&e.get(n)!==o&&(t=!0),e.set(n,o))});return{colors:{...g,...Object.fromEntries(e)},conflicting:t}},[g,d]),b=(n??!0)&&!x.conflicting,v=Object.keys(g).length>0,w=b&&v;/* @__PURE__ */
22
- return pa(qr,{initialState:l,children:/* @__PURE__ */pa(_r,{children:/* @__PURE__ */pa(xa.Provider,{value:!0,children:/* @__PURE__ */pa(ba.Provider,{value:m,children:/* @__PURE__ */pa(E,{colors:g,children:/* @__PURE__ */ya(ga.Provider,{value:w,children:[b&&"top"===i&&/* @__PURE__ */pa(Xe,{categoryColors:x.colors,interaction:r,selectionName:o,field:a}),e,b&&"bottom"===i&&/* @__PURE__ */pa(Xe,{categoryColors:x.colors,interaction:r,selectionName:o,field:a})]})})})})})})}function Ze(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>et(t(e))}function Je(e,t){let n=Ze(e),i=Ze(t);return(e,t)=>{let r=i(e);return{value:r,x:n(e),y:r,category:t}}}function Qe(e,t){let n=Ze(t??"value"),i=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=i?i(e):void 0;return{value:n(e),category:null==t?void 0:String(t)}}}function et(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function tt(e,t,n){let i=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&i!==e.eq||void 0!==e.ne&&i===e.ne||void 0!==e.in&&!e.in.includes(i))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let r=et(i);if(!(void 0!==r&&(void 0===e.gt||r>e.gt)&&(void 0===e.gte||r>=e.gte)&&(void 0===e.lt||r<e.lt)&&(void 0===e.lte||r<=e.lte)))return!1;if(void 0!==e.within){let[t,n]=e.within;if(!(r>=t&&r<=n))return!1}if(void 0!==e.outside){let[t,n]=e.outside;if(!(r<t||r>n))return!1}return!0}function nt(e,t,n){let i=e.when;return void 0===i||!0===i||!1!==i&&("function"==typeof i?i(t,n):tt(i,t,n))}function it(e,t,n){if(!t||0===t.length)return{};let i={};for(let r of t){if(!nt(r,e,n))continue;let t="function"==typeof r.style?r.style(e,n):r.style;t&&(i={...i,...t})}return i}function rt(e,t,n,i=e=>e){let r=e??(()=>({}));return t&&0!==t.length?(e,o)=>{let a=i(e),l={...r(e,o)};return Object.assign(l,it(a,t,n(a,o))),l}:r}function ot(e,t,n){return e&&0!==e.length?(i,r)=>{let o=it(i,e,t(i,r)),a=n?n(i,r):void 0;return a?{...o,...a}:o}:n}function at(e,t,n,i){if(!e||0===e.length)return i;let r=Qe(t,n);return(t,n)=>{let o=t&&t.data||t,a=it(o,e,r(o)),l=i?i(t,n):void 0;return l?{...a,...l}:a}}function lt(e,t,n,i){return ot(e,Je(t,n),i)}function st(e,t,n){let i=Ze(t);return ot(e,(e,t)=>({value:i(e),category:t}),n)}function ct(e){if(!e)return Ma;let t=!1;for(let n=0;n<e.length;n++){let i=e[n];if(null==i||"object"!=typeof i){t=!0;break}}if(!t)return e;let n=[];for(let t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function ut(e,t){let n={...e};for(let e of t)n[Sa[e]]++;return n}function dt(e,t,n){let i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:ut(n,i)}}function ht(e){let{domain:t,layout:n,sceneGeometry:i}=e.revisions;return{domain:t,layout:n,sceneGeometry:i}}function ft(e,t){return e.sceneGeometry===t.sceneGeometry&&e.layout===t.layout&&e.domain===t.domain}function mt(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function pt(e){return La(new Ra(e))}function yt(e,t,n,i=!1,r=!1){let o=e.beforeCompute(t.getLastUpdateResult(),i);n(),e.afterCompute(o,!0,r)}function gt(e){let{legend:t,totalWidth:n,totalHeight:i,margin:r,legendPosition:o="right",legendLayout:a,legendHoverBehavior:l,legendClickBehavior:s,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;let{x:h,y:f,width:m}=Ne(t,{totalWidth:n,totalHeight:i,margin:r,position:o,legendLayout:a,axisChrome:e.axisChrome}),p="top"===o||"bottom"===o;/* @__PURE__ */
23
- return Fa("g",{transform:`translate(${h}, ${f})`,children:ye(t)?/* @__PURE__ */Fa(Fe,{config:t.gradient,orientation:p?"horizontal":"vertical",width:m,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):pe(t)?/* @__PURE__ */Fa(Be,{legendGroups:t.legendGroups,title:"",width:m,orientation:p?"horizontal":"vertical",legendLayout:a,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function xt(e){return!0===e?._annotationDeferred}function bt(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function vt(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis?e.emphasis:null}function wt(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function kt(e){return Math.max(.72,.95-.06*e)}function Mt(e){let t=e.map((e,t)=>({p:e,i:t,emphasis:vt(e.annotation),confidence:wt(e.annotation),readingOrder:null,rank:1})),n=t.some(e=>null!=e.emphasis||null!=e.confidence),i=e.some(e=>xt(e.annotation)),r=e.some(e=>null!=bt(e.annotation)),o=e.some(e=>"layer"===bt(e.annotation));if(!n&&!i&&!r)return e.map(e=>e.node);let a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(let e of t)e.emphasis&&(e.rank=Wa[e.emphasis]);let l=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{let{p:t,i:n,emphasis:i,readingOrder:r}=e,o=xt(t.annotation),a=t.node;if("primary"===i||"secondary"===i||null!=r){let e=null==i&&null!=r;a=/* @__PURE__ */Ta("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":`annotation-emphasis annotation-emphasis--${i}`,..."secondary"===i?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:kt(r),"data-annotation-reading-order":r}:{},children:t.node},`annotation-emphasis-${n}`)}let l=bt(t.annotation);return l&&(a=/* @__PURE__ */Ta("g",{className:`annotation-cohesion--${l}`,children:a},`annotation-cohesion-${n}`)),o&&(a=/* @__PURE__ */Ta("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},`annotation-deferred-${n}`)),a});return i&&l.unshift(
24
- /* @__PURE__ */Ta("style",{children:Ea},"annotation-disclosure-style")),o&&l.unshift(
25
- /* @__PURE__ */Ta("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),l}function At(e,t,n,i){return St(e,t,n,i).nodes}function St(e,t,n,i){let r=[];return e.forEach((e,o)=>{let a;a=n?n(e,o,i)??t(e,o,i):t(e,o,i),a&&r.push({node:a,annotation:e})}),{nodes:Mt(r),renderedAnnotations:r.map(e=>e.annotation)}}function $t(e,t,n){if(!e)return null;let i="object"==typeof e?e:{};/* @__PURE__ */
26
- return Da("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,i.radius??4),fill:i.fill??n})}function Ct(e,t){return Math.max(Math.min(e,t),0)+16}function jt({ann:e,position:t,vertical:n,width:i,height:r,color:o,fontSize:a=12,fontFamily:l,bold:s,background:c,dash:u="6,3",labelGap:h=4}){let f=e.labelPosition,m=t>.6*i,p=n?t+(m?-4:4):"left"===f?4:"center"===f?i/2:i-4,y=n?"bottom"===f?r-4:"center"===f?r/2:16:t<20?Math.min(r-4,t+16):t-h,g=n?m?"end":"start":"left"===f?"start":"center"===f?"middle":"end",x=n?[t,0]:[0,t],b=n?[t,r]:[i,t];/* @__PURE__ */
27
- return Ha("g",{opacity:e.opacity,children:[
28
- /* @__PURE__ */Ba("line",{x1:x[0],y1:x[1],x2:b[0],y2:b[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),$t(e.endCap,x,o),e.label&&/* @__PURE__ */Ba(d,{x:p,y:y,text:e.label,textAnchor:g,fill:e.labelColor??o,fontSize:a,fontFamily:l,fontWeight:s?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function Lt(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function It(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Nt(e,t,n){if(!e)return[];let i=Math.max(1,Math.floor(t/n)),r=[],o="";for(let t of e.split(/\s+/))t&&(o&&o.length+1+t.length>i?(r.push(o),o=t):o=o?`${o} ${t}`:t);return o&&r.push(o),r}function zt(e,t,n,i){return"curly"===e?i?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:i?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function Rt(e,t,n,i){if(!e)/* @__PURE__ */return Ga("g",{className:"annotation-note"});let{label:r,title:o,orientation:a,align:l,wrap:s=120,noWrap:c}=e;if(!r&&!o)/* @__PURE__ */return Ga("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d="topBottom"===u,h="leftRight"===u,f=l;(!f||"dynamic"===f)&&(f=d?t>=0?"left":"right":n>=0?"top":"bottom");let m="start";d?"right"===f?m="end":"middle"===f&&(m="middle"):m=t>=0?"start":"end";let p=e.useHTML||e.html,y=p?void 0:It(e),g=y?.lineHeight??16,x=y?.titleLines??(o?c?[o]:Nt(o,s,8):[]),b=y?.labelLines??(r?c?[r]:Nt(r,s,8):[]),v=x.length+b.length,w=h?"end"===m?-4:4:0,k=[],M=i||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(p){let e=s,t=Math.max(g,v*g+(o&&r?2:0)),n="end"===m?w-e:"middle"===m?w-e/2:w,i="end"===m?"right":"middle"===m?"center":"left";k.push(
29
- /* @__PURE__ */Ga("foreignObject",{className:"annotation-note-html",x:n,y:-g,width:e,height:t+g,style:{overflow:"visible"},children:/* @__PURE__ */_a("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:M,fontSize:"12px",lineHeight:`${g}px`,overflow:"visible",textAlign:i,whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&/* @__PURE__ */Ga("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),r&&/* @__PURE__ */Ga("div",{className:"annotation-note-label",children:r})]})},"annotation-note-html"))}else for(let e of[!0,!1]){let t=e?x:b;if(0===t.length)continue;let n="annotation-note-"+(e?"title":"label");k.push(
30
- /* @__PURE__ */Ga("text",{className:n,fill:M,textAnchor:m,fontWeight:e?y?.titleFontWeight??"bold":void 0,y:e?void 0:x.length*g,children:t.map((e,t)=>/* @__PURE__ */Ga("tspan",{x:w,dy:0===t?0:g,children:e},t))},n))}let A=null;if((o||r)&&(0!==t||0!==n)){let e=d?y?y.width:Math.min(s,120):(x.length+b.length+(b.length>0?1:0))*g,t=d?m:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;A=/* @__PURE__ */Ga("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}let S=Math.max(0,v-1)*g,$=b.length>0&&x.length>0?2:0,C=0;(d||h)&&(C=h&&"middle"===f?-(S+g+$)/2+g/2:n<0||h&&"bottom"===f?-(S+2):2+g);let j=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */
31
- return _a("g",{className:"annotation-note",transform:`translate(${t},${n})`,...y?.textProps,children:[
32
- /* @__PURE__ */Ga("g",{className:"annotation-note-content",transform:j,children:k}),A]})}function Ot(e,t,n,i,r){let o=null,a=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{let e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=/* @__PURE__ */Ga("circle",{r:e,fill:"none",stroke:a},"subject-circle"));break}case"callout-rect":{let e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=/* @__PURE__ */Ga("rect",{width:e,height:n,fill:"none",stroke:a},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{let e=i||0,n=r||0,l=0,s=0,c=0,u=0;if(void 0!==t?.x)l=s=(t.x||0)-e,c=(t.y1||0)-n,u=(t.y2||0)-n;else if(void 0!==t?.y)c=u=(t.y||0)-n,l=(t.x1||0)-e,s=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)l=(t.x1||0)-e,s=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;c=(t.y1||0)-n,u=(t.y2||0)-n}o=/* @__PURE__ */Ga("line",{x1:l,y1:c,x2:s,y2:u,stroke:a,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{let e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(o=/* @__PURE__ */Ga("path",{d:zt(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:a},"bracket-path"));break}}/* @__PURE__ */
33
- return Ga("g",{className:"annotation-subject",children:o})}function Ft(e,t,n,i,r,o){let a,l,s=0,c=0;if("callout-circle"!==r&&"label"!==r||!o?.radius){if("callout-rect"===r&&o){let n=o.width||0,i=o.height||0;if(n>0||i>0){let r=n/2,o=i/2,a=e-r,l=t-o;if(0!==a||0!==l){let e=Math.abs(a),t=Math.abs(l),u=n/2,d=i/2,h=e*d>t*u?u/e:d/t;s=r+a*h,c=o+l*h}}}else if("bracket"===r&&o){let e=o.width,t=o.height,n=o.depth||30;void 0!==e?(s=e/2,c=n):void 0!==t&&(s=n,c=t/2)}}else{let n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){let i=Math.atan2(t,e);s=Math.cos(i)*n,c=Math.sin(i)*n}}let u=e-s,d=t-c,h=Math.hypot(u,d);if(h>.5){let r=i||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type,f=Math.atan2(d,u);if(o){let i=(s+e)/2,o=(c+t)/2,l=-d/h,m=u/h,p=(n?.curve??.25)*h,y=i+l*p,g=o+m*p;a=/* @__PURE__ */Ga("path",{className:"connector-curve",d:`M${s},${c}Q${y},${g} ${e},${t}`,fill:"none",stroke:r},"connector-line"),f=Math.atan2(g-c,y-s)}else a=/* @__PURE__ */Ga("line",{x1:s,y1:c,x2:e,y2:t,stroke:r},"connector-line");if("arrow"===n?.end){let e=.08888888888888889*Math.PI,t=s+10*Math.cos(f+e),n=c+10*Math.sin(f+e),i=s+10*Math.cos(f-e),o=c+10*Math.sin(f-e);l=/* @__PURE__ */Ga("path",{d:`M${s},${c}L${t},${n}L${i},${o}Z`,fill:r,stroke:"none"},"connector-arrow")}}/* @__PURE__ */
34
- return _a("g",{className:"annotation-connector",children:[a,l]})}function Tt(e){let{x:t=0,y:n=0,dx:i,dy:r,nx:o,ny:a,note:l,connector:s,subject:c,type:u,color:d,className:h,disable:f,opacity:m,strokeDasharray:p,events:y={},"data-testid":g}=e,x=Array.isArray(t)?t[0]??0:t,b=Array.isArray(n)?n[0]??0:n,v=Array.isArray(f)?f:[],w=i||0,k=r||0;null!=o&&(w=o-x),null!=a&&(k=a-b);let M="string"==typeof u?u:"label";if("bracket"===M&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;let e=c.depth||30;k=e+(e>=0?5:-5)}else if(void 0!==c.height){let e=c.depth||30;w=e+(e>=0?5:-5),k=c.height/2}/* @__PURE__ */
35
- return _a("g",{className:`annotation ${h||""}`.trim(),transform:`translate(${x},${b})`,"data-testid":g,...null!=m&&{opacity:m},...p&&{strokeDasharray:p},...y,children:[!v.includes("connector")&&Ft(w,k,s,d,M,c),!v.includes("subject")&&Ot(M,c,d,x,b),!v.includes("note")&&Rt(l,w,k,d)]})}function Wt(e){let{noteData:t}=e,{screenCoordinates:n}=t,i="string"==typeof t.type?t.type:"label",r=t.eventListeners||t.events||{};if(t.coordinates&&n){let e=t.nx||n[0][0]+(t.dx??0),r=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{let a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:r});/* @__PURE__ */
36
- return Ga(Tt,{"data-testid":"semiotic-annotation",...a,type:i},`multi-annotation-${o}`)});/* @__PURE__ */
37
- return Ga("g",{children:o})}let o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;/* @__PURE__ */
38
- return Ga(Tt,{"data-testid":"semiotic-annotation",events:r,...t,type:i},a)}function Et(e,t){let n=t.scales?.x??t.scales?.time,i=t.scales?.y??t.scales?.value;if(!n||!i)return[];let r=t.data||[],o=t.xAccessor||"x",a=t.yAccessor||"y",l="horizontal"===t.projection,s="ordinal"===t.frameType;s&&l&&([o,a]=[a,o]);let c=n,u=i,d=l?u:c,h=s?t.scales?.o?.domain().map(String)??[...new Set(r.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),m=lr(r.map(e=>[s?null==e[o]?void 0:f.get(String(e[o])):e[o],e[a]]));return m.length<2?[]:("loess"===e.method?ur(m,e.bandwidth??.3):("polynomial"===e.method?cr(m,e.order??2):sr(m)).points).map(([e,t])=>{if(!s)return[c(e),u(t)];let n=d(h[e]);return l?[c(t),n]:[n,u(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}function Dt(e,t){let n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Bt(e,t){let n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Ht(e){let t=e.data;if(!t||0===t.length)return null;let n=t[t.length-1],i=e.scales?.x??e.scales?.time,r=e.scales?.y??e.scales?.value;if(!i||!r)return null;let o=e.xAccessor||"x",a=e.yAccessor||"y",l=n[o],s=n[a];return null==l||null==s?null:{x:i(l),y:r(s)}}function Pt(e){return null==e?null:String(e)}function Gt(e){return Pt(e.provenance?.stableId??e.stableId)}function _t(e){return Pt(e.stableId??e.id??e.provenance?.stableId)}function Vt(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Yt(e,t,n){let i=Gt(e);if(!i)return null;let r=n.pointNodes?.find(e=>Pt(e.pointId)===i);if(r)return Vt(t,n,{x:r.x,y:r.y});let o=n.data?.find(e=>_t(e)===i);if(!o)return null;let a=Dt(o,n),l=Bt(o,n);return null==a||null==l?null:Vt(t,n,{x:a,y:l})}function Ut(e,t,n){let i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){let r=n.pointNodes[i];if(r.pointId===e.pointId)return Vt(t,n,{x:r.x,y:r.y})}let i=Ht(n);return i?Vt(t,n,i):null}if("semantic"===i){let i=Yt(e,t,n);if(i)return i}let r=null,o=null;if(null!=e.pointId&&n.pointNodes){let t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(r=t.x,o=t.y)}if((null==r||null==o)&&(r=Dt(e,n),o=Bt(e,n)),null!=r&&null!=o)return Vt(t,n,{x:r,y:o});if("sticky"===i){let e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Xt(e,t,n,i=50){let r=n.width||0,o=n.height||0;return e>=-i&&e<=r+i&&t>=-i&&t<=o+i}function qt(e,t,n,i){let r=$r(e.fill??e.color,t,i),o="string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:i;return Cr(e.gradient,t,n,o)??r}function Kt(e,t,n){let i=e.position,r="string"==typeof i&&nl.has(i)?i:"bottom-left",o=r.endsWith("left")?"left":r.endsWith("right")?"right":"center",a=r.startsWith("top")?"top":r.startsWith("bottom")?"bottom":"middle",l="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:l+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}function Zt(e,t,n,i){return{...Kt(e,t,n),fill:e.fill??e.color??i.fill,fontSize:e.fontSize??i.fontSize,fontFamily:e.fontFamily??i.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function Jt({annotation:e,width:t,height:n,defaults:i=rl}){let r=e.label??e.text;return null==r?null:/* @__PURE__ */il("text",{...Zt(e,t,n,i),children:r})}function Qt(e,t={},n=!1){return function(e,i,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{let t=Ut(e,i,r);if(!t)return null;let{x:n,y:o}=t;if(!Xt(n,o,r))return null;let a="callout"===e.type?"callout-circle":e.type,l="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;/* @__PURE__ */
39
- return ol(Wt,{noteData:{x:n,y:o,dx:e.dx??30,dy:e.dy??-30,note:Lt(e),type:a,...l?{subject:l}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},`ann-${i}`)}case"x-threshold":case"y-threshold":{let t="x-threshold"===e.type,n=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?Dt(n,r):Bt(n,r);return null==o?null:/* @__PURE__ */ol(jt,{ann:e,position:o,vertical:t,width:r.width||0,height:r.height||0,color:e.color||"#f97316",bold:!0},`ann-${i}`)}case"enclose":{let t=(e.coordinates||[]).map(e=>({x:Dt({...e,type:"point"},r),y:Bt({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;let n=Va(t),o=e.padding||10;/* @__PURE__ */
40
- return al("g",{children:[
41
- /* @__PURE__ */ol("circle",{cx:n.x,cy:n.y,r:n.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ol(d,{x:n.x,y:n.y-n.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${i}`)}case"rect-enclose":{let t=(e.coordinates||[]).map(e=>({x:Dt({...e,type:"point"},r),y:Bt({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;let n=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[l,s]=no(o),[c,u]=no(a),h=l-n,f=s+n,m=c-n;/* @__PURE__ */
42
- return al("g",{children:[
43
- /* @__PURE__ */ol("rect",{x:h,y:m,width:f-h,height:u+n-m,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ol(d,{x:(h+f)/2,y:m-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${i}`)}case"highlight":{let t=r.data||[],n="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */
44
- return ol("g",{children:n.map((t,n)=>{let i=Dt(t,r),a=Bt(t,r);if(null==i||null==a)return null;let l="function"==typeof e.r?e.r(t):e.r||6,s="function"==typeof e.style?e.style(t):e.style||o;/* @__PURE__ */
45
- return ol("circle",{cx:i,cy:a,r:l,...s},`hl-${n}`)})},`ann-${i}`)}case"bracket":{let t=Dt(e,r),n=Bt(e,r);/* @__PURE__ */
46
- return ol(Wt,{noteData:{x:t??0,y:n??0,dx:e.dx||0,dy:e.dy||0,note:Lt(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},`ann-${i}`)}case"trend":{let t=Et(e,r);if(t.length<2)return null;let n=t.map(([e,t])=>`${e},${t}`).join(" "),o=e.color||"#6366f1",[a,l]=t[t.length-1];/* @__PURE__ */
47
- return al("g",{children:[
48
- /* @__PURE__ */ol("polyline",{points:n,fill:"none",stroke:o,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */ol("text",{x:a+4,y:l-4,fill:o,fontSize:11,children:e.label})]},`ann-${i}`)}case"band":{let t=r.scales?.y??r.scales?.value,o=t?.domain?.(),a=e.y0??o?.[0],l=e.y1??o?.[1],s=null!=a&&t?t(a):0,c=null!=l&&t?t(l):r.height||0,u=qt(e,`ann-${i}`,"vertical","var(--semiotic-primary, #6366f1)"),h=n&&"under"===e.layer;/* @__PURE__ */
49
- return al("g",{opacity:e.opacity,children:[!h&&u.def&&/* @__PURE__ */ol("defs",{children:u.def}),!h&&/* @__PURE__ */ol("rect",{x:0,y:Math.min(s,c),width:r.width||0,height:Math.abs(c-s),fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ol(d,{x:(r.width||0)-4,y:Ct(s,c),textAnchor:"end",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${i}`)}case"x-band":{let t=r.scales?.x??r.scales?.time,o=t?.domain?.(),a=e.x0??o?.[0],l=e.x1??o?.[1],s=null!=a&&t?t(a):null,c=null!=l&&t?t(l):null;if(null==s||null==c)return null;let u=qt(e,`ann-${i}`,"horizontal","var(--semiotic-primary, #6366f1)"),h=n&&"under"===e.layer;/* @__PURE__ */
50
- return al("g",{opacity:e.opacity,children:[!h&&u.def&&/* @__PURE__ */ol("defs",{children:u.def}),!h&&/* @__PURE__ */ol("rect",{x:Math.min(s,c),y:0,width:Math.abs(c-s),height:r.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ol(d,{x:Math.min(s,c)+4,y:16,textAnchor:"start",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${i}`)}case"envelope":{let t=r.data||[];if(t.length<2)return null;let n=r.xAccessor||"x",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;let l=e.upperAccessor||"upperBounds",s=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>!(null==e[l]||null==e[s]||c&&!c(e))).sort((e,t)=>e[n]-t[n]);if(u.length<2)return null;let d=ll[r.curve||"linear"]||Ua,h=Ya().x(e=>o(e[n])).y0(e=>a(e[s])).y1(e=>a(e[l])).curve(d)(u);if(!h)return null;let f=e.fill||"#6366f1";/* @__PURE__ */
51
- return al("g",{children:[
52
- /* @__PURE__ */ol("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */ol("text",{x:o(u[u.length-1][n])+4,y:a(u[u.length-1][l])-4,fill:f,fontSize:11,children:e.label})]},`ann-${i}`)}case"anomaly-band":{let t=(r.data||[]).filter(t=>!e.filter||e.filter(t));if(t.length<2)return null;let n=r.yAccessor||"y",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;let l=t.map(e=>ar(e[n])).filter(e=>null!==e);if(l.length<2)return null;let s=l.reduce((e,t)=>e+t,0)/l.length,c=l.reduce((e,t)=>e+(t-s)**2,0)/l.length,u=Math.sqrt(c),d=e.threshold??2,h=s+d*u,f=s-d*u,m=!1!==e.showBand,p=e.fill||"#6366f1",y=e.fillOpacity??.1,g=e.anomalyColor||"#ef4444",x=e.anomalyRadius??6,b=a(h),v=a(f),w=t.filter(e=>{let t=ar(e[n]);return null!=t&&Math.abs(t-s)>d*u});/* @__PURE__ */
53
- return al("g",{children:[m&&/* @__PURE__ */ol("rect",{x:0,y:Math.min(b,v),width:r.width||0,height:Math.abs(v-b),fill:p,fillOpacity:y}),w.map((e,t)=>{let n=Dt(e,r),i=Bt(e,r);return null==n||null==i?null:/* @__PURE__ */ol("circle",{cx:n,cy:i,r:x,fill:g,fillOpacity:.7,stroke:g,strokeWidth:1.5},`anomaly-${t}`)}),e.label&&/* @__PURE__ */ol("text",{x:(r.width||0)-4,y:Math.min(b,v)-4,textAnchor:"end",fill:p,fontSize:11,children:e.label})]},`ann-${i}`)}case"forecast":{let t=r.data||[],n=r.xAccessor||"x",o=r.yAccessor||"y",a=r.scales?.x??r.scales?.time,l=r.scales?.y??r.scales?.value;if(!a||!l)return null;let s=lr(t.map(e=>[e[n],e[o]])),c=dr(s,e);if(!c)return null;let{predict:u}=c,d=s[s.length-1][0],h=c.forecast(e.steps??5);if(!h.length)return null;let f=Ya().x(e=>a(e.x)).y0(e=>l(e.lower)).y1(e=>l(e.upper))(h);if(!f)return null;let m=h.map(e=>`${a(e.x)},${l(e.y)}`).join(" "),p=`${a(d)},${l(u(d))}`,y=e.fill||"#6366f1",g=e.strokeColor||"#6366f1";/* @__PURE__ */
54
- return al("g",{children:[
55
- /* @__PURE__ */ol("path",{d:f,fill:y,fillOpacity:e.fillOpacity??.15,stroke:"none"}),
56
- /* @__PURE__ */ol("polyline",{points:`${p} ${m}`,fill:"none",stroke:g,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&h.length>0&&/* @__PURE__ */ol("text",{x:a(h[h.length-1].x)+4,y:l(h[h.length-1].y)-4,fill:g,fontSize:11,children:e.label})]},`ann-${i}`)}case"widget":{let n,o;if(null!=e.px&&null!=e.py)n=e.px,o=e.py;else{let t=Ut(e,i,r);if(!t)return null;n=t.x,o=t.y}if(!Xt(n,o,r))return null;let a=e.dx??0,l=e.dy??0,s=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */ol("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */
57
- return ol("foreignObject",{x:n+a-s/2,y:o+l-c/2,width:s,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */ol("div",{...p(e,t),style:{width:s,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},`ann-${i}`)}case"text":{let t=Ut(e,i,r);if(!t)return null;let{x:n,y:o}=t,a=n+(e.dx||0),l=o+(e.dy||0),s=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */ol("text",{x:a,y:l,fill:s,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Pa.cloneElement(c,{key:`ann-text-${i}`}):/* @__PURE__ */al("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
58
- /* @__PURE__ */ol("line",{x1:n,y1:o,x2:a,y2:l,stroke:s,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Pa.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},`ann-text-${i}`)}case"frame-text":/* @__PURE__ */
59
- return ol(Jt,{annotation:e,width:r.width||0,height:r.height||0},`ann-frame-text-${i}`);case"category-highlight":{let t=e.category;if(null==t)return null;let n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=r.scales?.o,a=r.scales?.x,l=r.scales?.y,s=n(o)?o:n(a)?a:n(l)?l:null;if(!s)return null;let c=s(String(t));if(null==c)return null;let u=s.bandwidth(),h=r.projection?"vertical"===r.projection:s===a,f=e.color||"var(--semiotic-primary, #4589ff)",m=e.opacity??.15,p=e.label;/* @__PURE__ */
60
- return al("g",h?{children:[
61
- /* @__PURE__ */ol("rect",{x:c,y:0,width:u,height:r.height||0,fill:f,fillOpacity:m}),p&&/* @__PURE__ */ol(d,{x:c+u/2,y:16,textAnchor:"middle",fill:f,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]}:{children:[
62
- /* @__PURE__ */ol("rect",{x:0,y:c,width:r.width||0,height:u,fill:f,fillOpacity:m}),p&&/* @__PURE__ */ol(d,{x:12,y:c+u/2,dominantBaseline:"middle",fill:f,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${i}`)}default:return null}}}function en(e){return"string"==typeof e?.type?e.type:""}function tn(e){return!!e&&"object"==typeof e&&cl.has(en(e))}function nn(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function rn(e){return ul.has(en(e))&&!nn(e)}function on(e,t,n){return Math.max(t,Math.min(n,e))}function an(e){return tn(e)}function ln(e){return"primary"===e?.emphasis||!0===e?.defensive}function sn(e,t,n={}){if("number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations))return Math.max(0,Math.floor(n.maxAnnotations));if(!(e>0&&t>0))return 1/0;let i=n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/i))}function cn(e){let t,n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;let i=e?.provenance?.confidence;switch("number"==typeof i&&Number.isFinite(i)&&(t+=15*on(i,0,1)),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function un(e){let{annotations:t,width:n,height:i}=e,r=Math.max(0,e.minVisible??1),o=sn(n,i,e),a=t.map((e,t)=>({annotation:e,index:t,note:an(e)})),l=a.filter(e=>e.note);if(0===l.length||l.length<=o)return{visible:t.slice(),deferred:[],budget:o};let s=l.filter(e=>ln(e.annotation)),c=l.filter(e=>!ln(e.annotation)).sort((e,t)=>cn(t.annotation)-cn(e.annotation)||e.index-t.index),u=Math.max(0,o-s.length),d=Math.max(0,r-s.length),h=Math.min(c.length,Math.max(u,d)),f=/* @__PURE__ */new Set([...s.map(e=>e.index),...c.slice(0,h).map(e=>e.index)]),m=[],p=[];for(let{annotation:e,index:t,note:n}of a)!n||f.has(t)?m.push(e):p.push(e);return{visible:m,deferred:p,budget:o}}function dn(e){return"number"==typeof e.dx||"number"==typeof e.dy}function hn(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function fn(e){let t=e?.familiarity;if(!t)return 3;let n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function mn(e){if(!e)return 1;let t=fn(e);return t<=2?1.5:t>=4?.6:1}function pn(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(yl,t.source)?yl[t.source]:t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?`${Math.round(100*Math.max(0,Math.min(1,t.confidence)))}%`:null;if(!n&&!i||null!=e.label&&"string"!=typeof e.label)return e;let r=[n,i].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${r})`)?e:{...e,label:o?`${o} (${r})`:`(${r})`}}function yn(e,t){let n=!1,i=e.map(e=>bn(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(n=!0,{...e,cohesion:t}):e);return n?i:e}function gn(e){if(!bn(e))return e;let t="string"==typeof e.mobileText?e.mobileText:void 0,n="string"==typeof e.shortText?e.shortText:void 0,i=t??n;return!i||"string"!=typeof e.label&&null!=e.label?e:{...e,label:i}}function xn(e){if("text"!==e.type||"string"!=typeof e.color)return e;let t="number"==typeof e.dx?e.dx:0,n="number"==typeof e.dy?e.dy:0;return Math.hypot(t,n)<8?e:{...e,_redundantConnector:!0}}function bn(e){return tn(e)}function vn(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=It(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let n="number"==typeof e.wrap?e.wrap:120,i=[...Nt("string"==typeof e.title?e.title:void 0,n,7),...Nt("string"==typeof e.label?e.label:void 0,n,7)],r=i.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*r)+10),height:Math.max(18,16*i.length+6)}}function wn(e,t,n,i,r){let o=e+n,a=t+i;return Math.abs(n)>Math.abs(i)?{x:n>=0?o+4:o-r.width-4,y:i<0?a-r.height:a,width:r.width,height:r.height}:{x:n>=0?o:o-r.width,y:i<0?a-r.height-4:a+4,width:r.width,height:r.height}}function kn(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Mn(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function An(e,t,n,i){let r=Math.max(0,i-e.x),o=Math.max(0,i-e.y),a=Math.max(0,e.x+e.width-(t-i)),l=Math.max(0,e.y+e.height-(n-i));return(r+a)*e.height+(o+l)*e.width}function Sn(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function $n(e,t){return(e.pointNodes||[]).map(e=>{let n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function Cn(e,t,n,i,r,o,a,l){let s=kn(e,a),c=.4*Math.hypot(t.dx,t.dy)+80*An(s,r,o,l);for(let e of n)c+=12*Mn(s,e);for(let e of i)c+=4*Mn(s,e);return c}function jn(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){let e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}let r=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(r)&&r.length>=2&&o){let e=r[0],t=r[1];if("number"==typeof e&&"number"==typeof t){let n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?Ut(e,t,n):{x:e.x,y:e.y}}function Ln(e){let{annotations:t,context:n,defaultOffset:i=dl,notePadding:r=hl,markPadding:o=fl,edgePadding:a=ml,preserveManualOffsets:l=!0,routeLongConnectors:s=!0,connectorThreshold:c=pl,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:p,audience:y}=e,g=n.width||0,x=n.height||0,b="object"==typeof m?m:{},v=b.breakpoint??480,w=!!m&&g<=v,k=w&&!1!==b.preferShortText?t.map(gn):t,M=w&&!u?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:u,A=d||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),S=w&&!f?b.responsive??{minWidth:v}:f,$=w&&!p?b.cohesion:p;if(0===k.length||g<=0||x<=0)return k.slice();let C=[],j=$n(n,o),L=!1,I=k.map((e,t)=>{if(!bn(e))return e;let o=jn(e,t,n);if(!o)return e;let u=vn(!0===e.defensive?pn(e):e);if(l&&dn(e)){let t=hn(e),n="number"==typeof e.dx?e.dx:t.dx,i="number"==typeof e.dy?e.dy:t.dy;return C.push(kn(wn(o.x,o.y,n,i,u),r)),e}let d=null,h=1/0;for(let e of Sn(i)){let t=Cn(wn(o.x,o.y,e.dx,e.dy,u),e,C,j,g,x,r,a);t<h&&(d=e,h=t)}if(!d)return e;let f=kn(wn(o.x,o.y,d.dx,d.dy,u),r);C.push(f);let m=Math.hypot(d.dx,d.dy),p=s&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:d.dx,dy:d.dy,...p?{connector:p}:{}}}),N=L?I:k.slice(),z=N;if(h){let e=!1,t=N.map(t=>{let n=xn(t);return n!==t&&(e=!0),n});z=e?t:N}{let e=!1,t=z.map(t=>{if(!0!==t?.defensive)return t;let n=pn(t);return n!==t&&(e=!0),n});z=e?t:z}let R,O=/* @__PURE__ */new Set;if(M){let e="object"==typeof M?M:{},t=mn(y),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??sn(g,x,e))*t))},{deferred:i}=un({annotations:z,width:g,height:x,...n});for(let e of i)O.add(e)}if(S){let e="object"==typeof S&&"number"==typeof S.minWidth?S.minWidth:480;if(g<=e)for(let e of z)bn(e)&&"secondary"===e.emphasis&&O.add(e)}if(O.size>0)for(let e of z)!0===e?.defensive&&O.delete(e);return R=0===O.size?z:A?z.map(e=>O.has(e)?{...e,_annotationDeferred:!0}:e):z.filter(e=>!O.has(e)),$?yn(R,$):R}function In({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */gl("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */gl("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function Nn(e){if(!1!==e?.interactive)return e?.style?.cursor}function zn(e){if(!e)return!1;for(let t of e)if(Nn(t))return!0;return!1}function Rn(e,t){if(!e)return;let n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function On(e,t){return Rn(e),zn(t)}function Fn(e,t,n){if(e){if(!t.inside||"touch"===t.pointerType)return void Rn(e);Rn(e,n(t))}}function Tn(e){let t=xl.useRef(null);xl.useEffect(()=>{e.current&&(t.current=e.current)}),xl.useEffect(()=>()=>Rn(t.current),[])}function Wn(e,t,n){let i=Nn(t);return i&&null!=e&&!1!==e?/* @__PURE__ */bl("g",{style:{cursor:i},"data-semiotic-mark-cursor":i,children:e},n):e}function En(){let[e,t]=Ml(!1);return Sl(()=>{t(!0)},[]),e}function Dn(){let e=Al($l,Cl,jl);return kl(e).current}function Bn(e){let{hydrated:t,wasHydratingFromSSR:n,storeRef:i,dirtyRef:r,renderFnRef:o,cancelRender:a,cleanup:l}=e;Sl(()=>{if(!t)return;let e=i.current;t&&n&&e?.cancelIntroAnimation?.();let l=!!e?.sceneNodes&&e.sceneNodes.length>0;!n&&l&&e?.markStylePaintPending?e.markStylePaintPending():r.current=!0,a?.(),o.current()},[t,n]);let s=kl(l);s.current=l,vl(()=>()=>s.current?.(),[])}function Hn(e,t){return Pn(e,t,2)}function Pn(e,t,n){if(Object.is(e,t))return!0;if(0===n)return!1;if(Array.isArray(e)&&Array.isArray(t))return Gn(e,t);if(!_n(e)||!_n(t))return!1;let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(let r of i)if(!Object.prototype.hasOwnProperty.call(t,r)||!Pn(e[r],t[r],n-1))return!1;return!0}function Gn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function _n(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Vn(e){let t=Ll(e);return Hn(t.current,e)||(t.current=e),t.current}function Yn({hoverPoint:e,scene:t,active:n=!0}){let i="";if(n&&e){let n=e.data??e,r="stats"in e?e.stats:void 0,o=r&&t?.find(e=>e.stats===r)||t?.find(e=>e.datum===n)||t?.find(e=>Array.isArray(e.datum)&&e.datum.includes(n)),a=o?Or(o):n,l=r&&o&&("boxplot"===o.type||"violin"===o.type)&&Array.isArray(a)?{category:o.category,...Rr(o.stats)}:a;if(null!=l&&"object"==typeof l){let e=(Array.isArray(l)?l:[l]).map(e=>Object.entries(Rr(e)).map(([e,t])=>`${e}: ${t}`).join(", ")).filter(Boolean);i=e.length>0?`Data point: ${e.join("; ")}`:""}else i=`Data point: ${String(l)}`}/* @__PURE__ */
63
- return Il("div",{"aria-live":"polite","aria-atomic":"true",style:hr,children:i})}function Un({children:e}){let[t,n]=Nl.useState(!1),i=Nl.useCallback(()=>n(e=>!e),[]),r=Nl.useMemo(()=>({visible:t,setVisible:n,toggle:i}),[t,i]);/* @__PURE__ */
64
- return zl(Rl.Provider,{value:r,children:e})}function Xn(){let e=Nl.useContext(Rl);return e?e.toggle:null}function qn({interaction:e,tableId:t,regionLabel:n,countLabel:i,summary:r,children:o,className:a=Wr}){let{isExpanded:l,containerRef:s,triggerRef:c,open:u,handleFocus:d,handleBlur:h,dismiss:f,announcement:m}=e,[p,y]=Fl.useState(!1);/* @__PURE__ */
65
- return Wl("div",{ref:s,id:t,className:l?a:Tr,tabIndex:-1,onFocus:l?void 0:d,onBlur:l?h:void 0,style:l?Dr:p?fr:hr,role:"region","aria-label":n,children:l?/* @__PURE__ */El(Tl,{children:[
66
- /* @__PURE__ */Wl("div",{role:"status","aria-atomic":"true",style:hr,children:m}),
67
- /* @__PURE__ */Wl("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:f,"aria-label":"Close data summary",style:Hr,children:"×"}),r&&/* @__PURE__ */Wl("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Br,children:r}),o]}):/* @__PURE__ */El("button",{ref:c,type:"button",onClick:u,onFocus:()=>y(!0),onBlur:()=>y(!1),style:Er,children:["View data summary (",i,")"]})})}function Kn(){let[e,t]=Dl.useState(!1),[n,i]=Dl.useState(""),r=Nl.useContext(Rl),o=r?.visible??!1,a=e||o,l=Dl.useRef(null),s=Dl.useRef(null),c=Dl.useRef(null),u=Dl.useRef(!1),d=Dl.useRef(!1),h=Dl.useRef(null);Bl(()=>{if(a&&!d.current){let e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&!l.current?.contains(e)&&(c.current=e),l.current?.focus()}else!a&&d.current&&(u.current&&(c.current?.isConnected?c.current:s.current)?.focus(),u.current=!1,c.current=null,h.current=null,i(""));d.current=a;let e=h.current;a&&e&&(e.table.querySelectorAll("tbody tr")[e.index]?.focus(),h.current=null)});let f=()=>t(!0);return{isExpanded:a,containerRef:l,triggerRef:s,open:f,handleFocus:e=>{e.target!==e.currentTarget||a||(e.relatedTarget instanceof HTMLElement&&(c.current=e.relatedTarget),f())},handleBlur:e=>{o||l.current?.contains(e.relatedTarget)||t(!1)},dismiss:()=>{u.current=!0,o&&r?.setVisible(!1),t(!1)},revealRows:(e,t,n,r,o="rows")=>{let a=e.previousElementSibling;a&&(h.current={table:a,index:t}),i(`${n} of ${r} ${o} shown.`)},announcement:n}}function Zn({accessibleTable:e,children:t}){let n=En();return"object"!=typeof e?t:n?/* @__PURE__ */Hl(Ol.Suspense,{fallback:null,children:/* @__PURE__ */Hl(Gl,{target:e.portalTarget,children:t})}):null}function Jn(e,t){if(!e||0===e.length)return`${t}, empty`;let n={};for(let t of e){if(null===t?.datum)continue;let e=String(t.type);n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return`${t}, empty`;let i=[],r={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=Object.keys(r),a=Object.keys(n).sort((e,t)=>{let n=o.indexOf(e),i=o.indexOf(t);return(-1===n?999:n)-(-1===i?999:i)});for(let e of a){let t=r[e]||e;i.push(`${n[e]} ${t}`)}return`${t}, ${i.join(", ")}`}function Qn(e,t,n){let i=[];return e>0&&i.push(`${e} nodes`),t>0&&i.push(`${t} edges`),0===i.length?`${n}, empty`:`${n}, ${i.join(", ")}`}function ei({accessibleTable:e,...t}){return e?/* @__PURE__ */Pl(Zn,{accessibleTable:e,children:[
68
- /* @__PURE__ */Hl(ii,{tableId:t.tableId}),
69
- /* @__PURE__ */Hl(ti,{...t})]}):null}function ti(e){let{scene:t,chartType:n,tableId:i,chartTitle:r}=e,o=Kn(),a=r?`Data summary for ${r}`:i?`Data summary for ${n} ${i}`:`Data summary for ${n}`;return t&&0!==t.length?/* @__PURE__ */Hl(qn,{interaction:o,tableId:i,regionLabel:a,countLabel:`${Fr(t)} elements`,children:o.isExpanded&&/* @__PURE__ */Hl(Ol.Suspense,{fallback:/* @__PURE__ */Hl("div",{role:"status",children:"Loading data summary…"}),children:/* @__PURE__ */Hl(_l,{...e,revealRows:o.revealRows})})}):i?/* @__PURE__ */Hl("span",{id:i,tabIndex:-1,style:hr}):null}function ni({summary:e}){return e?/* @__PURE__ */Hl("div",{role:"note",style:hr,children:e}):null}function ii({tableId:e}){let[t,n]=Ol.useState(!1);/* @__PURE__ */
70
- return Hl("a",{href:`#${e}`,style:t?fr:hr,onClick:t=>{t.preventDefault();let n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function ri({active:e,hoverPoint:t,margin:n,size:i,shape:r="circle",width:o,height:a,pathData:l}){if(!e||!t)return null;let s,c=t.x+n.left,u=t.y+n.top;if("geoarea"!==r&&"path"!==r||!l)if("rect"===r&&null!=o&&null!=a){let e=Math.max(o,4),t=Math.max(a,4);s=/* @__PURE__ */Vl("rect",{x:c-e/2-3,y:u-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Yl,strokeWidth:2,strokeDasharray:"4,2"})}else s=/* @__PURE__ */Vl("circle","wedge"===r?{cx:c,cy:u,r:12,fill:"none",stroke:Yl,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:c,cy:u,r:8,fill:"none",stroke:Yl,strokeWidth:2,strokeDasharray:"4,2"});else s=/* @__PURE__ */Vl("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */Vl("path",{d:l,fill:"none",stroke:Yl,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */
71
- return Vl("svg",{style:{position:"absolute",left:0,top:0,width:i[0],height:i[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:s})}function oi({x:e,y:t,containerWidth:n,containerHeight:i,margin:r,children:o,contentOwnsChrome:a=!1,className:l="stream-frame-tooltip",zIndex:s=1}){let c=Number.isFinite(e)&&Number.isFinite(t),u=g(o),d=Ul.useRef(null),[h,f]=Ul.useState(null);Ul.useLayoutEffect(()=>{let e=d.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();!Number.isFinite(t.width)||!Number.isFinite(t.height)||f(e=>e&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>"u")return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[l,n,i,c,u]);let m,p=Ul.useRef(null),y=e,x=t,b=!1,w=!1;if(h){let r=i-t;b=n-e<h.width+12,w=r<h.height+12,y=Math.max(0,Math.min(e+(b?-h.width-12:12),n-h.width)),x=Math.max(0,Math.min(t+(w?-h.height-4:4),i-h.height)),m="none"}else m=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*i?"4px":"calc(-100% - 4px)"})`;let k=h?{flipX:b,flipY:w}:null,M=p.current,A=!k||!M||M.flipX!==k.flipX||M.flipY!==k.flipY;Ul.useLayoutEffect(()=>{p.current=k});let S=a||v(o),$=S?null:ho,C=S?l:`${l} semiotic-tooltip`.trim();return c&&u?/* @__PURE__ */Xl("div",{ref:d,className:C,"data-placement":k?"placed":"pending","data-flip-x":b?"true":"false","data-flip-y":w?"true":"false",style:{...$||{},position:"absolute",left:r.left+y,top:r.top+x,transform:m,...A&&{transition:"none"},pointerEvents:"none",zIndex:s,width:"max-content",maxWidth:S?n:`min(${n}px, ${ho.maxWidth})`,boxSizing:"border-box"},children:o}):null}function ai(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function li(e){let t=Ur(),n=es(t);n.current=t;let[i,r]=Pe(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=r[0],a=r[1],l=Ql(()=>[o,a],[o,a]),s=!!e.title,c=Ql(()=>{let t=ge({...e.marginDefault,...e.userMargin},s);if(e.legend&&!e.legendMarginReserved){let n={...t},i=e.legendPosition??"right";Ie(t,{legend:e.legend,position:i,size:l,hasTitle:s,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),xe(t,n,l,i)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,s,l]),u=Math.max(1,r[0]-c.left-c.right),d=Math.max(1,r[1]-c.top-c.bottom),h=ai(e.foregroundGraphics,r,c),f=ai(e.backgroundGraphics,r,c),m=Gr(e=>e.theme),{transition:p,introEnabled:y}=to(e.animate,e.transitionProp),g=`semiotic-table-${ql.useId()}`,x=es(null);if(!x.current){let t=!e.suspendWhenHidden||typeof document>"u"||!document.hidden;x.current=new rr({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}let b=x.current;b.configure({clock:e.clock,random:e.random,seed:e.seed});let v=es(null),w=es(e.frameScheduler??rs);w.current=e.frameScheduler??rs;let k=es(null),M=es(!1),A=es(()=>{}),S=Kl(()=>{if(null!==v.current||M.current)return;let e=w.current,t=!1,n=!1,i=e.requestAnimationFrame(()=>{t=!0;let e=!n;e&&(M.current=!0),v.current=null,k.current=null;try{A.current()}finally{e&&(M.current=!1)}});n=!0,t||(v.current=i,k.current=e)},[]),$=Kl(()=>{null!==v.current&&((k.current??w.current).cancelAnimationFrame(v.current),v.current=null,k.current=null)},[]);is(()=>{b.setPaused(!0===e.paused)},[b,e.paused]),Zl(()=>{if(!e.suspendWhenHidden||typeof document>"u")return void b.setVisible(!0);let t=()=>b.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[b,e.suspendWhenHidden]),Zl(()=>()=>{$()},[$]);let C=es(()=>{}),j=es(()=>{}),L=es({inside:!1,clientX:0,clientY:0,pointerType:void 0}),I=es(null),N=es(null),z=es(null),R=Kl(()=>{let e=I.current;I.current=null,e&&C.current(e)},[]),O=Kl(e=>{let t=L.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,I.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===N.current){let e=w.current,t=!1,n=e.requestAnimationFrame(()=>{t=!0,N.current=null,z.current=null,R()});t||(N.current=n,z.current=e)}},[R]),F=Kl(()=>{L.current.inside=!1,I.current=null,null!==N.current&&((z.current??w.current).cancelAnimationFrame(N.current),N.current=null,z.current=null),j.current()},[]);Zl(()=>()=>{I.current=null,null!==N.current&&((z.current??w.current).cancelAnimationFrame(N.current),N.current=null,z.current=null)},[]);let T=e.themeDirtyRef,W=es(!1);return is(()=>{if(!T)return;let t=!W.current;W.current=!0,(!t||!e.skipInitialThemeInvalidation)&&(kr(),T.current=!0,S())},[m,e.skipInitialThemeInvalidation,S,T]),Zl(()=>{if(T)return wr(()=>i.current,()=>{T.current=!0,S()})},[i,S,T]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:i,size:r,margin:c,adjustedWidth:u,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:m,transition:p,introEnabled:y,tableId:g,frameRuntime:b,rafRef:v,renderFnRef:A,scheduleRender:S,cancelRender:$,hoverHandlerRef:C,hoverLeaveRef:j,onPointerMove:O,onPointerLeave:F,pointerStateRef:L}}function si(e,t,n){let i=Math.round(t[0]*n),r=Math.round(t[1]*n),o=0===t[0]?n:i/t[0],a=0===t[1]?n:r/t[1],l=`${t[0]}px`,s=`${t[1]}px`;e.style.width!==l&&(e.style.width=l),e.style.height!==s&&(e.style.height=s);let c=e.width!==i||e.height!==r;return e.width!==i&&(e.width=i),e.height!==r&&(e.height=r),{effectiveDprX:o,effectiveDprY:a,resized:c}}function ci(){if(!(typeof window>"u"||"function"!=typeof window.matchMedia))return ns!==window.matchMedia&&(ns=window.matchMedia,ts=window.matchMedia("(pointer: coarse)")),ts}function ui(e,t,n,i){let r=e.getContext("2d");if(!r)return null;let{effectiveDprX:o,effectiveDprY:a}=si(e,t,i);return r.setTransform(o,0,0,a,0,0),r.translate(n.left,n.top),r}function di(e,t){if(typeof window>"u")return 1;let n=window.devicePixelRatio||1,i=typeof window>"u"||!(!0===ci()?.matches||Math.min(window.innerWidth||1/0,window.innerHeight||1/0)<768)?3:2,r="number"==typeof e&&e>0?e:i;if(!t)return Math.max(1,Math.min(n,r));let[o,a]=t,l=Math.min(Math.sqrt(8388608/(o*a)),16384/Math.max(o,a));return Math.max(l<1?0:1,Math.min(n,r,l))}function hi(e){function t(){i||(n(),r=di(),e(),queueMicrotask(()=>{i||o()}))}if(typeof window>"u")return()=>{};let n=()=>{},i=!1,r=0,o=()=>{if("function"!=typeof window.matchMedia)return;let e=`(resolution: ${window.devicePixelRatio||1}dppx)`,i=window.matchMedia(e);i.media.includes("resolution")&&(n=Yr(i,t))};o(),r=di();let a=ci(),l=()=>{if(i)return;let t=di();t!==r&&(r=t,e())};window.addEventListener("resize",l);let s=Yr(a,l);return()=>{i=!0,window.removeEventListener("resize",l),s(),n()}}function fi(e){let{cancelRender:t,dirtyRef:n,frameRuntime:i,manageFrameRuntime:r,maxDevicePixelRatio:o,scheduleRender:a}=e,l=ls(null),s=ls(null),c=ls(!1),u=ls(!1),d=ls(!1);return us(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),Bn({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),os(()=>{if(!1!==r)return i.subscribe(()=>{i.isActive?(n.current=!0,a()):t()})},[t,n,i,r,a]),os(()=>hi(()=>{c.current=!0,a()}),[a]),os(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:l,interactionCanvasRef:s,resolutionDirtyRef:c}}function mi(e,t){return fi({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function pi({children:e,size:t,margin:n,backdropFill:i,overflowVisible:r=!1}){return e||i?/* @__PURE__ */cs("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:[i&&"transparent"!==i?/* @__PURE__ */ss("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:i}):null,
72
- /* @__PURE__ */ss("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function yi(e){return"touch"===e?"touch":"pointer"}function gi(e){let t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function xi(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:o,chartId:a,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"hover-end",timestamp:s,chartType:o,chartId:a});t({type:"hover",datum:n,x:i,y:r,timestamp:s,chartType:o,chartId:a}),"focus"===l?.type&&t({type:"focus",datum:n,inputType:"touch"===l.inputType?"pointer":l.inputType,timestamp:s,chartType:o,chartId:a})}}function bi(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:o,chartId:a,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"click-end",timestamp:s,chartType:o,chartId:a});t({type:"click",datum:n,x:i,y:r,timestamp:s,chartType:o,chartId:a}),"activate"===l?.type&&t({type:"activate",datum:n,inputType:l.inputType,timestamp:s,chartType:o,chartId:a})}}function vi({componentName:e,width:t,height:n,children:i}){/* @__PURE__ */
73
- return ds(So,{fallback:i=>/* @__PURE__ */ds(T,{componentName:e,message:i.message,width:t,height:n}),children:i})}function wi(e,t,n,i){return!1===i||null==e||Array.isArray(e)&&e.length>0||!Array.isArray(e)?null:/* @__PURE__ */ds("div",{style:{...hs,width:t,height:n},children:i||"No data available"})}function ki(e,t,n,i){if(!e||!1===i)return null;if(null!=i)/* @__PURE__ */
74
- return ds("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:i});let r=Math.min(5,Math.floor(n/40)),o=Math.max(8,Math.floor(n/(3*r))),a=Math.max(6,Math.floor(n/(2.5*r))),l=Math.floor((n-(r*(o+a)-a))/2);/* @__PURE__ */
75
- return ds("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:r},(e,n)=>/* @__PURE__ */ds("div",{className:"semiotic-loading-bar",style:{...fs,position:"absolute",top:l+n*(o+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:o,opacity:.5+n%2*.2}},n))})}function Mi(e,t,n,i){if("production"===process.env.NODE_ENV||!t||0===t.length||"string"!=typeof i)return;let r=t[0];if(!r||"object"!=typeof r||i in r)return;let o=Object.keys(r).join(", ");console.warn(`[semiotic] ${e}: ${n} "${i}" not found in data. Available keys: ${o}`)}function Ai(e,t={}){let n=t.mobileSemantics?.interaction,i="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,r="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!n||void 0!==i,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!r&&!o)return ms;let l=a??{};return{enabled:!0,tapToSelect:l.tapToSelect??!0,tapToLockTooltip:l.tapToLockTooltip??!0,clearSelection:l.clearSelection??"backgroundTap",targetSize:l.targetSize??i??44,snap:l.snap??"nearestDatum",brushHandleSize:l.brushHandleSize??44,standardControls:l.standardControls??!1}}function Si(e,t,n){let i=ps[e||"primary"],r=e&&"primary"!==e||!n?.width?i.width:n.width,o=e&&"primary"!==e||!n?.height?i.height:n.height,a=ce({...t,mode:e},{width:t.width??r,height:t.height??o}).props,l=a.mode||e||"primary",s=ps[l],c="context"===l||"sparkline"===l,u="primary"===l&&n?.width?n.width:s.width,d="primary"===l&&n?.height?n.height:s.height;return{mode:l,width:a.width??u,height:a.height??d,showAxes:a.showAxes??s.showAxes,showGrid:a.showGrid??s.showGrid,enableHover:a.enableHover??(!!a.linkedHover||s.enableHover),showLegend:a.showLegend??s.showLegend,showLabels:a.showLabels??s.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:Ci(s.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Ai(a.mobileInteraction,{mode:l,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function $i(e){return e.compactMode?e.marginDefaults:ys}function Ci(e,t,n){if(!1!==t)return e;let i={...e};return"horizontal"===n?i.left=Math.min(i.left,15):i.bottom=Math.min(i.bottom,15),i}function ji({data:e,colorBy:t,colorScale:n,getColor:i,strokeColor:r,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{let t=e.color||"#333",n={fill:t,stroke:t};return void 0!==r&&(n.stroke=r),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((r,o)=>{let a="function"==typeof t?e.find(e=>t(e)===r):e.find(e=>e[t]===r),l=a?i(a,t,n):n?n(r):gr[o%gr.length];return{label:String(r),color:l,__semioticCategory:!0}}),label:""}]}}function Li(e,t){if(!t)return[];let n=/* @__PURE__ */new Set;for(let i of e){let e="function"==typeof t?t(i):i[t];null!=e&&n.add(String(e))}return Array.from(n)}function Ii(e,t){return null!=e&&Object.hasOwn(e,t)}function Ni(e,t,n){let i=Ii(n,"legendPosition"),r=Ii(n,"legendLayout");return{legendPosition:i?n?.legendPosition??"right":e??"right",legendLayout:r?n?.legendLayout:t}}function zi({data:e,colorBy:t,colorScale:n,showLegend:i,legendPosition:r,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:l,additionalLegend:s,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){let{legendPosition:p,legendLayout:y}=Ni(r,d,h),g=Ii(h,"legend"),x=Po(ga),b=Ue(),v=void 0!==i?i:!x&&!!t,w=!!t&&(v||b),k=gs(()=>w?void 0!==l?l:Li(e,t):[],[l,t,e,w]);Ye(b&&t?k:[],n);let M=gs(()=>{if(!v||!t)return;let i=ji({data:e,colorBy:t,colorScale:n,getColor:xr,categories:k});return 0!==i.legendGroups.reduce((e,t)=>e+t.items.length,0)?i:void 0},[v,t,e,n,k]),A=gs(()=>g?h?.legend:me(M,s),[M,s,h?.legend,g]),{hasAxis:S,hasAxisLabel:$,rotatedTicks:C,topAxis:j,leftAxis:L,rightAxis:I}=m??{},N=void 0!==j,z=void 0!==L,R=void 0!==I,{hasAxis:O,hasAxisLabel:F,rotatedTicks:T}=j??{},{hasAxis:W,hasAxisLabel:E}=L??{},{hasAxis:D,hasAxisLabel:B}=I??{},H=gs(()=>{let e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=Oe(a,h?.axes,f),n=n=>{let i=e[n];return"number"==typeof i?i:t[n]},i={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},r={...i};return A&&(Ie(i,{legend:A,position:p,size:[c??600,u??400],hasTitle:f,legendLayout:y,minimumMargin:"bottom"===p?80:"top"===p?50:0,axisChrome:void 0===S?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:S,hasAxisLabel:$,rotatedTicks:C,topAxis:N?{hasAxis:O,hasAxisLabel:F,rotatedTicks:T}:void 0,leftAxis:z?{hasAxis:W,hasAxisLabel:E}:void 0,rightAxis:R?{hasAxis:D,hasAxisLabel:B}:void 0}}),null!=c&&null!=u&&xe(i,r,[c,u],p)),i},[a,h?.axes,o,A,p,c,u,y,f,S,$,C,N,O,F,T,z,W,E,R,D,B]);return{legend:A,margin:H,legendPosition:p,legendLayout:y,legendMarginReserved:void 0!==A&&!Ii(h,"margin"),hasAutomaticLegend:void 0!==M}}function Ri(e){let t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Oi(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Fi(e,t,n,i=!0,r=!1){let[o,a]=vs(null),[l,s]=vs(
76
- /* @__PURE__ */new Set),c=gs(()=>/* @__PURE__ */new Set,[]),u=gs(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=gs(()=>{if(0===l.size)return l;let e=new Set(Array.from(l).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===l.size?l:e},[u,c,l]);bs(()=>{(!i||!t||!e||"none"===e)&&(a(null),s(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,i,e]),bs(()=>{a(e=>null==e||u.has(e)?e:null),s(e=>{if(0===e.size)return e;let t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);let f=xs(t=>{!i||"highlight"!==e||a(!t||!u.has(t.label)||r&&!0!==t.__semioticCategory?null:t.label)},[u,i,e,r]),m=xs(t=>{!i||"isolate"!==e||!u.has(t.label)||r&&!0!==t.__semioticCategory||s(e=>{let n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,i,e,r]),p=gs(()=>{if(!i||!e||"none"===e||!t)return null;let n=e=>{let n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:String(n)};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,i,e,d,h]);return{highlightedCategory:i&&"highlight"===e?d:null,isolatedCategories:i&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:m,legendSelectionHook:p}}function Ti(e,t,n,i=5){let[r,o]=n,[a,l]=vs(null),[s,c]=vs(/* @__PURE__ */new Map),u=gs(()=>/* @__PURE__ */new Set,[]);bs(()=>{l(null),c(/* @__PURE__ */new Map)},[r,o,i,e]);let d=xs(t=>{if("highlight"!==e||!t)return void("highlight"===e&&l(null));let n=Ri(t);n&&l({key:Oi(t,n),range:n})},[e]),h=xs(t=>{if("isolate"!==e)return;let n=Ri(t);n&&c(e=>{let r=new Map(e),o=Oi(t,n);return r.has(o)?r.delete(o):r.set(o,n),r.size===i?/* @__PURE__ */new Map:r})},[i,e]),f=gs(()=>{let n="highlight"===e&&a?[a.range]:"isolate"===e?[...s.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{let i=t(e);return Number.isFinite(i)&&n.some(([e,t])=>i>=Math.min(e,t)&&i<=Math.max(e,t))}}},[a,s,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(s.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function Wi(e,t,n){let i=e.xValue??t?.[n];if(null==i)return null;let r=Number(i);return Number.isFinite(r)?r:null}function Ei(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?Jr({...t,xValue:e.xValue},Qr(t)):t||{}}function Di(e){if(!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Bi(){let e=Zr()?.colors?.categorical;return e&&e.length>0?e:void 0}function Hi(){return Zr()?.colors?.sequential||void 0}function Pi(){return Zr()?.colors?.diverging||void 0}function Gi(e){return"function"==typeof e?e:t=>t[e]}function _i(e,t,n){let i=D(null!=n),r=Bi();return ws(()=>{if(!t)return;let o=i??void 0,a=n??(r&&r.length>0?r:void 0)??"category10";if(0!==e.length){if("function"==typeof t){let n=Array.from(new Set(e.map(e=>String(t(e)))));if(o&&Di(o)){let e=n.map(e=>({_cat:e})),t=vr(e,"_cat",a);return e=>br(o,e)??t(e)}let i=n.map(e=>({_cat:e}));return vr(i,"_cat",a)}if(o&&Di(o)){let n=vr(e,t,a);return e=>br(o,e)??n(e)}return vr(e,t,a)}if(o&&Di(o)){let e=vr([{_:"a"}],"_",a);return t=>br(o,t)??e(t)}},[e,t,n,i,r])}function Vi(e,t,n){return ws(()=>{if(!t||"auto"===t||"function"==typeof t)return e;let i=[...e],r=Gi(n);return"asc"===t?i.sort((e,t)=>r(e)-r(t)):i.sort((e,t)=>r(t)-r(e))},[e,t,n])}function Yi({selection:e,linkedHover:t,fallbackFields:n=Cs,unwrapData:i=!1,onObservation:r,chartType:o,chartId:a,onClick:l,hoverHighlight:s,hoverHighlightField:c,colorByField:u,mobileInteraction:d,emitObservations:h=!0}){let f=As(),m=ws(()=>or(t,n),[t,n]),p=ws(()=>"series"===m?.mode?[m.seriesField||u||n[0]].filter(e=>!!e):m?.fields||n,[m,u,n]),y=Z({name:e?.name||"__unused__",fields:p}),g=Q({name:m?.name||"hover",fields:p}),x=Vr(e=>e.pushObservation),b=ks(e=>{r?.(e),x?.(e)},[r,x]),v=e?{isActive:y.isActive,predicate:y.predicate}:null,[w,k]=Ms(null),M=$s(!1),A=c||u||n[0],S=ws(()=>{if(!s||null==w||!A)return null;let e=w,t=A;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[s,w,A]),$=ks((e,n)=>{let i=!e&&M.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===m?.mode&&m.xField){let n=Wi(e,t,m.xField);null!=n&&P(m.name||"hover",n,f)}"x-position"!==m?.mode&&g.onHover(t)}else"x-position"===m?.mode&&!i&&G(m.name||"hover",f),"x-position"!==m?.mode&&!i&&g.onHover(null);if(s&&A)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);let n=t?.[A];k(null!=n?String(n):null)}else i||k(null);h&&(r||x)&&xi({onObservation:b,datum:e?Ei(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,g,m,f,r,o,a,x,b,h,s,A,d]),C=ks((n=!0)=>{M.current=!1,t&&"x-position"!==m?.mode&&g.onHover(null),e&&d?.tapToSelect&&y.clear(),n&&s&&k(null),"x-position"===m?.mode&&(V(m.name||"hover",f),G(m.name||"hover",f))},[t,m,g,e,d,y,s,f]),j=ks((n,i)=>{let c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===m?.mode&&m.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);let t=Wi(n,e,m.xField);null!=t&&_(m.name||"hover",t,f)}if(c)if(n){M.current=!0;let i=Ei(n);if(t&&"x-position"!==m?.mode&&g.onHover(i),e&&d?.tapToSelect&&p.length>0){let e=eo(i,p);Di(e)&&y.selectPoints(e)}if(s&&A){let e=i?.[A];k(null!=e?String(e):null)}}else u&&C();if(n||u){if(n&&l){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),l(e,{x:n.x??0,y:n.y??0})}h&&(r||x)&&bi({onObservation:b,datum:n?Ei(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:i})}},[l,h,r,x,b,o,a,m,f,d,t,g,e,y,p,s,A,C]);Ss(()=>{if(!d?.enabled||typeof document>"u")return;let e=e=>{"Escape"===e.key&&M.current&&C()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,C]);let L=$s(C);return L.current=C,Ss(()=>()=>{M.current&&L.current(!1)},[]),Ss(()=>{if("x-position"!==m?.mode)return;let e=m.name||"hover";return()=>{V(e,f),G(e,f)}},[m?.mode,m?.name,f]),{activeSelectionHook:v,hoverSelectionHook:S,customHoverBehavior:$,customClickBehavior:j,crosshairSourceId:f}}function Ui(e,t){let n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function Xi(e,t,n){return Si(e,t,n)}function qi(e,t="#4e79a7"){return Ar(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function Ki(e){let t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?`s_${t}`:t}function Zi(e,t,n,i){let r=e.glyph;if(!r?.parts?.length||e.size<=0)return null;let o=Ir(r,e.size);if(o.scale<=0)return null;let a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,l=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),s=zr(r,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=s?Ki(`${i}-clip`):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>r.parts.map((n,i)=>{let r=t?"none"===n.fill?void 0:t:Nr(n.fill,l,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:Nr(n.stroke??"none",l,e.accent);return r||o?/* @__PURE__ */Ls("path",{d:n.d,fill:r??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},i):null});/* @__PURE__ */
77
- return Is("g",{transform:a,opacity:1===u?void 0:u,children:[s&&c&&/* @__PURE__ */Ls("clipPath",{id:c,children:/* @__PURE__ */Ls("rect",{x:s.x,y:s.y,width:s.width,height:s.height})}),s&&e.ghostColor?/* @__PURE__ */Ls("g",{children:d(e.ghostColor)}):null,s&&c?/* @__PURE__ */Ls("g",{clipPath:`url(#${c})`,children:d()}):d()]},i)}function Ji(e,t){let n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return n.length<2?null:n.map((e,t)=>/* @__PURE__ */Ls("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function Qi(e,t){let n=e.fillGradient;if(!n||"object"!=typeof n)return null;let i=e.x,r=e.y,o=e.x,a=e.y+e.h;"bottom"===e.roundedEdge?(r=e.y+e.h,a=e.y):"right"===e.roundedEdge?(i=e.x+e.w,r=e.y,o=e.x,a=e.y):"left"===e.roundedEdge&&(i=e.x,r=e.y,o=e.x+e.w,a=e.y);let l=Ji(n.stops,qi(e.style.fill));return l?/* @__PURE__ */Ls("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:i,y1:r,x2:o,y2:a,children:l}):null}function er(e){let{x:t,y:n,w:i,h:r}=e,{tl:o,tr:a,br:l,bl:s}=jr(e),c=`M${t+o},${n}`;return c+=` L${t+i-a},${n}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t+i},${n+a}`),c+=` L${t+i},${n+r-l}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t+i-l},${n+r}`),c+=` L${t+s},${n+r}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t},${n+r-s}`),c+=` L${t},${n+o}`,o>0&&(c+=` A${o},${o} 0 0 1 ${t+o},${n}`),c+=" Z",c}function tr(e,t,n){let i=Lr(e.symbolType,e.size,e.path),r=e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`;/* @__PURE__ */
78
- return Ls("path",{d:i,transform:r,fill:e.style.fill?qi(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}function nr(e,t,n){let i=e.y,r=e.y+e.h,o=[],a=[];e.fillBands.forEach((t,l)=>{let s,c=Math.max(Math.min(t.y0,t.y1),i),u=Math.min(Math.max(t.y0,t.y1),r);if(u>c){if(Ar(t.fill)){let e=`${n}-band-${l}`;o.push(Sr(t.fill,e)),s=`url(#${e})`}else s=qi(t.fill);a.push(/* @__PURE__ */Ls("rect",{x:e.x,y:c,width:e.w,height:u-c,fill:s},l))}});let l=e.style.stroke&&"none"!==e.style.stroke;/* @__PURE__ */
79
- return Is("g",{opacity:e.style.opacity,children:[o.length>0&&/* @__PURE__ */Ls("defs",{children:o}),a,l&&/* @__PURE__ */Ls("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`rect-${t}`)}function ir(e,t,n){let i="point"===e.type,r=i?"circle":"rect",o=i?{cx:e.x,cy:e.y,r:e.r}:{x:e.x,y:e.y,width:e.w,height:e.h},a=`${n?`${n}-`:""}${i?"point":"xyrect"}-${t}-hatch`;if(!i&&e.fillBands&&e.fillBands.length>0)return nr(e,t,a);let l=Ar(e.style.fill)?Sr(e.style.fill,a):void 0;/* @__PURE__ */
80
- return Is(js.Fragment,{children:[l&&/* @__PURE__ */Ls("defs",{children:l}),js.createElement(r,{...o,fill:l?`url(#${a})`:qi(e.style.fill),opacity:i?e.style.opacity??e.style.fillOpacity??.8:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`${e.type}-${t}`)}import{b as rr,c as or}from"./c-2OZMC2MZ.min.js";import{a as ar,b as lr,c as sr,d as cr,e as ur,f as dr}from"./c-KJA7DA43.min.js";import{a as hr,b as fr}from"./c-2P6E22WZ.min.js";import{b as mr}from"./c-4ZSQIBC7.min.js";import{m as pr,o as yr,p as gr,r as xr,s as br,t as vr}from"./c-ZOE7TAR3.min.js";import{b as wr,d as kr,g as Mr,i as Ar,k as Sr,l as $r,n as Cr,w as jr}from"./c-SSKV5JPW.min.js";import{a as Lr,d as Ir,f as Nr,h as zr}from"./c-RBWJFQDC.min.js";import{a as Rr,b as Or,d as Fr,f as Tr,g as Wr,i as Er,j as Dr,k as Br,l as Hr}from"./c-K2Z4F22S.min.js";import{g as Pr,h as Gr,i as _r,j as Vr,k as Yr,l as Ur,n as Xr,o as qr,p as Kr,w as Zr}from"./c-CNYFCSG4.min.js";import{a as Jr,b as Qr,i as eo}from"./c-ODSUDNB4.min.js";import{e as to}from"./c-ESCEKIUO.min.js";import{a as no}from"./c-3PFVJFBK.min.js";var io={fresh:1,aging:1.5,stale:3},ro=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/;import{jsx as oo,jsxs as ao}from"react/jsx-runtime";var lo="var(--semiotic-bg, #ffffff)";import*as so from"react";import*as co from"react";import{jsx as uo}from"react/jsx-runtime";var ho={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"},fo=/* @__PURE__ */x(function({chrome:e="default",className:t="",style:n,children:i,...r}){let o="default"===e?{...ho,...n}:n;/* @__PURE__ */
81
- return uo("div",{...r,"data-semiotic-tooltip-chrome":!0,className:`semiotic-tooltip ${t}`.trim(),style:o,children:i})}),mo=["name","label","title"],po=["type","kind","category","group","class","status","role","shape"],yo=["value","amount","total","count","weight","score"],go=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import{jsx as xo,jsxs as bo}from"react/jsx-runtime";var vo=!1;import{Component as wo}from"react";import{jsx as ko,jsxs as Mo}from"react/jsx-runtime";import{jsx as Ao}from"react/jsx-runtime";var So=class extends wo{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */Ao(T,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{createContext as $o,useContext as Co,useMemo as jo}from"react";import{jsx as Lo}from"react/jsx-runtime";var Io=/* @__PURE__ */$o(null),No=/* @__PURE__ */$o(null),zo=/* @__PURE__ */W(function({colors:e,categories:t,colorScheme:n="category10",children:i}){let r=jo(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){let e=n,i=0;return Object.fromEntries(t.map(t=>[t,br(e,t)??pr[i++%pr.length]]))}let e=Array.isArray(n)?n:yr(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);/* @__PURE__ */
82
- return Lo(No.Provider,{value:r,children:/* @__PURE__ */Lo(Io.Provider,{value:r,children:i})})},"CategoryColorProvider");import{useId as Ro,useMemo as Oo,useCallback as Fo}from"react";import{useSyncExternalStore as To}from"react";var Wo={positions:/* @__PURE__ */new Map},Eo=/* @__PURE__ */new Set,Do={positions:/* @__PURE__ */new Map};import{useMemo as Bo}from"react";import{createContext as Ho,useContext as Po,useEffect as Go,useId as _o,useLayoutEffect as Vo,useMemo as Yo,useRef as Uo,useState as Xo,useCallback as qo}from"react";import*as Ko from"react";var Zo={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},Jo={fontSize:"var(--semiotic-legend-font-size, 12px)"},Qo=34,ea=70;import*as ta from"react";import{jsx as na,jsxs as ia}from"react/jsx-runtime";import{jsx as ra,jsxs as oa}from"react/jsx-runtime";var aa=(e,t,n,i,r,o,a,l,s,c,u)=>{let{items:d}=e,h=[],f=0,m={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u};return d.forEach((e,t)=>{h.push(De(m,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},la=(e,t,n,i,r,o,a,l,s,c,u,d)=>{let{items:h}=e,f=[],{swatchSize:m,labelGap:p,itemGap:y,rowHeight:g,align:x}=u,b={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u},v=h.map(e=>m+p+7*e.label.length),w=[],k=0,M=0;v.forEach((e,t)=>{let n=0===M?e:M+y+e;d&&d>0&&M>0&&n>d?(w.push({start:k,end:t,width:M}),k=t,M=e):M=n}),h.length>0&&w.push({start:k,end:h.length,width:M}),w.forEach((e,t)=>{let n="center"===x?Math.max(0,((d??e.width)-e.width)/2):"end"===x?Math.max(0,(d??e.width)-e.width):0;for(let i=e.start;i<e.end;i++)f.push(De(b,h[i],i,`translate(${n},${t*g})`,"ArrowLeft","ArrowRight")),n+=v[i]+y});let A=w.reduce((e,t)=>Math.max(e,t.width),0),S=w.length;return{items:f,offset:A,totalRows:S,totalHeight:S*g}},sa=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:l,onFocusedIndexChange:s,legendInteraction:c,metrics:u})=>{let d=[],h=Re(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{let m=h[f];d.push(
83
- /* @__PURE__ */ra("line",{stroke:"gray",x1:0,y1:m.lineY,x2:t,y2:m.lineY},`legend-top-line legend-symbol-${f}`)),e.label&&null!=m.labelY&&d.push(
84
- /* @__PURE__ */ra("text",{y:m.labelY,className:"legend-group-label",fontSize:12,style:Jo,fill:"var(--semiotic-text, #333)",children:e.label},`legend-text-${f}`)),d.push(
85
- /* @__PURE__ */ra("g",{className:"legend-item",transform:`translate(0,${m.itemsY})`,children:aa(e,n,i,r,o,a,l,f,s,c,u)},`legend-group-${f}`))}),d},ca=({legendGroups:e,title:t,height:n,width:i,customClickBehavior:r,customHoverBehavior:o,highlightedCategory:a,isolatedCategories:l,focusedGroupIndex:s,focusedItemIndex:c,onFocusedIndexChange:u,legendInteraction:d,metrics:h})=>{let f=0,m=[];e.forEach((e,t)=>{let n=0;e.label&&(n+=16);let p=la(e,r,o,a,l,s,c,t,u,d,h,h.maxWidth??i);n+=p.offset+5,m.push({label:e.label,...p,offset:n,totalRows:p.totalRows,totalHeight:p.totalHeight}),f+=n+12});let p=h.maxWidth??i,y=f>p?0:"center"===h.align?Math.max(0,(p-f)/2):"end"===h.align?Math.max(0,p-f):0,g=[];return m.forEach((t,i)=>{let r=e[i];if(r.label&&(g.push(
86
- /* @__PURE__ */ra("text",{transform:`translate(${y},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:Jo,fill:"var(--semiotic-text, #333)",children:r.label},`legend-text-${i}`)),y+=16),g.push(
87
- /* @__PURE__ */ra("g",{className:"legend-item",transform:`translate(${y},0)`,children:t.items},`legend-group-${i}`)),y+=t.offset+5,e[i+1]){let e=t.totalHeight||n;g.push(
88
- /* @__PURE__ */ra("line",{stroke:"gray",x1:y,y1:-8,x2:y,y2:e+0+8},`legend-top-line legend-symbol-${i}`))}y+=12}),/* @__PURE__ */ra("g",{children:g})};import{useRef as ua,useState as da,useEffect as ha,useLayoutEffect as fa}from"react";var ma=typeof window>"u"?ha:fa;import{jsx as pa,jsxs as ya}from"react/jsx-runtime";var ga=/* @__PURE__ */Ho(!1),xa=/* @__PURE__ */Ho(!1),ba=/* @__PURE__ */Ho(null),va=typeof window>"u"?Go:Vo,wa="__linked-legend-isolate__",ka="__linked-legend-highlight__",Ma=Object.freeze([]),Aa=typeof window>"u"||typeof document>"u",Sa={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},$a=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=dt({kind:"initialize"},[],this.revisions),this.listeners=/* @__PURE__ */new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let n=dt(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(let e of[...this.listeners])e();return n}};import{memo as Ca,useEffect as ja,useRef as La}from"react";var Ia={sceneGeometry:0,layout:0,domain:0},Na="production"!==process.env.NODE_ENV,za={revisions:Ia,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Ra=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Ia,this.lastObserved=Ia,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){Na&&(this.lastObserved=mt(this.lastObserved,ht(e)))}beforeCompute(e,t){if(!Na)return za;let n=mt(ht(e),this.lastObserved),i=`${(o=n).sceneGeometry}|${o.layout}|${o.domain}`,r=!ft(n,this.lastConsumed);var o;return{revisions:n,signature:i,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:r,warnUnconsumed:!t&&r&&this.lastUnconsumedWarning!==i}}afterCompute(e,t,n){if(Na){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},Oa=/* @__PURE__ */Ca(function({store:e,diagnostics:t}){return ja(()=>{let n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{jsx as Fa}from"react/jsx-runtime";import{jsx as Ta}from"react/jsx-runtime";var Wa={secondary:0,primary:3},Ea=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}";import{jsx as Da}from"react/jsx-runtime";import{jsx as Ba,jsxs as Ha}from"react/jsx-runtime";import*as Pa from"react";import{jsx as Ga,jsxs as _a}from"react/jsx-runtime";import{packEnclose as Va}from"d3-hierarchy";import{area as Ya,curveLinear as Ua,curveMonotoneX as Xa,curveMonotoneY as qa,curveStep as Ka,curveStepAfter as Za,curveStepBefore as Ja,curveBasis as Qa,curveCardinal as el,curveCatmullRom as tl}from"d3-shape";var nl=/* @__PURE__ */new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]);import{jsx as il}from"react/jsx-runtime";var rl={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"};import{jsx as ol,jsxs as al}from"react/jsx-runtime";var ll={linear:Ua,monotoneX:Xa,monotoneY:qa,step:Ka,stepAfter:Za,stepBefore:Ja,basis:Qa,cardinal:el,catmullRom:tl},sl=["label","callout","callout-circle","callout-rect"],cl=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),ul=/* @__PURE__ */new Set(sl),dl=32,hl=6,fl=4,ml=8,pl=72,yl={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};import{jsx as gl}from"react/jsx-runtime";import*as xl from"react";import{jsx as bl}from"react/jsx-runtime";import{useEffect as vl,useLayoutEffect as wl,useRef as kl,useState as Ml,useSyncExternalStore as Al}from"react";var Sl=typeof window<"u"?wl:vl,$l=()=>()=>{},Cl=()=>!1,jl=()=>!0;import{useRef as Ll}from"react";import{jsx as Il}from"react/jsx-runtime";import*as Nl from"react";import{jsx as zl}from"react/jsx-runtime";var Rl=/* @__PURE__ */Nl.createContext(null);import*as Ol from"react";import*as Fl from"react";import{Fragment as Tl,jsx as Wl,jsxs as El}from"react/jsx-runtime";import*as Dl from"react";var Bl=typeof window>"u"?Dl.useEffect:Dl.useLayoutEffect;import{jsx as Hl,jsxs as Pl}from"react/jsx-runtime";var Gl=/* @__PURE__ */Ol.lazy(()=>import("./c-P3SKRNZN.min.js")),_l=/* @__PURE__ */Ol.lazy(()=>import("./c-UP656CST.min.js"));import{jsx as Vl}from"react/jsx-runtime";var Yl="var(--semiotic-focus, #005fcc)";import*as Ul from"react";import{jsx as Xl}from"react/jsx-runtime";import*as ql from"react";import{useCallback as Kl,useEffect as Zl,useLayoutEffect as Jl,useMemo as Ql,useRef as es}from"react";var ts,ns,is=typeof window>"u"?Zl:Jl,rs={requestAnimationFrame:e=>(typeof window>"u"?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>(typeof window>"u"?globalThis:window).cancelAnimationFrame(e)};import{useEffect as os,useLayoutEffect as as,useRef as ls}from"react";import{jsx as ss,jsxs as cs}from"react/jsx-runtime";var us=typeof window>"u"?os:as;import{jsx as ds}from"react/jsx-runtime";var hs={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},fs={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},ms={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},ps={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},ys={top:10,bottom:10,left:10,right:10};import{useMemo as gs,useCallback as xs,useEffect as bs,useState as vs}from"react";import{useMemo as ws,useCallback as ks,useState as Ms,useId as As,useEffect as Ss,useRef as $s}from"react";var Cs=[];import*as js from"react";import{jsx as Ls,jsxs as Is}from"react/jsx-runtime";var Ns={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};export{Ma as a,ct as b,io as c,e as d,t as e,n as f,i as g,r as h,o as i,a as j,Aa as k,$a as l,pt as m,yt as n,Oa as o,he as p,fe as q,me as r,xe as s,ke as t,Se as u,$e as v,Ce as w,Le as x,Ie as y,Oe as z,gt as A,c as B,d as C,h as D,f as E,p as F,y as G,qt as H,Ea as I,At as J,Qt as K,en as L,tn as M,rn as N,on as O,sn as P,Ln as Q,V as R,K as S,In as T,Ns as U,qi as V,Ki as W,Zi as X,Ji as Y,Qi as Z,er as _,tr as $,ir as aa,Nn as ba,zn as ca,Rn as da,On as ea,Fn as fa,Tn as ga,Wn as ha,En as ia,Dn as ja,Hn as ka,Vn as la,Yn as ma,qn as na,Un as oa,Xn as pa,Kn as qa,Zn as ra,Jn as sa,Qn as ta,ei as ua,ti as va,ni as wa,ii as xa,ri as ya,g as za,ho as Aa,fo as Ba,x as Ca,v as Da,oi as Ea,Pe as Fa,li as Ga,si as Ha,ui as Ia,di as Ja,mi as Ka,pi as La,M as Ma,S as Na,k as Oa,j as Pa,L as Qa,I as Ra,N as Sa,z as Ta,R as Ua,O as Va,F as Wa,yi as Xa,gi as Ya,xi as Za,bi as _a,W as $a,T as ab,So as bb,vi as cb,wi as db,ki as eb,Mi as fb,D as gb,zo as hb,B as ib,Z as jb,J as kb,Q as lb,ne as mb,ie as nb,le as ob,ce as pb,Ai as qb,$i as rb,de as sb,ue as tb,Ge as ub,Ye as vb,Ue as wb,Ke as xb,ji as yb,Li as zb,zi as Ab,Fi as Bb,Ti as Cb,Bi as Db,Hi as Eb,Pi as Fb,_i as Gb,Vi as Hb,Yi as Ib,Ui as Jb,Xi as Kb,Ze as Lb,Je as Mb,Qe as Nb,tt as Ob,nt as Pb,it as Qb,rt as Rb,ot as Sb,at as Tb,lt as Ub,st as Vb};