semiotic 3.9.2 → 3.10.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 (537) hide show
  1. package/README.md +97 -76
  2. package/agent-skill/semiotic-charts/SKILL.md +13 -7
  3. package/ai/artifact-contract-reference.md +408 -0
  4. package/ai/artifact-surface-inventory.json +5586 -0
  5. package/ai/behaviorContracts.cjs +24 -2
  6. package/ai/cli.js +480 -56
  7. package/ai/componentMetadata.cjs +3 -1
  8. package/ai/dist/mcp-server.js +68 -68
  9. package/ai/examples.md +68 -1
  10. package/ai/reference.md +105 -14
  11. package/ai/schema.json +6646 -18
  12. package/ai/surface-manifest.json +34 -6
  13. package/ai/system-prompt.md +2 -0
  14. package/ai/task-packets/compare-category-totals.json +301 -0
  15. package/ai/task-packets/compare-category-totals.md +188 -0
  16. package/ai/task-packets/correct-published-chart.json +271 -0
  17. package/ai/task-packets/correct-published-chart.md +597 -0
  18. package/ai/task-packets/index.json +40 -0
  19. package/ai/task-packets/update-live-chart.json +289 -0
  20. package/ai/task-packets/update-live-chart.md +424 -0
  21. package/dist/c-2N7IU2NY.min.js +1 -0
  22. package/dist/c-2RL2QPZJ.min.js +1 -0
  23. package/dist/c-2WK7YJLL.min.js +1 -0
  24. package/dist/c-42PLDTX7.min.js +1 -0
  25. package/dist/c-45CQWZZ6.min.js +1 -0
  26. package/dist/c-4BRHKVKV.min.js +1 -0
  27. package/dist/c-7242NXSG.min.js +1 -0
  28. package/dist/c-7DVPSB5C.min.js +1 -0
  29. package/dist/c-7EGHJU2F.min.js +1 -0
  30. package/dist/c-A7OGOFSL.min.js +1 -0
  31. package/dist/c-AFBSWT77.min.js +1 -0
  32. package/dist/c-AH5HWZWS.min.js +1 -0
  33. package/dist/c-AJ7EC32V.min.js +1 -0
  34. package/dist/c-AQADQNY7.min.js +1 -0
  35. package/dist/c-ATM475SA.min.js +1 -0
  36. package/dist/c-AVO3Q7T7.min.js +1 -0
  37. package/dist/c-B7GW7IHJ.min.js +1 -0
  38. package/dist/c-BNFJMDHN.min.js +1 -0
  39. package/dist/c-BOHCQILI.min.js +1 -0
  40. package/dist/c-C3TZLTZK.min.js +1 -0
  41. package/dist/c-CGQAQWBV.min.js +1 -0
  42. package/dist/c-CPV4N35K.min.js +1 -0
  43. package/dist/c-D6HAAPTX.min.js +1 -0
  44. package/dist/c-DIPEYUOW.min.js +1 -0
  45. package/dist/c-E4JDJH4I.min.js +1 -0
  46. package/dist/c-E72OTUZU.min.js +1 -0
  47. package/dist/c-E7I2L7CU.min.js +1 -0
  48. package/dist/c-ELDWAO2V.min.js +1 -0
  49. package/dist/c-EUBTECGM.min.js +1 -0
  50. package/dist/c-EUMPMDCS.min.js +1 -0
  51. package/dist/c-EZZT2WAE.min.js +1 -0
  52. package/dist/c-FHBVFCQB.min.js +1 -0
  53. package/dist/c-G4HCO2IQ.min.js +1 -0
  54. package/dist/c-G5VIJEOK.min.js +1 -0
  55. package/dist/c-GHVOXAYH.min.js +1 -0
  56. package/dist/c-GNTXRXRN.min.js +1 -0
  57. package/dist/c-GXV3C3MO.min.js +1 -0
  58. package/dist/c-HHTK2R75.min.js +1 -0
  59. package/dist/c-HLLFJYTY.min.js +1 -0
  60. package/dist/c-HP4ZFM47.min.js +1 -0
  61. package/dist/c-HPOYKCCG.min.js +1 -0
  62. package/dist/c-HYDTS5OP.min.js +1 -0
  63. package/dist/c-I4QJ6YLM.min.js +1 -0
  64. package/dist/c-IK33LNZ6.min.js +1 -0
  65. package/dist/c-IK3PZHRY.min.js +1 -0
  66. package/dist/c-J6DVC236.min.js +1 -0
  67. package/dist/c-JIMJF6F6.min.js +1 -0
  68. package/dist/c-JUKIWTBJ.min.js +1 -0
  69. package/dist/c-KKPMHAZC.min.js +1 -0
  70. package/dist/c-L6WNDBHV.min.js +1 -0
  71. package/dist/c-LDEX5OFW.min.js +1 -0
  72. package/dist/c-LESEUVC5.min.js +1 -0
  73. package/dist/c-LYQMZMZQ.min.js +1 -0
  74. package/dist/c-MB6CV5NC.min.js +1 -0
  75. package/dist/c-MOKJOIPE.min.js +1 -0
  76. package/dist/c-MVR3RWF3.min.js +1 -0
  77. package/dist/c-N3FXLRNT.min.js +1 -0
  78. package/dist/c-N5NPTJVJ.min.js +1 -0
  79. package/dist/c-NHBL4J67.min.js +1 -0
  80. package/dist/c-ODG6TFSY.min.js +1 -0
  81. package/dist/c-ORLEBW72.min.js +1 -0
  82. package/dist/c-P65V6HLO.min.js +1 -0
  83. package/dist/c-PRIKOLTE.min.js +1 -0
  84. package/dist/c-PSKKFZNP.min.js +1 -0
  85. package/dist/c-PSNI6KAZ.min.js +1 -0
  86. package/dist/c-QA3HMQJP.min.js +1 -0
  87. package/dist/c-R2P4RR7Q.min.js +1 -0
  88. package/dist/c-RFC7UAG7.min.js +1 -0
  89. package/dist/c-S3AZX5PP.min.js +1 -0
  90. package/dist/c-SGAURYHG.min.js +1 -0
  91. package/dist/c-SJMWU6UX.min.js +1 -0
  92. package/dist/c-STIIGQOD.min.js +1 -0
  93. package/dist/c-T2ASIJVZ.min.js +1 -0
  94. package/dist/c-T2V7O2LO.min.js +1 -0
  95. package/dist/c-TKG2NP7G.min.js +1 -0
  96. package/dist/c-TX3THUTO.min.js +1 -0
  97. package/dist/c-TX7XJM3Z.min.js +1 -0
  98. package/dist/c-UC7SIU2W.min.js +1 -0
  99. package/dist/c-UMXSJIOV.min.js +1 -0
  100. package/dist/c-VJTDST2R.min.js +1 -0
  101. package/dist/c-VRSXMLYF.min.js +1 -0
  102. package/dist/c-VSLWSAN2.min.js +1 -0
  103. package/dist/c-VXLOLYTO.min.js +1 -0
  104. package/dist/c-W4ZUKSEQ.min.js +1 -0
  105. package/dist/c-WCBRPILW.min.js +1 -0
  106. package/dist/c-WGHT7OCY.min.js +1 -0
  107. package/dist/c-WUWXGQYA.min.js +1 -0
  108. package/dist/c-WWCW3APR.min.js +1 -0
  109. package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
  110. package/dist/c-Y6PYUMFU.min.js +1 -0
  111. package/dist/c-YDECTEUW.min.js +1 -0
  112. package/dist/c-YF3YKVQI.min.js +1 -0
  113. package/dist/c-YLZIV3VS.min.js +1 -0
  114. package/dist/c-ZIVPFTOC.min.js +1 -0
  115. package/dist/components/Annotation.d.ts +2 -1
  116. package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
  117. package/dist/components/ai/chartRecipes.d.ts +4 -0
  118. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  119. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  120. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  121. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  122. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  123. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  124. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  125. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  126. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  127. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  128. package/dist/components/artifact/claimGraph.d.ts +5 -0
  129. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  130. package/dist/components/artifact/claims.d.ts +24 -0
  131. package/dist/components/artifact/collection.d.ts +10 -0
  132. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  133. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  134. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  135. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  136. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  137. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  138. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  139. package/dist/components/artifact/contract.d.ts +30 -0
  140. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  141. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  142. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  143. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  144. package/dist/components/artifact/exportPaths.d.ts +8 -0
  145. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  146. package/dist/components/artifact/fingerprint.d.ts +36 -0
  147. package/dist/components/artifact/grounding.d.ts +51 -0
  148. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  149. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  150. package/dist/components/artifact/identity.d.ts +19 -0
  151. package/dist/components/artifact/inheritance.d.ts +48 -0
  152. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  153. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  154. package/dist/components/artifact/obligations.d.ts +3 -0
  155. package/dist/components/artifact/policies.d.ts +45 -0
  156. package/dist/components/artifact/policyRelations.d.ts +3 -0
  157. package/dist/components/artifact/recordProjection.d.ts +7 -0
  158. package/dist/components/artifact/representation.d.ts +50 -0
  159. package/dist/components/artifact/serialization.d.ts +40 -0
  160. package/dist/components/artifact/temporal.d.ts +32 -0
  161. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  162. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  163. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  164. package/dist/components/artifact/types.d.ts +341 -0
  165. package/dist/components/artifact/validation.d.ts +13 -0
  166. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  167. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  168. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  169. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  170. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  171. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  172. package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
  173. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  174. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  175. package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
  176. package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
  177. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  178. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  179. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  180. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  181. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  182. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  183. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  184. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  185. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  186. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  187. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  188. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  189. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  190. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  191. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  192. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  193. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  194. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  195. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  196. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  197. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
  198. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
  199. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
  200. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
  201. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
  202. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  203. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
  204. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  205. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  206. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  207. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  208. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  209. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  210. package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
  211. package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
  212. package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
  213. package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
  214. package/dist/components/charts/shared/hooks.d.ts +3 -1
  215. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  216. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  217. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  218. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  219. package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
  220. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  221. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  222. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  223. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  224. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  225. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  226. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  227. package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
  228. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  229. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  230. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  231. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
  232. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  233. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  234. package/dist/components/evidence/evidenceGate.d.ts +3 -1
  235. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  236. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  237. package/dist/components/export/chartConfig.d.ts +40 -5
  238. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  239. package/dist/components/legendLayout.d.ts +18 -0
  240. package/dist/components/legendStyles.d.ts +4 -0
  241. package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
  242. package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
  243. package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
  244. package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
  245. package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
  246. package/dist/components/recipes/atlas/braid.d.ts +62 -0
  247. package/dist/components/recipes/atlas/capsules.d.ts +18 -0
  248. package/dist/components/recipes/atlas/compare.d.ts +4 -0
  249. package/dist/components/recipes/atlas/completeness.d.ts +2 -0
  250. package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
  251. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
  252. package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
  253. package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
  254. package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
  255. package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
  256. package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
  257. package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
  258. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
  259. package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
  260. package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
  261. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
  262. package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
  263. package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
  264. package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
  265. package/dist/components/recipes/atlas/forests.d.ts +11 -0
  266. package/dist/components/recipes/atlas/ids.d.ts +6 -0
  267. package/dist/components/recipes/atlas/index.d.ts +26 -0
  268. package/dist/components/recipes/atlas/ledger.d.ts +7 -0
  269. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
  270. package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
  271. package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
  272. package/dist/components/recipes/atlas/motifs.d.ts +3 -0
  273. package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
  274. package/dist/components/recipes/atlas/prepare.d.ts +14 -0
  275. package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
  276. package/dist/components/recipes/atlas/profile.d.ts +19 -0
  277. package/dist/components/recipes/atlas/publish.d.ts +10 -0
  278. package/dist/components/recipes/atlas/queries.d.ts +34 -0
  279. package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
  280. package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
  281. package/dist/components/recipes/atlas/sections.d.ts +3 -0
  282. package/dist/components/recipes/atlas/support.d.ts +7 -0
  283. package/dist/components/recipes/atlas/types.d.ts +278 -0
  284. package/dist/components/recipes/atlas/validate.d.ts +12 -0
  285. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  286. package/dist/components/recipes/intervals.d.ts +1 -1
  287. package/dist/components/semiotic-ai-core.d.ts +33 -22
  288. package/dist/components/semiotic-ai.d.ts +15 -3
  289. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  290. package/dist/components/semiotic-artifact.d.ts +23 -0
  291. package/dist/components/semiotic-atlas-core.d.ts +20 -0
  292. package/dist/components/semiotic-atlas.d.ts +8 -0
  293. package/dist/components/semiotic-experimental.d.ts +1 -1
  294. package/dist/components/semiotic-physics.d.ts +4 -4
  295. package/dist/components/semiotic-recipes-core.d.ts +9 -0
  296. package/dist/components/semiotic-text.d.ts +2 -0
  297. package/dist/components/semiotic-utils-core.d.ts +18 -18
  298. package/dist/components/semiotic.d.ts +3 -3
  299. package/dist/components/server/renderEvidence.d.ts +12 -0
  300. package/dist/components/server/renderToStaticSVG.d.ts +3 -0
  301. package/dist/components/server/serverChartConfigs.d.ts +3 -0
  302. package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
  303. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  304. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  305. package/dist/components/server/staticXYGrid.d.ts +1 -1
  306. package/dist/components/server/svgSizing.d.ts +6 -0
  307. package/dist/components/shared/svgRoot.d.ts +17 -0
  308. package/dist/components/store/selectionProvenance.d.ts +6 -0
  309. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  310. package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
  311. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  312. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  313. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  314. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  315. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  316. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  317. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  318. package/dist/components/stream/XYGrid.d.ts +11 -0
  319. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  320. package/dist/components/stream/canvasSetup.d.ts +1 -2
  321. package/dist/components/stream/fontLoading.d.ts +4 -0
  322. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  323. package/dist/components/stream/networkCustomLayout.d.ts +8 -0
  324. package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
  325. package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
  326. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  327. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  328. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  329. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  330. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  331. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
  332. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  333. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  334. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  335. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  336. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  337. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  338. package/dist/components/stream/physics/physicsSemanticUI.d.ts +11 -0
  339. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
  340. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
  341. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  342. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  343. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  344. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  345. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  346. package/dist/components/stream/shallowEqual.d.ts +2 -0
  347. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  348. package/dist/components/stream/types.d.ts +4 -53
  349. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
  350. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  351. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  352. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  353. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  354. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  355. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  356. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  357. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  358. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  359. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  360. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  361. package/dist/controls.module.min.js +1 -1
  362. package/dist/geo.min.js +1 -1
  363. package/dist/geo.module.min.js +1 -1
  364. package/dist/network.module.min.js +1 -1
  365. package/dist/ordinal.module.min.js +1 -1
  366. package/dist/physics-matter.min.js +1 -1
  367. package/dist/physics-matter.module.min.js +1 -1
  368. package/dist/physics-rapier.min.js +1 -1
  369. package/dist/physics-rapier.module.min.js +1 -1
  370. package/dist/physics.module.min.js +1 -1
  371. package/dist/physicsWorker.js +1 -1
  372. package/dist/processSankeyLayoutWorker.js +1 -1
  373. package/dist/rough.min.js +1 -1
  374. package/dist/rough.module.min.js +1 -1
  375. package/dist/semiotic-access.module.min.js +1 -1
  376. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  377. package/dist/semiotic-ai-core.d.ts +33 -22
  378. package/dist/semiotic-ai-core.min.js +1 -1
  379. package/dist/semiotic-ai-core.module.min.js +1 -1
  380. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  381. package/dist/semiotic-ai.d.ts +15 -3
  382. package/dist/semiotic-ai.module.min.js +1 -1
  383. package/dist/semiotic-artifact-react.d.ts +10 -0
  384. package/dist/semiotic-artifact-react.min.js +2 -0
  385. package/dist/semiotic-artifact-react.module.min.js +2 -0
  386. package/dist/semiotic-artifact.d.ts +23 -0
  387. package/dist/semiotic-artifact.min.js +1 -0
  388. package/dist/semiotic-artifact.module.min.js +1 -0
  389. package/dist/semiotic-atlas-core.d.ts +20 -0
  390. package/dist/semiotic-atlas-core.min.js +1 -0
  391. package/dist/semiotic-atlas-core.module.min.js +1 -0
  392. package/dist/semiotic-atlas-selection.module.min.js +2 -0
  393. package/dist/semiotic-atlas.d.ts +8 -0
  394. package/dist/semiotic-atlas.min.js +2 -0
  395. package/dist/semiotic-atlas.module.min.js +2 -0
  396. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  397. package/dist/semiotic-client-glyph.module.min.js +1 -1
  398. package/dist/semiotic-client-responsive.module.min.js +1 -1
  399. package/dist/semiotic-client-shared.module.min.js +1 -1
  400. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  401. package/dist/semiotic-data.min.js +1 -1
  402. package/dist/semiotic-data.module.min.js +1 -1
  403. package/dist/semiotic-evidence.min.js +1 -1
  404. package/dist/semiotic-evidence.module.min.js +1 -1
  405. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  406. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  407. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  408. package/dist/semiotic-experimental-vacp.min.js +1 -1
  409. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  410. package/dist/semiotic-experimental.d.ts +1 -1
  411. package/dist/semiotic-line.module.min.js +1 -1
  412. package/dist/semiotic-physics.d.ts +4 -4
  413. package/dist/semiotic-realtime-core.module.min.js +1 -1
  414. package/dist/semiotic-realtime-react.module.min.js +1 -1
  415. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  416. package/dist/semiotic-recipes-core.d.ts +9 -0
  417. package/dist/semiotic-recipes-core.module.min.js +1 -1
  418. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  419. package/dist/semiotic-recipes-react.min.js +1 -1
  420. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  421. package/dist/semiotic-server-edge.min.js +1 -1
  422. package/dist/semiotic-server-edge.module.min.js +1 -1
  423. package/dist/semiotic-server-node.min.js +1 -1
  424. package/dist/semiotic-server-node.module.min.js +1 -1
  425. package/dist/semiotic-text.d.ts +2 -0
  426. package/dist/semiotic-text.min.js +2 -0
  427. package/dist/semiotic-text.module.min.js +2 -0
  428. package/dist/semiotic-themes-core.min.js +1 -1
  429. package/dist/semiotic-themes-core.module.min.js +1 -1
  430. package/dist/semiotic-themes.min.js +1 -1
  431. package/dist/semiotic-themes.module.min.js +1 -1
  432. package/dist/semiotic-utils-core.d.ts +18 -18
  433. package/dist/semiotic-utils-core.min.js +1 -1
  434. package/dist/semiotic-utils-core.module.min.js +1 -1
  435. package/dist/semiotic-value.module.min.js +1 -1
  436. package/dist/semiotic.d.ts +3 -3
  437. package/dist/semiotic.module.min.js +1 -1
  438. package/dist/server.min.js +1 -1
  439. package/dist/server.module.min.js +1 -1
  440. package/dist/xy.module.min.js +1 -1
  441. package/package.json +70 -14
  442. package/spec/README.md +8 -3
  443. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  444. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  445. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  446. package/dist/c-3BLJEQNG.min.js +0 -1
  447. package/dist/c-3SCUN5HI.min.js +0 -1
  448. package/dist/c-3VVKFA4M.min.js +0 -1
  449. package/dist/c-43TJZS3F.min.js +0 -1
  450. package/dist/c-4DTZPSUD.min.js +0 -1
  451. package/dist/c-4ES5367Y.min.js +0 -1
  452. package/dist/c-52TEGIUJ.min.js +0 -1
  453. package/dist/c-54IRWOGM.min.js +0 -1
  454. package/dist/c-5D2S4RMI.min.js +0 -1
  455. package/dist/c-5JWCTX3G.min.js +0 -1
  456. package/dist/c-6CMMSN6N.min.js +0 -1
  457. package/dist/c-6HRB2L7H.min.js +0 -1
  458. package/dist/c-6O5EVOPH.min.js +0 -1
  459. package/dist/c-7W4SV36A.min.js +0 -1
  460. package/dist/c-A4WRGZFX.min.js +0 -1
  461. package/dist/c-AG7WWVIH.min.js +0 -1
  462. package/dist/c-AH6J4MTN.min.js +0 -1
  463. package/dist/c-AKAF6JAD.min.js +0 -1
  464. package/dist/c-ALYR5LKK.min.js +0 -1
  465. package/dist/c-BBKITSXB.min.js +0 -1
  466. package/dist/c-BYDPC44I.min.js +0 -1
  467. package/dist/c-CFFIU2MW.min.js +0 -1
  468. package/dist/c-CGNHBHCE.min.js +0 -1
  469. package/dist/c-CJYSXIFV.min.js +0 -1
  470. package/dist/c-CZF7MV67.min.js +0 -1
  471. package/dist/c-D53OKBSY.min.js +0 -1
  472. package/dist/c-DADXPJXV.min.js +0 -1
  473. package/dist/c-DBQ2V7CH.min.js +0 -1
  474. package/dist/c-DPMVAUAW.min.js +0 -1
  475. package/dist/c-ECJCKLYY.min.js +0 -1
  476. package/dist/c-EGATGOWJ.min.js +0 -1
  477. package/dist/c-EGR6VYBW.min.js +0 -1
  478. package/dist/c-ESNR43AN.min.js +0 -1
  479. package/dist/c-F3LIKINL.min.js +0 -1
  480. package/dist/c-F5ZB5GJ6.min.js +0 -1
  481. package/dist/c-G36WS6LN.min.js +0 -1
  482. package/dist/c-G3VYMHKE.min.js +0 -1
  483. package/dist/c-GGISSW5E.min.js +0 -1
  484. package/dist/c-GR6MOEQC.min.js +0 -1
  485. package/dist/c-GSVCN34B.min.js +0 -1
  486. package/dist/c-GYOQCEFP.min.js +0 -1
  487. package/dist/c-H3DNMTCC.min.js +0 -1
  488. package/dist/c-I6J3FEZE.min.js +0 -1
  489. package/dist/c-IGH6MGJ5.min.js +0 -1
  490. package/dist/c-II2EEAJN.min.js +0 -1
  491. package/dist/c-IUHFPMHD.min.js +0 -1
  492. package/dist/c-J6M4JHRS.min.js +0 -1
  493. package/dist/c-JM3MGLQV.min.js +0 -1
  494. package/dist/c-KM3N7F7R.min.js +0 -1
  495. package/dist/c-LF5BZFNC.min.js +0 -1
  496. package/dist/c-LKBSGFQC.min.js +0 -1
  497. package/dist/c-MNF2S4AA.min.js +0 -1
  498. package/dist/c-MT3WBK7M.min.js +0 -1
  499. package/dist/c-NDJADPIF.min.js +0 -1
  500. package/dist/c-NVPQCIL5.min.js +0 -1
  501. package/dist/c-NY3JWV2K.min.js +0 -1
  502. package/dist/c-OFWJBEE5.min.js +0 -1
  503. package/dist/c-OYFHP5F5.min.js +0 -1
  504. package/dist/c-PGKQGGQ2.min.js +0 -1
  505. package/dist/c-PPWDL5ZI.min.js +0 -1
  506. package/dist/c-Q2IPZ3MU.min.js +0 -1
  507. package/dist/c-QKHMBE2E.min.js +0 -1
  508. package/dist/c-QMVM3AY6.min.js +0 -1
  509. package/dist/c-QSGWX53A.min.js +0 -1
  510. package/dist/c-RJKEKZOO.min.js +0 -1
  511. package/dist/c-RSVIHIQ4.min.js +0 -1
  512. package/dist/c-S6U5CGT5.min.js +0 -1
  513. package/dist/c-SFDIIU5G.min.js +0 -1
  514. package/dist/c-SLGMUBUL.min.js +0 -1
  515. package/dist/c-SRTBCRVE.min.js +0 -1
  516. package/dist/c-T6UAIKBH.min.js +0 -1
  517. package/dist/c-TMCTEVVW.min.js +0 -1
  518. package/dist/c-TMOSJLT3.min.js +0 -1
  519. package/dist/c-TZW3JGJ5.min.js +0 -1
  520. package/dist/c-U6ESPM7V.min.js +0 -1
  521. package/dist/c-UC5PTTFI.min.js +0 -1
  522. package/dist/c-USFMFKIH.min.js +0 -1
  523. package/dist/c-VGKUEZBC.min.js +0 -1
  524. package/dist/c-VGW3VG3I.min.js +0 -1
  525. package/dist/c-VN2HG5BS.min.js +0 -1
  526. package/dist/c-VPZDY5Q4.min.js +0 -1
  527. package/dist/c-VRXUB2F2.min.js +0 -1
  528. package/dist/c-VUBQNQJH.min.js +0 -1
  529. package/dist/c-VUH4PGZY.min.js +0 -1
  530. package/dist/c-W3CE4A4S.min.js +0 -1
  531. package/dist/c-X5UBGU2V.min.js +0 -1
  532. package/dist/c-XDRV7RKW.min.js +0 -1
  533. package/dist/c-YGZHURXZ.min.js +0 -1
  534. package/dist/c-YZVRZGX2.min.js +0 -1
  535. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  536. /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
  537. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -1 +0,0 @@
