semiotic 3.9.2 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +97 -76
  2. package/agent-skill/semiotic-charts/SKILL.md +13 -7
  3. package/ai/artifact-contract-reference.md +408 -0
  4. package/ai/artifact-surface-inventory.json +5586 -0
  5. package/ai/behaviorContracts.cjs +24 -2
  6. package/ai/cli.js +480 -56
  7. package/ai/componentMetadata.cjs +3 -1
  8. package/ai/dist/mcp-server.js +68 -68
  9. package/ai/examples.md +68 -1
  10. package/ai/reference.md +105 -14
  11. package/ai/schema.json +6646 -18
  12. package/ai/surface-manifest.json +34 -6
  13. package/ai/system-prompt.md +2 -0
  14. package/ai/task-packets/compare-category-totals.json +301 -0
  15. package/ai/task-packets/compare-category-totals.md +188 -0
  16. package/ai/task-packets/correct-published-chart.json +271 -0
  17. package/ai/task-packets/correct-published-chart.md +597 -0
  18. package/ai/task-packets/index.json +40 -0
  19. package/ai/task-packets/update-live-chart.json +289 -0
  20. package/ai/task-packets/update-live-chart.md +424 -0
  21. package/dist/c-2N7IU2NY.min.js +1 -0
  22. package/dist/c-2RL2QPZJ.min.js +1 -0
  23. package/dist/c-2WK7YJLL.min.js +1 -0
  24. package/dist/c-42PLDTX7.min.js +1 -0
  25. package/dist/c-45CQWZZ6.min.js +1 -0
  26. package/dist/c-4BRHKVKV.min.js +1 -0
  27. package/dist/c-7242NXSG.min.js +1 -0
  28. package/dist/c-7DVPSB5C.min.js +1 -0
  29. package/dist/c-7EGHJU2F.min.js +1 -0
  30. package/dist/c-A7OGOFSL.min.js +1 -0
  31. package/dist/c-AFBSWT77.min.js +1 -0
  32. package/dist/c-AH5HWZWS.min.js +1 -0
  33. package/dist/c-AJ7EC32V.min.js +1 -0
  34. package/dist/c-AQADQNY7.min.js +1 -0
  35. package/dist/c-ATM475SA.min.js +1 -0
  36. package/dist/c-AVO3Q7T7.min.js +1 -0
  37. package/dist/c-B7GW7IHJ.min.js +1 -0
  38. package/dist/c-BNFJMDHN.min.js +1 -0
  39. package/dist/c-BOHCQILI.min.js +1 -0
  40. package/dist/c-C3TZLTZK.min.js +1 -0
  41. package/dist/c-CGQAQWBV.min.js +1 -0
  42. package/dist/c-CPV4N35K.min.js +1 -0
  43. package/dist/c-D6HAAPTX.min.js +1 -0
  44. package/dist/c-DIPEYUOW.min.js +1 -0
  45. package/dist/c-E4JDJH4I.min.js +1 -0
  46. package/dist/c-E72OTUZU.min.js +1 -0
  47. package/dist/c-E7I2L7CU.min.js +1 -0
  48. package/dist/c-ELDWAO2V.min.js +1 -0
  49. package/dist/c-EUBTECGM.min.js +1 -0
  50. package/dist/c-EUMPMDCS.min.js +1 -0
  51. package/dist/c-EZZT2WAE.min.js +1 -0
  52. package/dist/c-FHBVFCQB.min.js +1 -0
  53. package/dist/c-G4HCO2IQ.min.js +1 -0
  54. package/dist/c-G5VIJEOK.min.js +1 -0
  55. package/dist/c-GHVOXAYH.min.js +1 -0
  56. package/dist/c-GNTXRXRN.min.js +1 -0
  57. package/dist/c-GXV3C3MO.min.js +1 -0
  58. package/dist/c-HHTK2R75.min.js +1 -0
  59. package/dist/c-HLLFJYTY.min.js +1 -0
  60. package/dist/c-HP4ZFM47.min.js +1 -0
  61. package/dist/c-HPOYKCCG.min.js +1 -0
  62. package/dist/c-HYDTS5OP.min.js +1 -0
  63. package/dist/c-I4QJ6YLM.min.js +1 -0
  64. package/dist/c-IK33LNZ6.min.js +1 -0
  65. package/dist/c-IK3PZHRY.min.js +1 -0
  66. package/dist/c-J6DVC236.min.js +1 -0
  67. package/dist/c-JIMJF6F6.min.js +1 -0
  68. package/dist/c-JUKIWTBJ.min.js +1 -0
  69. package/dist/c-KKPMHAZC.min.js +1 -0
  70. package/dist/c-L6WNDBHV.min.js +1 -0
  71. package/dist/c-LDEX5OFW.min.js +1 -0
  72. package/dist/c-LESEUVC5.min.js +1 -0
  73. package/dist/c-LYQMZMZQ.min.js +1 -0
  74. package/dist/c-MB6CV5NC.min.js +1 -0
  75. package/dist/c-MOKJOIPE.min.js +1 -0
  76. package/dist/c-MVR3RWF3.min.js +1 -0
  77. package/dist/c-N3FXLRNT.min.js +1 -0
  78. package/dist/c-N5NPTJVJ.min.js +1 -0
  79. package/dist/c-NHBL4J67.min.js +1 -0
  80. package/dist/c-ODG6TFSY.min.js +1 -0
  81. package/dist/c-ORLEBW72.min.js +1 -0
  82. package/dist/c-P65V6HLO.min.js +1 -0
  83. package/dist/c-PRIKOLTE.min.js +1 -0
  84. package/dist/c-PSKKFZNP.min.js +1 -0
  85. package/dist/c-PSNI6KAZ.min.js +1 -0
  86. package/dist/c-QA3HMQJP.min.js +1 -0
  87. package/dist/c-R2P4RR7Q.min.js +1 -0
  88. package/dist/c-RFC7UAG7.min.js +1 -0
  89. package/dist/c-S3AZX5PP.min.js +1 -0
  90. package/dist/c-SGAURYHG.min.js +1 -0
  91. package/dist/c-SJMWU6UX.min.js +1 -0
  92. package/dist/c-STIIGQOD.min.js +1 -0
  93. package/dist/c-T2ASIJVZ.min.js +1 -0
  94. package/dist/c-T2V7O2LO.min.js +1 -0
  95. package/dist/c-TKG2NP7G.min.js +1 -0
  96. package/dist/c-TX3THUTO.min.js +1 -0
  97. package/dist/c-TX7XJM3Z.min.js +1 -0
  98. package/dist/c-UC7SIU2W.min.js +1 -0
  99. package/dist/c-UMXSJIOV.min.js +1 -0
  100. package/dist/c-VJTDST2R.min.js +1 -0
  101. package/dist/c-VRSXMLYF.min.js +1 -0
  102. package/dist/c-VSLWSAN2.min.js +1 -0
  103. package/dist/c-VXLOLYTO.min.js +1 -0
  104. package/dist/c-W4ZUKSEQ.min.js +1 -0
  105. package/dist/c-WCBRPILW.min.js +1 -0
  106. package/dist/c-WGHT7OCY.min.js +1 -0
  107. package/dist/c-WUWXGQYA.min.js +1 -0
  108. package/dist/c-WWCW3APR.min.js +1 -0
  109. package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
  110. package/dist/c-Y6PYUMFU.min.js +1 -0
  111. package/dist/c-YDECTEUW.min.js +1 -0
  112. package/dist/c-YF3YKVQI.min.js +1 -0
  113. package/dist/c-YLZIV3VS.min.js +1 -0
  114. package/dist/c-ZIVPFTOC.min.js +1 -0
  115. package/dist/components/Annotation.d.ts +2 -1
  116. package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
  117. package/dist/components/ai/chartRecipes.d.ts +4 -0
  118. package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
  119. package/dist/components/ai/describePhysicsSource.d.ts +13 -0
  120. package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
  121. package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
  122. package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
  123. package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
  124. package/dist/components/artifact/artifactRevision.d.ts +54 -0
  125. package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
  126. package/dist/components/artifact/attachmentAudit.d.ts +13 -0
  127. package/dist/components/artifact/claimCorrections.d.ts +3 -0
  128. package/dist/components/artifact/claimGraph.d.ts +5 -0
  129. package/dist/components/artifact/claimLifecycle.d.ts +32 -0
  130. package/dist/components/artifact/claims.d.ts +24 -0
  131. package/dist/components/artifact/collection.d.ts +10 -0
  132. package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
  133. package/dist/components/artifact/collectionImpact.d.ts +11 -0
  134. package/dist/components/artifact/collectionLineage.d.ts +3 -0
  135. package/dist/components/artifact/collectionOperations.d.ts +8 -0
  136. package/dist/components/artifact/collectionPolicy.d.ts +22 -0
  137. package/dist/components/artifact/collectionTypes.d.ts +117 -0
  138. package/dist/components/artifact/configurationRepair.d.ts +8 -0
  139. package/dist/components/artifact/contract.d.ts +30 -0
  140. package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
  141. package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
  142. package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
  143. package/dist/components/artifact/evidenceSample.d.ts +8 -0
  144. package/dist/components/artifact/exportPaths.d.ts +8 -0
  145. package/dist/components/artifact/fieldPolicies.d.ts +12 -0
  146. package/dist/components/artifact/fingerprint.d.ts +36 -0
  147. package/dist/components/artifact/grounding.d.ts +51 -0
  148. package/dist/components/artifact/groundingBudget.d.ts +38 -0
  149. package/dist/components/artifact/hostTransfer.d.ts +13 -0
  150. package/dist/components/artifact/identity.d.ts +19 -0
  151. package/dist/components/artifact/inheritance.d.ts +48 -0
  152. package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
  153. package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
  154. package/dist/components/artifact/obligations.d.ts +3 -0
  155. package/dist/components/artifact/policies.d.ts +45 -0
  156. package/dist/components/artifact/policyRelations.d.ts +3 -0
  157. package/dist/components/artifact/recordProjection.d.ts +7 -0
  158. package/dist/components/artifact/representation.d.ts +50 -0
  159. package/dist/components/artifact/serialization.d.ts +40 -0
  160. package/dist/components/artifact/temporal.d.ts +32 -0
  161. package/dist/components/artifact/temporalAdapters.d.ts +75 -0
  162. package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
  163. package/dist/components/artifact/temporalPresentation.d.ts +8 -0
  164. package/dist/components/artifact/types.d.ts +341 -0
  165. package/dist/components/artifact/validation.d.ts +13 -0
  166. package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
  167. package/dist/components/artifact/validationPrimitives.d.ts +24 -0
  168. package/dist/components/artifact/validationSurfaces.d.ts +7 -0
  169. package/dist/components/artifact/validationTemporal.d.ts +3 -0
  170. package/dist/components/charts/geo/FlowMap.d.ts +7 -0
  171. package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
  172. package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
  173. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  174. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
  175. package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
  176. package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
  177. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
  178. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
  179. package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
  180. package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
  181. package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
  182. package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
  183. package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
  184. package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
  185. package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
  186. package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
  187. package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
  188. package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
  189. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  190. package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
  191. package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
  192. package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
  193. package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
  194. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
  195. package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
  196. package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
  197. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
  198. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
  199. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
  200. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
  201. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
  202. package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
  203. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
  204. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
  205. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
  206. package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
  207. package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
  208. package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
  209. package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
  210. package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
  211. package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
  212. package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
  213. package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
  214. package/dist/components/charts/shared/hooks.d.ts +3 -1
  215. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  216. package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
  217. package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
  218. package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
  219. package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
  220. package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
  221. package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
  222. package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
  223. package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
  224. package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
  225. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
  226. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
  227. package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
  228. package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
  229. package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
  230. package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
  231. package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
  232. package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
  233. package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
  234. package/dist/components/evidence/evidenceGate.d.ts +3 -1
  235. package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
  236. package/dist/components/evidence/stableJsonHash.d.ts +4 -0
  237. package/dist/components/export/chartConfig.d.ts +40 -5
  238. package/dist/components/export/chartConfigArtifact.d.ts +6 -0
  239. package/dist/components/legendLayout.d.ts +18 -0
  240. package/dist/components/legendStyles.d.ts +4 -0
  241. package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
  242. package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
  243. package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
  244. package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
  245. package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
  246. package/dist/components/recipes/atlas/braid.d.ts +62 -0
  247. package/dist/components/recipes/atlas/capsules.d.ts +18 -0
  248. package/dist/components/recipes/atlas/compare.d.ts +4 -0
  249. package/dist/components/recipes/atlas/completeness.d.ts +2 -0
  250. package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
  251. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
  252. package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
  253. package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
  254. package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
  255. package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
  256. package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
  257. package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
  258. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
  259. package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
  260. package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
  261. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
  262. package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
  263. package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
  264. package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
  265. package/dist/components/recipes/atlas/forests.d.ts +11 -0
  266. package/dist/components/recipes/atlas/ids.d.ts +6 -0
  267. package/dist/components/recipes/atlas/index.d.ts +26 -0
  268. package/dist/components/recipes/atlas/ledger.d.ts +7 -0
  269. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
  270. package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
  271. package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
  272. package/dist/components/recipes/atlas/motifs.d.ts +3 -0
  273. package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
  274. package/dist/components/recipes/atlas/prepare.d.ts +14 -0
  275. package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
  276. package/dist/components/recipes/atlas/profile.d.ts +19 -0
  277. package/dist/components/recipes/atlas/publish.d.ts +10 -0
  278. package/dist/components/recipes/atlas/queries.d.ts +34 -0
  279. package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
  280. package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
  281. package/dist/components/recipes/atlas/sections.d.ts +3 -0
  282. package/dist/components/recipes/atlas/support.d.ts +7 -0
  283. package/dist/components/recipes/atlas/types.d.ts +278 -0
  284. package/dist/components/recipes/atlas/validate.d.ts +12 -0
  285. package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
  286. package/dist/components/recipes/intervals.d.ts +1 -1
  287. package/dist/components/semiotic-ai-core.d.ts +33 -22
  288. package/dist/components/semiotic-ai.d.ts +15 -3
  289. package/dist/components/semiotic-artifact-react.d.ts +10 -0
  290. package/dist/components/semiotic-artifact.d.ts +23 -0
  291. package/dist/components/semiotic-atlas-core.d.ts +20 -0
  292. package/dist/components/semiotic-atlas.d.ts +8 -0
  293. package/dist/components/semiotic-experimental.d.ts +1 -1
  294. package/dist/components/semiotic-physics.d.ts +4 -4
  295. package/dist/components/semiotic-recipes-core.d.ts +9 -0
  296. package/dist/components/semiotic-text.d.ts +2 -0
  297. package/dist/components/semiotic-utils-core.d.ts +18 -18
  298. package/dist/components/semiotic.d.ts +3 -3
  299. package/dist/components/server/renderEvidence.d.ts +12 -0
  300. package/dist/components/server/renderToStaticSVG.d.ts +3 -0
  301. package/dist/components/server/serverChartConfigs.d.ts +3 -0
  302. package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
  303. package/dist/components/server/staticSVGChrome.d.ts +1 -4
  304. package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
  305. package/dist/components/server/staticXYGrid.d.ts +1 -1
  306. package/dist/components/server/svgSizing.d.ts +6 -0
  307. package/dist/components/shared/svgRoot.d.ts +17 -0
  308. package/dist/components/store/selectionProvenance.d.ts +6 -0
  309. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
  310. package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
  311. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
  312. package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
  313. package/dist/components/stream/SVGOverlay.d.ts +4 -0
  314. package/dist/components/stream/SceneToSVG.d.ts +4 -19
  315. package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
  316. package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
  317. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
  318. package/dist/components/stream/XYGrid.d.ts +11 -0
  319. package/dist/components/stream/axisTickUtils.d.ts +0 -1
  320. package/dist/components/stream/canvasSetup.d.ts +1 -2
  321. package/dist/components/stream/fontLoading.d.ts +4 -0
  322. package/dist/components/stream/hitTestUtils.d.ts +2 -0
  323. package/dist/components/stream/networkCustomLayout.d.ts +8 -0
  324. package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
  325. package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
  326. package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
  327. package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
  328. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  329. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
  330. package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
  331. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
  332. package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
  333. package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
  334. package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
  335. package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
  336. package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
  337. package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
  338. package/dist/components/stream/physics/physicsSemanticUI.d.ts +11 -0
  339. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
  340. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
  341. package/dist/components/stream/pipelineConfig.d.ts +4 -0
  342. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
  343. package/dist/components/stream/resolveXYAxes.d.ts +13 -0
  344. package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
  345. package/dist/components/stream/seriesGeometry.d.ts +13 -0
  346. package/dist/components/stream/shallowEqual.d.ts +2 -0
  347. package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
  348. package/dist/components/stream/types.d.ts +4 -53
  349. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
  350. package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
  351. package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
  352. package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
  353. package/dist/components/stream/xyAxisTicks.d.ts +25 -0
  354. package/dist/components/stream/xyDateTicks.d.ts +3 -2
  355. package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
  356. package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
  357. package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
  358. package/dist/components/text/annotationTextLayout.d.ts +28 -0
  359. package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
  360. package/dist/components/text/usePretextAnnotations.d.ts +12 -0
  361. package/dist/controls.module.min.js +1 -1
  362. package/dist/geo.min.js +1 -1
  363. package/dist/geo.module.min.js +1 -1
  364. package/dist/network.module.min.js +1 -1
  365. package/dist/ordinal.module.min.js +1 -1
  366. package/dist/physics-matter.min.js +1 -1
  367. package/dist/physics-matter.module.min.js +1 -1
  368. package/dist/physics-rapier.min.js +1 -1
  369. package/dist/physics-rapier.module.min.js +1 -1
  370. package/dist/physics.module.min.js +1 -1
  371. package/dist/physicsWorker.js +1 -1
  372. package/dist/processSankeyLayoutWorker.js +1 -1
  373. package/dist/rough.min.js +1 -1
  374. package/dist/rough.module.min.js +1 -1
  375. package/dist/semiotic-access.module.min.js +1 -1
  376. package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
  377. package/dist/semiotic-ai-core.d.ts +33 -22
  378. package/dist/semiotic-ai-core.min.js +1 -1
  379. package/dist/semiotic-ai-core.module.min.js +1 -1
  380. package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
  381. package/dist/semiotic-ai.d.ts +15 -3
  382. package/dist/semiotic-ai.module.min.js +1 -1
  383. package/dist/semiotic-artifact-react.d.ts +10 -0
  384. package/dist/semiotic-artifact-react.min.js +2 -0
  385. package/dist/semiotic-artifact-react.module.min.js +2 -0
  386. package/dist/semiotic-artifact.d.ts +23 -0
  387. package/dist/semiotic-artifact.min.js +1 -0
  388. package/dist/semiotic-artifact.module.min.js +1 -0
  389. package/dist/semiotic-atlas-core.d.ts +20 -0
  390. package/dist/semiotic-atlas-core.min.js +1 -0
  391. package/dist/semiotic-atlas-core.module.min.js +1 -0
  392. package/dist/semiotic-atlas-selection.module.min.js +2 -0
  393. package/dist/semiotic-atlas.d.ts +8 -0
  394. package/dist/semiotic-atlas.min.js +2 -0
  395. package/dist/semiotic-atlas.module.min.js +2 -0
  396. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  397. package/dist/semiotic-client-glyph.module.min.js +1 -1
  398. package/dist/semiotic-client-responsive.module.min.js +1 -1
  399. package/dist/semiotic-client-shared.module.min.js +1 -1
  400. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
  401. package/dist/semiotic-data.min.js +1 -1
  402. package/dist/semiotic-data.module.min.js +1 -1
  403. package/dist/semiotic-evidence.min.js +1 -1
  404. package/dist/semiotic-evidence.module.min.js +1 -1
  405. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  406. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  407. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  408. package/dist/semiotic-experimental-vacp.min.js +1 -1
  409. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  410. package/dist/semiotic-experimental.d.ts +1 -1
  411. package/dist/semiotic-line.module.min.js +1 -1
  412. package/dist/semiotic-physics.d.ts +4 -4
  413. package/dist/semiotic-realtime-core.module.min.js +1 -1
  414. package/dist/semiotic-realtime-react.module.min.js +1 -1
  415. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  416. package/dist/semiotic-recipes-core.d.ts +9 -0
  417. package/dist/semiotic-recipes-core.module.min.js +1 -1
  418. package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
  419. package/dist/semiotic-recipes-react.min.js +1 -1
  420. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  421. package/dist/semiotic-server-edge.min.js +1 -1
  422. package/dist/semiotic-server-edge.module.min.js +1 -1
  423. package/dist/semiotic-server-node.min.js +1 -1
  424. package/dist/semiotic-server-node.module.min.js +1 -1
  425. package/dist/semiotic-text.d.ts +2 -0
  426. package/dist/semiotic-text.min.js +2 -0
  427. package/dist/semiotic-text.module.min.js +2 -0
  428. package/dist/semiotic-themes-core.min.js +1 -1
  429. package/dist/semiotic-themes-core.module.min.js +1 -1
  430. package/dist/semiotic-themes.min.js +1 -1
  431. package/dist/semiotic-themes.module.min.js +1 -1
  432. package/dist/semiotic-utils-core.d.ts +18 -18
  433. package/dist/semiotic-utils-core.min.js +1 -1
  434. package/dist/semiotic-utils-core.module.min.js +1 -1
  435. package/dist/semiotic-value.module.min.js +1 -1
  436. package/dist/semiotic.d.ts +3 -3
  437. package/dist/semiotic.module.min.js +1 -1
  438. package/dist/server.min.js +1 -1
  439. package/dist/server.module.min.js +1 -1
  440. package/dist/xy.module.min.js +1 -1
  441. package/package.json +70 -14
  442. package/spec/README.md +8 -3
  443. package/spec/v0.1/artifact-contract.schema.json +2299 -0
  444. package/spec/v0.1/examples/artifact-contract-full.json +369 -0
  445. package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
  446. package/dist/c-3BLJEQNG.min.js +0 -1
  447. package/dist/c-3SCUN5HI.min.js +0 -1
  448. package/dist/c-3VVKFA4M.min.js +0 -1
  449. package/dist/c-43TJZS3F.min.js +0 -1
  450. package/dist/c-4DTZPSUD.min.js +0 -1
  451. package/dist/c-4ES5367Y.min.js +0 -1
  452. package/dist/c-52TEGIUJ.min.js +0 -1
  453. package/dist/c-54IRWOGM.min.js +0 -1
  454. package/dist/c-5D2S4RMI.min.js +0 -1
  455. package/dist/c-5JWCTX3G.min.js +0 -1
  456. package/dist/c-6CMMSN6N.min.js +0 -1
  457. package/dist/c-6HRB2L7H.min.js +0 -1
  458. package/dist/c-6O5EVOPH.min.js +0 -1
  459. package/dist/c-7W4SV36A.min.js +0 -1
  460. package/dist/c-A4WRGZFX.min.js +0 -1
  461. package/dist/c-AG7WWVIH.min.js +0 -1
  462. package/dist/c-AH6J4MTN.min.js +0 -1
  463. package/dist/c-AKAF6JAD.min.js +0 -1
  464. package/dist/c-ALYR5LKK.min.js +0 -1
  465. package/dist/c-BBKITSXB.min.js +0 -1
  466. package/dist/c-BYDPC44I.min.js +0 -1
  467. package/dist/c-CFFIU2MW.min.js +0 -1
  468. package/dist/c-CGNHBHCE.min.js +0 -1
  469. package/dist/c-CJYSXIFV.min.js +0 -1
  470. package/dist/c-CZF7MV67.min.js +0 -1
  471. package/dist/c-D53OKBSY.min.js +0 -1
  472. package/dist/c-DADXPJXV.min.js +0 -1
  473. package/dist/c-DBQ2V7CH.min.js +0 -1
  474. package/dist/c-DPMVAUAW.min.js +0 -1
  475. package/dist/c-ECJCKLYY.min.js +0 -1
  476. package/dist/c-EGATGOWJ.min.js +0 -1
  477. package/dist/c-EGR6VYBW.min.js +0 -1
  478. package/dist/c-ESNR43AN.min.js +0 -1
  479. package/dist/c-F3LIKINL.min.js +0 -1
  480. package/dist/c-F5ZB5GJ6.min.js +0 -1
  481. package/dist/c-G36WS6LN.min.js +0 -1
  482. package/dist/c-G3VYMHKE.min.js +0 -1
  483. package/dist/c-GGISSW5E.min.js +0 -1
  484. package/dist/c-GR6MOEQC.min.js +0 -1
  485. package/dist/c-GSVCN34B.min.js +0 -1
  486. package/dist/c-GYOQCEFP.min.js +0 -1
  487. package/dist/c-H3DNMTCC.min.js +0 -1
  488. package/dist/c-I6J3FEZE.min.js +0 -1
  489. package/dist/c-IGH6MGJ5.min.js +0 -1
  490. package/dist/c-II2EEAJN.min.js +0 -1
  491. package/dist/c-IUHFPMHD.min.js +0 -1
  492. package/dist/c-J6M4JHRS.min.js +0 -1
  493. package/dist/c-JM3MGLQV.min.js +0 -1
  494. package/dist/c-KM3N7F7R.min.js +0 -1
  495. package/dist/c-LF5BZFNC.min.js +0 -1
  496. package/dist/c-LKBSGFQC.min.js +0 -1
  497. package/dist/c-MNF2S4AA.min.js +0 -1
  498. package/dist/c-MT3WBK7M.min.js +0 -1
  499. package/dist/c-NDJADPIF.min.js +0 -1
  500. package/dist/c-NVPQCIL5.min.js +0 -1
  501. package/dist/c-NY3JWV2K.min.js +0 -1
  502. package/dist/c-OFWJBEE5.min.js +0 -1
  503. package/dist/c-OYFHP5F5.min.js +0 -1
  504. package/dist/c-PGKQGGQ2.min.js +0 -1
  505. package/dist/c-PPWDL5ZI.min.js +0 -1
  506. package/dist/c-Q2IPZ3MU.min.js +0 -1
  507. package/dist/c-QKHMBE2E.min.js +0 -1
  508. package/dist/c-QMVM3AY6.min.js +0 -1
  509. package/dist/c-QSGWX53A.min.js +0 -1
  510. package/dist/c-RJKEKZOO.min.js +0 -1
  511. package/dist/c-RSVIHIQ4.min.js +0 -1
  512. package/dist/c-S6U5CGT5.min.js +0 -1
  513. package/dist/c-SFDIIU5G.min.js +0 -1
  514. package/dist/c-SLGMUBUL.min.js +0 -1
  515. package/dist/c-SRTBCRVE.min.js +0 -1
  516. package/dist/c-T6UAIKBH.min.js +0 -1
  517. package/dist/c-TMCTEVVW.min.js +0 -1
  518. package/dist/c-TMOSJLT3.min.js +0 -1
  519. package/dist/c-TZW3JGJ5.min.js +0 -1
  520. package/dist/c-U6ESPM7V.min.js +0 -1
  521. package/dist/c-UC5PTTFI.min.js +0 -1
  522. package/dist/c-USFMFKIH.min.js +0 -1
  523. package/dist/c-VGKUEZBC.min.js +0 -1
  524. package/dist/c-VGW3VG3I.min.js +0 -1
  525. package/dist/c-VN2HG5BS.min.js +0 -1
  526. package/dist/c-VPZDY5Q4.min.js +0 -1
  527. package/dist/c-VRXUB2F2.min.js +0 -1
  528. package/dist/c-VUBQNQJH.min.js +0 -1
  529. package/dist/c-VUH4PGZY.min.js +0 -1
  530. package/dist/c-W3CE4A4S.min.js +0 -1
  531. package/dist/c-X5UBGU2V.min.js +0 -1
  532. package/dist/c-XDRV7RKW.min.js +0 -1
  533. package/dist/c-YGZHURXZ.min.js +0 -1
  534. package/dist/c-YZVRZGX2.min.js +0 -1
  535. /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
  536. /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
  537. /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
