semiotic 3.10.1 → 3.10.2

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 (346) hide show
  1. package/README.md +67 -62
  2. package/ai/artifact-surface-inventory.json +4 -1
  3. package/ai/dist/mcp-server.js +25 -24
  4. package/ai/examples.md +28 -0
  5. package/ai/reference.md +6 -1
  6. package/ai/schema.json +121 -5
  7. package/ai/surface-manifest.json +3 -2
  8. package/ai/task-packets/compare-category-totals.json +7 -53
  9. package/ai/task-packets/compare-category-totals.md +4 -4
  10. package/ai/task-packets/correct-published-chart.json +7 -53
  11. package/ai/task-packets/correct-published-chart.md +4 -4
  12. package/ai/task-packets/index.json +9 -9
  13. package/ai/task-packets/update-live-chart.json +8 -54
  14. package/ai/task-packets/update-live-chart.md +4 -4
  15. package/dist/c-27DCB5T6.min.js +18 -0
  16. package/dist/c-2MONF2P6.min.js +1 -0
  17. package/dist/c-2TW5H5PD.min.js +1 -0
  18. package/dist/c-3AGX252H.min.js +1 -0
  19. package/dist/c-3B6JZEZT.min.js +1 -0
  20. package/dist/c-3BYZXCX3.min.js +4 -0
  21. package/dist/c-3DIPZJDO.min.js +1 -0
  22. package/dist/c-3FOUMWLR.min.js +1 -0
  23. package/dist/c-3NA6I656.min.js +2 -0
  24. package/dist/c-3OFVBWQY.min.js +1 -0
  25. package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
  26. package/dist/c-3PPO7ZJF.min.js +4 -0
  27. package/dist/c-3YEW2PK6.min.js +1 -0
  28. package/dist/c-4JKDJUYD.min.js +1 -0
  29. package/dist/c-4LKK5YWB.min.js +1 -0
  30. package/dist/c-4MD53L2J.min.js +33 -0
  31. package/dist/c-4V3CD337.min.js +1 -0
  32. package/dist/c-4XLHPQTP.min.js +1 -0
  33. package/dist/c-5NYONM6V.min.js +5 -0
  34. package/dist/c-6IVBV5NO.min.js +1 -0
  35. package/dist/c-6ZU3QVLB.min.js +100 -0
  36. package/dist/c-72CBVNYX.min.js +209 -0
  37. package/dist/c-7APWCEPL.min.js +1 -0
  38. package/dist/c-7ASK4WBF.min.js +1 -0
  39. package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
  40. package/dist/c-7LY46QUI.min.js +41 -0
  41. package/dist/c-ABMGCCLT.min.js +1 -0
  42. package/dist/c-AINGQGUN.min.js +1 -0
  43. package/dist/c-AKLBQMQF.min.js +391 -0
  44. package/dist/c-AXJ2QI3F.min.js +1 -0
  45. package/dist/c-BQYD7T4E.min.js +1 -0
  46. package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
  47. package/dist/{c-J6DVC236.min.js → c-C4KIXUWU.min.js} +1 -1
  48. package/dist/c-C4SXYFXL.min.js +1 -0
  49. package/dist/c-CLDCKFBE.min.js +1 -0
  50. package/dist/c-CLJCJSFU.min.js +1 -0
  51. package/dist/c-CLLCX3PT.min.js +2 -0
  52. package/dist/c-ECHBKW7U.min.js +1 -0
  53. package/dist/c-EPJWM2UT.min.js +1 -0
  54. package/dist/c-F2GGJB2S.min.js +31 -0
  55. package/dist/c-FD2BXSRG.min.js +1 -0
  56. package/dist/c-FDUQDCBC.min.js +51 -0
  57. package/dist/c-FOTTQHOO.min.js +1 -0
  58. package/dist/c-FU7A5KSY.min.js +1 -0
  59. package/dist/c-G53AVC42.min.js +113 -0
  60. package/dist/c-GHN6IR4Y.min.js +1 -0
  61. package/dist/c-GSCO3FWL.min.js +1 -0
  62. package/dist/c-GYLOSK7M.min.js +1 -0
  63. package/dist/c-HK4OSLZA.min.js +1 -0
  64. package/dist/c-HLGTD5SJ.min.js +1 -0
  65. package/dist/c-HQ27AHMC.min.js +1 -0
  66. package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
  67. package/dist/c-IHWZ2C6D.min.js +26 -0
  68. package/dist/c-IIV73MUW.min.js +1 -0
  69. package/dist/c-IPYGNVN6.min.js +116 -0
  70. package/dist/c-JJKRER47.min.js +1 -0
  71. package/dist/c-JO6AYCU4.min.js +1 -0
  72. package/dist/c-JWHPG6S2.min.js +1 -0
  73. package/dist/c-JXVYIXTV.min.js +1 -0
  74. package/dist/c-K2ZIYDI3.min.js +1 -0
  75. package/dist/c-K37JAIWA.min.js +4 -0
  76. package/dist/c-KGROWFT2.min.js +9 -0
  77. package/dist/c-MOP2NGLH.min.js +1 -0
  78. package/dist/c-MTX2AO5S.min.js +1 -0
  79. package/dist/c-N5WT7TXG.min.js +1 -0
  80. package/dist/c-NATWERHZ.min.js +1 -0
  81. package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
  82. package/dist/c-OVQB75PE.min.js +1 -0
  83. package/dist/c-P3SKRNZN.min.js +1 -0
  84. package/dist/c-P5NXQWIM.min.js +1 -0
  85. package/dist/c-P7BQMVQQ.min.js +1 -0
  86. package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
  87. package/dist/c-PKY4JFY5.min.js +1 -0
  88. package/dist/c-PQOZPM4G.min.js +1 -0
  89. package/dist/c-PZ3NEGNG.min.js +1 -0
  90. package/dist/c-QXLDCATV.min.js +1 -0
  91. package/dist/c-R2HUSWKB.min.js +1 -0
  92. package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
  93. package/dist/c-RZPP5ERV.min.js +1 -0
  94. package/dist/c-SG2Y7EBY.min.js +46 -0
  95. package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
  96. package/dist/c-SQNEVNWT.min.js +1 -0
  97. package/dist/c-STHZWF3D.min.js +1 -0
  98. package/dist/c-TIDKVMMZ.min.js +1 -0
  99. package/dist/c-TIMGODBG.min.js +1 -0
  100. package/dist/c-TR7OHUAO.min.js +2 -0
  101. package/dist/c-TTKWXGAI.min.js +61 -0
  102. package/dist/c-TVKZC4BY.min.js +1 -0
  103. package/dist/c-U5XVLSHN.min.js +1 -0
  104. package/dist/c-U6NLVFN4.min.js +1 -0
  105. package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
  106. package/dist/c-UOPPO26M.min.js +1 -0
  107. package/dist/c-UUDAON4Z.min.js +1 -0
  108. package/dist/c-V32TPPY2.min.js +1 -0
  109. package/dist/c-V5KFJWQQ.min.js +1 -0
  110. package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
  111. package/dist/c-VXIYF7V2.min.js +1 -0
  112. package/dist/c-Y342FJ6K.min.js +1 -0
  113. package/dist/c-YM6CT4LJ.min.js +1 -0
  114. package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
  115. package/dist/c-YQVOKPKR.min.js +1 -0
  116. package/dist/c-YRJ3BJQZ.min.js +1 -0
  117. package/dist/c-YT5KPVNP.min.js +1 -0
  118. package/dist/components/ai/audienceProfile.d.ts +18 -1
  119. package/dist/components/ai/describeChart.d.ts +5 -1
  120. package/dist/components/ai/intentManifest.d.ts +16 -0
  121. package/dist/components/ai/intentRegistry.d.ts +12 -0
  122. package/dist/components/ai/intents.d.ts +6 -6
  123. package/dist/components/ai/streamSchema.d.ts +19 -0
  124. package/dist/components/ai/streamingTypes.d.ts +57 -11
  125. package/dist/components/ai/suggestCharts.d.ts +1 -1
  126. package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
  127. package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
  128. package/dist/components/ai/variantDiscovery.d.ts +1 -1
  129. package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
  130. package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
  131. package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
  132. package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
  133. package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
  134. package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
  135. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
  136. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
  137. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
  138. package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
  139. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
  140. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
  141. package/dist/components/charts/realtime/aggregate.d.ts +11 -1
  142. package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
  143. package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
  144. package/dist/components/charts/shared/directLabels.d.ts +12 -0
  145. package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
  146. package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
  147. package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
  148. package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
  149. package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
  150. package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
  151. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
  152. package/dist/components/charts/xy/LineChart.d.ts +4 -1
  153. package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
  154. package/dist/components/realtime/HyperLogLog.d.ts +19 -0
  155. package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
  156. package/dist/components/realtime/TDigest.d.ts +22 -0
  157. package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
  158. package/dist/components/realtime/applyChangelog.d.ts +38 -0
  159. package/dist/components/realtime/minHeap.d.ts +3 -0
  160. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +1 -1
  161. package/dist/components/recipes/layout1d.d.ts +2 -20
  162. package/dist/components/recipes/minGapPlacement.d.ts +20 -0
  163. package/dist/components/semiotic-ai-core.d.ts +8 -3
  164. package/dist/components/semiotic-ai-stream.d.ts +10 -0
  165. package/dist/components/semiotic-ai.d.ts +4 -6
  166. package/dist/components/semiotic-realtime-core.d.ts +6 -2
  167. package/dist/components/semiotic-stream-types.d.ts +14 -0
  168. package/dist/components/semiotic-xy.d.ts +1 -0
  169. package/dist/components/semiotic.d.ts +3 -11
  170. package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
  171. package/dist/components/server/rasterizeSVG.d.ts +2 -0
  172. package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
  173. package/dist/components/server/renderEvidence.d.ts +4 -0
  174. package/dist/components/server/serverChartConfigs.d.ts +5 -0
  175. package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
  176. package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
  177. package/dist/components/server/staticAnnotations.d.ts +9 -0
  178. package/dist/components/stream/SceneGraph.d.ts +3 -3
  179. package/dist/components/stream/StalenessBadge.d.ts +5 -2
  180. package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
  181. package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
  182. package/dist/components/stream/pipelineTransitions.d.ts +5 -35
  183. package/dist/components/stream/seriesGeometry.d.ts +2 -1
  184. package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
  185. package/dist/components/stream/types.d.ts +25 -2
  186. package/dist/components/text/axisLabelAssessment.d.ts +15 -0
  187. package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
  188. package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
  189. package/dist/components/text/labelMeasurement.d.ts +19 -0
  190. package/dist/components/text/labelPlacement.d.ts +71 -0
  191. package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
  192. package/dist/components/text/useLabelMeasurer.d.ts +3 -0
  193. package/dist/controls.module.min.js +71 -1
  194. package/dist/geo.min.js +231 -1
  195. package/dist/geo.module.min.js +31 -1
  196. package/dist/network.module.min.js +1 -1
  197. package/dist/ordinal.module.min.js +1 -1
  198. package/dist/physics-matter.module.min.js +1 -1
  199. package/dist/physics-rapier.module.min.js +1 -1
  200. package/dist/physics.module.min.js +1 -1
  201. package/dist/rough.min.js +2 -1
  202. package/dist/rough.module.min.js +2 -1
  203. package/dist/semiotic-access.module.min.js +1 -1
  204. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
  205. package/dist/semiotic-ai-core.d.ts +8 -3
  206. package/dist/semiotic-ai-core.min.js +4 -1
  207. package/dist/semiotic-ai-core.module.min.js +4 -1
  208. package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
  209. package/dist/semiotic-ai.d.ts +4 -6
  210. package/dist/semiotic-ai.module.min.js +14 -1
  211. package/dist/semiotic-artifact-react.min.js +269 -1
  212. package/dist/semiotic-artifact-react.module.min.js +137 -1
  213. package/dist/semiotic-artifact.min.js +3 -1
  214. package/dist/semiotic-artifact.module.min.js +3 -1
  215. package/dist/semiotic-atlas-core.min.js +2 -1
  216. package/dist/semiotic-atlas-core.module.min.js +1 -1
  217. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  218. package/dist/semiotic-atlas.module.min.js +11 -1
  219. package/dist/semiotic-client-cjs-shared.min.js +1529 -1
  220. package/dist/semiotic-client-glyph.module.min.js +3 -1
  221. package/dist/semiotic-client-responsive.module.min.js +1 -1
  222. package/dist/semiotic-client-shared.module.min.js +1 -1
  223. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
  224. package/dist/semiotic-data.min.js +1 -1
  225. package/dist/semiotic-data.module.min.js +1 -1
  226. package/dist/semiotic-evidence.min.js +3 -1
  227. package/dist/semiotic-evidence.module.min.js +3 -1
  228. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
  229. package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
  230. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  231. package/dist/semiotic-experimental-vacp.min.js +1 -1
  232. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  233. package/dist/semiotic-line.module.min.js +1 -1
  234. package/dist/semiotic-realtime-core.d.ts +6 -2
  235. package/dist/semiotic-realtime-core.module.min.js +1 -1
  236. package/dist/semiotic-realtime-react.module.min.js +1 -1
  237. package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
  238. package/dist/semiotic-recipes-core.module.min.js +72 -1
  239. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  240. package/dist/semiotic-recipes-react.min.js +3 -1
  241. package/dist/semiotic-server-edge-node.module.min.js +391 -1
  242. package/dist/semiotic-server-edge.min.js +651 -1
  243. package/dist/semiotic-server-edge.module.min.js +372 -1
  244. package/dist/semiotic-server-node.min.js +651 -1
  245. package/dist/semiotic-server-node.module.min.js +1 -1
  246. package/dist/semiotic-text.min.js +1 -1
  247. package/dist/semiotic-text.module.min.js +1 -1
  248. package/dist/semiotic-themes-core.min.js +1 -1
  249. package/dist/semiotic-themes-core.module.min.js +1 -1
  250. package/dist/semiotic-themes.min.js +1 -1
  251. package/dist/semiotic-themes.module.min.js +1 -1
  252. package/dist/semiotic-utils-core.min.js +11 -1
  253. package/dist/semiotic-utils-core.module.min.js +8 -1
  254. package/dist/semiotic-value.module.min.js +15 -1
  255. package/dist/semiotic-xy.d.ts +1 -0
  256. package/dist/semiotic.d.ts +3 -11
  257. package/dist/semiotic.module.min.js +10 -1
  258. package/dist/server.min.js +651 -1
  259. package/dist/server.module.min.js +1 -1
  260. package/dist/xy.module.min.js +1 -1
  261. package/package.json +4 -3
  262. package/dist/c-2N7IU2NY.min.js +0 -1
  263. package/dist/c-2RL2QPZJ.min.js +0 -1
  264. package/dist/c-2WK7YJLL.min.js +0 -1
  265. package/dist/c-45CQWZZ6.min.js +0 -1
  266. package/dist/c-4BRHKVKV.min.js +0 -1
  267. package/dist/c-7242NXSG.min.js +0 -1
  268. package/dist/c-7DVPSB5C.min.js +0 -1
  269. package/dist/c-7EGHJU2F.min.js +0 -1
  270. package/dist/c-A7OGOFSL.min.js +0 -1
  271. package/dist/c-AFBSWT77.min.js +0 -1
  272. package/dist/c-AH5HWZWS.min.js +0 -1
  273. package/dist/c-AJ7EC32V.min.js +0 -1
  274. package/dist/c-AQADQNY7.min.js +0 -1
  275. package/dist/c-ATM475SA.min.js +0 -1
  276. package/dist/c-AVO3Q7T7.min.js +0 -1
  277. package/dist/c-B7GW7IHJ.min.js +0 -1
  278. package/dist/c-BNFJMDHN.min.js +0 -1
  279. package/dist/c-BOHCQILI.min.js +0 -1
  280. package/dist/c-C3TZLTZK.min.js +0 -1
  281. package/dist/c-CGQAQWBV.min.js +0 -1
  282. package/dist/c-CPV4N35K.min.js +0 -1
  283. package/dist/c-DIPEYUOW.min.js +0 -1
  284. package/dist/c-E4JDJH4I.min.js +0 -1
  285. package/dist/c-E72OTUZU.min.js +0 -1
  286. package/dist/c-E7I2L7CU.min.js +0 -1
  287. package/dist/c-ELDWAO2V.min.js +0 -1
  288. package/dist/c-EUBTECGM.min.js +0 -1
  289. package/dist/c-EUMPMDCS.min.js +0 -1
  290. package/dist/c-EZZT2WAE.min.js +0 -1
  291. package/dist/c-FHBVFCQB.min.js +0 -1
  292. package/dist/c-G4HCO2IQ.min.js +0 -1
  293. package/dist/c-G5VIJEOK.min.js +0 -1
  294. package/dist/c-GHVOXAYH.min.js +0 -1
  295. package/dist/c-GXV3C3MO.min.js +0 -1
  296. package/dist/c-HHTK2R75.min.js +0 -1
  297. package/dist/c-HLLFJYTY.min.js +0 -1
  298. package/dist/c-HP4ZFM47.min.js +0 -1
  299. package/dist/c-HPOYKCCG.min.js +0 -1
  300. package/dist/c-HYDTS5OP.min.js +0 -1
  301. package/dist/c-I4QJ6YLM.min.js +0 -1
  302. package/dist/c-IK33LNZ6.min.js +0 -1
  303. package/dist/c-IK3PZHRY.min.js +0 -1
  304. package/dist/c-JIMJF6F6.min.js +0 -1
  305. package/dist/c-JUKIWTBJ.min.js +0 -1
  306. package/dist/c-KKPMHAZC.min.js +0 -1
  307. package/dist/c-L6WNDBHV.min.js +0 -1
  308. package/dist/c-LDEX5OFW.min.js +0 -1
  309. package/dist/c-LESEUVC5.min.js +0 -1
  310. package/dist/c-LYQMZMZQ.min.js +0 -1
  311. package/dist/c-MB6CV5NC.min.js +0 -1
  312. package/dist/c-MOKJOIPE.min.js +0 -1
  313. package/dist/c-N3FXLRNT.min.js +0 -1
  314. package/dist/c-N5NPTJVJ.min.js +0 -1
  315. package/dist/c-NHBL4J67.min.js +0 -1
  316. package/dist/c-ODG6TFSY.min.js +0 -1
  317. package/dist/c-PRIKOLTE.min.js +0 -1
  318. package/dist/c-PSKKFZNP.min.js +0 -1
  319. package/dist/c-PSNI6KAZ.min.js +0 -1
  320. package/dist/c-QAVFOEUY.min.js +0 -1
  321. package/dist/c-R2P4RR7Q.min.js +0 -1
  322. package/dist/c-RFC7UAG7.min.js +0 -1
  323. package/dist/c-S3AZX5PP.min.js +0 -1
  324. package/dist/c-SGAURYHG.min.js +0 -1
  325. package/dist/c-SJMWU6UX.min.js +0 -1
  326. package/dist/c-STIIGQOD.min.js +0 -1
  327. package/dist/c-T2ASIJVZ.min.js +0 -1
  328. package/dist/c-T2V7O2LO.min.js +0 -1
  329. package/dist/c-TKG2NP7G.min.js +0 -1
  330. package/dist/c-TX3THUTO.min.js +0 -1
  331. package/dist/c-TX7XJM3Z.min.js +0 -1
  332. package/dist/c-UC7SIU2W.min.js +0 -1
  333. package/dist/c-UMXSJIOV.min.js +0 -1
  334. package/dist/c-VRSXMLYF.min.js +0 -1
  335. package/dist/c-VSLWSAN2.min.js +0 -1
  336. package/dist/c-VXLOLYTO.min.js +0 -1
  337. package/dist/c-W4ZUKSEQ.min.js +0 -1
  338. package/dist/c-WCBRPILW.min.js +0 -1
  339. package/dist/c-WGHT7OCY.min.js +0 -1
  340. package/dist/c-WWCW3APR.min.js +0 -1
  341. package/dist/c-XSB27XPS.min.js +0 -1
  342. package/dist/c-Y6PYUMFU.min.js +0 -1
  343. package/dist/c-YDECTEUW.min.js +0 -1
  344. package/dist/c-YF3YKVQI.min.js +0 -1
  345. package/dist/c-YLZIV3VS.min.js +0 -1
  346. package/dist/c-ZIVPFTOC.min.js +0 -1
@@ -1 +1,8 @@
1
- function e(e){return Object.prototype.hasOwnProperty.call($i,e)?$i[e]:void 0}function t(e){let t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,a)=>{t["--semiotic-category-"+(a+1)]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);let a=e.typography.legendSize??e.typography.labelSize;null!=a&&(t["--semiotic-legend-font-size"]=a+"px"),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");let r=e.typography.titleFontSize??e.typography.titleSize;return null!=r&&(t["--semiotic-title-font-size"]=r+"px"),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),t}function a(e,a=":root"){return`${a} {\n${Object.entries(t(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function r(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:(e.typography.titleFontSize??e.typography.titleSize)+"px",$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function i(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>s(t(e))}function o(e,t){let a=i(e),r=i(t);return(e,t)=>{let i=r(e);return{value:i,x:a(e),y:i,category:t}}}function n(e,t){let a=i(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=r?r(e):void 0;return{value:a(e),category:null==t?void 0:t+""}}}function s(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function l(e,t,a){let r=null!=e.axis?a[e.axis]:null!=e.field?t[e.field]:a.value;if(void 0!==e.eq&&r!==e.eq||void 0!==e.ne&&r===e.ne||void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let i=s(r);if(void 0===i||void 0!==e.gt&&e.gt>=i||void 0!==e.gte&&e.gte>i||void 0!==e.lt&&i>=e.lt||void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){let[t,a]=e.within;if(t>i||i>a)return!1}if(void 0!==e.outside){let[t,a]=e.outside;if(i>=t&&a>=i)return!1}return!0}function c(e,t,a){let r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,a):l(r,t,a))}function u(e,t,a){if(!t||0===t.length)return{};let r={};for(let i of t){if(!c(i,e,a))continue;let t="function"==typeof i.style?i.style(e,a):i.style;t&&(r={...r,...t})}return r}function d(e,t,a,r=e=>e){let i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{let n=r(e),s={...i(e,o)};return Object.assign(s,u(n,t,a(n,o))),s}:i}function h(e,t,a){return e&&0!==e.length?(r,i)=>{let o=u(r,e,t(r,i)),n=a?a(r,i):void 0;return n?{...o,...n}:o}:a}function p(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;let[r,i,o]=[parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255],n=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*n(r)+.7152*n(i)+.0722*n(o)}function m(e,t){let a=p(e),r=p(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}function f(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),a=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(a){let e=a.length>4?a:a.split("").map(e=>`${e}${e}`).join("");return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let r=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!r)return null;let i=[Number(r[1]),Number(r[2]),Number(r[3])],o=void 0===r[4]?1:Number(r[4]);return i.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(o)||0>o||o>1?null:{r:i[0],g:i[1],b:i[2],a:o}}function y(e,t){return 1>t.a?null:{r:f(e.r*e.a+t.r*(1-e.a)),g:f(e.g*e.a+t.g*(1-e.a)),b:f(e.b*e.a+t.b*(1-e.a)),a:1}}function b(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>f(e).toString(16).padStart(2,"0")).join("")}function v(e,t,a){let r=g(e),i=g(t);if(!r||!i)return null;let o=y({...r,a:r.a*Math.min(1,Math.max(0,a))},i);return o?b(o):null}function w(e){let t=g(e.backgroundColor),a=t?b(t):null,r=v(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=r&&a?m(r,a):null,o=e.dataColors.map(t=>v(t,e.backgroundColor,1)).map(e=>e&&a?m(e,a):null).filter(e=>null!==e);if(null===i||o.length!==e.dataColors.length||0===o.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};let n=Math.min(...o),s=n/i,l={weakestDataContrast:n,scaffoldContrast:i,hierarchyRatio:s},c=Math.max(1,e.minimumScaffoldContrast??1.1);return c>i?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:3>n||i>Math.max(c,e.maximumScaffoldContrast??2)||Math.max(1,e.minimumHierarchyRatio??2)>s?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}:{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}}function A(e){return Math.min(1,Math.max(0,e))}function x(e,t){return Number.isFinite(e)?e:t}function $(e){return function(e){if("string"!=typeof e||""===e.trim())return;let t=g(e);return t?b(t)??`rgba(${f(t.r)},${f(t.g)},${f(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function C(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map($).filter(e=>!!e)}function S(e){return Array.isArray(e)||e&&"object"==typeof e?C(e):[]}function k(e){return e.length>=4&&Pi.some(t=>e.length===t.length&&e.every((e,a)=>e===t[a]))}function R(e,t){let a=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(a.map(e=>e[t]+""))):"function"==typeof t?Array.from(new Set(a.map((e,a)=>t(e,a)+""))):[]}function P(e,t){if(!e.evidence)return.5;let{weakestDataContrast:a,scaffoldContrast:r,hierarchyRatio:i}=e.evidence;return Math.min(A(a/3),A(r/t.scaffoldContrastMin),A(t.scaffoldContrastMax/r),A(i/t.hierarchyRatio))}function I(e,t,a,r,i,o,n){let s=a[e];return{id:e,label:Ei[e],status:0===s?"disabled":n??(.8>t?"warn":"pass"),score:t,weight:s,contribution:t*s,message:r,...o?.[e]?{rationale:o[e]}:{},evidence:i}}function N(e,t,a={}){let r=a.theme??bi,i=a.profile??r.aesthetics??ki,o={...Ci,...i.weights??{}};for(let e of Object.keys(o)){let t=o[e];o[e]=Number.isFinite(t)?Math.max(0,t):0}let n=function(e){let t=e.thresholds??{},a=Math.max(1,x(t.scaffoldContrastMin,Si.scaffoldContrastMin)),r=A(x(t.emphasisRatioMin,Si.emphasisRatioMin));return{hierarchyRatio:Math.max(1,x(t.hierarchyRatio,Si.hierarchyRatio)),scaffoldContrastMin:a,scaffoldContrastMax:Math.max(a,x(t.scaffoldContrastMax,Si.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,x(t.titleScaleRatio,Si.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(x(t.categoricalColorMax,Si.categoricalColorMax))),emphasisRatioMin:r,emphasisRatioMax:Math.max(r,A(x(t.emphasisRatioMax,Si.emphasisRatioMax)))}}(i),s=function(e,t,a){let r=S(t.colorScheme),i=C(t.color),o=R(t,t.colorBy),n=Ni.has(e)?R(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,l=(e,t)=>e.map((e,r)=>$(s?.[e])??("gray"===t?"#999999":a.colors.categorical.length>0?a.colors.categorical[r%a.colors.categorical.length]:"#007bff")),u=o.length>0?s?l(o,"gray"):r.length>0?r:a.colors.categorical:i.length>0?i:n.length>0&&s?l(n,"theme"):r.length>0&&!s?r:a.colors.categorical,d=u.slice(0,o.length>0||n.length>0?Math.min(u.length,Math.max(1,o.length||n.length||1)):1),h=function(e){let t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[],r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",o=[];for(let e of a)!e.style||"function"==typeof e.style||t.some((t,a)=>c(e,t,{value:Number(t[r]),category:(t[i]??"")+"",index:a}))&&o.push(...C(e.style.fill));return Array.from(new Set(o))}(t).filter(e=>!d.includes(e));return Array.from(new Set([...d,...h]))}(e,t,r),l=function(e){let t=e.colors.surface??e.colors.background,a=g(t),r=g(e.colors.background);if(!a)return t;if(1===a.a)return b(a)??t;if(!r)return t;let i=y(a,r);return i?b(i)??t:t}(r),u=w({backgroundColor:l,dataColors:s,scaffoldColor:r.colors.grid,minimumHierarchyRatio:n.hierarchyRatio,minimumScaffoldContrast:n.scaffoldContrastMin,maximumScaffoldContrast:n.scaffoldContrastMax}),d=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...S(e.colorScheme),...C(e.color),...C(e.fill),...C(e.stroke),...C(t?.fill),...C(t?.stroke)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of r)!e.style||"function"==typeof e.style||a.push(...C(e.style.fill),...C(e.style.stroke));return Array.from(new Set(a))}(t),h=k(r.colors.categorical.map($).filter(e=>!!e)),p=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...S(e.colorScheme),...C(e.color),...C(e.fill),...C(t?.fill)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of r)!e.style||"function"==typeof e.style||a.push(...C(e.style.fill));return Array.from(new Set(a))}(t),m="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,f=p.length>0||m?"chart":"theme",v="chart"===f?k(p)||!!m&&Ii.has(m):h,N=v?.2:"chart"===f?1:.8,E=function(e){return Math.max(1,e.length)}(s),M=E>n.categoricalColorMax?A(1-(E-n.categoricalColorMax)/n.categoricalColorMax):1,T=r.typography.titleFontSize??r.typography.titleSize,O=Math.max(r.typography.tickSize,r.typography.labelSize),F=O>0?T/O:1,j=A((F-1)/(n.titleScaleRatio-1)),z=new Set([...r.colors.categorical,r.colors.primary,r.colors.secondary,r.colors.background,r.colors.surface,r.colors.text,r.colors.textSecondary,r.colors.grid,r.colors.border,r.colors.annotation].map($).filter(e=>!!e)),B=d.filter(e=>!z.has(e)).length,L=0===d.length?1:A(1-B/d.length),_=function(e){let t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===a.length)return{ratio:0,authored:!1};let r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>a.some(a=>c(a,e,{value:Number(e[r]),category:(e[i]??"")+"",index:t}))).length/t.length,authored:!0}}(t),D=_.authored?n.emphasisRatioMin>_.ratio?A(_.ratio/n.emphasisRatioMin):_.ratio>n.emphasisRatioMax?A(n.emphasisRatioMax/_.ratio):1:.35,U=[I("mark-scaffold-hierarchy",P(u,n),o,u.finding.message,{hierarchyRatio:u.evidence?.hierarchyRatio??0,markContrast:u.evidence?.weakestDataContrast??0,scaffoldContrast:u.evidence?.scaffoldContrast??0},i.rationales,u.status),I("palette-authorship",N,o,v?"theme"===f?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:f,ubiquitousDefault:v,colorCount:s.length},i.rationales),I("palette-economy",M,o,`${E} color role(s) are used against a policy ceiling of ${n.categoricalColorMax}.`,{colorRoles:E,maximum:n.categoricalColorMax},i.rationales),I("typographic-hierarchy",j,o,`Title-to-supporting-type scale is ${F.toFixed(2)}×.`,{titleSize:T,supportingSize:O,ratio:F},i.rationales),I("theme-coherence",L,o,`${B} of ${d.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:d.length,outsideTheme:B},i.rationales),I("editorial-emphasis",D,o,_.authored?Math.round(100*_.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:_.authored,emphasizedRatio:_.ratio},i.rationales)],V=U.reduce((e,t)=>e+t.weight,0),G=U.reduce((e,t)=>e+t.contribution,0),q=0===V?null:G/V*100,H=100*A(x(i.minimumScore,ki.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===q||q>=H,score:q,minimumScore:H,weightedPoints:G,totalWeight:V,features:U,method:"weighted-machine-visible-features"}}function E(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return e+"";if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}function M(e){return 10>e?"0"+e:e+""}function T(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function O(e,t={}){let a,r=e,i=(o=function(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}(t),"utc"===o.kind?e=>T(e,!0):"local"===o.kind?e=>T(e,!1):function(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>T(e,!0)}return e=>{let a={};for(let r of t.formatToParts(e))"literal"!==r.type&&(a[r.type]=r.value);return{month:Math.max(0,(Number(a.month)||1)-1),day:Number(a.day)||1,year:Number(a.year)||1970,hours:Number(a.hour)||0,minutes:Number(a.minute)||0,seconds:Number(a.second)||0}}}(o.id));var o;return(t,o,n)=>{let s=t instanceof Date?t:new Date(t);!e&&n&&n.length>=2&&n!==a&&(a=n,r=function(e){if(2>e.length)return"days";let t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);let a=t[Math.floor(t.length/2)];return 12e4>a?"seconds":72e5>a?"minutes":2*Ti>a?"hours":60*Ti>a?"days":400*Ti>a?"months":"years"}(n));let l=r||"days";return null!=o&&0!==o&&n&&0!==n.length?function(e,t,a,r){let i=r(e),o=r(t),n=i.year!==o.year,s=n||i.month!==o.month,l=s||i.day!==o.day,c=l||i.hours!==o.hours,u=c||i.minutes!==o.minutes,d=Oi[i.month],{day:h,year:p}=i,m=M(i.hours),f=M(i.minutes),g=M(i.seconds);switch(a){case"seconds":return n?`${d} ${h}, ${p} ${m}:${f}:${g}`:l?`${d} ${h} ${m}:${f}:${g}`:c?`${m}:${f}:${g}`:u?`${f}:${g}`:":"+g;case"minutes":return n?`${d} ${h}, ${p} ${m}:${f}`:l?`${d} ${h} ${m}:${f}`:c?`${m}:${f}`:":"+f;case"hours":return n?`${d} ${h}, ${p} ${m}:00`:s?`${d} ${h} ${m}:${f}`:l?`${d} ${h} ${m}:00`:m+":00";case"days":return n?`${d} ${h}, ${p}`:s?`${d} ${h}`:""+h;case"months":return n?`${d} ${p}`:""+d;case"years":return""+p}}(s,new Date(n[o-1]),l,i):function(e,t,a){let{month:r,day:i,year:o,hours:n,minutes:s,seconds:l}=a(e),c=Oi[r],u=M(n),d=M(s),h=M(l);switch(t){case"seconds":return`${c} ${i}, ${o} ${u}:${d}:${h}`;case"minutes":case"hours":return`${c} ${i}, ${o} ${u}:${d}`;case"days":return`${c} ${i}, ${o}`;case"months":return`${c} ${o}`;case"years":return""+o}}(s,l,i)}}function F(e,t=0,a=1/0,r=0){let i=Number.isFinite(t)?t:0,o=Number.isFinite(a)?Math.max(i,a):1/0,n=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,n));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function j(e,t=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;let r=Math.round(parseInt(a[1],16)*(1-t)),i=Math.round(parseInt(a[2],16)*(1-t)),o=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function z(e,t=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;let r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),i=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function B(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}function L(e={},t){let a,{background:r="transparent",stroke:i="#000",lineWidth:o=1.5,spacing:n=6,angle:s=45}=e,l={background:r,stroke:i,lineWidth:o,spacing:n,angle:s},c=Math.max(8,Math.ceil(2*n));try{a=function(e){return"u">typeof OffscreenCanvas?new OffscreenCanvas(e,e):(Fi||(Fi=document.createElement("canvas")),Fi.width=e,Fi.height=e,Fi)}(c)}catch{return B(l)}let u=a.getContext("2d");if(!u)return B(l);r&&"transparent"!==r?(u.fillStyle=r,u.fillRect(0,0,c,c)):u.clearRect(0,0,c,c),u.strokeStyle=i,u.lineWidth=o,u.lineCap="square";let d=s*Math.PI/180;if(45===s||-45===s){let e=s>0?1:-1;for(let t=-c;2*c>=t;t+=n)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*c,c),u.stroke()}else{u.save(),u.translate(c/2,c/2),u.rotate(d);let e=2*c;for(let t=-e;e>=t;t+=n)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(a,"repeat")}function _(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function D(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function U(e,t){let a=2166136261,r=D(t);for(let e=0;r.length>e;e++)a^=r.charCodeAt(e),a=Math.imul(a,16777619);return`${e}-hatch-${(a>>>0).toString(36)}`}function V(e,t){let a=e.length,r=t.length,i=Array(r+1);for(let e=0;r>=e;e++)i[e]=e;for(let o=1;a>=o;o++){let a=i[0];i[0]=o;for(let n=1;r>=n;n++){let r=i[n];i[n]=e[o-1]===t[n-1]?a:1+Math.min(a,i[n],i[n-1]),a=r}}return i[r]}function G(e,t,a=3){let r,i=a+1;for(let a of t){let t=V(e.toLowerCase(),a.toLowerCase());i>t&&(i=t,r=a)}return i>a?void 0:r}function q(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function H(e,t){if(0===t.length)return null;let a=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(a)||a.includes(e.toLowerCase()))||(G(e,t,3)??null)}function W(e){return` Or use a function: ${e}={d => d.myValue}.`}function Y(e){let[t,a]=Array.isArray(e)?e:[e,void 0],r=Bi[t],i=Array.isArray(r)?[...r]:r;return void 0===a?{type:i}:{type:i,enum:[...Li[a]]}}function K(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function J(e,t){let a=[];(null==t||"object"!=typeof t)&&(t={});let r=Di[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(Di).join(", ")}`]};for(let i of r.required)null==t[i]&&a.push(`"${i}" is required for ${e}.`);"array"===r.dataShape&&Object.prototype.hasOwnProperty.call(r.props,"data")&&!r.required.includes("data")&&!function(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}(e,t)&&null==t.data&&a.push(`"data" is required for ${e}.`);for(let[e,i]of Object.entries(t)){if(null==i)continue;let t=r.props[e];if(t){if(!K(i,t.type)){let r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(i)?"array":typeof i}.`);continue}t.enum&&"string"==typeof i&&!t.enum.includes(i)&&a.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}let i=Object.keys(r.props),o=new Set(i);for(let r of Object.keys(t))if(void 0!==t[r]&&!o.has(r)){let t=G(r,i),o=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${i.join(", ")}.`;a.push(o)}if("array"===r.dataShape){let i=t.data,o={};for(let e of r.dataAccessors){let a=t[e];"string"==typeof a&&(o[e]=a)}let n=function({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(let[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(a){let r=q(t).find(e=>e&&"object"==typeof e);if(r){let t=Object.keys(r);for(let[i,o]of Object.entries(a))if(o&&"string"==typeof o&&!(o in r)){let a=H(o,t),r=a?` Try ${i}="${a}".`:"";return`${e}: ${i} "${o}" not found in data. Available fields: ${t.join(", ")}.${r}`+W(i)}}}return null}({componentName:e,data:i,accessors:Object.keys(o).length>0?o:void 0});n&&a.push(n)}else if("object"===r.dataShape){let r=function({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){let i=t.nodeIdAccessor??t.nodeIDAccessor??"id",o="string"==typeof i?{nodeIdAccessor:i}:void 0,n=function({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:i=!0,accessors:o}){if(null==t&&null==a)return null;if(i&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(o&&t&&t.length>0){let a=q(t).find(e=>e&&"object"==typeof e);if(a){let t=Object.keys(a);for(let[r,i]of Object.entries(o))if(i&&"string"==typeof i&&!(i in a)){let a=H(i,t),o=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${i}" not found in node data. Available fields: ${t.join(", ")}.${o}`+W(r)}}}return null}({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges"),accessors:o});n&&a.push(n)}return"GaugeChart"===e&&a.push(...function(e){if(!Array.isArray(e.thresholds))return[];let t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,a)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${a}]" for GaugeChart should be an object with numeric "value" and string "color".`);let r=e;("number"!=typeof r.value||!Number.isFinite(r.value))&&t.push(`"thresholds[${a}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),("string"!=typeof r.color||0===r.color.length)&&t.push(`"thresholds[${a}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==r.label&&"string"!=typeof r.label&&t.push(`"thresholds[${a}].label" for GaugeChart should be a string.`);let i=Object.keys(r).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${a}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&a.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),a.push(...function(e){let t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];let a=t.legendLayout;if(null==a||"object"!=typeof a||Array.isArray(a))return null==a?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(a)?"array":typeof a)+"."];let r=[],i=a,o=new Set(["align",...Object.keys(Vi)]);for(let e of Object.keys(i))o.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...o].join(", ")}.`);void 0!==i.align&&"string"!=typeof i.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(i.align)?"array":typeof i.align}.`):"string"==typeof i.align&&!Ui.has(i.align)&&r.push(`"frameProps.legendLayout.align" value "${i.align}" is not valid. Expected one of: ${[...Ui].join(", ")}.`);for(let[e,t]of Object.entries(Vi)){let a=i[e];void 0!==a&&("number"==typeof a&&Number.isFinite(a)?t.minimum>a&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${a}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(a)?"array":typeof a}.`))}return r}(t)),{valid:0===a.length,errors:a}}function X(e){return null==e?null:e.data??e.datum??e}function Z(e,t={}){let a=[],r=e.tokenSemantics,i=e.countStrategy,o=t.maxRecommendedTokens??("fixed-denominator"!==i||function(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}(e.denominator)>100?80:100);return r||a.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||a.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),("icon"===e.tokenType||"glyph"===e.tokenType)&&("icon-only"===e.labelPolicy||"token-only"===e.labelPolicy)&&a.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>o&&a.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"===r&&("icon"===e.tokenType||"glyph"===e.tokenType)&&a.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===r&&i&&"unitized"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===r&&i&&"fixed-denominator"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),("possible-outcome"===r||"posterior-sample"===r||"hypothetical-case"===r)&&i&&"quantile"!==i&&"sample"!==i&&"posterior-sample"!==i&&"random-sample"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===r&&"unitized"===i&&null==e.unitValue&&null==e.unit&&a.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"===r&&"unitized"===i&&!e.unitMeaning&&a.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),a}function Q(e){return"string"==typeof e?.type?e.type:""}function ee(e){return!!e&&"object"==typeof e&&po.has(Q(e))}function te(e){return mo.has(Q(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function ae(e){let t=e.provenance,a=e.id??e.stableId??t?.stableId;return null==a||""===a?void 0:a+""}function re(e,t,a){return"function"==typeof a?a(e,t):e[a]}function ie(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function oe(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 ne(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),a=t.length?t:["Intake"],r=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),i=function(e){let t=ie(e);return null!=t&&t>0?t:1}(e.unitValue),o=oe(e.seed??1),n=e.idPrefix??"mechanical-pile",s=a.map(()=>.65+.9*o()),l=s.reduce((e,t)=>e+t,0)||1,c=r-a.length,u=s.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),h=r-d.reduce((e,t)=>e+t,0),p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return a.map((e,t)=>({id:`${n}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/r}))}function se(e,t,a=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),i=new Map;for(let o of e){let e=null==o.id?`${t}-${a++}`:o.id+"";for(;null==o.id&&r.has(e);)e=`${t}-${a++}`;r.add(e),i.set(e,null==o.id?{...o,id:e}:o)}return{seed:e,rows:Array.from(i.values()),nextId:a}}function le(e){let t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function ce(e,t,a){return"function"==typeof t?t(e):e?.["string"==typeof t?t:a]}function ue(e,t){let a=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof a?a:e.defaultNestedDataAccessor}function de(e,t,a){let r=e.dataProp??"data",i=t[r],o=a??(Array.isArray(i)?i:[]),n=ue(e,t);if(!n)return{dataProp:r,rows:o};let s=[],l=!1;for(let e of o){let t=e?.[n];if(Array.isArray(t)){l=!0;for(let e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:r,rows:l?s:o}}function he(e,t,a){let r={numbers:a?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let a of e){let e,i=a?.[t];if(null!=i&&""!==i){if("number"==typeof i)e=i;else if("string"==typeof i){let t=i.trim();if(""===t){r.missing++;continue}let a=Number(t);Number.isNaN(a)?/^[+-]?nan$/i.test(t)&&(e=a):e=a}void 0!==e?Number.isFinite(e)?(r.numbers?.push(e),r.finite++,r.min>e&&(r.min=e),e>r.max&&(r.max=e),0===e&&r.zero++,0>e&&r.negative++,Number.isInteger(e)||r.fractional++):r.nonFinite++:r.nonNumeric++}else r.missing++}return r}function pe(e,t){if(0===e.length)return;let a=(e.length-1)*t,r=Math.floor(a),i=Math.ceil(a);if(r===i)return e[r];let o=a-r;return e[r]*(1-o)+e[i]*o}function me(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let a=new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))a.add(e);let r={};for(let i of a){let a=he(e,i,!1!==t.quantiles),o=a.numbers?.sort((e,t)=>e-t);r[i]={field:i,observedCount:e.length-a.missing,finiteCount:a.finite,missingCount:a.missing,nonFiniteCount:a.nonFinite,nonNumericCount:a.nonNumeric,zeroCount:a.zero,negativeCount:a.negative,fractionalCount:a.fractional,...a.finite>0?{min:a.min,...o?{q1:pe(o,.25),median:pe(o,.5),q3:pe(o,.75)}:{},max:a.max}:{}}}return r}function fe(e){let t=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(let a of e.diagnoses)t.push(`${"error"===a.severity?"ERROR":"WARN"} ${a.code}${a.field?` [${a.field}]`:""}: ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function ge(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function ye(e,t={}){let a=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,r=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=r.slice(0,a).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${ge(e)} · ${e.field}`:ge(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return r.length>a&&i.push({id:"data-audit:overflow:chart",level:r.slice(a).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${r.length-a} more numeric finding${r.length-a===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function be(e,t,a){return"function"==typeof e?e(t,a):t[e]}function ve(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){let a=e.getTime();return t&&Number.isFinite(a)?a:null}if("string"==typeof e){let a=e.trim(),r=Number(a);if(a&&Number.isFinite(r))return r;if("date-like"===t){let e=function(e){let t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;let a=go.test(t)?t+"-01":t;if(a===t&&10>t.length)return NaN;let r=Date.parse(a);return Number.isFinite(r)?r:NaN}(a);return Number.isFinite(e)?e:null}}return null}function we(e){return"number"==typeof e&&!Number.isFinite(e)}function Ae(e,t,a,r,i){let o={field:a,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let a=0;e.length>a;a++){let n;try{n=be(t,e[a],a)}catch{o.accessorErrorRows.push(a);continue}if(null==n||""===n){if(void 0!==i){o.numbers.push(i),o.finiteRows.push(a),0===i&&o.zeroRows.push(a),0>i&&o.negativeRows.push(a),Number.isInteger(i)||o.fractionalRows.push(a);continue}o.missingRows.push(a);continue}let s=ve(n,r);null!=s?(o.numbers.push(s),o.finiteRows.push(a),0===s&&o.zeroRows.push(a),0>s&&o.negativeRows.push(a),Number.isInteger(s)||o.fractionalRows.push(a)):we(n)?o.nonFiniteRows.push(a):o.nonNumericRows.push(a)}return o}function xe(e,t){let a=new Set(e.requirements??["finite"]);return a.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&a.add("positive"),[...a]}function $e(e){return e.slice(0,5)}function Ce(e){return{domain:"data",...e}}function Se(e,t){let a=[],{observation:r,contract:i,accessorLabel:o,requirements:n}=e,s={field:o,role:i.role},l=[...r.nonFiniteRows,...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(0===r.numbers.length)return a.push(Ce({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${o}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${o} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...l.length>0?{rows:$e(l),count:l.length}:{}})),a;r.nonFiniteRows.length>0&&a.push(Ce({severity:"error",code:"NON_FINITE_VALUE",message:`${o} contains ${r.nonFiniteRows.length} NaN or infinite value${1===r.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${o} before rendering.`,...s,rows:$e(r.nonFiniteRows),count:r.nonFiniteRows.length})),!i.allowMissing&&r.missingRows.length>0&&a.push(Ce({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${o} is missing for ${r.missingRows.length} row${1===r.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${o} values before rendering.`,...s,rows:$e(r.missingRows),count:r.missingRows.length}));let c=[...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(c.length>0&&a.push(Ce({severity:"error",code:"NON_NUMERIC_VALUE",message:`${o} produces ${c.length} non-numeric value${1===c.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:$e(c),count:c.length})),i.domain&&r.numbers.length>=2){let[e,t]=function(e){let t=1/0,a=-1/0;for(let r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}(r.numbers);e===t&&a.push(Ce({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${o} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:$e(r.finiteRows),count:r.finiteRows.length}))}if(n.includes("positive")){let t=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(t.length>0){let r=e.logScale;a.push(Ce({severity:"error",code:r?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${o} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${r?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:r?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:$e(t),count:t.length}))}}if(n.includes("non-negative")&&r.negativeRows.length>0&&a.push(Ce({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${o} contains ${r.negativeRows.length} negative ${i.role} value${1===r.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:$e(r.negativeRows),count:r.negativeRows.length})),n.includes("integer")){let e=[...new Set([...r.negativeRows,...r.zeroRows,...r.fractionalRows])].sort((e,t)=>e-t);e.length>0&&a.push(Ce({severity:"error",code:"INVALID_COUNT",message:`${o} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:$e(e),count:e.length}))}if(n.includes("unit-interval")){let e=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&a.push(Ce({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${o} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${o} to [0, 1] before using it as ${i.role}.`,...s,rows:$e(e),count:e.length}))}if(t&&i.domain){let t=function(e){let t=e.observation.numbers.map((t,a)=>({value:t,row:e.observation.finiteRows[a]})).sort((e,t)=>e.value-t.value);if(8>t.length)return[];let a=t.map(e=>e.value),r=pe(a,.25),i=pe(a,.75),o=pe(a,.5),n=i-r;if(n>0){let e=r-10*n,a=i+10*n;return t.filter(t=>e>t.value||t.value>a).map(e=>e.row)}let s=100*Math.max(1,Math.abs(o));return t.filter(e=>Math.abs(e.value-o)>s).map(e=>e.row)}(e);t.length>0&&a.push(Ce({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${o} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:$e(t),count:t.length}))}return a}function ke(e,t,a){if(!e)return"__all__";try{return be(e,t,a)+""}catch{return"__accessor_error__"}}function Re(e,t,a){if(e.whenProp&&!0!==a[e.whenProp])return[];let r=t.find(t=>t.contract.role===e.role);if(!r||0===r.observation.numbers.length)return[];let i=e.groupAccessor?a[e.groupAccessor]:void 0,o="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,n=new Map;for(let e=0;r.rows.length>e;e++){let t;try{t=be(r.accessor,r.rows[e],e)}catch{continue}let a=ve(t,void 0);if(null==a)continue;let i=ke(o,r.rows[e],e),s=n.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=a,s.magnitude+=Math.abs(a),s.positive||(s.positive=a>0),s.negative||(s.negative=0>a),s.rows.push(e),0>a&&s.negativeRows.push(e),n.set(i,s)}let s=[],l=[],c=[],u=[],d=[],h=[];for(let[t,a]of n)("positive-total"===e.kind&&0>=a.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,a.magnitude)*10>=Math.abs(a.sum))&&(s.push(t),u.push(...a.rows)),"normalized-total"===e.kind&&a.positive&&a.negative&&(l.push(t),d.push(...a.rows)),"normalized-total"===e.kind&&a.negative&&(c.push(t),h.push(...a.negativeRows));let p=[];return s.length>0&&p.push(Ce({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:r.accessorLabel,role:e.role,rows:$e([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),c.length>0&&p.push(Ce({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${c.length} normalization group${1===c.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:r.accessorLabel,role:e.role,rows:$e([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),l.length>0&&p.push(Ce({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${l.length} normalization group${1===l.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:r.accessorLabel,role:e.role,rows:$e([...new Set(d)].sort((e,t)=>e-t)),count:l.length})),p}function Pe(e,t,a,r={}){let i=r.contracts??function(e){return function(){let e=globalThis;return e[Eo]??(e[Eo]={contracts:new Map}),e[Eo]}().contracts.get(e)??No[e]}(e)??function(e){let t=[];for(let[a,r]of Object.entries(Mo))"string"!=typeof e[a]&&"function"!=typeof e[a]||t.push({role:r,accessor:a,..."size"===r?{requirements:["finite","non-negative"]}:{},..."x"===r||"y"===r?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}(t);if(!i)return{component:e,ok:!0,rowCount:a?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};let o=function(e,t,a){let r=[],i=new Set;for(let o of e.fields){if(o.whenProps?.some(e=>null==t[e]))continue;let e=t[o.accessor],n="string"==typeof e||"function"==typeof e?e:o.defaultAccessor;if("string"!=typeof n&&"function"!=typeof n)continue;let{dataProp:s,rows:l}=de(o,t,a);if(0===l.length)continue;let c="string"==typeof n?n:o.accessor+"()",u=`${s}:${o.role}:${c}`;if(i.has(u))continue;i.add(u);let d=o.temporalValues??("time"===o.role||"x"===o.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===o.role&&"log"===t.xScaleType||"y"===o.role&&"log"===t.yScaleType,p=xe(o,t);r.push({contract:o,accessor:n,accessorLabel:c,dataProp:s,rows:l,requirements:p,logScale:h,observation:Ae(l,n,c,d,o.missingValue)})}return r}(i,t,a),n=[],s=!1!==r.checkOutliers;for(let e of function(e,t,a){let r=new Set;for(let i of e.fields){let e=i.dataProp??"data",o=a??t[e];if(!Array.isArray(o))continue;if(0===o.length){r.add(e);continue}let n=ue(i,t);if(!n)continue;let s=o.map(e=>e?.[n]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&r.add(`${e}.${n}`)}return[...r]}(i,t,a))n.push(Ce({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));let l=new Set(o.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(let e of l)n.push(Ce({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(let e of o)n.push(...Se(e,s));for(let e of i.aggregates??[])n.push(...Re(e,o,t));let c=n.filter(e=>"error"===e.severity).length,u=n.length-c;return{component:e,ok:0===c,rowCount:o.reduce((e,t)=>Math.max(e,t.rows.length),a?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:o.length,errors:c,warnings:u},contracts:o.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:n}}function Ie(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function Ne(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Ee(e,t){let a=Ne(e.visibleTokens);if(null!=a)return a;let r=Ne(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=r)return r;let i=Ne(t.tokenCount),o=Ne(t.maxTokens);return null!=i&&null!=o?Math.min(i,o):i??r??o}function Me(e,t){let a=t.match(/^Unknown prop "([^"]+)"/);if(a)return`Remove \`${a[1]}\` or replace it with a documented ${e} prop.`;let r=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return r?`Add the required \`${r[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Te(e,t){let a=[],r=()=>({ok:a.every(e=>"warning"===e.severity),diagnoses:a}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),o=i?[]:J(e,function(e){let t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Ie(t.encoding)&&delete t.encoding,t}(t)).errors;if(i){"function"!=typeof t.layout&&o.push("Provide a layout function.");let a="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(let e of a)null!=t[e]&&!Array.isArray(t[e])&&o.push(`Provide an array for ${e}.`)}for(let r of o)"BigNumber"===e&&void 0!==t.accessibleTable&&r.startsWith('Unknown prop "accessibleTable"')||a.push({severity:"error",code:"VALIDATION",message:r,fix:i?r:Me(e,r)});if("BigNumber"===e&&function(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}(t,a),(i||Di[e])&&(function(e,t){for(let[a,r]of[["width",600],["height",400]]){let i=e[a];void 0!==i&&("number"!=typeof i||0>=i)&&t.push({severity:"error",code:"width"===a?"BAD_WIDTH":"BAD_HEIGHT",message:`${a}=${JSON.stringify(i)} — chart needs a positive number.`,fix:`Set ${a}={${r}}.`})}if(e.size&&Array.isArray(e.size)){let[a,r]=e.size;(null!=a&&0>=a||null!=r&&0>=r)&&t.push({severity:"error",code:"BAD_SIZE",message:`size=[${a}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}(t,a),function(e,t){let a=e.width??600,r=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;let o=(i.left||0)+(i.right||0),n=(i.top||0)+(i.bottom||0);o>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${o}px) >= width (${a}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),n>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${n}px) >= height (${r}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}(t,a),function(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(let e of r)!e||"object"!=typeof e||"widget"!==Q(e)||null==e.content||ae(e)||a.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}(0,t,a)),!Di[e])return r();(function(e,t,a){let r=Di[e];if(r){if("array"===r.dataShape){let e=t.data;e&&Array.isArray(e)&&0===e.length&&a.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}})(e,t,a),function(e,t,a){let r=Di[e];if(!r||"array"!==r.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let o=i[0];if(!o||"object"!=typeof o)return;let n=Object.keys(o);for(let e of r.dataAccessors){let r=t[e];"string"==typeof r&&(r in o||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${n.join(", ")}.`,fix:`Change ${e} to one of: ${n.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}(e,t,a),function(e,t,a){qi.has(e)&&Array.isArray(t.data)&&a.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}(e,t,a),function(e,t,a){Hi.has(e)&&!t.edges&&!t.data&&a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'})}(e,t,a),function(e,t,a){let r=Di[e];if(!r||"array"!==r.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let o=i[0];if(!o||"object"!=typeof o)return;let n=t.xAccessor;"string"==typeof n&&o[n]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${n}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}(e,t,a),function(e,t,a){t.linkedHover&&!t.selection&&a.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}(0,t,a),function(e,t,a){if(!Wi.has(e))return;let r=t.rExtent||t.yExtent||t.valueExtent;r&&Array.isArray(r)&&r.length>=1&&null!=r[0]&&0!==r[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${r[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${r[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}(e,t,a),function(e,t,a){if(!Yi.has(e)||t.gapStrategy)return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=t.yAccessor||"y";"string"==typeof i&&r.some(e=>{let t=e[i];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}(e,t,a);let n=Pe(e,t,void 0,{checkOutliers:!1}).diagnoses;for(let e of n)"EMPTY_DATA"===e.code&&a.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||a.push(e);if(function(e,t,a){if(!Ki.has(e))return;let r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}(e,t,a),function(e,t,a){if("Heatmap"!==e)return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=r[0];if(i&&"object"==typeof i)for(let e of["xAccessor","yAccessor"]){let r=t[e];if("string"!=typeof r)continue;let o=i[r];"string"==typeof o&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}(e,t,a),function(e,t,a){let r=t.colorScheme;if(!r||!Array.isArray(r))return;let i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;let o=[];for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=m(e,i);null!==t&&3>t&&o.push(`${e} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${o.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${o.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}(0,t,a),function(e,t,a){let r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;let i=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>i.length)return;let o=[];for(let e=0;i.length-1>e;e++){let t=m(i[e],i[e+1]);null!==t&&1.5>t&&o.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${o.length} adjacent color pair(s) in colorScheme have very similar luminance: ${o.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}(0,t,a),function(e,t,a){let r=t.colorScheme;"string"!=typeof r||Di[e]?.props?.colorScheme?.enum||To.has(r)||a.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${r}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...To].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}(e,t,a),function(e,t,a){let r=Di[e]?.props,i=e=>!!r?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,o=i("title"),n=i("description"),s=i("summary");!o&&!n&&!s&&a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}(e,t,a),function(e,t,a){let r=[];for(let e of Oo)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}(0,t,a),function(e,t,a){let r=t.hoverRadius;"number"==typeof r&&r>0&&24>r&&!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick)&&a.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${r}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}(0,t,a),function(e,t,a){!0===t.responsiveWidth&&!0===t.responsiveHeight&&a.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}(0,t,a),function(e,t,a){if(!0!==t.showParticles)return;let r=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof r.maxPerLine?r.maxPerLine:void 0,o="number"==typeof r.spawnRate?r.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof o&&o>.08)&&a.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}(0,t,a),function(e,t,a){let r=[];Ie(t.tokenEncoding)&&r.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Ie(t.encoding)&&r.push({source:"encoding",encoding:t.encoding});for(let{source:e,encoding:i}of r){let r=Ee(t,i);for(let t of Z(i,{visibleTokens:r}))a.push({severity:"warning",code:"TOKEN_"+t.code,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}(0,t,a),function(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(let e of r){if(!e||"object"!=typeof e)continue;let t=Q(e);if(!ee(e)||"widget"===t)continue;let r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,o=te(e);!o&&r>120?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${i}" sits ~${Math.round(r)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):o&&r>250&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${i}" uses a very long connector (~${Math.round(r)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}(0,t,a),function(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;let i=r.filter(ee).length;if(0===i)return;let o="number"==typeof t.width?t.width:600,n="number"==typeof t.height?t.height:400,s=function(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:2e4))):1/0}(o,n);!Number.isFinite(s)||s>=i||a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${o}×${n} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}(0,t,a),function(e,t,a){for(let e of fo){let r=t[e];if(!Array.isArray(r)||2>r.length)continue;let[i,o]=r;"number"!=typeof i||"number"!=typeof o||i>o&&a.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${o}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${o}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}(0,t,a),function(e,t,a){if("MultiAxisLineChart"!==e)return;let r=t.series;if(!Array.isArray(r)||2!==r.length)return;let i=r.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&a.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}(e,t,a),function(e,t,a){if(!Yi.has(e))return;let r=t.xExtent;if(!Array.isArray(r)||2>r.length)return;let[i,o]=r;if("number"!=typeof i||"number"!=typeof o||i>=o)return;let n=t.data;if(!n||!Array.isArray(n)||4>n.length)return;let s=t.xAccessor??"x";if("string"!=typeof s)return;let l=1/0,c=-1/0;for(let e of n){let t=e?.[s];"number"!=typeof t||!Number.isFinite(t)||(l>t&&(l=t),t>c&&(c=t))}if(!Number.isFinite(l)||!Number.isFinite(c)||l>=c)return;let u=c-l,d=Math.max(0,Math.min(o,c)-Math.max(i,l))/u;.7>d&&a.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${o}] shows only ~${Math.round(100*d)}% of the data's x range [${l}, ${c}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}(e,t,a),a.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||function(e,t,a){let r=Zi[e],i=eo[e];if(!r&&!i||i&&!t.normalize)return;let o=r??i,n=t[o],s="string"==typeof n?n:"yAccessor"===o?"y":"value",l=t.data;if(!l||!Array.isArray(l)||0===l.length)return;let c=l.filter(e=>{let t=e?.[s];return"number"==typeof t&&0>t});c.length>0&&a.push({severity:r?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${c.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${r?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:r?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}(e,t,a),function(e,t,a){Ji.has(e)&&"basis"===t.curve&&a.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}(e,t,a),function(e,t,a){if("LineChart"!==e&&"AreaChart"!==e||"sparkline"===t.mode||t.responsiveWidth||t.responsiveHeight)return;let r="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(0>=r||0>=i)return;let o=r/i;if(o>8||.25>o){let e=o>8?"flattens":"exaggerates";a.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${r}×${i} (${o.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:o>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}(e,t,a),function(e,t,a){if(!Xi.has(e))return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=t.categoryAccessor,o="string"==typeof i?i:"category",n=new Set;for(let e of r){let t=e?.[o];null!=t&&n.add(t)}n.size>8&&a.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:n.size+" slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.",fix:`Use a BarChart or DotPlot for ${n.size} categories, or group the long tail into an "Other" slice before charting.`})}(e,t,a),function(e,t,a){if(so.has(e)){if("GaltonBoardChart"===e){let e=t.bins;"number"==typeof e&&2>e&&a.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});let r=le(t.branchProbability);null!=t.branchProbability&&(null==r||0>r||r>1)&&a.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${t.branchProbability+""} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});let i=le(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||0>=i)&&a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){let e=t.windows,r=e&&"object"==typeof e?le(e.size):null;null!=r&&0>=r&&a.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${r} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&0>=t.timeScale&&a.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});let i=Array.isArray(t.data)?t.data:[];if(i.length>0){let e=t.timeAccessor||"time",r=t.arrivalAccessor||"arrivalTime";i.some(t=>{let a=le(ce(t,e,"time")),i=le(ce(t,r,"arrivalTime"));return null!=a&&null!=i&&a!==i})||a.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){let e="mechanical"===(t.simulationMode??t.mode),r=le(t.mechanicalCount);null!=t.mechanicalCount&&(null==r||0>=r)&&a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&a.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});let i=ie(t.unitValue??1);if(null==i||0>=i)return void a.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});let o=e?ne({count:r??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:ie(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:n}=se(o,"pile"),s=t.valueAccessor??(e?"value":void 0),l=n.reduce((e,t,a)=>{let r="function"==typeof s?s(t,a):"string"==typeof s&&s?t[s]:1;return e+function(e,t){let a=e/t,r=Math.round(a);return Math.ceil(r>0&&Number.EPSILON*a*4>=Math.abs(a-r)?r:a)}(Math.max(0,ie(r)??0),i)},0);l>1500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${l} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if(0>=(le(t.pointRadius??5)??5)&&a.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),0>=(le(t.collisionIterations??6)??6)&&a.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){let e=Array.isArray(t.xExtent)?t.xExtent:[],r=le(e[0]),i=le(e[1]);(2>e.length||null==r||null==i)&&a.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}let e=Array.isArray(t.data)?t.data:[];e.length>1200&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});let r=t.groupAccessor;if(e.length>0&&r){let t=new Set;for(let a of e){let e=ce(a,r,"group");null!=e&&t.add(e)}t.size>12&&a.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if(("GaltonBoardChart"===e||"UnitPileChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e)&&(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&a.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:e+" appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.",fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),("UnitPileChart"===e||"GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"CrucibleChart"===e)&&!1===t.showProjection&&a.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:e+" has showProjection={false}. Without a settled projection, motion is easy to over-read as data.",fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){let e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)a.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===(e.id+"").trim())&&a.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});let r=e.filter(e=>e?.absorb).length;t.groupBy&&0===r&&a.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||a.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){let e=Array.isArray(t.phases)?t.phases:[],r=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],o=Array.isArray(t.outlets)?t.outlets:[];0===e.length?a.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===(e.id+"").trim()||null==le(e.duration)||0>=Number(e.duration))&&a.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===r.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||a.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});let n=new Set(r.map(e=>e?.id).filter(e=>null!=e).map(String)),s=new Set(["product","retained","residue","failed","recovered",...o.map(e=>e?.id).filter(e=>null!=e).map(String)]),l=new Set,c=new Set;for(let e of i)if(e&&Array.isArray(e.effects))for(let t of e.effects){if(!t||"object"!=typeof t)continue;let e=t.type;if(("combine"===e||"contribute"===e||"complete-product"===e)&&null!=t.productId&&!n.has(t.productId+"")&&l.add(t.productId+""),"split"===e&&Array.isArray(t.products))for(let e of t.products)null!=e?.productId&&!n.has(e.productId+"")&&l.add(e.productId+"");null!=t.outletId&&!s.has(t.outletId+"")&&c.add(t.outletId+"")}l.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...l].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),c.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...c].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});let u=le(t.playbackRate);null!=t.playbackRate&&(null==u||0>=u)&&a.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${t.playbackRate+""} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});let d=le(t.rerunMS);null!=t.rerunMS&&(null==d||0>d)&&a.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${t.rerunMS+""} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){let r=Array.isArray(t.data)?t.data:[],i=le(t.mechanicalCount)??0,o=r.length>0?r.length:i;o>2500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(o)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}(e,t,a),"ProcessSankey"===e)for(let e of function(e){let t=[],a=e.domain;null==a?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):(!Array.isArray(a)||2!==a.length||!Number.isFinite(Number(a[0]))||!Number.isFinite(Number(a[1])))&&t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});let r=e.edges;if(Array.isArray(r)&&r.length>0){let e=r[0];(null==e.startTime||null==e.endTime)&&t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}let i=e.nodes,o=Array.isArray(i)?i.length:0;return!0===e.showLabels&&o>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${o} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(r)?r.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}(t))a.push(e);return r()}function Oe(e){return"string"==typeof e&&e.trim().length>0}function Fe(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function je(e,t){return`${e}[Symbol(${t.description??""})]`}function ze(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let a=Number(e);return Number.isSafeInteger(a)&&a>=0&&t>a}function Be(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function Le(e,t,a,r){let i=Be(e,t);return i&&"value"in i&&i.enumerable?_e(i.value,a,r):[a]}function _e(e,t="$",a=new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(a.has(e))return[t];let r,i,o;try{o=Array.isArray(e),r=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(r!==(o?Array.prototype:Object.prototype)&&null!==r)return[t];a.add(e);let n=[];try{if(o){let r=Be(e,"length")?.value;if(!Number.isSafeInteger(r)||0>r)return[Fe(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&ze(e,r)||n.push("symbol"==typeof e?je(t,e):Fe(t,e));for(let i=0;r>i;i+=1)n.push(...Le(e,i+"",Fe(t,i),a))}else for(let r of i)"symbol"!=typeof r?n.push(...Le(e,r,Fe(t,r),a)):n.push(je(t,r));return n}catch{return[t]}finally{a.delete(e)}}function De(){let e=globalThis;return e[Lo]||(e[Lo]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[Lo]}function Ue(e){return De().recipes.get(e)}function Ve(e){let t=De().layouts.get(e)?.identity;return t?{...t}:void 0}function Ge(e){return"string"==typeof e?Ue(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function qe(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=function(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}(e)}function He(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;let a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function We(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function Ye(e,t,a={}){let r=[],i=Ue(e),o=io.has(e),n=!!Di[e]||!!i||o,s=!0===a.inChartContainer,l=!0===a.describe,c=!0===a.navigable,u=to.has(e),d=qi.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:g}=function(e,t,a){let r=Di[e]?.props,i=jo.has(e)||void 0!==a&&zo.has(a),o=e=>!!r?.[e]||i,n=Fo.filter(e=>Oe(t[e])&&!o(e));return{hasTitle:o("title")&&Oe(t.title),hasDescription:o("description")&&Oe(t.description),hasSummary:o("summary")&&Oe(t.summary),unsupportedFinding:n.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${n.join(" and ")} text was supplied, but ${1===n.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}(e,t,i?.frameFamily),y=!1!==t.accessibleTable&&!u,b=h||p||f,v=function(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}(t),w=function(e){let t=We(e),a=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===a.pause||"function"==typeof a.pause}(t),A=o,x=function(e){let t=We(e);return!0===e.settledProjection||!0===t.settledProjection}(t)||no.has(e)&&y,$=function(e){let t=We(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}(t)||A,C=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],S=n?"pass":"manual",k=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(g&&r.push(g),r.push(function(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return{...t,status:"manual",message:`Background "${r}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=r??"#ffffff";if(!Array.isArray(a))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let o=[],n=0;for(let e of a){if("string"!=typeof e||!e.startsWith("#"))continue;let t=m(e,i);null!=t&&(n++,3>t&&o.push(`${e} (${t.toFixed(1)}:1)`))}return 0===n?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:o.length>0?{...t,status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${i}: ${o.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${n} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}(t)),r.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:y?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),r.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),r.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||oo.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){let e=!0===t.directLabel||!0===t.showLabels,a=function(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;let t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;let a=t.fill;return"object"==typeof a&&null!==a&&"hatch"===a.type})}(t);r.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:a?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:a?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=function(e){if(!Array.isArray(e))return!1;let t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>Bo.has(e))}(t.colorScheme);r.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:a?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:a?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=C.filter(ee);if(e.length>0){let a=t.autoPlaceAnnotations,i="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=Q(e),a=i&&"text"===t;return!(te(e)||a)});r.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}r.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{let e=[];(null!=t.brush||null!=t.onBrush)&&e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&e.push("legend filtering"),e.length>0&&r.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let a=ho[e];if(a&&v){let e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:S,message:`The chart takes a single tab stop and navigates data with arrow keys${k} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...v?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:S,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${k}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:S,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${k}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...b?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),r.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{let e=[t.description,t.summary].filter(Oe).join(". "),a=e?function(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(let e of a)r+=He(e);return a.length/t.length*.39+r/a.length*11.8-15.59}(e):null;r.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(a))} (≤ 9).`}})}if(ao.has(e)){let e=Oe(t.xLabel),a=Oe(t.yLabel);r.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(co.has(e)&&r.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),C.length>1){let e=C.filter(qe).length;r.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===C.length?{status:"pass",message:`All ${C.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:C.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${C.length-e} of ${C.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&r.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:S,message:`Transitions animate with object constancy and data changes are mirrored to the live region${k}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),r.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:S,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${k}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:y?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||r.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":k}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:S,message:`Keyboard navigation steps through points and switches series/groups${k}.`,fix:n?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let a,i=Array.isArray(t.data)?t.data:null,o=Array.isArray(t.nodes)?t.nodes:null,n={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};a=Qi.has(e)&&i&&i.length>7?{...n,status:"warn",message:i.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:o&&o.length>200?{...n,status:"warn",message:o.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:i&&i.length>5e3?{...n,status:"warn",message:i.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:i?{...n,status:"pass",message:i.length+" data points — a reasonable density for non-visual consumption."}:o?{...n,status:"pass",message:o.length+" nodes — a reasonable density for non-visual consumption."}:{...n,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},r.push(a)}{let e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!a)for(let t of e.slice(0,50))if(t&&"object"==typeof t){for(let e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){i=!0;break}if(i)break}i&&r.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}r.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),r.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:y?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:S,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${k}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...oo.has(e)||lo.has(e)?w?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:S,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${k}.`}}),o&&(r.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...w?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),r.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...x?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),r.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...$?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{let a=!0===t.responsiveWidth||!0===t.responsiveHeight,i=uo.has(e)&&!0===t.zoomable;r.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...a?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&r.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:i.name+" declares a color encoding without a redundant cue.",fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"===i.accessibility.description&&!p&&r.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:i.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&r.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:i.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let R=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),P={criticalsPassed:R.filter(e=>"pass"===e.status).length,criticalsEvaluated:R.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!R.some(e=>"fail"===e.status),summary:P,findings:r,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function Ke(e,{onlyCritical:t=!1}={}){let a=[];for(let r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a}function Je(e){let t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(let a of Do){let r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(let e of r)t.push(` ${_o[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),e.fix&&("fail"===e.status||"warn"===e.status||"manual"===e.status)&&t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Xe(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ze(e,t,a){return{id:`${t}.${e.code.toLowerCase()}.${a+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Qe(e,t){let a=e.filter(e=>"manual"!==e.severity),r=a.slice(0,t).map(e=>({id:"chart-evaluation-"+e.id,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${Xe(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return a.length>t&&r.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:a.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),r}function et(e){let t=[`${e.component}: ${e.ok?"PASS":"ISSUES FOUND"}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(let a of e.findings)t.push(`${a.rank}. [${a.stage}/${a.code}] ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function tt(e,t={},a,r={}){let i=void 0===a?t:{...t,data:a},o=J(e,i),n=Pe(e,i,a,r.dataAudit),s=Te(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=Ye(e,i,{inChartContainer:r.inChartContainer,describe:r.describe,navigable:r.navigable}),c=[];for(let[e,t]of o.errors.entries())c.push({id:"validation."+(e+1),stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});n.diagnoses.forEach((e,t)=>{c.push(Ze(e,"data",t))}),s.forEach((e,t)=>{c.push(Ze(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{c.push(function(e,t){return{id:e.id||"accessibility."+(t+1),stage:"accessibility",severity:"fail"===e.status?"error":"warn"===e.status?"warning":"manual",code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}(e,t))});let u,d=c.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(r.render&&o.valid&&!d)try{u=r.render(e,i).evidence,c.push(...function(e,t){let a=[];e.component!==t&&a.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(let t of function(e){let{contract:t,transfer:a,binding:r}=e;if(void 0===t&&void 0===a&&void 0===r)return[];let i=[],o=Array.isArray(r?.mismatchPaths)?r.mismatchPaths.filter(e=>"string"==typeof e):[];return a&&"preserved"!==a.status&&"excluded"!==a.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${a.status}; its contract cannot be relied on for publication.`}):(!a||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===r?.status||o.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(o.length?": "+o.join(", "):".")}):("match"!==r?.status||!Array.isArray(r.mismatchPaths)||!Array.isArray(r.unknownPaths)||r.mismatchPaths.length>0||r.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))a.push({id:"render."+t.id,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&a.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});let r=new Set;for(let t of function(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[Uo]:[]}(e))r.add(t.code),a.push({id:"render."+t.code.toLowerCase(),stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(let t of e.warnings)r.has(t)||a.push({id:"render."+t.toLowerCase(),stage:"render",severity:"warning",code:t,message:`The renderer reported ${Xe(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return a}(u,e))}catch{c.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}let h=function(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{let a=Vo[e.finding.severity]-Vo[t.finding.severity];if(0!==a)return a;let r=!0===e.finding.critical;if(r!==(!0===t.finding.critical))return r?-1:1;let i=Go[e.finding.stage]-Go[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}(c),p=h.filter(e=>"error"===e.severity).length,m=h.filter(e=>"warning"===e.severity).length,f=h.filter(e=>"manual"===e.severity).length,g=Qe(h,Math.max(0,Math.floor(r.notificationMax??8)));return{component:e,validation:o,data:n,deception:s,accessibility:l,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:m,manual:f,findings:h.length,notifications:g.length},findings:h,notifications:g}}function at(e,t=8){return Qe(e,Math.max(0,Math.floor(t)))}function rt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function it(e,t){let{when:a}=e,r=t.width,i=t.height,o=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),n=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof a.minWidth&&a.minWidth>r||"number"==typeof a.maxWidth&&r>a.maxWidth||"number"==typeof a.minHeight&&("number"!=typeof i||a.minHeight>i)||"number"==typeof a.maxHeight&&("number"!=typeof i||i>a.maxHeight)||"number"==typeof a.minAspectRatio&&("number"!=typeof o||a.minAspectRatio>o)||"number"==typeof a.maxAspectRatio&&("number"!=typeof o||o>a.maxAspectRatio)||a.orientation&&n!==a.orientation)}function ot(e,t,a=e.responsiveRules){if(!Array.isArray(a)||0===a.length)return{props:e,matches:[]};let r=a.map((e,t)=>({rule:e,index:t})).filter(e=>it(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:r.reduce((e,t)=>function(e,t){let a={...e,...t};for(let r of["margin","frameProps","mobileSemantics","style"])rt(e[r])&&rt(t[r])&&(a[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(a.className=`${e.className} ${t.className}`),a}(e,t.rule.transform),e),matches:r}}function nt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function st(e){return"string"==typeof e&&e.trim().length>0}function lt(e){let t=nt(e.capability)?e.capability:null,a=nt(e.recipe)?e.recipe:null,r=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,a?.mobile];for(let e of r)if(nt(e))return e;return null}function ct(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function ut(e){return ct(e.size)||ct(nt(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function dt(e,t){e.push({...t,status:"pass"})}function ht(e,t){e.push({...t,status:"warn"})}function pt(e,t){e.push({...t,status:"manual"})}function mt(e,t={},a={}){let r=a.viewportWidth??390,i=a.targetSize??44,o=ut(t),n=ot(t,{width:r,height:o?.[1]}),s=[],l=ut(t=n.props),c=lt(t),u=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),d=function(e){let t=lt(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),h=!0===a.inChartContainer,p=st(t.title)||st(t.summary)||st(t.description)||!0===c?.summary||st(c?.summary);if(n.matches.length>0&&dt(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${n.matches.length} responsive rule(s) applied for the ${r}px mobile audit.`}),l){let[t,a]=l;t>r&&!d?ht(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${r}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):dt(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof c?.minViewportWidth&&c.minViewportWidth>r&&ht(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${c.minViewportWidth}px minimum, wider than the audited ${r}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});let i=t/Math.max(1,a);430>=r&&i>2.4&&"BigNumber"!==e&&ht(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>a&&"BigNumber"!==e&&ht(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${a}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else pt(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});let m=function(e){let t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,nt(e.frameProps)?e.frameProps.data:void 0],a=0;for(let e of t)Array.isArray(e)&&(a+=e.length);return a}(t);m>0&&(m>("number"==typeof c?.maxMarks?c.maxMarks:qo.has(e)?1.25*r:ro.has(e)?Math.max(8,Math.floor(r/34)):r)?ht(s,{id:"density.mark-budget",category:"density",impact:qo.has(e)?"medium":"high",message:`${m} data item(s) exceed the rough mobile density budget for ${e} at ${r}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):dt(s,{id:"density.mark-budget",category:"density",impact:"medium",message:m+" data item(s) are within the rough mobile density budget for this component."}));let f=function(e){let t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues],a=0;for(let e of t)Array.isArray(e)&&(a+=e.length);return a>0?a:null}(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=f){let e=Math.max(3,Math.floor(r/58));f>e&&ht(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${f} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${r}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(qo.has(e)||ro.has(e))&&pt(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){let t=nt(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){let t=lt(e),a=nt(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===a?.tapToSelect||!0===a?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||st(t?.interaction?.hoverFallback)}(e)}(t)?dt(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):ht(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});let y=function(e,t){let a=Ho[e];if(!a)return null;let r=a.includes("hoverRadius")?30:null;for(let e of a){let a=t[e];"number"==typeof a&&Number.isFinite(a)&&a>0&&(r=null==r?a:Math.max(r,a))}return null==r?null:2*r}(e,t),b=nt(t.mobileInteraction)?t.mobileInteraction:null,v=y??("number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof c?.minimumHitTarget?c.minimumHitTarget:"number"==typeof c?.interaction?.targetSize?c.interaction.targetSize:null);null!=v&&(24>v?ht(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${v}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):i>v?ht(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):dt(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, meeting the configured ${i}px target.`}));let w=[];(null!=t.brush||null!=t.onBrush)&&w.push("brush"),!0===t.zoomable&&w.push("pan/zoom"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&w.push("legend filtering"),w.length>0&&!function(e,t){let a=lt(e),r=(nt(e.mobileInteraction)?e.mobileInteraction:null)?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(a?.interaction?.alternatives)&&a.interaction.alternatives.length>0||!0===r||"all"===r)||t.every(e=>"brush"===e?Array.isArray(r)?r.includes("brush"):"brush"===r:"pan/zoom"===e?Array.isArray(r)?r.includes("zoom"):"zoom"===r:"legend filtering"===e&&(Array.isArray(r)?r.includes("legend"):"legend"===r))}(t,w)&&ht(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${w.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1!==t.showLegend&&!1!==t.legend&&(!0===t.showLegend||!0===t.legend||null!=t.colorBy||null!=t.groupBy||null!=t.lineBy||null!=t.areaBy||null!=t.stackBy)&&!0!==t.directLabel&&!0!==t.showLabels&&"direct"!==t.labelStrategy&&"direct-end"!==t.labelStrategy&&"direct"!==c?.labels?.strategy&&"inline"!==c?.labels?.strategy&&"external"!==c?.labels?.strategy&&430>=r&&ht(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});let A=Array.isArray(t.annotations)?t.annotations.filter(e=>nt(e)):[];if(A.length>("number"==typeof c?.maxAnnotations?c.maxAnnotations:3)&&430>=r&&ht(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:A.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),A.length>0){let e=A.filter(e=>!st(e.mobileText)&&!st(e.shortText)&&!st(e.label));e.length>0&&pt(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}!d&&"BigNumber"!==e&&pt(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(c?(dt(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===c.custom?.dataBearingSceneNodes?ht(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==c.custom?.dataBearingSceneNodes&&pt(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):pt(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),!p&&!h&&ht(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});let x=s.filter(e=>"warn"===e.status),$={highRisk:x.filter(e=>"high"===e.impact).length,warnings:x.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:r,ok:0===$.highRisk,summary:$,findings:s,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}function ft(e){let t=[],a=e.summary,r=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${a.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${r} - ${a.warnings} warning(s) - ${a.manual} manual check(s)`);for(let a of Yo){let r=e.findings.filter(e=>e.category===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(let e of r)t.push(` ${Wo[e.status]} [${e.impact}] ${e.id}: ${e.message}`),e.fix&&("warn"===e.status||"manual"===e.status)&&t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function gt(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function yt(e,t){if("function"==typeof e)return t=>+e(t);let a=e||t;return e=>+e[a]}function bt(e,t){if("function"==typeof e)return e;let a=e||t;return e=>e[a]}function vt(e,t){return Jo.has(e)||Xo.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 wt(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let a=e[t];if("string"==typeof a&&a)return a}}function At(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function xt(e,t={}){let a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function $t(e){return"string"==typeof e?e:e.id??e.name}function Ct(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function St(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 kt(e,t,a){return a??Ge(t.recipe)??Ge(t.recipeId)??Ue(e)}function Rt(e,t,a=[]){let r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;let i=a.find(e=>e&&"object"==typeof e);if(!i)return;let o=Object.entries(i).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 i):o.find(([,e])=>"string"==typeof e)?.[0]}function Pt(e,t){return e.dataRoles.find(e=>e.role===t)}function It(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function Nt(e,t,a,r,i,o={}){let n={...o};if(t)for(let[e,a]of Object.entries(t))n[e]=a;for(let e of a.dataRoles){let a=Rt(e,r,i),o=t&&a?t[a]:a;void 0!==o&&(n[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let a=n[t];return null==a?`{${t}}`:a+""})}function Et(e,t){let a="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!a)return null;let r=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(ie(t.bins)??21)),o=Math.max(1,Math.round(ie(t.pegRows)??i-1));if(a&&(r="GaltonBoardChart"===e?function(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),r=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=(s=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,s))),o=oe(e.seed??1),n=e.idPrefix??"mechanical";var s;return Array.from({length:r},(e,t)=>{let r=0;for(let e=0;a>e;e+=1)o()<i&&(r+=1);let s=a/2;return{id:`${n}-${t}`,value:r,mechanical:!0,pegRows:a,branchProbability:i,pathRights:r,side:s>r?"left":r>s?"right":"center"}})}({bins:i,count:t.mechanicalCount,pegRows:o,branchProbability:t.branchProbability,seed:t.seed}):ne({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),r=se(r,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=new Map,i=t.valueAccessor??(a?"value":void 0);return r.forEach((a,r)=>{let o=(re(a,r,t.categoryAccessor??"category")??"unknown")+"",n=i?ie(re(a,r,i)):1;e.set(o,(e.get(o)??0)+Math.max(0,n??0))}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=r.map((e,a)=>ie(re(e,a,t.valueAccessor??"value"))).filter(e=>null!=e),n=a?[0,o]:function(e){if(!e)return;let t=ie(e[0]),a=ie(e[1]);return null!=t&&null!=a?t>a?[a,t]:[t,a]:void 0}(t.valueExtent),s=n?.[0]??(e.length?Math.min(...e):0),l=n?.[1]??(e.length?Math.max(...e):1),c=s===l?1:l-s,u=Array.from({length:i},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/c*i)))].value+=1;return{generated:a,rows:u}}if("CollisionSwarmChart"===e){let e=new Map;return r.forEach((a,r)=>{if(null==ie(re(a,r,t.xAccessor??"x")))return;let i=t.groupAccessor?(re(a,r,t.groupAccessor)??"All")+"":"All";e.set(i,(e.get(i)??0)+1)}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=ie(t.windows?.size??10);if(null==e||0>=e)return null;let{events:i}=function(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:r}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=se(e.data,"event"),o=i.flatMap((t,a)=>{let r=ie(re(t,a,e.timeAccessor));return null==r?[]:[{datum:t,index:a,eventTime:r,arrivalTime:ie(re(t,a,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),n="function"==typeof a?null:ie(a?.value),s="function"==typeof a?t:ie(a?.delay)??t,l=-1/0,c=-1/0;for(let e of o.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof a?ie(a(l)):l-s;c=n??Math.max(c,i??l-t);let o=r?ie(re(e.datum,e.index,r)):null;e.watermarkAtArrival=o??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:o,watermarkValue:o.length?c:n??-s}}({data:r,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),o=i.map(e=>e.eventTime),n=o.length?Math.min(...o):0,s=o.length?Math.max(...o):n+e,l=Math.min(ie(t.timeExtent?.[0])??n,n),c=Math.max(ie(t.timeExtent?.[1])??s,s),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),h=Array.from({length:d},(t,a)=>({label:`${u+a*e}-${u+(a+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let a=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?a.secondary+=1:a.value+=1}return{generated:a,rows:h}}return null}function Mt(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Tt(e,t){let a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,a)=>{if(!e||"object"!=typeof e)return null;let r=e,i=Mt(r.count??r.value??r.total??r.bodies??r.events);if(null==i)return null;let o=r.label??r.id??r.name??"container "+(a+1),n=Mt(r.secondary??r.secondaryCount),s=Mt(r.observed??r.observedCount);return{label:At(o,t),count:i,...null!=n?{secondary:n}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Ot(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ft(e){return Qo[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function jt(e){return rn[e]}function zt(e,t){let a=function(e){if(e){if("fits"in e||"buildProps"in e){let t=e,a={};for(let[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(a?.act)return a.act;if(a?.intentScores){let e=function(e){let t,a=0;for(let[r,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>a){t=r,a=i;continue}if(i===a&&void 0!==t){let e=nn.indexOf(r),a=nn.indexOf(t);-1!==e&&(-1===a||a>e)&&(t=r)}}return t}(a.intentScores);if(e&&rn[e]&&(a.intentScores[e]??0)>=3)return rn[e]}return a?.family?on[a.family]:function(e){return"BumpChart"===e?"ranking":Xo.has(e)||"StackedAreaChart"===e?"apportioning":an.has(e)?"relating":Jo.has(e)?"comparing":Zo.has(e)?"characterizing":Ko.has(e)?"tracking":en.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function Bt(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!ln.has(t.type))return!1;let a=t.provenance;return!(!a||"object"!=typeof a)&&(cn.has(a.authorKind)||un.has(a.source)||dn.has(a.basis))})}function Lt(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}function _t(e){let t=hn["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=function(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}(e),r=a?a+t.replace(/^an? /,""):t,i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return i?`${r} labeled "${i}"`:r}function Dt(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let a=xt(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;let r=a.map(_t),i=r.slice(0,5),o=r.length-i.length,n=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]??""}(i)+(o>0?`, and ${o} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${n}.`}function Ut(e,t,a={}){let r=void 0!==a.levels,i=new Set(a.levels??["l1","l2","l3"]);!r&&(a.capability||Bt(t))&&i.add("l4");let o=kt(e,t,a.recipe);if(o){let e=["l1","l2","l3","l4"].filter(e=>i.has(e));!r&&!e.includes("l4")&&e.push("l4");let n=function(e,t,a={}){let r=St(t),i=Ct(t),o=a.locale??"en",n=("function"==typeof e.description?e.description({data:r,config:i,locale:o}):void 0)?.levels??function(e,t,a,r){let i=It(e,["nominal","ordinal"]),o=It(e,["quantitative"]),n=i?Rt(i,a,t):void 0,s=o?Rt(o,a,t):void 0,l=i?.role??n??"category",c=o?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=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})}}}(r),m=new Map;if(n&&s)for(let e of t){let t=(e[n]??"Uncategorized")+"",a=Number(e[s]);Number.isFinite(a)&&m.set(t,(m.get(t)??0)+a)}let f=[...m].sort((e,t)=>t[1]-e[1]),g=f.reduce((e,[,t])=>e+t,0),y=f[0],b=f[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:$t(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 ${l} and ${c}. ${x=d,x&&x.charAt(0).toUpperCase()+x.slice(1)}.`,l2:f.length>0?`${f.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>f.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${f.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`,l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}(e,r,i,o),s=a.levels??["l1","l2","l3","l4"],l={};for(let e of s)n[e]&&(l[e]=n[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}(o,t,{levels:e,locale:a.locale,audience:a.audience,includeCaveats:a.includeCaveats}),s=Dt(t);return{...n,text:s?`${s} ${n.text}`.trim():n.text,...s?{annotations:s}:{}}}let n=Lt(a.locale??"en"),s=Ft(e),l=Array.isArray(t.data)?t.data:null,c=wt(t),u=tn.has(e)?Tt(t,n):null,d=tn.has(e)&&null===u?Et(e,t):null,{measure:h,measureFallback:p,dimension:m,dimensionFallback:f}=vt(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof m&&m?m:f,b={};if(tn.has(e)&&function(e,t,a,r,i,o,n=null){let s=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),l=n&&"EventDropChart"===e?"accepted event":function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}(e),c=n?n.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(r.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)),!i.has("l2")&&!i.has("l3"))return;if(!a||0===a.length)return void(i.has("l2")&&(r.l2=n?"No valid source records are available.":"No settled projection is loaded yet."));let u=a.reduce((e,t)=>e+t.count,0),d=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;let p=a.reduce((e,t)=>e+(t.secondary??0),0),m=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(n&&"EventDropChart"===e)r.l2=`${c} classifies ${o(u+p)} ${Ot(u+p,"event")} across ${a.length} ${Ot(a.length,s)}: ${o(u)} accepted and ${o(p)} late.`;else if(0===d.length)r.l2=`${c} contains ${o(u)} ${Ot(u,l)} across ${a.length} ${Ot(a.length,s)}; no ${Ot(2,s)} are non-empty yet.`;else{let e=p>0?` ${o(p)} ${Ot(p,l)} ${1===p?"is":"are"} marked ${m}.`:"";r.l2=`${c} contains ${o(u)} ${Ot(u,l)} across ${a.length} ${Ot(a.length,s)}; ${d.length} ${Ot(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${o(h.count)} ${Ot(h.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==h),t=function(e,t){if(0>=t)return"0%";let a=e/t*100;return(10>a?Math.round(10*a)/10:Math.round(a))+"%"}(h.count,u);r.l3=e?`${c} is most concentrated in ${h.label}, which holds ${o(h.count)} ${Ot(h.count,l)} (${t}); ${e.label} follows with ${o(e.count)} ${Ot(e.count,l)}.`:`${c} is concentrated in ${h.label}, which holds all ${o(h.count)} ${Ot(h.count,l)}.`}}(e,s,u??(d?Tt({projectionRows:d.rows},n):null),b,i,n,d),i.has("l1")&&!tn.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${c??"series"} by ${g} across ${y}.`;else if(Ko.has(e)||Jo.has(e))b.l1=`A ${s} of ${g} by ${y}`+(c?`, split by ${c}.`:".");else if(Xo.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(Zo.has(e))b.l1=`A ${s} of the distribution of ${g}`+(c?` by ${c}.`:".");else if(en.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${Gt(e,"node")}`:null,null!=a?`${a} ${Gt(a,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?" for "+e:""}.`}else b.l1=`A ${s}.`;let v=Ko.has(e)||"BumpChart"===e||Jo.has(e)||Xo.has(e)||Zo.has(e),w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&l&&l.length>0&&(w=function(e,t,a,r){let i=0,o=0,n=1/0,s=-1/0,l=null,c=null,u=0,d=0,h=null,p=null,m=NaN,f=NaN;for(let a of e){let e=t(a);Number.isFinite(e)&&(0===i&&(m=e,h=a),f=e,p=a,n>e&&(n=e,l=a,u=i),e>s&&(s=e,c=a,d=i),i++,o+=e)}return 0===i?null:{count:i,min:n,max:s,mean:o/i,minLabel:At(null!=l?a(l):null,r),maxLabel:At(null!=c?a(c):null,r),first:m,last:f,firstLabel:At(null!=h?a(h):null,r),lastLabel:At(null!=p?a(p):null,r),minIndex:u,maxIndex:d}}(l,yt(h,p),bt(m,f),n)),i.has("l2")&&v&&(l&&0!==l.length?w&&(b.l2=Xo.has(e)?`${w.count} segments totaling ${n(function(e){return e.mean*e.count}(w))}. Largest is ${w.maxLabel} at ${n(w.max)}; smallest is ${w.minLabel} at ${n(w.min)}.`:`${g} ranges from ${n(w.min)} (${w.minLabel}) to ${n(w.max)} (${w.maxLabel}), with a mean of ${n(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!c&&Ko.has(e)?b.l3=function(e,t,a){let{first:r,last:i,min:o,max:n,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,m=n-o,f=i-r;if(0===m)return`${Vt(t)} is constant at ${a(r)} across the series.`;if(.04>m/(Math.abs(e.mean)||1))return`${Vt(t)} ends roughly where it started (${a(r)} at ${c} to ${a(i)} at ${u}), ranging between ${a(o)} and ${a(n)}.`;let g=h>0&&p-1>h,y=d>0&&p-1>d,b=(n-Math.max(r,i))/m,v=(Math.min(r,i)-o)/m;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(n)} (${s}), then falls to ${a(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${a(o)} (${l}), then recovers to ${a(i)} (${u}).`:.05>Math.abs(f)/m?`${Vt(t)} ends roughly where it started (${a(r)} at ${c} to ${a(i)} at ${u}), ranging between ${a(o)} and ${a(n)}.`:f>0?h===p-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(i)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(i)} (${u}), after peaking at ${a(n)} (${s}).`:d===p-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(i)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(i)} (${u}), after dipping to ${a(o)} (${l}).`}(w,g,n):i.has("l3")&&w&&!c&&Jo.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){let r=Bt(t)?"alerting":zt(e,a.capability);r&&(b.l4=function(e,t,a,r,i,o,n,s){let l,c,u=sn[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof a.label&&a.label?a.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${o} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=function(e,t,a,r,i,o){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 "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(Jo.has(a)||Xo.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:r,last:i,min:o,max:n,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:h}=e,p=n-o;if(p>0){let e=d>0&&h-1>d,a=u>0&&h-1>u,m=(n-Math.max(r,i))/p,f=(Math.min(r,i)-o)/p;if(e&&m>.15)return`the peak of ${t(n)} at ${l} is the point to investigate`;if(a&&f>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(i>=n)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(o>=i)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(n)}) and ${s} (${t(o)}) — are the points to check`}(t,i,o);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){let t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}(e,r,i,o,n,t)}return`${l}; ${c}.${function(e,t){if(!t)return"";let a=t.familiarity?.[e];return"number"!=typeof a||a>2?"":` This ${Ft(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(r,e,t,c?null:w,g,y,n,a.audience))}let A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),x=Dt(t);return{text:x?`${x} ${A}`.trim():A,levels:b,...x?{annotations:x}:{}}}function Vt(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Gt(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function qt(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ht(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Wt(e,t="—"){return null==e||""===e?t:"object"==typeof e?Wt(e.id??e.name??e.label,t):e+""}function Yt(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Kt(e){return Wt(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Jt(e,t){let a=Ht(e,t,"children");return Array.isArray(a)?a:[]}function Xt(e,t,a){return`${e} ${1===e?t:a}`}function Zt(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${Xt(e.numericLeaves,"valued leaf","valued leaves")}`}function Qt(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function ea(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function ta(e,t="—"){return null==e||""===e?t:"object"==typeof e?ta(e.id??e.name??e.label,t):e+""}function aa(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ra(e){return ta(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ia(e){let 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 oa(e,t,a){let r=ea(e,t,a);if(void 0!==r)return r;let i=e.properties;return i&&"object"==typeof i?ea(i,t,a):void 0}function na(e,t,a){return ta(oa(e,t,"id")??oa(e,"name","name")??oa(e,"NAME","NAME")??oa(e,"label","label"),a)}function sa(e){let t=0,a=1/0,r=-1/0,i=0;for(let o of e)null!=o.value&&(t+=1,a=Math.min(a,o.value),r=Math.max(r,o.value),i+=o.value);return 0===t?null:{count:t,min:a,max:r,total:i,average:i/t}}function la(e,t){let a=sa(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function ca(e,t,a,r){let i=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let 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:[],n=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:o).map((a,r)=>({datum:a,index:r,label:na(a,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:aa(oa(a,l,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${la(d,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${n.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${ia(t)}`,children:[]};if("ChoroplethMap"===e)h.children=function(e,t,a){let r,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),o=new Map,n=0;for(let[e,t]of i.entries())r!==t.value&&(n=e+1,r=t.value),o.set(t.index,n);let s=0;return function(e){let t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],i=sa(t);if(i)if(i.min===i.max)r.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,a=i.min+2*(i.max-i.min)/3,o=t.filter(e=>e.value>=a),n=t.filter(t=>t.value>=e&&a>t.value),s=t.filter(t=>e>t.value);o.length>0&&r.push({id:"highest",label:"Highest values",rows:o}),n.length>0&&r.push({id:"middle",label:"Middle values",rows:n}),s.length>0&&r.push({id:"lowest",label:"Lowest values",rows:s})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}(e).map(e=>{let r=e.rows.slice(0,Math.max(0,t-s));s+=r.length;let n=r.map(e=>{let t=o.get(e.index),r=null==t||2>i.length?"":`, rank ${t} of ${i.length}`;return{id:`geo-${ra(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${a(e.value)}${r}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-r.length;return l>0&&n.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"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"}, ${la(e.rows,a)}.`,children:n}})}(u,a,r);else if(u.length>0){let e=u.slice(0,a).map(e=>({id:`geo-${ra(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+r(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-a} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let p="FlowMap"===e?n:s;if(p.length>0){let e=p.slice(0,a).map((e,t)=>{let a=ta(e.source,"unknown"),i=ta(e.target,"unknown"),o=aa(ea(e,l,"value"));return{id:`route-${ra(a)}-${ra(i)}-${t}`,role:"datum",level:3,label:`${a} to ${i}${null==o?"":": "+r(o)}.`,...null==o?{}:{value:o},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function ua(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function da(e,t="—"){return null==e||""===e?t:"object"==typeof e?da(e.id??e.name??e.label,t):e+""}function ha(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function pa(e){return da(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ma(e,t){let a=[];return(e.linkedHover||e.selection||e.linkedBrush)&&a.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&a.push("Hover or focus a mark for its details."),a.length>0?" "+a.join(" "):""}function fa(e,t){t&&e.children?.push(t)}function ga(e,t,a={}){let r=a.locale??"en",i=Math.max(1,a.maxLeaves??200),o=Lt(r),n=kt(e,t,a.recipe);if(n)return function(e,t,a={}){let r=St(t),i=Ct(t),o=Math.max(1,a.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:i,locale:a.locale??"en"});let n=(m=e.navigation)&&"object"==typeof m?e.navigation:void 0,s=(n?.groupByRole?Pt(e,n.groupByRole):void 0)??(n?.groupBy?.[0]?Pt(e,n.groupBy[0])??e.dataRoles.find(e=>e.field===n.groupBy?.[0]):void 0)??It(e,["nominal","ordinal"]),l=s?Rt(s,i,r):void 0,c=(n?.idRole?Pt(e,n.idRole):void 0)??It(e,["identifier"]),u=c?Rt(c,i,r):void 0,d={id:"root",role:"chart",label:n?.summaryTemplate?Nt(n.summaryTemplate,void 0,e,i,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]},h=0,p=(t,a,o)=>{let s=u?t[u]:void 0,l=n?.itemLabelTemplate?Nt(n.itemLabelTemplate,t,e,i,r,{count:r.length}):function(e,t,a,r){let i=It(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),n=i?Rt(i,a,r):void 0,s=[];n&&null!=e[n]&&s.push(e[n]+"");for(let t of o){let i=Rt(t,a,r);i&&null!=e[i]&&s.push(`${t.role}: ${e[i]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,i,r);return{id:"datum-"+qt(s??a),role:"datum",label:l,level:o,datum:t}};var m;if(l){let e=new Map;for(let t of r){let a=(t[l]??"Uncategorized")+"",r=e.get(a);r?r.push(t):e.set(a,[t])}d.children=[...e].map(([e,t],a)=>{let r=t.slice(0,Math.max(0,o-h));h+=r.length;let i=r.map((e,t)=>p(e,1e5*a+t,3));return t.length>r.length&&i.push({id:"more-"+qt(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+qt(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:i}})}else{let e=r.slice(0,o);d.children=e.map((e,t)=>p(e,t,2)),r.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return d}(n,t,{maxLeaves:i,locale:r});let s={id:"root",role:"chart",label:Ut(e,t,{locale:r}).text||"Chart.",level:1,children:[]},l=function(e,t){let a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;let r=xt(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let i=0,o=r.slice(0,t).map(e=>{let t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${r=_t(e),r&&r.charAt(0).toUpperCase()+r.slice(1)}${a}.`,datum:e};var r});r.length>t&&o.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});let n=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===n?"one marked feature":n+" marked features"}.`,children:o}}(t,i);if(pn.has(e)){let a=function(e,t,a,r){let i=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],n=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>da(ua(e,n,"id"),"unknown"),d=(e,t)=>da(ua(e,t,""),"unknown"),h=new Set;for(let e of o)h.add(d(e,s)),h.add(d(e,l));let p=i.length>0?i:[...h].map(e=>({id:e})),m=new Map;for(let e of p)m.set(u(e),{links:0,value:0});for(let e of o){let t=d(e,s),a=d(e,l),r=ha(ua(e,c,"value"))??0;for(let e of[t,a]){let t=m.get(e)??{links:0,value:0};t.links+=1,t.value+=r,m.set(e,t)}}let f={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${o.length} links.${ma(t,"network")}`,children:[]},g=0,y=new Map,b=t.colorBy??"group";for(let e of p){let t=da(ua(e,b,"group"),"Ungrouped"),a=y.get(t);a?a.push(e):y.set(t,[e])}let v=[...y].map(([e,t],i)=>{let o=[];for(let[e,n]of t.entries()){if(g>=a)break;g+=1;let t=u(n),s=m.get(t)??{links:0,value:0},l=s.value>0?`, ${r(s.value)} total flow`:"";o.push({id:`node-${i}-${e}-${pa(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:n})}return{id:`nodes-${i}-${pa(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});v.length>0&&f.children?.push(...v);let w=o.slice(0,a).map((e,t)=>{let a=d(e,s),i=d(e,l),o=ha(ua(e,c,"value"));return{id:`link-${pa(a)}-${pa(i)}-${t}`,role:"datum",level:3,label:`${a} to ${i}${null==o?"":": "+r(o)}.`,value:o,datum:e}});return o.length>a&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-a} more links.`,value:void 0}),w.length>0&&f.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:w}),f}(e,t,i,o);return fa(a,l),a}if(mn.has(e)){let a=function(e,t,a,r){let i=t.data&&"object"==typeof t.data?t.data:null,o=t.childrenAccessor??"children",n=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,l=new WeakMap,c=new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let a,r=Jt(e,o);if(0===r.length){let t=Yt(Ht(e,n,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=r.reduce((e,t)=>{let a=u(t);return{descendants:e.descendants+1+a.descendants,depth:Math.max(e.depth,a.depth+1),leaves:e.leaves+a.leaves,numericLeaves:e.numericLeaves+a.numericLeaves,leafTotal:e.leafTotal+a.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,a),a},d=0,h=(e,t,i,l)=>{let c=Wt(Ht(e,s,"name"),"item "+i);if(l.has(e))return{id:`hierarchy-${Kt(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let p=Jt(e,o),m=u(e);if(0===p.length){if(d>=a)return null;d+=1;let o=Yt(Ht(e,n,"value"));return{id:`hierarchy-${Kt(i)}-${Kt(c)}`,role:"datum",level:t,label:`${c}${null==o?"":": "+r(o)}.`,...null==o?{}:{value:o},datum:e}}let f=new Set(l);f.add(e);let g=[],y=0;for(let[e,r]of p.entries()){if(d>=a){y+=u(r).leaves;continue}let o=h(r,t+1,`${i}-${e}`,f);o&&g.push(o)}return y>0&&g.push({id:`hierarchy-${Kt(i)}-more`,role:"datum",level:t+1,label:`${Xt(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${Kt(i)}-${Kt(c)}`,role:"series",level:t,label:`${c}: ${Xt(p.length,"direct child","direct children")}, ${Xt(m.descendants,"total descendant","total descendants")}, ${Xt(m.leaves,"leaf","leaves")}${Zt(m,r)}.`,datum:e,children:g}},p=i?u(i):null,m={id:"root",role:"chart",level:1,label:i?`A ${Qt(e)} chart with ${Xt(p.leaves,"leaf","leaves")} and ${Xt(p.descendants,"total descendant","total descendants")} across ${Xt(p.depth,"hierarchy level","hierarchy levels")}${Zt(p,r)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=h(i,2,"root",new Set);if(e){let t=Wt(Ht(i,s,"name"),"");m.children="series"===e.role&&""===t?e.children:[e]}}return m}(e,t,i,o);return fa(a,l),a}if(fn.has(e)){let a=ca(e,t,i,o);return fa(a,l),a}let c=Array.isArray(t.data)?t.data:null,u=function(e,t={},a={}){return!!kt(e,t,a.recipe)||pn.has(e)||mn.has(e)||fn.has(e)||Ko.has(e)||Jo.has(e)||Xo.has(e)||Zo.has(e)}(e,t,a);if(!c||0===c.length||!u)return l&&(s.children=[l]),s;let{measure:d,measureFallback:h,dimension:p,dimensionFallback:m}=vt(e,t),f=yt(d,h),g=bt(p,m),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:m,v=wt(t),w=0,A=e=>`${e}-${w++}`,x=(e,t)=>{let a=e.slice(0,i).map(e=>((e,t)=>{let a=f(e),r=At(g(e),o);return{id:A("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?o(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>i&&a.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),a},$=[];if(Ko.has(e)||Jo.has(e)){let t=1/0,a=-1/0,r=1/0,i=-1/0,n=[],s=!0;for(let e of c){let o=f(e);Number.isFinite(o)&&(t>o&&(t=o),o>a&&(a=o));let l=g(e);n.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>i&&(i=l)):s=!1}let l=new Set,u=[];for(let e of n){let t=e+"";l.has(t)||(l.add(t),u.push(e))}let d=s?`${o(r)} to ${o(i)}`:`${At(u[0],o)} to ${At(u[u.length-1],o)} (${Jo.has(e)?u.length+" categories":c.length+" points"})`;$.push({id:A("axis"),role:"axis",level:2,label:`${Jo.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),a>=t&&$.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${o(t)} to ${o(a)}.`})}if(v){let a=bt(v,v),i=new Map;for(let e of c){let t=(a(e)??"—")+"",r=i.get(t);r?r.push(e):i.set(t,[e])}let o=[];for(let[a,n]of i){let i=Ut(e,{...t,data:n},{levels:["l2","l3"],locale:r}).text;o.push({id:A("series"),role:"series",level:2,label:`Series ${a}: ${i}`,children:x(n,3)})}s.children=[...$,...o]}else s.children=[...$,...x(c,2)];return l&&s.children.push(l),s}function ya(e,t){let a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(let t of e.children)r(t)};return r(e),a}function ba(e){let t=1;if(e.children)for(let a of e.children)t+=ba(a);return t}function va(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function wa(e){return va(e)?e:void 0}function Aa(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function xa(e){let t=Aa(e);return null==t?void 0:Math.max(0,Math.floor(t))}function $a(...e){return e.map(wa).find(Boolean)}function Ca(...e){return e.find(Array.isArray)}function Sa(e){let t={};for(let[a,r]of Object.entries(e))void 0!==r&&(t[a]=r);return t}function ka(e,t,a){return e["string"==typeof t&&t?t:a]}function Ra(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Pa(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ia(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Na(e,t,a){let r=e?.filter(e=>!0===wa(e)?.sensor).length,i=wa(t?.observation),o=wa(i?.sensors),n=Ca(a?.activeSensors);return Math.max(r??0,o?Object.keys(o).length:0,n?.length??0)||void 0}function Ea(e,t,a={}){let r,{capability:i,audience:o,locale:n}=a,s=a.levels??["l1","l2","l3"],l=!1!==a.includeStructure,c=zt(e,i),u=Ut(e,t,{levels:c?[...s,"l4"]:s,locale:n,capability:i,audience:o}),{l4:d,...h}=u.levels,p=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),m={levels:h,text:u.annotations?`${u.annotations} ${p}`.trim():p,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=(f=i)?"fits"in f||"buildProps"in f?{family:f.family}:{family:f.family,intentScores:f.intentScores}:{};r={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}var f;let g=l?ga(e,t,{maxLeaves:a.maxLeaves,locale:n}):void 0,y=function(e,t,a){if(!1===a)return;let r=va(a)?a:void 0,i=wa(t.physics),o=$a(r?.snapshot,i?.snapshot,t.physicsSnapshot,function(e){let t=wa(e);return!!t&&(va(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),n=$a(r?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=$a(r?.config,i?.config,o?.config,t.config),l=$a(wa(o?.world),wa(i?.world)),c=$a(wa(s?.kernel),wa(l?.options)),u=Ca(l?.bodies),d=Ca(l?.colliders,s?.colliders),h=Ca(o?.queue,i?.queue),p=Ca(o?.liveBodyOrder),m=Ca(l?.springs),f=Ca(o?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let a=wa(e);if(!a)return;let r=Aa(a.count??a.value??a.total??a.bodies??a.events);if(null==r)return;let i=(a.label??a.id??a.name??"container "+(t+1))+"",o=null==a.id?void 0:a.id+"",n=Aa(a.secondary??a.secondaryCount),s=Aa(a.observed??a.observedCount);return Sa({id:o,label:i,count:r,secondary:n,secondaryLabel:"string"==typeof a.secondaryLabel?a.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;let a=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:a,populatedCount:r,...i?{leader:i}:{}}}(function(e,t,a,r){let i=wa(e.settledProjection),o=wa(t?.settledProjection);return Ca(a?.projectionRows,a?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,o?.rows,r?.binCounts)}(t,i,r,n)),y=function(e,t){let a=e?.map((e,t)=>{let a=wa(e);if(!a)return;let r=Aa(a.count)??0,i=Aa(a.total),o={label:(a.label??a.id??"sediment "+(t+1))+"",count:r};return null!=a.id&&(o.id=a.id+""),null!=i&&(o.total=i),o}).filter(e=>null!=e),r=xa(t?.bins)??a?.length??0,i=Aa(t?.count)??a?.reduce((e,t)=>e+t.count,0)??0,o=Aa(t?.total)??a?.reduce((e,t)=>e+(t.total??0),0),n=a?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==i||o)return{bins:r,count:i,...null!=o&&o>0?{total:o}:{},...n?{leader:n}:{}}}(Ca(r?.sediment,i?.sediment,o?.sediment),$a(r?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??xa(n?.bodyCount),v=function(e){if(e)return e.filter(e=>!0===wa(e)?.sleeping).length}(u)??xa(n?.sleepingCount),w=h?.length,A="string"==typeof o?.simulationState?o.simulationState:void 0,x="boolean"==typeof n?.settled?n.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,$=wa(c?.gravity),C=Aa($?.x),S=Aa($?.y),k=Sa({state:A,settled:x,elapsedSeconds:Aa(o?.elapsedSeconds),paused:"boolean"==typeof o?.paused?o.paused:void 0,visible:"boolean"==typeof o?.visible?o.visible:void 0,seed:Aa(c?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:Aa(s?.fixedDt??c?.fixedDt),timeScale:Aa(s?.timeScale),maxSubsteps:xa(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:Aa(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=Sa({colliders:d?.length,sensors:Na(d,s,l),springs:m?.length,activeSensorPairs:f?.length}),P=Object.keys(R).length>0,I=gn.has(e);if(!(Object.keys(k).length>0||P||g||y)||!I&&null==a)return;let N={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},E=function(e){let t=[],a=e.simulation,r=[a.state??(a.settled?"settled":void 0),null!=a.liveBodies?`${a.liveBodies} live ${Pa(a.liveBodies,"body")}`:void 0,null!=a.sleepingBodies?a.sleepingBodies+" sleeping":void 0,null!=a.queued?a.queued+" queued":void 0,null!=a.seed?"seed "+Ia(a.seed):void 0,a.gravity?`gravity (${Ia(a.gravity.x)}, ${Ia(a.gravity.y)})`:void 0,null!=a.fixedDt?`fixed step ${Ia(a.fixedDt)}s`:void 0,null!=a.timeScale?Ia(a.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${Pa(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Pa(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Pa(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Pa(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let o=e.aggregates;if(o){let e=o.leader,a=e?` Largest is ${e.label} with ${Ia(e.count)}.`:"";t.push(`Physics aggregates: ${Ia(o.totalCount)} settled ${Pa(o.totalCount,"body")} across ${o.rows.length} ${Pa(o.rows.length,"container")}; ${o.populatedCount} populated.${a}`)}let n=e.sediment;if(n){let e=null!=n.total?", value total "+Ia(n.total):"",a=n.leader?`; largest sediment bin is ${n.leader.label} with ${Ia(n.leader.count)}`:"";t.push(`Physics sediment: ${n.count} retained ${Pa(n.count,"body")} in ${n.bins} ${Pa(n.bins,"bin")}${e}${a}.`)}return t.join(" ")}(N);return{...N,text:E}}(e,t,a.physics),b=function(e,t,a){let r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${Ra(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,a="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${Ra(e)} to ${Ra(a)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${Ra(t.domain[0])} to ${Ra(t.domain[1])}.`),i.length>0){r.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let o of i.slice(0,a)){let a=ka(o,t.sourceAccessor,"source"),i=ka(o,t.targetAccessor,"target"),n=ka(o,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==o.startTime&&null==o.endTime?`${Ra(a)} to ${Ra(i)} has value ${Ra(n)}.`:`${Ra(a)} to ${Ra(i)} has value ${Ra(n)} over ${Ra(o.startTime)}–${Ra(o.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=wa(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",o="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",n="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=wa(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(let e of s.slice(0,a))r.push(`${Ra(e[n])} has value ${Ra(e[o])}.`)}}if(gn.has(e)&&Array.isArray(t.data)){let a=t.data;r.push(`${a.length} observed source row${1===a.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,o="CollisionSwarmChart"===e?"x":"value",n=a.map(e=>Aa(ka(e,i,o))).filter(e=>null!=e);n.length>0&&r.push(`Observed ${"string"==typeof i?i:o} ranges from ${Ra(Math.min(...n))} to ${Ra(Math.max(...n))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}(e,t,Math.max(1,a.maxLeaves??200)),v=[m.text,r?.sentence,y?.text,b?.text].filter(Boolean).join(" ");return{component:e,description:m,intent:r,structure:g,physics:y,facts:b,text:v}}function Ma(e,t=30){return Math.max((e??4)+5,12,t)}function Ta(e){return bn.has(e)}function Oa(e,t){return vn.has(e)&&!("reading"===e&&"string"==typeof t)}function Fa(e,t){return`${e}[Symbol(${t.description??""})]`}function ja(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let a=Number(e);return Number.isSafeInteger(a)&&a>=0&&t>a}function za(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function Ba(e){return e.sort((e,t)=>{let a=JSON.stringify(e),r=JSON.stringify(t);return r>a?-1:a>r?1:0})}function La(e,t,a){if(null===e)return null;if(e instanceof Date){let r=e.getTime();return Number.isFinite(r)?{$type:"date",value:e.toISOString()}:void a.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void a.excluded.push(t);case"object":{let r=e;if(a.ancestors.has(r))return void a.excluded.push(t);a.ancestors.add(r);try{if(Array.isArray(e)){for(let r of Reflect.ownKeys(e))"length"===r||"string"==typeof r&&ja(r,e.length)||a.excluded.push("symbol"==typeof r?Fa(t,r):za(t,r));return Array.from({length:e.length},(r,i)=>{let o=za(t,i),n=Object.getOwnPropertyDescriptor(e,i+"");if(!n||!("value"in n)||!n.enumerable)return a.excluded.push(o),null;let s=La(n.value,o,a);return void 0===s?null:s})}let r={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void a.excluded.push(t);let o=[];for(let r of Reflect.ownKeys(e)){if("symbol"==typeof r){a.excluded.push(Fa(t,r));continue}let i=Object.getOwnPropertyDescriptor(e,r);i&&"value"in i&&i.enumerable?o.push(r):a.excluded.push(za(t,r))}for(let i of o.sort()){let o=Object.getOwnPropertyDescriptor(e,i),n=La(o&&"value"in o?o.value:void 0,za(t,i),a);void 0!==n&&Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0})}return r}finally{a.ancestors.delete(r)}}default:return void a.excluded.push(t)}}function _a(e,t=new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let a=a=>{let r="symbol"==typeof a?["symbol-key",a.description??""]:["string-key",a],i=Object.getOwnPropertyDescriptor(e,a);return i?"value"in i?[r,"data",!!i.enumerable,_a(i.value,t)]:[r,"accessor",!!i.enumerable,!!i.get,!!i.set]:[r,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,r)=>{let i=r+"";return Object.prototype.hasOwnProperty.call(e,i)?a(i):["hole"]}),Ba(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&ja(t,e.length))).map(a))];let r=Object.getPrototypeOf(e);return[r!==Object.prototype&&null!==r?"non-json-object":"object",Ba(Reflect.ownKeys(e).map(a))]}finally{t.delete(e)}default:return["excluded"]}}function Da(e){let t={excluded:[],ancestors:new Set},a=La(e,"$",t)??null;return{value:a,text:JSON.stringify(a),excludedPaths:t.excluded}}function Ua(e){let t=Da(e),a=function(e){let t=[...xn],a=Array.from((new TextEncoder).encode(e)),r=8*a.length;for(a.push(128);a.length%64!=56;)a.push(0);let i=Math.floor(r/4294967296),o=r>>>0;a.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o);let n=[];for(let e=0;a.length>e;e+=4)n.push((a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3])>>>0);for(let e=0;n.length>e;e+=16){let a=[...n.slice(e,e+16)];for(let e=16;64>e;e+=1){let t=wn(a[e-15],7)^wn(a[e-15],18)^a[e-15]>>>3,r=wn(a[e-2],17)^wn(a[e-2],19)^a[e-2]>>>10;a[e]=a[e-16]+t+a[e-7]+r>>>0}let[r,i,o,s,l,c,u,d]=t;for(let e=0;64>e;e+=1){let t=d+(wn(l,6)^wn(l,11)^wn(l,25))+(l&c^~l&u)+$n[e]+a[e]>>>0,n=r&i^r&o^i&o;d=u,u=c,c=l,l=s+t>>>0,s=o,o=i,i=r,r=t+((wn(r,2)^wn(r,13)^wn(r,22))+n>>>0)>>>0}let h=[r,i,o,s,l,c,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}(JSON.stringify(["semiotic-value-fingerprint","v2",_a(e)]));return{...t,algorithm:"sha256",digest:a,fingerprint:"sha256:"+a}}function Va(e,t,a,r){Ka(e,Object.keys(t),a,r);for(let[i,o]of Object.entries(t))o.values?(o.required||void 0!==e[i])&&Xa(e,i,a,o.values,r):o.required?Ja(e,i,a,r):ar(e,i,a,r)}function Ga(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function qa(e,t,a,r){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&r.push({path:`${a}.${t}`,message:"Expected a finite number."})}function Ha(e,t,a,r){void 0!==e[t]&&"boolean"!=typeof e[t]&&r.push({path:`${a}.${t}`,message:"Expected a boolean."})}function Wa(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(Wa):Ga(e)&&Object.values(e).every(Wa))}function Ya(e,t,a,r){void 0!==e[t]&&(!Ga(e[t])||!Wa(e[t]))&&r.push({path:`${a}.${t}`,message:"Expected a JSON object."})}function Ka(e,t,a,r){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||r.push({path:`${a}.${t}`,message:"Unexpected property."})}function Ja(e,t,a,r){("string"!=typeof e[t]||!e[t])&&r.push({path:`${a}.${t}`,message:"Expected a non-empty string."})}function Xa(e,t,a,r,i){("string"!=typeof e[t]||!r.includes(e[t]))&&i.push({path:`${a}.${t}`,message:`Expected one of: ${r.join(", ")}.`})}function Za(e,t,a,r){let i=e[t];if(void 0!==i)return Ga(i)?i:void r.push({path:`${a}.${t}`,message:"Expected an object."})}function Qa(e,t,a,r){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void r.push({path:`${a}.${t}`,message:"Expected an array."})}function er(e,t,a){e?.some(e=>"string"!=typeof e||!e)&&a.push({path:t,message:"Expected non-empty string values."})}function tr(e,t,a,r,i){void 0!==e[t]&&Xa(e,t,a,r,i)}function ar(e,t,a,r){void 0!==e[t]&&"string"!=typeof e[t]&&r.push({path:`${a}.${t}`,message:"Expected a string."})}function rr(e,t,a){Ga(e)?(Ka(e,["id","name","kind"],t,a),Ja(e,"kind",t,a),ar(e,"id",t,a),ar(e,"name",t,a)):a.push({path:t,message:"Expected an actor object."})}function ir(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function or(e){try{return function(e){let t=[],a=[];if(!Ga(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:a};let r=_e(e);if(r.length>0)return{valid:!1,errors:r.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:a};if(Ka(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),Ga(e.artifact)){Ka(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),Ja(e.artifact,"id","$.artifact",t),Xa(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let a of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])ar(e.artifact,a,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(Ga(e.purpose))if(Array.isArray(e.purpose.intents)){Ka(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,a)=>{(!Ga(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${a}].id`,message:"Expected a non-empty intent identifier."}),Ga(e)&&Ka(e,["id","strength","source","rationale"],`$.purpose.intents[${a}]`,t),Ga(e)&&void 0!==e.strength&&Xa(e,"strength",`$.purpose.intents[${a}]`,["primary","secondary"],t),Ga(e)&&(tr(e,"source",`$.purpose.intents[${a}]`,["author","derived","model-proposal","import"],t),ar(e,"rationale",`$.purpose.intents[${a}]`,t))});for(let a of["allowedUses","prohibitedUses"])er(Qa(e.purpose,a,"$.purpose",t),"$.purpose."+a,t);tr(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),ar(e.purpose,"communicativeAct","$.purpose",t),ar(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,a)=>{if(!Ga(e))return void t.push({path:`$.claims[${a}]`,message:"Expected a claim object."});Ka(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${a}]`,t),Ja(e,"id",`$.claims[${a}]`,t),Xa(e,"kind",`$.claims[${a}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),Xa(e,"status",`$.claims[${a}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${a}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${a}].evidenceIds`,message:"Expected an evidence identifier array."}),er(Qa(e,"supersedes",`$.claims[${a}]`,t),`$.claims[${a}].supersedes`,t),ar(e,"text",`$.claims[${a}]`,t),ar(e,"asOf",`$.claims[${a}]`,t),Ya(e,"scope",`$.claims[${a}]`,t),er(Qa(e,"tags",`$.claims[${a}]`,t),`$.claims[${a}].tags`,t),void 0!==e.authoredBy&&rr(e.authoredBy,`$.claims[${a}].authoredBy`,t);let r=Za(e,"review",`$.claims[${a}]`,t);r&&(Ka(r,["status","reviewer","reviewedAt","rationale"],`$.claims[${a}].review`,t),Xa(r,"status",`$.claims[${a}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==r.reviewer&&rr(r.reviewer,`$.claims[${a}].review.reviewer`,t),ar(r,"reviewedAt",`$.claims[${a}].review`,t),ar(r,"rationale",`$.claims[${a}].review`,t));let i=Za(e,"uncertainty",`$.claims[${a}]`,t);if(i){Ka(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${a}].uncertainty`,t),Xa(i,"kind",`$.claims[${a}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])qa(i,e,`$.claims[${a}].uncertainty`,t);ar(i,"unit",`$.claims[${a}].uncertainty`,t),ar(i,"description",`$.claims[${a}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,a)=>{if(!Ga(e))return void t.push({path:`$.evidence[${a}]`,message:"Expected an evidence object."});Ka(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${a}]`,t),Ja(e,"id",`$.evidence[${a}]`,t),Xa(e,"role",`$.evidence[${a}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let r of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])ar(e,r,`$.evidence[${a}]`,t);Ya(e,"scope",`$.evidence[${a}]`,t);let r=Za(e,"source",`$.evidence[${a}]`,t);if(r){Ka(r,["name","uri","version","retrievedAt","publisher"],`$.evidence[${a}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])ar(r,e,`$.evidence[${a}].source`,t)}let i=Za(e,"transformation",`$.evidence[${a}]`,t);if(i){Ka(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${a}].transformation`,t),Ja(i,"id",`$.evidence[${a}].transformation`,t),Xa(i,"kind",`$.evidence[${a}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=Qa(i,"inputEvidenceIds",`$.evidence[${a}].transformation`,t);e?er(e,`$.evidence[${a}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${a}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),er(Qa(i,"assumptions",`$.evidence[${a}].transformation`,t),`$.evidence[${a}].transformation.assumptions`,t),ar(i,"description",`$.evidence[${a}].transformation`,t),ar(i,"implementation",`$.evidence[${a}].transformation`,t),ar(i,"performedAt",`$.evidence[${a}].transformation`,t),Ya(i,"parameters",`$.evidence[${a}].transformation`,t),void 0!==i.performedBy&&rr(i.performedBy,`$.evidence[${a}].transformation.performedBy`,t)}let o=Za(e,"sample",`$.evidence[${a}]`,t);if(o){Ka(o,["rowCount","fields","values","truncated"],`$.evidence[${a}].sample`,t),er(Qa(o,"fields",`$.evidence[${a}].sample`,t),`$.evidence[${a}].sample.fields`,t);let e=Qa(o,"values",`$.evidence[${a}].sample`,t);e&&!function(e){return e.every(Wa)}(e)&&t.push({path:`$.evidence[${a}].sample.values`,message:"Expected JSON values."}),qa(o,"rowCount",`$.evidence[${a}].sample`,t),Ha(o,"truncated",`$.evidence[${a}].sample`,t)}tr(e,"relationship",`$.evidence[${a}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),function(e,t){if(void 0===e||Ga(e)){if(Ga(e))for(let[a,r]of Object.entries(e)){let e="$.fieldStatus."+a;if(!Ga(r)||"string"!=typeof r.status){t.push({path:e,message:"Expected a field state with a status."});continue}Ka(r,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(r.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==r.suppliedBy&&("string"!=typeof r.suppliedBy||!["author","system","model-proposal","import"].includes(r.suppliedBy))&&t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),ar(r,"reason",e,t),ar(r,"reviewedBy",e,t),Ha(r,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(Cn,a)?Cn[a]:void 0,o="model-proposal"===r.suppliedBy,n=o&&!0===i?.modelMayPropose&&"known"!==r.status;i&&"known"===r.status&&"string"!=typeof r.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${a}" must identify an allowed supplier.`}),i&&"string"==typeof r.suppliedBy&&!n&&!i.suppliedBy.includes(r.suppliedBy)&&t.push({path:e+".suppliedBy",message:`Field "${a}" cannot be supplied by ${r.suppliedBy}.`}),i&&!0===r.derived&&!i.derivable&&t.push({path:e+".derived",message:`Field "${a}" cannot be marked as derived.`}),i&&o&&(!i.modelMayPropose||"known"===r.status)&&t.push({path:e+".suppliedBy",message:"known"===r.status?`A model proposal cannot finalize field "${a}" as known.`:`Field "${a}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===r.status&&("string"!=typeof r.reviewedBy||!r.reviewedBy.trim())&&t.push({path:e+".reviewedBy",message:`Known field "${a}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}(e.fieldStatus,t);let i=Za(e,"time","$",t);return i&&function(e,t){let a="$.time";Ka(e,[...Rn,...Object.keys(Pn),"sources"],a,t);for(let r of Rn)ar(e,r,a,t);for(let[r,i]of Object.entries(Pn)){let o=Za(e,r,a,t);o&&Va(o,i,`${a}.${r}`,t)}Qa(e,"sources",a,t)?.forEach((e,r)=>{let i=`${a}.sources[${r}]`;Ga(e)?Va(e,In,i,t):t.push({path:i,message:"Expected a source object."})})}(i,t),function(e,t){(function(e,t){let a=Za(e,"reception","$",t);if(!a)return;Ka(a,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let r=Qa(a,"channels","$.reception",t);r||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),r?.forEach((e,a)=>{let r=`$.reception.channels[${a}]`;Ga(e)?(Ka(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],r,t),Xa(e,"channel",r,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),tr(e,"disclosure",r,["summary","standard","detailed"],t),tr(e,"rawData",r,["deny","bounded","allow"],t),Ha(e,"navigation",r,t),Ha(e,"interactionInstructions",r,t),qa(e,"tokenBudget",r,t),er(Qa(e,"privacyNotes",r,t),r+".privacyNotes",t)):t.push({path:r,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])er(Qa(a,e,"$.reception",t),"$.reception."+e,t);ar(a,"audience","$.reception",t),ar(a,"description","$.reception",t),Ha(a,"dataFallback","$.reception",t)})(e,t),function(e,t){let a=Za(e,"form","$",t);a&&(Ka(a,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),ar(a,"chartFamily","$.form",t),ar(a,"whyThisForm","$.form",t),er(Qa(a,"risks","$.form",t),"$.form.risks",t),er(Qa(a,"misuse","$.form",t),"$.form.misuse",t),Qa(a,"rejectedAlternatives","$.form",t)?.forEach((e,a)=>{let r=`$.form.rejectedAlternatives[${a}]`;Ga(e)?(Ka(e,["representation","reason"],r,t),Ja(e,"representation",r,t),Ja(e,"reason",r,t)):t.push({path:r,message:"Expected an alternative object."})}))}(e,t),function(e,t){let a=Za(e,"contestability","$",t);a&&(Ka(a,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),Ha(a,"sourceRequestsAllowed","$.contestability",t),Qa(a,"challenges","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.challenges[${a}]`;if(Ga(e)){Ka(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],r,t),Ja(e,"id",r,t),Ja(e,"claimId",r,t),Ja(e,"reason",r,t),Xa(e,"status",r,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&rr(e.raisedBy,r+".raisedBy",t);for(let a of["raisedAt","counterclaimId","resolution"])ar(e,a,r,t)}else t.push({path:r,message:"Expected a challenge object."})}),Qa(a,"corrections","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.corrections[${a}]`;if(!Ga(e))return void t.push({path:r,message:"Expected a correction object."});Ka(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],r,t),Ja(e,"id",r,t),Ja(e,"reason",r,t);let i=Qa(e,"affectedClaimIds",r,t);i||t.push({path:r+".affectedClaimIds",message:"Expected an affected-claim array."}),er(i,r+".affectedClaimIds",t),er(Qa(e,"replacementClaimIds",r,t),r+".replacementClaimIds",t),ar(e,"createdAt",r,t),void 0!==e.createdBy&&rr(e.createdBy,r+".createdBy",t)}),Qa(a,"alternativeViews","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.alternativeViews[${a}]`;Ga(e)?(Ka(e,["id","label","rationale"],r,t),Ja(e,"id",r,t),Ja(e,"label",r,t),ar(e,"rationale",r,t)):t.push({path:r,message:"Expected an alternative-view object."})}),Qa(a,"editorialExceptions","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.editorialExceptions[${a}]`;Ga(e)?(Ka(e,["ruleId","rationale","owner","reviewAt"],r,t),Ja(e,"ruleId",r,t),Ja(e,"rationale",r,t),ar(e,"owner",r,t),ar(e,"reviewAt",r,t)):t.push({path:r,message:"Expected an editorial-exception object."})}))}(e,t),function(e,t){let a=Za(e,"accountability","$",t);a&&(Ka(a,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),Qa(a,"authors","$.accountability",t)?.forEach((e,a)=>rr(e,`$.accountability.authors[${a}]`,t)),er(Qa(a,"dataSources","$.accountability",t),"$.accountability.dataSources",t),ar(a,"generatedBy","$.accountability",t),ar(a,"codeRef","$.accountability",t),Qa(a,"reviews","$.accountability",t)?.forEach((e,a)=>{let r=`$.accountability.reviews[${a}]`;if(Ga(e)){Ka(e,["id","status","reviewer","reviewedAt","rationale","policyId"],r,t),Ja(e,"id",r,t),Xa(e,"status",r,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&rr(e.reviewer,r+".reviewer",t);for(let a of["reviewedAt","rationale","policyId"])ar(e,a,r,t)}else t.push({path:r,message:"Expected a review object."})}),Qa(a,"actions","$.accountability",t)?.forEach((e,a)=>{let r=`$.accountability.actions[${a}]`;if(!Ga(e))return void t.push({path:r,message:"Expected an action object."});Ka(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],r,t),Ja(e,"id",r,t),Ja(e,"action",r,t);let i=Qa(e,"claimIds",r,t);i||t.push({path:r+".claimIds",message:"Expected a claim identifier array."}),er(i,r+".claimIds",t),void 0!==e.actor&&rr(e.actor,r+".actor",t);for(let a of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])ar(e,a,r,t);tr(e,"status",r,["proposed","taken","reversed","invalidated"],t)}))}(e,t),function(e,t){let a=Za(e,"inheritance","$",t);if(a){Ka(a,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])er(Qa(a,e,"$.inheritance",t),"$.inheritance."+e,t);tr(a,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),tr(a,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),tr(a,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}(e,t)}(e,t),Ya(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&a.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&a.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:a}}(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function nr(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function sr(e,t={}){try{return function(e,t){if(!nr(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let a=Da(e),r=[...new Set([...a.excludedPaths,..._e(e)])].sort(),i=a.value,o=function(e,t){if(!t||!nr(e)||!Array.isArray(e.evidence))return[];let a=[];return e.evidence.forEach((e,t)=>{nr(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,a.push(`$.evidence[${t}].sample`))}),a}(i,t.excludeEvidenceSamples),n=o.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...r,...o],warnings:["Artifact contract is missing a string contractVersion.",...n]}};if("0.1"!==s)return{contract:i,transfer:{status:r.length>0?"invalid":"unsupported-version",omittedPaths:[...r,...o],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...r.length>0?[`Non-JSON values could not be preserved at: ${r.join(", ")}.`]:[],...n]}};let l=or(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...r.length?[`Non-JSON values could not be preserved at: ${r.join(", ")}.`]:[],...n];return{contract:i,transfer:{status:!l.valid||r.length>0?"invalid":o.length>0?"excluded":"preserved",omittedPaths:[...r,...o],warnings:c}}}(e,t)}catch{let t=_e(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function lr(e){let t=Object.entries(e).filter(([e,t])=>Oa(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function cr(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!Oa(e,t)&&"recipeId"!==e))}function ur(e,t,a){let r=function(e,t,a,r=lr(t)){let i=cr(t),o=0===_e(i).length?Ua(i).fingerprint:void 0,n=void 0!==r&&0===_e(r).length?function(e,t=[]){if(void 0===e)return;let a=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return Ua(a.length>0?{data:e,transformations:a}:e).fingerprint}(r,e.evidence):void 0,s="ChartRecipe"===a&&"string"==typeof t.recipeId?t.recipeId:a,l=[],c=[];return void 0!==s&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==s&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===o?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==o&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&n?e.artifact.dataFingerprint!==n&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}(e,t,a);return{mismatchPaths:[...r.mismatchPaths,...void 0!==a&&r.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function dr(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function hr(e){if(!e||"object"!=typeof e)return!1;let t=e,a=t.serializedDataFingerprint;return"string"==typeof t.status&&Nn.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==a||"string"==typeof a)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function pr(e,t,a,r){return Ua({component:t,version:r.version,createdAt:r.createdAt,...void 0!==r.recipeId?{recipeId:r.recipeId}:{},...void 0!==r.portable?{portable:r.portable}:{},...void 0!==r.manifest?{manifest:r.manifest}:{},...void 0!==r.reason?{reason:r.reason}:{},...void 0!==r.warnings?{warnings:r.warnings}:{},...void 0!==r.selections?{selections:r.selections}:{},artifactContract:a,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function mr(e,t,a,r,i){let o=lr(a),n={...e,serializedConfigFingerprint:Ua(cr(a)).fingerprint,serializedDataFingerprint:void 0===o?null:Ua(o).fingerprint};return{...n,transferFingerprint:pr(n,t,r,i)}}function fr(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let a,r;if("props"===t||t.startsWith("props.")?(a=e,r=t):(a=e.artifactContract,r=t.startsWith("$.")?t.slice(2):t),"$"===r||""===r)return void 0!==a;let i=[...r.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(let e of i){if(null===a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,e))return!1;a=a[e]}return!0}function gr(e,t,a,r,i){if(!t)return{};let o=function(e){let t=sr(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}(t),n=i.recipeId??e,s=ur(t,a,n),l=function(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(a=>{if(Object.prototype.hasOwnProperty.call(e,a)!==Object.prototype.hasOwnProperty.call(t,a))return!0;let r=Ua(e[a]),i=Ua(t[a]);return r.excludedPaths.length>0||r.fingerprint!==i.fingerprint}).map(e=>"props."+e).sort()}(a,r),c=ur(t,r,n);return s.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:mr({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,r,o.contract,i)}:l.length>0?{artifactContract:o.contract,artifactTransfer:mr({status:"excluded",omittedPaths:l,warnings:["Chart props or data were excluded from the serialized configuration."]},e,r,o.contract,i)}:c.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:mr({status:"invalid",omittedPaths:c.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,r,o.contract,i)}:{artifactContract:o.contract,artifactTransfer:mr(o.transfer,e,r,o.contract,i)}}function yr(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(hr(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){let t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&fr(e,t));return 0===t.length?{artifactTransfer:En(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}let t=sr(e.artifactContract),a=e.artifactTransfer,r=t.transfer,i=(()=>{if(!a)return{status:"invalid",omittedPaths:[...new Set([...r.omittedPaths,"artifactTransfer"])],warnings:[...r.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!hr(a))return{status:"invalid",omittedPaths:r.omittedPaths,warnings:[...r.warnings,"The declared artifact transfer report is malformed."]};let t="excluded"===a.status||"unsupported-version"===a.status?a.omittedPaths.filter(t=>fr(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[...new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[...r.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===a.status&&a.omittedPaths.length>0||"excluded"===a.status&&0===a.omittedPaths.length?{status:"invalid",omittedPaths:[...new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[...r.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:a.status===r.status||"preserved"===r.status&&("excluded"===a.status||"invalid"===a.status)&&a.omittedPaths.length>0?En(a):{status:"invalid",omittedPaths:[...new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[...new Set([...a.warnings,...r.warnings,`Declared artifact transfer status ${a.status} does not match the restored contract status ${r.status}.`])]}})();if(a&&hr(a)){let t=function(e,t){let a=[],r=Ua(cr(t.props)).fingerprint,i=lr(t.props),o=void 0===i?null:Ua(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==pr(e,t.component,t.artifactContract,t)&&a.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==r&&a.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==o&&a.push("artifactTransfer.serializedDataFingerprint"),a}(a,e),r="invalid"!==a.status,o=[...r&&void 0===a.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...r&&!Object.prototype.hasOwnProperty.call(a,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...r&&void 0===a.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||o.length>0)&&(i={status:"invalid",omittedPaths:[...new Set([...i.omittedPaths,...t,...o])],warnings:[...new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&"0.1"===t.contract?.contractVersion){let a=ur(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!function(e,t){let a=t.map(dr).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?a.some(e=>vn.has(e)):"artifact.configFingerprint"===e&&a.some(e=>!vn.has(e))}(e,i.omittedPaths));a.length>0&&(i={status:"invalid",omittedPaths:[...new Set([...i.omittedPaths,...a])],warnings:[...new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function br(e,t,a){Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0})}function vr(e,t){return!(!Oa(e,t)||"areas"===e&&"string"==typeof t)}function wr(e,t,a){if(a?.selections&&_e(a.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");let r=Ue(e)??Ge(t.recipe)??Ge(t.recipeId);if(r)return function(e,t,a){let r=!1!==a?.includeData,i=_e(e);if("portable"===e.portability&&i.length>0)throw Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);let o=function(e,t,a){let r={};for(let[i,o]of Object.entries(e))if(null!=o&&!Tn.has(i)&&"recipeId"!==i&&(t||!vr(i,o))){if("function"==typeof o){if(a)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}if(_e(o).length>0){if(a)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}br(r,i,On(o))}return r}(t,r,"portable"===e.portability),n=e.intents.map($t).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,l=s?Ve(s):void 0,c=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(l&&c&&(l.version!==c.version||l.fingerprint!==c.fingerprint))throw Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);let u=l??c;if("portable"===e.portability&&s&&!u)throw Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);let d={name:e.name,intents:n,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:Ua(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=(new Date).toISOString();if("portable"===e.portability){if(_e(o).length>0)throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);let r={version:Mn,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...a?.selections?{selections:a.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:o,manifest:d,version:Mn,createdAt:h,...gr("ChartRecipe",a?.artifactContract,t,o,r),...a?.selections?{selections:a.selections}:{}}}let p="Recipe contains or may depend on non-serializable local layout callbacks.",m=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],f={version:Mn,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:m,...a?.selections?{selections:a.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:m,props:o,manifest:d,version:Mn,createdAt:h,...gr("ChartRecipe",a?.artifactContract,t,o,f),...a?.selections?{selections:a.selections}:{}}}(r,t,a);if(!Ta(e))throw Error(`Unknown component "${e}". Known components: ${yn.join(", ")}`);let i=!1!==a?.includeData,o={};for(let[e,a]of Object.entries(t))if(null!=a&&!Tn.has(e)&&(i||!vr(e,a))&&"function"!=typeof a&&0>=_e(a).length)try{br(o,e,On(a))}catch{}let n=(new Date).toISOString(),s={version:Mn,createdAt:n,...a?.selections?{selections:a.selections}:{}};return{component:e,props:o,version:Mn,createdAt:n,...gr(e,a?.artifactContract,t,o,s),...a?.selections?{selections:a.selections}:{}}}function Ar(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function xr(e){if(!Ar(e))throw Error("Invalid chart config: expected a plain object");let t=_e(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==Mn)throw Error(`Unsupported chart config version ${e.version+""}; expected ${Mn}.`);if("string"!=typeof e.component||!e.component.trim())throw Error("Invalid chart config: missing component");if(!Ar(e.props))throw Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!Ar(e.selections))throw Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!Ar(e.manifest))throw Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw Error("Invalid chart config: malformed recipe manifest")}}function $r(e){if(xr(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");let t=Ue(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==Ua(t).fingerprint)throw Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){let a=e.manifest.layoutId,r=a?function(e){return De().layouts.get(e)?.layout}(a):void 0,i=a?Ve(a):void 0,o=r?i:i??(t.layout&&"object"==typeof t.layout&&t.layout.id===a&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0);if(!o||o.version!==e.manifest.layoutVersion||o.fingerprint!==e.manifest.layoutFingerprint)throw Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...On(e.props),recipeId:e.recipeId},...yr(e)}}if(!Ta(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:On(e.props),...yr(e)}}function Cr(e,t={}){xr(e);let a=JSON.stringify(e),r="sc="+btoa(unescape(encodeURIComponent(a))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");if(void 0!==t.maxLength&&r.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${r.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return r}function Sr(e){let t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");let a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a))),i=JSON.parse(r);return xr(i),i}async function kr(e,t="json"){let a="jsx"===t?Rr(e):JSON.stringify(e,null,2);if(typeof navigator>="u"||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(a)}function Rr(e){xr(e);let{props:t}=e,a="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==a&&!Ta(a))throw Error(`Cannot project unknown component "${a}" to JSX.`);let r=["<"+a];e.recipeId&&r.push(` recipeId={${Ir(e.recipeId)}}`);for(let[e,a]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){let t={};Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),r.push(` {...${Ir(t)}}`);continue}if("string"==typeof a)r.push(Pr(a)?` ${e}="${a}"`:` ${e}={${Ir(a)}}`);else if("boolean"==typeof a&&!0===a)r.push(" "+e);else if("boolean"==typeof a&&!1===a)r.push(` ${e}={false}`);else if("number"==typeof a)r.push(` ${e}={${a}}`);else{let t=Ir(a);r.push(80>t.length?` ${e}={${t}}`:` ${e}={${Ir(a,2)}}`)}}return r.push("/>"),r.join("\n")}function Pr(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function Ir(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Nr(e){let t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:Rr(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function Er(e){let t=Object.create(null);for(let[a,r]of e){let e=[];for(let[,t]of r.clauses){let a=Object.create(null);for(let[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t}function Mr(e){let t=new Map;for(let[a,r]of Object.entries(e)){let e=new Map;for(let t of r.clauses){let a=Object.create(null);for(let[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t}async function Tr(e,t){let{format:a="png",filename:r="chart",scale:i=2,background:o="white"}=t||{},n=e.querySelector("svg");if(!n)throw Error("No SVG element found in the container");let s=n.cloneNode(!0),l=n.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",l.width+""),s.getAttribute("height")||s.setAttribute("height",l.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Or(n,s),"svg"===a){let e=(new XMLSerializer).serializeToString(s);Fr(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{let t=l.width*i,a=l.height*i,n=document.createElement("canvas");n.width=t,n.height=a;let c=n.getContext("2d");c.fillStyle=o,c.fillRect(0,0,t,a),c.scale(i,i);let u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);let d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),m=new Image;m.width=l.width,m.height=l.height,await new Promise((e,t)=>{m.onload=()=>{c.drawImage(m,0,0),n.toBlob(a=>{a?(Fr(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},m.onerror=()=>{URL.revokeObjectURL(p),t(Error("Failed to load SVG image"))},m.src=p})}}function Or(e,t){let a=e.children,r=t.children,i=window.getComputedStyle(e),o=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(let e of o){let a=i.getPropertyValue(e);a&&"none"!==a&&""!==a&&t.style?.setProperty(e,a)}for(let e=0;Math.min(a.length,r.length)>e;e++)Or(a[e],r[e])}function Fr(e,t){let a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function jr(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[a,r]of Object.entries(e))a.startsWith("_")||null==r||""===r||("number"==typeof r?Number.isFinite(r)&&(t[a]=r):"string"==typeof r?t[a]=r:"boolean"==typeof r?t[a]=r+"":r instanceof Date&&(t[a]=r.toISOString().slice(0,10)));return t}function zr(e){return e&&"object"==typeof e?e:{}}function Br(e){return zr(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Lr(e){let t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function _r(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function Dr(e){return"number"==typeof e&&Number.isFinite(e)}function Ur(e){if(Dr(e.x)&&Dr(e.y)&&Dr(e.w)&&Dr(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(Dr(e.x)&&Dr(e.y)&&Dr(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(Dr(e.cx)&&Dr(e.cy)&&Dr(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(Dr(e.cx)&&Dr(e.cy)&&Dr(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};let t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&Dr(e[0])&&Dr(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Vr(e,t){let a=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),r=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return r>0?a/r:0}function Gr(e,t,a,r,i){if(e===t)return!0;let o=a.dataRoles.map(e=>Rt(e,r,i)).filter(e=>!!e).filter(a=>null!=e[a]&&null!=t[a]);return o.length>0&&o.every(a=>e[a]+""==t[a]+"")}function qr(e,t,a,r,i,o="warn",n){return{id:e,category:t,status:a?"pass":o,message:a?r:i,...n?{evidence:n}:{}}}function Hr(e){let{recipe:t}=e,a=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(e.scene),r=e.layoutConfig??Ct({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},o=i.x??0,n=i.y??0,s=[],l=a.filter(e=>null!=_r(e)),c=a.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(qr("geometry.finite","geometry",0===c.length,"All emitted geometry is finite.",c.length+" marks contain non-finite geometry.","fail",{count:c.length}));let u=a.map(Ur),d=u.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;s.push(qr("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",d+" marks have zero or negative area.","warn",{count:d}));let h=u.filter(e=>e&&(o>e.x0||n>e.y0||e.x1>o+i.width||e.y1>n+i.height)).length;s.push(qr("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",h+" marks extend outside the plot bounds.","warn",{count:h}));let p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,f=u.filter(e=>!!e&&(p>e.x1-e.x0||p>e.y1-e.y0)).length;s.push(qr("interaction.target-size","interaction",0===f,`All bounded targets meet the declared ${p}px minimum.`,`${f} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:f,minimumTarget:p}));let g=l.map(Lr),y=g.filter(e=>!e).length,b=new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));s.push(qr("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",y+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:y})),s.push(qr("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",v.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(v)].slice(0,10)}));let w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:w+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});let A=new Set,x=0,$=e.inputData;for(let e of l){let a=_r(e),i=Array.isArray(a)?a:[a],o=!1;for(let e of i)if(e&&"object"==typeof e)for(let a=0;$.length>a;a+=1)Gr(e,$[a],t,r,$)&&(A.add(a),o=!0);o||(x+=1)}let C=Math.max(0,$.length-A.size);s.push(qr("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",C+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:$.length})),s.push(qr("coverage.scene-data","coverage",0===x,"Every data-bearing scene mark maps back to input data.",x+" scene marks do not map back to an input datum.","warn",{count:x})),!t.encodings?.some(e=>"count"===e.channel)&&l.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});let S=l.filter(e=>!1===e.interactive).length;s.push(qr("interaction.hit-targets","interaction",0===S&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":S+" data-bearing marks explicitly disable interaction.","fail"));let k=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),R=k.filter(e=>!b.has(e));s.push(qr("coverage.annotation-anchors","coverage",0===R.length,k.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",R.length+" annotations point to missing scene ids.","fail",{unresolved:R}));let P=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&s.push(qr("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",P.length+" selected ids are not reachable in the scene.","fail",{missing:P}));let I=function(e){let t=[];if(!Array.isArray(e))return t;let a=e.some(e=>e&&("line"===e.type||"area"===e.type));for(let r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(a)break;t.push({label:"Point",values:jr(Br(r))});break;case"line":case"area":{let e=Br(r),a=Array.isArray(e)?e:[],i="line"===r.type?"Line point":"Area point";for(let e of a)t.push({label:i,values:jr(e)});break}case"rect":{let e=Br(r),a=null!=e&&"object"==typeof e?e:{},i=a.category??r.group??"",o=a.value??a.__aggregateValue??a.total,n=jr(a);null==n.category&&""!==i&&(n.category=i+""),null==n.value&&null!=o&&(n.value="number"==typeof o||"string"==typeof o?o:o+""),t.push({label:"Bar",values:n});break}case"heatcell":{let e=jr(Br(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=Br(r),a=jr(e);if(null==a.category){let t=zr(e),r=t.category??t.label;null!=r&&(a.category=r+"")}t.push({label:"Wedge",values:a});break}case"circle":t.push({label:"Node",values:jr(Br(r))});break;case"arc":t.push({label:"Arc",values:jr(Br(r))});break;case"candlestick":t.push({label:"Candlestick",values:jr(Br(r))});break;case"geoarea":{let e=zr(Br(r)),a=jr(e);if(null==a.name){let t=zr(e.properties).name??e.name;null!=t&&(a.name=t+"")}t.push({label:"Region",values:a});break}}}catch{}return t}(a),N=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;let a=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return a?Rt(a,r,$):void 0}).filter(e=>!!e),E=new Set(I.flatMap(e=>Object.keys(e.values))),M=N.filter(e=>!E.has(e));s.push(qr("accessibility.table-fields","accessibility",0===M.length,N.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${M.join(", ")}.`,"fail",{expectedFields:N,observedFields:[...E]})),new Set($.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=E.size&&[...E].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});let T=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(qr("accessibility.color-only","accessibility",0===T.length,"Every declared color encoding names a redundant cue.",T.length+" color encodings have no declared redundant cue.","warn"));let O=e.chart;if(O){for(let[e,a]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])a&&s.push(qr("accessibility."+e,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(qr("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&s.push(qr("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}let F=e.theme?.background??"#ffffff",j=a.filter(e=>{let t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!F.startsWith("#"))return!1;let a=m(t,F);return null!=a&&3>a}).length;s.push(qr("visual.contrast","visual",0===j,"All statically checkable mark fills meet 3:1 contrast.",j+" marks have fill contrast below 3:1.","warn",{background:F}));let z=0,B=u.filter(e=>!!e).slice(0,500);for(let e=0;B.length>e;e+=1)for(let t=e+1;B.length>t;t+=1)Vr(B[e],B[t])>=.8&&(z+=1);z>B.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:z+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});let L=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),_={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map($t).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},D=[...s,...L],U=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===U,summary:{marks:a.length,passes:D.filter(e=>"pass"===e.status).length,warnings:D.filter(e=>"warn"===e.status).length,failures:U,manual:D.filter(e=>"manual"===e.status).length},declaredSemantics:_,observedSceneEvidence:s,manualATChecks:L}}function Wr(e){let t=1/0,a=-1/0;for(let r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}function Yr(e){return"nominal"===e||"ordinal"===e}function Kr(e){return"quantitative"===e||"temporal"===e}function Jr(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;let t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;let{layer:a,...r}=e,{usermeta:i,...o}=t[0];return{...r,...o}}(e);let t,a=[],{type:r,markProps:i}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};let{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),o=e.encoding||{},n=o.x,s=o.y,l=o.color,c=o.size,u=o.theta,d=o.opacity;e.data?.values?t=e.data.values:e.data?.url&&a.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&a.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&a.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&a.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&a.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&a.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&a.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");let h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);let p=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(p&&(h.title=p),l?.field&&(h.colorBy=l.field,l.scale?.scheme)){let e=Fn[l.scale.scheme];e&&(h.colorScheme=e)}void 0!==d?.value&&(h.pointOpacity=d.value);let m,f=n?.aggregate,g=s?.aggregate;if(t&&(f||g)){let e=g?s:n,a=g?n:s,r=zn[e.aggregate];if(r&&a?.field&&e.field)t=function(e,t){let{groupBy:a,value:r,agg:i="sum"}=t,o=new Map,n="min"===i?1/0:"max"===i?-1/0:0;for(let t of e){let e=t[a]+"",s=o.get(e);s||(s={total:n,count:0},o.set(e,s));let l=Number(t[r]);switch(s.count++,i){case"count":break;case"min":s.total>l&&(s.total=l);break;case"max":l>s.total&&(s.total=l);break;default:s.total+=l}}let s=[];for(let[e,t]of o){let r="count"===i?t.count:"mean"===i?t.total/t.count:t.total;s.push({[a]:e,value:r})}return s}(t,{groupBy:a.field,value:e.field,agg:r});else if(("count"===r||"count"===e.aggregate)&&a?.field&&t){let e=new Map;for(let r of t){let t=r[a.field]+"";e.set(t,(e.get(t)||0)+1)}t=Array.from(e,([e,t])=>({[a.field]:e,value:t}))}}if(n?.bin||s?.bin){let e="Histogram";t&&(h.data=t),n?.bin?(h.valueAccessor=n.field,s?.field&&(h.categoryAccessor=s.field),n.axis?.title&&(h.valueLabel=n.axis.title)):s?.bin&&(h.valueAccessor=s.field,n?.field&&(h.categoryAccessor=n.field),s.axis?.title&&(h.valueLabel=s.axis.title));let r=n?.bin||s?.bin,i="object"==typeof r?r.maxbins:void 0;return i&&(h.bins=i),Zr(e,h,a)}switch(r){case"bar":m=function(e,t,a,r,i,o,n){let s;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",r.stackBy=a.field):s="BarChart",Yr(e?.type)&&Kr(t?.type)?(r.categoryAccessor=e.field,r.valueAccessor=n?"value":t.field,e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)):Kr(e?.type)&&Yr(t?.type)?(r.categoryAccessor=t.field,r.valueAccessor=o?"value":e.field,r.orientation="horizontal",t?.axis?.title&&(r.categoryLabel=t.axis.title),e?.axis?.title&&(r.valueLabel=e.axis.title)):(e?.field&&(r.categoryAccessor=e.field),t?.field&&(r.valueAccessor=n?"value":t.field),e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)),i&&(r.data=i),s}(n,s,l,h,t,f,g);break;case"line":if(m="LineChart",Xr(n,s,h,f,g),l?.field&&(h.lineBy=l.field),i.interpolate){let e=jn[i.interpolate];e&&(h.curve=e)}!0===i.point&&(h.showPoints=!0),t&&(h.data=t);break;case"area":if(l?.field?(m="StackedAreaChart",h.areaBy=l.field):m="AreaChart",Xr(n,s,h,f,g),i.interpolate){let e=jn[i.interpolate];e&&(h.curve=e)}void 0!==i.opacity&&(h.areaOpacity=i.opacity),t&&(h.data=t);break;case"point":case"circle":case"square":c?.field?(m="BubbleChart",h.sizeBy=c.field,c.scale?.range&&(h.sizeRange=c.scale.range)):m="Scatterplot",Xr(n,s,h,f,g),t&&(h.data=t);break;case"rect":m="Heatmap",n?.field&&(h.xAccessor=n.field),s?.field&&(h.yAccessor=s.field),l?.field&&(h.valueAccessor=l.field,delete h.colorBy),n?.axis?.title&&(h.xLabel=n.axis.title),s?.axis?.title&&(h.yLabel=s.axis.title),t&&(h.data=t);break;case"arc":i.innerRadius&&i.innerRadius>0?(m="DonutChart",h.innerRadius=i.innerRadius):m="PieChart",u?.field?h.valueAccessor=u.field:s?.field&&(h.valueAccessor=g?"value":s.field),l?.field&&(h.categoryAccessor=l.field),n?.field&&!u?.field&&(h.categoryAccessor=n.field),t&&(h.data=t);break;case"tick":m="DotPlot",Yr(n?.type)?(h.categoryAccessor=n.field,s?.field&&(h.valueAccessor=g?"value":s.field),n?.axis?.title&&(h.categoryLabel=n.axis.title),s?.axis?.title&&(h.valueLabel=s.axis.title)):Yr(s?.type)?(h.categoryAccessor=s.field,n?.field&&(h.valueAccessor=f?"value":n.field),h.orientation="horizontal",s?.axis?.title&&(h.categoryLabel=s.axis.title),n?.axis?.title&&(h.valueLabel=n.axis.title)):(n?.field&&(h.categoryAccessor=n.field),s?.field&&(h.valueAccessor=g?"value":s.field)),t&&(h.data=t);break;default:a.push(`Unsupported mark type "${r}". Defaulting to Scatterplot.`),m="Scatterplot",Xr(n,s,h,f,g),t&&(h.data=t)}return Zr(m,h,a)}function Xr(e,t,a,r,i){e?.field&&(a.xAccessor=r?"value":e.field),t?.field&&(a.yAccessor=i?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function Zr(e,t,a){let r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(let e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}function Qr(e,t){for(let a of t){let t=e.find(e=>e.lower===a);if(t)return t}}function ei({chrome:e="default",className:t="",style:a,children:r,...i}){let o="default"===e?{...Hn,...a}:a;return qn("div",{...i,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:o,children:r})}function ti(e){return e.ownsChrome=!0,e}function ai(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function ri(e){if(!Gn.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let a=e.props,r=a["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;let i=a.style;return!(!i||"object"!=typeof i||!ai(i.background)&&!ai(i.backgroundColor))}function ii(e,t){return"function"==typeof t?t(e):e[t]}function oi(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";let 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 ni(e={}){let{fields:t,title:a,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let n,s=[];if(a){let t=ii(e,a);n=oi(t,r)}if(t&&t.length>0)t.forEach(t=>{let a,i,o;"string"==typeof t?(a=t,i=t,o=r):(a=t.label,i=t.accessor||t.key||"",o=t.format||r);let n=ii(e,i);s.push({label:a,value:oi(n,o)})});else if(!a){let t=["value","y","name","id","label"];for(let a of t)if(void 0!==e[a]){n=oi(e[a],r);break}if(!n){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(n=oi(e[t[0]],r))}}return Yn(ei,{className:o,style:i,children:[n&&Wn("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:n}),s.map((e,t)=>Yn("div",{style:{marginTop:0===t&&n?"4px":0},children:[e.label&&Yn("span",{children:[e.label,": "]}),e.value]},t))]})}}function si(e={}){let{fields:t=[],title:a,format:r,style:i={},className:o="",showLabels:n=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let l=[];if(a){let t=ii(e,a);l.push({value:oi(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let a,i,o;"string"==typeof t?(a=t,i=t,o=r):(a=t.label,i=t.accessor||t.key||"",o=t.format||r);let s=oi(ii(e,i),o);l.push({label:n?a:void 0,value:s})});else{let t=function(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let a=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(let[t,a]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(r&&Vn.has(e)||null==a)continue;let o=typeof a;"string"!==o&&"number"!==o&&"boolean"!==o&&!(a instanceof Date)||i.push({key:t,lower:e,value:a})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>_n.includes(e.lower)),n=o>=0;0>o&&(o=i.findIndex(e=>"id"===e.lower)),0>o&&(o=i.findIndex(e=>"string"==typeof e.value));let s=0>o?void 0:i[o],l=i.filter((e,t)=>t!==o&&(!n||"id"!==e.lower)),c=Qr(l,Dn),u=Qr(l,Un),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of l){if(d.length>=a)break;Dn.includes(e.lower)||Un.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:oi(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:n?e.key:void 0,value:oi(e.value,r)})})}return Array.isArray(l)&&0!==l.length?Wn(ei,{className:("semiotic-tooltip-multiline "+o).trim(),style:i,children:l.map((e,t)=>Yn("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&Yn("strong",{children:[e.label,s]}),e.value]},t))}):null}}function li(e){return"multi"===e||ci(e)}function ci(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function ui(e){let{tooltip:t,defaultTooltipContent:a,multiDefaultContent:r=hi(),customFunctionContext:i="datum"}=e,o=t;return!1===t?{tooltipContent:()=>null}:li(o)?{tooltipContent:(ci(o)&&"function"==typeof o.content?pi(o.content):void 0)||r,tooltipMode:"multi"}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:pi(o)||a}}function di(e){let{tooltip:t,defaultTooltipContent:a,customFunctionContext:r="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:pi(t)||a}}function hi(){return e=>{let t=e.allSeries;if(!t||0===t.length)return Wn(ei,{children:Wn("div",{children:oi(e.data?.value??e.data?.y)})});let a=e.xValue??e.data?.time??e.data?.x;return Yn(ei,{children:[null!=a&&Wn("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:oi(a)}),t.map((e,t)=>Yn("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[Wn("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),Wn("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),Wn("span",{style:{fontWeight:500,fontSize:"0.85em"},children:oi(e.value)})]},t))]})}}function pi(e){if(!0!==e){if("function"==typeof e){let t=e;return e=>{let a=!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),r=Array.isArray(i=a?e.data??{}:e)?i[0]:i;var i;if(!r||(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r))return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){let t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}let o=t(r);return null==o?null:ri(o)?o:Wn(ei,{children:o})}}if(!1===e||void 0===e)return!1;if(ci(e)){if("function"==typeof e.content)return pi(e.content);"u">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.');let t=si();return pi(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=ni(e);return pi(e=>t(e))}if("multi"===e){"u">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.');let e=si();return pi(t=>e(t))}return ni()}}function mi(e=240){let t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}function fi(e,t,a,r,i){let o=a-t||1;return i+(Math.max(t,Math.min(a,e))-t)/o*r}function gi(e=240){let{sweepRad:t,offsetRad:a}=mi(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)t+.001>=((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)&&r.push([Math.cos(e),Math.sin(e)]);let i=r.map(e=>e[0]),o=r.map(e=>e[1]),[n,s]=Wr(i),[l,c]=Wr(o);return{minX:n,maxX:s,minY:l,maxY:c,width:s-n,height:c-l,cx:(n+s)/2,cy:(l+c)/2}}var yi=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],bi={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},vi={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},wi={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:yi,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},Ai=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],xi={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},$i={light:bi,dark:vi,"high-contrast":wi,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},Ci=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),Si=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),ki=Object.freeze({name:"Semiotic balanced",weights:Ci,thresholds:Si,minimumScore:70}),Ri=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(Ci).map(e=>[e,0]))),minimumScore:0}),Pi=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],Ii=new Set(["category10","tableau10"]),Ni=new Set(["DonutChart","PieChart","SwimlaneChart"]),Ei={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};import*as Mi from"react";var Ti=864e5,Oi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fi=null;import{jsx as ji,jsxs as zi}from"react/jsx-runtime";var Bi=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["string","object"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],Li=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],_i={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},xyAxis:{xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:13,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:14,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},Di=Object.fromEntries(Object.entries({MotifBraidChart:[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,atlas:10,colorScheme:7,linkedHover:14,selection:10,onClick:12}],DependencyForestChart:[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:14,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],FlowCircuitChart:[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:14,linkedSelection:10,onSelectNode:12,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],BarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:17,onBrush:12,regression:14}],StackedBarChart:[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],GroupedBarChart:[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],SwarmPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],BoxPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],Histogram:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],ViolinPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],RidgelinePlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],DotPlot:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:14}],PieChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],DonutChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],GaugeChart:[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0,styleRules:9}],FunnelChart:[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],RadarChart:[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],SwimlaneChart:[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],LikertChart:[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],LineChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:17,onBrush:12}],BumpChart:[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],AreaChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],DifferenceChart:[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],StackedAreaChart:[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],Scatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10,brush:4,linkedBrush:17,onBrush:12}],BubbleChart:[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,brush:4,linkedBrush:17,onBrush:12}],Heatmap:[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],QuadrantChart:[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],MultiAxisLineChart:[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],WaterfallChart:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],CandlestickChart:[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],ConnectedScatterplot:[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],ScatterplotMatrix:[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],MinimapChart:[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],ForceDirectedGraph:[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],SankeyDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],ProcessSankey:[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],ChordDiagram:[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],TreeDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],Treemap:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],CirclePack:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],OrbitDiagram:[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],ChoroplethMap:[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],ProportionalSymbolMap:[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],FlowMap:[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],DistanceCartogram:[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],RealtimeLineChart:[[],"realtime",[],["realtime"],{styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,aggregate:10,eventTime:10,transition:10}],RealtimeHistogram:[["binSize"],"realtime",[],["realtime"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,binSize:1,direction:[0,47],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],TemporalHistogram:[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,data:9,binSize:1,size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,47],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],RealtimeSwarmChart:[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],RealtimeWaterfallChart:[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],RealtimeHeatmap:[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],GaltonBoardChart:[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,48],simulationMode:[0,49],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],EventDropChart:[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],UnitPileChart:[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,48],simulationMode:[0,49],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],CollisionSwarmChart:[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],GauntletChart:[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,50],terminalBehavior:[0,51]}],CrucibleChart:[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,52],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],ProcessFlowChart:[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,53],groupCompletion:[0,54],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,55],seed:1}],PacketFlowChart:[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,56],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,57],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],ChainReactionChart:[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,58],insight:[0,59],currentTime:2,controls:20,mechanism:[0,60],orientation:[0,61],reducedMotion:[0,62],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],BigNumber:[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,63],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,63],showDeltaPercent:4,direction:[0,64],sentiment:[0,65],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,66],align:[0,67],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]}).map(([e,[t,a,r,i,o]])=>[e,{required:[...t],dataShape:a,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...i.map(e=>_i[e]),o)).map(([e,t])=>[e,Y(t)]))}])),Ui=new Set(["start","center","end","left","right"]),Vi={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};import{interpolateLab as Gi}from"d3-interpolate";var qi=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Hi=new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),Wi=new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),Yi=new Set(["LineChart","AreaChart","StackedAreaChart"]),Ki=new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),Ji=new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),Xi=new Set(["PieChart","DonutChart"]),Zi={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},Qi=new Set(Object.keys(Zi)),eo={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},to=new Set(["BigNumber"]),ao=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),ro=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),io=new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),oo=new Set(["OrbitDiagram",...io]),no=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),so=new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),lo=new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),co=new Set(["MultiAxisLineChart"]),uo=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),ho={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},po=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),mo=new Set(["label","callout","callout-circle","callout-rect"]),fo=["xExtent","yExtent","rExtent"],go=/^\d{4}-\d{1,2}$/,yo=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],bo={fields:yo},vo=[{...yo[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...yo[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],wo={fields:vo},Ao={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},xo={...Ao,domain:!0},$o={fields:[{...Ao,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Co={fields:[Ao],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},So={fields:vo,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},ko={fields:[...yo,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Ro={fields:[...yo,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Po={fields:[Ao]},Io={fields:[{...Ao,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},No={LineChart:wo,AreaChart:wo,BumpChart:wo,Scatterplot:Ro,ConnectedScatterplot:bo,QuadrantChart:Ro,MinimapChart:wo,BubbleChart:ko,StackedAreaChart:So,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Po,BarChart:{fields:[Ao]},GroupedBarChart:{fields:[Ao]},StackedBarChart:Co,DotPlot:{fields:[xo]},Histogram:{fields:[xo]},BoxPlot:{fields:[xo]},SwarmPlot:{fields:[xo,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[xo]},RidgelinePlot:{fields:[xo]},PieChart:$o,DonutChart:$o,FunnelChart:$o,SankeyDiagram:Io,ChordDiagram:Io,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Eo=Symbol.for("semiotic.numericContractRegistry"),Mo={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},To=new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),Oo=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],Fo=["title","description","summary"],jo=new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),zo=new Set([...jo,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),Bo=new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),Lo=Symbol.for("semiotic.chartRecipeRegistry"),_o={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Do=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],Uo={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},Vo={error:0,warning:1,manual:2},Go={data:0,deception:1,accessibility:2,render:3},qo=new Set([...ao,"RealtimeLineChart","RealtimeHeatmap"]),Ho=Object.fromEntries(Object.entries(ho).map(([e,t])=>[e,[t,"hoverRadius"]])),Wo={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},Yo=["layout","density","interaction","annotation","semantics"],Ko=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Jo=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Xo=new Set(["PieChart","DonutChart","FunnelChart"]),Zo=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Qo={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"},en=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),tn=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),an=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),rn={"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"},on={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},nn=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],sn={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},ln=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),cn=new Set(["system","agent","watcher"]),un=new Set(["ai","agent","system","computed","dbt","great-expectations"]),dn=new Set(["rule","statistical-test","llm-inference","computed"]),hn={"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"},pn=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),mn=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),fn=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),gn=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),yn=["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],bn=new Set(yn),vn=new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),wn=(e,t)=>(e>>>t|e<<32-t)>>>0,An=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[xn,$n]=(()=>{let e=[],t=[];for(let a=2;64>t.length;a+=1){let r=!0;for(let e=2;a>=e*e;e+=1)if(a%e===0){r=!1;break}r&&(8>e.length&&e.push(An(Math.sqrt(a))),t.push(An(Math.cbrt(a))))}return[e,t]})(),Cn=ir({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Sn=["fresh","stale","unknown"],kn=["partial","provisional","settled","unknown"],Rn=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Pn={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Sn},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:kn},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},In={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Sn},completeness:{values:kn}},Nn=new Set(["preserved","unsupported-version","invalid","excluded"]),En="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Mn="1",Tn=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),On="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Fn={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"},jn={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"},zn={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"},Bn=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let a of e){let e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){let e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");let t=this.toArray(),a=0,r=[];t.length>e&&(a=t.length-e,r=t.slice(0,a)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=a;t.length>e;e++)this.push(t[e]);return r}update(e,t){let a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++){let o=(r+i)%this._capacity,n=this.buffer[o];if(e(n)){let e;e="object"!=typeof n||null===n?n:Array.isArray(n)?[...n]:{...n},a.push(e),this.buffer[o]=t(n)}}return a}remove(e){let t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},Ln=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){(e===this._min||e===this._max)&&(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(let a of e){let e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},_n=["name","label","title"],Dn=["type","kind","category","group","class","status","role","shape"],Un=["value","amount","total","count","weight","score"],Vn=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import*as Gn from"react";import{jsx as qn}from"react/jsx-runtime";var Hn={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"};ti(ei);import{jsx as Wn,jsxs as Yn}from"react/jsx-runtime";export{Ri as AESTHETICS_OFF_PROFILE,xi as CARBON_ALERT,Ai as CARBON_CATEGORICAL_14,yi as COLOR_BLIND_SAFE_CATEGORICAL,vi as DARK_THEME,ki as DEFAULT_AESTHETIC_PROFILE,Si as DEFAULT_AESTHETIC_THRESHOLDS,Ci as DEFAULT_AESTHETIC_WEIGHTS,wi as HIGH_CONTRAST_THEME,Ln as IncrementalExtent,bi as LIGHT_THEME,si as MultiLineTooltip,hi as MultiPointTooltip,Bn as RingBuffer,$i as THEME_PRESETS,ni as Tooltip,ei as TooltipRoot,Ke as accessibilityCaveats,O as adaptiveTimeTicks,Ye as auditAccessibility,Pe as auditData,mt as auditMobileVisualization,Hr as auditObservedScene,w as auditVisualHierarchy,ga as buildNavigationTree,Ea as buildReaderGrounding,jt as communicativeActForIntent,d as composeStyleRules,gi as computeArcBoundingBox,Rr as configToJSX,Nr as configToJSXWithReport,kr as copyConfig,ba as countNodes,L as createHatchPattern,j as darkenColor,Ut as describeChart,Mr as deserializeSelections,Te as diagnoseConfig,N as evaluateAesthetics,tt as evaluateChart,Tr as exportChart,ya as flattenVisible,Je as formatAccessibilityAudit,fe as formatDataAudit,et as formatEvaluateChart,ft as formatMobileVisualizationAudit,$r as fromConfig,Sr as fromURL,Jr as fromVegaLite,Ma as getHitRadius,ri as hasOwnTooltipChrome,U as hatchFillId,D as hatchFillKey,_ as isHatchFill,li as isMultiTooltip,z as lightenColor,n as makeNodeRuleContext,i as makeRuleValueResolver,h as makeStyleRuleStyleFn,o as makeXYRuleContext,ti as markTooltipChrome,l as matchesThreshold,gt as mobileVisualizationCaveats,pi as normalizeTooltip,me as profileNumericFields,zt as resolveCommunicativeAct,ui as resolveMultiCapableTooltip,F as resolveResponsiveDimension,ot as resolveResponsiveRules,u as resolveStyleRules,e as resolveThemePreset,di as resolveTooltipContent,it as responsiveRuleMatches,c as ruleMatches,Er as serializeSelections,E as smartTickFormat,mi as sweepToAngles,a as themeToCSS,t as themeToCSSVariables,r as themeToTokens,wr as toConfig,ye as toDataAuditNotifications,at as toEvaluateChartNotifications,Cr as toURL,X as unwrapDatum,J as validateProps,fi as valueToAngle};
1
+ function e(e){return Object.prototype.hasOwnProperty.call(Vs,e)?Vs[e]:void 0}function t(e){let t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,a)=>{t["--semiotic-category-"+(a+1)]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);let a=e.typography.legendSize??e.typography.labelSize;null!=a&&(t["--semiotic-legend-font-size"]=a+"px"),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");let r=e.typography.titleFontSize??e.typography.titleSize;return null!=r&&(t["--semiotic-title-font-size"]=r+"px"),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),t}function a(e,a=":root"){return`${a} {\n${Object.entries(t(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function r(e){return{semiotic:{bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},focus:{$value:e.colors.focus||e.colors.primary,$type:"color"},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"border-radius":{$value:e.borderRadius||"8px",$type:"dimension"},tooltip:{bg:{$value:e.tooltip?.background||e.colors.background,$type:"color"},text:{$value:e.tooltip?.text||e.colors.text,$type:"color"},radius:{$value:e.tooltip?.borderRadius||"6px",$type:"dimension"},"font-size":{$value:e.tooltip?.fontSize||"14px",$type:"dimension"},shadow:{$value:e.tooltip?.shadow||"0 2px 8px rgba(0,0,0,0.15)",$type:"shadow"}},selection:{color:{$value:e.colors.selection||e.colors.primary,$type:"color"},opacity:{$value:e.colors.selectionOpacity??.2,$type:"number"}},categorical:{$value:e.colors.categorical,$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:e.typography.legendSize+"px",$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},"title-font-size":{$value:(e.typography.titleFontSize??e.typography.titleSize)+"px",$type:"dimension"},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:e.typography.tickSize+"px",$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:e.typography.labelSize+"px",$type:"dimension"}}:{},secondary:{$value:e.colors.secondary||e.colors.primary,$type:"color"},surface:{$value:e.colors.surface||e.colors.background,$type:"color"},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function i(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>s(t(e))}function o(e,t){let a=i(e),r=i(t);return(e,t)=>{let i=r(e);return{value:i,x:a(e),y:i,category:t}}}function n(e,t){let a=i(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=r?r(e):void 0;return{value:a(e),category:null==t?void 0:t+""}}}function s(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function l(e,t,a){let r=null!=e.axis?a[e.axis]:null!=e.field?t[e.field]:a.value;if(void 0!==e.eq&&r!==e.eq||void 0!==e.ne&&r===e.ne||void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let i=s(r);if(void 0===i||void 0!==e.gt&&e.gt>=i||void 0!==e.gte&&e.gte>i||void 0!==e.lt&&i>=e.lt||void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){let[t,a]=e.within;if(t>i||i>a)return!1}if(void 0!==e.outside){let[t,a]=e.outside;if(i>=t&&a>=i)return!1}return!0}function c(e,t,a){let r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,a):l(r,t,a))}function u(e,t,a){if(!t||0===t.length)return{};let r={};for(let i of t){if(!c(i,e,a))continue;let t="function"==typeof i.style?i.style(e,a):i.style;t&&(r={...r,...t})}return r}function d(e,t,a,r=e=>e){let i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{let n=r(e),s={...i(e,o)};return Object.assign(s,u(n,t,a(n,o))),s}:i}function h(e,t,a){return e&&0!==e.length?(r,i)=>{let o=u(r,e,t(r,i)),n=a?a(r,i):void 0;return n?{...o,...n}:o}:a}function p(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));let a=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!a)return null;let[r,i,o]=[parseInt(a[1],16)/255,parseInt(a[2],16)/255,parseInt(a[3],16)/255],n=e=>e>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92;return.2126*n(r)+.7152*n(i)+.0722*n(o)}function f(e,t){let a=p(e),r=p(t);return null===a||null===r?null:(Math.max(a,r)+.05)/(Math.min(a,r)+.05)}function m(e){return Math.min(255,Math.max(0,Math.round(e)))}function g(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),a=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(a){let e=a.length>4?a:a.split("").map(e=>`${e}${e}`).join("");return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let r=t.match(/^rgba?\(\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))\s*,\s*(-?(?:\d+|\d*\.\d+))(?:\s*,\s*(-?(?:\d+|\d*\.\d+)))?\s*\)$/);if(!r)return null;let i=[Number(r[1]),Number(r[2]),Number(r[3])],o=void 0===r[4]?1:Number(r[4]);return i.some(e=>!Number.isFinite(e)||0>e||e>255)||!Number.isFinite(o)||0>o||o>1?null:{r:i[0],g:i[1],b:i[2],a:o}}function y(e,t){return 1>t.a?null:{r:m(e.r*e.a+t.r*(1-e.a)),g:m(e.g*e.a+t.g*(1-e.a)),b:m(e.b*e.a+t.b*(1-e.a)),a:1}}function b(e){return 1>e.a?null:"#"+[e.r,e.g,e.b].map(e=>m(e).toString(16).padStart(2,"0")).join("")}function v(e){if("string"!=typeof e||""===e.trim())return;let t=g(e);return t?b(t)??`rgba(${m(t.r)},${m(t.g)},${m(t.b)},${t.a})`:e.trim().toLowerCase()}function w(e,t,a){let r=g(e),i=g(t);if(!r||!i)return null;let o=y({...r,a:r.a*Math.min(1,Math.max(0,a))},i);return o?b(o):null}function A(e){let t=g(e.backgroundColor),a=t?b(t):null,r=w(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=r&&a?f(r,a):null,o=e.dataColors.map(t=>w(t,e.backgroundColor,1)).map(e=>e&&a?f(e,a):null).filter(e=>null!==e);if(null===i||o.length!==e.dataColors.length||0===o.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};let n=Math.min(...o),s=n/i,l={weakestDataContrast:n,scaffoldContrast:i,hierarchyRatio:s},c=Math.max(1,e.minimumScaffoldContrast??1.1);return c>i?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:3>n||i>Math.max(c,e.maximumScaffoldContrast??2)||Math.max(1,e.minimumHierarchyRatio??2)>s?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}:{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}}function x(e){return Math.min(1,Math.max(0,e))}function $(e,t){return Number.isFinite(e)?e:t}function C(e){let t=e.thresholds??{},a=Math.max(1,$(t.scaffoldContrastMin,Hs.scaffoldContrastMin)),r=x($(t.emphasisRatioMin,Hs.emphasisRatioMin));return{hierarchyRatio:Math.max(1,$(t.hierarchyRatio,Hs.hierarchyRatio)),scaffoldContrastMin:a,scaffoldContrastMax:Math.max(a,$(t.scaffoldContrastMax,Hs.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,$(t.titleScaleRatio,Hs.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round($(t.categoricalColorMax,Hs.categoricalColorMax))),emphasisRatioMin:r,emphasisRatioMax:Math.max(r,x($(t.emphasisRatioMax,Hs.emphasisRatioMax)))}}function S(e){return v(e)}function k(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(S).filter(e=>!!e)}function R(e){return Array.isArray(e)||e&&"object"==typeof e?k(e):[]}function P(e){return e.length>=4&&Ys.some(t=>e.length===t.length&&e.every((e,a)=>e===t[a]))}function I(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(e.stroke),...k(t?.fill),...k(t?.stroke)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of r)!e.style||"function"==typeof e.style||a.push(...k(e.style.fill),...k(e.style.stroke));return Array.from(new Set(a))}function E(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,a=[...R(e.colorScheme),...k(e.color),...k(e.fill),...k(t?.fill)],r=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of r)!e.style||"function"==typeof e.style||a.push(...k(e.style.fill));return Array.from(new Set(a))}function N(e,t){let a=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(a.map(e=>e[t]+""))):"function"==typeof t?Array.from(new Set(a.map((e,a)=>t(e,a)+""))):[]}function T(e){let t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[],r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",o=[];for(let e of a)!e.style||"function"==typeof e.style||t.some((t,a)=>c(e,t,{value:Number(t[r]),category:(t[i]??"")+"",index:a}))&&o.push(...k(e.style.fill));return Array.from(new Set(o))}function M(e,t,a){let r=R(t.colorScheme),i=k(t.color),o=N(t,t.colorBy),n=Js.has(e)?N(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,l=(e,t)=>e.map((e,r)=>S(s?.[e])??("gray"===t?"#999999":a.colors.categorical.length>0?a.colors.categorical[r%a.colors.categorical.length]:"#007bff")),c=o.length>0?s?l(o,"gray"):r.length>0?r:a.colors.categorical:i.length>0?i:n.length>0&&s?l(n,"theme"):r.length>0&&!s?r:a.colors.categorical,u=c.slice(0,o.length>0||n.length>0?Math.min(c.length,Math.max(1,o.length||n.length||1)):1),d=T(t).filter(e=>!u.includes(e));return Array.from(/* @__PURE__ */new Set([...u,...d]))}function O(e){let t=e.colors.surface??e.colors.background,a=g(t),r=g(e.colors.background);if(!a)return t;if(1===a.a)return b(a)??t;if(!r)return t;let i=y(a,r);return i?b(i)??t:t}function F(e,t){if(!e.evidence)return.5;let{weakestDataContrast:a,scaffoldContrast:r,hierarchyRatio:i}=e.evidence;return Math.min(x(a/3),x(r/t.scaffoldContrastMin),x(t.scaffoldContrastMax/r),x(i/t.hierarchyRatio))}function j(e,t,a,r,i,o,n){let s=a[e];return{id:e,label:Xs[e],status:0===s?"disabled":n??(.8>t?"warn":"pass"),score:t,weight:s,contribution:t*s,message:r,...o?.[e]?{rationale:o[e]}:{},evidence:i}}function z(e){return Math.max(1,e.length)}function B(e){let t=Array.isArray(e.data)?e.data:[],a=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===a.length)return{ratio:0,authored:!1};let r="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>a.some(a=>c(a,e,{value:Number(e[r]),category:(e[i]??"")+"",index:t}))).length/t.length,authored:!0}}function L(e,t,a={}){let r=a.theme??Bs,i=a.profile??r.aesthetics??qs,o={...Gs,...i.weights??{}};for(let e of Object.keys(o)){let t=o[e];o[e]=Number.isFinite(t)?Math.max(0,t):0}let n=C(i),s=M(e,t,r),l=A({backgroundColor:O(r),dataColors:s,scaffoldColor:r.colors.grid,minimumHierarchyRatio:n.hierarchyRatio,minimumScaffoldContrast:n.scaffoldContrastMin,maximumScaffoldContrast:n.scaffoldContrastMax}),c=I(t),u=P(r.colors.categorical.map(S).filter(e=>!!e)),d=E(t),h="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,p=d.length>0||h?"chart":"theme",f="chart"===p?P(d)||!!h&&Ks.has(h):u,m=f?.2:"chart"===p?1:.8,g=z(s),y=g>n.categoricalColorMax?x(1-(g-n.categoricalColorMax)/n.categoricalColorMax):1,b=r.typography.titleFontSize??r.typography.titleSize,v=Math.max(r.typography.tickSize,r.typography.labelSize),w=v>0?b/v:1,k=x((w-1)/(n.titleScaleRatio-1)),R=new Set([...r.colors.categorical,r.colors.primary,r.colors.secondary,r.colors.background,r.colors.surface,r.colors.text,r.colors.textSecondary,r.colors.grid,r.colors.border,r.colors.annotation].map(S).filter(e=>!!e)),N=c.filter(e=>!R.has(e)).length,T=0===c.length?1:x(1-N/c.length),L=B(t),_=L.authored?n.emphasisRatioMin>L.ratio?x(L.ratio/n.emphasisRatioMin):L.ratio>n.emphasisRatioMax?x(n.emphasisRatioMax/L.ratio):1:.35,D=[j("mark-scaffold-hierarchy",F(l,n),o,l.finding.message,{hierarchyRatio:l.evidence?.hierarchyRatio??0,markContrast:l.evidence?.weakestDataContrast??0,scaffoldContrast:l.evidence?.scaffoldContrast??0},i.rationales,l.status),j("palette-authorship",m,o,f?"theme"===p?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:p,ubiquitousDefault:f,colorCount:s.length},i.rationales),j("palette-economy",y,o,`${g} color role(s) are used against a policy ceiling of ${n.categoricalColorMax}.`,{colorRoles:g,maximum:n.categoricalColorMax},i.rationales),j("typographic-hierarchy",k,o,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:b,supportingSize:v,ratio:w},i.rationales),j("theme-coherence",T,o,`${N} of ${c.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:c.length,outsideTheme:N},i.rationales),j("editorial-emphasis",_,o,L.authored?Math.round(100*L.ratio)+"% of marks receive authored emphasis.":"No machine-visible editorial emphasis rule is declared.",{authored:L.authored,emphasizedRatio:L.ratio},i.rationales)],U=D.reduce((e,t)=>e+t.weight,0),V=D.reduce((e,t)=>e+t.contribution,0),G=0===U?null:V/U*100,H=100*x($(i.minimumScore,qs.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===G||G>=H,score:G,minimumScore:H,weightedPoints:V,totalWeight:U,features:D,method:"weighted-machine-visible-features"}}function _(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return e+"";if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),a=Math.abs(t);return 1e9>a?1e6>a?1e4>a?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}function D(e){if(2>e.length)return"days";let t=[];for(let a=1;e.length>a;a++)t.push(e[a]-e[a-1]);t.sort((e,t)=>e-t);let a=t[Math.floor(t.length/2)];return 2*Qs>a?"seconds":2*el>a?"minutes":2*tl>a?"hours":60*tl>a?"days":400*tl>a?"months":"years"}function U(e){return 10>e?"0"+e:e+""}function V(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}function G(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function H(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>G(e,!0)}return e=>{let a={};for(let r of t.formatToParts(e))"literal"!==r.type&&(a[r.type]=r.value);return{month:Math.max(0,(Number(a.month)||1)-1),day:Number(a.day)||1,year:Number(a.year)||1970,hours:Number(a.hour)||0,minutes:Number(a.minute)||0,seconds:Number(a.second)||0}}}function q(e){return"utc"===e.kind?e=>G(e,!0):"local"===e.kind?e=>G(e,!1):H(e.id)}function W(e,t,a){let{month:r,day:i,year:o,hours:n,minutes:s,seconds:l}=a(e),c=al[r],u=U(n),d=U(s),h=U(l);switch(t){case"seconds":return`${c} ${i}, ${o} ${u}:${d}:${h}`;case"minutes":case"hours":return`${c} ${i}, ${o} ${u}:${d}`;case"days":return`${c} ${i}, ${o}`;case"months":return`${c} ${o}`;case"years":return""+o}}function Y(e,t,a,r){let i=r(e),o=r(t),n=i.year!==o.year,s=n||i.month!==o.month,l=s||i.day!==o.day,c=l||i.hours!==o.hours,u=c||i.minutes!==o.minutes,d=al[i.month],{day:h,year:p}=i,f=U(i.hours),m=U(i.minutes),g=U(i.seconds);switch(a){case"seconds":return n?`${d} ${h}, ${p} ${f}:${m}:${g}`:l?`${d} ${h} ${f}:${m}:${g}`:c?`${f}:${m}:${g}`:u?`${m}:${g}`:":"+g;case"minutes":return n?`${d} ${h}, ${p} ${f}:${m}`:l?`${d} ${h} ${f}:${m}`:c?`${f}:${m}`:":"+m;case"hours":return n?`${d} ${h}, ${p} ${f}:00`:s?`${d} ${h} ${f}:${m}`:l?`${d} ${h} ${f}:00`:f+":00";case"days":return n?`${d} ${h}, ${p}`:s?`${d} ${h}`:""+h;case"months":return n?`${d} ${p}`:""+d;case"years":return""+p}}function K(e,t={}){let a,r=e,i=q(V(t));return(t,o,n)=>{let s=t instanceof Date?t:new Date(t);!e&&n&&n.length>=2&&n!==a&&(a=n,r=D(n));let l=r||"days";return null!=o&&0!==o&&n&&0!==n.length?Y(s,new Date(n[o-1]),l,i):W(s,l,i)}}function J(e,t=0,a=1/0,r=0){let i=Number.isFinite(t)?t:0,o=Number.isFinite(a)?Math.max(i,a):1/0,n=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,n));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function X(e,t=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;let r=Math.round(parseInt(a[1],16)*(1-t)),i=Math.round(parseInt(a[2],16)*(1-t)),o=Math.round(parseInt(a[3],16)*(1-t));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function Z(e,t=.5){let a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!a)return e;let r=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*t),i=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*t),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*t);return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function Q(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}function ee(e){return"u">typeof OffscreenCanvas?new OffscreenCanvas(e,e):(rl||(rl=document.createElement("canvas")),rl.width=e,rl.height=e,rl)}function te(e={},t){let a,{background:r="transparent",stroke:i="#000",lineWidth:o=1.5,spacing:n=6,angle:s=45}=e,l={background:r,stroke:i,lineWidth:o,spacing:n,angle:s},c=Math.max(8,Math.ceil(2*n));try{a=ee(c)}catch{return Q(l)}let u=a.getContext("2d");if(!u)return Q(l);r&&"transparent"!==r?(u.fillStyle=r,u.fillRect(0,0,c,c)):u.clearRect(0,0,c,c),u.strokeStyle=i,u.lineWidth=o,u.lineCap="square";let d=s*Math.PI/180;if(45===s||-45===s){let e=s>0?1:-1;for(let t=-c;2*c>=t;t+=n)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*c,c),u.stroke()}else{u.save(),u.translate(c/2,c/2),u.rotate(d);let e=2*c;for(let t=-e;e>=t;t+=n)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(a,"repeat")}function ae(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function re(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function ie(e,t){let a=2166136261,r=re(t);for(let e=0;r.length>e;e++)a^=r.charCodeAt(e),a=Math.imul(a,16777619);return`${e}-hatch-${(a>>>0).toString(36)}`}function oe(e,t){let a=e.length,r=t.length,i=Array(r+1);for(let e=0;r>=e;e++)i[e]=e;for(let o=1;a>=o;o++){let a=i[0];i[0]=o;for(let n=1;r>=n;n++){let r=i[n];i[n]=e[o-1]===t[n-1]?a:1+Math.min(a,i[n],i[n-1]),a=r}}return i[r]}function ne(e,t,a=3){let r,i=a+1;for(let a of t){let t=oe(e.toLowerCase(),a.toLowerCase());i>t&&(i=t,r=a)}return i>a?void 0:r}function se(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function le(e,t){if(0===t.length)return null;let a=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(a)||a.includes(e.toLowerCase()))||(ne(e,t,3)??null)}function ce(e){return` Or use a function: ${e}={d => d.myValue}.`}function ue({componentName:e,data:t,accessors:a,requiredProps:r}){if(r)for(let[t,a]of Object.entries(r))if(null==a)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(t)||0===t.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(a){let r=se(t).find(e=>e&&"object"==typeof e);if(r){let t=Object.keys(r);for(let[i,o]of Object.entries(a))if(o&&"string"==typeof o&&!(o in r)){let a=le(o,t),r=a?` Try ${i}="${a}".`:"";return`${e}: ${i} "${o}" not found in data. Available fields: ${t.join(", ")}.${r}`+ce(i)}}}return null}function de({componentName:e,data:t,dataLabel:a="data"}){return null==t?`${e}: No ${a} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${a} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function he({componentName:e,nodes:t,edges:a,nodesRequired:r=!1,edgesRequired:i=!0,accessors:o}){if(null==t&&null==a)return null;if(i&&(!a||!Array.isArray(a)||0===a.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(r&&(!t||!Array.isArray(t)||0===t.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(o&&t&&t.length>0){let a=se(t).find(e=>e&&"object"==typeof e);if(a){let t=Object.keys(a);for(let[r,i]of Object.entries(o))if(i&&"string"==typeof i&&!(i in a)){let a=le(i,t),o=a?` Try ${r}="${a}".`:"";return`${e}: ${r} "${i}" not found in node data. Available fields: ${t.join(", ")}.${o}`+ce(r)}}}return null}function pe(e){return sl.has(e)}function fe(e,t){return pe(e)&&!ll[t].includes(e)}function me(e){let[t,a]=Array.isArray(e)?e:[e,void 0],r=cl[t],i=Array.isArray(r)?[...r]:r;return void 0===a?{type:i}:{type:i,enum:[...ul[a]]}}function ge(){return Object.fromEntries(hl.map(([e,t,a,r,i],o)=>[nl[o],{required:[...e],dataShape:t,dataAccessors:[...a],props:Object.fromEntries(Object.entries(Object.assign({},...r.map(e=>dl[e]),i)).map(([e,t])=>[e,me(t)]))}]))}function ye(e,t){return(Array.isArray(t)?t:[t]).includes(Array.isArray(e)?"array":typeof e)}function be(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}function ve(e){if(!Array.isArray(e.thresholds))return[];let t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,a)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${a}]" for GaugeChart should be an object with numeric "value" and string "color".`);let r=e;("number"!=typeof r.value||!Number.isFinite(r.value))&&t.push(`"thresholds[${a}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),("string"!=typeof r.color||0===r.color.length)&&t.push(`"thresholds[${a}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==r.label&&"string"!=typeof r.label&&t.push(`"thresholds[${a}].label" for GaugeChart should be a string.`);let i=Object.keys(r).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${a}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}function we(e){let t=e.frameProps;if(null==t||"object"!=typeof t||Array.isArray(t))return[];let a=t.legendLayout;if(null==a||"object"!=typeof a||Array.isArray(a))return null==a?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(a)?"array":typeof a)+"."];let r=[],i=a,o=/* @__PURE__ */new Set(["align",...Object.keys(ml)]);for(let e of Object.keys(i))o.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...o].join(", ")}.`);void 0!==i.align&&"string"!=typeof i.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(i.align)?"array":typeof i.align}.`):"string"==typeof i.align&&!fl.has(i.align)&&r.push(`"frameProps.legendLayout.align" value "${i.align}" is not valid. Expected one of: ${[...fl].join(", ")}.`);for(let[e,t]of Object.entries(ml)){let a=i[e];void 0!==a&&("number"==typeof a&&Number.isFinite(a)?t.minimum>a&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${a}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(a)?"array":typeof a}.`))}return r}function Ae(e,t){let a=[];(null==t||"object"!=typeof t)&&(t={});let r=pl[e];if(!r)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(pl).join(", ")}`]};for(let i of r.required)null==t[i]&&a.push(`"${i}" is required for ${e}.`);"array"===r.dataShape&&Object.prototype.hasOwnProperty.call(r.props,"data")&&!r.required.includes("data")&&!be(e,t)&&null==t.data&&a.push(`"data" is required for ${e}.`);for(let[e,i]of Object.entries(t)){if(null==i)continue;let t=r.props[e];if(t){if(!ye(i,t.type)){let r=Array.isArray(t.type)?t.type.join(" | "):t.type;a.push(`"${e}" should be ${r}, got ${Array.isArray(i)?"array":typeof i}.`);continue}t.enum&&"string"==typeof i&&!t.enum.includes(i)&&a.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}let i=Object.keys(r.props),o=new Set(i);for(let r of Object.keys(t))if(void 0!==t[r]&&!o.has(r)){let t=ne(r,i),o=t?`Unknown prop "${r}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${r}" for ${e}. Valid props: ${i.join(", ")}.`;a.push(o)}if("array"===r.dataShape){let i=t.data,o={};for(let e of r.dataAccessors){let a=t[e];"string"==typeof a&&(o[e]=a)}let n=ue({componentName:e,data:i,accessors:Object.keys(o).length>0?o:void 0});n&&a.push(n)}else if("object"===r.dataShape){let r=de({componentName:e,data:t.data});r&&a.push(r)}else if("network"===r.dataShape){let i=t.nodeIdAccessor??t.nodeIDAccessor??"id",o="string"==typeof i?{nodeIdAccessor:i}:void 0,n=he({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:r.required.includes("nodes"),edgesRequired:r.required.includes("edges"),accessors:o});n&&a.push(n)}return"GaugeChart"===e&&a.push(...ve(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&a.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),a.push(...we(t)),{valid:0===a.length,errors:a}}function xe(e){return null==e?null:e.data??e.datum??e}function $e(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function Ce(e,t={}){let a=[],r=e.tokenSemantics,i=e.countStrategy,o=t.maxRecommendedTokens??("fixed-denominator"!==i||$e(e.denominator)>100?80:100);return r||a.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||a.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),("icon"===e.tokenType||"glyph"===e.tokenType)&&("icon-only"===e.labelPolicy||"token-only"===e.labelPolicy)&&a.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>o&&a.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"===r&&("icon"===e.tokenType||"glyph"===e.tokenType)&&a.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===r&&i&&"unitized"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===r&&i&&"fixed-denominator"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),("possible-outcome"===r||"posterior-sample"===r||"hypothetical-case"===r)&&i&&"quantile"!==i&&"sample"!==i&&"posterior-sample"!==i&&"random-sample"!==i&&a.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===r&&"unitized"===i&&null==e.unitValue&&null==e.unit&&a.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"===r&&"unitized"===i&&!e.unitMeaning&&a.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),a}function Se(e){return"string"==typeof e?.type?e.type:""}function ke(e){return!!e&&"object"==typeof e&&Bl.has(Se(e))}function Re(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function Pe(e){return Ll.has(Se(e))&&!Re(e)}function Ie(e,t,a={}){return"number"==typeof a.maxAnnotations&&Number.isFinite(a.maxAnnotations)?Math.max(0,Math.floor(a.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(a.areaPerAnnotation&&a.areaPerAnnotation>0?a.areaPerAnnotation:2e4))):1/0}function Ee(e){let t=e.provenance,a=e.id??e.stableId??t?.stableId;return null==a||""===a?void 0:a+""}function Ne(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(let e of r)!e||"object"!=typeof e||"widget"!==Se(e)||null==e.content||Ee(e)||a.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}function Te(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(r)for(let e of r){if(!e||"object"!=typeof e)continue;let t=Se(e);if(!ke(e)||"widget"===t)continue;let r=Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0),i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,o=Pe(e);!o&&r>120?a.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${i}" sits ~${Math.round(r)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):o&&r>250&&a.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${i}" uses a very long connector (~${Math.round(r)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}function Me(e,t,a){let r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return;let i=r.filter(ke).length;if(0===i)return;let o="number"==typeof t.width?t.width:600,n="number"==typeof t.height?t.height:400,s=Ie(o,n);!Number.isFinite(s)||s>=i||a.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${o}×${n} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}function Oe(e,t,a){for(let e of _l){let r=t[e];if(!Array.isArray(r)||2>r.length)continue;let[i,o]=r;"number"!=typeof i||"number"!=typeof o||i>o&&a.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${o}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${o}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}function Fe(e,t,a){if("MultiAxisLineChart"!==e)return;let r=t.series;if(!Array.isArray(r)||2!==r.length)return;let i=r.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&a.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}function je(e,t,a){if(!wl.has(e))return;let r=t.xExtent;if(!Array.isArray(r)||2>r.length)return;let[i,o]=r;if("number"!=typeof i||"number"!=typeof o||i>=o)return;let n=t.data;if(!n||!Array.isArray(n)||4>n.length)return;let s=t.xAccessor??"x";if("string"!=typeof s)return;let l=1/0,c=-1/0;for(let e of n){let t=e?.[s];"number"!=typeof t||!Number.isFinite(t)||(l>t&&(l=t),t>c&&(c=t))}if(!Number.isFinite(l)||!Number.isFinite(c)||l>=c)return;let u=c-l,d=Math.max(0,Math.min(o,c)-Math.max(i,l))/u;.7>d&&a.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${o}] shows only ~${Math.round(100*d)}% of the data's x range [${l}, ${c}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}function ze(e,t,a){let r=Cl[e],i=kl[e];if(!r&&!i||i&&!t.normalize)return;let o=r??i,n=t[o],s="string"==typeof n?n:"yAccessor"===o?"y":"value",l=t.data;if(!l||!Array.isArray(l)||0===l.length)return;let c=l.filter(e=>{let t=e?.[s];return"number"==typeof t&&0>t});c.length>0&&a.push({severity:r?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${c.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${r?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:r?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}function Be(e,t,a){xl.has(e)&&"basis"===t.curve&&a.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}function Le(e,t,a){if("LineChart"!==e&&"AreaChart"!==e||"sparkline"===t.mode||t.responsiveWidth||t.responsiveHeight)return;let r="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(0>=r||0>=i)return;let o=r/i;if(o>8||.25>o){let e=o>8?"flattens":"exaggerates";a.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${r}×${i} (${o.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:o>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}function _e(e,t,a){if(!$l.has(e))return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=t.categoryAccessor,o="string"==typeof i?i:"category",n=/* @__PURE__ */new Set;for(let e of r){let t=e?.[o];null!=t&&n.add(t)}n.size>8&&a.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:n.size+" slices — angle judgments degrade rapidly past ~8 categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.",fix:`Use a BarChart or DotPlot for ${n.size} categories, or group the long tail into an "Other" slice before charting.`})}function De(e,t,a){return"function"==typeof a?a(e,t):e[a]}function Ue(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Ve(e,t,a){return Math.max(t,Math.min(a,e))}function Ge(e,t){let a=Ue(e);return null!=a&&a>0?a:t}function He(e){if(!e)return;let t=Ue(e[0]),a=Ue(e[1]);return null!=t&&null!=a?t>a?[a,t]:[t,a]:void 0}function qe(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 We(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),a=t.length?t:["Intake"],r=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),i=Ge(e.unitValue,1),o=qe(e.seed??1),n=e.idPrefix??"mechanical-pile",s=a.map(()=>.65+.9*o()),l=s.reduce((e,t)=>e+t,0)||1,c=r-a.length,u=s.map(e=>e/l*c),d=u.map(e=>1+Math.floor(e)),h=r-d.reduce((e,t)=>e+t,0),p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return a.map((e,t)=>({id:`${n}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/r}))}function Ye(e,t){let a=e/t,r=Math.round(a);return Math.ceil(r>0&&Number.EPSILON*a*4>=Math.abs(a-r)?r:a)}function Ke(e,t,a=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),i=/* @__PURE__ */new Map;for(let o of e){let e=null==o.id?`${t}-${a++}`:o.id+"";for(;null==o.id&&r.has(e);)e=`${t}-${a++}`;r.add(e),i.set(e,null==o.id?{...o,id:e}:o)}return{seed:e,rows:Array.from(i.values()),nextId:a}}function Je(e){let t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function Xe(e,t,a){return"function"==typeof t?t(e):e?.["string"==typeof t?t:a]}function Ze(e,t,a){if(Ml.has(e)){if("GaltonBoardChart"===e){let e=t.bins;"number"==typeof e&&2>e&&a.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} leaves no meaningful settled projection for a Galton board.`,fix:"Use at least two bins; 8-24 bins is a practical range for physics distributions."});let r=Je(t.branchProbability);null!=t.branchProbability&&(null==r||0>r||r>1)&&a.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${t.branchProbability+""} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});let i=Je(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||0>=i)&&a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){let e=t.windows,r=e&&"object"==typeof e?Je(e.size):null;null!=r&&0>=r&&a.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${r} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&0>=t.timeScale&&a.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});let i=Array.isArray(t.data)?t.data:[];if(i.length>0){let e=t.timeAccessor||"time",r=t.arrivalAccessor||"arrivalTime";i.some(t=>{let a=Je(Xe(t,e,"time")),i=Je(Xe(t,r,"arrivalTime"));return null!=a&&null!=i&&a!==i})||a.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){let e="mechanical"===(t.simulationMode??t.mode),r=Je(t.mechanicalCount);null!=t.mechanicalCount&&(null==r||0>=r)&&a.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${t.mechanicalCount+""} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&a.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});let i=Ue(t.unitValue??1);if(null==i||0>=i)return void a.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});let o=e?We({count:r??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:Ue(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:n}=Ke(o,"pile"),s=t.valueAccessor??(e?"value":void 0),l=n.reduce((e,t,a)=>{let r="function"==typeof s?s(t,a):"string"==typeof s&&s?t[s]:1;return e+Ye(Math.max(0,Ue(r)??0),i)},0);l>1500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${l} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if(0>=(Je(t.pointRadius??5)??5)&&a.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),0>=(Je(t.collisionIterations??6)??6)&&a.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){let e=Array.isArray(t.xExtent)?t.xExtent:[],r=Je(e[0]),i=Je(e[1]);(2>e.length||null==r||null==i)&&a.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}let e=Array.isArray(t.data)?t.data:[];e.length>1200&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});let r=t.groupAccessor;if(e.length>0&&r){let t=/* @__PURE__ */new Set;for(let a of e){let e=Xe(a,r,"group");null!=e&&t.add(e)}t.size>12&&a.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if(("GaltonBoardChart"===e||"UnitPileChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e)&&(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&a.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:e+" appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.",fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),("UnitPileChart"===e||"GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"CrucibleChart"===e)&&!1===t.showProjection&&a.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:e+" has showProjection={false}. Without a settled projection, motion is easy to over-read as data.",fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){let e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)a.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===(e.id+"").trim())&&a.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});let r=e.filter(e=>e?.absorb).length;t.groupBy&&0===r&&a.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||a.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){let e=Array.isArray(t.phases)?t.phases:[],r=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],o=Array.isArray(t.outlets)?t.outlets:[];0===e.length?a.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===(e.id+"").trim()||null==Je(e.duration)||0>=Number(e.duration))&&a.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===r.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&a.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||a.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});let n=new Set(r.map(e=>e?.id).filter(e=>null!=e).map(String)),s=/* @__PURE__ */new Set(["product","retained","residue","failed","recovered",...o.map(e=>e?.id).filter(e=>null!=e).map(String)]),l=/* @__PURE__ */new Set,c=/* @__PURE__ */new Set;for(let e of i)if(e&&Array.isArray(e.effects))for(let t of e.effects){if(!t||"object"!=typeof t)continue;let e=t.type;if(("combine"===e||"contribute"===e||"complete-product"===e)&&null!=t.productId&&!n.has(t.productId+"")&&l.add(t.productId+""),"split"===e&&Array.isArray(t.products))for(let e of t.products)null!=e?.productId&&!n.has(e.productId+"")&&l.add(e.productId+"");null!=t.outletId&&!s.has(t.outletId+"")&&c.add(t.outletId+"")}l.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...l].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),c.size>0&&a.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...c].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});let u=Je(t.playbackRate);null!=t.playbackRate&&(null==u||0>=u)&&a.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${t.playbackRate+""} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});let d=Je(t.rerunMS);null!=t.rerunMS&&(null==d||0>d)&&a.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${t.rerunMS+""} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){let r=Array.isArray(t.data)?t.data:[],i=Je(t.mechanicalCount)??0,o=r.length>0?r.length:i;o>2500&&a.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(o)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}function Qe(e){let t=[],a=e.domain;null==a?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):(!Array.isArray(a)||2!==a.length||!Number.isFinite(Number(a[0]))||!Number.isFinite(Number(a[1])))&&t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});let r=e.edges;if(Array.isArray(r)&&r.length>0){let e=r[0];(null==e.startTime||null==e.endTime)&&t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}let i=e.nodes,o=Array.isArray(i)?i.length:0;return!0===e.showLabels&&o>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${o} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(r)?r.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function et(e){let t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;let a=Dl.test(t)?t+"-01":t;if(a===t&&10>t.length)return NaN;let r=Date.parse(a);return Number.isFinite(r)?r:NaN}function tt(e,t){let a=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof a?a:e.defaultNestedDataAccessor}function at(e,t,a){let r=e.dataProp??"data",i=t[r],o=a??(Array.isArray(i)?i:[]),n=tt(e,t);if(!n)return{dataProp:r,rows:o};let s=[],l=!1;for(let e of o){let t=e?.[n];if(Array.isArray(t)){l=!0;for(let e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:r,rows:l?s:o}}function rt(e,t,a){let r=/* @__PURE__ */new Set;for(let i of e.fields){let e=i.dataProp??"data",o=a??t[e];if(!Array.isArray(o))continue;if(0===o.length){r.add(e);continue}let n=tt(i,t);if(!n)continue;let s=o.map(e=>e?.[n]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&r.add(`${e}.${n}`)}return[...r]}function it(){let e=globalThis;return e[ac]??(e[ac]={contracts:/* @__PURE__ */new Map}),e[ac]}function ot(e){return it().contracts.get(e)??tc[e]}function nt(e,t,a){let r={numbers:a?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(let a of e){let e,i=a?.[t];if(null!=i&&""!==i){if("number"==typeof i)e=i;else if("string"==typeof i){let t=i.trim();if(""===t){r.missing++;continue}let a=Number(t);Number.isNaN(a)?/^[+-]?nan$/i.test(t)&&(e=a):e=a}void 0!==e?Number.isFinite(e)?(r.numbers?.push(e),r.finite++,r.min>e&&(r.min=e),e>r.max&&(r.max=e),0===e&&r.zero++,0>e&&r.negative++,Number.isInteger(e)||r.fractional++):r.nonFinite++:r.nonNumeric++}else r.missing++}return r}function st(e,t){if(0===e.length)return;let a=(e.length-1)*t,r=Math.floor(a),i=Math.ceil(a);if(r===i)return e[r];let o=a-r;return e[r]*(1-o)+e[i]*o}function lt(e,t={}){if(!Array.isArray(e)||0===e.length)return{};let a=/* @__PURE__ */new Set;for(let t of e)if(t&&"object"==typeof t)for(let e of Object.keys(t))a.add(e);let r={};for(let i of a){let a=nt(e,i,!1!==t.quantiles),o=a.numbers?.sort((e,t)=>e-t);r[i]={field:i,observedCount:e.length-a.missing,finiteCount:a.finite,missingCount:a.missing,nonFiniteCount:a.nonFinite,nonNumericCount:a.nonNumeric,zeroCount:a.zero,negativeCount:a.negative,fractionalCount:a.fractional,...a.finite>0?{min:a.min,...o?{q1:st(o,.25),median:st(o,.5),q3:st(o,.75)}:{},max:a.max}:{}}}return r}function ct(e){let t=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(let a of e.diagnoses)t.push(`${"error"===a.severity?"ERROR":"WARN"} ${a.code}${a.field?` [${a.field}]`:""}: ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function ut(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function dt(e,t={}){let a=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,r=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=r.slice(0,a).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${ut(e)} · ${e.field}`:ut(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return r.length>a&&i.push({id:"data-audit:overflow:chart",level:r.slice(a).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${r.length-a} more numeric finding${r.length-a===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function ht(e){let t=[];for(let[a,r]of Object.entries(rc))"string"!=typeof e[a]&&"function"!=typeof e[a]||t.push({role:r,accessor:a,..."size"===r?{requirements:["finite","non-negative"]}:{},..."x"===r||"y"===r?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}function pt(e,t,a){return"function"==typeof e?e(t,a):t[e]}function ft(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){let a=e.getTime();return t&&Number.isFinite(a)?a:null}if("string"==typeof e){let a=e.trim(),r=Number(a);if(a&&Number.isFinite(r))return r;if("date-like"===t){let e=et(a);return Number.isFinite(e)?e:null}}return null}function mt(e){return"number"==typeof e&&!Number.isFinite(e)}function gt(e,t,a,r,i){let o={field:a,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let a=0;e.length>a;a++){let n;try{n=pt(t,e[a],a)}catch{o.accessorErrorRows.push(a);continue}if(null==n||""===n){if(void 0!==i){o.numbers.push(i),o.finiteRows.push(a),0===i&&o.zeroRows.push(a),0>i&&o.negativeRows.push(a),Number.isInteger(i)||o.fractionalRows.push(a);continue}o.missingRows.push(a);continue}let s=ft(n,r);null!=s?(o.numbers.push(s),o.finiteRows.push(a),0===s&&o.zeroRows.push(a),0>s&&o.negativeRows.push(a),Number.isInteger(s)||o.fractionalRows.push(a)):mt(n)?o.nonFiniteRows.push(a):o.nonNumericRows.push(a)}return o}function yt(e,t){let a=new Set(e.requirements??["finite"]);return a.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&a.add("positive"),[...a]}function bt(e){let t=1/0,a=-1/0;for(let r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}function vt(e,t,a){let r=[],i=/* @__PURE__ */new Set;for(let o of e.fields){if(o.whenProps?.some(e=>null==t[e]))continue;let e=t[o.accessor],n="string"==typeof e||"function"==typeof e?e:o.defaultAccessor;if("string"!=typeof n&&"function"!=typeof n)continue;let{dataProp:s,rows:l}=at(o,t,a);if(0===l.length)continue;let c="string"==typeof n?n:o.accessor+"()",u=`${s}:${o.role}:${c}`;if(i.has(u))continue;i.add(u);let d=o.temporalValues??("time"===o.role||"x"===o.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===o.role&&"log"===t.xScaleType||"y"===o.role&&"log"===t.yScaleType,p=yt(o,t);r.push({contract:o,accessor:n,accessorLabel:c,dataProp:s,rows:l,requirements:p,logScale:h,observation:gt(l,n,c,d,o.missingValue)})}return r}function wt(e){return e.slice(0,5)}function At(e){return{domain:"data",...e}}function xt(e){let t=e.observation.numbers.map((t,a)=>({value:t,row:e.observation.finiteRows[a]})).sort((e,t)=>e.value-t.value);if(8>t.length)return[];let a=t.map(e=>e.value),r=st(a,.25),i=st(a,.75),o=st(a,.5),n=i-r;if(n>0){let e=r-10*n,a=i+10*n;return t.filter(t=>e>t.value||t.value>a).map(e=>e.row)}let s=100*Math.max(1,Math.abs(o));return t.filter(e=>Math.abs(e.value-o)>s).map(e=>e.row)}function $t(e,t){let a=[],{observation:r,contract:i,accessorLabel:o,requirements:n}=e,s={field:o,role:i.role},l=[...r.nonFiniteRows,...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(0===r.numbers.length)return a.push(At({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${o}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${o} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...l.length>0?{rows:wt(l),count:l.length}:{}})),a;r.nonFiniteRows.length>0&&a.push(At({severity:"error",code:"NON_FINITE_VALUE",message:`${o} contains ${r.nonFiniteRows.length} NaN or infinite value${1===r.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${o} before rendering.`,...s,rows:wt(r.nonFiniteRows),count:r.nonFiniteRows.length})),!i.allowMissing&&r.missingRows.length>0&&a.push(At({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${o} is missing for ${r.missingRows.length} row${1===r.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${o} values before rendering.`,...s,rows:wt(r.missingRows),count:r.missingRows.length}));let c=[...r.nonNumericRows,...r.accessorErrorRows].sort((e,t)=>e-t);if(c.length>0&&a.push(At({severity:"error",code:"NON_NUMERIC_VALUE",message:`${o} produces ${c.length} non-numeric value${1===c.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:wt(c),count:c.length})),i.domain&&r.numbers.length>=2){let[e,t]=bt(r.numbers);e===t&&a.push(At({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${o} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:wt(r.finiteRows),count:r.finiteRows.length}))}if(n.includes("positive")){let t=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(t.length>0){let r=e.logScale;a.push(At({severity:"error",code:r?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${o} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${r?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:r?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:wt(t),count:t.length}))}}if(n.includes("non-negative")&&r.negativeRows.length>0&&a.push(At({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${o} contains ${r.negativeRows.length} negative ${i.role} value${1===r.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:wt(r.negativeRows),count:r.negativeRows.length})),n.includes("integer")){let e=[.../* @__PURE__ */new Set([...r.negativeRows,...r.zeroRows,...r.fractionalRows])].sort((e,t)=>e-t);e.length>0&&a.push(At({severity:"error",code:"INVALID_COUNT",message:`${o} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:wt(e),count:e.length}))}if(n.includes("unit-interval")){let e=r.numbers.map((e,t)=>({number:e,row:r.finiteRows[t]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&a.push(At({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${o} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${o} to [0, 1] before using it as ${i.role}.`,...s,rows:wt(e),count:e.length}))}if(t&&i.domain){let t=xt(e);t.length>0&&a.push(At({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${o} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:wt(t),count:t.length}))}return a}function Ct(e,t,a){if(!e)return"__all__";try{return pt(e,t,a)+""}catch{return"__accessor_error__"}}function St(e,t,a){if(e.whenProp&&!0!==a[e.whenProp])return[];let r=t.find(t=>t.contract.role===e.role);if(!r||0===r.observation.numbers.length)return[];let i=e.groupAccessor?a[e.groupAccessor]:void 0,o="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,n=/* @__PURE__ */new Map;for(let e=0;r.rows.length>e;e++){let t;try{t=pt(r.accessor,r.rows[e],e)}catch{continue}let a=ft(t,void 0);if(null==a)continue;let i=Ct(o,r.rows[e],e),s=n.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=a,s.magnitude+=Math.abs(a),s.positive||(s.positive=a>0),s.negative||(s.negative=0>a),s.rows.push(e),0>a&&s.negativeRows.push(e),n.set(i,s)}let s=[],l=[],c=[],u=[],d=[],h=[];for(let[t,a]of n)("positive-total"===e.kind&&0>=a.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,a.magnitude)*10>=Math.abs(a.sum))&&(s.push(t),u.push(...a.rows)),"normalized-total"===e.kind&&a.positive&&a.negative&&(l.push(t),d.push(...a.rows)),"normalized-total"===e.kind&&a.negative&&(c.push(t),h.push(...a.negativeRows));let p=[];return s.length>0&&p.push(At({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:r.accessorLabel,role:e.role,rows:wt([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),c.length>0&&p.push(At({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${c.length} normalization group${1===c.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:r.accessorLabel,role:e.role,rows:wt([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),l.length>0&&p.push(At({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${l.length} normalization group${1===l.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:r.accessorLabel,role:e.role,rows:wt([...new Set(d)].sort((e,t)=>e-t)),count:l.length})),p}function kt(e,t,a,r={}){let i=r.contracts??ot(e)??ht(t);if(!i)return{component:e,ok:!0,rowCount:a?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};let o=vt(i,t,a),n=[],s=!1!==r.checkOutliers;for(let e of rt(i,t,a))n.push(At({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));let l=new Set(o.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(let e of l)n.push(At({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(let e of o)n.push(...$t(e,s));for(let e of i.aggregates??[])n.push(...St(e,o,t));let c=n.filter(e=>"error"===e.severity).length,u=n.length-c;return{component:e,ok:0===c,rowCount:o.reduce((e,t)=>Math.max(e,t.rows.length),a?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:o.length,errors:c,warnings:u},contracts:o.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:n}}function Rt(e,t,a){let r=pl[e];if(r){if("array"===r.dataShape){let e=t.data;e&&Array.isArray(e)&&0===e.length&&a.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===r.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&a.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}function Pt(e,t){for(let[a,r]of[["width",600],["height",400]]){let i=e[a];void 0!==i&&("number"!=typeof i||0>=i)&&t.push({severity:"error",code:"width"===a?"BAD_WIDTH":"BAD_HEIGHT",message:`${a}=${JSON.stringify(i)} — chart needs a positive number.`,fix:`Set ${a}={${r}}.`})}if(e.size&&Array.isArray(e.size)){let[a,r]=e.size;(null!=a&&0>=a||null!=r&&0>=r)&&t.push({severity:"error",code:"BAD_SIZE",message:`size=[${a}, ${r}] — both dimensions must be positive.`,fix:"Set size={[600, 400]}."})}}function It(e,t,a){let r=pl[e];if(!r||"array"!==r.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let o=i[0];if(!o||"object"!=typeof o)return;let n=Object.keys(o);for(let e of r.dataAccessors){let r=t[e];"string"==typeof r&&(r in o||a.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${r}" not found in data. Available fields: ${n.join(", ")}.`,fix:`Change ${e} to one of: ${n.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}function Et(e,t,a){yl.has(e)&&Array.isArray(t.data)&&a.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:e+" expects hierarchical data but received a flat array.",fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}function Nt(e,t,a){bl.has(e)&&!t.edges&&!t.data&&a.push({severity:"error",code:"NETWORK_NO_EDGES",message:e+" requires an edges prop.",fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'})}function Tt(e,t,a){let r=pl[e];if(!r||"array"!==r.dataShape)return;let i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;let o=i[0];if(!o||"object"!=typeof o)return;let n=t.xAccessor;"string"==typeof n&&o[n]instanceof Date&&!t.xFormat&&a.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${n}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}function Mt(e,t,a){t.linkedHover&&!t.selection&&a.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}function Ot(e,t,a){if(!wl.has(e)||t.gapStrategy)return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=t.yAccessor||"y";"string"==typeof i&&r.some(e=>{let t=e[i];return null==t||Number.isNaN(t)})&&a.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}function Ft(e,t,a){if(!vl.has(e))return;let r=t.rExtent||t.yExtent||t.valueExtent;r&&Array.isArray(r)&&r.length>=1&&null!=r[0]&&0!==r[0]&&a.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${r[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${r[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}function jt(e,t,a){if(!Al.has(e))return;let r=t.barPadding;"number"==typeof r&&10>r&&a.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${r} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}function zt(e,t,a){if("Heatmap"!==e)return;let r=t.data;if(!r||!Array.isArray(r)||0===r.length)return;let i=r[0];if(i&&"object"==typeof i)for(let e of["xAccessor","yAccessor"]){let r=t[e];if("string"!=typeof r)continue;let o=i[r];"string"==typeof o&&a.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${r}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}function Bt(e,t,a){let r=t.colorScheme;if(!r||!Array.isArray(r))return;let i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;let o=[];for(let e of r){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!==t&&3>t&&o.push(`${e} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${o.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${o.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}function Lt(e,t){let a=e.width??600,r=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;let o=(i.left||0)+(i.right||0),n=(i.top||0)+(i.bottom||0);o>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${o}px) >= width (${a}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),n>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${n}px) >= height (${r}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}function _t(e,t,a){let r=pl[e]?.props,i=e=>!!r?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,o=i("title"),n=i("description"),s=i("summary");!o&&!n&&!s&&a.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}function Dt(e,t,a){let r=t.colorScheme;"string"!=typeof r||pl[e]?.props?.colorScheme?.enum||ic.has(r)||a.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${r}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...ic].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}function Ut(e,t,a){let r=t.colorScheme;if(!r||!Array.isArray(r)||2>r.length)return;let i=r.filter(e=>"string"==typeof e&&e.startsWith("#"));if(2>i.length)return;let o=[];for(let e=0;i.length-1>e;e++){let t=f(i[e],i[e+1]);null!==t&&1.5>t&&o.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}o.length>0&&a.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${o.length} adjacent color pair(s) in colorScheme have very similar luminance: ${o.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}function Vt(e,t,a){let r=[];for(let e of oc)"function"==typeof t[e]&&r.push(e);r.length>0&&a.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${r.length>1?"s":""} detected: ${r.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}function Gt(e,t,a){let r=t.hoverRadius;"number"==typeof r&&r>0&&24>r&&!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick)&&a.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${r}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}function Ht(e,t,a){!0===t.responsiveWidth&&!0===t.responsiveHeight&&a.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}function qt(e,t,a){if(!0!==t.showParticles)return;let r=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof r.maxPerLine?r.maxPerLine:void 0,o="number"==typeof r.spawnRate?r.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof o&&o>.08)&&a.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}function Wt(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function Yt(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Kt(e,t){let a=Yt(e.visibleTokens);if(null!=a)return a;let r=Yt(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=r)return r;let i=Yt(t.tokenCount),o=Yt(t.maxTokens);return null!=i&&null!=o?Math.min(i,o):i??r??o}function Jt(e,t,a){let r=[];Wt(t.tokenEncoding)&&r.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Wt(t.encoding)&&r.push({source:"encoding",encoding:t.encoding});for(let{source:e,encoding:i}of r){let r=Kt(t,i);for(let t of Ce(i,{visibleTokens:r}))a.push({severity:"warning",code:"TOKEN_"+t.code,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}function Xt(e){let t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Wt(t.encoding)&&delete t.encoding,t}function Zt(e,t){let a=t.match(/^Unknown prop "([^"]+)"/);if(a)return`Remove \`${a[1]}\` or replace it with a documented ${e} prop.`;let r=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return r?`Add the required \`${r[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Qt(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}function ea(e,t){let a=[],r=()=>({ok:a.every(e=>"warning"===e.severity),diagnoses:a}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),o=i?[]:Ae(e,Xt(t)).errors;if(i){"function"!=typeof t.layout&&o.push("Provide a layout function.");let a="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(let e of a)null!=t[e]&&!Array.isArray(t[e])&&o.push(`Provide an array for ${e}.`)}for(let r of o)"BigNumber"===e&&void 0!==t.accessibleTable&&r.startsWith('Unknown prop "accessibleTable"')||a.push({severity:"error",code:"VALIDATION",message:r,fix:i?r:Zt(e,r)});if("BigNumber"===e&&Qt(t,a),(i||pl[e])&&(Pt(t,a),Lt(t,a),Ne(0,t,a)),!pl[e])return r();Rt(e,t,a),It(e,t,a),Et(e,t,a),Nt(e,t,a),Tt(e,t,a),Mt(0,t,a),Ft(e,t,a),Ot(e,t,a);let n=kt(e,t,void 0,{checkOutliers:!1}).diagnoses;for(let e of n)"EMPTY_DATA"===e.code&&a.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||a.push(e);if(jt(e,t,a),zt(e,t,a),Bt(0,t,a),Ut(0,t,a),Dt(e,t,a),_t(e,t,a),Vt(0,t,a),Gt(0,t,a),Ht(0,t,a),qt(0,t,a),Jt(0,t,a),Te(0,t,a),Me(0,t,a),Oe(0,t,a),Fe(e,t,a),je(e,t,a),a.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||ze(e,t,a),Be(e,t,a),Le(e,t,a),_e(e,t,a),Ze(e,t,a),"ProcessSankey"===e)for(let e of Qe(t))a.push(e);return r()}function ta(e){return"string"==typeof e&&e.trim().length>0}function aa(e,t,a){let r=sc.has(e)||void 0!==a&&lc.has(a),i=t=>fe(e,t)||r,o=nc.filter(e=>ta(t[e])&&!i(e));return{hasTitle:i("title")&&ta(t.title),hasDescription:i("description")&&ta(t.description),hasSummary:i("summary")&&ta(t.summary),unsupportedFinding:o.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${o.join(" and ")} text was supplied, but ${1===o.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}function ra(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;let t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;let a=t.fill;return"object"==typeof a&&null!==a&&"hatch"===a.type})}function ia(e){if(!Array.isArray(e))return!1;let t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>cc.has(e))}function oa(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function na(e,t){return`${e}[Symbol(${t.description??""})]`}function sa(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let a=Number(e);return Number.isSafeInteger(a)&&a>=0&&t>a}function la(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function ca(e,t,a,r){let i=la(e,t);return i&&"value"in i&&i.enumerable?ua(i.value,a,r):[a]}function ua(e,t="$",a=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(a.has(e))return[t];let r,i,o;try{o=Array.isArray(e),r=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(r!==(o?Array.prototype:Object.prototype)&&null!==r)return[t];a.add(e);let n=[];try{if(o){let r=la(e,"length")?.value;if(!Number.isSafeInteger(r)||0>r)return[oa(t,"length")];for(let e of i)"length"===e||"string"==typeof e&&sa(e,r)||n.push("symbol"==typeof e?na(t,e):oa(t,e));for(let i=0;r>i;i+=1)n.push(...ca(e,i+"",oa(t,i),a))}else for(let r of i)"symbol"!=typeof r?n.push(...ca(e,r,oa(t,r),a)):n.push(na(t,r));return n}catch{return[t]}finally{a.delete(e)}}function da(){let e=globalThis;return e[uc]||(e[uc]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[uc]}function ha(e){return da().recipes.get(e)}function pa(e){return da().layouts.get(e)?.layout}function fa(e){let t=da().layouts.get(e)?.identity;return t?{...t}:void 0}function ma(e){return"string"==typeof e?ha(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function ga(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function ya(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=ga(e)}function ba(e){let t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),a=e.trim().split(/\s+/).filter(Boolean);if(0===a.length||0===t.length)return null;let r=0;for(let e of a)r+=va(e);return a.length/t.length*.39+r/a.length*11.8-15.59}function va(e){let t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(3>=t.length)return 1;let a=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return a?a.length:1}function wa(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function Aa(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function xa(e){let t=Aa(e),a=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===a.pause||"function"==typeof a.pause}function $a(e){let t=Aa(e);return!0===e.settledProjection||!0===t.settledProjection}function Ca(e){let t=Aa(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function Sa(e){let t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},a=e.colorScheme,r="string"==typeof e.background?e.background:null;if(r&&!r.startsWith("#"))return{...t,status:"manual",message:`Background "${r}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};let i=r??"#ffffff";if(!Array.isArray(a))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};let o=[],n=0;for(let e of a){if("string"!=typeof e||!e.startsWith("#"))continue;let t=f(e,i);null!=t&&(n++,3>t&&o.push(`${e} (${t.toFixed(1)}:1)`))}return 0===n?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:o.length>0?{...t,status:"fail",message:`${o.length} color(s) fall below 3:1 contrast vs ${i}: ${o.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${n} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function ka(e,t,a={}){let r=[],i=ha(e),o=El.has(e),n=pe(e)||!!i||o,s=!0===a.inChartContainer,l=!0===a.describe,c=!0===a.navigable,u=Rl.has(e),d=yl.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:m}=aa(e,t,i?.frameFamily),g=!1!==t.accessibleTable&&!u,y=h||p||f,b=wa(t),v=xa(t),w=o,A=$a(t)||Tl.has(e)&&g,x=Ca(t)||w,$=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],C=n?"pass":"manual",S=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`;if(m&&r.push(m),r.push(Sa(t)),r.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...u?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:g?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:p&&f?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}}),r.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),r.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||Nl.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),null!=t.colorBy){let e=!0===t.directLabel||!0===t.showLabels,a=ra(t);r.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...e?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:a?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:a?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}});let i=ia(t.colorScheme);r.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...i?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),r.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:a?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:a?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{let e=$.filter(ke);if(e.length>0){let a=t.autoPlaceAnnotations,i="object"==typeof a&&null!==a&&!0===a.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;let t=Se(e),a=i&&"text"===t;return!(Pe(e)||a)});r.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}r.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{let e=[];(null!=t.brush||null!=t.onBrush)&&e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&e.push("legend filtering"),e.length>0&&r.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{let a=zl[e];if(a&&b){let e=t[a];"number"==typeof e&&e>0&&24>2*e&&r.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${a}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}r.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:C,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),r.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),r.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:C,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),r.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:C,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),r.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),r.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:l?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{let e=[t.description,t.summary].filter(ta).join(". "),a=e?ba(e):null;r.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==a?{status:"not-applicable",message:"No description/summary text to grade."}:a>9?{status:"warn",message:`Description/summary reads at ~grade ${a.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(a))} (≤ 9).`}})}if(Pl.has(e)){let e=ta(t.xLabel),a=ta(t.yLabel);r.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&a?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!a&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(Fl.has(e)&&r.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),$.length>1){let e=$.filter(ya).length;r.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===$.length?{status:"pass",message:`All ${$.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:$.length+" annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.",fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${$.length-e} of ${$.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&r.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&r.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:C,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),r.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),r.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),r.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:C,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),r.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...u?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:g?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}}),u||r.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),r.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":S}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),r.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...c?d?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:d?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:C,message:`Keyboard navigation steps through points and switches series/groups${S}.`,fix:n?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}});{let a,i=Array.isArray(t.data)?t.data:null,o=Array.isArray(t.nodes)?t.nodes:null,n={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};a=Sl.has(e)&&i&&i.length>7?{...n,status:"warn",message:i.length+" slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.",fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:o&&o.length>200?{...n,status:"warn",message:o.length+" nodes. A network this size is hard to navigate non-visually node by node.",fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:i&&i.length>5e3?{...n,status:"warn",message:i.length+" data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.",fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:i?{...n,status:"pass",message:i.length+" data points — a reasonable density for non-visual consumption."}:o?{...n,status:"pass",message:o.length+" nodes — a reasonable density for non-visual consumption."}:{...n,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},r.push(a)}{let e=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]),i=!1;if(e&&!a)for(let t of e.slice(0,50))if(t&&"object"==typeof t){for(let e of Object.values(t))if("number"==typeof e&&Number.isFinite(e)&&Math.abs(e)>=1e5){i=!0;break}if(i)break}i&&r.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}r.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...l?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),r.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...u?{status:"not-applicable",message:"Single value — nothing to skip."}:g?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}}),r.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:C,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),r.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...Nl.has(e)||Ol.has(e)?v?{status:"pass",message:e+" animates continuously and declares an in-chart pause/stop control."}:{status:"warn",message:e+" animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.",fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:C,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),o&&(r.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),r.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...A?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),r.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...x?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{let a=!0===t.responsiveWidth||!0===t.responsiveHeight,i=jl.has(e)&&!0===t.zoomable;r.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...a?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}i&&(i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length))&&r.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:i.name+" declares a color encoding without a redundant cue.",fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"===i.accessibility.description&&!p&&r.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:i.name+" requires a recipe-aware description, but none is attached.",fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&r.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:i.name+" requires a fallback table, but accessibleTable is disabled.",fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."}));let k=r.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),R={criticalsPassed:k.filter(e=>"pass"===e.status).length,criticalsEvaluated:k.length,fails:r.filter(e=>"fail"===e.status).length,warnings:r.filter(e=>"warn"===e.status).length,manual:r.filter(e=>"manual"===e.status).length,passes:r.filter(e=>"pass"===e.status).length};return{component:e,ok:!k.some(e=>"fail"===e.status),summary:R,findings:r,reference:"Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari)."}}function Ra(e,{onlyCritical:t=!1}={}){let a=[];for(let r of e.findings)"fail"!==r.status&&"warn"!==r.status||t&&!r.critical||a.push(r.message);return a}function Pa(e){let t=[],a=e.summary,r=e.ok?`${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`:`${a.fails} blocking failure(s) — ${a.criticalsPassed}/${a.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${r} · ${a.warnings} warning(s) · ${a.manual} to verify manually`);for(let a of hc){let r=e.findings.filter(e=>e.principle===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(let e of r)t.push(` ${dc[e.status]} ${e.id}${e.critical?" [critical]":""}: ${e.message}`),e.fix&&("fail"===e.status||"warn"===e.status||"manual"===e.status)&&t.push(" → "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function Ia(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[pc]:[]}function Ea(e){let{contract:t,transfer:a,binding:r}=e;if(void 0===t&&void 0===a&&void 0===r)return[];let i=[],o=Array.isArray(r?.mismatchPaths)?r.mismatchPaths.filter(e=>"string"==typeof e):[];return a&&"preserved"!==a.status&&"excluded"!==a.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${a.status}; its contract cannot be relied on for publication.`}):(!a||void 0===t)&&i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===r?.status||o.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(o.length?": "+o.join(", "):".")}):("match"!==r?.status||!Array.isArray(r.mismatchPaths)||!Array.isArray(r.unknownPaths)||r.mismatchPaths.length>0||r.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function Na(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ta(e,t,a){return{id:`${t}.${e.code.toLowerCase()}.${a+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Ma(e,t){return{id:e.id||"accessibility."+(t+1),stage:"accessibility",severity:"fail"===e.status?"error":"warn"===e.status?"warning":"manual",code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}function Oa(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{let a=fc[e.finding.severity]-fc[t.finding.severity];if(0!==a)return a;let r=!0===e.finding.critical;if(r!==(!0===t.finding.critical))return r?-1:1;let i=mc[e.finding.stage]-mc[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}function Fa(e,t){let a=[];e.component!==t&&a.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(let t of Ea({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))a.push({id:"render."+t.id,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&a.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});let r=/* @__PURE__ */new Set;for(let t of Ia(e))r.add(t.code),a.push({id:"render."+t.code.toLowerCase(),stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(let t of e.warnings)r.has(t)||a.push({id:"render."+t.toLowerCase(),stage:"render",severity:"warning",code:t,message:`The renderer reported ${Na(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return a}function ja(e,t){let a=e.filter(e=>"manual"!==e.severity),r=a.slice(0,t).map(e=>({id:"chart-evaluation-"+e.id,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${Na(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return a.length>t&&r.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:a.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),r}function za(e){let t=[`${e.component}: ${e.ok?"PASS":"ISSUES FOUND"}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(let a of e.findings)t.push(`${a.rank}. [${a.stage}/${a.code}] ${a.message}`),a.fix&&t.push(" Fix: "+a.fix);return t.join("\n")}function Ba(e,t={},a,r={}){let i=void 0===a?t:{...t,data:a},o=Ae(e,i),n=kt(e,i,a,r.dataAudit),s=ea(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),l=ka(e,i,{inChartContainer:r.inChartContainer,describe:r.describe,navigable:r.navigable}),c=[];for(let[e,t]of o.errors.entries())c.push({id:"validation."+(e+1),stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});n.diagnoses.forEach((e,t)=>{c.push(Ta(e,"data",t))}),s.forEach((e,t)=>{c.push(Ta(e,"deception",t))}),l.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{c.push(Ma(e,t))});let u,d=c.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(r.render&&o.valid&&!d)try{u=r.render(e,i).evidence,c.push(...Fa(u,e))}catch{c.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}let h=Oa(c),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=ja(h,Math.max(0,Math.floor(r.notificationMax??8)));return{component:e,validation:o,data:n,deception:s,accessibility:l,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function La(e,t=8){return ja(e,Math.max(0,Math.floor(t)))}function _a(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Da(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function Ua(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function Va(e,t){let{when:a}=e,r=t.width,i=t.height,o=Ua(t),n=Da(t);return!("number"==typeof a.minWidth&&a.minWidth>r||"number"==typeof a.maxWidth&&r>a.maxWidth||"number"==typeof a.minHeight&&("number"!=typeof i||a.minHeight>i)||"number"==typeof a.maxHeight&&("number"!=typeof i||i>a.maxHeight)||"number"==typeof a.minAspectRatio&&("number"!=typeof o||a.minAspectRatio>o)||"number"==typeof a.maxAspectRatio&&("number"!=typeof o||o>a.maxAspectRatio)||a.orientation&&n!==a.orientation)}function Ga(e,t){let a={...e,...t};for(let r of["margin","frameProps","mobileSemantics","style"])_a(e[r])&&_a(t[r])&&(a[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(a.className=`${e.className} ${t.className}`),a}function Ha(e,t,a=e.responsiveRules){if(!Array.isArray(a)||0===a.length)return{props:e,matches:[]};let r=a.map((e,t)=>({rule:e,index:t})).filter(e=>Va(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:r.reduce((e,t)=>Ga(e,t.rule.transform),e),matches:r}}function qa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Wa(e){return"string"==typeof e&&e.trim().length>0}function Ya(e){let t=qa(e.capability)?e.capability:null,a=qa(e.recipe)?e.recipe:null,r=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,a?.mobile];for(let e of r)if(qa(e))return e;return null}function Ka(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}function Ja(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function Xa(e){return Ja(e.size)||Ja(qa(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function Za(e){let t=Ya(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}function Qa(e){let t=Ya(e),a=qa(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===a?.tapToSelect||!0===a?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||Wa(t?.interaction?.hoverFallback)}function er(e,t){let a=Ya(e),r=(qa(e.mobileInteraction)?e.mobileInteraction:null)?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(a?.interaction?.alternatives)&&a.interaction.alternatives.length>0||!0===r||"all"===r)||t.every(e=>"brush"===e?Array.isArray(r)?r.includes("brush"):"brush"===r:"pan/zoom"===e?Array.isArray(r)?r.includes("zoom"):"zoom"===r:"legend filtering"===e&&(Array.isArray(r)?r.includes("legend"):"legend"===r))}function tr(e){let t=qa(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!Qa(e)}function ar(e){let t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,qa(e.frameProps)?e.frameProps.data:void 0],a=0;for(let e of t)Array.isArray(e)&&(a+=e.length);return a}function rr(e){let t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues],a=0;for(let e of t)Array.isArray(e)&&(a+=e.length);return a>0?a:null}function ir(e,t){let a=yc[e];if(!a)return null;let r=a.includes("hoverRadius")?30:null;for(let e of a){let a=t[e];"number"==typeof a&&Number.isFinite(a)&&a>0&&(r=null==r?a:Math.max(r,a))}return null==r?null:2*r}function or(e,t){e.push({...t,status:"pass"})}function nr(e,t){e.push({...t,status:"warn"})}function sr(e,t){e.push({...t,status:"manual"})}function lr(e,t={},a={}){let r=a.viewportWidth??390,i=a.targetSize??44,o=Xa(t),n=Ha(t,{width:r,height:o?.[1]}),s=[],l=Xa(t=n.props),c=Ya(t),u=Ka(e,t),d=Za(t),h=!0===a.inChartContainer,p=Wa(t.title)||Wa(t.summary)||Wa(t.description)||!0===c?.summary||Wa(c?.summary);if(n.matches.length>0&&or(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${n.matches.length} responsive rule(s) applied for the ${r}px mobile audit.`}),l){let[t,a]=l;t>r&&!d?nr(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${r}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):or(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof c?.minViewportWidth&&c.minViewportWidth>r&&nr(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${c.minViewportWidth}px minimum, wider than the audited ${r}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});let i=t/Math.max(1,a);430>=r&&i>2.4&&"BigNumber"!==e&&nr(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>a&&"BigNumber"!==e&&nr(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${a}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else sr(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});let f=ar(t);f>0&&(f>("number"==typeof c?.maxMarks?c.maxMarks:gc.has(e)?1.25*r:Il.has(e)?Math.max(8,Math.floor(r/34)):r)?nr(s,{id:"density.mark-budget",category:"density",impact:gc.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${r}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):or(s,{id:"density.mark-budget",category:"density",impact:"medium",message:f+" data item(s) are within the rough mobile density budget for this component."}));let m=rr(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){let e=Math.max(3,Math.floor(r/58));m>e&&nr(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${r}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(gc.has(e)||Il.has(e))&&sr(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});tr(t)?nr(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."}):or(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."});let y=ir(e,t),b=qa(t.mobileInteraction)?t.mobileInteraction:null,v=y??("number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof c?.minimumHitTarget?c.minimumHitTarget:"number"==typeof c?.interaction?.targetSize?c.interaction.targetSize:null);null!=v&&(24>v?nr(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${v}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):i>v?nr(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):or(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${v}px, meeting the configured ${i}px target.`}));let w=[];(null!=t.brush||null!=t.onBrush)&&w.push("brush"),!0===t.zoomable&&w.push("pan/zoom"),("isolate"===t.legendInteraction||"highlight"===t.legendInteraction)&&w.push("legend filtering"),w.length>0&&!er(t,w)&&nr(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${w.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1!==t.showLegend&&!1!==t.legend&&(!0===t.showLegend||!0===t.legend||null!=t.colorBy||null!=t.groupBy||null!=t.lineBy||null!=t.areaBy||null!=t.stackBy)&&!0!==t.directLabel&&!0!==t.showLabels&&"direct"!==t.labelStrategy&&"direct-end"!==t.labelStrategy&&"direct"!==c?.labels?.strategy&&"inline"!==c?.labels?.strategy&&"external"!==c?.labels?.strategy&&430>=r&&nr(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});let A=Array.isArray(t.annotations)?t.annotations.filter(e=>qa(e)):[];if(A.length>("number"==typeof c?.maxAnnotations?c.maxAnnotations:3)&&430>=r&&nr(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:A.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),A.length>0){let e=A.filter(e=>!Wa(e.mobileText)&&!Wa(e.shortText)&&!Wa(e.label));e.length>0&&sr(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}!d&&"BigNumber"!==e&&sr(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(c?(or(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===c.custom?.dataBearingSceneNodes?nr(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==c.custom?.dataBearingSceneNodes&&sr(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):sr(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),!p&&!h&&nr(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});let x=s.filter(e=>"warn"===e.status),$={highRisk:x.filter(e=>"high"===e.impact).length,warnings:x.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:r,ok:0===$.highRisk,summary:$,findings:s,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}function cr(e){let t=[],a=e.summary,r=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${a.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${r} - ${a.warnings} warning(s) - ${a.manual} manual check(s)`);for(let a of vc){let r=e.findings.filter(e=>e.category===a&&"not-applicable"!==e.status);if(0!==r.length){t.push(""),t.push(" "+a.toUpperCase());for(let e of r)t.push(` ${bc[e.status]} [${e.impact}] ${e.id}: ${e.message}`),e.fix&&("warn"===e.status||"manual"===e.status)&&t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function ur(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function dr(e,t){if("function"==typeof e)return t=>+e(t);let a=e||t;return e=>+e[a]}function hr(e,t){if("function"==typeof e)return e;let a=e||t;return e=>e[a]}function pr(){let e=globalThis;return e[wc]??(e[wc]={intents:/* @__PURE__ */new Map}),e[wc]}function fr(e,t){return xc.has(e)||$c.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 mr(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let a=e[t];if("string"==typeof a&&a)return a}}function gr(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function yr(e,t={}){let a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;let t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function br(e){return"string"==typeof e?e:e.id??e.name}function vr(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function wr(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 Ar(e,t,a){return a??ma(t.recipe)??ma(t.recipeId)??ha(e)}function xr(e,t,a=[]){let r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;let i=a.find(e=>e&&"object"==typeof e);if(!i)return;let o=Object.entries(i).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 i):o.find(([,e])=>"string"==typeof e)?.[0]}function $r(e,t){return e.dataRoles.find(e=>e.role===t)}function Cr(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function Sr(e,t,a,r,i,o={}){let n={...o};if(t)for(let[e,a]of Object.entries(t))n[e]=a;for(let e of a.dataRoles){let a=xr(e,r,i),o=t&&a?t[a]:a;void 0!==o&&(n[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let a=n[t];return null==a?`{${t}}`:a+""})}function kr(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Rr(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})}}}function Pr(e,t,a,r){let i=Cr(e,["nominal","ordinal"]),o=Cr(e,["quantitative"]),n=i?xr(i,a,t):void 0,s=o?xr(o,a,t):void 0,l=i?.role??n??"category",c=o?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=Rr(r),f=/* @__PURE__ */new Map;if(n&&s)for(let e of t){let t=(e[n]??"Uncategorized")+"",a=Number(e[s]);Number.isFinite(a)&&f.set(t,(f.get(t)??0)+a)}let m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:br(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 ${l} and ${c}. ${kr(d)}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>m.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${m.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`,l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`}}function Ir(e,t,a={}){let r=wr(t),i=vr(t),o=a.locale??"en",n=("function"==typeof e.description?e.description({data:r,config:i,locale:o}):void 0)?.levels??Pr(e,r,i,o),s=a.levels??["l1","l2","l3","l4"],l={};for(let e of s)n[e]&&(l[e]=n[e]);let c=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),u=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:l,...u?.length?{caveats:u}:{}}}function Er(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),r=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=Ve(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),o=qe(e.seed??1),n=e.idPrefix??"mechanical";return Array.from({length:r},(e,t)=>{let r=0;for(let e=0;a>e;e+=1)o()<i&&(r+=1);let s=a/2;return{id:`${n}-${t}`,value:r,mechanical:!0,pegRows:a,branchProbability:i,pathRights:r,side:s>r?"left":r>s?"right":"center"}})}function Nr(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:r}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:i}=Ke(e.data,"event"),o=i.flatMap((t,a)=>{let r=Ue(De(t,a,e.timeAccessor));return null==r?[]:[{datum:t,index:a,eventTime:r,arrivalTime:Ue(De(t,a,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),n="function"==typeof a?null:Ue(a?.value),s="function"==typeof a?t:Ue(a?.delay)??t,l=-1/0,c=-1/0;for(let e of o.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){l=Math.max(l,e.eventTime);let i="function"==typeof a?Ue(a(l)):l-s;c=n??Math.max(c,i??l-t);let o=r?Ue(De(e.datum,e.index,r)):null;e.watermarkAtArrival=o??c,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:o,watermarkValue:o.length?c:n??-s}}function Tr(e,t){let a="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!a)return null;let r=Array.isArray(t.data)?t.data:[],i=Math.max(2,Math.round(Ue(t.bins)??21)),o=Math.max(1,Math.round(Ue(t.pegRows)??i-1));if(a&&(r="GaltonBoardChart"===e?Er({bins:i,count:t.mechanicalCount,pegRows:o,branchProbability:t.branchProbability,seed:t.seed}):We({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),r=Ke(r,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=/* @__PURE__ */new Map,i=t.valueAccessor??(a?"value":void 0);return r.forEach((a,r)=>{let o=(De(a,r,t.categoryAccessor??"category")??"unknown")+"",n=i?Ue(De(a,r,i)):1;e.set(o,(e.get(o)??0)+Math.max(0,n??0))}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=r.map((e,a)=>Ue(De(e,a,t.valueAccessor??"value"))).filter(e=>null!=e),n=a?[0,o]:He(t.valueExtent),s=n?.[0]??(e.length?Math.min(...e):0),l=n?.[1]??(e.length?Math.max(...e):1),c=s===l?1:l-s,u=Array.from({length:i},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/c*i)))].value+=1;return{generated:a,rows:u}}if("CollisionSwarmChart"===e){let e=/* @__PURE__ */new Map;return r.forEach((a,r)=>{if(null==Ue(De(a,r,t.xAccessor??"x")))return;let i=t.groupAccessor?(De(a,r,t.groupAccessor)??"All")+"":"All";e.set(i,(e.get(i)??0)+1)}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=Ue(t.windows?.size??10);if(null==e||0>=e)return null;let{events:i}=Nr({data:r,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),o=i.map(e=>e.eventTime),n=o.length?Math.min(...o):0,s=o.length?Math.max(...o):n+e,l=Math.min(Ue(t.timeExtent?.[0])??n,n),c=Math.max(Ue(t.timeExtent?.[1])??s,s),u=Math.floor(l/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),h=Array.from({length:d},(t,a)=>({label:`${u+a*e}-${u+(a+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of i){let a=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?a.secondary+=1:a.value+=1}return{generated:a,rows:h}}return null}function Mr(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Or(e,t){let a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,a)=>{if(!e||"object"!=typeof e)return null;let r=e,i=Mr(r.count??r.value??r.total??r.bodies??r.events);if(null==i)return null;let o=r.label??r.id??r.name??"container "+(a+1),n=Mr(r.secondary??r.secondaryCount),s=Mr(r.observed??r.observedCount);return{label:gr(o,t),count:i,...null!=n?{secondary:n}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Fr(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function jr(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function zr(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.`}function Br(e,t){if(0>=t)return"0%";let a=e/t*100;return(10>a?Math.round(10*a)/10:Math.round(a))+"%"}function Lr(e,t,a,r,i,o,n=null){let s=Fr(e),l=n&&"EventDropChart"===e?"accepted event":jr(e),c=n?n.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(r.l1=zr(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!a||0===a.length)return void(i.has("l2")&&(r.l2=n?"No valid source records are available.":"No settled projection is loaded yet."));let u=a.reduce((e,t)=>e+t.count,0),d=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;let p=a.reduce((e,t)=>e+(t.secondary??0),0),f=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(n&&"EventDropChart"===e)r.l2=`${c} classifies ${o(u+p)} ${_r(u+p,"event")} across ${a.length} ${_r(a.length,s)}: ${o(u)} accepted and ${o(p)} late.`;else if(0===d.length)r.l2=`${c} contains ${o(u)} ${_r(u,l)} across ${a.length} ${_r(a.length,s)}; no ${_r(2,s)} are non-empty yet.`;else{let e=p>0?` ${o(p)} ${_r(p,l)} ${1===p?"is":"are"} marked ${f}.`:"";r.l2=`${c} contains ${o(u)} ${_r(u,l)} across ${a.length} ${_r(a.length,s)}; ${d.length} ${_r(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${o(h.count)} ${_r(h.count,l)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==h),t=Br(h.count,u);r.l3=e?`${c} is most concentrated in ${h.label}, which holds ${o(h.count)} ${_r(h.count,l)} (${t}); ${e.label} follows with ${o(e.count)} ${_r(e.count,l)}.`:`${c} is concentrated in ${h.label}, which holds all ${o(h.count)} ${_r(h.count,l)}.`}}function _r(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Dr(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}function Ur(e){return Sc[e]||Dr(e)+" chart"}function Vr(e){let t=/* @__PURE__ */new Set,a=e=>{let r=Ic[e];if(r)return r;if(t.has(e))return;let i=pr().intents.get(e);if(!i?.composes?.length)return;t.add(e);let o=[...i.composes].sort((e,t)=>{let a=e=>{let t=Nc.indexOf(e);return 0>t?Nc.length:t};return(i.weights?.[t]??1)-(i.weights?.[e]??1)||a(e)-a(t)});for(let r of o){let i=a(r);if(i)return t.delete(e),i}t.delete(e)};return a(e)}function Gr(e){let t,a=0;for(let[r,i]of Object.entries(e))if("number"==typeof i&&i>0){if(i>a){t=r,a=i;continue}if(i===a&&void 0!==t){let e=Nc.indexOf(r),a=Nc.indexOf(t);-1!==e&&(-1===a||a>e)&&(t=r)}}return t}function Hr(e){return"BumpChart"===e?"ranking":$c.has(e)||"StackedAreaChart"===e?"apportioning":Pc.has(e)?"relating":xc.has(e)?"comparing":Cc.has(e)?"characterizing":Ac.has(e)?"tracking":kc.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function qr(e){if(e){if("fits"in e||"buildProps"in e){let t=e,a={};for(let[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}function Wr(e,t){let a=qr(t);if(a?.act)return a.act;if(a?.intentScores){let e=Gr(a.intentScores);if(e&&Ic[e]&&(a.intentScores[e]??0)>=3)return Ic[e]}return a?.family?Ec[a.family]:Hr(e)}function Yr(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!Mc.has(t.type))return!1;let a=t.provenance;return!(!a||"object"!=typeof a)&&(Oc.has(a.authorKind)||Fc.has(a.source)||jc.has(a.basis))})}function Kr(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?a.format(e):t.format(e):e+""}function Jr(e,t,a,r){let i=0,o=0,n=1/0,s=-1/0,l=null,c=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(let a of e){let e=t(a);Number.isFinite(e)&&(0===i&&(f=e,h=a),m=e,p=a,n>e&&(n=e,l=a,u=i),e>s&&(s=e,c=a,d=i),i++,o+=e)}return 0===i?null:{count:i,min:n,max:s,mean:o/i,minLabel:gr(null!=l?a(l):null,r),maxLabel:gr(null!=c?a(c):null,r),first:f,last:m,firstLabel:gr(null!=h?a(h):null,r),lastLabel:gr(null!=p?a(p):null,r),minIndex:u,maxIndex:d}}function Xr(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]??""}function Zr(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}function Qr(e){let t=zc["string"==typeof e.type?e.type:"annotation"]||"an annotation",a=Zr(e),r=a?a+t.replace(/^an? /,""):t,i="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return i?`${r} labeled "${i}"`:r}function ei(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let a=yr(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;let r=a.map(Qr),i=r.slice(0,5),o=r.length-i.length,n=Xr(i)+(o>0?`, and ${o} more`:""),s=a.length;return`The author has marked ${1===s?"one feature":s+" features"} on this chart: ${n}.`}function ti(e,t,a={}){let r=void 0!==a.levels,i=new Set(a.levels??["l1","l2","l3"]);!r&&(a.capability||Yr(t))&&i.add("l4");let o=Ar(e,t,a.recipe);if(o){let e=["l1","l2","l3","l4"].filter(e=>i.has(e));!r&&!e.includes("l4")&&e.push("l4");let n=Ir(o,t,{levels:e,locale:a.locale,audience:a.audience,includeCaveats:a.includeCaveats}),s=ei(t);return{...n,text:s?`${s} ${n.text}`.trim():n.text,...s?{annotations:s}:{}}}let n=Kr(a.locale??"en"),s=Ur(e),l=Array.isArray(t.data)?t.data:null,c=mr(t),u=Rc.has(e)?Or(t,n):null,d=Rc.has(e)&&null===u?Tr(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=fr(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(Rc.has(e)&&Lr(e,s,u??(d?Or({projectionRows:d.rows},n):null),b,i,n,d),i.has("l1")&&!Rc.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${c??"series"} by ${g} across ${y}.`;else if(Ac.has(e)||xc.has(e))b.l1=`A ${s} of ${g} by ${y}`+(c?`, split by ${c}.`:".");else if($c.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(Cc.has(e))b.l1=`A ${s} of the distribution of ${g}`+(c?` by ${c}.`:".");else if(kc.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${ui(e,"node")}`:null,null!=a?`${a} ${ui(a,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${r.length?" with "+r.join(" and "):""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?" for "+e:""}.`}else b.l1=`A ${s}.`;let v=Ac.has(e)||"BumpChart"===e||xc.has(e)||$c.has(e)||Cc.has(e),w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&l&&l.length>0&&(w=Jr(l,dr(h,p),hr(f,m),n)),i.has("l2")&&v&&(l&&0!==l.length?w&&(b.l2=$c.has(e)?`${w.count} segments totaling ${n(ai(w))}. Largest is ${w.maxLabel} at ${n(w.max)}; smallest is ${w.minLabel} at ${n(w.min)}.`:`${g} ranges from ${n(w.min)} (${w.minLabel}) to ${n(w.max)} (${w.maxLabel}), with a mean of ${n(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!c&&Ac.has(e)?b.l3=ri(w,g,n):i.has("l3")&&w&&!c&&xc.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){let r=Yr(t)?"alerting":Wr(e,a.capability);r&&(b.l4=ii(r,e,t,c?null:w,g,y,n,a.audience))}let A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),x=ei(t);return{text:x?`${x} ${A}`.trim():A,levels:b,...x?{annotations:x}:{}}}function ai(e){return e.mean*e.count}function ri(e,t,a){let{first:r,last:i,min:o,max:n,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=n-o,m=i-r;if(0===f)return`${ci(t)} is constant at ${a(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${ci(t)} ends roughly where it started (${a(r)} at ${c} to ${a(i)} at ${u}), ranging between ${a(o)} and ${a(n)}.`;let g=h>0&&p-1>h,y=d>0&&p-1>d,b=(n-Math.max(r,i))/f,v=(Math.min(r,i)-o)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(n)} (${s}), then falls to ${a(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${a(o)} (${l}), then recovers to ${a(i)} (${u}).`:.05>Math.abs(m)/f?`${ci(t)} ends roughly where it started (${a(r)} at ${c} to ${a(i)} at ${u}), ranging between ${a(o)} and ${a(n)}.`:m>0?h===p-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(i)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(i)} (${u}), after peaking at ${a(n)} (${s}).`:d===p-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(i)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(i)} (${u}), after dipping to ${a(o)} (${l}).`}function ii(e,t,a,r,i,o,n,s){let l,c,u=Tc[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":l="This is a map",c="read values by location";break;case"presenting":l="This is a single-value display",c=`read ${"string"==typeof a.label&&a.label?a.label:i} as the headline number`;break;case"tracing":l=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":l=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":l=`This is ${d} ${u} chart`,c=`read it for whether ${o} and ${i} move together`;break;default:l=`This is ${d} ${u} chart`,c=oi(e,r,i,o,n,t)}return`${l}; ${c}.${li(t,s)}`}function oi(e,t,a,r,i,o){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 "+a;case"comparing":return`compare ${a} across ${r}`;case"ranking":return"read it top to bottom by "+a;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+a;default:return"read the highlighted features"}switch(e){case"alerting":return ni(t,i,o);case"tracking":return`read it for the trajectory of ${a}, which ${si(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{let e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function ni(e,t,a){if(xc.has(a)||$c.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:r,last:i,min:o,max:n,minLabel:s,maxLabel:l,lastLabel:c,minIndex:u,maxIndex:d,count:h}=e,p=n-o;if(p>0){let e=d>0&&h-1>d,a=u>0&&h-1>u,f=(n-Math.max(r,i))/p,m=(Math.min(r,i)-o)/p;if(e&&f>.15)return`the peak of ${t(n)} at ${l} is the point to investigate`;if(a&&m>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(i>=n)return`the climb to ${t(i)} at ${c} warrants a closer look`;if(o>=i)return`the drop to ${t(i)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(n)}) and ${s} (${t(o)}) — are the points to check`}function si(e){let t=e.max-e.min,a=e.last-e.first;return 0===t||.05>Math.abs(a)/t?"holds roughly steady":a>0?"rises":"falls"}function li(e,t){if(!t)return"";let a=t.familiarity?.[e];return"number"!=typeof a||a>2?"":` This ${Ur(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}function ci(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function ui(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function di(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function hi(e){return!!e&&"object"==typeof e}function pi(e,t,a,r){let i=Cr(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),n=i?xr(i,a,r):void 0,s=[];n&&null!=e[n]&&s.push(e[n]+"");for(let t of o){let i=xr(t,a,r);i&&null!=e[i]&&s.push(`${t.role}: ${e[i]+""}`)}return s.length>0?s.join(", "):"Data item"}function fi(e,t,a={}){let r=wr(t),i=vr(t),o=Math.max(1,a.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:i,locale:a.locale??"en"});let n=hi(e.navigation)?e.navigation:void 0,s=(n?.groupByRole?$r(e,n.groupByRole):void 0)??(n?.groupBy?.[0]?$r(e,n.groupBy[0])??e.dataRoles.find(e=>e.field===n.groupBy?.[0]):void 0)??Cr(e,["nominal","ordinal"]),l=s?xr(s,i,r):void 0,c=(n?.idRole?$r(e,n.idRole):void 0)??Cr(e,["identifier"]),u=c?xr(c,i,r):void 0,d={id:"root",role:"chart",label:n?.summaryTemplate?Sr(n.summaryTemplate,void 0,e,i,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]},h=0,p=(t,a,o)=>{let s=u?t[u]:void 0,l=n?.itemLabelTemplate?Sr(n.itemLabelTemplate,t,e,i,r,{count:r.length}):pi(t,e,i,r);return{id:"datum-"+di(s??a),role:"datum",label:l,level:o,datum:t}};if(l){let e=/* @__PURE__ */new Map;for(let t of r){let a=(t[l]??"Uncategorized")+"",r=e.get(a);r?r.push(t):e.set(a,[t])}d.children=[...e].map(([e,t],a)=>{let r=t.slice(0,Math.max(0,o-h));h+=r.length;let i=r.map((e,t)=>p(e,1e5*a+t,3));return t.length>r.length&&i.push({id:"more-"+di(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+di(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:i}})}else{let e=r.slice(0,o);d.children=e.map((e,t)=>p(e,t,2)),r.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return d}function mi(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function gi(e,t="—"){return null==e||""===e?t:"object"==typeof e?gi(e.id??e.name??e.label,t):e+""}function yi(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function bi(e){return gi(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function vi(e,t){let a=mi(e,t,"children");return Array.isArray(a)?a:[]}function wi(e,t,a){return`${e} ${1===e?t:a}`}function Ai(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${wi(e.numericLeaves,"valued leaf","valued leaves")}`}function xi(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function $i(e,t,a,r){let i=t.data&&"object"==typeof t.data?t.data:null,o=t.childrenAccessor??"children",n=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor,l=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new WeakSet,u=e=>{let t=l.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let a,r=vi(e,o);if(0===r.length){let t=yi(mi(e,n,"value"));a={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else a=r.reduce((e,t)=>{let a=u(t);return{descendants:e.descendants+1+a.descendants,depth:Math.max(e.depth,a.depth+1),leaves:e.leaves+a.leaves,numericLeaves:e.numericLeaves+a.numericLeaves,leafTotal:e.leafTotal+a.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),l.set(e,a),a},d=0,h=(e,t,i,l)=>{let c=gi(mi(e,s,"name"),"item "+i);if(l.has(e))return{id:`hierarchy-${bi(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let p=vi(e,o),f=u(e);if(0===p.length){if(d>=a)return null;d+=1;let o=yi(mi(e,n,"value"));return{id:`hierarchy-${bi(i)}-${bi(c)}`,role:"datum",level:t,label:`${c}${null==o?"":": "+r(o)}.`,...null==o?{}:{value:o},datum:e}}let m=new Set(l);m.add(e);let g=[],y=0;for(let[e,r]of p.entries()){if(d>=a){y+=u(r).leaves;continue}let o=h(r,t+1,`${i}-${e}`,m);o&&g.push(o)}return y>0&&g.push({id:`hierarchy-${bi(i)}-more`,role:"datum",level:t+1,label:`${wi(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${bi(i)}-${bi(c)}`,role:"series",level:t,label:`${c}: ${wi(p.length,"direct child","direct children")}, ${wi(f.descendants,"total descendant","total descendants")}, ${wi(f.leaves,"leaf","leaves")}${Ai(f,r)}.`,datum:e,children:g}},p=i?u(i):null,f={id:"root",role:"chart",level:1,label:i?`A ${xi(e)} chart with ${wi(p.leaves,"leaf","leaves")} and ${wi(p.descendants,"total descendant","total descendants")} across ${wi(p.depth,"hierarchy level","hierarchy levels")}${Ai(p,r)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){let e=h(i,2,"root",/* @__PURE__ */new Set);if(e){let t=gi(mi(i,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function Ci(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Si(e,t="—"){return null==e||""===e?t:"object"==typeof e?Si(e.id??e.name??e.label,t):e+""}function ki(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Ri(e){return Si(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Pi(e){let 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 Ii(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}function Ei(e,t,a){let r=Ci(e,t,a);if(void 0!==r)return r;let i=e.properties;return i&&"object"==typeof i?Ci(i,t,a):void 0}function Ni(e,t,a){return Si(Ei(e,t,"id")??Ei(e,"name","name")??Ei(e,"NAME","NAME")??Ei(e,"label","label"),a)}function Ti(e){let t=0,a=1/0,r=-1/0,i=0;for(let o of e)null!=o.value&&(t+=1,a=Math.min(a,o.value),r=Math.max(r,o.value),i+=o.value);return 0===t?null:{count:t,min:a,max:r,total:i,average:i/t}}function Mi(e,t){let a=Ti(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function Oi(e){let t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],i=Ti(t);if(i)if(i.min===i.max)r.push({id:"equal",label:"Equal values",rows:t});else{let e=i.min+(i.max-i.min)/3,a=i.min+2*(i.max-i.min)/3,o=t.filter(e=>e.value>=a),n=t.filter(t=>t.value>=e&&a>t.value),s=t.filter(t=>e>t.value);o.length>0&&r.push({id:"highest",label:"Highest values",rows:o}),n.length>0&&r.push({id:"middle",label:"Middle values",rows:n}),s.length>0&&r.push({id:"lowest",label:"Lowest values",rows:s})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}function Fi(e,t,a){let r,i=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),o=/* @__PURE__ */new Map,n=0;for(let[e,t]of i.entries())r!==t.value&&(n=e+1,r=t.value),o.set(t.index,n);let s=0;return Oi(e).map(e=>{let r=e.rows.slice(0,Math.max(0,t-s));s+=r.length;let n=r.map(e=>{let t=o.get(e.index),r=null==t||2>i.length?"":`, rank ${t} of ${i.length}`;return{id:`geo-${Ri(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${a(e.value)}${r}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-r.length;return l>0&&n.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"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"}, ${Mi(e.rows,a)}.`,children:n}})}function ji(e,t,a,r){let i=Ii(t.areas),o="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],n=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:o).map((a,r)=>({datum:a,index:r,label:Ni(a,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:ki(Ei(a,l,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${Mi(d,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${n.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${Pi(t)}`,children:[]};if("ChoroplethMap"===e)h.children=Fi(u,a,r);else if(u.length>0){let e=u.slice(0,a).map(e=>({id:`geo-${Ri(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+r(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-a} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let p="FlowMap"===e?n:s;if(p.length>0){let e=p.slice(0,a).map((e,t)=>{let a=Si(e.source,"unknown"),i=Si(e.target,"unknown"),o=ki(Ci(e,l,"value"));return{id:`route-${Ri(a)}-${Ri(i)}-${t}`,role:"datum",level:3,label:`${a} to ${i}${null==o?"":": "+r(o)}.`,...null==o?{}:{value:o},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function zi(e,t={},a={}){return!!Ar(e,t,a.recipe)||Bc.has(e)||Lc.has(e)||_c.has(e)||Ac.has(e)||xc.has(e)||$c.has(e)||Cc.has(e)}function Bi(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function Li(e,t="—"){return null==e||""===e?t:"object"==typeof e?Li(e.id??e.name??e.label,t):e+""}function _i(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Di(e){return Li(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Ui(e,t){let a=[];return(e.linkedHover||e.selection||e.linkedBrush)&&a.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&a.push("Hover or focus a mark for its details."),a.length>0?" "+a.join(" "):""}function Vi(e,t){t&&e.children?.push(t)}function Gi(e,t,a,r){let i=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],n=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>Li(Bi(e,n,"id"),"unknown"),d=(e,t)=>Li(Bi(e,t,""),"unknown"),h=/* @__PURE__ */new Set;for(let e of o)h.add(d(e,s)),h.add(d(e,l));let p=i.length>0?i:[...h].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(let e of p)f.set(u(e),{links:0,value:0});for(let e of o){let t=d(e,s),a=d(e,l),r=_i(Bi(e,c,"value"))??0;for(let e of[t,a]){let t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=r,f.set(e,t)}}let m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${o.length} links.${Ui(t,"network")}`,children:[]},g=0,y=/* @__PURE__ */new Map,b=t.colorBy??"group";for(let e of p){let t=Li(Bi(e,b,"group"),"Ungrouped"),a=y.get(t);a?a.push(e):y.set(t,[e])}let v=[...y].map(([e,t],i)=>{let o=[];for(let[e,n]of t.entries()){if(g>=a)break;g+=1;let t=u(n),s=f.get(t)??{links:0,value:0},l=s.value>0?`, ${r(s.value)} total flow`:"";o.push({id:`node-${i}-${e}-${Di(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:n})}return{id:`nodes-${i}-${Di(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});v.length>0&&m.children?.push(...v);let w=o.slice(0,a).map((e,t)=>{let a=d(e,s),i=d(e,l),o=_i(Bi(e,c,"value"));return{id:`link-${Di(a)}-${Di(i)}-${t}`,role:"datum",level:3,label:`${a} to ${i}${null==o?"":": "+r(o)}.`,value:o,datum:e}});return o.length>a&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-a} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:w}),m}function Hi(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function qi(e,t){let a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;let r=yr(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let i=0,o=r.slice(0,t).map(e=>{let t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${Hi(Qr(e))}${a}.`,datum:e}});r.length>t&&o.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});let n=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===n?"one marked feature":n+" marked features"}.`,children:o}}function Wi(e,t,a={}){let r=a.locale??"en",i=Math.max(1,a.maxLeaves??200),o=Kr(r),n=Ar(e,t,a.recipe);if(n)return fi(n,t,{maxLeaves:i,locale:r});let s={id:"root",role:"chart",label:ti(e,t,{locale:r}).text||"Chart.",level:1,children:[]},l=qi(t,i);if(Bc.has(e)){let a=Gi(e,t,i,o);return Vi(a,l),a}if(Lc.has(e)){let a=$i(e,t,i,o);return Vi(a,l),a}if(_c.has(e)){let a=ji(e,t,i,o);return Vi(a,l),a}let c=Array.isArray(t.data)?t.data:null,u=zi(e,t,a);if(!c||0===c.length||!u)return l&&(s.children=[l]),s;let{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=fr(e,t),m=dr(d,h),g=hr(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=mr(t),w=0,A=e=>`${e}-${w++}`,x=(e,t)=>{let a=m(e),r=gr(g(e),o);return{id:A("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?o(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}},$=(e,t)=>{let a=e.slice(0,i).map(e=>x(e,t));return e.length>i&&a.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),a},C=[];if(Ac.has(e)||xc.has(e)){let t=1/0,a=-1/0,r=1/0,i=-1/0,n=[],s=!0;for(let e of c){let o=m(e);Number.isFinite(o)&&(t>o&&(t=o),o>a&&(a=o));let l=g(e);n.push(l),"number"==typeof l&&Number.isFinite(l)?(r>l&&(r=l),l>i&&(i=l)):s=!1}let l=/* @__PURE__ */new Set,u=[];for(let e of n){let t=e+"";l.has(t)||(l.add(t),u.push(e))}let d=s?`${o(r)} to ${o(i)}`:`${gr(u[0],o)} to ${gr(u[u.length-1],o)} (${xc.has(e)?u.length+" categories":c.length+" points"})`;C.push({id:A("axis"),role:"axis",level:2,label:`${xc.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),a>=t&&C.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${o(t)} to ${o(a)}.`})}if(v){let a=hr(v,v),i=/* @__PURE__ */new Map;for(let e of c){let t=(a(e)??"—")+"",r=i.get(t);r?r.push(e):i.set(t,[e])}let o=[];for(let[a,n]of i){let i=ti(e,{...t,data:n},{levels:["l2","l3"],locale:r}).text;o.push({id:A("series"),role:"series",level:2,label:`Series ${a}: ${i}`,children:$(n,3)})}s.children=[...C,...o]}else s.children=[...C,...$(c,2)];return l&&s.children.push(l),s}function Yi(e,t){let a=[],r=e=>{if(a.push(e),e.children&&e.children.length>0&&t.has(e.id))for(let t of e.children)r(t)};return r(e),a}function Ki(e){let t=1;if(e.children)for(let a of e.children)t+=Ki(a);return t}function Ji(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Xi(e){return Ji(e)?e:void 0}function Zi(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Qi(e){let t=Zi(e);return null==t?void 0:Math.max(0,Math.floor(t))}function eo(...e){return e.map(Xi).find(Boolean)}function to(...e){return e.find(Array.isArray)}function ao(e){let t={};for(let[a,r]of Object.entries(e))void 0!==r&&(t[a]=r);return t}function ro(e,t,a){return e["string"==typeof t&&t?t:a]}function io(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function oo(e,t,a){let r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${io(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,a="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${io(e)} to ${io(a)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${io(t.domain[0])} to ${io(t.domain[1])}.`),i.length>0){r.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(let o of i.slice(0,a)){let a=ro(o,t.sourceAccessor,"source"),i=ro(o,t.targetAccessor,"target"),n=ro(o,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==o.startTime&&null==o.endTime?`${io(a)} to ${io(i)} has value ${io(n)}.`:`${io(a)} to ${io(i)} has value ${io(n)} over ${io(o.startTime)}–${io(o.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=Xi(t.data),i="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",o="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",n="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{let t=Array.isArray(e[i])?e[i]:[];if(0!==t.length)for(let e of t){let t=Xi(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(let e of s.slice(0,a))r.push(`${io(e[n])} has value ${io(e[o])}.`)}}if(Dc.has(e)&&Array.isArray(t.data)){let a=t.data;r.push(`${a.length} observed source row${1===a.length?"":"s"} are supplied.`);let i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,o="CollisionSwarmChart"===e?"x":"value",n=a.map(e=>Zi(ro(e,i,o))).filter(e=>null!=e);n.length>0&&r.push(`Observed ${"string"==typeof i?i:o} ranges from ${io(Math.min(...n))} to ${io(Math.max(...n))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}function no(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function so(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function lo(e,t,a,r){let i=Xi(e.settledProjection),o=Xi(t?.settledProjection);return to(a?.projectionRows,a?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,o?.rows,r?.binCounts)}function co(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let a=Xi(e);if(!a)return;let r=Zi(a.count??a.value??a.total??a.bodies??a.events);if(null==r)return;let i=(a.label??a.id??a.name??"container "+(t+1))+"",o=null==a.id?void 0:a.id+"",n=Zi(a.secondary??a.secondaryCount),s=Zi(a.observed??a.observedCount);return ao({id:o,label:i,count:r,secondary:n,secondaryLabel:"string"==typeof a.secondaryLabel?a.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;let a=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:a,populatedCount:r,...i?{leader:i}:{}}}function uo(e,t){let a=e?.map((e,t)=>{let a=Xi(e);if(!a)return;let r=Zi(a.count)??0,i=Zi(a.total),o={label:(a.label??a.id??"sediment "+(t+1))+"",count:r};return null!=a.id&&(o.id=a.id+""),null!=i&&(o.total=i),o}).filter(e=>null!=e),r=Qi(t?.bins)??a?.length??0,i=Zi(t?.count)??a?.reduce((e,t)=>e+t.count,0)??0,o=Zi(t?.total)??a?.reduce((e,t)=>e+(t.total??0),0),n=a?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==i||o)return{bins:r,count:i,...null!=o&&o>0?{total:o}:{},...n?{leader:n}:{}}}function ho(e){let t=Xi(e);return!!t&&(Ji(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function po(e){if(e)return e.filter(e=>!0===Xi(e)?.sleeping).length}function fo(e,t,a){let r=e?.filter(e=>!0===Xi(e)?.sensor).length,i=Xi(t?.observation),o=Xi(i?.sensors),n=to(a?.activeSensors);return Math.max(r??0,o?Object.keys(o).length:0,n?.length??0)||void 0}function mo(e){let t=[],a=e.simulation,r=[a.state??(a.settled?"settled":void 0),null!=a.liveBodies?`${a.liveBodies} live ${no(a.liveBodies,"body")}`:void 0,null!=a.sleepingBodies?a.sleepingBodies+" sleeping":void 0,null!=a.queued?a.queued+" queued":void 0,null!=a.seed?"seed "+so(a.seed):void 0,a.gravity?`gravity (${so(a.gravity.x)}, ${so(a.gravity.y)})`:void 0,null!=a.fixedDt?`fixed step ${so(a.fixedDt)}s`:void 0,null!=a.timeScale?so(a.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);let i=e.geometry;if(i){let e=[null!=i.colliders?`${i.colliders} ${no(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${no(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${no(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${no(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let o=e.aggregates;if(o){let e=o.leader,a=e?` Largest is ${e.label} with ${so(e.count)}.`:"";t.push(`Physics aggregates: ${so(o.totalCount)} settled ${no(o.totalCount,"body")} across ${o.rows.length} ${no(o.rows.length,"container")}; ${o.populatedCount} populated.${a}`)}let n=e.sediment;if(n){let e=null!=n.total?", value total "+so(n.total):"",a=n.leader?`; largest sediment bin is ${n.leader.label} with ${so(n.leader.count)}`:"";t.push(`Physics sediment: ${n.count} retained ${no(n.count,"body")} in ${n.bins} ${no(n.bins,"bin")}${e}${a}.`)}return t.join(" ")}function go(e,t,a){if(!1===a)return;let r=Ji(a)?a:void 0,i=Xi(t.physics),o=eo(r?.snapshot,i?.snapshot,t.physicsSnapshot,ho(t.snapshot)?t.snapshot:void 0),n=eo(r?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=eo(r?.config,i?.config,o?.config,t.config),l=eo(Xi(o?.world),Xi(i?.world)),c=eo(Xi(s?.kernel),Xi(l?.options)),u=to(l?.bodies),d=to(l?.colliders,s?.colliders),h=to(o?.queue,i?.queue),p=to(o?.liveBodyOrder),f=to(l?.springs),m=to(o?.activeSensorPairs),g=co(lo(t,i,r,n)),y=uo(to(r?.sediment,i?.sediment,o?.sediment),eo(r?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??Qi(n?.bodyCount),v=po(u)??Qi(n?.sleepingCount),w=h?.length,A="string"==typeof o?.simulationState?o.simulationState:void 0,x="boolean"==typeof n?.settled?n.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,$=Xi(c?.gravity),C=Zi($?.x),S=Zi($?.y),k=ao({state:A,settled:x,elapsedSeconds:Zi(o?.elapsedSeconds),paused:"boolean"==typeof o?.paused?o.paused:void 0,visible:"boolean"==typeof o?.visible?o.visible:void 0,seed:Zi(c?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:Zi(s?.fixedDt??c?.fixedDt),timeScale:Zi(s?.timeScale),maxSubsteps:Qi(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:Zi(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=ao({colliders:d?.length,sensors:fo(d,s,l),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,I=Dc.has(e);if(!(Object.keys(k).length>0||P||g||y)||!I&&null==a)return;let E={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},N=mo(E);return{...E,text:N}}function yo(e){return e?"fits"in e||"buildProps"in e?{family:e.family}:{family:e.family,intentScores:e.intentScores}:{}}function bo(e,t,a={}){let r,{capability:i,audience:o,locale:n}=a,s=a.levels??["l1","l2","l3"],l=!1!==a.includeStructure,c=Wr(e,i),u=ti(e,t,{levels:c?[...s,"l4"]:s,locale:n,capability:i,audience:o}),{l4:d,...h}=u.levels,p=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),f={levels:h,text:u.annotations?`${u.annotations} ${p}`.trim():p,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=yo(i);r={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}let m=l?Wi(e,t,{maxLeaves:a.maxLeaves,locale:n}):void 0,g=go(e,t,a.physics),y=oo(e,t,Math.max(1,a.maxLeaves??200)),b=[f.text,r?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:f,intent:r,structure:m,physics:g,facts:y,text:b}}function vo(e,t=30){return Math.max((e??4)+5,12,t)}function wo(e,t){return Uc.has(e)&&!("reading"===e&&"string"==typeof t)}function Ao(e){let t=[...Hc],a=Array.from((new TextEncoder).encode(e)),r=8*a.length;for(a.push(128);a.length%64!=56;)a.push(0);let i=Math.floor(r/4294967296),o=r>>>0;a.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o);let n=[];for(let e=0;a.length>e;e+=4)n.push((a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3])>>>0);for(let e=0;n.length>e;e+=16){let a=[...n.slice(e,e+16)];for(let e=16;64>e;e+=1){let t=Vc(a[e-15],7)^Vc(a[e-15],18)^a[e-15]>>>3,r=Vc(a[e-2],17)^Vc(a[e-2],19)^a[e-2]>>>10;a[e]=a[e-16]+t+a[e-7]+r>>>0}let[r,i,o,s,l,c,u,d]=t;for(let e=0;64>e;e+=1){let t=d+(Vc(l,6)^Vc(l,11)^Vc(l,25))+(l&c^~l&u)+qc[e]+a[e]>>>0,n=r&i^r&o^i&o;d=u,u=c,c=l,l=s+t>>>0,s=o,o=i,i=r,r=t+((Vc(r,2)^Vc(r,13)^Vc(r,22))+n>>>0)>>>0}let h=[r,i,o,s,l,c,u,d];for(let e=0;8>e;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function xo(e,t){return`${e}[Symbol(${t.description??""})]`}function $o(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;let a=Number(e);return Number.isSafeInteger(a)&&a>=0&&t>a}function Co(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function So(e){return e.sort((e,t)=>{let a=JSON.stringify(e),r=JSON.stringify(t);return r>a?-1:a>r?1:0})}function ko(e,t,a){if(null===e)return null;if(e instanceof Date){let r=e.getTime();return Number.isFinite(r)?{$type:"date",value:e.toISOString()}:void a.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:""+e};case"undefined":case"function":case"symbol":return void a.excluded.push(t);case"object":{let r=e;if(a.ancestors.has(r))return void a.excluded.push(t);a.ancestors.add(r);try{if(Array.isArray(e)){for(let r of Reflect.ownKeys(e))"length"===r||"string"==typeof r&&$o(r,e.length)||a.excluded.push("symbol"==typeof r?xo(t,r):Co(t,r));return Array.from({length:e.length},(r,i)=>{let o=Co(t,i),n=Object.getOwnPropertyDescriptor(e,i+"");if(!n||!("value"in n)||!n.enumerable)return a.excluded.push(o),null;let s=ko(n.value,o,a);return void 0===s?null:s})}let r={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void a.excluded.push(t);let o=[];for(let r of Reflect.ownKeys(e)){if("symbol"==typeof r){a.excluded.push(xo(t,r));continue}let i=Object.getOwnPropertyDescriptor(e,r);i&&"value"in i&&i.enumerable?o.push(r):a.excluded.push(Co(t,r))}for(let i of o.sort()){let o=Object.getOwnPropertyDescriptor(e,i),n=ko(o&&"value"in o?o.value:void 0,Co(t,i),a);void 0!==n&&Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0})}return r}finally{a.ancestors.delete(r)}}default:return void a.excluded.push(t)}}function Ro(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":e+""];case"bigint":return["bigint",""+e];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{let a=a=>{let r="symbol"==typeof a?["symbol-key",a.description??""]:["string-key",a],i=Object.getOwnPropertyDescriptor(e,a);return i?"value"in i?[r,"data",!!i.enumerable,Ro(i.value,t)]:[r,"accessor",!!i.enumerable,!!i.get,!!i.set]:[r,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,r)=>{let i=r+"";return Object.prototype.hasOwnProperty.call(e,i)?a(i):["hole"]}),So(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&$o(t,e.length))).map(a))];let r=Object.getPrototypeOf(e);return[r!==Object.prototype&&null!==r?"non-json-object":"object",So(Reflect.ownKeys(e).map(a))]}finally{t.delete(e)}default:return["excluded"]}}function Po(e){let t={excluded:[],ancestors:/* @__PURE__ */new Set},a=ko(e,"$",t)??null;return{value:a,text:JSON.stringify(a),excludedPaths:t.excluded}}function Io(e){let t=Po(e),a=Ao(JSON.stringify(["semiotic-value-fingerprint","v2",Ro(e)]));return{...t,algorithm:"sha256",digest:a,fingerprint:"sha256:"+a}}function Eo(e,t,a,r){zo(e,Object.keys(t),a,r);for(let[i,o]of Object.entries(t))o.values?(o.required||void 0!==e[i])&&Lo(e,i,a,o.values,r):o.required?Bo(e,i,a,r):Go(e,i,a,r)}function No(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function To(e,t,a,r){void 0!==e[t]&&("number"!=typeof e[t]||!Number.isFinite(e[t]))&&r.push({path:`${a}.${t}`,message:"Expected a finite number."})}function Mo(e,t,a,r){void 0!==e[t]&&"boolean"!=typeof e[t]&&r.push({path:`${a}.${t}`,message:"Expected a boolean."})}function Oo(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(Oo):No(e)&&Object.values(e).every(Oo))}function Fo(e,t,a,r){void 0!==e[t]&&(!No(e[t])||!Oo(e[t]))&&r.push({path:`${a}.${t}`,message:"Expected a JSON object."})}function jo(e){return e.every(Oo)}function zo(e,t,a,r){let i=new Set(t);for(let t of Object.keys(e))i.has(t)||r.push({path:`${a}.${t}`,message:"Unexpected property."})}function Bo(e,t,a,r){("string"!=typeof e[t]||!e[t])&&r.push({path:`${a}.${t}`,message:"Expected a non-empty string."})}function Lo(e,t,a,r,i){("string"!=typeof e[t]||!r.includes(e[t]))&&i.push({path:`${a}.${t}`,message:`Expected one of: ${r.join(", ")}.`})}function _o(e,t,a,r){let i=e[t];if(void 0!==i)return No(i)?i:void r.push({path:`${a}.${t}`,message:"Expected an object."})}function Do(e,t,a,r){let i=e[t];if(void 0!==i)return Array.isArray(i)?i:void r.push({path:`${a}.${t}`,message:"Expected an array."})}function Uo(e,t,a){e?.some(e=>"string"!=typeof e||!e)&&a.push({path:t,message:"Expected non-empty string values."})}function Vo(e,t,a,r,i){void 0!==e[t]&&Lo(e,t,a,r,i)}function Go(e,t,a,r){void 0!==e[t]&&"string"!=typeof e[t]&&r.push({path:`${a}.${t}`,message:"Expected a string."})}function Ho(e,t,a){No(e)?(zo(e,["id","name","kind"],t,a),Bo(e,"kind",t,a),Go(e,"id",t,a),Go(e,"name",t,a)):a.push({path:t,message:"Expected an actor object."})}function qo(e,t){let a=_o(e,"reception","$",t);if(!a)return;zo(a,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);let r=Do(a,"channels","$.reception",t);r||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),r?.forEach((e,a)=>{let r=`$.reception.channels[${a}]`;No(e)?(zo(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],r,t),Lo(e,"channel",r,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),Vo(e,"disclosure",r,["summary","standard","detailed"],t),Vo(e,"rawData",r,["deny","bounded","allow"],t),Mo(e,"navigation",r,t),Mo(e,"interactionInstructions",r,t),To(e,"tokenBudget",r,t),Uo(Do(e,"privacyNotes",r,t),r+".privacyNotes",t)):t.push({path:r,message:"Expected a channel object."})});for(let e of["strengths","risks","scaffolds","manualChecks"])Uo(Do(a,e,"$.reception",t),"$.reception."+e,t);Go(a,"audience","$.reception",t),Go(a,"description","$.reception",t),Mo(a,"dataFallback","$.reception",t)}function Wo(e,t){let a=_o(e,"form","$",t);a&&(zo(a,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),Go(a,"chartFamily","$.form",t),Go(a,"whyThisForm","$.form",t),Uo(Do(a,"risks","$.form",t),"$.form.risks",t),Uo(Do(a,"misuse","$.form",t),"$.form.misuse",t),Do(a,"rejectedAlternatives","$.form",t)?.forEach((e,a)=>{let r=`$.form.rejectedAlternatives[${a}]`;No(e)?(zo(e,["representation","reason"],r,t),Bo(e,"representation",r,t),Bo(e,"reason",r,t)):t.push({path:r,message:"Expected an alternative object."})}))}function Yo(e,t){let a=_o(e,"contestability","$",t);a&&(zo(a,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),Mo(a,"sourceRequestsAllowed","$.contestability",t),Do(a,"challenges","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.challenges[${a}]`;if(No(e)){zo(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],r,t),Bo(e,"id",r,t),Bo(e,"claimId",r,t),Bo(e,"reason",r,t),Lo(e,"status",r,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&Ho(e.raisedBy,r+".raisedBy",t);for(let a of["raisedAt","counterclaimId","resolution"])Go(e,a,r,t)}else t.push({path:r,message:"Expected a challenge object."})}),Do(a,"corrections","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.corrections[${a}]`;if(!No(e))return void t.push({path:r,message:"Expected a correction object."});zo(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],r,t),Bo(e,"id",r,t),Bo(e,"reason",r,t);let i=Do(e,"affectedClaimIds",r,t);i||t.push({path:r+".affectedClaimIds",message:"Expected an affected-claim array."}),Uo(i,r+".affectedClaimIds",t),Uo(Do(e,"replacementClaimIds",r,t),r+".replacementClaimIds",t),Go(e,"createdAt",r,t),void 0!==e.createdBy&&Ho(e.createdBy,r+".createdBy",t)}),Do(a,"alternativeViews","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.alternativeViews[${a}]`;No(e)?(zo(e,["id","label","rationale"],r,t),Bo(e,"id",r,t),Bo(e,"label",r,t),Go(e,"rationale",r,t)):t.push({path:r,message:"Expected an alternative-view object."})}),Do(a,"editorialExceptions","$.contestability",t)?.forEach((e,a)=>{let r=`$.contestability.editorialExceptions[${a}]`;No(e)?(zo(e,["ruleId","rationale","owner","reviewAt"],r,t),Bo(e,"ruleId",r,t),Bo(e,"rationale",r,t),Go(e,"owner",r,t),Go(e,"reviewAt",r,t)):t.push({path:r,message:"Expected an editorial-exception object."})}))}function Ko(e,t){let a=_o(e,"accountability","$",t);a&&(zo(a,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),Do(a,"authors","$.accountability",t)?.forEach((e,a)=>Ho(e,`$.accountability.authors[${a}]`,t)),Uo(Do(a,"dataSources","$.accountability",t),"$.accountability.dataSources",t),Go(a,"generatedBy","$.accountability",t),Go(a,"codeRef","$.accountability",t),Do(a,"reviews","$.accountability",t)?.forEach((e,a)=>{let r=`$.accountability.reviews[${a}]`;if(No(e)){zo(e,["id","status","reviewer","reviewedAt","rationale","policyId"],r,t),Bo(e,"id",r,t),Lo(e,"status",r,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&Ho(e.reviewer,r+".reviewer",t);for(let a of["reviewedAt","rationale","policyId"])Go(e,a,r,t)}else t.push({path:r,message:"Expected a review object."})}),Do(a,"actions","$.accountability",t)?.forEach((e,a)=>{let r=`$.accountability.actions[${a}]`;if(!No(e))return void t.push({path:r,message:"Expected an action object."});zo(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],r,t),Bo(e,"id",r,t),Bo(e,"action",r,t);let i=Do(e,"claimIds",r,t);i||t.push({path:r+".claimIds",message:"Expected a claim identifier array."}),Uo(i,r+".claimIds",t),void 0!==e.actor&&Ho(e.actor,r+".actor",t);for(let a of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])Go(e,a,r,t);Vo(e,"status",r,["proposed","taken","reversed","invalidated"],t)}))}function Jo(e,t){let a=_o(e,"inheritance","$",t);if(a){zo(a,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(let e of["requiredPaths","prohibitedExports","sourceArtifactIds"])Uo(Do(a,e,"$.inheritance",t),"$.inheritance."+e,t);Vo(a,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),Vo(a,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),Vo(a,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function Xo(e,t){qo(e,t),Wo(e,t),Yo(e,t),Ko(e,t),Jo(e,t)}function Zo(e){for(let t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function Qo(e,t){if(void 0===e||No(e)){if(No(e))for(let[a,r]of Object.entries(e)){let e="$.fieldStatus."+a;if(!No(r)||"string"!=typeof r.status){t.push({path:e,message:"Expected a field state with a status."});continue}zo(r,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(r.status)||t.push({path:e+".status",message:"Expected one of: known, unknown, manual, not-applicable."}),void 0!==r.suppliedBy&&("string"!=typeof r.suppliedBy||!["author","system","model-proposal","import"].includes(r.suppliedBy))&&t.push({path:e+".suppliedBy",message:"Expected one of: author, system, model-proposal, import."}),Go(r,"reason",e,t),Go(r,"reviewedBy",e,t),Mo(r,"derived",e,t);let i=Object.prototype.hasOwnProperty.call(Wc,a)?Wc[a]:void 0,o="model-proposal"===r.suppliedBy,n=o&&!0===i?.modelMayPropose&&"known"!==r.status;i&&"known"===r.status&&"string"!=typeof r.suppliedBy&&t.push({path:e+".suppliedBy",message:`Known field "${a}" must identify an allowed supplier.`}),i&&"string"==typeof r.suppliedBy&&!n&&!i.suppliedBy.includes(r.suppliedBy)&&t.push({path:e+".suppliedBy",message:`Field "${a}" cannot be supplied by ${r.suppliedBy}.`}),i&&!0===r.derived&&!i.derivable&&t.push({path:e+".derived",message:`Field "${a}" cannot be marked as derived.`}),i&&o&&(!i.modelMayPropose||"known"===r.status)&&t.push({path:e+".suppliedBy",message:"known"===r.status?`A model proposal cannot finalize field "${a}" as known.`:`Field "${a}" does not accept model proposals.`}),"required"===i?.humanReview&&"known"===r.status&&("string"!=typeof r.reviewedBy||!r.reviewedBy.trim())&&t.push({path:e+".reviewedBy",message:`Known field "${a}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function en(e,t){let a="$.time";zo(e,[...Jc,...Object.keys(Xc),"sources"],a,t);for(let r of Jc)Go(e,r,a,t);for(let[r,i]of Object.entries(Xc)){let o=_o(e,r,a,t);o&&Eo(o,i,`${a}.${r}`,t)}Do(e,"sources",a,t)?.forEach((e,r)=>{let i=`${a}.sources[${r}]`;No(e)?Eo(e,Zc,i,t):t.push({path:i,message:"Expected a source object."})})}function tn(e){try{return an(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function an(e){let t=[],a=[];if(!No(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:a};let r=ua(e);if(r.length>0)return{valid:!1,errors:r.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:a};if(zo(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),"0.1"!==e.contractVersion&&t.push({path:"$.contractVersion",message:"Expected contract version 0.1."}),No(e.artifact)){zo(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),Bo(e.artifact,"id","$.artifact",t),Lo(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(let a of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])Go(e.artifact,a,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(No(e.purpose))if(Array.isArray(e.purpose.intents)){zo(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,a)=>{(!No(e)||"string"!=typeof e.id||!e.id)&&t.push({path:`$.purpose.intents[${a}].id`,message:"Expected a non-empty intent identifier."}),No(e)&&zo(e,["id","strength","source","rationale"],`$.purpose.intents[${a}]`,t),No(e)&&void 0!==e.strength&&Lo(e,"strength",`$.purpose.intents[${a}]`,["primary","secondary"],t),No(e)&&(Vo(e,"source",`$.purpose.intents[${a}]`,["author","derived","model-proposal","import"],t),Go(e,"rationale",`$.purpose.intents[${a}]`,t))});for(let a of["allowedUses","prohibitedUses"])Uo(Do(e.purpose,a,"$.purpose",t),"$.purpose."+a,t);Vo(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),Go(e.purpose,"communicativeAct","$.purpose",t),Go(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,a)=>{if(!No(e))return void t.push({path:`$.claims[${a}]`,message:"Expected a claim object."});zo(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${a}]`,t),Bo(e,"id",`$.claims[${a}]`,t),Lo(e,"kind",`$.claims[${a}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),Lo(e,"status",`$.claims[${a}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${a}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${a}].evidenceIds`,message:"Expected an evidence identifier array."}),Uo(Do(e,"supersedes",`$.claims[${a}]`,t),`$.claims[${a}].supersedes`,t),Go(e,"text",`$.claims[${a}]`,t),Go(e,"asOf",`$.claims[${a}]`,t),Fo(e,"scope",`$.claims[${a}]`,t),Uo(Do(e,"tags",`$.claims[${a}]`,t),`$.claims[${a}].tags`,t),void 0!==e.authoredBy&&Ho(e.authoredBy,`$.claims[${a}].authoredBy`,t);let r=_o(e,"review",`$.claims[${a}]`,t);r&&(zo(r,["status","reviewer","reviewedAt","rationale"],`$.claims[${a}].review`,t),Lo(r,"status",`$.claims[${a}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==r.reviewer&&Ho(r.reviewer,`$.claims[${a}].review.reviewer`,t),Go(r,"reviewedAt",`$.claims[${a}].review`,t),Go(r,"rationale",`$.claims[${a}].review`,t));let i=_o(e,"uncertainty",`$.claims[${a}]`,t);if(i){zo(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${a}].uncertainty`,t),Lo(i,"kind",`$.claims[${a}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(let e of["lower","upper","confidence"])To(i,e,`$.claims[${a}].uncertainty`,t);Go(i,"unit",`$.claims[${a}].uncertainty`,t),Go(i,"description",`$.claims[${a}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,a)=>{if(!No(e))return void t.push({path:`$.evidence[${a}]`,message:"Expected an evidence object."});zo(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${a}]`,t),Bo(e,"id",`$.evidence[${a}]`,t),Lo(e,"role",`$.evidence[${a}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(let r of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])Go(e,r,`$.evidence[${a}]`,t);Fo(e,"scope",`$.evidence[${a}]`,t);let r=_o(e,"source",`$.evidence[${a}]`,t);if(r){zo(r,["name","uri","version","retrievedAt","publisher"],`$.evidence[${a}].source`,t);for(let e of["name","uri","version","retrievedAt","publisher"])Go(r,e,`$.evidence[${a}].source`,t)}let i=_o(e,"transformation",`$.evidence[${a}]`,t);if(i){zo(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${a}].transformation`,t),Bo(i,"id",`$.evidence[${a}].transformation`,t),Lo(i,"kind",`$.evidence[${a}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);let e=Do(i,"inputEvidenceIds",`$.evidence[${a}].transformation`,t);e?Uo(e,`$.evidence[${a}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${a}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),Uo(Do(i,"assumptions",`$.evidence[${a}].transformation`,t),`$.evidence[${a}].transformation.assumptions`,t),Go(i,"description",`$.evidence[${a}].transformation`,t),Go(i,"implementation",`$.evidence[${a}].transformation`,t),Go(i,"performedAt",`$.evidence[${a}].transformation`,t),Fo(i,"parameters",`$.evidence[${a}].transformation`,t),void 0!==i.performedBy&&Ho(i.performedBy,`$.evidence[${a}].transformation.performedBy`,t)}let o=_o(e,"sample",`$.evidence[${a}]`,t);if(o){zo(o,["rowCount","fields","values","truncated"],`$.evidence[${a}].sample`,t),Uo(Do(o,"fields",`$.evidence[${a}].sample`,t),`$.evidence[${a}].sample.fields`,t);let e=Do(o,"values",`$.evidence[${a}].sample`,t);e&&!jo(e)&&t.push({path:`$.evidence[${a}].sample.values`,message:"Expected JSON values."}),To(o,"rowCount",`$.evidence[${a}].sample`,t),Mo(o,"truncated",`$.evidence[${a}].sample`,t)}Vo(e,"relationship",`$.evidence[${a}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),Qo(e.fieldStatus,t);let i=_o(e,"time","$",t);return i&&en(i,t),Xo(e,t),Fo(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&a.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&a.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:a}}function rn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function on(e,t){if(!t||!rn(e)||!Array.isArray(e.evidence))return[];let a=[];return e.evidence.forEach((e,t)=>{rn(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,a.push(`$.evidence[${t}].sample`))}),a}function nn(e,t={}){try{return sn(e,t)}catch{let t=ua(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function sn(e,t){if(!rn(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};let a=Po(e),r=[.../* @__PURE__ */new Set([...a.excludedPaths,...ua(e)])].sort(),i=a.value,o=on(i,t.excludeEvidenceSamples),n=o.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...r,...o],warnings:["Artifact contract is missing a string contractVersion.",...n]}};if("0.1"!==s)return{contract:i,transfer:{status:r.length>0?"invalid":"unsupported-version",omittedPaths:[...r,...o],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...r.length>0?[`Non-JSON values could not be preserved at: ${r.join(", ")}.`]:[],...n]}};let l=tn(i),c=[...l.errors.map(({path:e,message:t})=>`${e}: ${t}`),...l.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...r.length?[`Non-JSON values could not be preserved at: ${r.join(", ")}.`]:[],...n];return{contract:i,transfer:{status:!l.valid||r.length>0?"invalid":o.length>0?"excluded":"preserved",omittedPaths:[...r,...o],warnings:c}}}function ln(e){let t=nn(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function cn(e){let t=Object.entries(e).filter(([e,t])=>wo(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function un(e,t=[]){if(void 0===e)return;let a=t.filter(e=>!!e.transformation).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>t>e?-1:e>t?1:0);return Io(a.length>0?{data:e,transformations:a}:e).fingerprint}function dn(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!wo(e,t)&&"recipeId"!==e))}function hn(e,t,a,r=cn(t)){let i=dn(t),o=0===ua(i).length?Io(i).fingerprint:void 0,n=void 0!==r&&0===ua(r).length?un(r,e.evidence):void 0,s="ChartRecipe"===a&&"string"==typeof t.recipeId?t.recipeId:a,l=[],c=[];return void 0!==s&&(void 0===e.artifact.component?c.push("artifact.component"):e.artifact.component!==s&&l.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===o?c.push("artifact.configFingerprint"):e.artifact.configFingerprint!==o&&l.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&n?e.artifact.dataFingerprint!==n&&l.push("artifact.dataFingerprint"):c.push("artifact.dataFingerprint"),{status:l.length>0?"mismatch":c.length>0?"unknown":"match",mismatchPaths:l,unknownPaths:c}}function pn(e,t,a){let r=hn(e,t,a);return{mismatchPaths:[...r.mismatchPaths,...void 0!==a&&r.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function fn(e,t){return[.../* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])].filter(a=>{if(Object.prototype.hasOwnProperty.call(e,a)!==Object.prototype.hasOwnProperty.call(t,a))return!0;let r=Io(e[a]),i=Io(t[a]);return r.excludedPaths.length>0||r.fingerprint!==i.fingerprint}).map(e=>"props."+e).sort()}function mn(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function gn(e,t){let a=t.map(mn).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?a.some(e=>Uc.has(e)):"artifact.configFingerprint"===e&&a.some(e=>!Uc.has(e))}function yn(e){if(!e||"object"!=typeof e)return!1;let t=e,a=t.serializedDataFingerprint;return"string"==typeof t.status&&Qc.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==a||"string"==typeof a)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function bn(e,t,a,r){return Io({component:t,version:r.version,createdAt:r.createdAt,...void 0!==r.recipeId?{recipeId:r.recipeId}:{},...void 0!==r.portable?{portable:r.portable}:{},...void 0!==r.manifest?{manifest:r.manifest}:{},...void 0!==r.reason?{reason:r.reason}:{},...void 0!==r.warnings?{warnings:r.warnings}:{},...void 0!==r.selections?{selections:r.selections}:{},artifactContract:a,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function vn(e,t,a,r,i){let o=cn(a),n={...e,serializedConfigFingerprint:Io(dn(a)).fingerprint,serializedDataFingerprint:void 0===o?null:Io(o).fingerprint};return{...n,transferFingerprint:bn(n,t,r,i)}}function wn(e,t){let a=[],r=Io(dn(t.props)).fingerprint,i=cn(t.props),o=void 0===i?null:Io(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==bn(e,t.component,t.artifactContract,t)&&a.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==r&&a.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==o&&a.push("artifactTransfer.serializedDataFingerprint"),a}function An(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let a,r;if("props"===t||t.startsWith("props.")?(a=e,r=t):(a=e.artifactContract,r=t.startsWith("$.")?t.slice(2):t),"$"===r||""===r)return void 0!==a;let i=[...r.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(let e of i){if(null===a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,e))return!1;a=a[e]}return!0}function xn(e,t,a,r,i){if(!t)return{};let o=ln(t),n=i.recipeId??e,s=pn(t,a,n),l=fn(a,r),c=pn(t,r,n);return s.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:vn({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,r,o.contract,i)}:l.length>0?{artifactContract:o.contract,artifactTransfer:vn({status:"excluded",omittedPaths:l,warnings:["Chart props or data were excluded from the serialized configuration."]},e,r,o.contract,i)}:c.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:vn({status:"invalid",omittedPaths:c.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,r,o.contract,i)}:{artifactContract:o.contract,artifactTransfer:vn(o.transfer,e,r,o.contract,i)}}function $n(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(yn(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){let t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&An(e,t));return 0===t.length?{artifactTransfer:eu(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}let t=nn(e.artifactContract),a=e.artifactTransfer,r=t.transfer,i=(()=>{if(!a)return{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,"artifactTransfer"])],warnings:[...r.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!yn(a))return{status:"invalid",omittedPaths:r.omittedPaths,warnings:[...r.warnings,"The declared artifact transfer report is malformed."]};let t="excluded"===a.status||"unsupported-version"===a.status?a.omittedPaths.filter(t=>An(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[...r.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===a.status&&a.omittedPaths.length>0||"excluded"===a.status&&0===a.omittedPaths.length?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[...r.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:a.status===r.status||"preserved"===r.status&&("excluded"===a.status||"invalid"===a.status)&&a.omittedPaths.length>0?eu(a):{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,...r.omittedPaths])],warnings:[.../* @__PURE__ */new Set([...a.warnings,...r.warnings,`Declared artifact transfer status ${a.status} does not match the restored contract status ${r.status}.`])]}})();if(a&&yn(a)){let t=wn(a,e),r="invalid"!==a.status,o=[...r&&void 0===a.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...r&&!Object.prototype.hasOwnProperty.call(a,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...r&&void 0===a.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||o.length>0)&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...t,...o])],warnings:[.../* @__PURE__ */new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&"0.1"===t.contract?.contractVersion){let a=pn(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!gn(e,i.omittedPaths));a.length>0&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...a])],warnings:[.../* @__PURE__ */new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function Cn(e,t,a){Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0})}function Sn(e,t){return!(!wo(e,t)||"areas"===e&&"string"==typeof t)}function kn(e,t,a){if(a?.selections&&ua(a.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");let r=ha(e)??ma(t.recipe)??ma(t.recipeId);if(r)return Pn(r,t,a);if(!pe(e))throw Error(`Unknown component "${e}". Known components: ${nl.join(", ")}`);let i=!1!==a?.includeData,o={};for(let[e,a]of Object.entries(t))if(null!=a&&!au.has(e)&&(i||!Sn(e,a))&&"function"!=typeof a&&0>=ua(a).length)try{Cn(o,e,ru(a))}catch{}let n=/* @__PURE__ */(new Date).toISOString(),s={version:tu,createdAt:n,...a?.selections?{selections:a.selections}:{}};return{component:e,props:o,version:tu,createdAt:n,...xn(e,a?.artifactContract,t,o,s),...a?.selections?{selections:a.selections}:{}}}function Rn(e,t,a){let r={};for(let[i,o]of Object.entries(e))if(null!=o&&!au.has(i)&&"recipeId"!==i&&(t||!Sn(i,o))){if("function"==typeof o){if(a)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}if(ua(o).length>0){if(a)throw Error(`Portable recipe prop "${i}" is not JSON-safe.`);continue}Cn(r,i,ru(o))}return r}function Pn(e,t,a){let r=!1!==a?.includeData,i=ua(e);if("portable"===e.portability&&i.length>0)throw Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);let o=Rn(t,r,"portable"===e.portability),n=e.intents.map(br).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,l=s?fa(s):void 0,c=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(l&&c&&(l.version!==c.version||l.fingerprint!==c.fingerprint))throw Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);let u=l??c;if("portable"===e.portability&&s&&!u)throw Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);let d={name:e.name,intents:n,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:Io(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=/* @__PURE__ */(new Date).toISOString();if("portable"===e.portability){if(ua(o).length>0)throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);let r={version:tu,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...a?.selections?{selections:a.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:o,manifest:d,version:tu,createdAt:h,...xn("ChartRecipe",a?.artifactContract,t,o,r),...a?.selections?{selections:a.selections}:{}}}let p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:tu,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...a?.selections?{selections:a.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:o,manifest:d,version:tu,createdAt:h,...xn("ChartRecipe",a?.artifactContract,t,o,m),...a?.selections?{selections:a.selections}:{}}}function In(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function En(e){if(!In(e))throw Error("Invalid chart config: expected a plain object");let t=ua(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==tu)throw Error(`Unsupported chart config version ${e.version+""}; expected ${tu}.`);if("string"!=typeof e.component||!e.component.trim())throw Error("Invalid chart config: missing component");if(!In(e.props))throw Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!In(e.selections))throw Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!In(e.manifest))throw Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw Error("Invalid chart config: malformed recipe manifest")}}function Nn(e){if(En(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");let t=ha(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==Io(t).fingerprint)throw Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){let a=e.manifest.layoutId,r=a?pa(a):void 0,i=a?fa(a):void 0,o=r?i:i??(t.layout&&"object"==typeof t.layout&&t.layout.id===a&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0);if(!o||o.version!==e.manifest.layoutVersion||o.fingerprint!==e.manifest.layoutFingerprint)throw Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...ru(e.props),recipeId:e.recipeId},...$n(e)}}if(!pe(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:ru(e.props),...$n(e)}}function Tn(e,t={}){En(e);let a=JSON.stringify(e),r="sc="+btoa(unescape(encodeURIComponent(a))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");if(void 0!==t.maxLength&&r.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${r.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return r}function Mn(e){let t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");let a=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(a))),i=JSON.parse(r);return En(i),i}async function On(e,t="json"){let a="jsx"===t?Fn(e):JSON.stringify(e,null,2);if(typeof navigator>="u"||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(a)}function Fn(e){En(e);let{props:t}=e,a="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==a&&!pe(a))throw Error(`Cannot project unknown component "${a}" to JSX.`);let r=["<"+a];e.recipeId&&r.push(` recipeId={${zn(e.recipeId)}}`);for(let[e,a]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){let t={};Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),r.push(` {...${zn(t)}}`);continue}if("string"==typeof a)r.push(jn(a)?` ${e}="${a}"`:` ${e}={${zn(a)}}`);else if("boolean"==typeof a&&!0===a)r.push(" "+e);else if("boolean"==typeof a&&!1===a)r.push(` ${e}={false}`);else if("number"==typeof a)r.push(` ${e}={${a}}`);else{let t=zn(a);r.push(80>t.length?` ${e}={${t}}`:` ${e}={${zn(a,2)}}`)}}return r.push("/>"),r.join("\n")}function jn(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function zn(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Bn(e){let t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:Fn(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function Ln(e){let t=/* @__PURE__ */Object.create(null);for(let[a,r]of e){let e=[];for(let[,t]of r.clauses){let a=/* @__PURE__ */Object.create(null);for(let[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:Array.from(r.values)}:{type:"interval",range:r.range};e.push({clientId:t.clientId,type:t.type,fields:a})}t[a]={name:r.name,resolution:r.resolution,clauses:e}}return t}function _n(e){let t=/* @__PURE__ */new Map;for(let[a,r]of Object.entries(e)){let e=/* @__PURE__ */new Map;for(let t of r.clauses){let a=/* @__PURE__ */Object.create(null);for(let[e,r]of Object.entries(t.fields))a[e]="point"===r.type?{type:"point",values:new Set(r.values)}:{type:"interval",range:r.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:a})}t.set(a,{name:r.name,resolution:r.resolution,clauses:e})}return t}async function Dn(e,t){let{format:a="png",filename:r="chart",scale:i=2,background:o="white"}=t||{},n=e.querySelector('svg[role="img"]')||e.querySelector("svg");if(!n)throw Error("No SVG element found in the container");let s=n.cloneNode(!0),l=n.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",l.width+""),s.getAttribute("height")||s.setAttribute("height",l.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),Un(n,s),"svg"===a){let e=(new XMLSerializer).serializeToString(s);Vn(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),r+".svg")}else{let t=l.width*i,a=l.height*i,n=document.createElement("canvas");n.width=t,n.height=a;let c=n.getContext("2d");c.fillStyle=o,c.fillRect(0,0,t,a),c.scale(i,i);let u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);let d=(new XMLSerializer).serializeToString(s),h=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(h),f=new Image;f.width=l.width,f.height=l.height,await new Promise((e,t)=>{f.onload=()=>{c.drawImage(f,0,0),n.toBlob(a=>{a?(Vn(a,r+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},f.onerror=()=>{URL.revokeObjectURL(p),t(Error("Failed to load SVG image"))},f.src=p})}}function Un(e,t){let a=e.children,r=t.children,i=window.getComputedStyle(e),o=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(let e of o){let a=i.getPropertyValue(e);a&&"none"!==a&&""!==a&&t.style?.setProperty(e,a)}for(let e=0;Math.min(a.length,r.length)>e;e++)Un(a[e],r[e])}function Vn(e,t){let a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function Gn(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[a,r]of Object.entries(e))a.startsWith("_")||null==r||""===r||("number"==typeof r?Number.isFinite(r)&&(t[a]=r):"string"==typeof r?t[a]=r:"boolean"==typeof r?t[a]=r+"":r instanceof Date&&(t[a]=r.toISOString().slice(0,10)));return t}function Hn(e){return e&&"object"==typeof e?e:{}}function qn(e){return Hn(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Wn(e){let t=[];if(!Array.isArray(e))return t;let a=e.some(e=>e&&("line"===e.type||"area"===e.type));for(let r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(a)break;t.push({label:"Point",values:Gn(qn(r))});break;case"line":case"area":{let e=qn(r),a=Array.isArray(e)?e:[],i="line"===r.type?"Line point":"Area point";for(let e of a)t.push({label:i,values:Gn(e)});break}case"rect":{let e=qn(r),a=null!=e&&"object"==typeof e?e:{},i=a.category??r.group??"",o=a.value??a.__aggregateValue??a.total,n=Gn(a);null==n.category&&""!==i&&(n.category=i+""),null==n.value&&null!=o&&(n.value="number"==typeof o||"string"==typeof o?o:o+""),t.push({label:"Bar",values:n});break}case"heatcell":{let e=Gn(qn(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=qn(r),a=Gn(e);if(null==a.category){let t=Hn(e),r=t.category??t.label;null!=r&&(a.category=r+"")}t.push({label:"Wedge",values:a});break}case"circle":t.push({label:"Node",values:Gn(qn(r))});break;case"arc":t.push({label:"Arc",values:Gn(qn(r))});break;case"candlestick":t.push({label:"Candlestick",values:Gn(qn(r))});break;case"geoarea":{let e=Hn(qn(r)),a=Gn(e);if(null==a.name){let t=Hn(e.properties).name??e.name;null!=t&&(a.name=t+"")}t.push({label:"Region",values:a});break}}}catch{}return t}function Yn(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}function Kn(e){let t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function Jn(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function Xn(e){return"number"==typeof e&&Number.isFinite(e)}function Zn(e){if(Xn(e.x)&&Xn(e.y)&&Xn(e.w)&&Xn(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(Xn(e.x)&&Xn(e.y)&&Xn(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(Xn(e.cx)&&Xn(e.cy)&&Xn(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(Xn(e.cx)&&Xn(e.cy)&&Xn(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};let t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&Xn(e[0])&&Xn(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function Qn(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}function es(e,t){let a=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),r=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return r>0?a/r:0}function ts(e,t,a,r,i){if(e===t)return!0;let o=a.dataRoles.map(e=>xr(e,r,i)).filter(e=>!!e).filter(a=>null!=e[a]&&null!=t[a]);return o.length>0&&o.every(a=>e[a]+""==t[a]+"")}function as(e,t,a,r,i,o="warn",n){return{id:e,category:t,status:a?"pass":o,message:a?r:i,...n?{evidence:n}:{}}}function rs(e){let{recipe:t}=e,a=Yn(e.scene),r=e.layoutConfig??vr({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},o=i.x??0,n=i.y??0,s=[],l=a.filter(e=>null!=Jn(e)),c=a.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||Qn(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));s.push(as("geometry.finite","geometry",0===c.length,"All emitted geometry is finite.",c.length+" marks contain non-finite geometry.","fail",{count:c.length}));let u=a.map(Zn),d=u.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;s.push(as("geometry.nonzero-area","geometry",0===d,"All bounded marks have positive area.",d+" marks have zero or negative area.","warn",{count:d}));let h=u.filter(e=>e&&(o>e.x0||n>e.y0||e.x1>o+i.width||e.y1>n+i.height)).length;s.push(as("geometry.bounds","geometry",0===h,"All bounded marks stay inside the plot.",h+" marks extend outside the plot bounds.","warn",{count:h}));let p=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=u.filter(e=>!!e&&(p>e.x1-e.x0||p>e.y1-e.y0)).length;s.push(as("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${p}px minimum.`,`${m} targets are smaller than ${p}px in at least one dimension.`,"warn",{count:m,minimumTarget:p}));let g=l.map(Kn),y=g.filter(e=>!e).length,b=/* @__PURE__ */new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));s.push(as("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",y+" data-bearing marks have no pointId, id, or transition key.",t.audit?.requireStableIds?"fail":"warn",{missing:y})),s.push(as("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",v.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set(v)].slice(0,10)}));let w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&s.push({id:"identity.index-pattern",category:"identity",status:"warn",message:w+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});let A=/* @__PURE__ */new Set,x=0,$=e.inputData;for(let e of l){let a=Jn(e),i=Array.isArray(a)?a:[a],o=!1;for(let e of i)if(e&&"object"==typeof e)for(let a=0;$.length>a;a+=1)ts(e,$[a],t,r,$)&&(A.add(a),o=!0);o||(x+=1)}let C=Math.max(0,$.length-A.size);s.push(as("coverage.input-data","coverage",0===C,"Every input datum is represented by the observed scene.",C+" input data items have no matching scene mark.",t.audit?.requireDatumCoverage?"fail":"warn",{represented:A.size,input:$.length})),s.push(as("coverage.scene-data","coverage",0===x,"Every data-bearing scene mark maps back to input data.",x+" scene marks do not map back to an input datum.","warn",{count:x})),!t.encodings?.some(e=>"count"===e.channel)&&l.length>A.size&&A.size>0&&s.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});let S=l.filter(e=>!1===e.interactive).length;s.push(as("interaction.hit-targets","interaction",0===S&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":S+" data-bearing marks explicitly disable interaction.","fail"));let k=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),R=k.filter(e=>!b.has(e));s.push(as("coverage.annotation-anchors","coverage",0===R.length,k.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",R.length+" annotations point to missing scene ids.","fail",{unresolved:R}));let P=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&s.push(as("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",P.length+" selected ids are not reachable in the scene.","fail",{missing:P}));let I=Wn(a),E=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;let a=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return a?xr(a,r,$):void 0}).filter(e=>!!e),N=new Set(I.flatMap(e=>Object.keys(e.values))),T=E.filter(e=>!N.has(e));s.push(as("accessibility.table-fields","accessibility",0===T.length,E.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${T.join(", ")}.`,"fail",{expectedFields:E,observedFields:[...N]})),new Set($.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=N.size&&[...N].every(e=>"category"===e||"value"===e)&&s.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});let M=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);s.push(as("accessibility.color-only","accessibility",0===M.length,"Every declared color encoding names a redundant cue.",M.length+" color encodings have no declared redundant cue.","warn"));let O=e.chart;if(O){for(let[e,a]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])a&&s.push(as("accessibility."+e,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&s.push(as("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&s.push(as("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}let F=e.theme?.background??"#ffffff",j=a.filter(e=>{let t=e.style?.fill??e.fill;if("string"!=typeof t||!t.startsWith("#")||!F.startsWith("#"))return!1;let a=f(t,F);return null!=a&&3>a}).length;s.push(as("visual.contrast","visual",0===j,"All statically checkable mark fills meet 3:1 contrast.",j+" marks have fill contrast below 3:1.","warn",{background:F}));let z=0,B=u.filter(e=>!!e).slice(0,500);for(let e=0;B.length>e;e+=1)for(let t=e+1;B.length>t;t+=1)es(B[e],B[t])>=.8&&(z+=1);z>B.length&&s.push({id:"visual.overlap-density",category:"visual",status:"warn",message:z+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});let L=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),_={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(br).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},D=[...s,...L],U=s.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===U,summary:{marks:a.length,passes:D.filter(e=>"pass"===e.status).length,warnings:D.filter(e=>"warn"===e.status).length,failures:U,manual:D.filter(e=>"manual"===e.status).length},declaredSemantics:_,observedSceneEvidence:s,manualATChecks:L}}function is(e){let t=1/0,a=-1/0;for(let r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}function os(e,t){let{groupBy:a,value:r,agg:i="sum"}=t,o=/* @__PURE__ */new Map,n="min"===i?1/0:"max"===i?-1/0:0;for(let t of e){let e=t[a]+"",s=o.get(e);s||(s={total:n,count:0},o.set(e,s));let l=Number(t[r]);switch(s.count++,i){case"count":break;case"min":s.total>l&&(s.total=l);break;case"max":l>s.total&&(s.total=l);break;default:s.total+=l}}let s=[];for(let[e,t]of o){let r="count"===i?t.count:"mean"===i?t.total/t.count:t.total;s.push({[a]:e,value:r})}return s}function ns(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};let{type:t,...a}=e;return{type:t,markProps:a}}function ss(e){if(e)return"string"==typeof e?e:e.text}function ls(e){return"nominal"===e||"ordinal"===e}function cs(e){return"quantitative"===e||"temporal"===e}function us(e){return e.usermeta?.idid}function ds(e){return"annotation-layer"===e.usermeta?.idid?.role}function hs(e){if(!us(e)||!Array.isArray(e.layer))return e;let t=e.layer.filter(e=>!ds(e));if(1!==t.length)return e;let{layer:a,...r}=e,{usermeta:i,...o}=t[0];return{...r,...o}}function ps(e){e=hs(e);let t,a=[],{type:r,markProps:i}=ns(e.mark),o=e.encoding||{},n=o.x,s=o.y,l=o.color,c=o.size,u=o.theta,d=o.opacity;e.data?.values?t=e.data.values:e.data?.url&&a.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&a.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&a.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&a.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&a.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&a.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&a.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");let h={};e.width&&(h.width=e.width),e.height&&(h.height=e.height);let p=ss(e.title);if(p&&(h.title=p),l?.field&&(h.colorBy=l.field,l.scale?.scheme)){let e=iu[l.scale.scheme];e&&(h.colorScheme=e)}void 0!==d?.value&&(h.pointOpacity=d.value);let f,m=n?.aggregate,g=s?.aggregate;if(t&&(m||g)){let e=g?s:n,a=g?n:s,r=nu[e.aggregate];if(r&&a?.field&&e.field)t=os(t,{groupBy:a.field,value:e.field,agg:r});else if(("count"===r||"count"===e.aggregate)&&a?.field&&t){let e=/* @__PURE__ */new Map;for(let r of t){let t=r[a.field]+"";e.set(t,(e.get(t)||0)+1)}t=Array.from(e,([e,t])=>({[a.field]:e,value:t}))}}if(n?.bin||s?.bin){let e="Histogram";t&&(h.data=t),n?.bin?(h.valueAccessor=n.field,s?.field&&(h.categoryAccessor=s.field),n.axis?.title&&(h.valueLabel=n.axis.title)):s?.bin&&(h.valueAccessor=s.field,n?.field&&(h.categoryAccessor=n.field),s.axis?.title&&(h.valueLabel=s.axis.title));let r=n?.bin||s?.bin,i="object"==typeof r?r.maxbins:void 0;return i&&(h.bins=i),gs(e,h,a)}switch(r){case"bar":f=fs(n,s,l,h,t,m,g);break;case"line":if(f="LineChart",ms(n,s,h,m,g),l?.field&&(h.lineBy=l.field),i.interpolate){let e=ou[i.interpolate];e&&(h.curve=e)}!0===i.point&&(h.showPoints=!0),t&&(h.data=t);break;case"area":if(l?.field?(f="StackedAreaChart",h.areaBy=l.field):f="AreaChart",ms(n,s,h,m,g),i.interpolate){let e=ou[i.interpolate];e&&(h.curve=e)}void 0!==i.opacity&&(h.areaOpacity=i.opacity),t&&(h.data=t);break;case"point":case"circle":case"square":c?.field?(f="BubbleChart",h.sizeBy=c.field,c.scale?.range&&(h.sizeRange=c.scale.range)):f="Scatterplot",ms(n,s,h,m,g),t&&(h.data=t);break;case"rect":f="Heatmap",n?.field&&(h.xAccessor=n.field),s?.field&&(h.yAccessor=s.field),l?.field&&(h.valueAccessor=l.field,delete h.colorBy),n?.axis?.title&&(h.xLabel=n.axis.title),s?.axis?.title&&(h.yLabel=s.axis.title),t&&(h.data=t);break;case"arc":i.innerRadius&&i.innerRadius>0?(f="DonutChart",h.innerRadius=i.innerRadius):f="PieChart",u?.field?h.valueAccessor=u.field:s?.field&&(h.valueAccessor=g?"value":s.field),l?.field&&(h.categoryAccessor=l.field),n?.field&&!u?.field&&(h.categoryAccessor=n.field),t&&(h.data=t);break;case"tick":f="DotPlot",ls(n?.type)?(h.categoryAccessor=n.field,s?.field&&(h.valueAccessor=g?"value":s.field),n?.axis?.title&&(h.categoryLabel=n.axis.title),s?.axis?.title&&(h.valueLabel=s.axis.title)):ls(s?.type)?(h.categoryAccessor=s.field,n?.field&&(h.valueAccessor=m?"value":n.field),h.orientation="horizontal",s?.axis?.title&&(h.categoryLabel=s.axis.title),n?.axis?.title&&(h.valueLabel=n.axis.title)):(n?.field&&(h.categoryAccessor=n.field),s?.field&&(h.valueAccessor=g?"value":s.field)),t&&(h.data=t);break;default:a.push(`Unsupported mark type "${r}". Defaulting to Scatterplot.`),f="Scatterplot",ms(n,s,h,m,g),t&&(h.data=t)}return gs(f,h,a)}function fs(e,t,a,r,i,o,n){let s;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",r.stackBy=a.field):s="BarChart",ls(e?.type)&&cs(t?.type)?(r.categoryAccessor=e.field,r.valueAccessor=n?"value":t.field,e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)):cs(e?.type)&&ls(t?.type)?(r.categoryAccessor=t.field,r.valueAccessor=o?"value":e.field,r.orientation="horizontal",t?.axis?.title&&(r.categoryLabel=t.axis.title),e?.axis?.title&&(r.valueLabel=e.axis.title)):(e?.field&&(r.categoryAccessor=e.field),t?.field&&(r.valueAccessor=n?"value":t.field),e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)),i&&(r.data=i),s}function ms(e,t,a,r,i){e?.field&&(a.xAccessor=r?"value":e.field),t?.field&&(a.yAccessor=i?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function gs(e,t,a){let r={component:e,props:t,version:"1",createdAt:/* @__PURE__ */(new Date).toISOString()};if(a.length>0){r.warnings=a;for(let e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}function ys(e){return Array.isArray(e)?e[0]:e}function bs(e,t){for(let a of t){let t=e.find(e=>e.lower===a);if(t)return t}}function vs(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let a=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(let[t,a]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(r&&hu.has(e)||null==a)continue;let o=typeof a;"string"!==o&&"number"!==o&&"boolean"!==o&&!(a instanceof Date)||i.push({key:t,lower:e,value:a})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>cu.includes(e.lower)),n=o>=0;0>o&&(o=i.findIndex(e=>"id"===e.lower)),0>o&&(o=i.findIndex(e=>"string"==typeof e.value));let s=0>o?void 0:i[o],l=i.filter((e,t)=>t!==o&&(!n||"id"!==e.lower)),c=bs(l,uu),u=bs(l,du),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of l){if(d.length>=a)break;uu.includes(e.lower)||du.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function ws({chrome:e="default",className:t="",style:a,children:r,...i}){let o="default"===e?{...mu,...a}:a;/* @__PURE__ */
2
+ return fu("div",{...i,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:o,children:r})}function As(e){return e.ownsChrome=!0,e}function xs(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function $s(e){if(!pu.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let a=e.props,r=a["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;let i=a.style;return!(!i||"object"!=typeof i||!xs(i.background)&&!xs(i.backgroundColor))}function Cs(e,t){return"function"==typeof t?t(e):e[t]}function Ss(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";let 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 ks(e={}){let{fields:t,title:a,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let n,s=[];if(a){let t=Cs(e,a);n=Ss(t,r)}if(t&&t.length>0)t.forEach(t=>{let a,i,o;"string"==typeof t?(a=t,i=t,o=r):(a=t.label,i=t.accessor||t.key||"",o=t.format||r);let n=Cs(e,i);s.push({label:a,value:Ss(n,o)})});else if(!a){let t=["value","y","name","id","label"];for(let a of t)if(void 0!==e[a]){n=Ss(e[a],r);break}if(!n){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(n=Ss(e[t[0]],r))}}/* @__PURE__ */
3
+ return yu(ws,{className:o,style:i,children:[n&&/* @__PURE__ */gu("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:n}),s.map((e,t)=>/* @__PURE__ */yu("div",{style:{marginTop:0===t&&n?"4px":0},children:[e.label&&/* @__PURE__ */yu("span",{children:[e.label,": "]}),e.value]},t))]})}}function Rs(e={}){let{fields:t=[],title:a,format:r,style:i={},className:o="",showLabels:n=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let l=[];if(a){let t=Cs(e,a);l.push({value:Ss(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let a,i,o;"string"==typeof t?(a=t,i=t,o=r):(a=t.label,i=t.accessor||t.key||"",o=t.format||r);let s=Ss(Cs(e,i),o);l.push({label:n?a:void 0,value:s})});else{let t=vs(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:Ss(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:n?e.key:void 0,value:Ss(e.value,r)})})}return Array.isArray(l)&&0!==l.length?/* @__PURE__ */gu(ws,{className:("semiotic-tooltip-multiline "+o).trim(),style:i,children:l.map((e,t)=>/* @__PURE__ */yu("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */yu("strong",{children:[e.label,s]}),e.value]},t))}):null}}function Ps(e){return"multi"===e||Is(e)}function Is(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Es(e){let{tooltip:t,defaultTooltipContent:a,multiDefaultContent:r=Ts(),customFunctionContext:i="datum"}=e,o=t;return!1===t?{tooltipContent:()=>null}:Ps(o)?{tooltipContent:(Is(o)&&"function"==typeof o.content?Ms(o.content):void 0)||r,tooltipMode:"multi"}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Ms(o)||a}}function Ns(e){let{tooltip:t,defaultTooltipContent:a,customFunctionContext:r="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Ms(t)||a}}function Ts(){return e=>{let t=e.allSeries;if(!t||0===t.length)/* @__PURE__ */
4
+ return gu(ws,{children:/* @__PURE__ */gu("div",{children:Ss(e.data?.value??e.data?.y)})});let a=e.xValue??e.data?.time??e.data?.x;/* @__PURE__ */
5
+ return yu(ws,{children:[null!=a&&/* @__PURE__ */gu("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:Ss(a)}),t.map((e,t)=>/* @__PURE__ */yu("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
6
+ /* @__PURE__ */gu("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
7
+ /* @__PURE__ */gu("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
8
+ /* @__PURE__ */gu("span",{style:{fontWeight:500,fontSize:"0.85em"},children:Ss(e.value)})]},t))]})}}function Ms(e){if(!0!==e){if("function"==typeof e){let t=e;return e=>{let a=!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),r=ys(a?e.data??{}:e);if(!r||(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r))return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){let t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}let i=t(r);return null==i?null:$s(i)?i:/* @__PURE__ */gu(ws,{children:i})}}if(!1===e||void 0===e)return!1;if(Is(e)){if("function"==typeof e.content)return Ms(e.content);"u">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.');let t=Rs();return Ms(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=ks(e);return Ms(e=>t(e))}if("multi"===e){"u">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.');let e=Rs();return Ms(t=>e(t))}return ks()}}function Os(e=240){let t=360-e,a=180+t/2,r=a*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:a,startAngleRad:r,offsetRad:-Math.PI/2+r}}function Fs(e,t,a,r,i){let o=a-t||1;return i+(Math.max(t,Math.min(a,e))-t)/o*r}function js(e=240){let{sweepRad:t,offsetRad:a}=Os(e),r=[[Math.cos(a),Math.sin(a)],[Math.cos(a+t),Math.sin(a+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)t+.001>=((e-a)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)&&r.push([Math.cos(e),Math.sin(e)]);let i=r.map(e=>e[0]),o=r.map(e=>e[1]),[n,s]=is(i),[l,c]=is(o);return{minX:n,maxX:s,minY:l,maxY:c,width:s-n,height:c-l,cx:(n+s)/2,cy:(l+c)/2}}var zs=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Bs={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Ls={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},_s={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:zs,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},Ds=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],Us={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},Vs={light:Bs,dark:Ls,"high-contrast":_s,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},Gs=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),Hs=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),qs=Object.freeze({name:"Semiotic balanced",weights:Gs,thresholds:Hs,minimumScore:70}),Ws=Object.freeze({name:"Aesthetics off",weights:Object.freeze(Object.fromEntries(Object.keys(Gs).map(e=>[e,0]))),minimumScore:0}),Ys=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],Ks=/* @__PURE__ */new Set(["category10","tableau10"]),Js=/* @__PURE__ */new Set(["DonutChart","PieChart","SwimlaneChart"]),Xs={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};import*as Zs from"react";var Qs=6e4,el=36e5,tl=24*el,al=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rl=null;import{jsx as il,jsxs as ol}from"react/jsx-runtime";var nl=["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],sl=new Set(nl),ll={title:["BigNumber"],description:[],summary:[]},cl=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["string","object"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["array","function"],["string","number","array","object","function"]],ul=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],dl={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},xyAxis:{xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],capacity:1,capacityMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:14,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:13,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:14,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},hl=[[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,atlas:10,colorScheme:7,linkedHover:14,selection:10,onClick:12}],[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:14,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,linkedHover:14,linkedSelection:10,onSelectNode:12,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:17,onBrush:12,regression:14}],[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,barPadding:1,roundedTop:16,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:17,onBrush:12}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:17}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:15,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:14}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,showScaleLabels:4,backgroundColor:0,styleRules:9}],[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:16,valueExtent:9,trackFill:17,gradientFill:3,brush:4,onBrush:12,linkedBrush:17,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:17,onBrush:12}],[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10,brush:4,linkedBrush:17,onBrush:12}],[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:14,brush:4,linkedBrush:17,onBrush:12}],[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,xExtent:9,yExtent:9,regression:14,forecast:10,anomaly:10}],[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,brushExtent:9,yExtent:9}],[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common"],{styleRules:9,nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],[["domain"],"network",["sourceAccessor","targetAccessor"],["common"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,styleRules:9,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common"],{styleRules:9,edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],[["data"],"object",[],["common"],{styleRules:9,data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],[["data"],"object",[],["common"],{styleRules:9,data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:16,speed:1,eccentricity:16,showRings:4,nodeRadius:16,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[[],"realtime",[],["realtime"],{styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,seriesAccessor:6,aggregate:10,eventTime:10,transition:10}],[["binSize"],"realtime",[],["realtime"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,binSize:1,direction:[0,47],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:14,onBrush:12,linkedBrush:17,transition:10}],[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showValueAxis:4,axes:9,styleRules:9,data:9,binSize:1,capacity:1,capacityMode:[0,7],size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,direction:[0,47],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:13,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:14,linkedBrush:17,brush:14,onBrush:12}],[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,48],simulationMode:[0,49],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor"],["physics"],{styleRules:9,timeAccessor:6,arrivalAccessor:6,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,48],simulationMode:[0,49],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:32,bodyGroups:32,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,50],terminalBehavior:[0,51]}],[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,52],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,53],groupCompletion:[0,54],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,55],seed:1}],[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,56],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,57],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,58],insight:[0,59],currentTime:2,controls:20,mechanism:[0,60],orientation:[0,61],reducedMotion:[0,62],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,63],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,63],showDeltaPercent:4,direction:[0,64],sentiment:[0,65],thresholds:9,chartSlot:33,chartSize:1,windowSize:1,mode:[0,66],align:[0,67],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:33,valueSlot:33,deltaSlot:33,trendSlot:33,footerSlot:33,onClick:12,onObservation:12}]],pl=/* @__PURE__ */ge(),fl=/* @__PURE__ */new Set(["start","center","end","left","right"]),ml={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}};import{interpolateLab as gl}from"d3-interpolate";var yl=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),bl=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),vl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),wl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart"]),Al=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),xl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),$l=/* @__PURE__ */new Set(["PieChart","DonutChart"]),Cl={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},Sl=new Set(Object.keys(Cl)),kl={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},Rl=/* @__PURE__ */new Set(["BigNumber"]),Pl=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Il=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),El=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Nl=/* @__PURE__ */new Set(["OrbitDiagram",...El]),Tl=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Ml=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Ol=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),Fl=/* @__PURE__ */new Set(["MultiAxisLineChart"]),jl=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),zl={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},Bl=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Ll=new Set(["label","callout","callout-circle","callout-rect"]),_l=["xExtent","yExtent","rExtent"],Dl=/^\d{4}-\d{1,2}$/,Ul=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],Vl={fields:Ul},Gl=[{...Ul[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...Ul[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],Hl={fields:Gl},ql={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},Wl={...ql,domain:!0},Yl={fields:[{...ql,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Kl={fields:[ql],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},Jl={fields:Gl,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},Xl={fields:[...Ul,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Zl={fields:[...Ul,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Ql={fields:[ql]},ec={fields:[{...ql,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},tc={LineChart:Hl,AreaChart:Hl,BumpChart:Hl,Scatterplot:Zl,ConnectedScatterplot:Vl,QuadrantChart:Zl,MinimapChart:Hl,BubbleChart:Xl,StackedAreaChart:Jl,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Ql,BarChart:{fields:[ql]},GroupedBarChart:{fields:[ql]},StackedBarChart:Kl,DotPlot:{fields:[Wl]},Histogram:{fields:[Wl]},BoxPlot:{fields:[Wl]},SwarmPlot:{fields:[Wl,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[Wl]},RidgelinePlot:{fields:[Wl]},PieChart:Yl,DonutChart:Yl,FunnelChart:Yl,SankeyDiagram:ec,ChordDiagram:ec,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},ac=/* @__PURE__ */Symbol.for("semiotic.numericContractRegistry"),rc={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},ic=/* @__PURE__ */new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),oc=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],nc=["title","description","summary"],sc=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),lc=/* @__PURE__ */new Set([...sc,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),cc=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),uc=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),dc={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},hc=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],pc={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},fc={error:0,warning:1,manual:2},mc={data:0,deception:1,accessibility:2,render:3},gc=/* @__PURE__ */new Set([...Pl,"RealtimeLineChart","RealtimeHeatmap"]),yc=Object.fromEntries(Object.entries(zl).map(([e,t])=>[e,[t,"hoverRadius"]])),bc={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},vc=["layout","density","interaction","annotation","semantics"],wc=/* @__PURE__ */Symbol.for("semiotic.intentRegistry"),Ac=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),xc=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),$c=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),Cc=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Sc={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"},kc=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Rc=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Pc=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Ic={"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"},Ec={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Nc=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Tc={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Mc=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Oc=/* @__PURE__ */new Set(["system","agent","watcher"]),Fc=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),jc=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),zc={"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"},Bc=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Lc=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),_c=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Dc=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Uc=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),Vc=(e,t)=>(e>>>t|e<<32-t)>>>0,Gc=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[Hc,qc]=/* @__PURE__ */(()=>{let e=[],t=[];for(let a=2;64>t.length;a+=1){let r=!0;for(let e=2;a>=e*e;e+=1)if(a%e===0){r=!1;break}r&&(8>e.length&&e.push(Gc(Math.sqrt(a))),t.push(Gc(Math.cbrt(a))))}return[e,t]})(),Wc=/* @__PURE__ */Zo({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Yc=["fresh","stale","unknown"],Kc=["partial","provisional","settled","unknown"],Jc=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Xc={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Yc},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:Kc},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Zc={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Yc},completeness:{values:Kc}},Qc=/* @__PURE__ */new Set(["preserved","unsupported-version","invalid","excluded"]),eu="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),tu="1",au=/* @__PURE__ */new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),ru="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),iu={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"},ou={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"},nu={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"},su=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){let t=[];for(let a of e){let e=this.push(a);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){let t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e(this.buffer[(t+a)%this._capacity],a)}toArray(){let e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let a=0;this._size>a;a++)e[a]=this.buffer[(t+a)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");let t=this.toArray(),a=0,r=[];t.length>e&&(a=t.length-e,r=t.slice(0,a)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=a;t.length>e;e++)this.push(t[e]);return r}update(e,t){let a=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++){let o=(r+i)%this._capacity,n=this.buffer[o];if(e(n)){let e;e="object"!=typeof n||null===n?n:Array.isArray(n)?[...n]:{...n},a.push(e),this.buffer[o]=t(n)}}return a}remove(e){let t=[],a=[];if(this.forEach(r=>{e(r)?a.push(r):t.push(r)}),0===a.length)return a;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(let e of t)this.push(e);return a}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},lu=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}evict(e){(e===this._min||e===this._max)&&(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(let a of e){let e=t?t(a):a;Number.isFinite(e)&&(this._min>e&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},cu=["name","label","title"],uu=["type","kind","category","group","class","status","role","shape"],du=["value","amount","total","count","weight","score"],hu=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import*as pu from"react";import{jsx as fu}from"react/jsx-runtime";var mu={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"};As(ws);import{jsx as gu,jsxs as yu}from"react/jsx-runtime";export{Ws as AESTHETICS_OFF_PROFILE,Us as CARBON_ALERT,Ds as CARBON_CATEGORICAL_14,zs as COLOR_BLIND_SAFE_CATEGORICAL,Ls as DARK_THEME,qs as DEFAULT_AESTHETIC_PROFILE,Hs as DEFAULT_AESTHETIC_THRESHOLDS,Gs as DEFAULT_AESTHETIC_WEIGHTS,_s as HIGH_CONTRAST_THEME,lu as IncrementalExtent,Bs as LIGHT_THEME,Rs as MultiLineTooltip,Ts as MultiPointTooltip,su as RingBuffer,Vs as THEME_PRESETS,ks as Tooltip,ws as TooltipRoot,Ra as accessibilityCaveats,K as adaptiveTimeTicks,ka as auditAccessibility,kt as auditData,lr as auditMobileVisualization,rs as auditObservedScene,A as auditVisualHierarchy,Wi as buildNavigationTree,bo as buildReaderGrounding,Vr as communicativeActForIntent,d as composeStyleRules,js as computeArcBoundingBox,Fn as configToJSX,Bn as configToJSXWithReport,On as copyConfig,Ki as countNodes,te as createHatchPattern,X as darkenColor,ti as describeChart,_n as deserializeSelections,ea as diagnoseConfig,L as evaluateAesthetics,Ba as evaluateChart,Dn as exportChart,Yi as flattenVisible,Pa as formatAccessibilityAudit,ct as formatDataAudit,za as formatEvaluateChart,cr as formatMobileVisualizationAudit,Nn as fromConfig,Mn as fromURL,ps as fromVegaLite,vo as getHitRadius,$s as hasOwnTooltipChrome,ie as hatchFillId,re as hatchFillKey,ae as isHatchFill,Ps as isMultiTooltip,Z as lightenColor,n as makeNodeRuleContext,i as makeRuleValueResolver,h as makeStyleRuleStyleFn,o as makeXYRuleContext,As as markTooltipChrome,l as matchesThreshold,ur as mobileVisualizationCaveats,Ms as normalizeTooltip,lt as profileNumericFields,Wr as resolveCommunicativeAct,Es as resolveMultiCapableTooltip,J as resolveResponsiveDimension,Ha as resolveResponsiveRules,u as resolveStyleRules,e as resolveThemePreset,Ns as resolveTooltipContent,Va as responsiveRuleMatches,c as ruleMatches,Ln as serializeSelections,_ as smartTickFormat,Os as sweepToAngles,a as themeToCSS,t as themeToCSSVariables,r as themeToTokens,kn as toConfig,dt as toDataAuditNotifications,La as toEvaluateChartNotifications,Tn as toURL,xe as unwrapDatum,Ae as validateProps,Fs as valueToAngle};