1
- function e(e,t){if("function"==typeof e)return t=>+e(t);const n=e||t;return e=>+e[n]}function t(e,t){if("function"==typeof e)return e;const n=e||t;return e=>e[n]}var n=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),a=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),r=new Set(["PieChart","DonutChart","FunnelChart"]),o=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function l(e,t){return a.has(e)||r.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function i(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const n=e[t];if("string"==typeof n&&n)return n}}function s(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function c(e,t={}){const n=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,r=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&r.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&r.has(t)&&!a)})}function u(e,t=new Set){if(null===e)return!0;const n=typeof e;if("string"===n||"boolean"===n)return!0;if("number"===n)return Number.isFinite(e);if("object"!==n)return!1;if(t.has(e))return!1;t.add(e);const a=Array.isArray(e)?e.every(e=>u(e,t)):Object.entries(e).every(([,e])=>u(e,t));return t.delete(e),a}var h=Symbol.for("semiotic.chartRecipeRegistry");function d(e){return function(){const e=globalThis;return e[h]||(e[h]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[h]}().recipes.get(e)}function m(e){return"string"==typeof e?d(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function f(e){return"string"==typeof e?e:e.id??e.name}function p(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function g(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function $(e,t,n){return n??m(t.recipe)??m(t.recipeId)??d(e)}function b(e,t,n=[]){const a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;const r=n.find(e=>e&&"object"==typeof e);if(!r)return;const o=Object.entries(r).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?o.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in r):o.find(([,e])=>"string"==typeof e)?.[0]}function v(e,t){return e.dataRoles.find(e=>e.role===t)}function y(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function w(e,t,n,a,r,o={}){const l={...o};if(t)for(const[e,n]of Object.entries(t))l[e]=n;for(const e of n.dataRoles){const n=b(e,a,r),o=t&&n?t[n]:n;void 0!==o&&(l[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const n=l[t];return null==n?`{${t}}`:n+""})}var C={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},k=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),A=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function x(e){return C[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function S(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var L=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),F={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},j={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},M=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],P={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function N(e,t){const l=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,n={};for(const[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(n[e]=a);return{family:t.family,intentScores:Object.keys(n).length?n:void 0}}return e}}(t);if(l?.act)return l.act;if(l?.intentScores){const e=function(e){let t,n=0;for(const[a,r]of Object.entries(e))if("number"==typeof r&&r>0)if(r>n)t=a,n=r;else if(r===n&&void 0!==t){const e=M.indexOf(a),n=M.indexOf(t);-1===e||-1!==n&&e>=n||(t=a)}return t}(l.intentScores);if(e&&F[e]&&(l.intentScores[e]??0)>=3)return F[e]}return l?.family?j[l.family]:function(e){return"BumpChart"===e?"ranking":r.has(e)||"StackedAreaChart"===e?"apportioning":L.has(e)?"relating":a.has(e)?"comparing":o.has(e)?"characterizing":n.has(e)?"tracking":k.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var D=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),T=new Set(["system","agent","watcher"]),B=new Set(["ai","agent","system","computed","dbt","great-expectations"]),I=new Set(["rule","statistical-test","llm-inference","computed"]);function R(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!D.has(t.type))return!1;const n=t.provenance;return!(!n||"object"!=typeof n)&&(T.has(n.authorKind)||B.has(n.source)||I.has(n.basis))})}function O(e="en"){let t,n;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?n.format(e):t.format(e):e+""}var G={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function z(e){const t=G["string"==typeof e.type?e.type:"annotation"]||"an annotation",n=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=t?.authorKind??t?.source??t?.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),a=n?n+t.replace(/^an? /,""):t,r="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return r?`${a} labeled "${r}"`:a}function U(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const n=c(t.filter(e=>!!e&&"object"==typeof e));if(0===n.length)return;const a=n.map(z),r=a.slice(0,5),o=a.length-r.length,l=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(r)+(o>0?`, and ${o} more`:""),i=n.length;return`The author has marked ${1===i?"one feature":i+" features"} on this chart: ${l}.`}function H(c,u,h={}){const d=void 0!==h.levels,m=new Set(h.levels??["l1","l2","l3"]);d||!h.capability&&!R(u)||m.add("l4");const v=$(c,u,h.recipe);if(v){const e=["l1","l2","l3","l4"].filter(e=>m.has(e));d||e.includes("l4")||e.push("l4");const t=function(e,t,n={}){const a=g(t),r=p(t),o=n.locale??"en",l="function"==typeof e.description?e.description({data:a,config:r,locale:o}):void 0,i=l?.levels??function(e,t,n,a){const r=y(e,["nominal","ordinal"]),o=y(e,["quantitative"]),l=r?b(r,n,t):void 0,i=o?b(o,n,t):void 0,s=r?.role??l??"category",c=o?.role??i??"value",u=e.encodings??[],h=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${s} and ${c} are mapped through the recipe's declared visual semantics`,{number:d,percent:m}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(a),p=new Map;if(l&&i)for(const e of t){const t=(e[l]??"Uncategorized")+"",n=Number(e[i]);Number.isFinite(n)&&p.set(t,(p.get(t)??0)+n)}const g=[...p].sort((e,t)=>t[1]-e[1]),$=g.reduce((e,[,t])=>e+t,0),v=g[0],w=g[1],C=$>0?((v?.[1]??0)+(w?.[1]??0))/$:0,k=e.intents.map(e=>({id:f(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${s} and ${c}. ${x=h,x?x.charAt(0).toUpperCase()+x.slice(1):x}.`,l2:g.length>0?`${g.length} categories total ${d.format($)}. ${v[0]} accounts for ${d.format(v[1])}${$>0?` (${m.format(v[1]/$)})`:""}${w?`, followed by ${w[0]} at ${d.format(w[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>g.length?v?v[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>C?`The total is distributed across ${g.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${v[0]} and ${w[0]}, which together account for ${m.format(C)}.`,l4:`The chart is intended for ${k??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}(e,a,r,o),s=n.levels??["l1","l2","l3","l4"],c={};for(const e of s)i[e]&&(c[e]=i[e]);const u=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),h=n.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:u,levels:c,...h?.length?{caveats:h}:{}}}(v,u,{levels:e,locale:h.locale,audience:h.audience,includeCaveats:h.includeCaveats}),n=U(u);return{...t,text:n?`${n} ${t.text}`.trim():t.text,...n?{annotations:n}:{}}}const w=O(h.locale??"en"),C=x(c),L=Array.isArray(u.data)?u.data:null,F=i(u),j=A.has(c)?function(e,t){const n=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,r=[e.settledProjectionRows,e.projectionRows,a?.rows,n?.settledProjectionRows,n?.projectionRows,n?.settledProjection&&"object"==typeof n.settledProjection?n.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(r)?r.map((e,n)=>{if(!e||"object"!=typeof e)return null;const a=e,r=S(a.count??a.value??a.total??a.bodies??a.events);if(null==r)return null;const o=a.label??a.id??a.name??"container "+(n+1),l=S(a.secondary??a.secondaryCount),i=S(a.observed??a.observedCount);return{label:s(o,t),count:r,...null!=l?{secondary:l}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=i?{observed:i}:{}}}).filter(e=>null!=e):null}(u,w):null,{measure:M,measureFallback:D,dimension:T,dimensionFallback:B}=l(c,u),I="string"==typeof M&&M?M:D,G="string"==typeof T&&T?T:B,z={};if(A.has(c)&&function(e,t,n,a,r,o){const l=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),i=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(r.has("l1")&&(a.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!r.has("l2")&&!r.has("l3"))return;if(!n||0===n.length)return void(r.has("l2")&&(a.l2="No settled projection is loaded yet."));const s=n.reduce((e,t)=>e+t.count,0),c=n.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),u=c[0]??n.slice().sort((e,t)=>t.count-e.count)[0];if(!u)return;const h=n.reduce((e,t)=>e+(t.secondary??0),0),d=n.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(r.has("l2"))if(0===c.length)a.l2=`The settled projection contains ${o(s)} ${E(s,i)} across ${n.length} ${E(n.length,l)}; no ${E(2,l)} are non-empty yet.`;else{const e=h>0?` ${o(h)} ${E(h,i)} ${1===h?"is":"are"} marked ${d}.`:"";a.l2=`The settled projection contains ${o(s)} ${E(s,i)} across ${n.length} ${E(n.length,l)}; ${c.length} ${E(c.length,l)} ${1===c.length?"is":"are"} non-empty. The largest ${l} is ${u.label} with ${o(u.count)} ${E(u.count,i)}.${e}`}if(r.has("l3")&&s>0&&c.length>0){const e=c.find(e=>e!==u),t=function(e,t){if(0>=t)return"0%";const n=e/t*100;return(10>n?Math.round(10*n)/10:Math.round(n))+"%"}(u.count,s);a.l3=e?`The settled projection is most concentrated in ${u.label}, which holds ${o(u.count)} ${E(u.count,i)} (${t}); ${e.label} follows with ${o(e.count)} ${E(e.count,i)}.`:`The settled projection is concentrated in ${u.label}, which holds all ${o(u.count)} ${E(u.count,i)}.`}}(c,C,j,z,m,w),m.has("l1")&&!A.has(c))if("BumpChart"===c)z.l1=`A ${C} ranking ${F??"series"} by ${I} across ${G}.`;else if(n.has(c)||a.has(c))z.l1=`A ${C} of ${I} by ${G}`+(F?`, split by ${F}.`:".");else if(r.has(c))z.l1=`A ${C} showing ${I} across ${G} categories.`;else if(o.has(c))z.l1=`A ${C} of the distribution of ${I}`+(F?` by ${F}.`:".");else if(k.has(c)){const e=Array.isArray(u.nodes)?u.nodes.length:void 0,t=Array.isArray(u.edges)?u.edges.length:void 0,n=[null!=e?`${e} ${E(e,"node")}`:null,null!=t?`${t} ${E(t,"edge")}`:null].filter(Boolean);z.l1=`A ${C}${n.length?" with "+n.join(" and "):""}.`}else if("BigNumber"===c){const e="string"==typeof u.label?u.label:I;z.l1=`A single value${e?" for "+e:""}.`}else z.l1=`A ${C}.`;const H=n.has(c)||"BumpChart"===c||a.has(c)||r.has(c)||o.has(c);let V=null;if((m.has("l2")||m.has("l3")||m.has("l4"))&&H&&L&&L.length>0&&(V=function(e,t,n,a){let r=0,o=0,l=1/0,i=-1/0,c=null,u=null,h=0,d=0,m=null,f=null,p=NaN,g=NaN;for(const n of e){const e=t(n);Number.isFinite(e)&&(0===r&&(p=e,m=n),g=e,f=n,l>e&&(l=e,c=n,h=r),e>i&&(i=e,u=n,d=r),r++,o+=e)}return 0===r?null:{count:r,min:l,max:i,mean:o/r,minLabel:s(null!=c?n(c):null,a),maxLabel:s(null!=u?n(u):null,a),first:p,last:g,firstLabel:s(null!=m?n(m):null,a),lastLabel:s(null!=f?n(f):null,a),minIndex:h,maxIndex:d}}(L,e(M,D),t(T,B),w)),m.has("l2")&&H&&(L&&0!==L.length?V&&(z.l2=r.has(c)?`${V.count} segments totaling ${w(function(e){return e.mean*e.count}(V))}. Largest is ${V.maxLabel} at ${w(V.max)}; smallest is ${V.minLabel} at ${w(V.min)}.`:`${I} ranges from ${w(V.min)} (${V.minLabel}) to ${w(V.max)} (${V.maxLabel}), with a mean of ${w(V.mean)} across ${V.count} points.`):z.l2="No data is loaded yet."),m.has("l3")&&V&&!F&&n.has(c)?z.l3=function(e,t,n){const{first:a,last:r,min:o,max:l,maxLabel:i,minLabel:s,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:m}=e,f=l-o,p=r-a;if(0===f)return`${q(t)} is constant at ${n(a)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${q(t)} ends roughly where it started (${n(a)} at ${c} to ${n(r)} at ${u}), ranging between ${n(o)} and ${n(l)}.`;const g=d>0&&m-1>d,$=h>0&&m-1>h,b=(l-Math.max(a,r))/f,v=(Math.min(a,r)-o)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${n(l)} (${i}), then falls to ${n(r)} (${u}).`:$&&v>.15?`Overall ${t} drops to a low of ${n(o)} (${s}), then recovers to ${n(r)} (${u}).`:.05>Math.abs(p)/f?`${q(t)} ends roughly where it started (${n(a)} at ${c} to ${n(r)} at ${u}), ranging between ${n(o)} and ${n(l)}.`:p>0?d===m-1?`Overall ${t} rises from ${n(a)} (${c}) to a peak of ${n(r)} (${u}).`:`Overall ${t} rises from ${n(a)} (${c}) to ${n(r)} (${u}), after peaking at ${n(l)} (${i}).`:h===m-1?`Overall ${t} falls from ${n(a)} (${c}) to a low of ${n(r)} (${u}).`:`Overall ${t} falls from ${n(a)} (${c}) to ${n(r)} (${u}), after dipping to ${n(o)} (${s}).`}(V,I,w):m.has("l3")&&V&&!F&&a.has(c)&&(z.l3=`The highest ${G} is ${V.maxLabel} and the lowest is ${V.minLabel}.`),m.has("l4")){const e=R(u)?"alerting":N(c,h.capability);e&&(z.l4=function(e,t,n,o,l,i,s,c){const u=P[e],h=/^[aeiou]/i.test(u)?"an":"a";let d,m;switch(e){case"locating":d="This is a map",m="read values by location";break;case"presenting":d="This is a single-value display",m=`read ${"string"==typeof n.label&&n.label?n.label:l} as the headline number`;break;case"tracing":d=`This is ${h} ${u} chart`,m="follow the movement between states";break;case"nesting":d=`This is ${h} ${u} chart`,m="read it for nested structure and how children sum into their parents";break;case"relating":d=`This is ${h} ${u} chart`,m=`read it for whether ${i} and ${l} move together`;break;default:d=`This is ${h} ${u} chart`,m=function(e,t,n,o,l,i){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+n;case"comparing":return`compare ${n} across ${o}`;case"ranking":return"read it top to bottom by "+n;case"apportioning":return`read each ${o}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+n;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,n){if(a.has(n)||r.has(n))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:o,last:l,min:i,max:s,minLabel:c,maxLabel:u,lastLabel:h,minIndex:d,maxIndex:m,count:f}=e,p=s-i;if(p>0){const e=m>0&&f-1>m,n=d>0&&f-1>d,a=(s-Math.max(o,l))/p,r=(Math.min(o,l)-i)/p;if(e&&a>.15)return`the peak of ${t(s)} at ${u} is the point to investigate`;if(n&&r>.15)return`the dip to ${t(i)} at ${c} is the point to investigate`;if(l>=s)return`the climb to ${t(l)} at ${h} warrants a closer look`;if(i>=l)return`the drop to ${t(l)} at ${h} warrants a closer look`}return`the extremes — ${u} (${t(s)}) and ${c} (${t(i)}) — are the points to check`}(t,l,i);case"tracking":return`read it for the trajectory of ${n}, which ${function(e){const t=e.max-e.min,n=e.last-e.first;return 0===t||.05>Math.abs(n)/t?"holds roughly steady":n>0?"rises":"falls"}(t)} from ${l(t.first)} (${t.firstLabel}) to ${l(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${n} across ${o}; ${t.maxLabel} leads at ${l(t.max)}`;case"ranking":return`read it top to bottom by ${n}; ${t.maxLabel} ranks highest at ${l(t.max)}`;case"apportioning":{const e=t.mean*t.count,n=e>0?Math.round(t.max/e*100):null;return`read each ${o}'s share of the ${l(e)} total; ${t.maxLabel} is the largest at ${l(t.max)}${null!=n?` (${n}%)`:""}`}case"characterizing":return`read it for the spread of ${n}, from ${l(t.min)} to ${l(t.max)}`;default:return"read the highlighted features"}}(e,o,l,i,s,t)}return`${d}; ${m}.${function(e,t){if(!t)return"";const n=t.familiarity?.[e];return"number"!=typeof n||n>2?"":` This ${x(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,c)}`}(e,c,u,F?null:V,I,G,w,h.audience))}const Q=["l1","l2","l3","l4"].filter(e=>m.has(e)&&z[e]).map(e=>z[e]).join(" "),W=U(u);return{text:W?`${W} ${Q}`.trim():Q,levels:z,...W?{annotations:W}:{}}}function q(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function E(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function V(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Q(e,t,n){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:n]}function W(e,t="—"){return null==e||""===e?t:"object"==typeof e?W(e.id??e.name??e.label,t):e+""}function K(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function X(e){return W(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Z(e,t){const n=Q(e,t,"children");return Array.isArray(n)?n:[]}function _(e,t,n){return`${e} ${1===e?t:n}`}function J(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${_(e.numericLeaves,"valued leaf","valued leaves")}`}function Y(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function ee(e,t,n){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:n]}function te(e,t="—"){return null==e||""===e?t:"object"==typeof e?te(e.id??e.name??e.label,t):e+""}function ne(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ae(e){return te(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function re(e){const t=[];return(e.linkedHover||e.selection||e.linkedBrush)&&t.push("Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&t.push("Hover or focus a mark for its details."),t.length>0?" "+t.join(" "):""}function oe(e,t,n){const a=ee(e,t,n);if(void 0!==a)return a;const r=e.properties;return r&&"object"==typeof r?ee(r,t,n):void 0}function le(e,t,n){return te(oe(e,t,"id")??oe(e,"name","name")??oe(e,"NAME","NAME")??oe(e,"label","label"),n)}function ie(e){let t=0,n=1/0,a=-1/0,r=0;for(const o of e)null!=o.value&&(t+=1,n=Math.min(n,o.value),a=Math.max(a,o.value),r+=o.value);return 0===t?null:{count:t,min:n,max:a,total:r,average:r/t}}function se(e,t){const n=ie(e);return n?`range ${t(n.min)} to ${t(n.max)}, average ${t(n.average)}, total ${t(n.total)}`:"no numeric values"}function ce(e,t,n,a){const r=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),o="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],l=Array.isArray(t.flows)?t.flows:[],i=Array.isArray(t.lines)?t.lines:[],s=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?r:o).map((n,a)=>({datum:n,index:a,label:le(n,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:ne(oe(n,s,"value"))})),h=u.filter(e=>null!=e.value),d={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${r.length} regions.${h.length>0?` Values are available for ${h.length} of ${r.length} regions; ${se(h,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${l.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${i.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${re(t)}`,children:[]};if("ChoroplethMap"===e)d.children=function(e,t,n){const a=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),r=new Map;let o,l=0;for(const[e,t]of a.entries())o!==t.value&&(l=e+1,o=t.value),r.set(t.index,l);let i=0;return function(e){const t=e.filter(e=>null!=e.value),n=e.filter(e=>null==e.value),a=[],r=ie(t);if(r)if(r.min===r.max)a.push({id:"equal",label:"Equal values",rows:t});else{const e=r.min+(r.max-r.min)/3,n=r.min+2*(r.max-r.min)/3,o=t.filter(e=>e.value>=n),l=t.filter(t=>t.value>=e&&n>t.value),i=t.filter(t=>e>t.value);o.length>0&&a.push({id:"highest",label:"Highest values",rows:o}),l.length>0&&a.push({id:"middle",label:"Middle values",rows:l}),i.length>0&&a.push({id:"lowest",label:"Lowest values",rows:i})}return n.length>0&&a.push({id:"missing",label:"No numeric value",rows:n}),a}(e).map(e=>{const o=e.rows.slice(0,Math.max(0,t-i));i+=o.length;const l=o.map(e=>{const t=r.get(e.index),o=null==t||2>a.length?"":`, rank ${t} of ${a.length}`;return{id:`geo-${ae(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${n(e.value)}${o}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),s=e.rows.length-o.length;return s>0&&l.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${s} more ${1===s?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${se(e.rows,n)}.`,children:l}})}(u,n,a);else if(u.length>0){const e=u.slice(0,n).map(e=>({id:`geo-${ae(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+a(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>n&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-n} more locations.`}),d.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}const m="FlowMap"===e?l:i;if(m.length>0){const e=m.slice(0,n).map((e,t)=>{const n=te(e.source,"unknown"),r=te(e.target,"unknown"),o=ne(ee(e,s,"value"));return{id:`route-${ae(n)}-${ae(r)}-${t}`,role:"datum",level:3,label:`${n} to ${r}${null==o?"":": "+a(o)}.`,...null==o?{}:{value:o},datum:e}});d.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${m.length} ${1===m.length?"route":"routes"}.`,children:e})}return d}var ue=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),he=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),de=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);function me(e,t={},l={}){return!!$(e,t,l.recipe)||ue.has(e)||he.has(e)||de.has(e)||n.has(e)||a.has(e)||r.has(e)||o.has(e)}function fe(e,t,n){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:n]}function pe(e,t="—"){return null==e||""===e?t:"object"==typeof e?pe(e.id??e.name??e.label,t):e+""}function ge(e){if(null==e||""===e)return;const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function $e(e){return pe(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function be(e,t){const n=[];return(e.linkedHover||e.selection||e.linkedBrush)&&n.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&n.push("Hover or focus a mark for its details."),n.length>0?" "+n.join(" "):""}function ve(e,t){t&&e.children?.push(t)}function ye(r,o,u={}){const h=u.locale??"en",d=Math.max(1,u.maxLeaves??200),m=O(h),f=$(r,o,u.recipe);if(f)return function(e,t,n={}){const a=g(t),r=p(t),o=Math.max(1,n.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:a,config:r,locale:n.locale??"en"});const l=(i=e.navigation)&&"object"==typeof i?e.navigation:void 0;var i;const s=(l?.groupByRole?v(e,l.groupByRole):void 0)??(l?.groupBy?.[0]?v(e,l.groupBy[0])??e.dataRoles.find(e=>e.field===l.groupBy?.[0]):void 0)??y(e,["nominal","ordinal"]),c=s?b(s,r,a):void 0,u=(l?.idRole?v(e,l.idRole):void 0)??y(e,["identifier"]),h=u?b(u,r,a):void 0,d={id:"root",role:"chart",label:l?.summaryTemplate?w(l.summaryTemplate,void 0,e,r,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]};let m=0;const f=(t,n,o)=>{const i=h?t[h]:void 0,s=l?.itemLabelTemplate?w(l.itemLabelTemplate,t,e,r,a,{count:a.length}):function(e,t,n,a){const r=y(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),l=r?b(r,n,a):void 0,i=[];l&&null!=e[l]&&i.push(e[l]+"");for(const t of o){const r=b(t,n,a);r&&null!=e[r]&&i.push(`${t.role}: ${e[r]+""}`)}return i.length>0?i.join(", "):"Data item"}(t,e,r,a);return{id:"datum-"+V(i??n),role:"datum",label:s,level:o,datum:t}};if(c){const e=new Map;for(const t of a){const n=(t[c]??"Uncategorized")+"",a=e.get(n);a?a.push(t):e.set(n,[t])}d.children=[...e].map(([e,t],n)=>{const a=t.slice(0,Math.max(0,o-m));m+=a.length;const r=a.map((e,t)=>f(e,1e5*n+t,3));return t.length>a.length&&r.push({id:"more-"+V(e),role:"datum",label:`…and ${t.length-a.length} more items`,level:3}),{id:"group-"+V(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:r}})}else{const e=a.slice(0,o);d.children=e.map((e,t)=>f(e,t,2)),a.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return d}(f,o,{maxLeaves:d,locale:h});const C={id:"root",role:"chart",label:H(r,o,{locale:h}).text||"Chart.",level:1,children:[]},k=function(e,t){const n=Array.isArray(e.annotations)?e.annotations:null;if(!n)return null;const a=c(n.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let r=0;const o=a.slice(0,t).map(e=>{const t=e.lifecycle?.status,n=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+r++,role:"annotation",level:3,label:`${a=z(e),a?a.charAt(0).toUpperCase()+a.slice(1):a}${n}.`,datum:e};var a});a.length>t&&o.push({id:"annotation-"+r++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});const l=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===l?"one marked feature":l+" marked features"}.`,children:o}}(o,d);if(ue.has(r)){const e=function(e,t,n,a){const r=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],l=t.nodeIdAccessor??t.nodeIDAccessor,i=t.sourceAccessor??"source",s=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>pe(fe(e,l,"id"),"unknown"),h=(e,t)=>pe(fe(e,t,""),"unknown"),d=new Set;for(const e of o)d.add(h(e,i)),d.add(h(e,s));const m=r.length>0?r:[...d].map(e=>({id:e})),f=new Map;for(const e of m)f.set(u(e),{links:0,value:0});for(const e of o){const t=h(e,i),n=h(e,s),a=ge(fe(e,c,"value"))??0;for(const e of[t,n]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}const p={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${m.length} nodes and ${o.length} links.${be(t,"network")}`,children:[]};let g=0;const $=new Map,b=t.colorBy??"group";for(const e of m){const t=pe(fe(e,b,"group"),"Ungrouped"),n=$.get(t);n?n.push(e):$.set(t,[e])}const v=[...$].map(([e,t],r)=>{const o=[];for(const[e,l]of t.entries()){if(g>=n)break;g+=1;const t=u(l),i=f.get(t)??{links:0,value:0},s=i.value>0?`, ${a(i.value)} total flow`:"";o.push({id:`node-${r}-${e}-${$e(t)}`,role:"datum",level:3,label:`${t}: ${i.links} ${1===i.links?"link":"links"}${s}.`,value:i.value>0?i.value:void 0,datum:l})}return{id:`nodes-${r}-${$e(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});v.length>0&&p.children?.push(...v);const y=o.slice(0,n).map((e,t)=>{const n=h(e,i),r=h(e,s),o=ge(fe(e,c,"value"));return{id:`link-${$e(n)}-${$e(r)}-${t}`,role:"datum",level:3,label:`${n} to ${r}${null==o?"":": "+a(o)}.`,value:o,datum:e}});return o.length>n&&y.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-n} more links.`,value:void 0}),y.length>0&&p.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:y}),p}(r,o,d,m);return ve(e,k),e}if(he.has(r)){const e=function(e,t,n,a){const r=t.data&&"object"==typeof t.data?t.data:null,o=t.childrenAccessor??"children",l=t.valueAccessor??"value",i=t.nodeLabel??t.nodeIdAccessor,s=new WeakMap,c=new WeakSet,u=e=>{const t=s.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);const n=Z(e,o);let a;if(0===n.length){const t=K(Q(e,l,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=n.reduce((e,t)=>{const n=u(t);return{descendants:e.descendants+1+n.descendants,depth:Math.max(e.depth,n.depth+1),leaves:e.leaves+n.leaves,numericLeaves:e.numericLeaves+n.numericLeaves,leafTotal:e.leafTotal+n.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),s.set(e,a),a};let h=0;const d=(e,t,r,s)=>{const c=W(Q(e,i,"name"),"item "+r);if(s.has(e))return{id:`hierarchy-${X(r)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};const m=Z(e,o),f=u(e);if(0===m.length){if(h>=n)return null;h+=1;const o=K(Q(e,l,"value"));return{id:`hierarchy-${X(r)}-${X(c)}`,role:"datum",level:t,label:`${c}${null==o?"":": "+a(o)}.`,...null==o?{}:{value:o},datum:e}}const p=new Set(s);p.add(e);const g=[];let $=0;for(const[e,a]of m.entries()){if(h>=n){$+=u(a).leaves;continue}const o=d(a,t+1,`${r}-${e}`,p);o&&g.push(o)}return $>0&&g.push({id:`hierarchy-${X(r)}-more`,role:"datum",level:t+1,label:`${_($,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${n}.`}),{id:`hierarchy-${X(r)}-${X(c)}`,role:"series",level:t,label:`${c}: ${_(m.length,"direct child","direct children")}, ${_(f.descendants,"total descendant","total descendants")}, ${_(f.leaves,"leaf","leaves")}${J(f,a)}.`,datum:e,children:g}},m=r?u(r):null,f={id:"root",role:"chart",level:1,label:r?`A ${Y(e)} chart with ${_(m.leaves,"leaf","leaves")} and ${_(m.descendants,"total descendant","total descendants")} across ${_(m.depth,"hierarchy level","hierarchy levels")}${J(m,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(r){const e=d(r,2,"root",new Set);if(e){const t=W(Q(r,i,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}(r,o,d,m);return ve(e,k),e}if(de.has(r)){const e=ce(r,o,d,m);return ve(e,k),e}const A=Array.isArray(o.data)?o.data:null,x=me(r,o,u);if(!A||0===A.length||!x)return k&&(C.children=[k]),C;const{measure:S,measureFallback:L,dimension:F,dimensionFallback:j}=l(r,o),M=e(S,L),P=t(F,j),N="string"==typeof S&&S?S:L,D="string"==typeof F&&F?F:j,T=i(o);let B=0;const I=e=>`${e}-${B++}`,R=(e,t)=>{const n=e.slice(0,d).map(e=>((e,t)=>{const n=M(e),a=s(P(e),m);return{id:I("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(n)?m(n):"—"}`,value:Number.isFinite(n)?n:void 0,datum:e}})(e,t));return e.length>d&&n.push({id:I("more"),role:"datum",level:t,label:`…and ${e.length-d} more points`}),n},G=[];if(n.has(r)||a.has(r)){let e=1/0,t=-1/0,n=1/0,o=-1/0;const l=[];let i=!0;for(const a of A){const r=M(a);Number.isFinite(r)&&(e>r&&(e=r),r>t&&(t=r));const s=P(a);l.push(s),"number"==typeof s&&Number.isFinite(s)?(n>s&&(n=s),s>o&&(o=s)):i=!1}const c=new Set,u=[];for(const e of l){const t=e+"";c.has(t)||(c.add(t),u.push(e))}const h=i?`${m(n)} to ${m(o)}`:`${s(u[0],m)} to ${s(u[u.length-1],m)} (${a.has(r)?u.length+" categories":A.length+" points"})`;G.push({id:I("axis"),role:"axis",level:2,label:`${a.has(r)?"Category axis":"X axis"}: ${D}, ${h}.`}),e>t||G.push({id:I("axis"),role:"axis",level:2,label:`Value axis: ${N}, ${m(e)} to ${m(t)}.`})}if(T){const e=t(T,T),n=new Map;for(const t of A){const a=(e(t)??"—")+"",r=n.get(a);r?r.push(t):n.set(a,[t])}const a=[];for(const[e,t]of n){const n=H(r,{...o,data:t},{levels:["l2","l3"],locale:h}).text;a.push({id:I("series"),role:"series",level:2,label:`Series ${e}: ${n}`,children:R(t,3)})}C.children=[...G,...a]}else C.children=[...G,...R(A,2)];return k&&C.children.push(k),C}export{u as isJsonSafe,d as getChartRecipe,m as resolveChartRecipe,f as recipeIntentId,N as resolveCommunicativeAct,H as describeChart,me as supportsStructuredNavigation,ye as buildNavigationTree};
@@ -1 +0,0 @@
1
- import{areaCanvasRenderer as e}from"./c-AH6J4MTN.min.js";import{lineCanvasRenderer as t}from"./c-CZF7MV67.min.js";import{buildAreaNode as o,buildLineNode as n,buildPointNode as r,buildStackedAreaNodes as s,normalizeGradient as i}from"./c-F3LIKINL.min.js";import{buildAggregateRibbons as c,buildPerSeriesRibbons as a,partitionRibbons as l}from"./c-VGKUEZBC.min.js";import{pointCanvasRenderer as f}from"./c-T6UAIKBH.min.js";var u=Object.create(null);function g(e){u[e.chartType]=e}function d(e){return u[e]}function y(e){return u[e]?.buildScene}function p(e,t=!1){if(t){const e=u.custom?.canvasRenderers;if(e&&e.length>0)return e;const t=new Set,o=[];for(const e of Object.values(u))if(e)for(const n of e.canvasRenderers)t.has(n)||(t.add(n),o.push(n));return o}return u[e]?.canvasRenderers??[]}function h(e){return Array.isArray(e)?{nodes:e,binBoundaries:[]}:{nodes:e.nodes,binBoundaries:e.binBoundaries}}function v(e,t,o,n){if(!e.config.pointStyle)return;const s=n??e.getY;for(const n of t){const t=e.resolveGroupColor(n.key);for(const i of n.data){let n=e.config.pointStyle(i);!n.fill&&t&&(n={...n,fill:t});const c=n.r??3,a=e.getPointId?e.getPointId(i)+"":void 0,l=r(i,e.scales,e.getX,s,c,n,a);l&&o.push(l)}}}function k(e){return"threshold"===e.type&&"string"==typeof e.color&&"number"==typeof e.value}var m={chartType:"line",buildScene:(e,t)=>function(e,t){const o=e.groupData(t),r=[],s=e.config.annotations?.filter(k).map(e=>({value:e.value,color:e.color,thresholdType:e.thresholdType||"greater"}));if(e.ribbons&&e.ribbons.length>0){const{perSeries:n,aggregate:s}=l(e.ribbons);if(s.length>0&&r.push(...c(e,t,s)),n.length>0)for(const t of o)r.push(...a(e,t.data,t.key,n))}for(const t of o){const o=e.resolveLineStyle(t.key,t.data[0]),i=n(t.data,e.scales,e.getX,e.getY,o,t.key);s&&s.length>0&&(i.colorThresholds=s),e.config.curve&&"linear"!==e.config.curve&&(i.curve=e.config.curve),e.config.lineGradient&&(i.strokeGradient=e.config.lineGradient),r.push(i)}return v(e,o,r),r}(e,t),canvasRenderers:[e,t,f]};function b(e){return i(e)}function S(e,t){const o=e.groupData(t),n=e.config.stackOrder??"key",r=()=>o.sort((e,t)=>t.key>e.key?-1:e.key>t.key?1:0);if("input"===n);else if("key"===n)r();else if("asc"===n||"desc"===n||"insideOut"===n){const t=new Map;for(const n of o){let o=0;for(const t of n.data){const n=e.getX(t),r=e.getY(t);Number.isFinite(n)&&Number.isFinite(r)&&(o+=r)}t.set(n.key,o)}const r=(e,t)=>t>e?-1:e>t?1:0;if("asc"===n)o.sort((e,o)=>{const n=(t.get(e.key)??0)-(t.get(o.key)??0);return 0!==n?n:r(e.key,o.key)});else if("desc"===n)o.sort((e,o)=>{const n=(t.get(o.key)??0)-(t.get(e.key)??0);return 0!==n?n:r(e.key,o.key)});else{const e=[...o].sort((e,o)=>{const n=(t.get(o.key)??0)-(t.get(e.key)??0);return 0!==n?n:r(e.key,o.key)}),n=[],s=[];let i=0,c=0;for(const o of e)c>i?(n.push(o),i+=t.get(o.key)??0):(s.push(o),c+=t.get(o.key)??0);o.length=0,o.push(...s.reverse(),...n)}}else r();const i=e.config.curve&&"linear"!==e.config.curve?e.config.curve:void 0,c=e.config.normalize?"zero":e.config.baseline??"zero",{nodes:a,stackedTops:l}=s(o,e.scales,e.getX,e.getY,(t,o)=>e.resolveAreaStyle(t,o),e.config.normalize,i,c),f=a;if(e.config.pointStyle){const t=new WeakMap;for(const n of o){const o=l.get(n.key);if(o)for(const r of n.data){const n=e.getX(r),s=e.getY(r);null==n||Number.isNaN(n)||null==s||Number.isNaN(s)||!o.has(n)||t.set(r,o.get(n))}}const n=o=>t.get(o)??e.getY(o);v(e,o,f,n)}return f}var G={chartType:"area",buildScene:(e,t)=>function(e,t){const n=e.groupData(t),r=[];if(e.ribbons&&e.ribbons.length>0){const{perSeries:o,aggregate:s}=l(e.ribbons);if(s.length>0&&r.push(...c(e,t,s)),o.length>0)for(const t of n)r.push(...a(e,t.data,t.key,o))}const s=e.scales.y.domain(),i=s[0],f=e.config.semanticLineStops?.filter(e=>Number.isFinite(e.offset)).map(e=>({value:s[0]+Math.max(0,Math.min(1,e.offset))*(s[1]-s[0]),color:e.color,opacity:e.opacity,thresholdType:"greater"})).sort((e,t)=>e.value-t.value),u=f&&f.length>0?(()=>{const t=f.reduce((e,t)=>(e.at(-1)?.value===t.value?e[e.length-1]=t:e.push(t),e),[]),o=[{from:s[0],to:t[0].value,color:t[0].color,opacity:t[0].opacity}];for(let e=0;t.length>e;e++)o.push({from:t[e].value,to:t[e+1]?.value??s[1],color:t[e].color,opacity:t[e].opacity});return o.map(({from:t,to:o,color:n,opacity:r})=>{const s=e.scales.y(t),i=e.scales.y(o);return{y:Math.min(s,i),height:Math.abs(i-s),color:n,...null!=r&&{opacity:r}}}).filter(e=>e.height>0)})():void 0,g=e.getY0?t=>{const o=e.getY0(t);return null==o?i:o}:void 0;for(const t of n){const n=e.resolveAreaStyle(t.key,t.data[0]),s=o(t.data,e.scales,e.getX,e.getY,i,n,t.key,g),c=b(e.config.gradientFill);c&&(s.fillGradient=c),e.config.curve&&"linear"!==e.config.curve&&(s.curve=e.config.curve),e.config.lineGradient&&(s.strokeGradient=e.config.lineGradient),f&&f.length>0&&(s.colorThresholds=f,s.strokeColorBands=u),r.push(s)}return v(e,n,r),r}(e,t),canvasRenderers:[e,f]},N={chartType:"mixed",buildScene:(e,t)=>function(e,t){const r=e.groupData(t),s=[],i=e.config.areaGroups||new Set;if(e.ribbons&&e.ribbons.length>0){const{perSeries:o,aggregate:n}=l(e.ribbons);if(n.length>0&&s.push(...c(e,t,n)),o.length>0)for(const t of r)s.push(...a(e,t.data,t.key,o))}const f=e.scales.y.domain()[0],u=e.getY0?t=>{const o=e.getY0(t);return null==o?f:o}:void 0;for(const t of r)if(i.has(t.key)){const n=e.resolveAreaStyle(t.key,t.data[0]),r=o(t.data,e.scales,e.getX,e.getY,f,n,t.key,u),i=b(e.config.gradientFill);i&&(r.fillGradient=i),e.config.curve&&"linear"!==e.config.curve&&(r.curve=e.config.curve),e.config.lineGradient&&(r.strokeGradient=e.config.lineGradient),s.push(r)}else{const o=e.resolveLineStyle(t.key,t.data[0]),r=n(t.data,e.scales,e.getX,e.getY,o,t.key);e.config.curve&&"linear"!==e.config.curve&&(r.curve=e.config.curve),e.config.lineGradient&&(r.strokeGradient=e.config.lineGradient),s.push(r)}return v(e,r,s),s}(e,t),canvasRenderers:[e,t,f]};function w(e,t,o,n,r,s=!1){const i=new Map;for(const c of e){const e=t(c),a=o(c);if(null==e||null==a||Number.isNaN(e)||Number.isNaN(a))continue;const l=Math.floor(e/n)*n;let f=i.get(l);if(f||(f={start:l,end:l+n,total:0,categories:new Map,...s?{rows:[],categoryRows:new Map}:{}},i.set(l,f)),f.total+=a,f.rows?.push(c),r){const e=r(c);if(f.categories.set(e,(f.categories.get(e)||0)+a),f.categoryRows){let t=f.categoryRows.get(e);t||(t=[],f.categoryRows.set(e,t)),t.push(c)}}}return i}function Y(e,t,o,n,r){const s=w(e,t,o,n,r);if(0===s.size)return[0,0];let i=0;for(const e of s.values())e.total>i&&(i=e.total);return[0,i]}export{g as registerXYPlugin,d as getXYPlugin,y as getXYSceneBuilder,p as getXYCanvasRenderers,h as unwrapXYScene,w as computeBins,Y as computeBinExtent,m as lineXYPlugin,S as buildStackedAreaScene,G as areaXYPlugin,N as mixedXYPlugin};
@@ -1 +0,0 @@
1
- import{getMinMax as e}from"./c-GGISSW5E.min.js";function t(t,a){const{field:i,bins:r=10}=a,s=t.map(e=>Number(e[i])).filter(e=>!isNaN(e));if(0===s.length)return[];const[n,l]=e(s),c=a.domain?a.domain[0]:n,u=a.domain?a.domain[1]:l;if(c===u)return[{category:`${c}-${u}`,value:s.length}];const f=(u-c)/r,d=Array(r).fill(0);for(const e of s){let t=Math.floor((e-c)/f);t===r&&(t=r-1),t>=0&&r>t&&d[t]++}return d.map((e,t)=>{const a=c+t*f,i=a+f;return{category:`${o(a)}-${o(i)}`,value:e}})}function a(t,a){const{groupBy:i,value:r,agg:o="sum"}=a,s=new Map;for(const e of t){const t=e[i]+"";s.has(t)||s.set(t,[]),s.get(t).push(Number(e[r]))}const n=[];for(const[t,a]of s){let r;switch(o){case"count":r=a.length;break;case"mean":r=a.reduce((e,t)=>e+t,0)/a.length;break;case"min":r=e(a)[0];break;case"max":r=e(a)[1];break;default:r=a.reduce((e,t)=>e+t,0)}n.push({[i]:t,value:r})}return n}function i(e,t){const{key:a,fields:i}=t,r=new Map;for(const t of e){const e=t[a]+"";if(r.has(e)||r.set(e,[]),i){const a={};for(const e of i)e in t&&(a[e]=t[e]);r.get(e).push(a)}else r.get(e).push({...t})}const o=[];for(const[e,t]of r)o.push({id:e,coordinates:t});return o}function r(e,t){const{columns:a,nameField:i="name",valueField:r="value"}=t,o=new Set(a),s=[];for(const t of e){const e={};for(const a of Object.keys(t))o.has(a)||(e[a]=t[a]);for(const o of a)s.push({...e,[i]:o,[r]:t[o]})}return s}function o(e){return Math.round(1e3*e)/1e3+""}function s(e){return"nominal"===e||"ordinal"===e}function n(e){return"quantitative"===e||"temporal"===e}var l={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},c={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},u={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function f(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...i}=e,{usermeta:r,...o}=t[0];return{...i,...o}}(e);const t=[],{type:i,markProps:r}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),o=e.encoding||{},f=o.x,y=o.y,g=o.color,m=o.size,h=o.theta,v=o.opacity;let b;e.data?.values?b=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const x={};e.width&&(x.width=e.width),e.height&&(x.height=e.height);const A=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(A&&(x.title=A),g?.field&&(x.colorBy=g.field,g.scale?.scheme)){const e=l[g.scale.scheme];e&&(x.colorScheme=e)}void 0!==v?.value&&(x.pointOpacity=v.value);const k=f?.aggregate,L=y?.aggregate;if(b&&(k||L)){const e=L?y:f,t=L?f:y,i=u[e.aggregate];if(i&&t?.field&&e.field)b=a(b,{groupBy:t.field,value:e.field,agg:i});else if(("count"===i||"count"===e.aggregate)&&t?.field&&b){const e=new Map;for(const a of b){const i=a[t.field]+"";e.set(i,(e.get(i)||0)+1)}b=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(f?.bin||y?.bin){const e="Histogram";b&&(x.data=b),f?.bin?(x.valueAccessor=f.field,y?.field&&(x.categoryAccessor=y.field),f.axis?.title&&(x.valueLabel=f.axis.title)):y?.bin&&(x.valueAccessor=y.field,f?.field&&(x.categoryAccessor=f.field),y.axis?.title&&(x.valueLabel=y.axis.title));const a=f?.bin||y?.bin,i="object"==typeof a?a.maxbins:void 0;return i&&(x.bins=i),p(e,x,t)}let w;switch(i){case"bar":w=function(e,t,a,i,r,o,l){let c;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(c="StackedBarChart",i.stackBy=a.field):c="BarChart",s(e?.type)&&n(t?.type)?(i.categoryAccessor=e.field,i.valueAccessor=l?"value":t.field,e?.axis?.title&&(i.categoryLabel=e.axis.title),t?.axis?.title&&(i.valueLabel=t.axis.title)):n(e?.type)&&s(t?.type)?(i.categoryAccessor=t.field,i.valueAccessor=o?"value":e.field,i.orientation="horizontal",t?.axis?.title&&(i.categoryLabel=t.axis.title),e?.axis?.title&&(i.valueLabel=e.axis.title)):(e?.field&&(i.categoryAccessor=e.field),t?.field&&(i.valueAccessor=l?"value":t.field),e?.axis?.title&&(i.categoryLabel=e.axis.title),t?.axis?.title&&(i.valueLabel=t.axis.title)),r&&(i.data=r),c}(f,y,g,x,b,k,L);break;case"line":if(w="LineChart",d(f,y,x,k,L),g?.field&&(x.lineBy=g.field),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}!0===r.point&&(x.showPoints=!0),b&&(x.data=b);break;case"area":if(g?.field?(w="StackedAreaChart",x.areaBy=g.field):w="AreaChart",d(f,y,x,k,L),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}void 0!==r.opacity&&(x.areaOpacity=r.opacity),b&&(x.data=b);break;case"point":case"circle":case"square":m?.field?(w="BubbleChart",x.sizeBy=m.field,m.scale?.range&&(x.sizeRange=m.scale.range)):w="Scatterplot",d(f,y,x,k,L),b&&(x.data=b);break;case"rect":w="Heatmap",f?.field&&(x.xAccessor=f.field),y?.field&&(x.yAccessor=y.field),g?.field&&(x.valueAccessor=g.field,delete x.colorBy),f?.axis?.title&&(x.xLabel=f.axis.title),y?.axis?.title&&(x.yLabel=y.axis.title),b&&(x.data=b);break;case"arc":r.innerRadius&&r.innerRadius>0?(w="DonutChart",x.innerRadius=r.innerRadius):w="PieChart",h?.field?x.valueAccessor=h.field:y?.field&&(x.valueAccessor=L?"value":y.field),g?.field&&(x.categoryAccessor=g.field),f?.field&&!h?.field&&(x.categoryAccessor=f.field),b&&(x.data=b);break;case"tick":w="DotPlot",s(f?.type)?(x.categoryAccessor=f.field,y?.field&&(x.valueAccessor=L?"value":y.field),f?.axis?.title&&(x.categoryLabel=f.axis.title),y?.axis?.title&&(x.valueLabel=y.axis.title)):s(y?.type)?(x.categoryAccessor=y.field,f?.field&&(x.valueAccessor=k?"value":f.field),x.orientation="horizontal",y?.axis?.title&&(x.categoryLabel=y.axis.title),f?.axis?.title&&(x.valueLabel=f.axis.title)):(f?.field&&(x.categoryAccessor=f.field),y?.field&&(x.valueAccessor=L?"value":y.field)),b&&(x.data=b);break;default:t.push(`Unsupported mark type "${i}". Defaulting to Scatterplot.`),w="Scatterplot",d(f,y,x,k,L),b&&(x.data=b)}return p(w,x,t)}function d(e,t,a,i,r){e?.field&&(a.xAccessor=i?"value":e.field),t?.field&&(a.yAccessor=r?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function p(e,t,a){const i={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){i.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return i}export{t as bin,a as rollup,i as groupBy,r as pivot,f as fromVegaLite};
@@ -1 +0,0 @@
1
- import{useChartSetup as e,useFrameImperativeHandle as t}from"./c-F5ZB5GJ6.min.js";import{useChartMode as o}from"./c-VN2HG5BS.min.js";function n(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}import{useMemo as i,useRef as r}from"react";function a(e){const a=r(null);return t(e.imperativeRef,{variant:e.imperativeVariant,frameRef:a}),{frameRef:a,resolved:o(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:i(()=>n(e.margin),[e.margin])}}function l(t){const o=a(t),{resolved:n,normalizedMargin:i}=o,r=e({data:t.data??[],rawData:t.data,colorBy:t.colorBy,colorScheme:t.colorScheme,legendInteraction:t.legendInteraction,legendPosition:t.legendPosition,frameLegend:t.frameLegend,selection:t.selection,linkedHover:t.linkedHover,hoverHighlight:t.hoverHighlight,fallbackFields:"string"==typeof t.colorBy?[t.colorBy]:[],unwrapData:t.unwrapData,onObservation:t.onObservation,onClick:t.onClick,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,chartType:t.chartTypeLabel,chartId:t.chartId,showLegend:n.showLegend,legend:t.legend,userMargin:i,marginDefaults:n.marginDefaults,loading:t.loading,loadingContent:t.loadingContent,emptyContent:t.emptyContent,width:n.width,height:n.height});return{...o,safeData:r.data,setup:r,earlyReturn:r.earlyReturn}}export{n as normalizePartialMargin,a as useCustomChartScaffold,l as useCustomChartSetup};
@@ -1 +0,0 @@
1
- function l(l){return!(!l._pulseIntensity||0>=l._pulseIntensity)}function t(t,e,n=.3){l(e)&&(t.globalAlpha=e._pulseIntensity*n,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.fillRect(e.x,e.y,e.w,e.h))}function e(t,e,n=.6){if(!l(e))return;const s=e.r+(e._pulseGlowRadius??4)*e._pulseIntensity,i=e.cx??e.x??0,o=e.cy??e.y??0;t.beginPath(),t.arc(i,o,s,0,2*Math.PI),t.strokeStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.lineWidth=2*e._pulseIntensity,t.globalAlpha=e._pulseIntensity*n,t.stroke()}function n(t,e,n,s=.35){l(e)&&(t.globalAlpha=e._pulseIntensity*s,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",n?t.fill(n):t.fill())}export{l as hasPulse,t as renderRectPulse,e as renderCirclePulse,n as renderPathPulse};
@@ -1 +0,0 @@
1
- import*as e from"react";function r({label:r="Data range brush",description:t="Use arrow keys to move the selected range, Shift plus an arrow key to resize it, and Escape to clear it.",onAction:i}={}){const n=e.useId().replace(/:/g,""),o=e.useRef(i);return o.current=i,{description:t,descriptionId:"semiotic-brush-description-"+n,svgProps:{role:"region",tabIndex:0,"aria-label":r,"aria-describedby":"semiotic-brush-description-"+n,onKeyDown:e.useCallback(e=>{const r=function(e){return"Escape"===e.key?{type:"clear"}:"ArrowLeft"===e.key?{type:"nudge",direction:"left",resize:e.shiftKey}:"ArrowRight"===e.key?{type:"nudge",direction:"right",resize:e.shiftKey}:"ArrowUp"===e.key?{type:"nudge",direction:"up",resize:e.shiftKey}:"ArrowDown"===e.key?{type:"nudge",direction:"down",resize:e.shiftKey}:null}(e);r&&(e.preventDefault(),o.current?.(r))},[])}}}export{r as useBrushAccessibility};
@@ -1 +0,0 @@
1
- function t(t,e,n,o){return"function"==typeof e.style?e.style(o||{},n):e.style&&"object"==typeof e.style?e.style:t.resolveBoundsStyle(n,o)}function e(e,n,o,i){if(!e.scales)return null;const r=[],s=[];for(const t of n){const n=e.getX(t);if(!Number.isFinite(n))continue;const o=i.getTop(t),u=i.getBottom(t);if(!Number.isFinite(o)||!Number.isFinite(u))continue;const c=e.scales.x(n),f=e.scales.y(o),a=e.scales.y(u);Number.isFinite(c)&&Number.isFinite(f)&&Number.isFinite(a)&&(r.push([c,f]),s.push([c,a]))}return 2>r.length?null:{type:"area",topPath:r,bottomPath:s,...e.config.curve&&"linear"!==e.config.curve&&{curve:e.config.curve},style:t(e,i,o,n[0]),datum:n,group:o,interactive:i.interactive}}function n(t){const e=[],n=[];if(!t)return{perSeries:e,aggregate:n};for(const o of t)o.perSeries?e.push(o):n.push(o);return{perSeries:e,aggregate:n}}function o(t,n,o){const i=[];for(const r of o){const o=e(t,n,"__ribbon_aggregate",r);o&&i.push(o)}return i}function i(t,n,o,i){const r=[];for(const s of i){const i=e(t,n,o,s);i&&r.push(i)}return r}function r(t,e){if(!t)return{};if(!e||0===e.length)return t;const n=[];for(const o of e){if("band"!==o.kind)continue;const e=o.getTop(t),i=o.getBottom(t);Number.isFinite(i)&&Number.isFinite(e)&&n.push({y0:i,y1:e})}return 0===n.length?t:{...t,band:n[0],bands:n}}export{n as partitionRibbons,o as buildAggregateRibbons,i as buildPerSeriesRibbons,r as enrichDatumWithBand};
@@ -1 +0,0 @@
1
- function e(e){if("undefined"!=typeof __filename){const r=__filename.replace(/\\/g,"/"),n=r.startsWith("/")?r:"/"+r;return new URL("./"+e,"file:"+n)}throw Error("Cannot resolve module worker asset: "+e)}export{e as commonJsWorkerModuleUrl};
@@ -1 +0,0 @@
1
- import{confidenceZScore as e,fitLinearForForecast as t,forecastIntervalStats as n,linearRegression as i,polynomialRegression as o}from"./c-GR6MOEQC.min.js";import{ObservationProvider as r,SelectionProvider as a,buildPredicate as s,hasOwnEnumerableKey as l,useObservationSelector as c,useReducedMotion as u,useSelectionSelector as d,useTheme as h,useThemeSelector as f}from"./c-VRXUB2F2.min.js";import{getMinMax as m}from"./c-GGISSW5E.min.js";import{COLOR_SCHEMES as y,DEFAULT_COLOR as p,DEFAULT_COLORS as g,STREAMING_PALETTE as b,createColorScale as x,getColor as v,resolveCategoricalPalette as w,resolveExplicitColor as k}from"./c-EGR6VYBW.min.js";import{attachSelectionProvenance as $}from"./c-PGKQGGQ2.min.js";import{clampCornerRadii as M,clearCSSColorCache as A,glyphFractionClipRect as S,glyphPlacement as C,hasAnyCornerRadius as L,hatchPatternDef as j,isHatchFill as N,resolveAnnotationGradient as I,resolveGlyphPaint as W,resolveSvgFill as R,subscribeToCSSColorInvalidation as z,symbolPathString as F}from"./c-QKHMBE2E.min.js";var T={fresh:1,aging:1.5,stale:3};function O(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}function P(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 D(e){const{data:t,encoding:n}=e,i=[],o=new Map;return t.forEach((e,t)=>{const r=P(n.id,e,t);if(null==r||""===r)throw Error(`[semiotic] Motion encoding row ${t} resolved an empty id.`);const a=r+"";if(o.has(a))throw Error(`[semiotic] Duplicate motion encoding id "${a}".`);const s=P(n.process?.group,e,t),l=P(n.process?.stage,e,t),c=P(n.accessible?.group,e,t)??(null!=s?s+"":null!=l?l+"":void 0),u={};for(const i of Object.keys(n.evidence??{}))u[i]=P(n.evidence?.[i],e,t);const d={id:a,datum:e,time:{arrival:P(n.time?.arrival,e,t),basis:n.time?.basis,unit:n.time?.unit},placement:{x:P(n.placement?.x,e,t),y:P(n.placement?.y,e,t),lane:P(n.placement?.lane,e,t),space:n.placement?.space},kinematics:{velocityX:P(n.kinematics?.velocityX,e,t),velocityY:P(n.kinematics?.velocityY,e,t),space:n.kinematics?.space},process:{group:s,stage:l,target:P(n.process?.target,e,t),work:P(n.process?.work,e,t)},evidence:u,accessible:{description:P(n.accessible?.description,e,t),group:c,label:P(n.accessible?.label,e,t)??a}};i.push(d),o.set(a,d)}),{rows:i,byId:o}}function E(e){const t=e.now-e.arrival;return{age:t,progress:Number.isFinite(t)&&Number.isFinite(e.ttl)&&e.ttl>0?Math.max(0,t)/e.ttl:t===1/0&&Number.isFinite(e.ttl)&&e.ttl>0?1/0:0,lifecycle:O(t,e.ttl,e.thresholds)}}function B(e){const 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)||0>=e.extent)return 1;const n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){const i=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(i>0?i:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function H(e,t){const 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 G(e,t,n){return Number.isFinite(n)&&n>0?H((t.x-e.x)/n,(t.y-e.y)/n):H(0,0)}function _(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}import*as V from"react";function q(e){const t=c(e=>e.pushObservation),n=V.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return V.useMemo(()=>({...e,onObservation:n}),[n,e])}function Y(e,t={}){const n=_(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(i){const o=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(i);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:o}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:o,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function U(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}import{jsx as X,jsxs as K}from"react/jsx-runtime";var Z="var(--semiotic-bg, #ffffff)";function Q(e,t){return(e+"").length*t*.6}function J(e){const{x:t,y:n,text:i,fill:o,fontSize:r=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{type:e.type??"halo",...e}}(u),f=e=>X("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:o,fontSize:r,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:i});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??Z,strokeWidth:h.haloWidth??3});const m=h.padding??{x:6,y:3},y="number"==typeof m?m:m.x,p="number"==typeof m?m:m.y,g=Q(i,r),b=r+2*p;let x,v;return x="middle"===l?t-g/2-y:"end"===l?t-g-y:t-y,v="middle"===c||"central"===c?n-b/2:"hanging"===c||"text-before-edge"===c?n-p:n-.8*r-p,K("g",{className:d,children:[X("rect",{x:x,y:v,width:g+2*y,height:b,rx:h.radius??3,ry:h.radius??3,fill:h.fill??Z,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}import*as ee from"react";import{jsx as te}from"react/jsx-runtime";var ne={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"};function ie({chrome:e="default",className:t="",style:n,children:i,...o}){const r="default"===e?{...ne,...n}:n;return te("div",{...o,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:r,children:i})}function oe(e){return e.ownsChrome=!0,e}function re(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function ae(e){if(!ee.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,i=n["data-semiotic-tooltip-chrome"];if(null!=i&&!1!==i&&"false"!==i)return!0;const o=n.style;if(o&&"object"==typeof o){if(re(o.background))return!0;if(re(o.backgroundColor))return!0}return!1}oe(ie);var se=["name","label","title"],le=["type","kind","category","group","class","status","role","shape"],ce=["value","amount","total","count","weight","score"],ue=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"]);function de(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function he(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,i=!1!==t.skipPositional,o=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(i&&ue.has(t.toLowerCase()))continue;if(null==n)continue;const e=typeof n;("string"===e||"number"===e||"boolean"===e||n instanceof Date)&&o.push({key:t,lower:t.toLowerCase(),value:n})}if(0===o.length)return{entries:[]};let r=o.findIndex(e=>se.includes(e.lower));const a=r>=0;0>r&&(r=o.findIndex(e=>"id"===e.lower)),0>r&&(r=o.findIndex(e=>"string"==typeof e.value));const s=0>r?void 0:o[r];let l=o.filter((e,t)=>t!==r);a&&(l=l.filter(e=>"id"!==e.lower));const c=de(l,le),u=de(l,ce),d=new Set(le),h=new Set(ce),f=[];c&&f.push({key:c.key,value:c.value}),u&&f.push({key:u.key,value:u.value});for(const e of l){if(f.length>=n)break;e!==c&&e!==u&&(d.has(e.lower)||h.has(e.lower)||f.push({key:e.key,value:e.value}))}return{titleKey:s?.key,title:s?.value,entries:f}}function fe(e,t){return"touch"===t?Math.max(e,24):e}function me(e){return Array.isArray(e)?e[0]:e}function ye(e,t,n,i){return{data:me(e),x:t,y:n,__semioticHoverData:!0,...i}}import{jsx as pe,jsxs as ge}from"react/jsx-runtime";function be(e,t){return"function"==typeof t?t(e):e[t]}function xe(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function ve(e={}){const{fields:t,title:n,format:i,style:o={},className:r=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=be(e,n);a=xe(t,i)}if(t&&t.length>0)t.forEach(t=>{let n,o,r;"string"==typeof t?(n=t,o=t,r=i):(n=t.label,o=t.accessor||t.key||"",r=t.format||i);const a=be(e,o);s.push({label:n,value:xe(a,r)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=xe(e[n],i);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=xe(e[t[0]],i))}}return ge(ie,{className:r,style:o,children:[a&&pe("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>ge("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&ge("span",{children:[e.label,": "]}),e.value]},t))]})}}function we(e={}){const{fields:t=[],title:n,format:i,style:o={},className:r="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=be(e,n);l.push({value:xe(t,i)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,o,r;"string"==typeof t?(n=t,o=t,r=i):(n=t.label,o=t.accessor||t.key||"",r=t.format||i);const s=xe(be(e,o),r);l.push({label:a?n:void 0,value:s})});else{const t=he(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:xe(t.title,i),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:xe(e.value,i)})})}return Array.isArray(l)&&0!==l.length?pe(ie,{className:("semiotic-tooltip-multiline "+r).trim(),style:o,children:l.map((e,t)=>ge("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&ge("strong",{children:[e.label,s]}),e.value]},t))}):null}}function ke(e){return"multi"===e||$e(e)}function $e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Me(e){const{tooltip:t,defaultTooltipContent:n,multiDefaultContent:i=Se(),customFunctionContext:o="datum"}=e,r=t;return!1===t?{tooltipContent:()=>null}:ke(r)?{tooltipContent:($e(r)&&"function"==typeof r.content?Ce(r.content):void 0)||i,tooltipMode:"multi"}:"hover"===o&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Ce(r)||n}}function Ae(e){const{tooltip:t,defaultTooltipContent:n,customFunctionContext:i="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Ce(t)||n}}function Se(){return e=>{const t=e.allSeries;if(!t||0===t.length)return pe(ie,{children:pe("div",{children:xe(e.data?.value??e.data?.y)})});const n=e.xValue??e.data?.time??e.data?.x;return ge(ie,{children:[null!=n&&pe("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:xe(n)}),t.map((e,t)=>ge("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[pe("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),pe("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),pe("span",{style:{fontWeight:500,fontSize:"0.85em"},children:xe(e.value)})]},t))]})}}function Ce(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let i=me(n?e.data??{}:e);if(!i)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i)return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...i};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}const o=t(i);return null==o?null:ae(o)?o:pe(ie,{children:o})}}if(!1===e||void 0===e)return!1;if($e(e)){if("function"==typeof e.content)return Ce(e.content);"undefined"!=typeof process&&"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.');const t=we();return Ce(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=ve(e);return Ce(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"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.');const e=we();return Ce(t=>e(t))}return ve()}}import*as Le from"react";import{jsx as je,jsxs as Ne}from"react/jsx-runtime";function Ie({componentName:e,message:t,diagnosticHint:n,width:i,height:o}){return je("div",{role:"alert",style:{width:i,height:Math.max(o,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:Ne("div",{style:{textAlign:"center",maxWidth:400},children:[je("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),je("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&je("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})]})})}import{jsx as We}from"react/jsx-runtime";var Re=class extends Le.Component{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){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:We(Ie,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{createContext as ze,useContext as Fe,useMemo as Te}from"react";import{jsx as Oe}from"react/jsx-runtime";var Pe=ze(null);function De({colors:e,categories:t,colorScheme:n="category10",children:i}){const o=Te(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;let i=0;return Object.fromEntries(t.map(t=>[t,k(e,t)??g[i++%g.length]]))}const e=Array.isArray(n)?n:w(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);return Oe(Pe.Provider,{value:o,children:i})}function Ee(){return Fe(Pe)}De.displayName="CategoryColorProvider";import{useId as Be,useMemo as He,useCallback as Ge}from"react";import{useSyncExternalStore as _e}from"react";var Ve={positions:new Map},qe=new Set;function Ye(){for(const e of qe)e()}function Ue(e,t){const n=Ve.positions.get(e);if(n?.locked)return;if(!n||n.sourceId!==t)return;const i=new Map(Ve.positions);i.delete(e),Ve={positions:i},Ye()}function Xe(e,t){const n=Ve.positions.get(e);if(!n?.locked)return;if(t&&n.sourceId!==t)return;const i=new Map(Ve.positions);i.delete(e),Ve={positions:i},Ye()}function Ke(){return Ve}function Ze(e){return qe.add(e),()=>qe.delete(e)}var Qe={positions:new Map};function Je(){return()=>{}}function et(){return Qe}function tt(e){const t=_e(e?Ze:Je,e?Ke:et,e?Ke:et);return e?t.positions.get(e)??null:null}function nt(e){const t=Be(),n=e.clientId||t,{name:i}=e,o=d(e=>e.selections.get(i)),r=d(e=>e.setClause),a=d(e=>e.clearClause),l=He(()=>!!o&&o.clauses.size>0,[o]);return{predicate:He(()=>o&&0!==o.clauses.size?s(o,n):()=>!0,[o,n]),isActive:l,selectPoints:Ge(e=>{const t={};let o=!1;for(const[n,i]of Object.entries(e))t[n]={type:"point",values:new Set(i)},o=!0;o&&r(i,{clientId:n,type:"point",fields:t})},[n,i,r]),selectInterval:Ge(e=>{const t={};let o=!1;for(const[n,i]of Object.entries(e))t[n]={type:"interval",range:i},o=!0;o&&r(i,{clientId:n,type:"interval",fields:t})},[n,i,r]),clear:Ge(()=>{a(i,n)},[a,i,n]),clientId:n}}function it(e,t){const n=Be(),i=t||n,o=d(e=>e.setClause),r=d(e=>e.clearClause);return{selectPoints:Ge(t=>{const n={};let r=!1;for(const[e,i]of Object.entries(t))n[e]={type:"point",values:new Set(i)},r=!0;r&&o(e,{clientId:i,type:"point",fields:n})},[e,i,o]),clear:Ge(()=>r(e,i),[e,i,r]),clientId:i}}function ot(e){const t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:o,selectPoints:r,clear:a}=nt({name:t,fields:n});return{onHover:Ge(e=>{if(!e)return void a();const t={};for(const i of n){const n=e[i];void 0!==n&&(t[i]=[n])}l(t)&&r(t)},[n,r,a]),predicate:i,isActive:o}}function rt(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function at(e){const{name:t,xField:n,yField:i}=e,{predicate:o,isActive:r,selectInterval:a,clear:s}=nt({name:t,fields:[n,i].filter(Boolean)}),c=n&&i?"xyBrush":n?"xBrush":"yBrush",u=Ge(e=>{if(!e)return void s();const t={};"xyBrush"===c&&function(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}(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"===c&&rt(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===c&&rt(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),l(t)&&a(t)},[c,n,i,a,s]);return{brushInteraction:He(()=>({brush:c,during:u,end:u}),[c,u]),predicate:o,isActive:r,clear:s}}function st(e,t,n){const i=d(e=>e.selections.get(t));return He(()=>{if(!i||0===i.clauses.size)return e;const t=s(i,n);return e.filter(t)},[e,i,n])}function lt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ct(e,t){const{when:n}=e,i=t.width,o=t.height,r=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>i||"number"==typeof n.maxWidth&&i>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof o||n.minHeight>o)||"number"==typeof n.maxHeight&&("number"!=typeof o||o>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof r||n.minAspectRatio>r)||"number"==typeof n.maxAspectRatio&&("number"!=typeof r||r>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function ut(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const i=n.map((e,t)=>({rule:e,index:t})).filter(e=>ct(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)=>function(e,t){const n={...e,...t};for(const i of["margin","frameProps","mobileSemantics","style"])lt(e[i])&&lt(t[i])&&(n[i]={...e[i],...t[i]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:i}}import{useMemo as dt}from"react";function ht(e={}){const{limit:t=50,types:n,chartId:i}=e,o=c(e=>e.version),r=c(e=>e.observations),a=c(e=>e.clearObservations),s=dt(()=>{let e=r;if(n&&n.length>0){const 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},[r,n,i,t,o]);return{observations:s,latest:s.length>0?s[s.length-1]:null,clear:a}}import{createContext as ft,useContext as mt,useEffect as yt,useId as pt,useLayoutEffect as gt,useMemo as bt,useRef as xt,useState as vt,useCallback as wt}from"react";function kt(e,t){const n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return function(e){let t=2166136261;for(let n=0;e.length>n;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}(t);const i=e.size;return e.set(t,i),i}import*as $t from"react";function Mt(...e){let t;for(const n of e)n&&(t=At(t)&&At(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function At(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function St(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Ct(e,t,n,i,o=8){const r=i,a="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",s=Math.max(t[r],Math.max(0,("left"===i||"right"===i?n[0]:n[1])-o)-e[a]);e[r]>s&&(e[r]=s)}function Lt(e){return Math.ceil(7*e.length)}function jt(e,t){if(At(e)){const n=Ht(t),i=e.legendGroups.flatMap(e=>[e.label?Lt(e.label):0,...e.items.map(e=>n.swatchSize+n.labelGap+Lt(e.label))]);return Math.max(100,...i)}if(St(e)){const{gradient:t}=e,n=t.format||(e=>Math.round(100*e)/100+""),i=Math.max(Lt(n(t.domain[0])),Lt(n(t.domain[1]))),o=t.label?Lt(t.label):0;return Math.max(100,19+i,o)}return 100}function Nt(e){return(At(e)||St(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function It(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?zt:Rt:0}function Wt(e){return Math.max(0,e?.edgeGutter??3)}var Rt=34,zt=70;function Ft(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function Tt(e){const t=e.axes?.find(e=>"bottom"===e.orient),n=e.axes?.find(e=>"top"===e.orient),i=e.axes?.find(e=>"left"===e.orient),o=e.axes?.find(e=>"right"===e.orient),r=!n||!!t,a=!!n&&!t,s=!o||!!i,l=!!o,c=!1!==e.showAxes;return{hasAxis:c&&r,hasAxisLabel:c&&r&&!!(t?.label??e.xLabel),rotatedTicks:c&&r&&(e.rotatedTicks??!!t?.autoRotate),topAxis:a?{hasAxis:c,hasAxisLabel:c&&!!(n?.label??e.xLabel),rotatedTicks:c&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:s?{hasAxis:c,hasAxisLabel:c&&!!(i?.label??e.yLabel)}:void 0,rightAxis:l?{hasAxis:c,hasAxisLabel:c&&!!(o?.label??e.yLabelRight??e.yLabel)}:void 0}}function Ot(e,t){return Tt({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 Pt(e){const 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 Dt(e,t,n){if(St(e))return e.gradient.label?46:26;if(!At(e))return 20;const i=Ht(n),o=Math.max(1,n?.maxWidth??t);let r=i.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const r of t.items){const t=i.swatchSize+i.labelGap+Lt(r.label),a=0===n?t:n+i.itemGap+t;n>0&&a>o?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),r=Math.max(r,e*i.rowHeight,t.label?Lt(t.label):0)}return r+(e.legendGroups.length>1?16:0)}function Et(e,t,n){return jt(e,t)+Nt(e)+It(t,n)+Wt(t)}function Bt(e,t){const{legend:n}=t;if(!n)return;const i=t.position??"right",o=Dt(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+Nt(n)+Ft("bottom"===i?t.axisChrome:"top"===i?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===i&&t.hasTitle?24:0),r=Math.max(t.minimumMargin??0,"top"===i?t.hasTitle?58:34:0);"right"===i?e.right=Math.max(e.right,r,Et(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===i?e.left=Math.max(e.left,r,Et(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===i?e.top=Math.max(e.top,r,o):e.bottom=Math.max(e.bottom,r,o)}function Ht(e){const 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}}import*as Gt from"react";import{jsx as _t,jsxs as Vt}from"react/jsx-runtime";function qt({config:e,orientation:t="vertical",width:n=100,customClickBehavior:i,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h=d||(e=>Math.round(100*e)/100+""),f="grad-legend-"+Gt.useId(),m=!(!i&&!o),y="isolate"===s||void 0===s&&null!=a,[p,g]=Gt.useState(0),[b,x]=Gt.useState(null),v=Gt.useRef([]),w=(e,t=!1)=>{const n=t?5-e-1:e,i=c[0]+n/5*(c[1]-c[0]),o=c[0]+(n+1)/5*(c[1]-c[0]);return{label:`${h(i)} – ${h(o)}`,valueRange:[i,o],interactionKey:`${i}:${o}`}},k=(e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=r===l,d=b===s,h=e=>{const t=(e+5)%5;g(t),v.current[t]?.focus()};return _t("rect",{ref:e=>{v.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:a?.size&&!c||null!=r&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===p?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:o?()=>o(e):void 0,onMouseLeave:o?()=>o(null):void 0,onFocus:()=>{g(s),x(s),o?.(e)},onBlur:()=>{x(null),o?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&i)return n.preventDefault(),void i(e);const o="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===o?(n.preventDefault(),h(s+(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-"+s)},$="horizontal"===t,M=[];for(let e=0;64>=e;e++){const t=e/64;M.push(_t("stop",{offset:100*t+"%",stopColor:l($?c[0]+t*(c[1]-c[0]):c[1]-t*(c[1]-c[0]))},e))}if($){const e=12,t=Math.min(n,200),i=Math.max(0,(n-t)/2),o=u?18:0;return Vt("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?"horizontal":void 0,"aria-multiselectable":!(!m||!y)||void 0,style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[_t("defs",{children:_t("linearGradient",{id:f,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:M})}),u&&_t("text",{x:i+t/2,y:12,textAnchor:"middle",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),_t("rect",{x:i,y:o,width:t,height:e,fill:`url(#${f})`,rx:2}),m&&Array.from({length:5},(n,r)=>k(w(r),{x:i+r*t/5,y:o,width:t/5,height:e},r)),_t("text",{x:i,y:o+e+12,textAnchor:"start",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[0])}),_t("text",{x:i+t,y:o+e+12,textAnchor:"end",fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[1])})]})}const A=u?18:0;return Vt("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?"vertical":void 0,"aria-multiselectable":!(!m||!y)||void 0,style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[u&&_t("text",{x:0,y:12,textAnchor:"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),_t("defs",{children:_t("linearGradient",{id:f,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:M})}),_t("rect",{x:0,y:A,width:14,height:100,fill:`url(#${f})`,rx:2}),m&&Array.from({length:5},(e,t)=>k(w(t,!0),{x:0,y:A+100*t/5,width:14,height:20},t)),_t("text",{x:19,y:A+10,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[1])}),_t("text",{x:19,y:A+100,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:h(c[0])})]})}import{jsx as Yt,jsxs as Ut}from"react/jsx-runtime";var Xt={fill:(e,t)=>Yt("rect",{style:e,width:t,height:t}),line:(e,t)=>Yt("line",{style:e,x1:0,y1:0,x2:t,y2:t})};function Kt(e,t,n,i,o){let r;return r="function"==typeof n?n(e):(0,Xt[n])(i(e,t),o),r}function Zt({swatchSize:e}){return Yt("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 Qt(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function Jt(e,t,n,i,o,r){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:m,groupIndex:y,onFocusedIndexChange:p,interactive:g,useIsolateAria:b,metrics:{swatchSize:x,labelGap:v}}=e,w=!!h?.size&&h.has(t.label);return Ut("g",{transform:i,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:g?y===f&&n===m?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&b?w:void 0,"aria-current":!(!g||b||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:g?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===o||e.key===r){e.preventDefault();const t=(n+(e.key===r?1:-1)+l.length)%l.length;p(y,t);const i=e.currentTarget.parentElement?.children[t];i instanceof SVGElement&&i.focus()}}:void 0,onFocus:g?e=>{p(y,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:Qt(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&Yt("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:x+v+2+7*t.label.length,height:x+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Kt(t,n,a,s,x),w&&Yt(Zt,{swatchSize:x}),Yt("text",{y:x/2,x:x+v,dominantBaseline:"central",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}var en=(e,t,n,i,o,r,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const m={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:r,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=o,metrics:u};return d.forEach((e,t)=>{h.push(Jt(m,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h};function tn(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:r,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=Ht(d),[f,m]=$t.useState(0),[y,p]=$t.useState(0),g=$t.useCallback((e,t)=>{m(e),p(t)},[]),b="vertical"===u?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:r,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=function(e,t){let n=24;return e.map(({hasLabel:e,itemCount:i})=>{n+=5;const o=n;let r;n+=8,e&&(n+=16,r=n,n+=8);const a=n;return n+=i*t+8,{lineY:o,labelY:r,itemsY:a,endY:n}})}(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const m=h[f];d.push(Yt("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(Yt("text",{y:m.labelY,className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(Yt("g",{className:"legend-item",transform:`translate(0,${m.itemsY})`,children:en(e,n,i,o,r,a,s,f,l,c,u)},"legend-group-"+f))}),d})({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:r,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:a,metrics:h}):(({legendGroups:e,height:t,width:n,customClickBehavior:i,customHoverBehavior:o,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:s,focusedItemIndex:l,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0;const f=[];e.forEach((e,t)=>{let m=0;e.label&&(m+=16);const y=((e,t,n,i,o,r,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:m,labelGap:y,itemGap:p,rowHeight:g,align:b}=u,x={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:r,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=o,metrics:u},v=h.map(e=>m+y+7*e.label.length),w=[];let k=0,$=0;v.forEach((e,t)=>{const n=0===$?e:$+p+e;d&&d>0&&$>0&&n>d?(w.push({start:k,end:t,width:$}),k=t,$=e):$=n}),h.length>0&&w.push({start:k,end:h.length,width:$}),w.forEach((e,t)=>{let n="center"===b?Math.max(0,((d??e.width)-e.width)/2):"end"===b?Math.max(0,(d??e.width)-e.width):0;for(let i=e.start;e.end>i;i++)f.push(Jt(x,h[i],i,`translate(${n},${t*g})`,"ArrowLeft","ArrowRight")),n+=v[i]+p});const M=Math.max(0,...w.map(e=>e.width)),A=w.length;return{items:f,offset:M,totalRows:A,totalHeight:A*g}})(e,i,o,r,a,s,l,t,c,u,d,d.maxWidth??n);m+=y.offset+5,f.push({label:e.label,...y,offset:m,totalRows:y.totalRows,totalHeight:y.totalHeight}),h+=m+12});const m=d.maxWidth??n;let y=h>m?0:"center"===d.align?Math.max(0,(m-h)/2):"end"===d.align?Math.max(0,m-h):0;const p=[];return f.forEach((n,i)=>{const o=e[i];o.label&&(p.push(Yt("text",{transform:`translate(${y},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:o.label},"legend-text-"+i)),y+=16),p.push(Yt("g",{className:"legend-item",transform:`translate(${y},0)`,children:n.items},"legend-group-"+i)),y+=n.offset+5,e[i+1]&&p.push(Yt("line",{stroke:"gray",x1:y,y1:-8,x2:y,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+i)),y+=12}),Yt("g",{children:p})})({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:r,focusedGroupIndex:f,focusedItemIndex:y,onFocusedIndexChange:g,legendInteraction:a,metrics:h}),x=!(!n&&!i);return Ut("g",{role:x?"listbox":void 0,"aria-multiselectable":!(!x||"isolate"!==a&&(void 0!==a||null==r))||void 0,"aria-label":"Chart legend",style:{fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},children:[void 0!==s&&""!==s&&"vertical"===u&&Yt("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:{fontSize:"var(--semiotic-legend-font-size, 12px)"},fill:"var(--semiotic-text, #333)",children:s}),b]})}import{useRef as nn,useState as on,useEffect as rn}from"react";function an(e,t=0,n=1/0,i=0){const o=Number.isFinite(t)?t:0,r=Number.isFinite(n)?Math.max(o,n):1/0,a=Number.isFinite(e)?Math.floor(e):o,s=Math.max(o,Math.min(r,a));return i>0&&Number.isFinite(i)?Math.max(o,Math.min(r,Math.round(s/i)*i)):s}function sn(e,t,n,i={}){const o=nn(null),[r,a]=on(null);return rn(()=>{if(!t&&!n)return;const e=o.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=(e,t)=>({w:an(e,i.minWidth,i.maxWidth,i.widthStep),h:an(t,i.minHeight,i.maxHeight,i.heightStep)}),s=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,i=r(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]),[o,[t&&r?r.w:e[0],n&&r?r.h:e[1]]]}import{jsx as ln,jsxs as cn}from"react/jsx-runtime";var un=ft(!1),dn=ft(!1);function hn(){return mt(dn)}var fn=ft(null),mn="undefined"==typeof window?yt:gt;function yn(e){const t=new Set,n=[];for(const i of e)t.has(i)||(t.add(i),n.push(i));return n}function pn(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function gn(e){const t=mt(fn),n=pt(),i=yn(e),o=xt([]);pn(o.current,i)||(o.current=i);const r=o.current;mn(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),mn(()=>{t&&t.registerCategories(n,r)},[t,n,r])}function bn(){return null!==mt(fn)}var xn="__linked-legend-isolate__",vn="__linked-legend-highlight__";function wn({categoryColors:e,interaction:t,selectionName:n,field:i}){const o=Object.entries(e),r=o.map(([e])=>e),a=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:o.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:s,clear:l}=nt({name:n,fields:[i],clientId:xn}),{selectPoints:c,clear:u}=nt({name:n,fields:[i],clientId:vn}),h=d(e=>e.selections.get(n)),{isolatedCategories:f,highlightedCategory:m}=bt(()=>{const e=new Set;let t=null;const n=h?.clauses.get(xn)?.fields[i];if("point"===n?.type)for(const t of n.values)e.add(t+"");const o=h?.clauses.get(vn)?.fields[i];if("point"===o?.type){const e=o.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[h,i]),y=wt(e=>{"highlight"===t&&(e?c({[i]:[e.label]}):u())},[t,i,c,u]),p=wt(e=>{if("isolate"!==t)return;const n=new Set(f);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===r.length?l():s({[i]:Array.from(n)})},[t,i,f,r.length,s,l]),[g,[b]]=sn([0,0],!0,!1),x=bt(()=>function(e,t){if(!t||0===e.length)return 1;let n=0,i=1;for(const o of e){const e=26+7*o.length;n>0&&n+e>t&&(i++,n=0),n+=e}return i}(o.map(([e])=>e),b),[o,b]);return 0===o.length?null:ln("div",{ref:g,style:{width:"100%",display:"block"},children:ln("svg",{width:"100%",height:Math.max(30,22*x+8),style:{display:"block",overflow:"visible"},children:ln(tn,{legendGroups:a,title:!1,orientation:"horizontal",width:b,height:20,customHoverBehavior:"highlight"===t?y:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:m,isolatedCategories:f})})})}function kn({children:e,selections:t,showLegend:n,legendPosition:i="top",legendInteraction:o="none",legendSelectionName:s="legend",legendField:l="category"}){const c=bt(()=>{if(!t)return;const e=new Map;for(const[n,i]of Object.entries(t))i.resolution&&e.set(n,{name:n,resolution:i.resolution,clauses:new Map});return e.size>0?{selections:e}:void 0},[t]),u=Ee(),d=f(e=>e.theme.colors.categorical),h=d.length>0?d:g,[m,y]=vt({}),p=xt(new Map),b=bt(()=>({registerCategories:(e,t)=>{const n=yn(t);y(t=>pn(t[e]??[],n)?t:{...t,[e]:n})},unregisterCategories:e=>{y(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;const n={...t};return delete n[e],n})}}),[]),x=bt(()=>{const e=[];for(const t of Object.values(m))for(const n of t)e.push(n);return yn(e)},[m]),v=bt(()=>{const e=u??{},t=new Map(p.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),i=x.map(n=>{const i=kt(t,n);return[n,k(e,n)??h[i%h.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...i])}},[u,x,h]);mn(()=>{p.current=v.categoryIndexes},[v]);const w=v.colors,$=void 0===n||n,M=Object.keys(w).length>0;return ln(a,{initialState:c,children:ln(r,{children:ln(dn.Provider,{value:!0,children:ln(fn.Provider,{value:b,children:ln(De,{colors:w,children:cn(un.Provider,{value:$&&M,children:[$&&"top"===i&&ln(wn,{categoryColors:w,interaction:o,selectionName:s,field:l}),e,$&&"bottom"===i&&ln(wn,{categoryColors:w,interaction:o,selectionName:s,field:l})]})})})})})})}function $n(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Sn(t(e))}function Mn(e,t){const n=$n(e),i=$n(t);return(e,t)=>{const o=i(e);return{value:o,x:n(e),y:o,category:t}}}function An(e,t){const n=$n(t??"value"),i=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=i?i(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Sn(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function Cn(e,t,n){const i=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&i!==e.eq)return!1;if(void 0!==e.ne&&i===e.ne)return!1;if(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;const o=Sn(i);if(void 0===o)return!1;if(void 0!==e.gt&&e.gt>=o)return!1;if(void 0!==e.gte&&e.gte>o)return!1;if(void 0!==e.lt&&o>=e.lt)return!1;if(void 0!==e.lte&&o>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>o||o>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(o>=t&&n>=o)return!1}return!0}function Ln(e,t,n){const i=e.when;return void 0===i||!0===i||!1!==i&&("function"==typeof i?i(t,n):Cn(i,t,n))}function jn(e,t,n){if(!t||0===t.length)return{};let i={};for(const o of t){if(!Ln(o,e,n))continue;const t="function"==typeof o.style?o.style(e,n):o.style;t&&(i={...i,...t})}return i}function Nn(e,t,n,i=e=>e){const o=e??(()=>({}));return t&&0!==t.length?(e,r)=>{const a=i(e),s={...o(e,r)};return Object.assign(s,jn(a,t,n(a,r))),s}:o}function In(e,t,n){return e&&0!==e.length?(i,o)=>{const r=jn(i,e,t(i,o)),a=n?n(i,o):void 0;return a?{...r,...a}:r}:n}function Wn(e,t,n,i){if(!e||0===e.length)return i;const o=An(t,n);return(t,n)=>{const r=t&&t.data||t,a=jn(r,e,o(r)),s=i?i(t,n):void 0;return s?{...a,...s}:a}}function Rn(e,t,n,i){return In(e,Mn(t,n),i)}function zn(e,t,n){const i=$n(t);return In(e,(e,t)=>({value:i(e),category:t}),n)}var Fn=Object.freeze([]);function Tn(e){if(!e)return Fn;let t=!1;for(let n=0;e.length>n;n++){const i=e[n];if(null==i||"object"!=typeof i){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}var On="undefined"==typeof window||"undefined"==typeof document,Pn={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function Dn(e,t){const n={...e};for(const e of t)n[Pn[e]]++;return n}function En(e,t,n){const i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:Dn(n,i)}}var Bn=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=En({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=En(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};import{memo as Hn,useEffect as Gn,useRef as _n}from"react";var Vn={sceneGeometry:0,layout:0,domain:0};function qn(e){const{domain:t,layout:n,sceneGeometry:i}=e.revisions;return{domain:t,layout:n,sceneGeometry:i}}function Yn(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}var Un="production"!==process.env.NODE_ENV,Xn={revisions:Vn,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Kn=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Vn,this.lastObserved=Vn,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){Un&&(this.lastObserved=Yn(this.lastObserved,qn(e)))}beforeCompute(e,t){if(!Un)return Xn;const n=Yn(qn(e),this.lastObserved),i=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),o=!((r=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&r.layout===a.layout&&r.domain===a.domain);var r,a;return{revisions:n,signature:i,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:o,warnUnconsumed:!t&&o&&this.lastUnconsumedWarning!==i}}afterCompute(e,t,n){if(Un){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="")}}};function Zn(e){return _n(new Kn(e))}function Qn(e,t,n,i=!1,o=!1){const r=e.beforeCompute(t.getLastUpdateResult(),i);n(),e.afterCompute(r,!0,o)}var Jn=Hn(function({store:e,diagnostics:t}){return Gn(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{jsx as ei}from"react/jsx-runtime";function ti(e){const{legend:t,totalWidth:n,totalHeight:i,margin:o,legendPosition:r="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:m}=function(e,t){const n=t.position??"right",i="top"===n||"bottom"===n,o=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),r=Math.max(1,i?t.legendLayout?.maxWidth??o:t.reservedWidth??jt(e,t.legendLayout)),a=Nt(e),s=It(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=Wt(t.legendLayout),c=Dt(e,o,t.legendLayout),u=Ft(t.axisChrome,t.legendLayout),d=Ft(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-r-a),y:t.margin.top,width:r,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:r,height:c};if("bottom"===n){const 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:r,height:c}}return{x:Math.min(t.totalWidth-r-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:r,height:c}}(t,{totalWidth:n,totalHeight:i,margin:o,position:r,legendLayout:a,axisChrome:e.axisChrome}),y="top"===r||"bottom"===r;return ei("g",{transform:`translate(${h}, ${f})`,children:St(t)?ei(qt,{config:t.gradient,orientation:y?"horizontal":"vertical",width:m,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):At(t)?ei(tn,{legendGroups:t.legendGroups,title:"",width:m,orientation:y?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}import{jsx as ni}from"react/jsx-runtime";var ii={secondary:0,primary:3},oi=".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}}";function ri(e){return!0===e?._annotationDeferred}function ai(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function si(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function li(e){return Math.max(.72,.95-.06*e)}function ci(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:si(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),i=e.some(e=>ri(e.annotation)),o=e.some(e=>null!=ai(e.annotation)),r=e.some(e=>"layer"===ai(e.annotation));if(!n&&!i&&!o)return e.map(e=>e.node);const 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(const e of t)e.emphasis&&(e.rank=ii[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:i,readingOrder:o}=e,r=ri(t.annotation);let a=t.node;if("primary"===i||"secondary"===i||null!=o){const e=null==i&&null!=o;a=ni("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+i,..."secondary"===i?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:li(o),"data-annotation-reading-order":o}:{},children:t.node},"annotation-emphasis-"+n)}const s=ai(t.annotation);return s&&(a=ni("g",{className:"annotation-cohesion--"+s,children:a},"annotation-cohesion-"+n)),r&&(a=ni("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},"annotation-deferred-"+n)),a});return i&&s.unshift(ni("style",{children:oi},"annotation-disclosure-style")),r&&s.unshift(ni("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")),s}function ui(e,t,n,i){return function(e,t,n,i){const o=[];return e.forEach((e,r)=>{let a;if(n){const o=n(e,r,i);a=null!=o?o:t(e,r,i)}else a=t(e,r,i);a&&o.push({node:a,annotation:e})}),{nodes:ci(o),renderedAnnotations:o.map(e=>e.annotation)}}(e,t,n,i).nodes}import*as di from"react";import{jsx as hi,jsxs as fi}from"react/jsx-runtime";function mi(e,t=120,n=8){if(!e)return[];const i=Math.max(1,Math.floor(t/n)),o=e.split(/\s+/),r=[];let a="";for(const e of o)a&&a.length+1+e.length>i?(r.push(a),a=e):a=a?`${a} ${e}`:e;return a&&r.push(a),r}function yi(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 pi(e,t,n,i){if(!e)return hi("g",{className:"annotation-note"});const{label:o,title:r,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!o&&!r)return hi("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d=s;d&&"dynamic"!==d||(d="topBottom"===u?0>t?"right":"left":0>n?"bottom":"top");let h="start";"topBottom"===u?"right"===d?h="end":"middle"===d&&(h="middle"):h=0>t?"end":"start";const f=16,m=r?c?[r]:mi(r,l):[],y=o?c?[o]:mi(o,l):[],p="leftRight"===u?"end"===h?-4:4:0;let g=0;const b=[],x=i||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";e.useHTML||e.html?b.push(hi("foreignObject",{className:"annotation-note-html",x:"end"===h?p-l:"middle"===h?p-l/2:p,y:-16,width:l,height:Math.max(f,(m.length+y.length)*f+(r&&o?2:0))+f,style:{overflow:"visible"},children:fi("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:x,fontSize:"12px",lineHeight:"16px",overflow:"visible",textAlign:"end"===h?"right":"middle"===h?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[r&&hi("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:r}),o&&hi("div",{className:"annotation-note-label",children:o})]})},"annotation-note-html")):(m.length>0&&(b.push(hi("text",{className:"annotation-note-title",fill:x,textAnchor:h,fontWeight:"bold",children:m.map((e,t)=>hi("tspan",{x:p,dy:0===t?0:f,children:e},t))},"annotation-note-title")),g=m.length*f),y.length>0&&b.push(hi("text",{className:"annotation-note-label",fill:x,textAnchor:h,y:g,children:y.map((e,t)=>hi("tspan",{x:p,dy:0===t?0:f,children:e},t))},"annotation-note-label")));let v=null;if((r||o)&&(0!==t||0!==n))if("topBottom"===u){const e=Math.min(l,120);let t=0,n=e;"end"===h?(t=-e,n=0):"middle"===h&&(t=-e/2,n=e/2),v=hi("line",{className:"note-line",x1:t,x2:n,y1:0,y2:0,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}else{const e=(m.length+y.length)*f+(y.length>0?f:0);let t=0,n=e;"bottom"===d?(t=-e,n=0):"middle"===d&&(t=-e/2,n=e/2),v=hi("line",{className:"note-line",x1:0,x2:0,y1:t,y2:n,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}const w=Math.max(0,m.length+y.length-1)*f;let k=0;return"topBottom"===u?k=0>n?-(w+2):18:"leftRight"===u&&(k="middle"===d?-(w+f+(y.length>0&&m.length>0?2:0))/2+8:"bottom"===d||0>n?-(w+2):18),fi("g",{className:"annotation-note",transform:`translate(${t},${n})`,children:[hi("g",{className:"annotation-note-content",transform:0!==k?`translate(0,${k})`:void 0,children:b}),v]})}function gi(e,t,n,i,o){const r=[];switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&r.push(hi("circle",{r:e,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,i=t?.height||0;(e>0||i>0)&&r.push(hi("rect",{width:e,height:i,fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"subject-rect"));break}case"callout-custom":t?.custom&&r.push(...Array.isArray(t.custom)?t.custom:[t.custom]);break;case"xy-threshold":{const e=i||0,a=o||0;if(void 0!==t?.x){const i=(t.x||0)-e;r.push(hi("line",{x1:i,y1:(t.y1||0)-a,x2:i,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else if(void 0!==t?.y){const i=(t.y||0)-a;r.push(hi("line",{x1:(t.x1||0)-e,y1:i,x2:(t.x2||0)-e,y2:i,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"))}else void 0!==t?.x1||void 0!==t?.x2?r.push(hi("line",{x1:(t.x1||0)-e,y1:0,x2:(t.x2||0)-e,y2:0,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line")):void 0===t?.y1&&void 0===t?.y2||r.push(hi("line",{x1:0,y1:(t.y1||0)-a,x2:0,y2:(t.y2||0)-a,stroke:n||"var(--semiotic-text-secondary, currentColor)",strokeDasharray:"5,5"},"threshold-line"));break}case"bracket":{const e=t?.type||"curly",i=t?.width??t?.height;void 0!==i&&r.push(hi("path",{d:yi(e,i,t?.depth||30,void 0===t?.width),fill:"none",stroke:n||"var(--semiotic-text-secondary, currentColor)"},"bracket-path"));break}}return hi("g",{className:"annotation-subject",children:r})}function bi(e,t,n,i,o,r){const a=[];let s=0,l=0;if("callout-circle"!==o&&"label"!==o||!r?.radius){if("callout-rect"===o&&r){const n=r.width||0,i=r.height||0;if(n>0||i>0){const o=n/2,r=i/2,a=e-o,c=t-r;if(0!==a||0!==c){const e=Math.abs(a),t=Math.abs(c),u=n/2,d=i/2,h=e*d>t*u?u/e:d/t;s=o+a*h,l=r+c*h}}}else if("bracket"===o&&r){const e=r.width,t=r.height,n=r.depth||30;void 0!==e?(s=e/2,l=n):void 0!==t&&(s=n,l=t/2)}}else{const n=(r.radius||0)+(r.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const i=Math.atan2(t,e);s=Math.cos(i)*n,l=Math.sin(i)*n}}const c=Math.sqrt((e-s)**2+(t-l)**2);if(c>.5){const o=i||"var(--semiotic-text-secondary, currentColor)",r="curve"===n?.type;let u=Math.atan2(t-l,e-s);if(r){const i=(s+e)/2,r=(l+t)/2,d=-(t-l)/c,h=(e-s)/c,f=(n?.curve??.25)*c,m=i+d*f,y=r+h*f;a.push(hi("path",{className:"connector-curve",d:`M${s},${l}Q${m},${y} ${e},${t}`,fill:"none",stroke:o},"connector-line")),u=Math.atan2(y-l,m-s)}else a.push(hi("line",{x1:s,y1:l,x2:e,y2:t,stroke:o},"connector-line"));if("arrow"===n?.end){const e=10,t=16/180*Math.PI;a.push(hi("path",{d:`M${s},${l}L${s+e*Math.cos(u+t)},${l+e*Math.sin(u+t)}L${s+e*Math.cos(u-t)},${l+e*Math.sin(u-t)}Z`,fill:o,stroke:"none"},"connector-arrow"))}}return hi("g",{className:"annotation-connector",children:a})}function xi(e){const{x:t=0,y:n=0,dx:i,dy:o,nx:r,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:m,strokeDasharray:y,events:p={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=new Set(Array.isArray(f)?f:[]);let w=i||0,k=o||0;null!=r&&(w=r-b),null!=a&&(k=a-x);const $="string"==typeof u?u:"label";if("bracket"===$&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;const e=c.depth||30;k=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;w=e+(0>e?-5:5),k=c.height/2}return fi("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=m&&{opacity:m},...y&&{strokeDasharray:y},...p,children:[!v.has("connector")&&bi(w,k,l,d,$,c),!v.has("subject")&&gi($,c,d,b,x),!v.has("note")&&pi(s,w,k,d)]})}function vi(e){const{noteData:t}=e,{screenCoordinates:n}=t,i="string"==typeof t.type?t.type:"label",o=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),o=t.ny||n[0][1]+(t.dy??0),r=n.map((n,r)=>{const a=Object.assign({},t,{note:0===r?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:o});return hi(xi,{"data-testid":"semiotic-annotation",...a,type:i},"multi-annotation-"+r)});return hi("g",{children:r})}const r=t.note||{title:"none",label:t.label},a=`${r.label}-${r.title}-${t.i}`;return hi(xi,{"data-testid":"semiotic-annotation",events:o,...t,type:i},a)}import{packEnclose as wi}from"d3-hierarchy";import{area as ki,curveLinear as $i,curveMonotoneX as Mi,curveMonotoneY as Ai,curveStep as Si,curveStepAfter as Ci,curveStepBefore as Li,curveBasis as ji,curveCardinal as Ni,curveCatmullRom as Ii}from"d3-shape";function Wi(e,t){const 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 Ri(e,t){const 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 zi(e){return null==e?null:e+""}function Fi(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Ti(e,t,n){const 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--){const o=n.pointNodes[i];if(o.pointId===e.pointId)return Fi(t,n,{x:o.x,y:o.y})}const i=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],i=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!i||!o)return null;const r=n[e.xAccessor||"x"],a=n[e.yAccessor||"y"];return null==r||null==a?null:{x:i(r),y:o(a)}}(n);return i?Fi(t,n,i):null}if("semantic"===i){const i=function(e,t,n){const i=function(e){return zi(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;const o=n.pointNodes?.find(e=>zi(e.pointId)===i);if(o)return Fi(t,n,{x:o.x,y:o.y});const r=n.data?.find(e=>function(e){return zi(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!r)return null;const a=Wi(r,n),s=Ri(r,n);return null==a||null==s?null:Fi(t,n,{x:a,y:s})}(e,t,n);if(i)return i}let o=null,r=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,r=t.y)}if(null!=o&&null!=r||(o=Wi(e,n),r=Ri(e,n)),null!=o&&null!=r)return Fi(t,n,{x:o,y:r});if("sticky"===i){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Oi(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}function Pi(e,t,n,i){const o=R(e.fill??e.color,t,i);return I(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:i)??o}var Di=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]);function Ei(e,t,n,i){const o=function(e,t,n){const i=e.position,o="string"==typeof i&&Di.has(i)?i:"bottom-left",r=o.endsWith("left")?"left":o.endsWith("right")?"right":"center",a=o.startsWith("top")?"top":o.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===r?0:"right"===r?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===r?"start":"right"===r?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}(e,t,n);return{...o,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"}}}import{jsx as Bi}from"react/jsx-runtime";var Hi={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"};function Gi({annotation:e,width:t,height:n,defaults:i=Hi}){const o=e.label??e.text;return null==o?null:Bi("text",{...Ei(e,t,n,i),children:o})}import{jsx as _i,jsxs as Vi}from"react/jsx-runtime";var qi={linear:$i,monotoneX:Mi,monotoneY:Ai,step:Si,stepAfter:Ci,stepBefore:Li,basis:ji,cardinal:Ni,catmullRom:Ii};function Yi(r,a={}){return function(r,s,l){switch(r.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const e=Ti(r,s,l);if(!e)return null;const{x:t,y:n}=e;if(!Oi(t,n,l))return null;const i="callout"===r.type?"callout-circle":r.type,o="callout-circle"===i?{radius:r.radius??12,radiusPadding:r.radiusPadding}:"callout-rect"===i?{width:r.width,height:r.height}:void 0;return _i(vi,{noteData:{x:t,y:n,dx:r.dx??30,dy:r.dy??-30,note:{label:r.label,title:r.title,wrap:r.wrap||120},type:i,...o?{subject:o}:{},connector:r.connector||{end:"arrow"},color:r.color,disable:r.disable,opacity:r.opacity,strokeDasharray:r.strokeDasharray,className:r.className}},"ann-"+s)}case"x-threshold":{const e=Wi(null!=r.value?{...r,x:r.value}:r,l);if(null==e)return null;const t=r.color||"#f97316",n=r.labelPosition||"top";let i;i="bottom"===n?(l.height||0)-4:"center"===n?(l.height||0)/2:16;const o=e>.6*(l.width||0),a=o?e-4:e+4,c=o?"end":"start";return Vi("g",{opacity:r.opacity,children:[_i("line",{x1:e,y1:0,x2:e,y2:l.height||0,stroke:t,strokeWidth:r.strokeWidth??1.5,strokeDasharray:r.strokeDasharray||"6,3"}),r.label&&_i(J,{x:a,y:i,text:r.label,textAnchor:c,fill:t,fontSize:12,fontWeight:"bold",background:r.labelBackground??"halo"})]},"ann-"+s)}case"y-threshold":{const e=Ri(null!=r.value?{...r,y:r.value}:r,l);if(null==e)return null;const t=r.color||"#f97316",n=r.labelPosition||"right";let i,o;"left"===n?(i=4,o="start"):"center"===n?(i=(l.width||0)/2,o="middle"):(i=(l.width||0)-4,o="end");const a=20>(d=e)?Math.min((l.height||0)-4,d+16):d-4;return Vi("g",{opacity:r.opacity,children:[_i("line",{x1:0,y1:e,x2:l.width||0,y2:e,stroke:t,strokeWidth:r.strokeWidth??1.5,strokeDasharray:r.strokeDasharray||"6,3"}),r.label&&_i(J,{x:i,y:a,text:r.label,textAnchor:o,fill:t,fontSize:12,fontWeight:"bold",background:r.labelBackground??"halo"})]},"ann-"+s)}case"enclose":{const e=(r.coordinates||[]).map(e=>({x:Wi({...e,type:"point"},l),y:Ri({...e,type:"point"},l),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const t=wi(e),n=r.padding||10;return Vi("g",{children:[_i("circle",{cx:t.x,cy:t.y,r:t.r+n,fill:r.fill||"none",fillOpacity:r.fillOpacity??.1,stroke:r.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),r.label&&_i(J,{x:t.x,y:t.y-t.r-n-4,textAnchor:"middle",fill:r.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:r.label,background:r.labelBackground??"none"})]},"ann-"+s)}case"rect-enclose":{const e=(r.coordinates||[]).map(e=>({x:Wi({...e,type:"point"},l),y:Ri({...e,type:"point"},l)})).filter(e=>null!=e.x&&null!=e.y);if(2>e.length)return null;const t=r.padding||10,n=e.map(e=>e.x),i=e.map(e=>e.y),[o,a]=m(n),[c,u]=m(i),d=o-t,h=a+t,f=c-t;return Vi("g",{children:[_i("rect",{x:d,y:f,width:h-d,height:u+t-f,fill:r.fill||"none",fillOpacity:r.fillOpacity??.1,stroke:r.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),r.label&&_i(J,{x:(d+h)/2,y:f-4,textAnchor:"middle",fill:r.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:r.label,background:r.labelBackground??"none"})]},"ann-"+s)}case"highlight":{const e=l.data||[],t="function"==typeof r.filter?e.filter(r.filter):r.field&&null!=r.value?e.filter(e=>e[r.field]===r.value):[],n={stroke:r.color||"#f97316",strokeWidth:2,fill:"none"};return _i("g",{children:t.map((e,t)=>{const i=Wi(e,l),o=Ri(e,l);if(null==i||null==o)return null;const a="function"==typeof r.r?r.r(e):r.r||6,s="function"==typeof r.style?r.style(e):r.style||n;return _i("circle",{cx:i,cy:o,r:a,...s},"hl-"+t)})},"ann-"+s)}case"bracket":{const e=Wi(r,l),t=Ri(r,l);return _i(vi,{noteData:{x:e??0,y:t??0,dx:r.dx||0,dy:r.dy||0,note:{label:r.label,title:r.title,wrap:r.wrap||120},type:"bracket",subject:{type:r.bracketType||"curly",width:r.width,height:r.height,depth:r.depth||30},color:r.color}},"ann-"+s)}case"trend":{const e=l.data||[];if(2>e.length)return null;const t=l.xAccessor||"x",n=l.yAccessor||"y",a="ordinal"===l.frameType,c="horizontal"===l.projection,u=a?t:null,d=a?n:null;let h;const f=[],m=new Map;if(a&&u&&d){for(const t of e){const e=t[u];if(null==e)continue;const n=e+"";m.has(n)||(m.set(n,f.length),f.push(n))}h=e.map(e=>{const t=e[u],n=e[d];if(null==t||null==n)return null;const i=m.get(t+"");return null!=i?[i,+n]:null}).filter(e=>null!==e)}else h=e.map(e=>[e[t],e[n]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>h.length)return null;const y=l.scales?.x??l.scales?.time,p=l.scales?.y??l.scales?.value;if(!y||!p)return null;const g=e=>t=>{const n=Math.max(0,Math.floor(t)),i=Math.min(f.length-1,n+1),o=t-n,r=e(f[n]);return r+(e(f[i])-r)*o},b=y,x=p;let v;if(a)if(c){const e=g(x);v=(t,n)=>[b(n),e(t)]}else{const e=g(b);v=(t,n)=>[e(t),x(n)]}else v=(e,t)=>[b(e),x(t)];const w=r.method||"linear";let k;k="loess"===w?function(e,t=.3){const n=e.length;if(2>n)return e.slice();const i=e.slice().sort((e,t)=>e[0]-t[0]),o=i.map(e=>e[0]),r=i.map(e=>e[1]),a=Math.max(2,Math.ceil(t*n)),s=[];for(let e=0;n>e;e++){const t=o[e],i=o.map(e=>Math.abs(e-t)),l=i.slice().sort((e,t)=>e-t)[Math.min(a-1,n-1)]||1,c=[];for(let e=0;n>e;e++){const t=0===l?0:i[e]/l;c[e]=1>t?Math.pow(1-Math.pow(t,3),3):0}let u=0,d=0,h=0,f=0,m=0;for(let e=0;n>e;e++){const t=c[e];0!==t&&(u+=t,d+=t*o[e],h+=t*r[e],f+=t*o[e]*o[e],m+=t*o[e]*r[e])}if(0===u){s.push([t,r[e]]);continue}const y=u*f-d*d;if(1e-12>Math.abs(y))s.push([t,h/u]);else{const e=(u*m-d*h)/y;s.push([t,(h-e*d)/u+e*t])}}return s}(h,r.bandwidth??.3):("polynomial"===w?o(h,r.order||2):i(h)).points;const $=k.map(([e,t])=>{const[n,i]=v(e,t);return`${n},${i}`}).join(" "),M=r.color||"#6366f1",A=k[k.length-1],[S,C]=v(A[0],A[1]);return Vi("g",{children:[_i("polyline",{points:$,fill:"none",stroke:M,strokeWidth:r.strokeWidth??2,strokeDasharray:r.strokeDasharray||"6,3"}),r.label&&_i("text",{x:S+4,y:C-4,fill:M,fontSize:11,children:r.label})]},"ann-"+s)}case"band":{const e=l.scales?.y??l.scales?.value,t=e?.domain?.(),n=r.y0??t?.[0],i=r.y1??t?.[1],o=null!=n&&e?e(n):0,a=null!=i&&e?e(i):l.height||0,d=Pi(r,"ann-"+s,"vertical","var(--semiotic-primary, #6366f1)");return Vi("g",{opacity:r.opacity,children:[d.def&&_i("defs",{children:d.def}),_i("rect",{x:0,y:Math.min(o,a),width:l.width||0,height:Math.abs(a-o),fill:d.fill,fillOpacity:r.fillOpacity??.1}),r.label&&_i(J,{x:(l.width||0)-4,y:(c=o,u=a,Math.max(Math.min(c,u),0)+16),textAnchor:"end",fill:r.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:r.label,background:r.labelBackground??"halo"})]},"ann-"+s)}case"x-band":{const e=l.scales?.x??l.scales?.time,t=e?.domain?.(),n=r.x0??t?.[0],i=r.x1??t?.[1],o=null!=n&&e?e(n):null,a=null!=i&&e?e(i):null;if(null==o||null==a)return null;const c=Pi(r,"ann-"+s,"horizontal","var(--semiotic-primary, #6366f1)");return Vi("g",{opacity:r.opacity,children:[c.def&&_i("defs",{children:c.def}),_i("rect",{x:Math.min(o,a),y:0,width:Math.abs(a-o),height:l.height||0,fill:c.fill,fillOpacity:r.fillOpacity??.1}),r.label&&_i(J,{x:Math.min(o,a)+4,y:16,textAnchor:"start",fill:r.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:r.label,background:r.labelBackground??"halo"})]},"ann-"+s)}case"envelope":{const e=l.data||[];if(2>e.length)return null;const t=l.xAccessor||"x",n=l.scales?.x??l.scales?.time,i=l.scales?.y??l.scales?.value;if(!n||!i)return null;const o=r.upperAccessor||"upperBounds",a=r.lowerAccessor||"lowerBounds",c=r.filter,u=e.filter(e=>null!=e[o]&&null!=e[a]&&!(c&&!c(e))).sort((e,n)=>e[t]-n[t]);if(2>u.length)return null;const d=qi[l.curve||"linear"]||$i,h=ki().x(e=>n(e[t])).y0(e=>i(e[a])).y1(e=>i(e[o])).curve(d)(u);if(!h)return null;const f=r.fill||"#6366f1";return Vi("g",{children:[_i("path",{d:h,fill:f,fillOpacity:r.fillOpacity??.15,stroke:"none"}),r.label&&u.length>0&&_i("text",{x:n(u[u.length-1][t])+4,y:i(u[u.length-1][o])-4,fill:f,fontSize:11,children:r.label})]},"ann-"+s)}case"anomaly-band":{const e=l.data||[];if(2>e.length)return null;const t=l.yAccessor||"y",n=l.scales?.x??l.scales?.time,i=l.scales?.y??l.scales?.value;if(!n||!i)return null;const o=e.map(e=>e[t]).filter(e=>null!=e&&isFinite(e));if(2>o.length)return null;const a=o.reduce((e,t)=>e+t,0)/o.length,c=o.reduce((e,t)=>e+(t-a)**2,0)/o.length,u=Math.sqrt(c),d=r.threshold??2,h=a-d*u,f=!1!==r.showBand,m=r.fill||"#6366f1",y=r.fillOpacity??.1,p=r.anomalyColor||"#ef4444",g=r.anomalyRadius??6,b=i(a+d*u),x=i(h),v=e.filter(e=>{const n=e[t];return null!=n&&Math.abs(n-a)>d*u});return Vi("g",{children:[f&&_i("rect",{x:0,y:Math.min(b,x),width:l.width||0,height:Math.abs(x-b),fill:m,fillOpacity:y}),v.map((e,t)=>{const n=Wi(e,l),i=Ri(e,l);return null==n||null==i?null:_i("circle",{cx:n,cy:i,r:g,fill:p,fillOpacity:.7,stroke:p,strokeWidth:1.5},"anomaly-"+t)}),r.label&&_i("text",{x:(l.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:m,fontSize:11,children:r.label})]},"ann-"+s)}case"forecast":{const i=l.data||[];if(3>i.length)return null;const a=l.xAccessor||"x",c=l.yAccessor||"y",u=l.scales?.x??l.scales?.time,d=l.scales?.y??l.scales?.value;if(!u||!d)return null;const h=i.map(e=>[e[a],e[c]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>h.length)return null;let f;if("polynomial"===(r.method||"linear")){const e=o(h,r.order||2).equation;f=t=>e.reduce((e,n,i)=>e+n*Math.pow(t,i),0)}else{const e=t(h);if(!e)return null;f=e}const m=h.length,{se:y,meanX:p,ssX:g}=n(h,f),b=e(r.confidence??.95),x=r.steps??5,v=h[m-1][0],w=(v-h[0][0])/Math.max(m-1,1),k=[];for(let e=1;x>=e;e++)k.push(v+e*w);const $=[];for(const e of k){const t=f(e),n=y*Math.sqrt(1+1/m+(g>0?(e-p)**2/g:0))*b;$.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const M=`M${$.map(e=>`${u(e.x)},${d(e.yUpper)}`).join(" L")} L${$.slice().reverse().map(e=>`${u(e.x)},${d(e.yLower)}`).join(" L")} Z`,A=$.map(e=>`${u(e.x)},${d(e.yCenter)}`).join(" "),S=`${u(v)},${d(f(v))}`,C=r.strokeColor||"#6366f1";return Vi("g",{children:[_i("path",{d:M,fill:r.fill||"#6366f1",fillOpacity:r.fillOpacity??.15,stroke:"none"}),_i("polyline",{points:`${S} ${A}`,fill:"none",stroke:C,strokeWidth:r.strokeWidth??2,strokeDasharray:r.strokeDasharray??"6,3"}),r.label&&$.length>0&&_i("text",{x:u($[$.length-1].x)+4,y:d($[$.length-1].yCenter)-4,fill:C,fontSize:11,children:r.label})]},"ann-"+s)}case"widget":{let e,t;if(null!=r.px&&null!=r.py)e=r.px,t=r.py;else{const n=Ti(r,s,l);if(!n)return null;e=n.x,t=n.y}if(!Oi(e,t,l))return null;const n=r.dx??0,i=r.dy??0,o=r.width??32,c=r.height??32,u=r.content??_i("span",{style:{fontSize:18,cursor:"default"},title:r.label||"Info",children:"ℹ️"});return _i("foreignObject",{x:e+n-o/2,y:t+i-c/2,width:o,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:_i("div",{...Y(r,a),style:{width:o,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+s)}case"text":{const e=Ti(r,s,l);if(!e)return null;const{x:t,y:n}=e,i=t+(r.dx||0),o=n+(r.dy||0),a=r.color||"var(--semiotic-text, #333)",c=_i("text",{x:i,y:o,fill:a,fontSize:r.fontSize||11,opacity:r.opacity,strokeDasharray:r.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:r.label});return!0!==r._redundantConnector?di.cloneElement(c,{key:"ann-text-"+s}):Vi("g",{opacity:r.opacity,strokeDasharray:r.strokeDasharray,children:[_i("line",{x1:t,y1:n,x2:i,y2:o,stroke:a,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),di.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+s)}case"frame-text":return _i(Gi,{annotation:r,width:l.width||0,height:l.height||0},"ann-frame-text-"+s);case"category-highlight":{const e=r.category;if(null==e)return null;const t=e=>"function"==typeof e&&"function"==typeof e.bandwidth,n=l.scales?.o,i=l.scales?.x,o=l.scales?.y,a=t(n)?n:t(i)?i:t(o)?o:null;if(!a)return null;const c=a(e+"");if(null==c)return null;const u=a.bandwidth(),d=r.color||"var(--semiotic-primary, #4589ff)",h=r.opacity??.15,f=r.label;return Vi("g",(l.projection?"vertical"===l.projection:a===i)?{children:[_i("rect",{x:c,y:0,width:u,height:l.height||0,fill:d,fillOpacity:h}),f&&_i(J,{x:c+u/2,y:16,textAnchor:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:r.labelBackground??"none"})]}:{children:[_i("rect",{x:0,y:c,width:l.width||0,height:u,fill:d,fillOpacity:h}),f&&_i(J,{x:12,y:c+u/2,dominantBaseline:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:r.labelBackground??"none"})]},"ann-"+s)}default:return null}var c,u,d}}var Ui=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Xi=new Set(["label","callout","callout-circle","callout-rect"]);function Ki(e){return"string"==typeof e?.type?e.type:""}function Zi(e){return!!e&&"object"==typeof e&&Ui.has(Ki(e))}function Qi(e){return Xi.has(Ki(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function Ji(e){return"primary"===e?.emphasis||!0===e?.defensive}function eo(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function to(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const i=e?.provenance?.confidence;switch("number"==typeof i&&Number.isFinite(i)&&(t+=15*Math.max(0,Math.min(1,i))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}var no=32,io=6,oo=4,ro=8,ao=72;var so={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function lo(e){if(!co(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function co(e){return Zi(e)}function uo(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),i=e.split(/\s+/).filter(Boolean),o=[];let r="";for(const e of i)r&&r.length+e.length+1>n?(o.push(r),r=e):r=r?`${r} ${e}`:e;return r&&o.push(r),o}function ho(e,t,n,i,o){const r=e+n,a=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?r-o.width-4:r+4,y:0>i?a-o.height:a,width:o.width,height:o.height}:{x:0>n?r-o.width:r,y:0>i?a-o.height-4:a+4,width:o.width,height:o.height}}function fo(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function mo(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 yo(e,t,n,i,o,r,a,s){const l=fo(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){const o=Math.max(0,i-e.x),r=Math.max(0,i-e.y);return(o+Math.max(0,e.x+e.width-(t-i)))*e.height+(r+Math.max(0,e.y+e.height-(n-i)))*e.width}(l,o,r,s);for(const e of n)c+=12*mo(l,e);for(const e of i)c+=4*mo(l,e);return c}function po(e){const{annotations:t,context:n,defaultOffset:i=no,notePadding:o=io,markPadding:r=oo,edgePadding:a=ro,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=ao,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:y,audience:p}=e,g=n.width||0,b=n.height||0,x="object"==typeof m?m:{},v=x.breakpoint??480,w=!!m&&v>=g,k=w&&!1!==x.preferShortText?t.map(lo):t,$=w&&!u?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:u,M=d||w&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),A=w&&!f?x.responsive??{minWidth:v}:f,S=w&&!y?x.cohesion:y;if(0===k.length||0>=g||0>=b)return k.slice();const C=[],L=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(n,r);let j=!1;const N=k.map((e,t)=>{if(!co(e))return e;const r=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,r=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&r){const e=o[0],t=o[1];if("number"==typeof e&&"number"==typeof t){const n=r([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?Ti(e,t,n):{x:e.x,y:e.y}}(e,t,n);if(!r)return e;const u=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...uo("string"==typeof e.title?e.title:void 0,t),...uo("string"==typeof e.label?e.label:void 0,t)],i=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*i)+10),height:Math.max(18,16*n.length+6)}}(e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return C.push(fo(ho(r.x,r.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),o)),e}var d;let h=null,f=1/0;for(const e of function(e){const 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}]}(i)){const t=yo(ho(r.x,r.y,e.dx,e.dy,u),e,C,L,g,b,o,a);f>t&&(h=e,f=t)}if(!h)return e;const m=fo(ho(r.x,r.y,h.dx,h.dy,u),o);C.push(m);const y=Math.hypot(h.dx,h.dy),p=l&&y>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return j=!0,{...e,dx:h.dx,dy:h.dy,...p?{connector:p}:{}}}),I=j?N:k.slice();let W=I;if(h){let e=!1;const t=I.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});W=e?t:I}{let e=!1;const t=W.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(so,t.source)?so[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)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,i].filter(Boolean).join(" · "),r="string"==typeof e.label?e.label:"";return r.includes(`(${o})`)?e:{...e,label:r?`${r} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});W=e?t:W}const R=new Set;if($){const e="object"==typeof $?$:{},t=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const 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}(e);return t>2?4>t?1:.6:1.5}(p),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??eo(g,b,e))*t))},{deferred:i}=function(e){const{annotations:t,width:n,height:i}=e,o=Math.max(0,e.minVisible??1),r=eo(n,i,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,Zi(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||r>=s.length)return{visible:t.slice(),deferred:[],budget:r};const l=s.filter(e=>Ji(e.annotation)),c=s.filter(e=>!Ji(e.annotation)).sort((e,t)=>to(t.annotation)-to(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,r-l.length),Math.max(0,o-l.length))),d=new Set([...l.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(const{annotation:e,index:t,note:n}of a)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:r}}({annotations:W,width:g,height:b,...n});for(const e of i)R.add(e)}if(A&&("object"==typeof A&&"number"==typeof A.minWidth?A.minWidth:480)>=g)for(const e of W)co(e)&&"secondary"===e.emphasis&&R.add(e);if(R.size>0)for(const e of W)!0===e?.defensive&&R.delete(e);let z;return z=0===R.size?W:M?W.map(e=>R.has(e)?{...e,_annotationDeferred:!0}:e):W.filter(e=>!R.has(e)),S?function(e,t){let n=!1;const i=e.map(e=>co(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?i:e}(z,S):z}import{jsx as go}from"react/jsx-runtime";function bo({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?go("foreignObject",{x:0,y:0,width:t,height:n,children:e}):go("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}import*as xo from"react";import{jsx as vo}from"react/jsx-runtime";function wo(e){if(!1!==e?.interactive)return e?.style?.cursor}function ko(e){if(!e)return!1;for(const t of e)if(wo(t))return!0;return!1}function $o(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Mo(e,t){return $o(e),ko(t)}function Ao(e,t,n){e&&(t.inside&&"touch"!==t.pointerType?$o(e,n(t)):$o(e))}function So(e){const t=xo.useRef(null);xo.useEffect(()=>{e.current&&(t.current=e.current)}),xo.useEffect(()=>()=>$o(t.current),[])}function Co(e,t,n){const i=wo(t);return i&&null!=e&&!1!==e?vo("g",{style:{cursor:i},"data-semiotic-mark-cursor":i,children:e},n):e}import{useEffect as Lo,useLayoutEffect as jo,useRef as No,useState as Io,useSyncExternalStore as Wo}from"react";var Ro="undefined"!=typeof window?jo:Lo;function zo(){const[e,t]=Io(!1);return Ro(()=>{t(!0)},[]),e}var Fo=()=>()=>{},To=()=>!1,Oo=()=>!0;function Po(){const e=Wo(Fo,To,Oo);return No(e).current}import*as Do from"react";import{jsx as Eo}from"react/jsx-runtime";var Bo=Do.createContext(null);function Ho({children:e}){const[t,n]=Do.useState(!1),i=Do.useCallback(()=>n(e=>!e),[]),o=Do.useMemo(()=>({visible:t,setVisible:n,toggle:i}),[t,i]);return Eo(Bo.Provider,{value:o,children:e})}function Go(){return Do.useContext(Bo)}function _o(){const e=Do.useContext(Bo);return e?e.toggle:null}import{jsx as Vo}from"react/jsx-runtime";var qo={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Yo({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}return Vo("div",{"aria-live":"polite","aria-atomic":"true",style:qo,children:t})}function Uo(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,i]of Object.entries(e))n.startsWith("_")||null!=i&&""!==i&&("number"==typeof i?Number.isFinite(i)&&(t[n]=i):"string"==typeof i?t[n]=i:"boolean"==typeof i?t[n]=i+"":i instanceof Date&&(t[n]=i.toISOString().slice(0,10)));return t}function Xo(e){return e&&"object"==typeof e?e:{}}function Ko(e){return Xo(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Zo(e,t){const n=Xo(e.accessibility);return{label:"string"==typeof n.label&&n.label.length>0?n.label:"string"==typeof e.label&&e.label.length>0?e.label:t,values:Uo(Ko(e))}}function Qo(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const i of e)if(i&&"object"==typeof i&&null!==i.datum)try{switch(i.type){case"point":if(n)break;t.push({label:"Point",values:Uo(Ko(i))});break;case"line":case"area":{const e=Ko(i),n=Array.isArray(e)?e:[],o="line"===i.type?"Line point":"Area point";for(const e of n)t.push({label:o,values:Uo(e)});break}case"rect":{const e=Ko(i),n=null!=e&&"object"==typeof e?e:{},o=n.category??i.group??"",r=n.value??n.__aggregateValue??n.total,a=Uo(n);null==a.category&&""!==o&&(a.category=o+""),null==a.value&&null!=r&&(a.value="number"==typeof r||"string"==typeof r?r:r+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=Uo(Ko(i));null==e.value&&"number"==typeof i.value&&Number.isFinite(i.value)&&(e.value=i.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=Ko(i),n=Uo(e);if(null==n.category){const t=Xo(e),i=t.category??t.label;null!=i&&(n.category=i+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:Uo(Ko(i))});break;case"arc":t.push({label:"Arc",values:Uo(Ko(i))});break;case"candlestick":t.push({label:"Candlestick",values:Uo(Ko(i))});break;case"geoarea":{const e=Xo(Ko(i)),n=Uo(e);if(null==n.name){const t=Xo(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}import*as Jo from"react";var er=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""};function tr(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":er(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":e+""}function nr(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function ir(e){return null!=e&&"object"==typeof e?nr(e).id:e}function or(e){const t=nr(e.datum);return{source:ir(t.source??e.source),target:ir(t.target??e.target)}}import{jsx as rr,jsxs as ar}from"react/jsx-runtime";var sr=Jo.lazy(()=>import("./c-PPWDL5ZI.min.js"));function lr({accessibleTable:e,children:t}){return"object"!=typeof e?t:"undefined"==typeof document?null:rr(Jo.Suspense,{fallback:null,children:rr(sr,{target:e.portalTarget,children:t})})}function cr(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const i=[],o={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},r=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],a=Object.keys(n).sort((e,t)=>{const n=r.indexOf(e),i=r.indexOf(t);return(-1===n?999:n)-(-1===i?999:i)});for(const e of a)i.push(`${n[e]} ${o[e]||e}`);return`${t}, ${i.join(", ")}`}function ur(e,t,n){const i=[];return e>0&&i.push(e+" nodes"),t>0&&i.push(t+" edges"),0===i.length?n+", empty":`${n}, ${i.join(", ")}`}var dr=25,hr="semiotic-accessible-data-table",fr=hr+" semiotic-accessible-data-table-hidden",mr=hr+" semiotic-accessible-data-table-visible",yr=mr+" semiotic-accessible-data-table-network",pr={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},gr={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},br={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},xr={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},vr={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},wr={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},kr={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},$r={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},Mr={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};function Ar({scene:e,chartType:t,tableId:n,chartTitle:i}){const[o,r]=Jo.useState(!1),[a,s]=Jo.useState(5),l=Go(),c=l?.visible??!1,u=o||c,d=Jo.useRef(null),h=i?"Data summary for "+i:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Jo.useEffect(()=>{u||s(5)},[u]);const f=Jo.useCallback(e=>{e.target===e.currentTarget&&(o||c||r(!0))},[o,c]),m=Jo.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||r(!1)},[c]);if(!e||0===e.length)return n?rr("span",{id:n,tabIndex:-1,style:qo}):null;if(!u)return rr("div",{id:n,className:fr,tabIndex:-1,onFocus:f,style:qo,role:"region","aria-label":h,children:ar("button",{type:"button",onClick:()=>r(!0),style:pr,children:["View data summary (",e.length," elements)"]})});const y=Qo(e),p=function(e){const t=new Map;for(const n of e??[])for(const[e,i]of Object.entries(n?.values??{})){if(null==i||""===i)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:new Set},t.set(e,n)),"number"==typeof i){if(!Number.isFinite(i))continue;n.count++,n.sum+=i,n.min>i&&(n.min=i),i>n.max&&(n.max=i)}else"object"!=typeof i&&"function"!=typeof i&&n.strings.add(i+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}(y),g=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${er(e.min)} to ${er(e.max)}, mean ${er(e.mean)}.`);else{const t=e.uniqueValues,i=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${i}.`)}return n.join(" ")}(y.length,p),b=Math.min(a,y.length),x=y.slice(0,b),v=y.length-b,w=new Set;for(const e of x)for(const t of Object.keys(e.values))w.add(t);const k=Array.from(w);return ar("div",{ref:d,id:n,className:mr,tabIndex:-1,onBlur:m,style:gr,role:"region","aria-label":h,children:[rr("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&l&&l.setVisible(!1),r(!1)},"aria-label":"Close data summary",style:xr,children:"×"}),rr("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:br,children:g}),ar("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:vr,children:[rr("caption",{className:"semiotic-accessible-data-table-caption",style:$r,children:v>0?`First ${b} of ${y.length} data points`:`All ${y.length} data points`}),rr("thead",{children:ar("tr",{children:[rr("th",{style:wr,children:"type"}),k.map(e=>rr("th",{style:wr,children:e},e))]})}),rr("tbody",{children:x.map((e,t)=>ar("tr",{children:[rr("td",{style:kr,children:e.label}),k.map(t=>rr("td",{style:kr,children:tr(e.values[t])},t))]},t))})]}),v>0&&ar("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+dr),style:Mr,children:["Show ",Math.min(dr,v)," more"," ",1===v?"row":"rows"," (",v," remaining)"]})]})}function Sr({nodes:e,edges:t,chartType:n,tableId:i,chartTitle:o}){const[r,a]=Jo.useState(!1),[s,l]=Jo.useState(5),[c,u]=Jo.useState(5),d=Go(),h=d?.visible??!1,f=r||h,m=o?"Data summary for "+o:i?`Data summary for ${n} ${i}`:"Data summary for "+n,y=Jo.useRef(null);Jo.useEffect(()=>{f||(l(5),u(5))},[f]);const p=Jo.useCallback(e=>{e.target===e.currentTarget&&(r||h||a(!0))},[r,h]),g=Jo.useCallback(e=>{h||y.current?.contains(e.relatedTarget)||a(!1)},[h]),b=e.filter(e=>null!==e.datum);if(0===b.length&&0===t.length)return i?rr("span",{id:i,tabIndex:-1,style:qo}):null;if(!f)return rr("div",{id:i,className:fr,tabIndex:-1,onFocus:p,style:qo,role:"region","aria-label":m,children:ar("button",{type:"button",onClick:()=>a(!0),style:pr,children:["View data summary (",b.length," nodes, ",t.length," edges)"]})});const{nodeRows:x,edgeRows:v,hasWeights:w,summary:k}=function(e,t){const n=new Map,i=[];let o=!1;for(let e=0;t.length>e;e++){const r=t[e];if(!r||"object"!=typeof r)continue;const a=nr(r.datum),{source:s,target:l}=or(r),c="number"==typeof a.value&&Number.isFinite(a.value),u=c?a.value:0;o||(o=c);for(const[e,t,i]of[[s,1,3],[l,0,2]]){if(null==e||""===e)continue;const o=e+"",r=n.get(o)??[0,0,0,0];r[t]++,r[i]+=u,n.set(o,r)}i.push(Zo(r,null!=s||null!=l?`${null==s?"?":s+""} → ${null==l?"?":l+""}`:"Edge "+(e+1)))}const r=[];let a=0,s=0;for(let t=0;e.length>t;t++){const i=e[t];if(!i||"object"!=typeof i||null===i.datum)continue;const o=nr(i.datum).id??i.id,l=null!=o?o+"":"node-"+t,[c,u,d,h]=n.get(l)??[0,0,0,0],f=c+u;a+=f,f>s&&(s=f),r.push({id:l,degree:f,inDeg:c,outDeg:u,wDegree:d+h,wInDeg:d,wOutDeg:h,semantic:Zo(i,l)})}r.sort((e,t)=>t.degree-e.degree);const l=[`${r.length} nodes, ${t.length} edges.`];return r.length>0&&l.push(`Mean degree: ${er(a/r.length)}, max degree: ${s}.`),{nodeRows:r,edgeRows:i,hasWeights:o,summary:l.join(" ")}}(b,t),$=Math.min(s,x.length),M=x.slice(0,$),A=x.length-$,S=Math.min(c,v.length),C=v.slice(0,S),L=v.length-S,j=new Set;for(const e of M)for(const t of Object.keys(e.semantic.values))j.add(t);const N=Array.from(j),I=new Set;for(const e of C)for(const t of Object.keys(e.values))I.add(t);const W=Array.from(I);return ar("div",{ref:y,id:i,className:yr,tabIndex:-1,onBlur:g,style:gr,role:"region","aria-label":m,children:[rr("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{h&&d&&d.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:xr,children:"×"}),rr("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:br,children:k}),x.length>0&&ar("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node data and degree summary for "+n,style:vr,children:[rr("caption",{className:"semiotic-accessible-data-table-caption",style:$r,children:A>0?`Top ${$} of ${x.length} nodes by degree`:`All ${x.length} nodes by degree`}),rr("thead",{children:ar("tr",{children:[rr("th",{style:wr,children:"node"}),N.map(e=>rr("th",{style:wr,children:e},e)),rr("th",{style:wr,children:"degree"}),rr("th",{style:wr,children:"in"}),rr("th",{style:wr,children:"out"}),w&&rr("th",{style:wr,children:"w. degree"}),w&&rr("th",{style:wr,children:"w. in"}),w&&rr("th",{style:wr,children:"w. out"})]})}),rr("tbody",{children:M.map((e,t)=>ar("tr",{"aria-label":e.semantic.label,children:[rr("td",{style:kr,children:e.semantic.label}),N.map(t=>rr("td",{style:kr,children:tr(e.semantic.values[t])},t)),rr("td",{style:kr,children:e.degree}),rr("td",{style:kr,children:e.inDeg}),rr("td",{style:kr,children:e.outDeg}),w&&rr("td",{style:kr,children:er(e.wDegree)}),w&&rr("td",{style:kr,children:er(e.wInDeg)}),w&&rr("td",{style:kr,children:er(e.wOutDeg)})]},t))})]}),A>0&&ar("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>l(e=>e+dr),style:Mr,children:["Show ",Math.min(dr,A)," more"," ",1===A?"node":"nodes"," (",A," remaining)"]}),v.length>0&&ar("table",{className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",role:"table","aria-label":"Edge data for "+n,style:{...vr,marginTop:12},children:[rr("caption",{className:"semiotic-accessible-data-table-caption",style:$r,children:L>0?`First ${S} of ${v.length} edges`:`All ${v.length} edges`}),rr("thead",{children:ar("tr",{children:[rr("th",{style:wr,children:"edge"}),W.map(e=>rr("th",{style:wr,children:e},e))]})}),rr("tbody",{children:C.map((e,t)=>ar("tr",{"aria-label":e.label,children:[rr("td",{style:kr,children:e.label}),W.map(t=>rr("td",{style:kr,children:tr(e.values[t])},t))]},t))})]}),L>0&&ar("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>u(e=>e+dr),style:Mr,children:["Show ",Math.min(dr,L)," more"," ",1===L?"edge":"edges"," (",L," remaining)"]})]})}function Cr({summary:e}){return e?rr("div",{role:"note",style:qo,children:e}):null}function Lr({tableId:e}){return rr("a",{href:"#"+e,style:qo,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,qo)},children:"Skip to data table"})}import{jsx as jr}from"react/jsx-runtime";var Nr="var(--semiotic-focus, #005fcc)";function Ir({active:e,hoverPoint:t,margin:n,size:i,shape:o="circle",width:r,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==o&&"path"!==o||!s)if("rect"===o&&null!=r&&null!=a){const e=Math.max(r,4),t=Math.max(a,4);u=jr("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Nr,strokeWidth:2,strokeDasharray:"4,2"})}else u=jr("circle","wedge"===o?{cx:l,cy:c,r:12,fill:"none",stroke:Nr,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:l,cy:c,r:8,fill:"none",stroke:Nr,strokeWidth:2,strokeDasharray:"4,2"});else u=jr("g",{transform:`translate(${n.left},${n.top})`,children:jr("path",{d:s,fill:"none",stroke:Nr,strokeWidth:2.5,strokeDasharray:"6,3"})});return jr("svg",{style:{position:"absolute",left:0,top:0,width:i[0],height:i[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}import*as Wr from"react";import{jsx as Rr}from"react/jsx-runtime";function zr({x:e,y:t,containerWidth:n,containerHeight:i,margin:o,children:r,className:a="stream-frame-tooltip",zIndex:s=1}){const l=Number.isFinite(e)&&Number.isFinite(t),c=Wr.useRef(null),[u,d]=Wr.useState(null);Wr.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&d(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a,n,i,l]);let h;h=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>i-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*i>t?"4px":"calc(-100% - 4px)"})`;const f=ae(r),m=f?null:ne;return l?Rr("div",{ref:c,className:f?a:(a+" semiotic-tooltip").trim(),style:{...m||{},position:"absolute",left:o.left+e,top:o.top+t,transform:h,pointerEvents:"none",zIndex:s,width:"max-content"},children:r}):null}import*as Fr from"react";import{useCallback as Tr,useEffect as Or,useLayoutEffect as Pr,useMemo as Dr,useRef as Er}from"react";function Br(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function Hr(e,t){return Math.min((e-t.startTime)/t.duration,1)}function Gr(e,t,n){return e+(t-e)*n}function _r(){return"undefined"!=typeof performance?performance.now():Date.now()}var Vr=()=>"undefined"!=typeof performance?performance.now():Date.now();function qr(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function Yr(e,t){const n=e();return Number.isFinite(n)?n:t}var Ur=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Vr,this.lastWallTime=Yr(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Yr(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Vr;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Yr(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:qr(n)))}},Xr="undefined"==typeof window?Or:Pr,Kr={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)};function Zr(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Qr(e){const t=u(),n=Er(t);n.current=t;const[i,o]=sn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),r=o[0],a=o[1],s=Dr(()=>[r,a],[r,a]),l=!!e.title,c=!!e.legend&&"top"===e.legendPosition,d=Dr(()=>{const t=function(e,t,n=!1){const i=n?t?58:34:t?36:0;return i>e.top?{...e,top:i}:e}({...e.marginDefault,...e.userMargin},l,c);if(e.legend&&!e.legendMarginReserved){const n={...t},i=e.legendPosition??"right";Bt(t,{legend:e.legend,position:i,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),Ct(t,n,s,i)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,c,s]),h=o[0]-d.left-d.right,m=o[1]-d.top-d.bottom,y=Zr(e.foregroundGraphics,o,d),p=Zr(e.backgroundGraphics,o,d),g=f(e=>e.theme),{transition:b,introEnabled:x}=function(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}(e.animate,e.transitionProp),v="semiotic-table-"+Fr.useId(),w=Er(null);if(!w.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;w.current=new Ur({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const k=w.current;k.configure({clock:e.clock,random:e.random,seed:e.seed});const $=Er(null),M=Er(e.frameScheduler??Kr);M.current=e.frameScheduler??Kr;const S=Er(null),C=Er(!1),L=Er(()=>{}),j=Tr(()=>{if(null!==$.current||C.current)return;const e=M.current;let t=!1,n=!1;const i=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(C.current=!0),$.current=null,S.current=null;try{L.current()}finally{e&&(C.current=!1)}});n=!0,t||($.current=i,S.current=e)},[]),N=Tr(()=>{null!==$.current&&((S.current??M.current).cancelAnimationFrame($.current),$.current=null,S.current=null)},[]);Xr(()=>{k.setPaused(!0===e.paused)},[k,e.paused]),Or(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void k.setVisible(!0);const t=()=>k.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[k,e.suspendWhenHidden]),Or(()=>()=>{N()},[N]);const I=Er(()=>{}),W=Er(()=>{}),R=Er({inside:!1,clientX:0,clientY:0,pointerType:void 0}),F=Er(null),T=Er(null),O=Er(null),P=Tr(()=>{const e=F.current;F.current=null,e&&I.current(e)},[]),D=Tr(e=>{const t=R.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,F.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===T.current){const e=M.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,T.current=null,O.current=null,P()});t||(T.current=n,O.current=e)}},[P]),E=Tr(()=>{R.current.inside=!1,F.current=null,null!==T.current&&((O.current??M.current).cancelAnimationFrame(T.current),T.current=null,O.current=null),W.current()},[]);Or(()=>()=>{F.current=null,null!==T.current&&((O.current??M.current).cancelAnimationFrame(T.current),T.current=null,O.current=null)},[]);const B=e.themeDirtyRef,H=Er(!1);return Xr(()=>{if(!B)return;const t=!H.current;H.current=!0,t&&e.skipInitialThemeInvalidation||(A(),B.current=!0,j())},[g,e.skipInitialThemeInvalidation,j,B]),Or(()=>{if(B)return z(()=>i.current,()=>{B.current=!0,j()})},[i,j,B]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:i,size:o,margin:d,adjustedWidth:h,adjustedHeight:m,resolvedForeground:y,resolvedBackground:p,currentTheme:g,transition:b,introEnabled:x,tableId:v,frameRuntime:k,rafRef:$,renderFnRef:L,scheduleRender:j,cancelRender:N,hoverHandlerRef:I,hoverLeaveRef:W,onPointerMove:D,onPointerLeave:E,pointerStateRef:R}}function Jr(e){const t="undefined"==typeof document?void 0:document.fonts;return t?(t.addEventListener("loadingdone",e),()=>{t.removeEventListener("loadingdone",e)}):()=>{}}function ea(e,t,n){const i=Math.round(t[0]*n),o=Math.round(t[1]*n),r=0===t[0]?n:i/t[0],a=0===t[1]?n:o/t[1],s=t[0]+"px",l=t[1]+"px";return e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l),e.width!==i&&(e.width=i),e.height!==o&&(e.height=o),{effectiveDprX:r,effectiveDprY:a}}function ta(e,t,n,i){const o=e.getContext("2d");if(!o)return null;const{effectiveDprX:r,effectiveDprY:a}=ea(e,t,i);return o.setTransform(r,0,0,a,0,0),o.translate(n.left,n.top),o}function na(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,i="undefined"!=typeof window&&("function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches||768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0))?2:3,o="number"==typeof e&&e>0?e:i;if(!t)return Math.max(1,Math.min(n,o));const[r,a]=t,s=Math.min(Math.sqrt(8388608/(r*a)),16384/Math.max(r,a));return Math.max(1>s?0:1,Math.min(n,o,s))}import{useEffect as ia,useRef as oa}from"react";import{jsx as ra,jsxs as aa}from"react/jsx-runtime";function sa(e){const{cancelRender:t,dirtyRef:n,frameRuntime:i,manageFrameRuntime:o,maxDevicePixelRatio:r,scheduleRender:a}=e,s=oa(null),l=oa(null),c=oa(!1),u=oa(!1),d=oa(!1);return function(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:i,dirtyRef:o,renderFnRef:r,cancelRender:a,cleanup:s}=e;Ro(()=>{const e=i.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():o.current=!0,a?.(),r.current()},[t,n]);const l=No(s);l.current=s,Lo(()=>()=>l.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),ia(()=>{if(!1!==o)return i.subscribe(()=>{i.isActive?(n.current=!0,a()):t()})},[t,n,i,o,a]),ia(()=>function(){if("undefined"==typeof window||"function"!=typeof window.matchMedia)return()=>{};let e=null,t=!1;const n=()=>{e&&("function"==typeof e.removeEventListener?e.removeEventListener("change",o):"function"==typeof e.removeListener&&e.removeListener(o))},i=()=>{const t=`(resolution: ${window.devicePixelRatio||1}dppx)`;e=window.matchMedia(t),e.media.includes("resolution")?"function"==typeof e.addEventListener?e.addEventListener("change",o):"function"==typeof e.addListener&&e.addListener(o):e=null};function o(){t||(n(),e=null,c.current=!0,a(),queueMicrotask(()=>{t||i()}))}return i(),()=>{t=!0,n(),e=null}}(),[a]),ia(()=>{d.current?(c.current=!0,a()):d.current=!0},[r,a]),ia(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function la(e,t){return sa({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function ca({children:e,size:t,margin:n,backdropFill:i,overflowVisible:o=!1}){return e||i?aa("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:o?"visible":void 0},children:[i&&"transparent"!==i?ra("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:i}):null,ra("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function ua(e){return"touch"===e?"touch":"pointer"}function da(e){const 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 ha(e){const{onObservation:t,datum:n,x:i=0,y:o=0,chartType:r,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:i,y:o,timestamp:l,chartType:r,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:r,chartId:a})):t({type:"hover-end",timestamp:l,chartType:r,chartId:a}))}function fa(e){const{onObservation:t,datum:n,x:i=0,y:o=0,chartType:r,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:i,y:o,timestamp:l,chartType:r,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:r,chartId:a})):t({type:"click-end",timestamp:l,chartType:r,chartId:a}))}import{jsx as ma}from"react/jsx-runtime";var ya="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV;function pa({componentName:e,width:t,height:n,children:i}){return ma(Re,{fallback:i=>ma(Ie,{componentName:e,message:i.message,width:t,height:n}),children:i})}var ga={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"},ba={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2};function xa(e,t,n,i){return!1===i||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?ma("div",{style:{...ga,width:t,height:n},children:i||"No data available"}):null}function va(e,t,n,i){if(!e)return null;if(!1===i)return null;if(null!=i)return ma("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:i});const o=Math.min(5,Math.floor(n/40)),r=Math.max(8,Math.floor(n/(3*o))),a=Math.max(6,Math.floor(n/(2.5*o))),s=Math.floor((n-(o*(r+a)-a))/2);return ma("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:o},(e,n)=>ma("div",{className:"semiotic-loading-bar",style:{...ba,position:"absolute",top:s+n*(r+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:r,opacity:.5+n%2*.2}},n))})}function wa(e,t,n,i){if(!ya)return;if(!t||0===t.length)return;if("string"!=typeof i)return;const o=t[0];if(!o||"object"!=typeof o)return;if(i in o)return;const r=Object.keys(o).join(", ");console.warn(`[semiotic] ${e}: ${n} "${i}" not found in data. Available keys: ${r}`)}function ka(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function $a(e){return e?"string"==typeof e?{name:e}:e:null}var Ma=.5;function Aa(e,t,n,i){if(!t)return e;const o=(o,...r)=>{const a={...e(o,...r)};if(t.isActive)if(t.predicate(i?i(o):o))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??.5;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return $(o,[o])}var Sa={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1};function Ca(e,t={}){const n=t.mobileSemantics?.interaction,i="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,o="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,r=!!n||void 0!==i,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!o&&!r)return Sa;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??i??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}var La={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}}},ja={top:10,bottom:10,left:10,right:10};function Na(e){return e.compactMode?e.marginDefaults:ja}function Ia(e,t,n){if(!1!==t)return e;const i={...e};return"horizontal"===n?i.left=Math.min(i.left,15):i.bottom=Math.min(i.bottom,15),i}import{useMemo as Wa,useCallback as Ra,useEffect as za,useState as Fa}from"react";function Ta({data:e,colorBy:t,colorScale:n,getColor:i,strokeColor:o,strokeWidth:r,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==o&&(n.stroke=o),void 0!==r&&(n.strokeWidth=r),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((o,r)=>{const a=e.find("function"==typeof t?e=>t(e)===o:e=>e[t]===o),s=a?i(a,t,n):n?n(o):b[r%b.length];return{label:o+"",color:s,__semioticCategory:!0}}),label:""}]}}function Oa(e,t){if(!t)return[];const n=new Set;for(const i of e){const e="function"==typeof t?t(i):i[t];null!=e&&n.add(e+"")}return Array.from(n)}function Pa(e,t){return null!=e&&Object.hasOwn(e,t)}function Da({data:e,colorBy:t,colorScale:n,showLegend:i,legendPosition:o,userMargin:r,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){const{legendPosition:y,legendLayout:p}=function(e,t,n){const i=Pa(n,"legendPosition"),o=Pa(n,"legendLayout");return{legendPosition:i?n?.legendPosition??"right":e??"right",legendLayout:o?n?.legendLayout:t}}(o,d,h),g=Pa(h,"legend"),b=mt(un),x=bn(),w=void 0!==i?i:!b&&!!t,k=!!t&&(w||x),$=Wa(()=>k?void 0!==s?s:Oa(e,t):[],[s,t,e,k]);gn(x&&t?$:[]);const M=Wa(()=>{if(!w||!t)return;const i=Ta({data:e,colorBy:t,colorScale:n,getColor:v,categories:$});return 0!==i.legendGroups.reduce((e,t)=>e+t.items.length,0)?i:void 0},[w,t,e,n,$]),A=Wa(()=>g?h?.legend:Mt(M,l),[M,l,h?.legend,g]),{hasAxis:S,hasAxisLabel:C,rotatedTicks:L,topAxis:j,leftAxis:N,rightAxis:I}=m??{},W=void 0!==j,R=void 0!==N,z=void 0!==I,{hasAxis:F,hasAxisLabel:T,rotatedTicks:O}=j??{},{hasAxis:P,hasAxisLabel:D}=N??{},{hasAxis:E,hasAxisLabel:B}=I??{},H=Wa(()=>{const e="number"==typeof r?{top:r,bottom:r,left:r,right:r}:r??{},t=t=>{const n=e[t];return"number"==typeof n?n:a[t]},n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")},i={...n};return A&&(Bt(n,{legend:A,position:y,size:[c??600,u??400],hasTitle:f,legendLayout:p,minimumMargin:"bottom"===y?80:"top"===y?50:0,axisChrome:void 0===S?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:S,hasAxisLabel:C,rotatedTicks:L,topAxis:W?{hasAxis:F,hasAxisLabel:T,rotatedTicks:O}:void 0,leftAxis:R?{hasAxis:P,hasAxisLabel:D}:void 0,rightAxis:z?{hasAxis:E,hasAxisLabel:B}:void 0}}),null!=c&&null!=u&&Ct(n,i,[c,u],y)),n},[a,r,A,y,c,u,p,f,S,C,L,W,F,T,O,R,P,D,z,E,B]);return{legend:A,margin:H,legendPosition:y,legendLayout:p,legendMarginReserved:void 0!==A&&!Pa(h,"margin"),hasAutomaticLegend:void 0!==M}}function Ea(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Ba(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ha(e,t,n,i=!0,o=!1){const[r,a]=Fa(null),[s,l]=Fa(new Set),c=Wa(()=>new Set,[]),u=Wa(()=>new Set(n),[n]),d=null!=r&&u.has(r)?r:null,h=Wa(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);za(()=>{i&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:new Set))},[t,i,e]),za(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?new Set:t.size===e.size?e:t})},[u]);const f=Ra(t=>{i&&"highlight"===e&&a(!t||!u.has(t.label)||o&&!0!==t.__semioticCategory?null:t.label)},[u,i,e,o]),m=Ra(t=>{!i||"isolate"!==e||!u.has(t.label)||o&&!0!==t.__semioticCategory||l(e=>{const 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?new Set:n})},[u,i,e,o]),y=Wa(()=>{if(!i||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n: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:y}}function Ga(e,t,n,i=5){const[o,r]=n,[a,s]=Fa(null),[l,c]=Fa(new Map),u=Wa(()=>new Set,[]);za(()=>{s(null),c(new Map)},[o,r,i,e]);const d=Ra(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Ea(t);n&&s({key:Ba(t,n),range:n})},[e]),h=Ra(t=>{if("isolate"!==e)return;const n=Ea(t);n&&c(e=>{const o=new Map(e),r=Ba(t,n);return o.has(r)?o.delete(r):o.set(r,n),o.size===i?new Map:o})},[i,e]),f=Wa(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const i=t(e);return Number.isFinite(i)&&n.some(([e,t])=>i>=Math.min(e,t)&&Math.max(e,t)>=i)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}import{useMemo as _a,useCallback as Va,useState as qa,useId as Ya,useEffect as Ua,useRef as Xa}from"react";function Ka(e,t,n){const i=e.xValue??t?.[n];if(null==i)return null;const o=Number(i);return Number.isFinite(o)?o:null}function Za(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?{...t,xValue:e.xValue}:t||{}}function Qa(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}var Ja=[];function es(){const e=h(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function ts(){const e=h();return e?.colors?.sequential||void 0}function ns(){const e=h();return e?.colors?.diverging||void 0}function is(e,t,n,i,o){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){const e=k(n,i);if(e)return e}let r;if(Array.isArray(n))r=n;else if(t&&t.length>0)r=t;else if("string"==typeof n){const e=y[n];Array.isArray(e)&&(r=e)}return r&&0!==r.length?null!=i?(o.has(i)||o.set(i,o.size),r[o.get(i)%r.length]):r[0]:p}function os(e,t,n){const i=Ee(),o=es();return _a(()=>{if(!t)return;const r=i??void 0,a=n??(o&&o.length>0?o:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(r&&Qa(r)){const e=n.map(e=>({_cat:e})),t=x(e,"_cat",a);return e=>k(r,e)??t(e)}const i=n.map(e=>({_cat:e}));return x(i,"_cat",a)}if(r&&Qa(r)){const n=x(e,t,a);return e=>k(r,e)??n(e)}return x(e,t,a)}if(r&&Qa(r)){const e=x([{_:"a"}],"_",a);return t=>k(r,t)??e(t)}},[e,t,n,i,o])}function rs(e,t,n){return _a(()=>{if(!t||"auto"===t||"function"==typeof t)return e;const i=[...e],o="function"==typeof(r=n)?r:e=>e[r];var r;return i.sort("asc"===t?(e,t)=>o(e)-o(t):(e,t)=>o(t)-o(e))},[e,t,n])}function as({selection:e,linkedHover:t,fallbackFields:n=Ja,unwrapData:i=!1,onObservation:o,chartType:r,chartId:a,onClick:s,hoverHighlight:l,colorByField:u,mobileInteraction:d}){const h=Ya(),f=_a(()=>ka(t,n),[t,n]),m=_a(()=>"series"===f?.mode?[f.seriesField||u||n[0]].filter(e=>!!e):f?.fields||n,[f,u,n]),y=nt({name:e?.name||"__unused__",fields:m}),p=ot({name:f?.name||"hover",fields:m}),g=c(e=>e.pushObservation),b=Va(e=>{o?.(e),g?.(e)},[o,g]),x=e?{isActive:y.isActive,predicate:y.predicate}:null,[v,w]=qa(null),k=Xa(!1),$=u||n[0],M=_a(()=>{if(!l||null==v||!$)return null;const e=v,t=$;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,v,$]),A=Va((e,n)=>{const i=!e&&k.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"===f?.mode&&f.xField){const n=Ka(e,t,f.xField);null!=n&&function(e,t,n){const i=Ve.positions.get(e);i?.locked||i&&i.xValue===t&&i.sourceId===n||(Ve={positions:new Map(Ve.positions).set(e,{xValue:t,sourceId:n})},Ye())}(f.name||"hover",n,h)}"x-position"!==f?.mode&&p.onHover(t)}else"x-position"!==f?.mode||i||Ue(f.name||"hover",h),"x-position"===f?.mode||i||p.onHover(null);if(l&&$)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[$];w(null!=n?n+"":null)}else i||w(null);(o||g)&&ha({onObservation:b,datum:e?Za(e):null,x:e?.x,y:e?.y,chartType:r||"unknown",chartId:a,context:n})},[t,p,f,h,o,r,a,g,b,l,$,d]),S=Va((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&p.onHover(null),e&&d?.tapToSelect&&y.clear(),n&&l&&w(null),"x-position"===f?.mode&&(Xe(f.name||"hover",h),Ue(f.name||"hover",h))},[t,f,p,e,d,y,l,h]),C=Va((n,i)=>{const c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Ka(n,e,f.xField);null!=t&&function(e,t,n){const i=Ve.positions.get(e);if(i?.locked){const t=new Map(Ve.positions);return t.delete(e),Ve={positions:t},Ye(),!1}Ve={positions:new Map(Ve.positions).set(e,{xValue:t,sourceId:n,locked:!0})},Ye()}(f.name||"hover",t,h)}if(c)if(n){k.current=!0;const i=Za(n);if(t&&"x-position"!==f?.mode&&p.onHover(i),e&&d?.tapToSelect&&m.length>0){const e={};for(const t of m){const n=i[t];void 0!==n&&(e[t]=[n])}Qa(e)&&y.selectPoints(e)}if(l&&$){const e=i?.[$];w(null!=e?e+"":null)}}else u&&S();if(n||u){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}(o||g)&&fa({onObservation:b,datum:n?Za(n):null,x:n?.x,y:n?.y,chartType:r||"unknown",chartId:a,context:i})}},[s,o,g,b,r,a,f,h,d,t,p,e,y,m,l,$,S]);return Ua(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&S()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,S]),Ua(()=>()=>{k.current&&S(!1)},[S]),Ua(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{Xe(e,h),Ue(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:x,hoverSelectionHook:M,customHoverBehavior:A,customClickBehavior:C,crosshairSourceId:h}}function ss(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function ls(e,t,n){return function(e,t,n){const i=La[e||"primary"],o=e&&"primary"!==e||!n?.width?i.width:n.width,r=e&&"primary"!==e||!n?.height?i.height:n.height,a=ut({...t,mode:e},{width:t.width??o,height:t.height??r}).props,s=a.mode||e||"primary",l=La[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.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:Ia(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Ca(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}(e,t,n)}import{jsx as cs,jsxs as us}from"react/jsx-runtime";var ds={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};function hs(e,t="#4e79a7"){return N(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function fs(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function ms(e,t,n,i){const o=e.glyph;if(!o?.parts?.length||0>=e.size)return null;const r=C(o,e.size);if(0>=r.scale)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${r.offsetX},${r.offsetY}) scale(${r.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=S(o,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?fs(i+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>o.parts.map((n,i)=>{const o=t?"none"===n.fill?void 0:t:W(n.fill,s,e.accent),r=t?n.stroke&&"none"!==n.stroke?t:void 0:W(n.stroke??"none",s,e.accent);return o||r?cs("path",{d:n.d,fill:o??"none",stroke:r,strokeWidth:r?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},i):null});return us("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&cs("clipPath",{id:c,children:cs("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?cs("g",{children:d(e.ghostColor)}):null,l&&c?cs("g",{clipPath:`url(#${c})`,children:d()}):d()]},i)}function ys(e,t){const 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 2>n.length?null:n.map((e,t)=>cs("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function ps(e,t,n){const i=F(e.symbolType,e.size,e.path);return cs("path",{d:i,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?hs(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}import*as gs from"react";import{arc as bs}from"d3-shape";var xs=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)});function vs(e){const{innerRadius:t,outerRadius:n,startAngle:i,endAngle:o}=e,r=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(r){const e=xs(n,i),t=xs(n,o);return`M0,0 L${e.x},${e.y} A${n},${n} 0 ${o-i>Math.PI?1:0} 1 ${t.x},${t.y} Z`}const e=xs(n,i),a=xs(n,o),s=xs(t,o),l=xs(t,i),c=o-i>Math.PI?1:0;return`M${e.x},${e.y} A${n},${n} 0 ${c} 1 ${a.x},${a.y} L${s.x},${s.y} A${t},${t} 0 ${c} 0 ${l.x},${l.y} Z`}const a=Math.max(0,Math.min(e.cornerRadius??0,(n-t)/2));if(0===a)return vs({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const s=Math.asin(Math.min(1,a/Math.max(1e-9,n-a))),l=r?0:Math.asin(Math.min(1,a/Math.max(1e-9,t+a))),c=o-i,u=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&u>s,h=!!e.roundEnd&&u>s;if(!d&&!h)return vs({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});const f=i+(d?s:0),m=o-(h?s:0),y=i+(d?l:0),p=o-(h?l:0),g=xs(n,f),b=xs(n,m),x=(n-a)*Math.cos(s),v=xs(x,i),w=xs(x,o),k=r?null:xs(t,p),$=r?null:xs(t,y),M=r?0:(t+a)*Math.cos(l),A=r?null:xs(M,i),S=r?null:xs(M,o),C=m-f>Math.PI?1:0,L=r?0:p-y>Math.PI?1:0;let j="";if(d)j+=`M${v.x},${v.y}`,j+=` A${a},${a} 0 0 1 ${g.x},${g.y}`;else{const e=xs(n,i);j+=`M${e.x},${e.y}`}if(h)j+=` A${n},${n} 0 ${C} 1 ${b.x},${b.y}`,j+=` A${a},${a} 0 0 1 ${w.x},${w.y}`;else{const e=xs(n,o);j+=` A${n},${n} 0 ${C} 1 ${e.x},${e.y}`}if(r)j+=" L0,0";else{if(h)j+=` L${S.x},${S.y}`,j+=` A${a},${a} 0 0 1 ${k.x},${k.y}`;else{const e=xs(t,o);j+=` L${e.x},${e.y}`}if(d)j+=` A${t},${t} 0 ${L} 0 ${$.x},${$.y}`,j+=` A${a},${a} 0 0 1 ${A.x},${A.y}`;else{const e=xs(t,i);j+=` A${t},${t} 0 ${L} 0 ${e.x},${e.y}`}}return j+=" Z",j}function ws(e){const t=vs({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),n=[],i=e.colors;if(i.length>0){const t=(e.endAngle-e.startAngle)/i.length;for(let o=0;i.length>o;o++)n.push({d:vs({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+o*t,endAngle:e.endAngle}),color:i[o]})}return{clipPath:t,slices:n}}import{jsx as ks,jsxs as $s}from"react/jsx-runtime";function Ms(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function As(e,t){const n=e.datum;if(!n)return null;const i=[],o=n.__funnelStepLabel,r=Number(n.__funnelStepLabelX),a=Number(n.__funnelStepLabelY),s=Number(n.__funnelRowWidth);"string"!=typeof o||!Number.isFinite(r)||!Number.isFinite(a)||Number.isFinite(s)&&8.4*o.length+16>s||i.push(ks("text",{x:r,y:a+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-step"));const l=Number(n.__funnelValue),c=Number(n.__funnelValueLabelX),u=Number(n.__funnelValueLabelY),d=Number(n.__funnelBarW);if(Number.isFinite(l)&&0!==l&&Number.isFinite(c)&&Number.isFinite(u)&&d>=60){const e=Number(n.__funnelPercent);let o=!0!==n.__funnelIsFirstStep&&Number.isFinite(e)?`${Ms(l)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:Ms(l);7.8*o.length+16>d&&(o=Ms(l)),7.8*o.length+16>d||i.push(ks("text",{x:c,y:u+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:o},t+"-funnel-value"))}return i.length?ks("g",{children:i},t+"-funnel-labels"):null}function Ss(e,t,n){return Co(function(e,t,n){const i=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",o=n=>`ord-${e.type}-${i}-${t}-${n}`,r=`ord-${e.type}-${i}-${t}`;switch(e.type){case"rect":{const t=e,n=fs(r)+"-grad",i=function(e,t){const n=e.fillGradient;if(!n||"object"!=typeof n)return null;let i=e.x,o=e.y,r=e.x,a=e.y+e.h;"bottom"===e.roundedEdge?(o=e.y+e.h,a=e.y):"right"===e.roundedEdge?(i=e.x+e.w,o=e.y,r=e.x,a=e.y):"left"===e.roundedEdge&&(i=e.x,o=e.y,r=e.x+e.w,a=e.y);const s=ys(n.stops,hs(e.style.fill));return s?cs("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:i,y1:o,x2:r,y2:a,children:s}):null}(t,n);let o,a;if(i)a=`url(#${n})`;else if(N(t.style.fill)){const e=fs(r)+"-hatch";o=j(t.style.fill,e),a=`url(#${e})`}else a=hs(t.style.fill);const s=i||o?$s("defs",{children:[i,o]}):null;if(t.cornerRadii&&L(t.cornerRadii)){const e=function(e){const{x:t,y:n,w:i,h:o}=e,{tl:r,tr:a,br:s,bl:l}=M(e);let c=`M${t+r},${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+o-s}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t+i-s},${n+o}`),c+=` L${t+l},${n+o}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t},${n+o-l}`),c+=` L${t},${n+r}`,r>0&&(c+=` A${r},${r} 0 0 1 ${t+r},${n}`),c+=" Z",c}(t);return $s(gs.Fragment,{children:[s,ks("path",{d:e,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},r)}if(t.roundedTop&&t.roundedTop>0){const e=Math.min(t.roundedTop,t.w/2,t.h/2),{x:n,y:i,w:o,h:l}=t;let c;switch(t.roundedEdge){case"right":c=`M${n},${i} L${n+o-e},${i} A${e},${e} 0 0 1 ${n+o},${i+e} L${n+o},${i+l-e} A${e},${e} 0 0 1 ${n+o-e},${i+l} L${n},${i+l} Z`;break;case"left":c=`M${n+o},${i} L${n+e},${i} A${e},${e} 0 0 0 ${n},${i+e} L${n},${i+l-e} A${e},${e} 0 0 0 ${n+e},${i+l} L${n+o},${i+l} Z`;break;case"bottom":c=`M${n},${i} L${n+o},${i} L${n+o},${i+l-e} A${e},${e} 0 0 1 ${n+o-e},${i+l} L${n+e},${i+l} A${e},${e} 0 0 1 ${n},${i+l-e} Z`;break;default:c=`M${n},${i+l} L${n},${i+e} A${e},${e} 0 0 1 ${n+e},${i} L${n+o-e},${i} A${e},${e} 0 0 1 ${n+o},${i+e} L${n+o},${i+l} Z`}return $s(gs.Fragment,{children:[s,ks("path",{d:c,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth})]},r)}return $s(gs.Fragment,{children:[s,ks("rect",{x:t.x,y:t.y,width:t.w,height:t.h,fill:a,opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth}),As(t,r)]},r)}case"point":{const t=e;return ks("circle",{cx:t.x,cy:t.y,r:t.r,fill:hs(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},r)}case"symbol":return ps(e,t,n);case"glyph":return ms(e,e.x,e.y,`${n??""}ord-glyph-${e.pointId??t}`);case"wedge":{const i=e;if(i._gradientBand&&i._gradientBand.colors.length>0){const e=fs(`${n?n+"-":""}gauge-grad-${i.category||r}-${t}`),{clipPath:o,slices:a}=ws({innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,cornerRadius:i.cornerRadius,roundStart:i.roundedEnds?.start??!0,roundEnd:i.roundedEnds?.end??!0,colors:i._gradientBand.colors});return $s("g",{transform:`translate(${i.cx},${i.cy})`,opacity:i.style.opacity,fillOpacity:i.style.fillOpacity,children:[ks("defs",{children:ks("clipPath",{id:e,children:ks("path",{d:o})})}),ks("g",{clipPath:`url(#${e})`,children:a.map((e,t)=>ks("path",{d:e.d,fill:hs(e.color)},t))}),i.style.stroke&&"none"!==i.style.stroke&&ks("path",{d:o,fill:"none",stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},r)}let o;if(i.roundedEnds)o=vs({innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,cornerRadius:i.cornerRadius,roundStart:i.roundedEnds.start,roundEnd:i.roundedEnds.end});else{const e=bs().innerRadius(i.innerRadius).outerRadius(i.outerRadius).startAngle(i.startAngle+Math.PI/2).endAngle(i.endAngle+Math.PI/2);i.cornerRadius&&e.cornerRadius(i.cornerRadius),o=e(ds)||""}return ks("path",{d:o,transform:`translate(${i.cx},${i.cy})`,fill:hs(i.style.fill),stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,opacity:i.style.opacity},r)}case"boxplot":{const t=e,n=t.columnWidth/2,i=t.style.strokeWidth??1;return $s("g","vertical"===t.projection?{children:[ks("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("rect",{x:t.x-n,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:hs(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("line",{x1:t.x-n,y1:t.medianPos,x2:t.x+n,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*i}),ks("line",{x1:t.x-.5*n,y1:t.minPos,x2:t.x+.5*n,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("line",{x1:t.x-.5*n,y1:t.maxPos,x2:t.x+.5*n,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i})]}:{children:[ks("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-n,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:hs(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("line",{x1:t.medianPos,y1:t.y-n,x2:t.medianPos,y2:t.y+n,stroke:t.style.stroke||"#333",strokeWidth:2*i}),ks("line",{x1:t.minPos,y1:t.y-.5*n,x2:t.minPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:i}),ks("line",{x1:t.maxPos,y1:t.y-.5*n,x2:t.maxPos,y2:t.y+.5*n,stroke:t.style.stroke||"#333",strokeWidth:i})]},r)}case"violin":{const t=e,n=[ks("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:hs(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},o("path"))];if(t.iqrLine&&t.bounds){const e=t.bounds,i=e.x+e.width/2,r=e.y+e.height/2;t.iqrLine.isVertical?n.push(ks("line",{x1:i,y1:t.iqrLine.q1Pos,x2:i,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},o("iqr")),ks("circle",{cx:i,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},o("med"))):n.push(ks("line",{x1:t.iqrLine.q1Pos,y1:r,x2:t.iqrLine.q3Pos,y2:r,stroke:t.style.stroke||"#333",strokeWidth:2},o("iqr")),ks("circle",{cx:t.iqrLine.medianPos,cy:r,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},o("med")))}return ks("g",{children:n},r)}case"connector":{const t=e,n=t.style.fill&&"none"!==t.style.fill?hs(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";return ks("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||n,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},r)}case"trapezoid":{const t=e,n=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");return ks("polygon",{points:n,fill:hs(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},r)}default:return null}}(e,t,n),e,"ordinal-cursor-"+t)}export{Fn as EMPTY_ARRAY,Tn as filterSparseArray,Br as computeEasing,Hr as computeRawProgress,Gr as lerp,_r as now,T as DEFAULT_LIFECYCLE_THRESHOLDS,O as bandFromAge,P as resolveMotionAccessor,D as compileMotionEncoding,E as resolveMotionAge,B as opacityFromAge,H as resolveMotionVector,G as deriveMotionVector,On as isServerEnvironment,Bn as UpdateResultTracker,Zn as useSceneRevisionDiagnostics,Qn as runSceneBuild,Jn as SceneRevisionDiagnosticsObserver,Mt as composeLegendConfigs,Ct as clampLegendReservation,It as resolveLegendSideGutter,Tt as resolveXYAxisChrome,Ot as resolveXYFramePropsAxisChrome,Pt as resolveOrdinalAxisChrome,Bt as reserveLegendMargin,ti as renderLegendFromConfig,_ as annotationStableId,q as useAnnotationActivationOptions,Y as annotationActivationProps,U as isAnnotationActivationTarget,Q as estimateLabelWidth,J as AnnotationLabel,oi as ANNOTATION_DISCLOSURE_REVEAL_CSS,ui as renderAnnotationPass,Yi as createDefaultAnnotationRules,Ki as annotationType,Zi as isNoteAnnotation,Qi as annotationDrawsConnector,eo as annotationBudget,po as annotationLayout,Xe as unlockCrosshair,tt as useCrosshairPosition,bo as SVGChartTitle,ds as ARC_NOOP,hs as svgFill,fs as safeSvgId,ms as glyphNodeToSVG,ys as colorStopElements,ps as symbolSceneNodeToSVG,wo as sceneMarkCursor,ko as sceneHasAuthoredCursor,$o as setCanvasMarkCursor,Mo as syncCanvasMarkCursor,Ao as rehitCanvasMarkCursor,So as useCanvasMarkCursorCleanup,Co as withSceneMarkCursor,vs as annularSectorPath,ws as buildGaugeGradientGeometry,Ss as ordinalSceneNodeToSVG,zo as useHydration,Po as useWasHydratingFromSSR,Ho as DataSummaryProvider,Go as useDataSummary,_o as useDataSummaryToggle,Yo as AriaLiveTooltip,Qo as extractAllRows,lr as AccessibleTablePortal,cr as computeCanvasAriaLabel,ur as computeNetworkAriaLabel,Ar as AccessibleDataTable,Sr as NetworkAccessibleDataTable,Cr as ScreenReaderSummary,Lr as SkipToTableLink,Ir as FocusRing,ne as defaultTooltipStyle,ie as TooltipRoot,oe as markTooltipChrome,ae as hasOwnTooltipChrome,zr as FlippingTooltip,sn as useResponsiveSize,qr as createSeededFrameRandom,Qr as useFrame,Jr as subscribeToCanvasFontInvalidation,ea as syncCanvasSize,ta as prepareCanvas,na as getDevicePixelRatio,la as useFrameCanvasHost,ca as CanvasFrameBackground,fe as getPointerHitRadius,ye as buildHoverData,he as smartTooltipEntries,ve as Tooltip,we as MultiLineTooltip,ke as isMultiTooltip,$e as isMultiTooltipConfig,Me as resolveMultiCapableTooltip,Ae as resolveTooltipContent,Se as MultiPointTooltip,Ce as normalizeTooltip,ua as observationInputType,da as isInteractiveKeyboardTarget,ha as emitHoverObservations,fa as emitClickObservations,Ie as ChartError,Re as ChartErrorBoundary,pa as SafeRender,xa as renderEmptyState,va as renderLoadingState,wa as warnMissingField,De as CategoryColorProvider,Ee as useCategoryColors,ka as normalizeLinkedHover,$a as normalizeLinkedBrush,Ma as DEFAULT_SELECTION_OPACITY,Aa as wrapStyleWithSelection,nt as useSelection,it as useSelectionActions,ot as useLinkedHover,at as useBrushSelection,st as useFilteredData,ct as responsiveRuleMatches,ut as resolveResponsiveRules,Ca as resolveMobileInteraction,Na as resolveAxisFreeMarginDefaults,kt as resolveBoundedCategoryIndex,ht as useChartObserver,hn as useLinkedChartsActive,gn as useLinkedChartCategories,bn as useLinkedChartCategoryRegistryActive,kn as LinkedCharts,Ta as createLegend,Oa as distinctCategories,Da as useChartLegendAndMargin,Ha as useLegendInteraction,Ga as useGradientLegendInteraction,es as useThemeCategorical,ts as useThemeSequential,ns as useThemeDiverging,is as resolveDefaultFill,os as useColorScale,rs as useSortedData,as as useChartSelection,ss as getCrosshairProps,ls as useChartMode,$n as makeRuleValueResolver,Mn as makeXYRuleContext,An as makeNodeRuleContext,Cn as matchesThreshold,Ln as ruleMatches,jn as resolveStyleRules,Nn as composeStyleRules,In as makeStyleRuleStyleFn,Wn as styleRulesToNodeStyle,Rn as styleRulesToXYStyle,zn as styleRulesToPieceStyle};
@@ -1 +0,0 @@
1
- import{resolveCategoricalPalette as t,resolveExplicitColor as r}from"./c-EGR6VYBW.min.js";function e(r,e,n){return t(r,e,n)}function n(t,e){const n=e&&"object"==typeof e&&!Array.isArray(e)?e:void 0;return 0===t.length?t=>n&&r(n,t)||"#4e79a7":e=>{if(n){const t=r(n,e);if(t)return t}let o=0;for(let t=0;e.length>t;t++)o=31*o+e.charCodeAt(t)|0;return t[Math.abs(o)%t.length]??"#4e79a7"}}export{e as resolveCustomLayoutPalette,n as buildResolveColor};