@@ -1 +1 @@
1
- import{toConfig as e}from"./c-EGATGOWJ.min.js";import{buildReaderGrounding as t}from"./c-XDRV7RKW.min.js";import"./c-NDJADPIF.min.js";function n(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function r(e,t={}){const n="number"==typeof t.maxDepth&&Number.isFinite(t.maxDepth)?Math.max(1,Math.floor(t.maxDepth)):10,r="number"==typeof t.maxArrayLength&&Number.isFinite(t.maxArrayLength)?Math.max(1,Math.floor(t.maxArrayLength)):1e3,o=new WeakSet,i=(e,t)=>{if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("bigint"==typeof e)return""+e;if("function"==typeof e||"symbol"==typeof e||void 0===e)return;if(e instanceof Date)return e.toISOString();if(t>=n)return"[depth limit]";if("object"!=typeof e)return e+"";if("$$typeof"in e)return;if(o.has(e))return"[circular]";if(o.add(e),Array.isArray(e)){const n=e.slice(0,r).map(e=>i(e,t+1)).filter(e=>void 0!==e);return o.delete(e),n}if(e instanceof Set){const n=Array.from(e).slice(0,r).map(e=>i(e,t+1)).filter(e=>void 0!==e);return o.delete(e),n}if(e instanceof Map){const n=Object.create(null);let a=0;for(const[o,s]of e){if(a++>=r)break;const e=i(s,t+1);void 0!==e&&(n[o+""]=e)}return o.delete(e),n}const a=Object.create(null);for(const n of Object.keys(e).sort()){const r=i(e[n],t+1);void 0!==r&&(a[n]=r)}return o.delete(e),a};return i(e,0)}function o(e){const t=r(e);return n(t)?t:{}}function i(e){if(Array.isArray(e))return e.map(i);if(!n(e))return e;const t=Object.create(null);for(const n of Object.keys(e).sort())t[n]=i(e[n]);return t}function a(e){return JSON.stringify(i(r(e)))}function s(e){return function(e){let t=BigInt("14695981039346656037");const n=BigInt("1099511628211"),r=BigInt("0xffffffffffffffff");for(let o=0;e.length>o;o++)t^=BigInt(e.charCodeAt(o)),t=t*n&r;return t.toString(16).padStart(16,"0")}(a(e))}function c(e){if(!e?.length)return;const t=Array.from(new Set(e.filter(e=>"string"==typeof e&&e.length))).sort();return t.length?t:void 0}function l(e,t){return t.some(t=>e===t||e.startsWith(t+"/"))}function f(e,t){const n=c(t.refs),r=!1!==t.includeSummary;if(!n)return{snapshot:{version:e.version,createdAt:e.createdAt,state:e.state,...r&&e.summary?{summary:e.summary}:{}}};const o={};for(const[t,r]of Object.entries(e.state))l(t,n)&&(o[t]=r);const i={};if(r&&e.summary)for(const[t,r]of Object.entries(e.summary))l(t,n)&&(i[t]=r);return{snapshot:{version:e.version,createdAt:e.createdAt,state:o,...Object.keys(i).length?{summary:i}:{}},refs:n}}function d(e,t){const n={},r=[];for(const[r,o]of Object.entries(t.state))Object.prototype.hasOwnProperty.call(e.state,r)&&a(e.state[r])===a(o)||(n[r]=o);for(const n of Object.keys(e.state))Object.prototype.hasOwnProperty.call(t.state,n)||r.push(n);const o={},i=[],s=e.summary??{},c=t.summary??{};for(const[e,t]of Object.entries(c))Object.prototype.hasOwnProperty.call(s,e)&&a(s[e])===a(t)||(o[e]=t);for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(c,e)||i.push(e);return{changed:n,removed:r.sort(),...Object.keys(o).length?{summaryChanged:o}:{},...i.length?{summaryRemoved:i.sort()}:{}}}function u(e){return null==e?"NULL":"number"==typeof e?"DOUBLE":"string"==typeof e?"VARCHAR":"boolean"==typeof e?"BOOLEAN":e instanceof Date?"TIMESTAMP":Array.isArray(e)?"ARRAY":"OBJECT"}var m="semiotic.set_point_selection",p="semiotic.set_interval_selection",h="semiotic.clear_selection",g="semiotic.activate_navigation_node",y="semiotic.inspect_data",b="0.1.0",v="vacp.data_schema";function w(e,t){if(!t.descriptor.name.trim())throw Error("VACP action names must be non-empty.");if(e.some(e=>e.descriptor.name===t.descriptor.name))throw Error(`Duplicate VACP action "${t.descriptor.name}".`);e.push(t)}function A(e,t){if(!n(e))throw Error(t+" expects an object parameter payload.");return e}function I(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,Math.floor(e)):t}function R(e,t,n){if("string"!=typeof e.selectionRef)throw Error("params.selectionRef must be a VACP selection ref.");const r=t.find(t=>t.ref===e.selectionRef);if(!r)throw Error(`Unknown selection ref "${e.selectionRef}".`);if(n&&!r.modes.has(n))throw Error(`Selection "${r.name}" does not accept ${n} state.`);return r}function S(e){return null==e||"string"==typeof e||"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e||e instanceof Date&&Number.isFinite(e.getTime())}function C(e,t,i){const a=[],c=e.dataHandles.map(e=>e.ref);c.length&&w(a,{descriptor:{name:v,title:"Describe Semiotic data",description:"Return columns, types, row count, and optional bounded summaries for a chart DataHandle.",targetRef:i.view,parameters:{type:"object",properties:{handleRef:{type:"string",enum:c},detail:{type:"string",enum:["columns","full"]},sampleRows:{type:"number",minimum:1}},required:["handleRef"]}},execute(r){const o=A(r,v);if("string"!=typeof o.handleRef)throw Error("params.handleRef must be a DataHandle ref.");const i=e.dataHandles.find(e=>e.ref===o.handleRef);if(!i)throw Error(`Unknown DataHandle "${o.handleRef}".`);const a=void 0===o.detail||"columns"===o.detail?"columns":"full"===o.detail?"full":(()=>{throw Error('params.detail must be "columns" or "full".')})(),s="number"==typeof o.sampleRows&&Number.isFinite(o.sampleRows)?Math.max(1,Math.floor(o.sampleRows)):"full"===a?1e3:Math.min(i.rows.length,1e3),c=I(t.dataAccess?.maxSchemaRows,5e3);return function(e){const t=e.rows.slice(0,Math.max(0,e.sampleRows)),r=function(e){const t=new Map;for(const r of e)if(n(r))for(const[e,n]of Object.entries(r)){const r=t.get(e)??new Set;r.add(u(n)),t.set(e,r)}return Array.from(t).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{const n=Array.from(t).filter(e=>"NULL"!==e);return{name:e,type:0===n.length?"NULL":1===new Set(n).size?n[0]:"MIXED"}})}(e.rows),o=r.map(e=>e.name);if("columns"===e.detail)return{handleRef:e.handleRef,detail:e.detail,table:null,rowCount:e.rows.length,columns:r};const i=function(e,t){const r=Object.create(null);for(const o of t){const t=[];for(const r of e){if(!n(r))continue;const e=r[o];"number"==typeof e&&Number.isFinite(e)&&t.push(e)}if(!t.length)continue;let i=t[0],a=t[0],s=0;for(const e of t)i=Math.min(i,e),a=Math.max(a,e),s+=e;r[o]={min:i,max:a,avg:s/t.length}}return Object.keys(r).length?r:void 0}(t,o),a=function(e,t){const r=Object.create(null);for(const o of t){const t=[];for(const r of e){if(!n(r))continue;const e=r[o];e instanceof Date&&Number.isFinite(e.getTime())&&t.push(e.getTime())}if(!t.length)continue;const i=Math.min(...t),a=Math.max(...t);r[o]={minIso:new Date(i).toISOString(),maxIso:new Date(a).toISOString(),minEpochMs:i,maxEpochMs:a}}return Object.keys(r).length?r:void 0}(t,o),s=function(e,t){const r=Object.create(null);for(const o of t){const t=new Map;for(const r of e){if(!n(r))continue;const e=r[o];if("string"!=typeof e&&"boolean"!=typeof e)continue;const i=e+"";t.set(i,(t.get(i)??0)+1)}t.size&&(r[o]=Array.from(t).sort(([e,t],[n,r])=>r-t||e.localeCompare(n)).slice(0,10).map(([e,t])=>({value:e,n:t})))}return Object.keys(r).length?r:void 0}(t,o);return{handleRef:e.handleRef,detail:e.detail,table:null,rowCount:e.rows.length,columns:r,...i?{numeric:i}:{},...a?{temporal:a}:{},...s?{categoricalTopValues:s}:{},sampledRows:t.length}}({handleRef:i.ref,rows:i.rows,detail:a,sampleRows:Math.min(s,c)})}}),c.length&&t.dataAccess?.sample&&w(a,{descriptor:{name:y,title:"Inspect bounded Semiotic rows",description:"Return a bounded JSON sample from a chart DataHandle. This action is opt-in.",targetRef:i.view,parameters:{type:"object",properties:{handleRef:{type:"string",enum:c},offset:{type:"number",minimum:0},limit:{type:"number",minimum:1}},required:["handleRef"]}},execute(n){const o=A(n,y);if("string"!=typeof o.handleRef)throw Error("params.handleRef must be a DataHandle ref.");const i=e.dataHandles.find(e=>e.ref===o.handleRef);if(!i)throw Error(`Unknown DataHandle "${o.handleRef}".`);const a="number"==typeof o.offset&&Number.isFinite(o.offset)?Math.max(0,Math.floor(o.offset)):0,s=I(t.dataAccess?.maxSampleRows,50),c="number"==typeof o.limit&&Number.isFinite(o.limit)?Math.max(1,Math.floor(o.limit)):Math.min(20,s),l=Math.min(c,s),f=i.rows.slice(a,a+l);return{handleRef:i.ref,offset:a,limit:l,rowCount:i.rows.length,rows:r(f,{maxArrayLength:s}),truncated:i.rows.length>a+f.length}}});const l=e.selections.map(e=>e.ref),f=e.selections.filter(e=>e.modes.has("point"));f.length&&t.selectionActions?.setPointSelection&&w(a,{descriptor:{name:m,title:"Set point selection",description:"Set a named LinkedCharts point-selection clause with allowlisted fields.",targetRef:i.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:f.map(e=>e.ref)},fields:{type:"object"}},required:["selectionRef","fields"]}},async execute(r){const o=A(r,m),i=R(o,e.selections,"point"),a=function(e,t){if(!n(e)||!Object.keys(e).length)throw Error("params.fields must be a non-empty object.");const r=Object.create(null);for(const[n,o]of Object.entries(e)){if(!t.includes(n))throw Error(`Field "${n}" is not allowed for this selection.`);if(!Array.isArray(o)||!o.length)throw Error(`Point selection field "${n}" requires values[].`);for(const e of o)if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&("number"!=typeof e||!Number.isFinite(e)))throw Error(`Point selection field "${n}" only accepts JSON primitive values.`);r[n]=[...o]}return r}(o.fields,i.fields);return await(t.selectionActions?.setPointSelection?.(i.name,i.clientId,a)),{selectionRef:i.ref,fields:a}}});const d=e.selections.filter(e=>e.modes.has("interval"));d.length&&t.selectionActions?.setIntervalSelection&&w(a,{descriptor:{name:p,title:"Set interval selection",description:"Set a named LinkedCharts interval-selection clause in data units.",targetRef:i.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:d.map(e=>e.ref)},fields:{type:"object"}},required:["selectionRef","fields"]}},async execute(r){const o=A(r,p),i=R(o,e.selections,"interval"),a=function(e,t){if(!n(e)||!Object.keys(e).length)throw Error("params.fields must be a non-empty object.");const r=Object.create(null);for(const[n,o]of Object.entries(e)){if(!t.includes(n))throw Error(`Field "${n}" is not allowed for this selection.`);if(!Array.isArray(o)||2!==o.length||"number"!=typeof o[0]||"number"!=typeof o[1]||!Number.isFinite(o[0])||!Number.isFinite(o[1]))throw Error(`Interval selection field "${n}" requires [min,max].`);r[n]=[Math.min(o[0],o[1]),Math.max(o[0],o[1])]}return r}(o.fields,i.fields);return await(t.selectionActions?.setIntervalSelection?.(i.name,i.clientId,a)),{selectionRef:i.ref,fields:a}}}),l.length&&t.selectionActions?.clearSelection&&w(a,{descriptor:{name:h,title:"Clear selection",description:"Clear every active clause from one named LinkedCharts selection.",targetRef:i.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:l}},required:["selectionRef"]}},async execute(n){const r=R(A(n,h),e.selections);return await(t.selectionActions?.clearSelection?.(r.name)),{selectionRef:r.ref,cleared:!0}}});const b=e.charts.map(e=>e.navigation).filter(e=>!!e&&e.index.valid&&!!e.binding.onActiveChange);b.length&&w(a,{descriptor:{name:g,title:"Activate chart navigation target",description:"Move an accessible chart navigation tree to a uniquely identified datum.",targetRef:i.view,parameters:{type:"object",properties:{navigationRef:{type:"string",enum:b.map(e=>e.ref)},match:{type:"object"}},required:["navigationRef","match"]}},execute(e){const t=A(e,g);if("string"!=typeof t.navigationRef)throw Error("params.navigationRef must be a navigation ref.");const r=b.find(e=>e.ref===t.navigationRef);if(!r)throw Error(`Unknown navigation ref "${t.navigationRef}".`);const o=function(e,t){if(!n(e))throw Error("params.match must be an object.");for(const n of Object.keys(e))if(!t.includes(n))throw Error(`params.match includes undeclared field "${n}".`);const r=Object.create(null);for(const n of t){if(!Object.prototype.hasOwnProperty.call(e,n)||!S(e[n]))throw Error(`params.match requires a primitive value for "${n}".`);r[n]=e[n]instanceof Date?e[n].toISOString():e[n]}return r}(t.match,r.index.matchFields),i=r.index.byKey.get(s(o));if(!i)throw Error("No navigation datum matches params.match.");return r.binding.onActiveChange?.(i),{navigationRef:r.ref,targetRef:r.index.targetRef(o),match:o}}});const C="function"==typeof t.actions?t.actions():t.actions;for(const e of C??[])e.available&&!e.available()||w(a,{descriptor:{...e.descriptor,...e.descriptor.parameters?{parameters:o(e.descriptor.parameters)}:{}},async execute(t){const n=e.validate?.(t);if("string"==typeof n&&n)throw Error(n);return e.execute(t)}});return a}var O=["data","nodes","edges","points","areas","lines","flows"],x=[["xAccessor","x"],["yAccessor","y"],["categoryAccessor","category"],["valueAccessor","value"],["colorBy","color"],["sizeAccessor","size"],["lineBy","series"],["groupAccessor","group"],["oAccessor","ordinal"],["rAccessor","radial"],["sourceAccessor","source"],["targetAccessor","target"],["nodeIDAccessor","id"]];function E(e,t){const n=e.trim();if(!n)throw Error(t+" must be a non-empty string.");return encodeURIComponent(n)}function k(e,...t){return`${e}/${t.map(e=>E(e,"VACP ref segment")).join("/")}`}function j(e){const t=e.now?.()??new Date,n=t instanceof Date?t:new Date(t);if(!Number.isFinite(n.getTime()))throw Error("VACP bridge clock returned an invalid date.");return n.toISOString()}function _(t){try{const{createdAt:n,...r}=e(t.component,t.props,{includeData:!1});return o(r)}catch(e){const n=Object.create(null);for(const[e,o]of Object.entries(t.props)){if(O.includes(e)||"function"==typeof o)continue;const t=r(o);void 0!==t&&(n[e]=t)}return{component:t.component,props:n,version:"unregistered",warning:e instanceof Error?e.message:"Chart config could not be serialized by toConfig."}}}function N(e){return t(e.component,e.props,{...e.grounding,audience:e.audience,includeStructure:!0,maxLeaves:1})}function M(e,t){const n=[];for(const r of O){const o=e.props[r];Array.isArray(o)&&n.push({ref:t.data(e.chartId,r),chartId:e.chartId,collection:r,rows:o})}return n}function D(e,t){t(e);for(const n of e.children??[])D(n,t)}function P(e,t){if(!t)return;let n;return D(e,e=>{n||e.id!==t||(n=e)}),n}function T(e){return null==e||"string"==typeof e||"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e||e instanceof Date&&Number.isFinite(e.getTime())}function V(e,t){if("datum"!==e.role||!e.datum)return;const n=Object.create(null);for(const r of t){if(!Object.prototype.hasOwnProperty.call(e.datum,r)||!T(e.datum[r]))return;n[r]=e.datum[r]instanceof Date?e.datum[r].toISOString():e.datum[r]}return n}function $(e,t){const n=Array.from(new Set(e.matchFields.map(e=>e.trim()).filter(Boolean))),r=new Map;if(!n.length)return{valid:!1,diagnostic:"Navigation actions require at least one durable match field.",byKey:r,matchFields:n,targetRef:()=>k(t,"target","invalid")};let o,i=0,a=0,c=!1;return D(e.tree,e=>{if("datum"!==e.role)return;i++;const t=V(e,n);if(!t)return void a++;const o=s(t);r.has(o)?c=!0:r.set(o,e)}),i?a?o=a+" navigation leaves lack durable primitive match-field values.":c&&(o="Navigation match fields do not uniquely identify every datum leaf."):o="Navigation tree has no datum leaves.",{valid:!o,...o?{diagnostic:o}:{},byKey:r,matchFields:n,targetRef:e=>k(t,"target",s(e))}}function L(e,t){const{chart:r,ref:i,configRef:a,grounding:s}=e,c=[{ref:i,kind:"Visualization",layer:"VisualizationLayer",title:r.title??(r.props.title??r.component)+"",description:r.description??s.text,data:o({component:r.component,grounding:{description:s.description,intent:s.intent,physics:s.physics,text:s.text},audience:r.audience})},{ref:a,kind:"Param",layer:"ConfigLayer",title:r.component+" configuration",description:"Serializable Semiotic chart configuration with raw data collections omitted.",data:e.config}],l=[{from:e.ref,to:a,kind:"contains"}],f=(s.structure?.children??[]).filter(e=>"axis"===e.role).map(e=>e.label);let d=0;for(const[e,t]of x){const n=r.props[e];if("string"!=typeof n||!n.trim())continue;const o=k(i,"encoding",t);if(c.push({ref:o,kind:"EncodingChannel",layer:"VisualizationLayer",title:`${t} → ${n}`,data:{channel:t,field:n,accessorProp:e}}),l.push({from:i,to:o,kind:"contains"}),"x"===t||"y"===t||"category"===t||"value"===t||"ordinal"===t||"radial"===t){const e=k(i,"axis",t);c.push({ref:e,kind:"Axis",layer:"VisualizationLayer",title:f[d++]??`${t} axis: ${n}`,data:{channel:t,field:n}}),l.push({from:i,to:e,kind:"contains"}),l.push({from:e,to:o,kind:"derivedFrom"})}}for(const n of e.dataHandles)c.push({ref:n.ref,kind:"DataHandle",layer:"DataLayer",title:`${r.chartId}.${n.collection}`,description:"Bounded details-on-demand handle. Use vacp.data_schema before requesting an opt-in sample.",data:{collection:n.collection,rowCount:n.rows.length,schemaAction:v,...t.dataAccess?.sample?{inspectAction:y}:{}}}),l.push({from:i,to:n.ref,kind:"contains"});if(e.navigation){const{navigation:t}=e;c.push({ref:t.ref,kind:"Selection",layer:"InteractionFeedbackLayer",title:(r.title??r.component)+" structured navigation",description:t.index.diagnostic??"Active accessible-navigation target identified by durable datum fields.",data:{matchFields:t.index.matchFields,targetCount:t.index.byKey.size,status:t.index.valid?t.binding.onActiveChange?"actionable":"read-only":"ambiguous"}}),l.push({from:i,to:t.ref,kind:"contains"})}if(t.getObservations){const e=k(i,"interaction","latest-observation");c.push({ref:e,kind:"InteractionTarget",layer:"InteractionFeedbackLayer",title:(r.title??r.component)+" latest observation",description:"Latest semantic hover, focus, selection, brush, activation, or control observation."}),l.push({from:i,to:e,kind:"contains"})}const u=Array.isArray(r.props.annotations)?r.props.annotations:[],m=new Set;for(const e of u){if(!n(e))continue;const t=n(e.provenance)?e.provenance:void 0,a=e.id??e.stableId??t?.stableId,s=null==a||""===a?void 0:a+"";if(!s)continue;const f=n(e.note)?e.note:void 0,d=n(e.noteData)?e.noteData:void 0,u=k(i,"annotation",s);if(m.has(u))throw Error(`Duplicate stable annotation id "${s.trim()}" in VACP chart "${r.chartId}".`);m.add(u),c.push({ref:u,kind:"InteractionTarget",layer:"VisualizationLayer",title:(e.label??f?.label??d?.label??"Annotation "+s)+"",description:"string"==typeof e.note?e.note:"string"==typeof e.description?e.description:void 0,data:o({id:s,provenance:t,lifecycle:e.lifecycle})}),l.push({from:i,to:u,kind:"contains"})}return{nodes:c,edges:l}}function F(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.chartId===t)return r}}function z(e,t){const n=function(e,t){const n=function(e){const t="function"==typeof e?e():e,n=new Set;for(const e of t){const t=e.chartId.trim();if(!t)throw Error("Every VACP chart requires a non-empty chartId.");if(n.has(t))throw Error(`Duplicate VACP chartId "${t}".`);n.add(t)}return t}(e.charts),r=n.map(e=>{const n=t.visualization(e.chartId),r=e.navigation?{ref:t.navigation(e.chartId),chartRef:n,chartId:e.chartId,binding:e.navigation,index:$(e.navigation,t.navigation(e.chartId))}:void 0;return{chart:e,ref:n,configRef:t.config(e.chartId),grounding:N(e),config:_(e),dataHandles:M(e,t),...r?{navigation:r}:{}}}),o=function(e,t){const n=new Map;for(const t of e)for(const e of t.chart.selections??[]){const r=e.name.trim();if(!r)throw Error("VACP selection names must be non-empty.");const o=n.get(r)??{fields:new Set,modes:new Set,chartRefs:new Set};for(const t of e.fields.map(e=>e.trim()))t&&o.fields.add(t);if("interval"!==e.mode&&o.modes.add("point"),"point"!==e.mode&&o.modes.add("interval"),e.clientId){if(o.clientId&&o.clientId!==e.clientId)throw Error(`Selection "${r}" declares conflicting VACP clientIds.`);o.clientId=e.clientId}o.chartRefs.add(t.ref),n.set(r,o)}return Array.from(n).sort(([e],[t])=>e.localeCompare(t)).map(([e,n])=>{if(0===n.fields.size)throw Error(`Selection "${e}" requires at least one allowlisted field.`);return{ref:t.selection(e),name:e,fields:Array.from(n.fields).sort(),modes:n.modes,clientId:n.clientId??"__semiotic-vacp__:"+e,chartRefs:Array.from(n.chartRefs)}})}(r,t),i=r.flatMap(e=>e.dataHandles),a=[{ref:t.app,kind:"App",layer:"ViewLayer",title:e.title??e.appId,description:"Semiotic application state exposed through the experimental VACP 0.1.0 bridge.",data:{provider:"semiotic",protocol:b}},{ref:t.view,kind:"View",layer:"ViewLayer",title:e.title??e.viewId??"Semiotic charts"}],s=[{from:t.app,to:t.view,kind:"contains"}];for(const n of r){const r=L(n,e);a.push(...r.nodes),s.push(...r.edges),s.push({from:t.view,to:n.ref,kind:"contains"})}for(const e of o){a.push({ref:e.ref,kind:"Selection",layer:"InteractionFeedbackLayer",title:"Selection: "+e.name,description:"Named LinkedCharts selection. Agent mutations are restricted to declared fields and modes.",data:{name:e.name,fields:e.fields,modes:Array.from(e.modes).sort()}}),s.push({from:t.view,to:e.ref,kind:"contains"});for(const t of e.chartRefs)s.push({from:e.ref,to:t,kind:"controls"})}return{charts:r,selections:o,dataHandles:i,nodes:a,edges:s}}(e,t);return{...n,actions:C(n,e,t)}}function H(e){const t=e.viewId?.trim()||"main",n=function(e,t){const n="vacp://"+E(e,"appId"),r=k(n,"view",t),o=e=>k(r,"visualization",e);return{app:n,view:r,visualization:o,config:e=>k(o(e),"config"),data:(e,t="data")=>k(o(e),"data",t),selection:e=>k(r,"selection",e),navigation:e=>k(o(e),"navigation"),observation:e=>k(o(e),"interaction","latest-observation")}}(e.appId,t),i="number"==typeof e.stateCacheSize&&Number.isFinite(e.stateCacheSize)?Math.max(1,Math.floor(e.stateCacheSize)):64,a=new Map;return{version:b,refs:n,getCapabilities:t=>{const r=z(e,n),o={version:b,createdAt:j(e),graph:{version:b,nodes:r.nodes,edges:r.edges,actions:r.actions.map(e=>e.descriptor)}};return t?function(e,t){const n=function(e){return{refs:c(e.refs),prefixes:c(e.prefixes),kinds:e.kinds?.length?new Set(e.kinds):void 0,layers:e.layers?.length?new Set(e.layers):void 0,includeActions:!1!==e.includeActions,includeEdges:!1!==e.includeEdges,includeNodeData:!1!==e.includeNodeData}}(t),r=e.graph.nodes.filter(e=>function(e,t){return!((t.refs?.length||t.prefixes?.length)&&!t.refs?.includes(e.ref)&&!t.prefixes?.some(t=>e.ref===t||e.ref.startsWith(t+"/")))&&(!t.kinds||t.kinds.has(e.kind))&&(!t.layers||t.layers.has(e.layer))}(e,n)).map(e=>{if(n.includeNodeData)return e;const{data:t,...r}=e;return r}),o=new Set(r.map(e=>e.ref)),i=n.includeActions?e.graph.actions.filter(e=>{if(!e.targetRef)return!0;if(o.has(e.targetRef))return!0;for(const t of o)if(t.startsWith(e.targetRef+"/"))return!0;return!1}):[];return{version:e.version,createdAt:e.createdAt,graph:{version:e.graph.version,nodes:r,edges:n.includeEdges?e.graph.edges.filter(e=>o.has(e.from)&&o.has(e.to)):[],actions:i}}}(o,t):o},getState:async function(t){const r=function(e,t,n){const r={},i={},a=t.getSelections?.()??{},s=t.getObservations?.()??[];for(const a of e.charts){r[a.ref]=o({component:a.chart.component,description:a.grounding.description,intent:a.grounding.intent,physics:a.grounding.physics,audience:a.chart.audience}),r[a.configRef]=a.config,i[a.ref]={component:a.chart.component,dataHandles:a.dataHandles.length};for(const e of a.dataHandles)r[e.ref]={kind:"DataHandle",collection:e.collection,rowCount:e.rows.length},i[e.ref]={rowCount:e.rows.length};if(a.navigation){const e=P(a.navigation.binding.tree,a.navigation.binding.activeId),t=e?V(e,a.navigation.index.matchFields):void 0;r[a.navigation.ref]=o({kind:"Selection",status:a.navigation.index.valid?"ready":"ambiguous",activeRole:e?.role,activeLabel:e?.label,activeMatch:t,activeTargetRef:t?a.navigation.index.targetRef(t):void 0,diagnostic:a.navigation.index.diagnostic}),i[a.navigation.ref]={targetCount:a.navigation.index.byKey.size}}if(t.getObservations){const e=F(s,a.chart.chartId);r[n.observation(a.chart.chartId)]=e?o(e):null,e&&(i[n.observation(a.chart.chartId)]={type:e.type,timestamp:e.timestamp})}}for(const t of e.selections){const e=a[t.name];r[t.ref]=(e?o(e):void 0)??{name:t.name,resolution:"union",clauses:[]},i[t.ref]={active:!!e?.clauses.length,clauseCount:e?.clauses.length??0,fields:t.fields}}return{version:b,createdAt:j(t),state:r,...Object.keys(i).length?{summary:i}:{}}}(z(e,n),e,n);if(!t)return r;const{snapshot:c,refs:l}=f(r,t),u="st_"+s({state:(m=c).state,...m.summary?{summary:m.summary}:{}});var m;const p=t.since?a.get(t.since):void 0;let h;if("full"!==t.mode&&t.since&&p){const e=f(p,t).snapshot;h={version:b,createdAt:c.createdAt,mode:"delta",token:u,baseToken:t.since,...l?{scope:{refs:l}}:{},delta:d(e,c)}}else h={version:b,createdAt:c.createdAt,mode:"full",token:u,...l?{scope:{refs:l}}:{},snapshot:c};return((e,t)=>{for(a.has(e)&&a.delete(e),a.set(e,t);a.size>i;){const e=a.keys().next().value;if("string"!=typeof e)break;a.delete(e)}})(u,r),h},execute:async t=>{const o=t&&"string"==typeof t.callId?t.callId:"";try{if(!t||"string"!=typeof t.name||!t.name.trim())throw Error("VACP action call requires a non-empty name.");if(!o)throw Error("VACP action call requires a callId.");const i=z(e,n),a=i.actions.find(e=>e.descriptor.name===t.name);if(!a)return{callId:o,ok:!1,error:{message:`Unknown or currently unavailable VACP action "${t.name}".`,details:{available:i.actions.map(e=>e.descriptor.name)}}};const s=r(await a.execute(t.params));return{callId:o,ok:!0,...void 0!==s?{result:s}:{}}}catch(e){return{callId:o,ok:!1,error:{message:e instanceof Error?e.message:"VACP action failed."}}}}}}function q(e,t={}){const n=t.globalKey?.trim()||"__vacp",r=t.target??("undefined"!=typeof window?window:void 0);if(!r)return{installed:!1,globalKey:n,bridge:e,reason:`Refused to install "${n}" without a browser window or an explicit target.`,cleanup:()=>!1};if("__proto__"===n||"prototype"===n||"constructor"===n)return{installed:!1,globalKey:n,bridge:e,reason:`Refused unsafe global key "${n}".`,cleanup:()=>!1};const o=r[n];if(void 0!==o&&o!==e)return{installed:!1,globalKey:n,bridge:e,reason:`Refused to replace existing global "${n}".`,cleanup:()=>!1};try{r[n]=e}catch(t){return{installed:!1,globalKey:n,bridge:e,reason:t instanceof Error?`Could not install "${n}": ${t.message}`:`Could not install "${n}".`,cleanup:()=>!1}}return{installed:!0,globalKey:n,bridge:e,cleanup:()=>{if(r[n]!==e)return!1;try{return delete r[n]}catch{return!1}}}}export{g as unstable_SEMIOTIC_VACP_ACTIVATE_NAVIGATION_ACTION,h as unstable_SEMIOTIC_VACP_CLEAR_SELECTION_ACTION,y as unstable_SEMIOTIC_VACP_INSPECT_DATA_ACTION,p as unstable_SEMIOTIC_VACP_SET_INTERVAL_SELECTION_ACTION,m as unstable_SEMIOTIC_VACP_SET_POINT_SELECTION_ACTION,v as unstable_VACP_DATA_SCHEMA_ACTION,b as unstable_VACP_SCHEMA_VERSION,H as unstable_createSemioticVACPBridge,q as unstable_installSemioticVACPBridge};
1
+ function e(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function t(e,t={}){let r="number"==typeof t.maxDepth&&Number.isFinite(t.maxDepth)?Math.max(1,Math.floor(t.maxDepth)):10,n="number"==typeof t.maxArrayLength&&Number.isFinite(t.maxArrayLength)?Math.max(1,Math.floor(t.maxArrayLength)):1e3,a=new WeakSet,i=(e,t)=>{if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("bigint"==typeof e)return""+e;if("function"==typeof e||"symbol"==typeof e||typeof e>"u")return;if(e instanceof Date)return e.toISOString();if(t>=r)return"[depth limit]";if("object"!=typeof e)return e+"";if("$$typeof"in e)return;if(a.has(e))return"[circular]";if(a.add(e),Array.isArray(e)){let r=e.slice(0,n).map(e=>i(e,t+1)).filter(e=>void 0!==e);return a.delete(e),r}if(e instanceof Set){let r=Array.from(e).slice(0,n).map(e=>i(e,t+1)).filter(e=>void 0!==e);return a.delete(e),r}if(e instanceof Map){let r=Object.create(null),o=0;for(let[a,l]of e){if(o++>=n)break;let e=i(l,t+1);void 0!==e&&(r[a+""]=e)}return a.delete(e),r}let o=Object.create(null);for(let r of Object.keys(e).sort()){let n=i(e[r],t+1);void 0!==n&&(o[r]=n)}return a.delete(e),o};return i(e,0)}function r(r){let n=t(r);return e(n)?n:{}}function n(t){if(Array.isArray(t))return t.map(n);if(!e(t))return t;let r=Object.create(null);for(let e of Object.keys(t).sort())r[e]=n(t[e]);return r}function a(e){return JSON.stringify(n(t(e)))}function i(e){return function(e){let t=BigInt("14695981039346656037"),r=BigInt("1099511628211"),n=BigInt("0xffffffffffffffff");for(let a=0;e.length>a;a++)t^=BigInt(e.charCodeAt(a)),t=t*r&n;return t.toString(16).padStart(16,"0")}(a(e))}function o(e){if(!e?.length)return;let t=Array.from(new Set(e.filter(e=>"string"==typeof e&&e.length))).sort();return t.length?t:void 0}function l(e,t){return t.some(t=>e===t||e.startsWith(t+"/"))}function s(e,t){let r=o(t.refs),n=!1!==t.includeSummary;if(!r)return{snapshot:{version:e.version,createdAt:e.createdAt,state:e.state,...n&&e.summary?{summary:e.summary}:{}}};let a={};for(let[t,n]of Object.entries(e.state))l(t,r)&&(a[t]=n);let i={};if(n&&e.summary)for(let[t,n]of Object.entries(e.summary))l(t,r)&&(i[t]=n);return{snapshot:{version:e.version,createdAt:e.createdAt,state:a,...Object.keys(i).length?{summary:i}:{}},refs:r}}function c(e,t){let r={},n=[];for(let[n,i]of Object.entries(t.state))(!Object.prototype.hasOwnProperty.call(e.state,n)||a(e.state[n])!==a(i))&&(r[n]=i);for(let r of Object.keys(e.state))Object.prototype.hasOwnProperty.call(t.state,r)||n.push(r);let i={},o=[],l=e.summary??{},s=t.summary??{};for(let[e,t]of Object.entries(s))(!Object.prototype.hasOwnProperty.call(l,e)||a(l[e])!==a(t))&&(i[e]=t);for(let e of Object.keys(l))Object.prototype.hasOwnProperty.call(s,e)||o.push(e);return{changed:r,removed:n.sort(),...Object.keys(i).length?{summaryChanged:i}:{},...o.length?{summaryRemoved:o.sort()}:{}}}function u(e){return null==e?"NULL":"number"==typeof e?"DOUBLE":"string"==typeof e?"VARCHAR":"boolean"==typeof e?"BOOLEAN":e instanceof Date?"TIMESTAMP":Array.isArray(e)?"ARRAY":"OBJECT"}function d(e,t){if(!t.descriptor.name.trim())throw Error("VACP action names must be non-empty.");if(e.some(e=>e.descriptor.name===t.descriptor.name))throw Error(`Duplicate VACP action "${t.descriptor.name}".`);e.push(t)}function f(t,r){if(!e(t))throw Error(r+" expects an object parameter payload.");return t}function h(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,Math.floor(e)):t}function m(e,t,r){if("string"!=typeof e.selectionRef)throw Error("params.selectionRef must be a VACP selection ref.");let n=t.find(t=>t.ref===e.selectionRef);if(!n)throw Error(`Unknown selection ref "${e.selectionRef}".`);if(r&&!n.modes.has(r))throw Error(`Selection "${n.name}" does not accept ${r} state.`);return n}function p(e){return null==e||"string"==typeof e||"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e||e instanceof Date&&Number.isFinite(e.getTime())}function g(n,a,o){let l=[],s=n.dataHandles.map(e=>e.ref);s.length&&d(l,{descriptor:{name:bt,title:"Describe Semiotic data",description:"Return columns, types, row count, and optional bounded summaries for a chart DataHandle.",targetRef:o.view,parameters:{type:"object",properties:{handleRef:{type:"string",enum:s},detail:{type:"string",enum:["columns","full"]},sampleRows:{type:"number",minimum:1}},required:["handleRef"]}},execute(t){let r=f(t,bt);if("string"!=typeof r.handleRef)throw Error("params.handleRef must be a DataHandle ref.");let i=n.dataHandles.find(e=>e.ref===r.handleRef);if(!i)throw Error(`Unknown DataHandle "${r.handleRef}".`);let o=void 0===r.detail||"columns"===r.detail?"columns":"full"===r.detail?"full":(()=>{throw Error('params.detail must be "columns" or "full".')})(),l="number"==typeof r.sampleRows&&Number.isFinite(r.sampleRows)?Math.max(1,Math.floor(r.sampleRows)):"full"===o?1e3:Math.min(i.rows.length,1e3),s=h(a.dataAccess?.maxSchemaRows,5e3);return function(t){let r=t.rows.slice(0,Math.max(0,t.sampleRows)),n=function(t){let r=new Map;for(let n of t)if(e(n))for(let[e,t]of Object.entries(n)){let n=r.get(e)??new Set;n.add(u(t)),r.set(e,n)}return Array.from(r).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let r=Array.from(t).filter(e=>"NULL"!==e);return{name:e,type:0===r.length?"NULL":1===new Set(r).size?r[0]:"MIXED"}})}(t.rows),a=n.map(e=>e.name);if("columns"===t.detail)return{handleRef:t.handleRef,detail:t.detail,table:null,rowCount:t.rows.length,columns:n};let i=function(t,r){let n=Object.create(null);for(let a of r){let r=[];for(let n of t){if(!e(n))continue;let t=n[a];"number"==typeof t&&Number.isFinite(t)&&r.push(t)}if(!r.length)continue;let i=r[0],o=r[0],l=0;for(let e of r)i=Math.min(i,e),o=Math.max(o,e),l+=e;n[a]={min:i,max:o,avg:l/r.length}}return Object.keys(n).length?n:void 0}(r,a),o=function(t,r){let n=Object.create(null);for(let a of r){let r=[];for(let n of t){if(!e(n))continue;let t=n[a];t instanceof Date&&Number.isFinite(t.getTime())&&r.push(t.getTime())}if(!r.length)continue;let i=Math.min(...r),o=Math.max(...r);n[a]={minIso:new Date(i).toISOString(),maxIso:new Date(o).toISOString(),minEpochMs:i,maxEpochMs:o}}return Object.keys(n).length?n:void 0}(r,a),l=function(t,r){let n=Object.create(null);for(let a of r){let r=new Map;for(let n of t){if(!e(n))continue;let t=n[a];if("string"!=typeof t&&"boolean"!=typeof t)continue;let i=t+"";r.set(i,(r.get(i)??0)+1)}r.size&&(n[a]=Array.from(r).sort(([e,t],[r,n])=>n-t||e.localeCompare(r)).slice(0,10).map(([e,t])=>({value:e,n:t})))}return Object.keys(n).length?n:void 0}(r,a);return{handleRef:t.handleRef,detail:t.detail,table:null,rowCount:t.rows.length,columns:n,...i?{numeric:i}:{},...o?{temporal:o}:{},...l?{categoricalTopValues:l}:{},sampledRows:r.length}}({handleRef:i.ref,rows:i.rows,detail:o,sampleRows:Math.min(l,s)})}}),s.length&&a.dataAccess?.sample&&d(l,{descriptor:{name:yt,title:"Inspect bounded Semiotic rows",description:"Return a bounded JSON sample from a chart DataHandle. This action is opt-in.",targetRef:o.view,parameters:{type:"object",properties:{handleRef:{type:"string",enum:s},offset:{type:"number",minimum:0},limit:{type:"number",minimum:1}},required:["handleRef"]}},execute(e){let r=f(e,yt);if("string"!=typeof r.handleRef)throw Error("params.handleRef must be a DataHandle ref.");let i=n.dataHandles.find(e=>e.ref===r.handleRef);if(!i)throw Error(`Unknown DataHandle "${r.handleRef}".`);let o="number"==typeof r.offset&&Number.isFinite(r.offset)?Math.max(0,Math.floor(r.offset)):0,l=h(a.dataAccess?.maxSampleRows,50),s="number"==typeof r.limit&&Number.isFinite(r.limit)?Math.max(1,Math.floor(r.limit)):Math.min(20,l),c=Math.min(s,l),u=i.rows.slice(o,o+c);return{handleRef:i.ref,offset:o,limit:c,rowCount:i.rows.length,rows:t(u,{maxArrayLength:l}),truncated:i.rows.length>o+u.length}}});let c=n.selections.map(e=>e.ref),g=n.selections.filter(e=>e.modes.has("point"));g.length&&a.selectionActions?.setPointSelection&&d(l,{descriptor:{name:ht,title:"Set point selection",description:"Set a named LinkedCharts point-selection clause with allowlisted fields.",targetRef:o.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:g.map(e=>e.ref)},fields:{type:"object"}},required:["selectionRef","fields"]}},async execute(t){let r=f(t,ht),i=m(r,n.selections,"point"),o=function(t,r){if(!e(t)||!Object.keys(t).length)throw Error("params.fields must be a non-empty object.");let n=Object.create(null);for(let[e,a]of Object.entries(t)){if(!r.includes(e))throw Error(`Field "${e}" is not allowed for this selection.`);if(!Array.isArray(a)||!a.length)throw Error(`Point selection field "${e}" requires values[].`);for(let t of a)if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&("number"!=typeof t||!Number.isFinite(t)))throw Error(`Point selection field "${e}" only accepts JSON primitive values.`);n[e]=[...a]}return n}(r.fields,i.fields);return await(a.selectionActions?.setPointSelection?.(i.name,i.clientId,o)),{selectionRef:i.ref,fields:o}}});let y=n.selections.filter(e=>e.modes.has("interval"));y.length&&a.selectionActions?.setIntervalSelection&&d(l,{descriptor:{name:mt,title:"Set interval selection",description:"Set a named LinkedCharts interval-selection clause in data units.",targetRef:o.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:y.map(e=>e.ref)},fields:{type:"object"}},required:["selectionRef","fields"]}},async execute(t){let r=f(t,mt),i=m(r,n.selections,"interval"),o=function(t,r){if(!e(t)||!Object.keys(t).length)throw Error("params.fields must be a non-empty object.");let n=Object.create(null);for(let[e,a]of Object.entries(t)){if(!r.includes(e))throw Error(`Field "${e}" is not allowed for this selection.`);if(!Array.isArray(a)||2!==a.length||"number"!=typeof a[0]||"number"!=typeof a[1]||!Number.isFinite(a[0])||!Number.isFinite(a[1]))throw Error(`Interval selection field "${e}" requires [min,max].`);n[e]=[Math.min(a[0],a[1]),Math.max(a[0],a[1])]}return n}(r.fields,i.fields);return await(a.selectionActions?.setIntervalSelection?.(i.name,i.clientId,o)),{selectionRef:i.ref,fields:o}}}),c.length&&a.selectionActions?.clearSelection&&d(l,{descriptor:{name:pt,title:"Clear selection",description:"Clear every active clause from one named LinkedCharts selection.",targetRef:o.view,parameters:{type:"object",properties:{selectionRef:{type:"string",enum:c}},required:["selectionRef"]}},async execute(e){let t=m(f(e,pt),n.selections);return await(a.selectionActions?.clearSelection?.(t.name)),{selectionRef:t.ref,cleared:!0}}});let v=n.charts.map(e=>e.navigation).filter(e=>!!e&&e.index.valid&&!!e.binding.onActiveChange);v.length&&d(l,{descriptor:{name:gt,title:"Activate chart navigation target",description:"Move an accessible chart navigation tree to a uniquely identified datum.",targetRef:o.view,parameters:{type:"object",properties:{navigationRef:{type:"string",enum:v.map(e=>e.ref)},match:{type:"object"}},required:["navigationRef","match"]}},execute(t){let r=f(t,gt);if("string"!=typeof r.navigationRef)throw Error("params.navigationRef must be a navigation ref.");let n=v.find(e=>e.ref===r.navigationRef);if(!n)throw Error(`Unknown navigation ref "${r.navigationRef}".`);let a=function(t,r){if(!e(t))throw Error("params.match must be an object.");for(let e of Object.keys(t))if(!r.includes(e))throw Error(`params.match includes undeclared field "${e}".`);let n=Object.create(null);for(let e of r){if(!Object.prototype.hasOwnProperty.call(t,e)||!p(t[e]))throw Error(`params.match requires a primitive value for "${e}".`);n[e]=t[e]instanceof Date?t[e].toISOString():t[e]}return n}(r.match,n.index.matchFields),o=n.index.byKey.get(i(a));if(!o)throw Error("No navigation datum matches params.match.");return n.binding.onActiveChange?.(o),{navigationRef:n.ref,targetRef:n.index.targetRef(a),match:a}}});let b="function"==typeof a.actions?a.actions():a.actions;for(let e of b??[])e.available&&!e.available()||d(l,{descriptor:{...e.descriptor,...e.descriptor.parameters?{parameters:r(e.descriptor.parameters)}:{}},async execute(t){let r=e.validate?.(t);if("string"==typeof r&&r)throw Error(r);return e.execute(t)}});return l}function y(){let e=globalThis;return e[Ct]||(e[Ct]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[Ct]}function v(e){return y().recipes.get(e)}function b(e){return"string"==typeof e?v(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function $(e){return"string"==typeof e?e:e.id??e.name}function w(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function C(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 A(e,t,r){return r??b(t.recipe)??b(t.recipeId)??v(e)}function k(e,t,r=[]){let n=e.accessor?t[e.accessor]:void 0;if("string"==typeof n&&n)return n;if(e.field)return e.field;let a=r.find(e=>e&&"object"==typeof e);if(!a)return;let i=Object.entries(a).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?i.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in a):i.find(([,e])=>"string"==typeof e)?.[0]}function x(e,t){return e.dataRoles.find(e=>e.role===t)}function S(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function P(e,t,r,n,a,i={}){let o={...i};if(t)for(let[e,r]of Object.entries(t))o[e]=r;for(let e of r.dataRoles){let r=k(e,n,a),i=t&&r?t[r]:r;void 0!==i&&(o[e.role]=i)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{let r=o[t];return null==r?`{${t}}`:r+""})}function I(e,t,r){let n=Ye(e,t,r);return{mismatchPaths:[...n.mismatchPaths,...void 0!==r&&n.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function j(e,t,r,n){let a={component:t,version:n.version,createdAt:n.createdAt,...void 0!==n.recipeId?{recipeId:n.recipeId}:{},...void 0!==n.portable?{portable:n.portable}:{},...void 0!==n.manifest?{manifest:n.manifest}:{},...void 0!==n.reason?{reason:n.reason}:{},...void 0!==n.warnings?{warnings:n.warnings}:{},...void 0!==n.selections?{selections:n.selections}:{},artifactContract:r,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}:{}};return tt(a).fingerprint}function M(e,t,r,n,a){let i=Xe(r),o={...e,serializedConfigFingerprint:tt(Qe(r)).fingerprint,serializedDataFingerprint:void 0===i?null:tt(i).fingerprint};return{...o,transferFingerprint:j(o,t,n,a)}}function R(e,t,r,n,a){if(!t)return{};let i=ct(t),o=a.recipeId??e,l=I(t,r,o),s=function(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;let n=tt(e[r]),a=tt(t[r]);return n.excludedPaths.length>0||n.fingerprint!==a.fingerprint}).map(e=>"props."+e).sort()}(r,n),c=I(t,n,o);return l.mismatchPaths.length>0?{artifactContract:i.contract,artifactTransfer:M({status:"invalid",omittedPaths:l.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,n,i.contract,a)}:s.length>0?{artifactContract:i.contract,artifactTransfer:M({status:"excluded",omittedPaths:s,warnings:["Chart props or data were excluded from the serialized configuration."]},e,n,i.contract,a)}:c.mismatchPaths.length>0?{artifactContract:i.contract,artifactTransfer:M({status:"invalid",omittedPaths:c.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,n,i.contract,a)}:{artifactContract:i.contract,artifactTransfer:M(i.transfer,e,n,i.contract,a)}}function O(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function F(e,t){return!(!it(e,t)||"areas"===e&&"string"==typeof t)}function D(e,t){return Pt.has(e)||It.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 L(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let r=e[t];if("string"==typeof r&&r)return r}}function N(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function T(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function E(e,t){let r=e.physics&&"object"==typeof e.physics?e.physics:null,n=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,a=[e.settledProjectionRows,e.projectionRows,n?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(a)?a.map((e,r)=>{if(!e||"object"!=typeof e)return null;let n=e,a=T(n.count??n.value??n.total??n.bodies??n.events);if(null==a)return null;let i=n.label??n.id??n.name??"container "+(r+1),o=T(n.secondary??n.secondaryCount),l=T(n.observed??n.observedCount);return{label:N(i,t),count:a,...null!=o?{secondary:o}:{},..."string"==typeof n.secondaryLabel&&n.secondaryLabel?{secondaryLabel:n.secondaryLabel}:{},...null!=l?{observed:l}:{}}}).filter(e=>null!=e):null}function B(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function _(e){return Mt[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function z(e,t){let r=function(e){if(e){if("fits"in e||"buildProps"in e){let t=e,r={};for(let[e,n]of Object.entries(t.intentScores))"number"==typeof n&&Number.isFinite(n)&&(r[e]=n);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}(t);if(r?.act)return r.act;if(r?.intentScores){let e=function(e){let t,r=0;for(let[n,a]of Object.entries(e))if("number"==typeof a&&a>0){if(a>r){t=n,r=a;continue}if(a===r&&void 0!==t){let e=Nt.indexOf(n),r=Nt.indexOf(t);-1!==e&&(-1===r||r>e)&&(t=n)}}return t}(r.intentScores);if(e&&Dt[e]&&(r.intentScores[e]??0)>=3)return Dt[e]}return r?.family?Lt[r.family]:function(e){return"BumpChart"===e?"ranking":It.has(e)||"StackedAreaChart"===e?"apportioning":Ft.has(e)?"relating":Pt.has(e)?"comparing":jt.has(e)?"characterizing":St.has(e)?"tracking":Rt.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function V(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||!Et.has(t.type))return!1;let r=t.provenance;return!(!r||"object"!=typeof r)&&(Bt.has(r.authorKind)||_t.has(r.source)||zt.has(r.basis))})}function H(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?r.format(e):t.format(e):e+""}function q(e){let t=Vt["string"==typeof e.type?e.type:"annotation"]||"an annotation",r=function(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}(e),n=r?r+t.replace(/^an? /,""):t,a="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return a?`${n} labeled "${a}"`:n}function G(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let r=et(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;let n=r.map(q),a=n.slice(0,5),i=n.length-a.length,o=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]??""}(a)+(i>0?`, and ${i} more`:""),l=r.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${o}.`}function U(e,t,r={}){let n=void 0!==r.levels,a=new Set(r.levels??["l1","l2","l3"]);!n&&(r.capability||V(t))&&a.add("l4");let i=A(e,t,r.recipe);if(i){let e=["l1","l2","l3","l4"].filter(e=>a.has(e));!n&&!e.includes("l4")&&e.push("l4");let o=function(e,t,r={}){let n=C(t),a=w(t),i=r.locale??"en",o=("function"==typeof e.description?e.description({data:n,config:a,locale:i}):void 0)?.levels??function(e,t,r,n){let a=S(e,["nominal","ordinal"]),i=S(e,["quantitative"]),o=a?k(a,r,t):void 0,l=i?k(i,r,t):void 0,s=a?.role??o??"category",c=i?.role??l??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${s} and ${c} are mapped through the recipe's declared visual semantics`,{number:f,percent:h}=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})}}}(n),m=new Map;if(o&&l)for(let e of t){let t=(e[o]??"Uncategorized")+"",r=Number(e[l]);Number.isFinite(r)&&m.set(t,(m.get(t)??0)+r)}let p=[...m].sort((e,t)=>t[1]-e[1]),g=p.reduce((e,[,t])=>e+t,0),y=p[0],v=p[1],b=g>0?((y?.[1]??0)+(v?.[1]??0))/g:0,w=e.intents.map(e=>({id:$(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,C=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${s} and ${c}. ${A=d,A&&A.charAt(0).toUpperCase()+A.slice(1)}.`,l2:p.length>0?`${p.length} categories total ${f.format(g)}. ${y[0]} accounts for ${f.format(y[1])}${g>0?` (${h.format(y[1]/g)})`:""}${v?`, followed by ${v[0]} at ${f.format(v[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>p.length?y?y[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>b?`The total is distributed across ${p.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${y[0]} and ${v[0]}, which together account for ${h.format(b)}.`,l4:`The chart is intended for ${w??"explanation"}${C?` with a ${C} audience`:""}: ${e.designContract.whyCustom}`};var A}(e,n,a,i),l=r.levels??["l1","l2","l3","l4"],s={};for(let e of l)o[e]&&(s[e]=o[e]);let c=["l1","l2","l3","l4"].map(e=>s[e]).filter(e=>!!e).join(" "),u=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:c,levels:s,...u?.length?{caveats:u}:{}}}(i,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),l=G(t);return{...o,text:l?`${l} ${o.text}`.trim():o.text,...l?{annotations:l}:{}}}let o=H(r.locale??"en"),l=_(e),s=Array.isArray(t.data)?t.data:null,c=L(t),u=Ot.has(e)?E(t,o):null,d=Ot.has(e)&&null===u?function(e,t){let r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let n=Array.isArray(t.data)?t.data:[],a=Math.max(2,Math.round(rt(t.bins)??21)),i=Math.max(1,Math.round(rt(t.pegRows)??a-1));if(r&&(n="GaltonBoardChart"===e?nt({bins:a,count:t.mechanicalCount,pegRows:i,branchProbability:t.branchProbability,seed:t.seed}):at({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),n=Ze(n,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=new Map,a=t.valueAccessor??(r?"value":void 0);return n.forEach((r,n)=>{let i=(st(r,n,t.categoryAccessor??"category")??"unknown")+"",o=a?rt(st(r,n,a)):1;e.set(i,(e.get(i)??0)+Math.max(0,o??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=n.map((e,r)=>rt(st(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),o=r?[0,i]:lt(t.valueExtent),l=o?.[0]??(e.length?Math.min(...e):0),s=o?.[1]??(e.length?Math.max(...e):1),c=l===s?1:s-l,u=Array.from({length:a},(e,t)=>({label:t+1+"",value:0}));for(let t of e)u[Math.max(0,Math.min(a-1,Math.floor((t-l)/c*a)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){let e=new Map;return n.forEach((r,n)=>{if(null==rt(st(r,n,t.xAccessor??"x")))return;let a=t.groupAccessor?(st(r,n,t.groupAccessor)??"All")+"":"All";e.set(a,(e.get(a)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=rt(t.windows?.size??10);if(null==e||0>=e)return null;let{events:a}=dt({data:n,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),i=a.map(e=>e.eventTime),o=i.length?Math.min(...i):0,l=i.length?Math.max(...i):o+e,s=Math.min(rt(t.timeExtent?.[0])??o,o),c=Math.max(rt(t.timeExtent?.[1])??l,l),u=Math.floor(s/e)*e,d=Math.max(1,Math.ceil((c-u+e)/e)),f=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of a){let r=f[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:f}}return null}(e,t):null,{measure:f,measureFallback:h,dimension:m,dimensionFallback:p}=D(e,t),g="string"==typeof f&&f?f:h,y="string"==typeof m&&m?m:p,v={};if(Ot.has(e)&&function(e,t,r,n,a,i,o=null){let l=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=o&&"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=o?o.generated?"The generated sample projection":"The source projection":"The settled projection";if(a.has("l1")&&(n.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)),!a.has("l2")&&!a.has("l3"))return;if(!r||0===r.length)return void(a.has("l2")&&(n.l2=o?"No valid source records are available.":"No settled projection is loaded yet."));let u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),f=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!f)return;let h=r.reduce((e,t)=>e+(t.secondary??0),0),m=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(a.has("l2"))if(o&&"EventDropChart"===e)n.l2=`${c} classifies ${i(u+h)} ${B(u+h,"event")} across ${r.length} ${B(r.length,l)}: ${i(u)} accepted and ${i(h)} late.`;else if(0===d.length)n.l2=`${c} contains ${i(u)} ${B(u,s)} across ${r.length} ${B(r.length,l)}; no ${B(2,l)} are non-empty yet.`;else{let e=h>0?` ${i(h)} ${B(h,s)} ${1===h?"is":"are"} marked ${m}.`:"";n.l2=`${c} contains ${i(u)} ${B(u,s)} across ${r.length} ${B(r.length,l)}; ${d.length} ${B(d.length,l)} ${1===d.length?"is":"are"} non-empty. The largest ${l} is ${f.label} with ${i(f.count)} ${B(f.count,s)}.${e}`}if(a.has("l3")&&u>0&&d.length>0){let e=d.find(e=>e!==f),t=function(e,t){if(0>=t)return"0%";let r=e/t*100;return(10>r?Math.round(10*r)/10:Math.round(r))+"%"}(f.count,u);n.l3=e?`${c} is most concentrated in ${f.label}, which holds ${i(f.count)} ${B(f.count,s)} (${t}); ${e.label} follows with ${i(e.count)} ${B(e.count,s)}.`:`${c} is concentrated in ${f.label}, which holds all ${i(f.count)} ${B(f.count,s)}.`}}(e,l,u??(d?E({projectionRows:d.rows},o):null),v,a,o,d),a.has("l1")&&!Ot.has(e))if("BumpChart"===e)v.l1=`A ${l} ranking ${c??"series"} by ${g} across ${y}.`;else if(St.has(e)||Pt.has(e))v.l1=`A ${l} of ${g} by ${y}`+(c?`, split by ${c}.`:".");else if(It.has(e))v.l1=`A ${l} showing ${g} across ${y} categories.`;else if(jt.has(e))v.l1=`A ${l} of the distribution of ${g}`+(c?` by ${c}.`:".");else if(Rt.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,n=[null!=e?`${e} ${J(e,"node")}`:null,null!=r?`${r} ${J(r,"edge")}`:null].filter(Boolean);v.l1=`A ${l}${n.length?" with "+n.join(" and "):""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:g;v.l1=`A single value${e?" for "+e:""}.`}else v.l1=`A ${l}.`;let b=St.has(e)||"BumpChart"===e||Pt.has(e)||It.has(e)||jt.has(e),x=null;if((a.has("l2")||a.has("l3")||a.has("l4"))&&b&&s&&s.length>0&&(x=function(e,t,r,n){let a=0,i=0,o=1/0,l=-1/0,s=null,c=null,u=0,d=0,f=null,h=null,m=NaN,p=NaN;for(let r of e){let e=t(r);Number.isFinite(e)&&(0===a&&(m=e,f=r),p=e,h=r,o>e&&(o=e,s=r,u=a),e>l&&(l=e,c=r,d=a),a++,i+=e)}return 0===a?null:{count:a,min:o,max:l,mean:i/a,minLabel:N(null!=s?r(s):null,n),maxLabel:N(null!=c?r(c):null,n),first:m,last:p,firstLabel:N(null!=f?r(f):null,n),lastLabel:N(null!=h?r(h):null,n),minIndex:u,maxIndex:d}}(s,ut(f,h),ft(m,p),o)),a.has("l2")&&b&&(s&&0!==s.length?x&&(v.l2=It.has(e)?`${x.count} segments totaling ${o(function(e){return e.mean*e.count}(x))}. Largest is ${x.maxLabel} at ${o(x.max)}; smallest is ${x.minLabel} at ${o(x.min)}.`:`${g} ranges from ${o(x.min)} (${x.minLabel}) to ${o(x.max)} (${x.maxLabel}), with a mean of ${o(x.mean)} across ${x.count} points.`):v.l2="No data is loaded yet."),a.has("l3")&&x&&!c&&St.has(e)?v.l3=function(e,t,r){let{first:n,last:a,min:i,max:o,maxLabel:l,minLabel:s,firstLabel:c,lastLabel:u,minIndex:d,maxIndex:f,count:h}=e,m=o-i,p=a-n;if(0===m)return`${K(t)} is constant at ${r(n)} across the series.`;if(.04>m/(Math.abs(e.mean)||1))return`${K(t)} ends roughly where it started (${r(n)} at ${c} to ${r(a)} at ${u}), ranging between ${r(i)} and ${r(o)}.`;let g=f>0&&h-1>f,y=d>0&&h-1>d,v=(o-Math.max(n,a))/m,b=(Math.min(n,a)-i)/m;return g&&v>.15?`Overall ${t} climbs to a peak of ${r(o)} (${l}), then falls to ${r(a)} (${u}).`:y&&b>.15?`Overall ${t} drops to a low of ${r(i)} (${s}), then recovers to ${r(a)} (${u}).`:.05>Math.abs(p)/m?`${K(t)} ends roughly where it started (${r(n)} at ${c} to ${r(a)} at ${u}), ranging between ${r(i)} and ${r(o)}.`:p>0?f===h-1?`Overall ${t} rises from ${r(n)} (${c}) to a peak of ${r(a)} (${u}).`:`Overall ${t} rises from ${r(n)} (${c}) to ${r(a)} (${u}), after peaking at ${r(o)} (${l}).`:d===h-1?`Overall ${t} falls from ${r(n)} (${c}) to a low of ${r(a)} (${u}).`:`Overall ${t} falls from ${r(n)} (${c}) to ${r(a)} (${u}), after dipping to ${r(i)} (${s}).`}(x,g,o):a.has("l3")&&x&&!c&&Pt.has(e)&&(v.l3=`The highest ${y} is ${x.maxLabel} and the lowest is ${x.minLabel}.`),a.has("l4")){let n=V(t)?"alerting":z(e,r.capability);n&&(v.l4=function(e,t,r,n,a,i,o,l){let s,c,u=Tt[e],d=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":s="This is a map",c="read values by location";break;case"presenting":s="This is a single-value display",c=`read ${"string"==typeof r.label&&r.label?r.label:a} as the headline number`;break;case"tracing":s=`This is ${d} ${u} chart`,c="follow the movement between states";break;case"nesting":s=`This is ${d} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":s=`This is ${d} ${u} chart`,c=`read it for whether ${i} and ${a} move together`;break;default:s=`This is ${d} ${u} chart`,c=function(e,t,r,n,a,i){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+r;case"comparing":return`compare ${r} across ${n}`;case"ranking":return"read it top to bottom by "+r;case"apportioning":return`read each ${n}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+r;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,r){if(Pt.has(r)||It.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:n,last:a,min:i,max:o,minLabel:l,maxLabel:s,lastLabel:c,minIndex:u,maxIndex:d,count:f}=e,h=o-i;if(h>0){let e=d>0&&f-1>d,r=u>0&&f-1>u,m=(o-Math.max(n,a))/h,p=(Math.min(n,a)-i)/h;if(e&&m>.15)return`the peak of ${t(o)} at ${s} is the point to investigate`;if(r&&p>.15)return`the dip to ${t(i)} at ${l} is the point to investigate`;if(a>=o)return`the climb to ${t(a)} at ${c} warrants a closer look`;if(i>=a)return`the drop to ${t(a)} at ${c} warrants a closer look`}return`the extremes — ${s} (${t(o)}) and ${l} (${t(i)}) — are the points to check`}(t,a,i);case"tracking":return`read it for the trajectory of ${r}, which ${function(e){let t=e.max-e.min,r=e.last-e.first;return 0===t||.05>Math.abs(r)/t?"holds roughly steady":r>0?"rises":"falls"}(t)} from ${a(t.first)} (${t.firstLabel}) to ${a(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${n}; ${t.maxLabel} leads at ${a(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${a(t.max)}`;case"apportioning":{let e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${n}'s share of the ${a(e)} total; ${t.maxLabel} is the largest at ${a(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${a(t.min)} to ${a(t.max)}`;default:return"read the highlighted features"}}(e,n,a,i,o,t)}return`${s}; ${c}.${function(e,t){if(!t)return"";let r=t.familiarity?.[e];return"number"!=typeof r||r>2?"":` This ${_(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,l)}`}(n,e,t,c?null:x,g,y,o,r.audience))}let P=["l1","l2","l3","l4"].filter(e=>a.has(e)&&v[e]).map(e=>v[e]).join(" "),I=G(t);return{text:I?`${I} ${P}`.trim():P,levels:v,...I?{annotations:I}:{}}}function K(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function J(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function W(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function Q(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function X(e,t="—"){return null==e||""===e?t:"object"==typeof e?X(e.id??e.name??e.label,t):e+""}function Y(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Z(e){return X(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ee(e,t){let r=Q(e,t,"children");return Array.isArray(r)?r:[]}function te(e,t,r){return`${e} ${1===e?t:r}`}function re(e,t){return 0===e.numericLeaves?"":e.numericLeaves===e.leaves?", leaf total "+t(e.leafTotal):`, known leaf total ${t(e.leafTotal)} across ${te(e.numericLeaves,"valued leaf","valued leaves")}`}function ne(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function ae(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function ie(e,t="—"){return null==e||""===e?t:"object"==typeof e?ie(e.id??e.name??e.label,t):e+""}function oe(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function le(e){return ie(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function se(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 ce(e,t,r){let n=ae(e,t,r);if(void 0!==n)return n;let a=e.properties;return a&&"object"==typeof a?ae(a,t,r):void 0}function ue(e,t,r){return ie(ce(e,t,"id")??ce(e,"name","name")??ce(e,"NAME","NAME")??ce(e,"label","label"),r)}function de(e){let t=0,r=1/0,n=-1/0,a=0;for(let i of e)null!=i.value&&(t+=1,r=Math.min(r,i.value),n=Math.max(n,i.value),a+=i.value);return 0===t?null:{count:t,min:r,max:n,total:a,average:a/t}}function fe(e,t){let r=de(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function he(e,t,r,n){let a=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),i="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],o=Array.isArray(t.flows)?t.flows:[],l=Array.isArray(t.lines)?t.lines:[],s=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?a:i).map((r,n)=>({datum:r,index:n,label:ue(r,"ChoroplethMap"===e?t.idAccessor:c,`${"ChoroplethMap"===e?"region":"location"} ${n+1}`),value:oe(ce(r,s,"value"))})),d=u.filter(e=>null!=e.value),f={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${a.length} regions.${d.length>0?` Values are available for ${d.length} of ${a.length} regions; ${fe(d,n)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${o.length} flows and ${i.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${i.length} locations and ${l.length} routes.`:`A proportional-symbol map with ${i.length} locations.`}${se(t)}`,children:[]};if("ChoroplethMap"===e)f.children=function(e,t,r){let n,a=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),i=new Map,o=0;for(let[e,t]of a.entries())n!==t.value&&(o=e+1,n=t.value),i.set(t.index,o);let l=0;return function(e){let t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),n=[],a=de(t);if(a)if(a.min===a.max)n.push({id:"equal",label:"Equal values",rows:t});else{let e=a.min+(a.max-a.min)/3,r=a.min+2*(a.max-a.min)/3,i=t.filter(e=>e.value>=r),o=t.filter(t=>t.value>=e&&r>t.value),l=t.filter(t=>e>t.value);i.length>0&&n.push({id:"highest",label:"Highest values",rows:i}),o.length>0&&n.push({id:"middle",label:"Middle values",rows:o}),l.length>0&&n.push({id:"lowest",label:"Lowest values",rows:l})}return r.length>0&&n.push({id:"missing",label:"No numeric value",rows:r}),n}(e).map(e=>{let n=e.rows.slice(0,Math.max(0,t-l));l+=n.length;let o=n.map(e=>{let t=i.get(e.index),n=null==t||2>a.length?"":`, rank ${t} of ${a.length}`;return{id:`geo-${le(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?e.label+": no numeric value.":`${e.label}: ${r(e.value)}${n}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),s=e.rows.length-n.length;return s>0&&o.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${s} more ${1===s?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:"regions-"+e.id,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${fe(e.rows,r)}.`,children:o}})}(u,r,n);else if(u.length>0){let e=u.slice(0,r).map(e=>({id:`geo-${le(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":": "+n(e.value)}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),f.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}let h="FlowMap"===e?o:l;if(h.length>0){let e=h.slice(0,r).map((e,t)=>{let r=ie(e.source,"unknown"),a=ie(e.target,"unknown"),i=oe(ae(e,s,"value"));return{id:`route-${le(r)}-${le(a)}-${t}`,role:"datum",level:3,label:`${r} to ${a}${null==i?"":": "+n(i)}.`,...null==i?{}:{value:i},datum:e}});f.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${h.length} ${1===h.length?"route":"routes"}.`,children:e})}return f}function me(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function pe(e,t="—"){return null==e||""===e?t:"object"==typeof e?pe(e.id??e.name??e.label,t):e+""}function ge(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function ye(e){return pe(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ve(e,t){let r=[];return(e.linkedHover||e.selection||e.linkedBrush)&&r.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&r.push("Hover or focus a mark for its details."),r.length>0?" "+r.join(" "):""}function be(e,t){t&&e.children?.push(t)}function $e(e,t,r={}){let n=r.locale??"en",a=Math.max(1,r.maxLeaves??200),i=H(n),o=A(e,t,r.recipe);if(o)return function(e,t,r={}){let n=C(t),a=w(t),i=Math.max(1,r.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:n,config:a,locale:r.locale??"en"});let o=(m=e.navigation)&&"object"==typeof m?e.navigation:void 0,l=(o?.groupByRole?x(e,o.groupByRole):void 0)??(o?.groupBy?.[0]?x(e,o.groupBy[0])??e.dataRoles.find(e=>e.field===o.groupBy?.[0]):void 0)??S(e,["nominal","ordinal"]),s=l?k(l,a,n):void 0,c=(o?.idRole?x(e,o.idRole):void 0)??S(e,["identifier"]),u=c?k(c,a,n):void 0,d={id:"root",role:"chart",label:o?.summaryTemplate?P(o.summaryTemplate,void 0,e,a,n,{count:n.length}):`${e.name}: ${n.length} ${1===n.length?"item":"items"} represented.`,level:1,children:[]},f=0,h=(t,r,i)=>{let l=u?t[u]:void 0,s=o?.itemLabelTemplate?P(o.itemLabelTemplate,t,e,a,n,{count:n.length}):function(e,t,r,n){let a=S(t,["nominal","ordinal"]),i=t.dataRoles.filter(e=>"quantitative"===e.semanticType),o=a?k(a,r,n):void 0,l=[];o&&null!=e[o]&&l.push(e[o]+"");for(let t of i){let a=k(t,r,n);a&&null!=e[a]&&l.push(`${t.role}: ${e[a]+""}`)}return l.length>0?l.join(", "):"Data item"}(t,e,a,n);return{id:"datum-"+W(l??r),role:"datum",label:s,level:i,datum:t}};var m;if(s){let e=new Map;for(let t of n){let r=(t[s]??"Uncategorized")+"",n=e.get(r);n?n.push(t):e.set(r,[t])}d.children=[...e].map(([e,t],r)=>{let n=t.slice(0,Math.max(0,i-f));f+=n.length;let a=n.map((e,t)=>h(e,1e5*r+t,3));return t.length>n.length&&a.push({id:"more-"+W(e),role:"datum",label:`…and ${t.length-n.length} more items`,level:3}),{id:"group-"+W(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:a}})}else{let e=n.slice(0,i);d.children=e.map((e,t)=>h(e,t,2)),n.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${n.length-e.length} more items`,level:2})}return d}(o,t,{maxLeaves:a,locale:n});let l={id:"root",role:"chart",label:U(e,t,{locale:n}).text||"Chart.",level:1,children:[]},s=function(e,t){let r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;let n=et(r.filter(e=>!!e&&"object"==typeof e));if(0===n.length)return null;let a=0,i=n.slice(0,t).map(e=>{let t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+a++,role:"annotation",level:3,label:`${n=q(e),n&&n.charAt(0).toUpperCase()+n.slice(1)}${r}.`,datum:e};var n});n.length>t&&i.push({id:"annotation-"+a++,role:"annotation",level:3,label:`…and ${n.length-t} more annotations.`});let o=n.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===o?"one marked feature":o+" marked features"}.`,children:i}}(t,a);if(Ht.has(e)){let r=function(e,t,r,n){let a=Array.isArray(t.nodes)?t.nodes:[],i=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],o=t.nodeIdAccessor??t.nodeIDAccessor,l=t.sourceAccessor??"source",s=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>pe(me(e,o,"id"),"unknown"),d=(e,t)=>pe(me(e,t,""),"unknown"),f=new Set;for(let e of i)f.add(d(e,l)),f.add(d(e,s));let h=a.length>0?a:[...f].map(e=>({id:e})),m=new Map;for(let e of h)m.set(u(e),{links:0,value:0});for(let e of i){let t=d(e,l),r=d(e,s),n=ge(me(e,c,"value"))??0;for(let e of[t,r]){let t=m.get(e)??{links:0,value:0};t.links+=1,t.value+=n,m.set(e,t)}}let p={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${h.length} nodes and ${i.length} links.${ve(t,"network")}`,children:[]},g=0,y=new Map,v=t.colorBy??"group";for(let e of h){let t=pe(me(e,v,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}let b=[...y].map(([e,t],a)=>{let i=[];for(let[e,o]of t.entries()){if(g>=r)break;g+=1;let t=u(o),l=m.get(t)??{links:0,value:0},s=l.value>0?`, ${n(l.value)} total flow`:"";i.push({id:`node-${a}-${e}-${ye(t)}`,role:"datum",level:3,label:`${t}: ${l.links} ${1===l.links?"link":"links"}${s}.`,value:l.value>0?l.value:void 0,datum:o})}return{id:`nodes-${a}-${ye(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:i}});b.length>0&&p.children?.push(...b);let $=i.slice(0,r).map((e,t)=>{let r=d(e,l),a=d(e,s),i=ge(me(e,c,"value"));return{id:`link-${ye(r)}-${ye(a)}-${t}`,role:"datum",level:3,label:`${r} to ${a}${null==i?"":": "+n(i)}.`,value:i,datum:e}});return i.length>r&&$.push({id:"links-more",role:"datum",level:3,label:`…and ${i.length-r} more links.`,value:void 0}),$.length>0&&p.children?.push({id:"links",role:"series",level:2,label:`Links: ${i.length} ${1===i.length?"connection":"connections"}.`,children:$}),p}(e,t,a,i);return be(r,s),r}if(qt.has(e)){let r=function(e,t,r,n){let a=t.data&&"object"==typeof t.data?t.data:null,i=t.childrenAccessor??"children",o=t.valueAccessor??"value",l=t.nodeLabel??t.nodeIdAccessor,s=new WeakMap,c=new WeakSet,u=e=>{let t=s.get(e);if(t)return t;if(c.has(e))return{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.add(e);let r,n=ee(e,i);if(0===n.length){let t=Y(Q(e,o,"value"));r={descendants:0,depth:1,leaves:1,numericLeaves:null==t?0:1,leafTotal:t??0}}else r=n.reduce((e,t)=>{let r=u(t);return{descendants:e.descendants+1+r.descendants,depth:Math.max(e.depth,r.depth+1),leaves:e.leaves+r.leaves,numericLeaves:e.numericLeaves+r.numericLeaves,leafTotal:e.leafTotal+r.leafTotal}},{descendants:0,depth:1,leaves:0,numericLeaves:0,leafTotal:0});return c.delete(e),s.set(e,r),r},d=0,f=(e,t,a,s)=>{let c=X(Q(e,l,"name"),"item "+a);if(s.has(e))return{id:`hierarchy-${Z(a)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};let h=ee(e,i),m=u(e);if(0===h.length){if(d>=r)return null;d+=1;let i=Y(Q(e,o,"value"));return{id:`hierarchy-${Z(a)}-${Z(c)}`,role:"datum",level:t,label:`${c}${null==i?"":": "+n(i)}.`,...null==i?{}:{value:i},datum:e}}let p=new Set(s);p.add(e);let g=[],y=0;for(let[e,n]of h.entries()){if(d>=r){y+=u(n).leaves;continue}let i=f(n,t+1,`${a}-${e}`,p);i&&g.push(i)}return y>0&&g.push({id:`hierarchy-${Z(a)}-more`,role:"datum",level:t+1,label:`${te(y,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${Z(a)}-${Z(c)}`,role:"series",level:t,label:`${c}: ${te(h.length,"direct child","direct children")}, ${te(m.descendants,"total descendant","total descendants")}, ${te(m.leaves,"leaf","leaves")}${re(m,n)}.`,datum:e,children:g}},h=a?u(a):null,m={id:"root",role:"chart",level:1,label:a?`A ${ne(e)} chart with ${te(h.leaves,"leaf","leaves")} and ${te(h.descendants,"total descendant","total descendants")} across ${te(h.depth,"hierarchy level","hierarchy levels")}${re(h,n)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(a){let e=f(a,2,"root",new Set);if(e){let t=X(Q(a,l,"name"),"");m.children="series"===e.role&&""===t?e.children:[e]}}return m}(e,t,a,i);return be(r,s),r}if(Gt.has(e)){let r=he(e,t,a,i);return be(r,s),r}let c=Array.isArray(t.data)?t.data:null,u=function(e,t={},r={}){return!!A(e,t,r.recipe)||Ht.has(e)||qt.has(e)||Gt.has(e)||St.has(e)||Pt.has(e)||It.has(e)||jt.has(e)}(e,t,r);if(!c||0===c.length||!u)return s&&(l.children=[s]),l;let{measure:d,measureFallback:f,dimension:h,dimensionFallback:m}=D(e,t),p=ut(d,f),g=ft(h,m),y="string"==typeof d&&d?d:f,v="string"==typeof h&&h?h:m,b=L(t),$=0,I=e=>`${e}-${$++}`,j=(e,t)=>{let r=e.slice(0,a).map(e=>((e,t)=>{let r=p(e),n=N(g(e),i);return{id:I("datum"),role:"datum",level:t,label:`${n}: ${Number.isFinite(r)?i(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}})(e,t));return e.length>a&&r.push({id:I("more"),role:"datum",level:t,label:`…and ${e.length-a} more points`}),r},M=[];if(St.has(e)||Pt.has(e)){let t=1/0,r=-1/0,n=1/0,a=-1/0,o=[],l=!0;for(let e of c){let i=p(e);Number.isFinite(i)&&(t>i&&(t=i),i>r&&(r=i));let s=g(e);o.push(s),"number"==typeof s&&Number.isFinite(s)?(n>s&&(n=s),s>a&&(a=s)):l=!1}let s=new Set,u=[];for(let e of o){let t=e+"";s.has(t)||(s.add(t),u.push(e))}let d=l?`${i(n)} to ${i(a)}`:`${N(u[0],i)} to ${N(u[u.length-1],i)} (${Pt.has(e)?u.length+" categories":c.length+" points"})`;M.push({id:I("axis"),role:"axis",level:2,label:`${Pt.has(e)?"Category axis":"X axis"}: ${v}, ${d}.`}),r>=t&&M.push({id:I("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${i(t)} to ${i(r)}.`})}if(b){let r=ft(b,b),a=new Map;for(let e of c){let t=(r(e)??"—")+"",n=a.get(t);n?n.push(e):a.set(t,[e])}let i=[];for(let[r,o]of a){let a=U(e,{...t,data:o},{levels:["l2","l3"],locale:n}).text;i.push({id:I("series"),role:"series",level:2,label:`Series ${r}: ${a}`,children:j(o,3)})}l.children=[...M,...i]}else l.children=[...M,...j(c,2)];return s&&l.children.push(s),l}function we(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ce(e){return we(e)?e:void 0}function Ae(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function ke(e){let t=Ae(e);return null==t?void 0:Math.max(0,Math.floor(t))}function xe(...e){return e.map(Ce).find(Boolean)}function Se(...e){return e.find(Array.isArray)}function Pe(e){let t={};for(let[r,n]of Object.entries(e))void 0!==n&&(t[r]=n);return t}function Ie(e,t,r){return e["string"==typeof t&&t?t:r]}function je(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function Me(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Re(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function Oe(e,t,r){let n=e?.filter(e=>!0===Ce(e)?.sensor).length,a=Ce(t?.observation),i=Ce(a?.sensors),o=Se(r?.activeSensors);return Math.max(n??0,i?Object.keys(i).length:0,o?.length??0)||void 0}function Fe(e,t,r={}){let n,{capability:a,audience:i,locale:o}=r,l=r.levels??["l1","l2","l3"],s=!1!==r.includeStructure,c=z(e,a),u=U(e,t,{levels:c?[...l,"l4"]:l,locale:o,capability:a,audience:i}),{l4:d,...f}=u.levels,h=["l1","l2","l3"].map(e=>u.levels[e]).filter(Boolean).join(" "),m={levels:f,text:u.annotations?`${u.annotations} ${h}`.trim():h,...u.annotations?{annotations:u.annotations}:{}};if(c&&d){let e=(p=a)?"fits"in p||"buildProps"in p?{family:p.family}:{family:p.family,intentScores:p.intentScores}:{};n={act:c,sentence:d,family:e.family,intentScores:e.intentScores}}var p;let g=s?$e(e,t,{maxLeaves:r.maxLeaves,locale:o}):void 0,y=function(e,t,r){if(!1===r)return;let n=we(r)?r:void 0,a=Ce(t.physics),i=xe(n?.snapshot,a?.snapshot,t.physicsSnapshot,function(e){let t=Ce(e);return!!t&&(we(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),o=xe(n?.evidence,a?.evidence,t.physicsEvidence,t.settledEvidence),l=xe(n?.config,a?.config,i?.config,t.config),s=xe(Ce(i?.world),Ce(a?.world)),c=xe(Ce(l?.kernel),Ce(s?.options)),u=Se(s?.bodies),d=Se(s?.colliders,l?.colliders),f=Se(i?.queue,a?.queue),h=Se(i?.liveBodyOrder),m=Se(s?.springs),p=Se(i?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;let t=e.map((e,t)=>{let r=Ce(e);if(!r)return;let n=Ae(r.count??r.value??r.total??r.bodies??r.events);if(null==n)return;let a=(r.label??r.id??r.name??"container "+(t+1))+"",i=null==r.id?void 0:r.id+"",o=Ae(r.secondary??r.secondaryCount),l=Ae(r.observed??r.observedCount);return Pe({id:i,label:a,count:n,secondary:o,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:l})}).filter(e=>null!=e);if(0===t.length)return;let r=t.reduce((e,t)=>e+t.count,0),n=t.filter(e=>e.count>0).length,a=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:n,...a?{leader:a}:{}}}(function(e,t,r,n){let a=Ce(e.settledProjection),i=Ce(t?.settledProjection);return Se(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,a?.rows,t?.settledProjectionRows,t?.projectionRows,i?.rows,n?.binCounts)}(t,a,n,o)),y=function(e,t){let r=e?.map((e,t)=>{let r=Ce(e);if(!r)return;let n=Ae(r.count)??0,a=Ae(r.total),i={label:(r.label??r.id??"sediment "+(t+1))+"",count:n};return null!=r.id&&(i.id=r.id+""),null!=a&&(i.total=a),i}).filter(e=>null!=e),n=ke(t?.bins)??r?.length??0,a=Ae(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,i=Ae(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),o=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==n||0!==a||i)return{bins:n,count:a,...null!=i&&i>0?{total:i}:{},...o?{leader:o}:{}}}(Se(n?.sediment,a?.sediment,i?.sediment),xe(n?.sedimentTotals,a?.sedimentTotals)),v=h?.length??u?.length??ke(o?.bodyCount),b=function(e){if(e)return e.filter(e=>!0===Ce(e)?.sleeping).length}(u)??ke(o?.sleepingCount),$=f?.length,w="string"==typeof i?.simulationState?i.simulationState:void 0,C="boolean"==typeof o?.settled?o.settled:w?"settled"===w:null!=v||null!=b||null!=$?null!=v&&b===v&&0===($??0):void 0,A=Ce(c?.gravity),k=Ae(A?.x),x=Ae(A?.y),S=Pe({state:w,settled:C,elapsedSeconds:Ae(i?.elapsedSeconds),paused:"boolean"==typeof i?.paused?i.paused:void 0,visible:"boolean"==typeof i?.visible?i.visible:void 0,seed:Ae(c?.seed),gravity:null!=k&&null!=x?{x:k,y:x}:void 0,fixedDt:Ae(l?.fixedDt??c?.fixedDt),timeScale:Ae(l?.timeScale),maxSubsteps:ke(l?.maxSubsteps),liveBodies:v,sleepingBodies:b,queued:$,bodyLimit:Ae(l?.bodyLimit),eviction:"string"==typeof l?.eviction?l.eviction:void 0}),P=Pe({colliders:d?.length,sensors:Oe(d,l,s),springs:m?.length,activeSensorPairs:p?.length}),I=Object.keys(P).length>0,j=Ut.has(e);if(!(Object.keys(S).length>0||I||g||y)||!j&&null==r)return;let M={simulation:S,...I?{geometry:P}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},R=function(e){let t=[],r=e.simulation,n=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Me(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?r.sleepingBodies+" sleeping":void 0,null!=r.queued?r.queued+" queued":void 0,null!=r.seed?"seed "+Re(r.seed):void 0,r.gravity?`gravity (${Re(r.gravity.x)}, ${Re(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${Re(r.fixedDt)}s`:void 0,null!=r.timeScale?Re(r.timeScale)+"x time":void 0].filter(Boolean);n.length>0&&t.push(`Physics simulation: ${n.join("; ")}.`);let a=e.geometry;if(a){let e=[null!=a.colliders?`${a.colliders} ${Me(a.colliders,"collider")}`:void 0,null!=a.sensors?`${a.sensors} ${Me(a.sensors,"sensor")}`:void 0,null!=a.springs?`${a.springs} ${Me(a.springs,"spring")}`:void 0,null!=a.activeSensorPairs?`${a.activeSensorPairs} active sensor ${Me(a.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}let i=e.aggregates;if(i){let e=i.leader,r=e?` Largest is ${e.label} with ${Re(e.count)}.`:"";t.push(`Physics aggregates: ${Re(i.totalCount)} settled ${Me(i.totalCount,"body")} across ${i.rows.length} ${Me(i.rows.length,"container")}; ${i.populatedCount} populated.${r}`)}let o=e.sediment;if(o){let e=null!=o.total?", value total "+Re(o.total):"",r=o.leader?`; largest sediment bin is ${o.leader.label} with ${Re(o.leader.count)}`:"";t.push(`Physics sediment: ${o.count} retained ${Me(o.count,"body")} in ${o.bins} ${Me(o.bins,"bin")}${e}${r}.`)}return t.join(" ")}(M);return{...M,text:R}}(e,t,r.physics),v=function(e,t,r){let n=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&n.push(`Current value is ${je(t.value)}.`);let e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;n.push(`The gauge scale runs from ${je(e)} to ${je(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){let a=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&n.push(`The ProcessSankey time domain runs from ${je(t.domain[0])} to ${je(t.domain[1])}.`),a.length>0){n.push(`${a.length} source flow${1===a.length?"":"s"} are supplied.`);for(let i of a.slice(0,r)){let r=Ie(i,t.sourceAccessor,"source"),a=Ie(i,t.targetAccessor,"target"),o=Ie(i,t.valueAccessor,"value");n.push("ProcessSankey"!==e||null==i.startTime&&null==i.endTime?`${je(r)} to ${je(a)} has value ${je(o)}.`:`${je(r)} to ${je(a)} has value ${je(o)} over ${je(i.startTime)}–${je(i.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){let e=Ce(t.data),a="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",i="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",l=[],s=e=>{let t=Array.isArray(e[a])?e[a]:[];if(0!==t.length)for(let e of t){let t=Ce(e);t&&s(t)}else l.push(e)};if(e&&s(e),l.length>0){n.push(l.length+" hierarchy leaves are supplied.");for(let e of l.slice(0,r))n.push(`${je(e[o])} has value ${je(e[i])}.`)}}if(Ut.has(e)&&Array.isArray(t.data)){let r=t.data;n.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);let a="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,i="CollisionSwarmChart"===e?"x":"value",o=r.map(e=>Ae(Ie(e,a,i))).filter(e=>null!=e);o.length>0&&n.push(`Observed ${"string"==typeof a?a:i} ranges from ${je(Math.min(...o))} to ${je(Math.max(...o))}.`)}if(0!==n.length)return{source:"chart-props",statements:n,text:"Exact chart-prop facts: "+n.join(" ")}}(e,t,Math.max(1,r.maxLeaves??200)),b=[m.text,n?.sentence,y?.text,v?.text].filter(Boolean).join(" ");return{component:e,description:m,intent:n,structure:g,physics:y,facts:v,text:b}}function De(e,t){let r=e.trim();if(!r)throw Error(t+" must be a non-empty string.");return encodeURIComponent(r)}function Le(e,...t){return`${e}/${t.map(e=>De(e,"VACP ref segment")).join("/")}`}function Ne(e){let t=e.now?.()??new Date,r=t instanceof Date?t:new Date(t);if(!Number.isFinite(r.getTime()))throw Error("VACP bridge clock returned an invalid date.");return r.toISOString()}function Te(e){try{let{createdAt:t,...n}=function(e,t,r){if(r?.selections&&ot(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");let n=v(e)??b(t.recipe)??b(t.recipeId);if(n)return function(e,t,r){let n=!1!==r?.includeData,a=ot(e);if("portable"===e.portability&&a.length>0)throw Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${a.join(", ")}.`);let i=function(e,t,r){let n={};for(let[a,i]of Object.entries(e))if(null!=i&&!kt.has(a)&&"recipeId"!==a&&(t||!F(a,i))){if("function"==typeof i){if(r)throw Error(`Portable recipe prop "${a}" is not JSON-safe.`);continue}if(ot(i).length>0){if(r)throw Error(`Portable recipe prop "${a}" is not JSON-safe.`);continue}O(n,a,xt(i))}return n}(t,n,"portable"===e.portability),o=e.intents.map($).filter(e=>!!e),l=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,s=l?function(e){let t=y().layouts.get(e)?.identity;return t?{...t}:void 0}(l):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(s&&c&&(s.version!==c.version||s.fingerprint!==c.fingerprint))throw Error(`Recipe layout "${l}" registry identity does not match its portable declaration.`);let u=s??c;if("portable"===e.portability&&l&&!u)throw Error(`Portable recipe layout "${l}" must be registered with an explicit version identity.`);let d={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===a.length?{definitionFingerprint:tt(e).fingerprint}:{},...l?{layoutId:l}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},f=(new Date).toISOString();if("portable"===e.portability){if(ot(i).length>0)throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);let n={version:At,createdAt:f,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:i,manifest:d,version:At,createdAt:f,...R("ChartRecipe",r?.artifactContract,t,i,n),...r?.selections?{selections:r.selections}:{}}}let h="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."],p={version:At,createdAt:f,recipeId:e.id,portable:!1,manifest:d,reason:h,warnings:m,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:h,warnings:m,props:i,manifest:d,version:At,createdAt:f,...R("ChartRecipe",r?.artifactContract,t,i,p),...r?.selections?{selections:r.selections}:{}}}(n,t,r);if(!function(e){return wt.has(e)}(e))throw Error(`Unknown component "${e}". Known components: ${$t.join(", ")}`);let a=!1!==r?.includeData,i={};for(let[e,r]of Object.entries(t))if(null!=r&&!kt.has(e)&&(a||!F(e,r))&&"function"!=typeof r&&0>=ot(r).length)try{O(i,e,xt(r))}catch{}let o=(new Date).toISOString(),l={version:At,createdAt:o,...r?.selections?{selections:r.selections}:{}};return{component:e,props:i,version:At,createdAt:o,...R(e,r?.artifactContract,t,i,l),...r?.selections?{selections:r.selections}:{}}}(e.component,e.props,{includeData:!1});return r(n)}catch(r){let n=Object.create(null);for(let[r,a]of Object.entries(e.props)){if(Kt.includes(r)||"function"==typeof a)continue;let e=t(a);void 0!==e&&(n[r]=e)}return{component:e.component,props:n,version:"unregistered",warning:r instanceof Error?r.message:"Chart config could not be serialized by toConfig."}}}function Ee(e){return Fe(e.component,e.props,{...e.grounding,audience:e.audience,includeStructure:!0,maxLeaves:1})}function Be(e,t){let r=[];for(let n of Kt){let a=e.props[n];Array.isArray(a)&&r.push({ref:t.data(e.chartId,n),chartId:e.chartId,collection:n,rows:a})}return r}function _e(e,t){t(e);for(let r of e.children??[])_e(r,t)}function ze(e,t){if(!t)return;let r;return _e(e,e=>{!r&&e.id===t&&(r=e)}),r}function Ve(e){return null==e||"string"==typeof e||"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e||e instanceof Date&&Number.isFinite(e.getTime())}function He(e,t){if("datum"!==e.role||!e.datum)return;let r=Object.create(null);for(let n of t){if(!Object.prototype.hasOwnProperty.call(e.datum,n)||!Ve(e.datum[n]))return;r[n]=e.datum[n]instanceof Date?e.datum[n].toISOString():e.datum[n]}return r}function qe(e,t){let r=Array.from(new Set(e.matchFields.map(e=>e.trim()).filter(Boolean))),n=new Map;if(!r.length)return{valid:!1,diagnostic:"Navigation actions require at least one durable match field.",byKey:n,matchFields:r,targetRef:()=>Le(t,"target","invalid")};let a,o=0,l=0,s=!1;return _e(e.tree,e=>{if("datum"!==e.role)return;o++;let t=He(e,r);if(!t)return void l++;let a=i(t);n.has(a)?s=!0:n.set(a,e)}),o?l?a=l+" navigation leaves lack durable primitive match-field values.":s&&(a="Navigation match fields do not uniquely identify every datum leaf."):a="Navigation tree has no datum leaves.",{valid:!a,...a?{diagnostic:a}:{},byKey:n,matchFields:r,targetRef:e=>Le(t,"target",i(e))}}function Ge(t,n){let{chart:a,ref:i,configRef:o,grounding:l}=t,s=[{ref:i,kind:"Visualization",layer:"VisualizationLayer",title:a.title??(a.props.title??a.component)+"",description:a.description??l.text,data:r({component:a.component,grounding:{description:l.description,intent:l.intent,physics:l.physics,text:l.text},audience:a.audience})},{ref:o,kind:"Param",layer:"ConfigLayer",title:a.component+" configuration",description:"Serializable Semiotic chart configuration with raw data collections omitted.",data:t.config}],c=[{from:t.ref,to:o,kind:"contains"}],u=(l.structure?.children??[]).filter(e=>"axis"===e.role).map(e=>e.label),d=0;for(let[e,t]of Jt){let r=a.props[e];if("string"!=typeof r||!r.trim())continue;let n=Le(i,"encoding",t);if(s.push({ref:n,kind:"EncodingChannel",layer:"VisualizationLayer",title:`${t} → ${r}`,data:{channel:t,field:r,accessorProp:e}}),c.push({from:i,to:n,kind:"contains"}),"x"===t||"y"===t||"category"===t||"value"===t||"ordinal"===t||"radial"===t){let e=Le(i,"axis",t);s.push({ref:e,kind:"Axis",layer:"VisualizationLayer",title:u[d++]??`${t} axis: ${r}`,data:{channel:t,field:r}}),c.push({from:i,to:e,kind:"contains"}),c.push({from:e,to:n,kind:"derivedFrom"})}}for(let e of t.dataHandles)s.push({ref:e.ref,kind:"DataHandle",layer:"DataLayer",title:`${a.chartId}.${e.collection}`,description:"Bounded details-on-demand handle. Use vacp.data_schema before requesting an opt-in sample.",data:{collection:e.collection,rowCount:e.rows.length,schemaAction:bt,...n.dataAccess?.sample?{inspectAction:yt}:{}}}),c.push({from:i,to:e.ref,kind:"contains"});if(t.navigation){let{navigation:e}=t;s.push({ref:e.ref,kind:"Selection",layer:"InteractionFeedbackLayer",title:(a.title??a.component)+" structured navigation",description:e.index.diagnostic??"Active accessible-navigation target identified by durable datum fields.",data:{matchFields:e.index.matchFields,targetCount:e.index.byKey.size,status:e.index.valid?e.binding.onActiveChange?"actionable":"read-only":"ambiguous"}}),c.push({from:i,to:e.ref,kind:"contains"})}if(n.getObservations){let e=Le(i,"interaction","latest-observation");s.push({ref:e,kind:"InteractionTarget",layer:"InteractionFeedbackLayer",title:(a.title??a.component)+" latest observation",description:"Latest semantic hover, focus, selection, brush, activation, or control observation."}),c.push({from:i,to:e,kind:"contains"})}let f=Array.isArray(a.props.annotations)?a.props.annotations:[],h=new Set;for(let t of f){if(!e(t))continue;let n=e(t.provenance)?t.provenance:void 0,o=t.id??t.stableId??n?.stableId,l=null==o||""===o?void 0:o+"";if(!l)continue;let u=e(t.note)?t.note:void 0,d=e(t.noteData)?t.noteData:void 0,f=Le(i,"annotation",l);if(h.has(f))throw Error(`Duplicate stable annotation id "${l.trim()}" in VACP chart "${a.chartId}".`);h.add(f),s.push({ref:f,kind:"InteractionTarget",layer:"VisualizationLayer",title:(t.label??u?.label??d?.label??"Annotation "+l)+"",description:"string"==typeof t.note?t.note:"string"==typeof t.description?t.description:void 0,data:r({id:l,provenance:n,lifecycle:t.lifecycle})}),c.push({from:i,to:f,kind:"contains"})}return{nodes:s,edges:c}}function Ue(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.chartId===t)return n}}function Ke(e,t){let r=function(e,t){let r=function(e){let t="function"==typeof e?e():e,r=new Set;for(let e of t){let t=e.chartId.trim();if(!t)throw Error("Every VACP chart requires a non-empty chartId.");if(r.has(t))throw Error(`Duplicate VACP chartId "${t}".`);r.add(t)}return t}(e.charts).map(e=>{let r=t.visualization(e.chartId),n=e.navigation?{ref:t.navigation(e.chartId),chartRef:r,chartId:e.chartId,binding:e.navigation,index:qe(e.navigation,t.navigation(e.chartId))}:void 0;return{chart:e,ref:r,configRef:t.config(e.chartId),grounding:Ee(e),config:Te(e),dataHandles:Be(e,t),...n?{navigation:n}:{}}}),n=function(e,t){let r=new Map;for(let t of e)for(let e of t.chart.selections??[]){let n=e.name.trim();if(!n)throw Error("VACP selection names must be non-empty.");let a=r.get(n)??{fields:new Set,modes:new Set,chartRefs:new Set};for(let t of e.fields.map(e=>e.trim()))t&&a.fields.add(t);if("interval"!==e.mode&&a.modes.add("point"),"point"!==e.mode&&a.modes.add("interval"),e.clientId){if(a.clientId&&a.clientId!==e.clientId)throw Error(`Selection "${n}" declares conflicting VACP clientIds.`);a.clientId=e.clientId}a.chartRefs.add(t.ref),r.set(n,a)}return Array.from(r).sort(([e],[t])=>e.localeCompare(t)).map(([e,r])=>{if(0===r.fields.size)throw Error(`Selection "${e}" requires at least one allowlisted field.`);return{ref:t.selection(e),name:e,fields:Array.from(r.fields).sort(),modes:r.modes,clientId:r.clientId??"__semiotic-vacp__:"+e,chartRefs:Array.from(r.chartRefs)}})}(r,t),a=r.flatMap(e=>e.dataHandles),i=[{ref:t.app,kind:"App",layer:"ViewLayer",title:e.title??e.appId,description:"Semiotic application state exposed through the experimental VACP 0.1.0 bridge.",data:{provider:"semiotic",protocol:vt}},{ref:t.view,kind:"View",layer:"ViewLayer",title:e.title??e.viewId??"Semiotic charts"}],o=[{from:t.app,to:t.view,kind:"contains"}];for(let n of r){let r=Ge(n,e);i.push(...r.nodes),o.push(...r.edges),o.push({from:t.view,to:n.ref,kind:"contains"})}for(let e of n){i.push({ref:e.ref,kind:"Selection",layer:"InteractionFeedbackLayer",title:"Selection: "+e.name,description:"Named LinkedCharts selection. Agent mutations are restricted to declared fields and modes.",data:{name:e.name,fields:e.fields,modes:Array.from(e.modes).sort()}}),o.push({from:t.view,to:e.ref,kind:"contains"});for(let t of e.chartRefs)o.push({from:e.ref,to:t,kind:"controls"})}return{charts:r,selections:n,dataHandles:a,nodes:i,edges:o}}(e,t);return{...r,actions:g(r,e,t)}}function Je(e){let n=e.viewId?.trim()||"main",a=function(e,t){let r="vacp://"+De(e,"appId"),n=Le(r,"view",t),a=e=>Le(n,"visualization",e);return{app:r,view:n,visualization:a,config:e=>Le(a(e),"config"),data:(e,t="data")=>Le(a(e),"data",t),selection:e=>Le(n,"selection",e),navigation:e=>Le(a(e),"navigation"),observation:e=>Le(a(e),"interaction","latest-observation")}}(e.appId,n),l="number"==typeof e.stateCacheSize&&Number.isFinite(e.stateCacheSize)?Math.max(1,Math.floor(e.stateCacheSize)):64,u=new Map;return{version:vt,refs:a,getCapabilities:t=>{let r=Ke(e,a),n={version:vt,createdAt:Ne(e),graph:{version:vt,nodes:r.nodes,edges:r.edges,actions:r.actions.map(e=>e.descriptor)}};return t?function(e,t){let r=function(e){return{refs:o(e.refs),prefixes:o(e.prefixes),kinds:e.kinds?.length?new Set(e.kinds):void 0,layers:e.layers?.length?new Set(e.layers):void 0,includeActions:!1!==e.includeActions,includeEdges:!1!==e.includeEdges,includeNodeData:!1!==e.includeNodeData}}(t),n=e.graph.nodes.filter(e=>function(e,t){return!((t.refs?.length||t.prefixes?.length)&&!t.refs?.includes(e.ref)&&!t.prefixes?.some(t=>e.ref===t||e.ref.startsWith(t+"/")))&&(!t.kinds||t.kinds.has(e.kind))&&(!t.layers||t.layers.has(e.layer))}(e,r)).map(e=>{if(r.includeNodeData)return e;let{data:t,...n}=e;return n}),a=new Set(n.map(e=>e.ref)),i=r.includeActions?e.graph.actions.filter(e=>{if(!e.targetRef||a.has(e.targetRef))return!0;for(let t of a)if(t.startsWith(e.targetRef+"/"))return!0;return!1}):[];return{version:e.version,createdAt:e.createdAt,graph:{version:e.graph.version,nodes:n,edges:r.includeEdges?e.graph.edges.filter(e=>a.has(e.from)&&a.has(e.to)):[],actions:i}}}(n,t):n},getState:async function(t){let n=function(e,t,n){let a={},i={},o=t.getSelections?.()??{},l=t.getObservations?.()??[];for(let o of e.charts){a[o.ref]=r({component:o.chart.component,description:o.grounding.description,intent:o.grounding.intent,physics:o.grounding.physics,audience:o.chart.audience}),a[o.configRef]=o.config,i[o.ref]={component:o.chart.component,dataHandles:o.dataHandles.length};for(let e of o.dataHandles)a[e.ref]={kind:"DataHandle",collection:e.collection,rowCount:e.rows.length},i[e.ref]={rowCount:e.rows.length};if(o.navigation){let e=ze(o.navigation.binding.tree,o.navigation.binding.activeId),t=e?He(e,o.navigation.index.matchFields):void 0;a[o.navigation.ref]=r({kind:"Selection",status:o.navigation.index.valid?"ready":"ambiguous",activeRole:e?.role,activeLabel:e?.label,activeMatch:t,activeTargetRef:t?o.navigation.index.targetRef(t):void 0,diagnostic:o.navigation.index.diagnostic}),i[o.navigation.ref]={targetCount:o.navigation.index.byKey.size}}if(t.getObservations){let e=Ue(l,o.chart.chartId);a[n.observation(o.chart.chartId)]=e?r(e):null,e&&(i[n.observation(o.chart.chartId)]={type:e.type,timestamp:e.timestamp})}}for(let t of e.selections){let e=o[t.name];a[t.ref]=(e?r(e):void 0)??{name:t.name,resolution:"union",clauses:[]},i[t.ref]={active:!!e?.clauses.length,clauseCount:e?.clauses.length??0,fields:t.fields}}return{version:vt,createdAt:Ne(t),state:a,...Object.keys(i).length?{summary:i}:{}}}(Ke(e,a),e,a);if(!t)return n;let o,{snapshot:d,refs:f}=s(n,t),h="st_"+i({state:(p=d).state,...p.summary?{summary:p.summary}:{}}),m=t.since?u.get(t.since):void 0;var p;if("full"!==t.mode&&t.since&&m){let e=s(m,t).snapshot;o={version:vt,createdAt:d.createdAt,mode:"delta",token:h,baseToken:t.since,...f?{scope:{refs:f}}:{},delta:c(e,d)}}else o={version:vt,createdAt:d.createdAt,mode:"full",token:h,...f?{scope:{refs:f}}:{},snapshot:d};return((e,t)=>{for(u.has(e)&&u.delete(e),u.set(e,t);u.size>l;){let e=u.keys().next().value;if("string"!=typeof e)break;u.delete(e)}})(h,n),o},execute:async r=>{let n=r&&"string"==typeof r.callId?r.callId:"";try{if(!r||"string"!=typeof r.name||!r.name.trim())throw Error("VACP action call requires a non-empty name.");if(!n)throw Error("VACP action call requires a callId.");let i=Ke(e,a),o=i.actions.find(e=>e.descriptor.name===r.name);if(!o)return{callId:n,ok:!1,error:{message:`Unknown or currently unavailable VACP action "${r.name}".`,details:{available:i.actions.map(e=>e.descriptor.name)}}};let l=t(await o.execute(r.params));return{callId:n,ok:!0,...void 0!==l?{result:l}:{}}}catch(e){return{callId:n,ok:!1,error:{message:e instanceof Error?e.message:"VACP action failed."}}}}}}function We(e,t={}){let r=t.globalKey?.trim()||"__vacp",n=t.target??("u">typeof window?window:void 0);if(!n)return{installed:!1,globalKey:r,bridge:e,reason:`Refused to install "${r}" without a browser window or an explicit target.`,cleanup:()=>!1};if("__proto__"===r||"prototype"===r||"constructor"===r)return{installed:!1,globalKey:r,bridge:e,reason:`Refused unsafe global key "${r}".`,cleanup:()=>!1};let a=n[r];if(void 0!==a&&a!==e)return{installed:!1,globalKey:r,bridge:e,reason:`Refused to replace existing global "${r}".`,cleanup:()=>!1};try{n[r]=e}catch(t){return{installed:!1,globalKey:r,bridge:e,reason:t instanceof Error?`Could not install "${r}": ${t.message}`:`Could not install "${r}".`,cleanup:()=>!1}}return{installed:!0,globalKey:r,bridge:e,cleanup:()=>{if(n[r]!==e)return!1;try{return delete n[r]}catch{return!1}}}}import{artifactConfigurationValue as Qe,artifactDataValue as Xe,compareArtifactIdentity as Ye,createPhysicsSourceState as Ze,filterAnnotationsByStatus as et,fingerprintValue as tt,finiteNumber as rt,generateGaltonMechanicalSamples as nt,generatePhysicsPileMechanicalSamples as at,isChartDataProp as it,nonJsonValuePaths as ot,normalizedFiniteExtent as lt,readAccessor as st,requireSerializableArtifactContract as ct,resolveAccessor as ut,resolveEventDropAdmissions as dt,resolveRawAccessor as ft}from"./c-G4HCO2IQ.min.js";import"./c-I4QJ6YLM.min.js";var ht="semiotic.set_point_selection",mt="semiotic.set_interval_selection",pt="semiotic.clear_selection",gt="semiotic.activate_navigation_node",yt="semiotic.inspect_data",vt="0.1.0",bt="vacp.data_schema",$t=["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"],wt=new Set($t),Ct=Symbol.for("semiotic.chartRecipeRegistry"),At="1",kt=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"]),xt="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),St=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Pt=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),It=new Set(["PieChart","DonutChart","FunnelChart"]),jt=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Mt={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"},Rt=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Ot=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Ft=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Dt={"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"},Lt={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Nt=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Tt={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Et=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Bt=new Set(["system","agent","watcher"]),_t=new Set(["ai","agent","system","computed","dbt","great-expectations"]),zt=new Set(["rule","statistical-test","llm-inference","computed"]),Vt={"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"},Ht=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),qt=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Gt=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Ut=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Kt=["data","nodes","edges","points","areas","lines","flows"],Jt=[["xAccessor","x"],["yAccessor","y"],["categoryAccessor","category"],["valueAccessor","value"],["colorBy","color"],["sizeAccessor","size"],["lineBy","series"],["groupAccessor","group"],["oAccessor","ordinal"],["rAccessor","radial"],["sourceAccessor","source"],["targetAccessor","target"],["nodeIDAccessor","id"]];export{gt as unstable_SEMIOTIC_VACP_ACTIVATE_NAVIGATION_ACTION,pt as unstable_SEMIOTIC_VACP_CLEAR_SELECTION_ACTION,yt as unstable_SEMIOTIC_VACP_INSPECT_DATA_ACTION,mt as unstable_SEMIOTIC_VACP_SET_INTERVAL_SELECTION_ACTION,ht as unstable_SEMIOTIC_VACP_SET_POINT_SELECTION_ACTION,bt as unstable_VACP_DATA_SCHEMA_ACTION,vt as unstable_VACP_SCHEMA_VERSION,Je as unstable_createSemioticVACPBridge,We as unstable_installSemioticVACPBridge};
@@ -35,7 +35,7 @@ export { PhysicsSedimentAccumulator as unstable_PhysicsSedimentAccumulator, sedi
35
35
  export { StreamPhysicsFrame as unstable_StreamPhysicsFrame } from "./components/stream/physics/StreamPhysicsFrame";
36
36
  export { PhysicsCustomChart as unstable_PhysicsCustomChart } from "./components/charts/physics/PhysicsCustomChart";
37
37
  export { buildPhysicsNavigationTree as unstable_buildPhysicsNavigationTree, buildPhysicsSettledProjection as unstable_buildPhysicsSettledProjection, physicsObservationAnnouncement as unstable_physicsObservationAnnouncement } from "./components/stream/physics/PhysicsAccessibility";
38
- export type { PhysicsBoundsColliderOptions as UnstablePhysicsBoundsColliderOptions, PhysicsObservationEvent as UnstablePhysicsObservationEvent, PhysicsObservationEventType as UnstablePhysicsObservationEventType, PhysicsObservationRecord as UnstablePhysicsObservationRecord, PhysicsPipelineConfig as UnstablePhysicsPipelineConfig, PhysicsPipelineControlSurface as UnstablePhysicsPipelineControlSurface, PhysicsPipelineObservationOptions as UnstablePhysicsPipelineObservationOptions, PhysicsPipelineQueuedSpawnSnapshot as UnstablePhysicsPipelineQueuedSpawnSnapshot, PhysicsPipelineSnapshot as UnstablePhysicsPipelineSnapshot, PhysicsPipelineTickResult as UnstablePhysicsPipelineTickResult, PhysicsPlotBounds as UnstablePhysicsPlotBounds, PhysicsQueuedSpawn as UnstablePhysicsQueuedSpawn, PhysicsSensorObservationConfig as UnstablePhysicsSensorObservationConfig, PhysicsSimulationState as UnstablePhysicsSimulationState, PhysicsSpawnPacing as UnstablePhysicsSpawnPacing, PhysicsSpawnPacingOptions as UnstablePhysicsSpawnPacingOptions, PhysicsSpawnSpringSpec as UnstablePhysicsSpawnSpringSpec, PhysicsSpawnTimeAccessor as UnstablePhysicsSpawnTimeAccessor, PhysicsXBinColliderOptions as UnstablePhysicsXBinColliderOptions } from "./components/stream/physics/PhysicsPipelineStore";
38
+ export type { PhysicsBoundsColliderOptions as UnstablePhysicsBoundsColliderOptions, PhysicsObservationEvent as UnstablePhysicsObservationEvent, PhysicsObservationEventType as UnstablePhysicsObservationEventType, PhysicsObservationRecord as UnstablePhysicsObservationRecord, PhysicsPipelineConfig as UnstablePhysicsPipelineConfig, PhysicsPipelineControlSurface as UnstablePhysicsPipelineControlSurface, PhysicsPipelineObservationOptions as UnstablePhysicsPipelineObservationOptions, PhysicsPipelineQueuedSpawnSnapshot as UnstablePhysicsPipelineQueuedSpawnSnapshot, PhysicsPipelineSnapshot as UnstablePhysicsPipelineSnapshot, PhysicsPipelineTickResult as UnstablePhysicsPipelineTickResult, PhysicsPipelineExecution as UnstablePhysicsPipelineExecution, PhysicsPlotBounds as UnstablePhysicsPlotBounds, PhysicsQueuedSpawn as UnstablePhysicsQueuedSpawn, PhysicsSensorObservationConfig as UnstablePhysicsSensorObservationConfig, PhysicsSimulationState as UnstablePhysicsSimulationState, PhysicsSpawnPacing as UnstablePhysicsSpawnPacing, PhysicsSpawnPacingOptions as UnstablePhysicsSpawnPacingOptions, PhysicsSpawnSpringSpec as UnstablePhysicsSpawnSpringSpec, PhysicsSpawnTimeAccessor as UnstablePhysicsSpawnTimeAccessor, PhysicsXBinColliderOptions as UnstablePhysicsXBinColliderOptions } from "./components/stream/physics/PhysicsPipelineStore";
39
39
  export type { PhysicsBodyBudgetAction as UnstablePhysicsBodyBudgetAction, PhysicsBodyBudgetDecision as UnstablePhysicsBodyBudgetDecision, PhysicsBodyBudgetInput as UnstablePhysicsBodyBudgetInput, PhysicsBodyBudgetOptions as UnstablePhysicsBodyBudgetOptions, PhysicsBodyBudgetState as UnstablePhysicsBodyBudgetState } from "./components/stream/physics/PhysicsBodyBudget";
40
40
  export type { PhysicsSedimentAccessor as UnstablePhysicsSedimentAccessor, PhysicsSedimentBinSnapshot as UnstablePhysicsSedimentBinSnapshot, PhysicsSedimentColumn as UnstablePhysicsSedimentColumn, PhysicsSedimentConfig as UnstablePhysicsSedimentConfig, PhysicsSedimentHeightfieldOptions as UnstablePhysicsSedimentHeightfieldOptions, PhysicsSedimentTotals as UnstablePhysicsSedimentTotals, PhysicsSedimentValueAccessor as UnstablePhysicsSedimentValueAccessor, RunningStatsSnapshot as UnstableRunningStatsSnapshot } from "./components/stream/physics/PhysicsSediment";
41
41
  export type { PhysicsEngineAdapter as UnstablePhysicsEngineAdapter, PhysicsEngineAdapterFactory as UnstablePhysicsEngineAdapterFactory, PhysicsEngineAdapterInput as UnstablePhysicsEngineAdapterInput, PhysicsEngineCapabilities as UnstablePhysicsEngineCapabilities, PhysicsEngineDeterminism as UnstablePhysicsEngineDeterminism } from "./components/stream/physics/PhysicsEngineAdapter";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{LineChart as m}from"./c-YGZHURXZ.min.js";import"./c-RSVIHIQ4.min.js";import"./c-F5ZB5GJ6.min.js";import"./c-J6M4JHRS.min.js";import"./c-W3CE4A4S.min.js";import"./c-5D2S4RMI.min.js";import"./c-ENF72HU5.min.js";import"./c-TMOSJLT3.min.js";import"./c-AH6J4MTN.min.js";import"./c-CZF7MV67.min.js";import"./c-SRTBCRVE.min.js";import"./c-RJKEKZOO.min.js";import"./c-F3LIKINL.min.js";import"./c-VGKUEZBC.min.js";import"./c-T6UAIKBH.min.js";import"./c-OCI56QF2.min.js";import"./c-GSVCN34B.min.js";import"./c-AG7WWVIH.min.js";import"./c-G36WS6LN.min.js";import"./c-MT3WBK7M.min.js";import"./c-UC5PTTFI.min.js";import"./c-DBQ2V7CH.min.js";import"./c-QSGWX53A.min.js";import"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import"./c-VRXUB2F2.min.js";import"./c-GGISSW5E.min.js";import"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import"./c-QKHMBE2E.min.js";export{m as LineChart};
2
+ import{LineChart as m}from"./c-B7GW7IHJ.min.js";import"./c-D6HAAPTX.min.js";import"./c-RFC7UAG7.min.js";import"./c-JIMJF6F6.min.js";import"./c-G5VIJEOK.min.js";import"./c-P65V6HLO.min.js";import"./c-ORLEBW72.min.js";import"./c-QAVFOEUY.min.js";import"./c-LESEUVC5.min.js";import"./c-R2P4RR7Q.min.js";import"./c-C3TZLTZK.min.js";import"./c-AVO3Q7T7.min.js";import"./c-N3FXLRNT.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import"./c-V4XMSLC3.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-SGAURYHG.min.js";import"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import"./c-MB6CV5NC.min.js";export{m as LineChart};
@@ -13,7 +13,7 @@ import { resolveGauntletTerminalState, resolveGauntletTerminalStates } from "./c
13
13
  import { PacketFlowChart, PhysicalFlowChart } from "./components/charts/physics/PacketFlowChart";
14
14
  import { ProcessFlowChart } from "./components/charts/physics/ProcessFlowChart";
15
15
  import { physicsProcessBoundaryColliders, physicsProcessGroupSemanticItems, physicsProcessRegionSemanticItem, physicsProcessStageSemanticItems } from "./components/charts/physics/physicsProcessPrimitives";
16
- import { buildCollisionSwarmPhysics, buildEventDropPhysics, buildGaltonBoardPhysics, buildPhysicalFlowPhysics, buildPhysicsPile, buildProcessFlowPhysics } from "./components/charts/physics/physicsChartUtils";
16
+ import { buildCollisionSwarmPhysics, buildEventDropPhysics, readEventDropOccupancy, buildGaltonBoardPhysics, buildPhysicalFlowPhysics, buildPhysicsPile, buildProcessFlowPhysics } from "./components/charts/physics/physicsChartUtils";
17
17
  import StreamPhysicsFrame, { StreamPhysicsFrame as NamedStreamPhysicsFrame } from "./components/stream/physics/StreamPhysicsFrame";
18
18
  import { Tooltip, TooltipRoot, MultiLineTooltip, markTooltipChrome } from "./components/Tooltip/Tooltip";
19
19
  import { PhysicsPipelineStore } from "./components/stream/physics/PhysicsPipelineStore";
@@ -27,7 +27,7 @@ import { composePhysicsControllers, createCapacityQueueController, createPortalC
27
27
  import { createDependencyGateController, createServiceLevelController, createServiceResourcePoolController } from "./components/stream/physics/ServiceOperationsControllers";
28
28
  import { processChrome } from "./components/recipes/processChrome";
29
29
  import { absorbRegion, aggregateRegionCounts, arrivalReplay, bodyGroupSpec, capacitatedRegion, chargeGateRegion, collidersFromScales, createProcessJourneyLedger, forceFieldRegion, galtonPegs, groupCompletionRows, comparePhysicsTrace, membraneRegion, portalRegion, pressureFieldRegion, processLaneWalls, processJourneyRows, processStageLayout, describePhysicsStageGeography, physicsChargePoint, physicsDestination, physicsStageColliders, physicsStageGeography, processStageRegions, processVolumePolygons, physicsReferenceEnvelope, regionCountsToProjectionRows, routeSurfaceRegion, sedimentBake, spawnFromTokens, stageTargetInVolume, updateProcessJourney } from "./components/recipes/physics";
30
- export { BuiltInPhysicsEngineAdapter, CollisionSwarmChart, EventDropChart, GauntletChart, GaltonBoardChart, GuantletChart, PacketFlowChart, PhysicalFlowChart, PhysicsCustomChart, PhysicsPileChart, UnitPileChart, Tooltip, TooltipRoot, MultiLineTooltip, markTooltipChrome, PhysicsPipelineStore, PhysicsSedimentAccumulator, ProcessFlowChart, absorbRegion, aggregateRegionCounts, arrivalReplay, bodyGroupSpec, buildCollisionSwarmPhysics, buildEventDropPhysics, buildGaltonBoardPhysics, buildPhysicalFlowPhysics, buildPhysicsPile, buildProcessFlowPhysics, capacitatedRegion, chargeGateRegion, collidersFromScales, compilePhysicsEncoding, composePhysicsControllers, createCapacityQueueController, createDependencyGateController, createDefaultPhysicsEngineAdapter, createPortalController, createPhysicsEncodingLayout, createServiceLevelController, createServiceResourcePoolController, createProcessJourneyLedger, evaluatePhysicsBodyBudget, processChrome, forceFieldRegion, galtonPegs, groupCompletionRows, comparePhysicsTrace, planGauntletPropertyWork, membraneRegion, physicsProcessBoundaryColliders, physicsProcessGroupSemanticItems, physicsProcessRegionSemanticItem, physicsProcessStageSemanticItems, portalRegion, pressureFieldRegion, processLaneWalls, processJourneyRows, processStageLayout, describePhysicsStageGeography, physicsChargePoint, physicsDestination, physicsStageColliders, physicsStageGeography, processStageRegions, processVolumePolygons, physicsReferenceEnvelope, regionCountsToProjectionRows, replaceGauntletNegative, resolveGauntletTerminalState, resolveGauntletTerminalStates, routeSurfaceRegion, sedimentBake, sedimentHeightfield, spawnFromTokens, stageTargetInVolume, updateProcessJourney, NamedStreamPhysicsFrame as StreamPhysicsFrame };
30
+ export { BuiltInPhysicsEngineAdapter, CollisionSwarmChart, EventDropChart, GauntletChart, GaltonBoardChart, GuantletChart, PacketFlowChart, PhysicalFlowChart, PhysicsCustomChart, PhysicsPileChart, UnitPileChart, Tooltip, TooltipRoot, MultiLineTooltip, markTooltipChrome, PhysicsPipelineStore, PhysicsSedimentAccumulator, ProcessFlowChart, absorbRegion, aggregateRegionCounts, arrivalReplay, bodyGroupSpec, buildCollisionSwarmPhysics, buildEventDropPhysics, readEventDropOccupancy, buildGaltonBoardPhysics, buildPhysicalFlowPhysics, buildPhysicsPile, buildProcessFlowPhysics, capacitatedRegion, chargeGateRegion, collidersFromScales, compilePhysicsEncoding, composePhysicsControllers, createCapacityQueueController, createDependencyGateController, createDefaultPhysicsEngineAdapter, createPortalController, createPhysicsEncodingLayout, createServiceLevelController, createServiceResourcePoolController, createProcessJourneyLedger, evaluatePhysicsBodyBudget, processChrome, forceFieldRegion, galtonPegs, groupCompletionRows, comparePhysicsTrace, planGauntletPropertyWork, membraneRegion, physicsProcessBoundaryColliders, physicsProcessGroupSemanticItems, physicsProcessRegionSemanticItem, physicsProcessStageSemanticItems, portalRegion, pressureFieldRegion, processLaneWalls, processJourneyRows, processStageLayout, describePhysicsStageGeography, physicsChargePoint, physicsDestination, physicsStageColliders, physicsStageGeography, processStageRegions, processVolumePolygons, physicsReferenceEnvelope, regionCountsToProjectionRows, replaceGauntletNegative, resolveGauntletTerminalState, resolveGauntletTerminalStates, routeSurfaceRegion, sedimentBake, sedimentHeightfield, spawnFromTokens, stageTargetInVolume, updateProcessJourney, NamedStreamPhysicsFrame as StreamPhysicsFrame };
31
31
  export default StreamPhysicsFrame;
32
32
  export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig, MultiTooltipConfig, TooltipRootProps, TooltipChromeMode } from "./components/Tooltip/Tooltip";
33
33
  export type { CollisionSwarmChartProps } from "./components/charts/physics/CollisionSwarmChart";
@@ -43,7 +43,7 @@ export type { ProcessFlowChartProps, ProcessFlowProjectionMetadata, ProcessFlowS
43
43
  export type { PhysicsCustomChartProps, PhysicsCustomLayout, PhysicsCustomLayoutContext, PhysicsCustomLayoutResult, PhysicsCustomSpawnDatumResult } from "./components/charts/physics/PhysicsCustomChart";
44
44
  export type { UnitPileChartProps, PhysicsPileChartProps } from "./components/charts/physics/UnitPileChart";
45
45
  export type { CompilePhysicsEncodingOptions, CreatePhysicsEncodingLayoutOptions, PhysicsAccessibleEncoding, PhysicsAppearanceEncoding, PhysicsDynamicsEncoding, PhysicsEncoding, PhysicsEncodingAccessor, PhysicsEncodingCompilation, PhysicsEncodingConstant, PhysicsEncodingDefaults, PhysicsEncodingLayoutExtension, PhysicsKinematicsEncoding, PhysicsPlacementEncoding, PhysicsProcessEncoding, PhysicsTimeEncoding, ResolvedPhysicsEncodingRow } from "./components/charts/physics/physicsEncoding";
46
- export type { PhysicsChartLayout, CollisionSwarmPhysicsOptions, CollisionSwarmProjectionMetadata, EventDropWindowOptions, EventDropPhysicsOptions, GaltonBoardProjectionMetadata, GaltonBoardPhysicsOptions, PhysicalFlowCoordinateMode, PhysicalFlowOptions, PhysicalFlowPathConstraint, PhysicalFlowPoint, PhysicalFlowProjectionMetadata, PhysicalFlowRawPath, PhysicsPileOptions, ProcessFlowPhysicsOptions } from "./components/charts/physics/physicsChartUtils";
46
+ export type { PhysicsChartLayout, CollisionSwarmPhysicsOptions, CollisionSwarmProjectionMetadata, EventDropWindowOptions, EventDropProjectionMetadata, EventDropPhysicsOptions, GaltonBoardProjectionMetadata, GaltonBoardPhysicsOptions, PhysicalFlowCoordinateMode, PhysicalFlowOptions, PhysicalFlowPathConstraint, PhysicalFlowPoint, PhysicalFlowProjectionMetadata, PhysicalFlowRawPath, PhysicsPileOptions, ProcessFlowPhysicsOptions } from "./components/charts/physics/physicsChartUtils";
47
47
  export type { CapacityQueueAbandonedInfo, CapacityQueueAgeSummary, CapacityQueueBlockedInfo, CapacityQueueControllerOptions, CapacityQueueProcessedInfo, CapacityQueueSnapshot, CapacityQueueVisitInfo, CapacityQueueWindowSnapshot, ComposedPhysicsControllers, PhysicsController, PhysicsControllerTickContext } from "./components/stream/physics/PhysicsControllers";
48
48
  export type { DependencyGateController, ServiceLevelController, ServiceResourcePoolController } from "./components/stream/physics/ServiceOperationsControllers";
49
49
  export type { DependencyGateOptions, DependencyGateSnapshot, ServiceLevelCaseInfo, ServiceLevelCaseState, ServiceLevelControllerOptions, ServiceLevelSnapshot, ServiceResourceAssignment, ServiceResourceDefinition, ServiceResourcePoolOptions, ServiceResourcePoolSnapshot } from "./components/stream/physics/ServiceOperationsTypes";
@@ -56,7 +56,7 @@ export { PhysicsSVGOverlay, bodiesToAnnotationAnchors, buildPhysicsAnnotationCon
56
56
  export type { PhysicsAnnotationAnchorNode, PhysicsSVGOverlayProps } from "./components/stream/physics/PhysicsSVGOverlay";
57
57
  export type { PhysicsExecution } from "./components/stream/physics/PhysicsWorkerProtocol";
58
58
  export type { PhysicsEngineAdapter, PhysicsEngineAdapterFactory, PhysicsEngineAdapterInput, PhysicsEngineCapabilities, PhysicsEngineDeterminism } from "./components/stream/physics/PhysicsEngineAdapter";
59
- export type { PhysicsPipelineConfig, PhysicsPipelineControlSurface, PhysicsPlotBounds, PhysicsPipelineSnapshot, PhysicsPipelineTickResult, PhysicsQueuedSpawn, PhysicsSpawnPacing, PhysicsSpawnPacingOptions, PhysicsSpawnTimeAccessor } from "./components/stream/physics/PhysicsPipelineStore";
59
+ export type { PhysicsPipelineConfig, PhysicsPipelineControlSurface, PhysicsPlotBounds, PhysicsPipelineSnapshot, PhysicsPipelineTickResult, PhysicsPipelineExecution, PhysicsQueuedSpawn, PhysicsSpawnPacing, PhysicsSpawnPacingOptions, PhysicsSpawnTimeAccessor } from "./components/stream/physics/PhysicsPipelineStore";
60
60
  export type { PhysicsBodyBudgetAction, PhysicsBodyBudgetDecision, PhysicsBodyBudgetInput, PhysicsBodyBudgetOptions, PhysicsBodyBudgetState } from "./components/stream/physics/PhysicsBodyBudget";
61
61
  export type { PhysicsSedimentAccessor, PhysicsSedimentBinSnapshot, PhysicsSedimentColumn, PhysicsSedimentConfig, PhysicsSedimentHeightfieldOptions, PhysicsSedimentTotals, PhysicsSedimentValueAccessor, RunningStatsSnapshot } from "./components/stream/physics/PhysicsSediment";
62
62
  export type { PhysicsBodyShape, PhysicsBodySpec, PhysicsBodyState, PhysicsColliderBodyFilter, PhysicsColliderBodyFilterSpec, PhysicsColliderShape, PhysicsColliderSpec, PhysicsKernelOptions, PhysicsSpringSpec } from "./components/stream/physics/PhysicsKernel";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{registerBuiltInXYPlugins as m}from"./c-VUH4PGZY.min.js";import{RealtimeHeatmap as i,RealtimeHistogram as r,RealtimeLineChart as o,RealtimeSwarmChart as t,RealtimeWaterfallChart as s,ReorderBuffer as p,RunningStats as c,TemporalHistogram as j,WindowAccumulator as n,bandBounds as G,parseWindowDuration as V,statValue as E}from"./c-GYOQCEFP.min.js";import"./c-A4WRGZFX.min.js";import"./c-VUBQNQJH.min.js";import"./c-I6J3FEZE.min.js";import{StreamXYFrame_default as H}from"./c-J6M4JHRS.min.js";import"./c-W3CE4A4S.min.js";import"./c-5D2S4RMI.min.js";import"./c-ENF72HU5.min.js";import"./c-TMOSJLT3.min.js";import"./c-AH6J4MTN.min.js";import"./c-CZF7MV67.min.js";import"./c-3VVKFA4M.min.js";import"./c-G3VYMHKE.min.js";import{IncrementalExtent as S}from"./c-SRTBCRVE.min.js";import{RingBuffer as B}from"./c-RJKEKZOO.min.js";import"./c-F3LIKINL.min.js";import"./c-VGKUEZBC.min.js";import"./c-T6UAIKBH.min.js";import{StreamNetworkFrame_default as F}from"./c-ALYR5LKK.min.js";import"./c-6HRB2L7H.min.js";import"./c-OCI56QF2.min.js";import"./c-5JWCTX3G.min.js";import"./c-54IRWOGM.min.js";import"./c-GSVCN34B.min.js";import"./c-AG7WWVIH.min.js";import"./c-G36WS6LN.min.js";import"./c-MT3WBK7M.min.js";import"./c-UC5PTTFI.min.js";import"./c-DBQ2V7CH.min.js";import"./c-QSGWX53A.min.js";import"./c-VPZDY5Q4.min.js";import{DEFAULT_LIFECYCLE_THRESHOLDS as K,MultiLineTooltip as M,MultiPointTooltip as R,Tooltip as C,TooltipRoot as Q,bandFromAge as W,compileMotionEncoding as I,deriveMotionVector as T,markTooltipChrome as A,opacityFromAge as J,resolveMotionAccessor as N,resolveMotionVector as f}from"./c-VN2HG5BS.min.js";import"./c-GR6MOEQC.min.js";import"./c-VRXUB2F2.min.js";import"./c-GGISSW5E.min.js";import"./c-EGR6VYBW.min.js";import"./c-PGKQGGQ2.min.js";import"./c-QKHMBE2E.min.js";export{K as DEFAULT_LIFECYCLE_THRESHOLDS,S as IncrementalExtent,M as MultiLineTooltip,R as MultiPointTooltip,i as RealtimeHeatmap,r as RealtimeHistogram,o as RealtimeLineChart,t as RealtimeSwarmChart,s as RealtimeWaterfallChart,p as ReorderBuffer,B as RingBuffer,c as RunningStats,F as StreamNetworkFrame,H as StreamXYFrame,j as TemporalHistogram,C as Tooltip,Q as TooltipRoot,n as WindowAccumulator,G as bandBounds,W as bandFromAge,I as compileMotionEncoding,T as deriveMotionVector,A as markTooltipChrome,J as opacityFromAge,V as parseWindowDuration,m as registerBuiltInXYPlugins,N as resolveMotionAccessor,f as resolveMotionVector,E as statValue};
2
+ import{registerBuiltInXYPlugins as m}from"./c-WWCW3APR.min.js";import{RealtimeHeatmap as i,RealtimeHistogram as r,RealtimeLineChart as o,RealtimeSwarmChart as t,RealtimeWaterfallChart as s,ReorderBuffer as p,RunningStats as c,TemporalHistogram as j,WindowAccumulator as n,bandBounds as V,parseWindowDuration as O,statValue as E}from"./c-A7OGOFSL.min.js";import"./c-J6DVC236.min.js";import"./c-WCBRPILW.min.js";import"./c-E72OTUZU.min.js";import{StreamXYFrame_default as C}from"./c-JIMJF6F6.min.js";import"./c-G5VIJEOK.min.js";import"./c-P65V6HLO.min.js";import"./c-ORLEBW72.min.js";import"./c-QAVFOEUY.min.js";import"./c-LESEUVC5.min.js";import"./c-R2P4RR7Q.min.js";import"./c-NHBL4J67.min.js";import"./c-SJMWU6UX.min.js";import{IncrementalExtent as J}from"./c-C3TZLTZK.min.js";import"./c-AVO3Q7T7.min.js";import{RingBuffer as L}from"./c-N3FXLRNT.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import{StreamNetworkFrame_default as N}from"./c-N5NPTJVJ.min.js";import"./c-MVR3RWF3.min.js";import"./c-V4XMSLC3.min.js";import"./c-PSKKFZNP.min.js";import"./c-KKPMHAZC.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-SGAURYHG.min.js";import"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{DEFAULT_LIFECYCLE_THRESHOLDS as P,MultiLineTooltip as T,MultiPointTooltip as U,Tooltip as W,TooltipRoot as K,bandFromAge as S,compileMotionEncoding as F,deriveMotionVector as R,markTooltipChrome as M,opacityFromAge as A,resolveMotionAccessor as G,resolveMotionVector as f}from"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import"./c-MB6CV5NC.min.js";export{P as DEFAULT_LIFECYCLE_THRESHOLDS,J as IncrementalExtent,T as MultiLineTooltip,U as MultiPointTooltip,i as RealtimeHeatmap,r as RealtimeHistogram,o as RealtimeLineChart,t as RealtimeSwarmChart,s as RealtimeWaterfallChart,p as ReorderBuffer,L as RingBuffer,c as RunningStats,N as StreamNetworkFrame,C as StreamXYFrame,j as TemporalHistogram,W as Tooltip,K as TooltipRoot,n as WindowAccumulator,V as bandBounds,S as bandFromAge,F as compileMotionEncoding,R as deriveMotionVector,M as markTooltipChrome,A as opacityFromAge,O as parseWindowDuration,m as registerBuiltInXYPlugins,G as resolveMotionAccessor,f as resolveMotionVector,E as statValue};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{useCallback as e,useEffect as n,useMemo as r,useRef as t,useState as u}from"react";var s=Symbol("semiotic.useStreamStatus.wrapped");function o(o={}){const{staleThresholdMs:a=5e3,pollIntervalMs:l=1e3}=o,c=t(null),[i,f]=u("idle"),[h,p]=u(null),m=e(()=>{const e="undefined"!=typeof performance?performance.now():Date.now();c.current=e,p(e),f(e=>"active"===e?e:"active")},[]),d=r(()=>{const e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(n){const r=e._frame;if(r&&r!==n&&e._origPush&&e._origPushMany&&(r.push=e._origPush,r.pushMany=e._origPushMany,delete r[s]),e._frame=n,!n)return e._origPush=null,void(e._origPushMany=null);if(n[s])return;n[s]=!0;const t=n.push,u=n.pushMany,o=t.bind(n),a=u.bind(n);e._origPush=t,e._origPushMany=u,n.push=e=>(m(),o(e)),n.pushMany=e=>(e&&e.length>0&&m(),a(e))}}},[m]);return n(()=>{const e=setInterval(()=>{const e=c.current;if(null==e)return;const n=("undefined"!=typeof performance?performance.now():Date.now())-e>a;f(e=>{const r=n?"stale":"active";return e===r?e:r})},l);return()=>clearInterval(e)},[a,l]),{ref:d,status:i,lastPushTime:h}}import{useEffect as a,useMemo as l,useRef as c}from"react";function i(e,n,r,t){const u=new Map;r.forEach((e,n)=>{u.set(t?t(e,n):n+"",e)});const s=[];n.forEach((e,n)=>{u.has(n)||s.push(n)}),s.length>0&&e.remove?.(s);const o=[];if(u.forEach((r,t)=>{const u=n.get(t);void 0===u?o.push(r):u!==r&&(e.update?e.update(t,()=>r):(e.remove?.(t),o.push(r)))}),o.length>0)if(e.pushMany)e.pushMany(o);else if(e.push)for(const n of o)e.push(n);return u}function f(e,n,r={}){const{id:t,resetKey:u}=r,s=l(()=>function(e){return null==e?null:"function"==typeof e?(n,r)=>{const t=e(n,r);return null==t?r+"":t+""}:(n,r)=>{const t=n[e];return null==t?r+"":t+""}}(t),[t]),o=c({map:new Map,handle:null,resetKey:void 0});a(()=>{const r=e.current;if(!r)return;const t=o.current;t.handle===r&&t.resetKey===u||(r.clear?.(),t.map=new Map,t.handle=r,t.resetKey=u),t.map=i(r,t.map,n,s)},[e,n,s,u])}export{i as syncPushBuffer,o as useStreamStatus,f as useSyncedPushData};
2
+ function e(e={}){let{staleThresholdMs:r=5e3,pollIntervalMs:t=1e3}=e,i=a(null),[h,p]=s("idle"),[f,c]=s(null),m=n(()=>{let e="u">typeof performance?performance.now():Date.now();i.current=e,c(e),p(e=>"active"===e?e:"active")},[]),y=l(()=>{let e={_frame:null,_origPush:null,_origPushMany:null};return{get current(){return e._frame},set current(r){let t=e._frame;if(t&&t!==r&&e._origPush&&e._origPushMany&&(t.push=e._origPush,t.pushMany=e._origPushMany,delete t[o]),e._frame=r,!r)return e._origPush=null,void(e._origPushMany=null);if(r[o])return;r[o]=!0;let n=r.push,u=r.pushMany,l=n.bind(r),a=u.bind(r);e._origPush=n,e._origPushMany=u,r.push=e=>(m(),l(e)),r.pushMany=e=>(e&&e.length>0&&m(),a(e))}}},[m]);return u(()=>{let e=setInterval(()=>{let e=i.current;if(null==e)return;let t=("u">typeof performance?performance.now():Date.now())-e>r;p(e=>{let r=t?"stale":"active";return e===r?e:r})},t);return()=>clearInterval(e)},[r,t]),{ref:y,status:h,lastPushTime:f}}function r(e,r,t,n){let u=new Map;t.forEach((e,r)=>{u.set(n?n(e,r):r+"",e)});let l=[];r.forEach((e,r)=>{u.has(r)||l.push(r)}),l.length>0&&e.remove?.(l);let a=[];if(u.forEach((t,n)=>{let u=r.get(n);void 0===u?a.push(t):u!==t&&(e.update?e.update(n,()=>t):(e.remove?.(n),a.push(t)))}),a.length>0)if(e.pushMany)e.pushMany(a);else if(e.push)for(let r of a)e.push(r);return u}function t(e,t,n={}){let{id:u,resetKey:l}=n,a=h(()=>function(e){return null==e?null:"function"==typeof e?(r,t)=>{let n=e(r,t);return null==n?t+"":n+""}:(r,t)=>{let n=r[e];return null==n?t+"":n+""}}(u),[u]),s=p({map:new Map,handle:null,resetKey:void 0});i(()=>{let n=e.current;if(!n)return;let u=s.current;(u.handle!==n||u.resetKey!==l)&&(n.clear?.(),u.map=new Map,u.handle=n,u.resetKey=l),u.map=r(n,u.map,t,a)},[e,t,a,l])}import{useCallback as n,useEffect as u,useMemo as l,useRef as a,useState as s}from"react";var o=Symbol("semiotic.useStreamStatus.wrapped");import{useEffect as i,useMemo as h,useRef as p}from"react";export{r as syncPushBuffer,e as useStreamStatus,t as useSyncedPushData};