semiotic 3.9.2 → 3.10.0
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.
- package/README.md +99 -74
- package/agent-skill/semiotic-charts/SKILL.md +13 -7
- package/ai/artifact-contract-reference.md +408 -0
- package/ai/artifact-surface-inventory.json +5586 -0
- package/ai/behaviorContracts.cjs +24 -2
- package/ai/cli.js +480 -56
- package/ai/dist/mcp-server.js +68 -68
- package/ai/examples.md +1 -1
- package/ai/reference.md +31 -14
- package/ai/schema.json +1868 -438
- package/ai/surface-manifest.json +11 -4
- package/ai/system-prompt.md +2 -0
- package/ai/task-packets/compare-category-totals.json +301 -0
- package/ai/task-packets/compare-category-totals.md +188 -0
- package/ai/task-packets/correct-published-chart.json +271 -0
- package/ai/task-packets/correct-published-chart.md +597 -0
- package/ai/task-packets/index.json +40 -0
- package/ai/task-packets/update-live-chart.json +289 -0
- package/ai/task-packets/update-live-chart.md +424 -0
- package/dist/c-2N7IU2NY.min.js +1 -0
- package/dist/c-2WK7YJLL.min.js +1 -0
- package/dist/c-33QOXEUG.min.js +1 -0
- package/dist/c-42PLDTX7.min.js +1 -0
- package/dist/c-447VIMRO.min.js +1 -0
- package/dist/c-4FN7Q6VQ.min.js +1 -0
- package/dist/c-553QUDKA.min.js +1 -0
- package/dist/c-55BAJ333.min.js +1 -0
- package/dist/c-7242NXSG.min.js +1 -0
- package/dist/c-7EGHJU2F.min.js +1 -0
- package/dist/c-7HP7MB2I.min.js +1 -0
- package/dist/c-7NBU5ZKS.min.js +1 -0
- package/dist/c-AFBSWT77.min.js +1 -0
- package/dist/c-AJ7EC32V.min.js +1 -0
- package/dist/c-AQADQNY7.min.js +1 -0
- package/dist/c-ATM475SA.min.js +1 -0
- package/dist/c-AVO3Q7T7.min.js +1 -0
- package/dist/c-AZKPVBOC.min.js +1 -0
- package/dist/c-BNFJMDHN.min.js +1 -0
- package/dist/c-BNG5ECK5.min.js +1 -0
- package/dist/c-BOHCQILI.min.js +1 -0
- package/dist/c-CCTGN5CK.min.js +1 -0
- package/dist/c-CPSPZH6A.min.js +1 -0
- package/dist/c-CPV4N35K.min.js +1 -0
- package/dist/c-D6HAAPTX.min.js +1 -0
- package/dist/c-DE5Q3U2X.min.js +1 -0
- package/dist/c-DK662R77.min.js +1 -0
- package/dist/c-DY2676CR.min.js +1 -0
- package/dist/c-E32M6XW5.min.js +1 -0
- package/dist/c-E4JDJH4I.min.js +1 -0
- package/dist/c-E7I2L7CU.min.js +1 -0
- package/dist/c-EBOQ7ER7.min.js +1 -0
- package/dist/c-ELDWAO2V.min.js +1 -0
- package/dist/c-EUBTECGM.min.js +1 -0
- package/dist/c-GNTXRXRN.min.js +1 -0
- package/dist/c-GSZRZRD6.min.js +1 -0
- package/dist/c-GWX7JGMF.min.js +1 -0
- package/dist/c-GXV3C3MO.min.js +1 -0
- package/dist/c-HHTK2R75.min.js +1 -0
- package/dist/c-HLLFJYTY.min.js +1 -0
- package/dist/c-HPOYKCCG.min.js +1 -0
- package/dist/c-HXDKPIKR.min.js +1 -0
- package/dist/c-I4QJ6YLM.min.js +1 -0
- package/dist/c-IDJV3CZK.min.js +1 -0
- package/dist/c-ITKX3RC5.min.js +1 -0
- package/dist/c-JG2JCQLP.min.js +1 -0
- package/dist/c-JLGRHXGZ.min.js +1 -0
- package/dist/c-JO2UGTCP.min.js +1 -0
- package/dist/c-JUKIWTBJ.min.js +1 -0
- package/dist/c-KCRJGUHP.min.js +1 -0
- package/dist/c-LMGSSD2E.min.js +1 -0
- package/dist/c-LYQMZMZQ.min.js +1 -0
- package/dist/c-LYVKDBQJ.min.js +1 -0
- package/dist/c-MVR3RWF3.min.js +1 -0
- package/dist/c-MXCP7GNZ.min.js +1 -0
- package/dist/c-NG7BLZTR.min.js +1 -0
- package/dist/c-NYZ2QNAM.min.js +1 -0
- package/dist/c-OO5QLMJC.min.js +1 -0
- package/dist/c-OOVX2JPQ.min.js +1 -0
- package/dist/c-ORLEBW72.min.js +1 -0
- package/dist/c-P65V6HLO.min.js +1 -0
- package/dist/c-PP6VY3QU.min.js +1 -0
- package/dist/c-PRIKOLTE.min.js +1 -0
- package/dist/c-PSNI6KAZ.min.js +1 -0
- package/dist/c-PYNW54D2.min.js +1 -0
- package/dist/c-QA3HMQJP.min.js +1 -0
- package/dist/c-ROEHCIGV.min.js +1 -0
- package/dist/c-S3AZX5PP.min.js +1 -0
- package/dist/c-T2V7O2LO.min.js +1 -0
- package/dist/c-TIXX5CAU.min.js +1 -0
- package/dist/c-TKG2NP7G.min.js +1 -0
- package/dist/c-VJTDST2R.min.js +1 -0
- package/dist/c-VXLOLYTO.min.js +1 -0
- package/dist/c-W4ZUKSEQ.min.js +1 -0
- package/dist/c-WH2O53VI.min.js +1 -0
- package/dist/c-WNGH47HF.min.js +1 -0
- package/dist/c-WUWXGQYA.min.js +1 -0
- package/dist/c-XDQKXPX4.min.js +1 -0
- package/dist/{c-CKLIFCGN.min.js → c-XSB27XPS.min.js} +1 -1
- package/dist/c-YDECTEUW.min.js +1 -0
- package/dist/c-YF3YKVQI.min.js +1 -0
- package/dist/c-YLZIV3VS.min.js +1 -0
- package/dist/c-ZYPXQF7B.min.js +1 -0
- package/dist/components/Annotation.d.ts +2 -1
- package/dist/components/ai/chartRecipeRegistry.d.ts +6 -1
- package/dist/components/ai/chartRecipes.d.ts +4 -0
- package/dist/components/ai/describePhysicsProjection.d.ts +18 -0
- package/dist/components/ai/describePhysicsSource.d.ts +13 -0
- package/dist/components/artifact/ArtifactInspector.d.ts +26 -0
- package/dist/components/artifact/ArtifactInspectorContextSections.d.ts +18 -0
- package/dist/components/artifact/artifactContractDiff.d.ts +8 -0
- package/dist/components/artifact/artifactInspectorSummary.d.ts +53 -0
- package/dist/components/artifact/artifactRevision.d.ts +54 -0
- package/dist/components/artifact/artifactTestFixtures.d.ts +17 -0
- package/dist/components/artifact/attachmentAudit.d.ts +13 -0
- package/dist/components/artifact/claimCorrections.d.ts +3 -0
- package/dist/components/artifact/claimGraph.d.ts +5 -0
- package/dist/components/artifact/claimLifecycle.d.ts +32 -0
- package/dist/components/artifact/claims.d.ts +24 -0
- package/dist/components/artifact/collection.d.ts +10 -0
- package/dist/components/artifact/collectionCorrectionScope.d.ts +4 -0
- package/dist/components/artifact/collectionImpact.d.ts +11 -0
- package/dist/components/artifact/collectionLineage.d.ts +3 -0
- package/dist/components/artifact/collectionOperations.d.ts +8 -0
- package/dist/components/artifact/collectionPolicy.d.ts +22 -0
- package/dist/components/artifact/collectionTypes.d.ts +117 -0
- package/dist/components/artifact/configurationRepair.d.ts +8 -0
- package/dist/components/artifact/contract.d.ts +30 -0
- package/dist/components/artifact/evaluateArtifact.d.ts +12 -0
- package/dist/components/artifact/evaluateArtifactTypes.d.ts +78 -0
- package/dist/components/artifact/evaluationPresentation.d.ts +9 -0
- package/dist/components/artifact/evidenceSample.d.ts +8 -0
- package/dist/components/artifact/exportPaths.d.ts +8 -0
- package/dist/components/artifact/fieldPolicies.d.ts +12 -0
- package/dist/components/artifact/fingerprint.d.ts +36 -0
- package/dist/components/artifact/grounding.d.ts +51 -0
- package/dist/components/artifact/groundingBudget.d.ts +38 -0
- package/dist/components/artifact/hostTransfer.d.ts +13 -0
- package/dist/components/artifact/identity.d.ts +19 -0
- package/dist/components/artifact/inheritance.d.ts +48 -0
- package/dist/components/artifact/inheritanceIntegrity.d.ts +3 -0
- package/dist/components/artifact/jsonCompatibility.d.ts +2 -0
- package/dist/components/artifact/obligations.d.ts +3 -0
- package/dist/components/artifact/policies.d.ts +45 -0
- package/dist/components/artifact/policyRelations.d.ts +3 -0
- package/dist/components/artifact/recordProjection.d.ts +7 -0
- package/dist/components/artifact/representation.d.ts +50 -0
- package/dist/components/artifact/serialization.d.ts +40 -0
- package/dist/components/artifact/temporal.d.ts +32 -0
- package/dist/components/artifact/temporalAdapters.d.ts +75 -0
- package/dist/components/artifact/temporalAuditHelpers.d.ts +12 -0
- package/dist/components/artifact/temporalPresentation.d.ts +8 -0
- package/dist/components/artifact/types.d.ts +341 -0
- package/dist/components/artifact/validation.d.ts +13 -0
- package/dist/components/artifact/validationFieldStatus.d.ts +7 -0
- package/dist/components/artifact/validationPrimitives.d.ts +24 -0
- package/dist/components/artifact/validationSurfaces.d.ts +7 -0
- package/dist/components/artifact/validationTemporal.d.ts +3 -0
- package/dist/components/charts/geo/FlowMap.d.ts +7 -0
- package/dist/components/charts/geo/flowMapLineStyle.d.ts +18 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +2 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +2 -0
- package/dist/components/charts/ordinal/RadarChart.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
- package/dist/components/charts/physics/EventDropChart.d.ts +3 -1
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +4 -2
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +6 -0
- package/dist/components/charts/physics/UnitPileChart.d.ts +2 -1
- package/dist/components/charts/physics/collisionSwarmPacking.d.ts +14 -0
- package/dist/components/charts/physics/collisionSwarmPhysics.d.ts +1 -0
- package/dist/components/charts/physics/eventDropAdmission.d.ts +32 -0
- package/dist/components/charts/physics/eventDropPhysics.d.ts +22 -1
- package/dist/components/charts/physics/galtonBoardPhysics.d.ts +2 -9
- package/dist/components/charts/physics/physicsChartReconcile.d.ts +4 -0
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsGaltonData.d.ts +10 -0
- package/dist/components/charts/physics/physicsHocHandle.d.ts +2 -0
- package/dist/components/charts/physics/physicsPileData.d.ts +11 -0
- package/dist/components/charts/physics/physicsPilePhysics.d.ts +5 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +1 -1
- package/dist/components/charts/physics/physicsSourceRows.d.ts +8 -0
- package/dist/components/charts/physics/usePhysicsChartData.d.ts +19 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +14 -6
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +4 -0
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeAccessors.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +8 -7
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +7 -0
- package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +17 -11
- package/dist/components/charts/shared/GaugeReadout.d.ts +9 -0
- package/dist/components/charts/shared/ThresholdAnnotation.d.ts +18 -0
- package/dist/components/charts/shared/ThresholdEndCap.d.ts +7 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +4 -2
- package/dist/components/charts/shared/numericTickFormatter.d.ts +2 -0
- package/dist/components/charts/shared/radialCenterContent.d.ts +10 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +1 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +4 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +7 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +7 -0
- package/dist/components/charts/xy/MinimapChart.d.ts +7 -0
- package/dist/components/charts/xy/MultiAxisLineChart.d.ts +7 -0
- package/dist/components/charts/xy/ScatterplotMatrix.d.ts +6 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +8 -0
- package/dist/components/charts/xy/differenceMarkStyle.d.ts +28 -0
- package/dist/components/charts/xy/multiAxisFields.d.ts +23 -0
- package/dist/components/charts/xy/scatterplotMatrixCells.d.ts +50 -0
- package/dist/components/evidence/chartEvidenceEnvelope.d.ts +16 -8
- package/dist/components/evidence/evidenceEnvelopeInput.d.ts +8 -0
- package/dist/components/evidence/evidenceEnvelopeValidation.d.ts +11 -0
- package/dist/components/evidence/evidenceGate.d.ts +3 -1
- package/dist/components/evidence/renderedSceneHash.d.ts +23 -0
- package/dist/components/evidence/stableJsonHash.d.ts +4 -0
- package/dist/components/export/chartConfig.d.ts +40 -5
- package/dist/components/export/chartConfigArtifact.d.ts +6 -0
- package/dist/components/legendLayout.d.ts +18 -0
- package/dist/components/legendStyles.d.ts +4 -0
- package/dist/components/recipes/firstAvailableTrack.d.ts +17 -0
- package/dist/components/recipes/intervals.d.ts +1 -1
- package/dist/components/semiotic-ai-core.d.ts +33 -22
- package/dist/components/semiotic-ai.d.ts +15 -3
- package/dist/components/semiotic-artifact-react.d.ts +10 -0
- package/dist/components/semiotic-artifact.d.ts +23 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-physics.d.ts +4 -4
- package/dist/components/semiotic-text.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +18 -18
- package/dist/components/semiotic.d.ts +3 -3
- package/dist/components/server/renderEvidence.d.ts +12 -0
- package/dist/components/server/renderToStaticSVG.d.ts +3 -0
- package/dist/components/server/staticSVGChrome.d.ts +1 -4
- package/dist/components/server/staticXYAxisTicks.d.ts +2 -38
- package/dist/components/server/staticXYGrid.d.ts +1 -1
- package/dist/components/server/svgSizing.d.ts +6 -0
- package/dist/components/shared/svgRoot.d.ts +17 -0
- package/dist/components/store/selectionProvenance.d.ts +6 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +4 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -0
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +4 -0
- package/dist/components/stream/SVGOverlay.d.ts +4 -0
- package/dist/components/stream/SceneToSVG.d.ts +4 -19
- package/dist/components/stream/SceneToSVGXY.d.ts +13 -0
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -2
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -2
- package/dist/components/stream/XYGrid.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +0 -1
- package/dist/components/stream/hitTestUtils.d.ts +2 -0
- package/dist/components/stream/overlayAccessibleText.d.ts +18 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +1 -1
- package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +5 -4
- package/dist/components/stream/physics/PhysicsPipelineTypes.d.ts +9 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +3 -0
- package/dist/components/stream/physics/physicsCanvasCoordinates.d.ts +5 -0
- package/dist/components/stream/physics/physicsFixedPosition.d.ts +16 -0
- package/dist/components/stream/physics/physicsKernelCloning.d.ts +6 -0
- package/dist/components/stream/physics/physicsPipelineObservations.d.ts +2 -0
- package/dist/components/stream/physics/physicsPipelineSettle.d.ts +15 -9
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +8 -17
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +9 -0
- package/dist/components/stream/pipelineConfig.d.ts +4 -0
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +1 -1
- package/dist/components/stream/resolveXYAxes.d.ts +13 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +2 -1
- package/dist/components/stream/seriesGeometry.d.ts +13 -0
- package/dist/components/stream/streamEncodingTypes.d.ts +53 -0
- package/dist/components/stream/types.d.ts +4 -53
- package/dist/components/stream/useGeoFrameHandle.d.ts +16 -0
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +15 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +15 -0
- package/dist/components/stream/xyAxisTicks.d.ts +25 -0
- package/dist/components/stream/xyDateTicks.d.ts +3 -2
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xySceneBuilders/ribbonScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +1 -0
- package/dist/components/text/annotationTextLayout.d.ts +28 -0
- package/dist/components/text/pretextAnnotationLayout.d.ts +29 -0
- package/dist/components/text/usePretextAnnotations.d.ts +12 -0
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +33 -22
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +2 -0
- package/dist/semiotic-ai.d.ts +15 -3
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact-react.d.ts +10 -0
- package/dist/semiotic-artifact-react.min.js +2 -0
- package/dist/semiotic-artifact-react.module.min.js +2 -0
- package/dist/semiotic-artifact.d.ts +23 -0
- package/dist/semiotic-artifact.min.js +1 -0
- package/dist/semiotic-artifact.module.min.js +1 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-client-glyph.module.min.js +1 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-physics.d.ts +4 -4
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.d.ts +2 -0
- package/dist/semiotic-text.min.js +2 -0
- package/dist/semiotic-text.module.min.js +2 -0
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +18 -18
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.d.ts +3 -3
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +55 -14
- package/spec/README.md +8 -3
- package/spec/v0.1/artifact-contract.schema.json +2299 -0
- package/spec/v0.1/examples/artifact-contract-full.json +369 -0
- package/spec/v0.1/examples/artifact-contract-unknown-state.json +46 -0
- package/dist/c-3BLJEQNG.min.js +0 -1
- package/dist/c-3SCUN5HI.min.js +0 -1
- package/dist/c-3VVKFA4M.min.js +0 -1
- package/dist/c-43TJZS3F.min.js +0 -1
- package/dist/c-4DTZPSUD.min.js +0 -1
- package/dist/c-4ES5367Y.min.js +0 -1
- package/dist/c-52TEGIUJ.min.js +0 -1
- package/dist/c-54IRWOGM.min.js +0 -1
- package/dist/c-5D2S4RMI.min.js +0 -1
- package/dist/c-5JWCTX3G.min.js +0 -1
- package/dist/c-6CMMSN6N.min.js +0 -1
- package/dist/c-6HRB2L7H.min.js +0 -1
- package/dist/c-6O5EVOPH.min.js +0 -1
- package/dist/c-7W4SV36A.min.js +0 -1
- package/dist/c-A4WRGZFX.min.js +0 -1
- package/dist/c-AG7WWVIH.min.js +0 -1
- package/dist/c-AH6J4MTN.min.js +0 -1
- package/dist/c-AKAF6JAD.min.js +0 -1
- package/dist/c-ALYR5LKK.min.js +0 -1
- package/dist/c-BBKITSXB.min.js +0 -1
- package/dist/c-BYDPC44I.min.js +0 -1
- package/dist/c-CFFIU2MW.min.js +0 -1
- package/dist/c-CGNHBHCE.min.js +0 -1
- package/dist/c-CJYSXIFV.min.js +0 -1
- package/dist/c-CZF7MV67.min.js +0 -1
- package/dist/c-D53OKBSY.min.js +0 -1
- package/dist/c-DADXPJXV.min.js +0 -1
- package/dist/c-DBQ2V7CH.min.js +0 -1
- package/dist/c-DPMVAUAW.min.js +0 -1
- package/dist/c-ECJCKLYY.min.js +0 -1
- package/dist/c-EGATGOWJ.min.js +0 -1
- package/dist/c-EGR6VYBW.min.js +0 -1
- package/dist/c-ESNR43AN.min.js +0 -1
- package/dist/c-F3LIKINL.min.js +0 -1
- package/dist/c-F5ZB5GJ6.min.js +0 -1
- package/dist/c-G36WS6LN.min.js +0 -1
- package/dist/c-G3VYMHKE.min.js +0 -1
- package/dist/c-GGISSW5E.min.js +0 -1
- package/dist/c-GR6MOEQC.min.js +0 -1
- package/dist/c-GSVCN34B.min.js +0 -1
- package/dist/c-GYOQCEFP.min.js +0 -1
- package/dist/c-H3DNMTCC.min.js +0 -1
- package/dist/c-I6J3FEZE.min.js +0 -1
- package/dist/c-IGH6MGJ5.min.js +0 -1
- package/dist/c-II2EEAJN.min.js +0 -1
- package/dist/c-IUHFPMHD.min.js +0 -1
- package/dist/c-J6M4JHRS.min.js +0 -1
- package/dist/c-JM3MGLQV.min.js +0 -1
- package/dist/c-KM3N7F7R.min.js +0 -1
- package/dist/c-LF5BZFNC.min.js +0 -1
- package/dist/c-LKBSGFQC.min.js +0 -1
- package/dist/c-MNF2S4AA.min.js +0 -1
- package/dist/c-MT3WBK7M.min.js +0 -1
- package/dist/c-NDJADPIF.min.js +0 -1
- package/dist/c-NVPQCIL5.min.js +0 -1
- package/dist/c-NY3JWV2K.min.js +0 -1
- package/dist/c-OFWJBEE5.min.js +0 -1
- package/dist/c-OYFHP5F5.min.js +0 -1
- package/dist/c-PGKQGGQ2.min.js +0 -1
- package/dist/c-PPWDL5ZI.min.js +0 -1
- package/dist/c-Q2IPZ3MU.min.js +0 -1
- package/dist/c-QKHMBE2E.min.js +0 -1
- package/dist/c-QMVM3AY6.min.js +0 -1
- package/dist/c-QSGWX53A.min.js +0 -1
- package/dist/c-RJKEKZOO.min.js +0 -1
- package/dist/c-RSVIHIQ4.min.js +0 -1
- package/dist/c-S6U5CGT5.min.js +0 -1
- package/dist/c-SFDIIU5G.min.js +0 -1
- package/dist/c-SLGMUBUL.min.js +0 -1
- package/dist/c-SRTBCRVE.min.js +0 -1
- package/dist/c-T6UAIKBH.min.js +0 -1
- package/dist/c-TMCTEVVW.min.js +0 -1
- package/dist/c-TMOSJLT3.min.js +0 -1
- package/dist/c-TZW3JGJ5.min.js +0 -1
- package/dist/c-U6ESPM7V.min.js +0 -1
- package/dist/c-UC5PTTFI.min.js +0 -1
- package/dist/c-USFMFKIH.min.js +0 -1
- package/dist/c-VGKUEZBC.min.js +0 -1
- package/dist/c-VGW3VG3I.min.js +0 -1
- package/dist/c-VN2HG5BS.min.js +0 -1
- package/dist/c-VPZDY5Q4.min.js +0 -1
- package/dist/c-VRXUB2F2.min.js +0 -1
- package/dist/c-VUBQNQJH.min.js +0 -1
- package/dist/c-VUH4PGZY.min.js +0 -1
- package/dist/c-W3CE4A4S.min.js +0 -1
- package/dist/c-X5UBGU2V.min.js +0 -1
- package/dist/c-XDRV7RKW.min.js +0 -1
- package/dist/c-YGZHURXZ.min.js +0 -1
- package/dist/c-YZVRZGX2.min.js +0 -1
- /package/dist/{c-N4G2L7ID.min.js → c-HYW2XA4Q.min.js} +0 -0
- /package/dist/{c-ENF72HU5.min.js → c-QAVFOEUY.min.js} +0 -0
- /package/dist/{c-OCI56QF2.min.js → c-V4XMSLC3.min.js} +0 -0
package/dist/c-II2EEAJN.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildRegressionAnnotation as e}from"./c-SLGMUBUL.min.js";import{useCustomChartSetup as t}from"./c-U6ESPM7V.min.js";import{validateArrayData as o}from"./c-RSVIHIQ4.min.js";import{useChartSetup as i,useFrameImperativeHandle as n,useResolvedSelection as r}from"./c-F5ZB5GJ6.min.js";import{useStreamingLegend as a}from"./c-3VVKFA4M.min.js";import{barCanvasRenderer as s}from"./c-G3VYMHKE.min.js";import{DataSourceAdapter as l,IncrementalExtent as c,buildEnrichAnnotationData as h,ordinalFrameLegendOptions as u,resolveAnnotationAccessor as d,snapOrdinalIntroTargets as m,ticksForMode as g,toIdSet as p}from"./c-SRTBCRVE.min.js";import{RingBuffer as f,compactTimestampBufferForRemoval as y,computePulseIntensity as v,createTimestampBufferForData as b,ensureRingBufferCapacity as x,hasActivePulses as w,pushWithTimestamp as A,refreshIdlePulse as S,setPulseState as k,useOrdinalKeyboardNavigation as R,useSemanticFrameInteractions as C}from"./c-RJKEKZOO.min.js";import{buildRectNode as _,normalizeColorGradient as P,normalizeGradient as L}from"./c-F3LIKINL.min.js";import{pointCanvasRenderer as M}from"./c-T6UAIKBH.min.js";import{symbolCanvasRenderer as I}from"./c-5JWCTX3G.min.js";import{glyphCanvasRenderer as T}from"./c-54IRWOGM.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as H}from"./c-GSVCN34B.min.js";import{StalenessBadge as B,attachUpdateResultStore as O,buildBaseMetadataProps as F,buildCustomBehaviorProps as D,buildDatumIndexMap as E,buildOrdinalTooltip as j,buildTooltipProps as N,composeOverlays as W,computeDecayOpacity as z,filterAnnotationsByStatus as V,findHitPointInQuadtree as G,getHitRadius as $,hitTestRect as q,mergeShapeStyle as X,normalizeAngle as Y,paintSceneWithBackend as Q,renderSceneListWithBackend as K,resolveFrameGraphics as Z,runCustomLayoutAttempt as U,shouldHandleFramePointer as J,useConfigSync as ee,useLayoutSelectionSync as te,useLegendCategoryEmission as oe,useStableShallow as ie,useStalenessCheck as ne,warnCustomLayoutDiagnostics as re}from"./c-AG7WWVIH.min.js";import{wrapWithCustomLayoutSelection as ae}from"./c-G36WS6LN.min.js";import{accessorsEquivalent as se,resolveAccessor as le,resolveStringAccessor as ce}from"./c-MT3WBK7M.min.js";import{renderPathPulse as he}from"./c-UC5PTTFI.min.js";import{buildResolveColor as ue,resolveCustomLayoutPalette as de}from"./c-VPZDY5Q4.min.js";import{AccessibleDataTable as me,AccessibleTablePortal as ge,AriaLiveTooltip as pe,CanvasFrameBackground as fe,ChartError as ye,FlippingTooltip as ve,FocusRing as be,SVGChartTitle as xe,SafeRender as we,SceneRevisionDiagnosticsObserver as Ae,ScreenReaderSummary as Se,SkipToTableLink as ke,UpdateResultTracker as Re,annotationLayout as Ce,annularSectorPath as _e,buildGaugeGradientGeometry as Pe,buildHoverData as Le,composeStyleRules as Me,computeCanvasAriaLabel as Ie,computeEasing as Te,computeRawProgress as He,createDefaultAnnotationRules as Be,defaultTooltipStyle as Oe,filterSparseArray as Fe,getDevicePixelRatio as De,isAnnotationActivationTarget as Ee,isServerEnvironment as je,lerp as Ne,makeRuleValueResolver as We,normalizeLinkedBrush as ze,normalizeTooltip as Ve,now as Ge,observationInputType as $e,ordinalSceneNodeToSVG as qe,rehitCanvasMarkCursor as Xe,renderAnnotationPass as Ye,renderEmptyState as Qe,renderLegendFromConfig as Ke,renderLoadingState as Ze,resolveDefaultFill as Ue,resolveLegendSideGutter as Je,resolveOrdinalAxisChrome as et,resolveStyleRules as tt,safeSvgId as ot,sceneMarkCursor as it,setCanvasMarkCursor as nt,smartTooltipEntries as rt,subscribeToCanvasFontInvalidation as at,svgFill as st,syncCanvasMarkCursor as lt,useAnnotationActivationOptions as ct,useBrushSelection as ht,useCanvasMarkCursorCleanup as ut,useChartMode as dt,useChartSelection as mt,useFrame as gt,useFrameCanvasHost as pt,useHydration as ft,useSceneRevisionDiagnostics as yt,useSortedData as vt,useThemeCategorical as bt,useThemeDiverging as xt,useWasHydratingFromSSR as wt,warnMissingField as At,withSceneMarkCursor as St,wrapStyleWithSelection as kt}from"./c-VN2HG5BS.min.js";import{resolveThemeSemanticColors as Rt}from"./c-VRXUB2F2.min.js";import{getMax as Ct,getMinMax as _t}from"./c-GGISSW5E.min.js";import{STREAMING_PALETTE as Pt,getColor as Lt,getSize as Mt,interpolateBrBG as It,interpolatePRGn as Tt,interpolatePiYG as Ht,interpolateRdBu as Bt,interpolateRdYlBu as Ot,interpolateRdYlGn as Ft,interpolateSpectral as Dt,resolveExplicitColor as Et}from"./c-EGR6VYBW.min.js";import{coerceCanvasFill as jt,createHatchPattern as Nt,glyphHitGeometry as Wt,hatchPatternDef as zt,isHatchFill as Vt,makeSymbolResolver as Gt,parseCanvasColor as $t,resolveCSSColor as qt,resolveCanvasFill as Xt,symbolRadius as Yt}from"./c-QKHMBE2E.min.js";import{forwardRef as Qt,memo as Kt,useCallback as Zt,useEffect as Ut,useImperativeHandle as Jt,useMemo as eo,useRef as to,useState as oo}from"react";import{scaleBand as io,scaleLinear as no}from"d3-scale";var ro=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){const i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:Et(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){const o=this.colorSchemeMap.get(t);if(o)return o;const i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||Pt,n=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,n),n}};function ao(e,t,o){const i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function so(e){const t=e.getSymbol;return t?Gt(t,e.config.symbolMap):null}function lo(e,t,o,i,n,r,a){e.push(t?{type:"symbol",x:i,y:n,size:Math.PI*r*r,symbolType:t(o),style:a,datum:o}:{type:"point",x:i,y:n,r:r,style:a,datum:o})}function co(e,t){const{columns:o,config:i,resolvePieceStyle:n}=e,r=[],a=Math.min(t.width,t.height)/2-4,s="donut"===i.chartType?i.innerRadius||60:0,l=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,u=Object.values(o),d=u.some(e=>{const t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!d&&u.length>1&&(i.cornerRadius??0)>0;for(let e=0;u.length>e;e++){const t=u[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d=l+h*c,g=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=n(t.pieceData[0],t.name),f=0===e,y=e===u.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:s,outerRadius:a,startAngle:d,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),r.push(v)}return r}import{quantile as ho}from"d3-array";function uo(e,t,o){return{...e[0],...o,category:t,data:e}}function mo(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:ho(e,.25)??o,median:ho(e,.5)??(o+i)/2,q3:ho(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as go}from"d3-scale";var po={bar:function(e,t){const{scales:o,columns:i,config:n,getR:r,getStack:a,resolvePieceStyle:s}=e,{r:l,projection:c}=o,h=[],u="vertical"===c,d="horizontal"===c,m=n.normalize,g=[];if(a){const e=new Set;for(const t of Object.values(i))for(const o of t.pieceData){const t=a(o);e.has(t)||(e.add(t),g.push(t))}}else g.push("_default");for(const e of Object.values(i)){const t=new Map;for(const o of e.pieceData){const e=a?a(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const i=t.get(e);i.total+=r(o),i.pieces.push(o)}let o=0;if(m)for(const e of t.values())o+=Math.abs(e.total);let i=0,n=0;for(const r of g){const c=t.get(r);if(!c)continue;let g=c.total;m&&o>0&&(g/=o);const p=s(c.pieces[0],a?r:e.name),f={...c.pieces[0],__aggregateValue:c.total,__pieceCount:c.pieces.length,category:e.name};if(u){const t=l(0>g?n:i+g),o=0>g?l(n+g)-l(n):l(i)-l(i+g);h.push(_(e.x,t,e.width,Math.abs(o),p,f,r)),0>g?n+=g:i+=g}else if(d){const t=l(0>g?n+g:i),o=0>g?l(n)-l(n+g):l(i+g)-l(i);h.push(_(t,e.x,Math.abs(o),e.width,p,f,r)),0>g?n+=g:i+=g}}}const p="vertical"===c;for(const e of h){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=p?0>t?"bottom":"top":0>t?"left":"right",n.gradientFill&&(e.fillGradient=n.gradientFill)}if(void 0!==n.roundedTop){const e=new Map;for(const t of h){if("rect"!==t.type)continue;const o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(const t of e.values()){if(0===t.length)continue;const e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));if(e.length>0){const t=e.reduce(p?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t),o=ao(n.roundedTop,t,p);o>0&&(t.roundedTop=o)}if(o.length>0){const e=o.reduce(p?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t),t=ao(n.roundedTop,e,p);t>0&&(e.roundedTop=t)}}}return h},clusterbar:function(e,t){const{scales:o,columns:i,config:n,getR:r,getGroup:a,resolvePieceStyle:s}=e,{r:l,projection:c}=o,h=[],u="vertical"===c,d=[],m=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=a?a(t):"_default";m.has(e)||(m.add(e),d.push(e))}const g=d.length||1;for(const e of Object.values(i)){const t=e.width/g,o=.2*t,i=t-o,n=new Map;for(const t of e.pieceData){const e=a?a(t):"_default";n.has(e)||n.set(e,[]),n.get(e).push(t)}for(let a=0;d.length>a;a++){const c=n.get(d[a])||[];for(const n of c){const c=r(n),m=s(n,d[a]);if(u){const r=e.x+a*t+o/2,s=l(0),u=l(c);h.push(_(r,Math.min(s,u),i,Math.abs(s-u),m,n,d[a]))}else{const r=e.x+a*t+o/2,s=l(0),u=l(c);h.push(_(Math.min(s,u),r,Math.abs(u-s),i,m,n,d[a]))}}}}for(const e of h){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=r(e.datum),o=ao(n.roundedTop,e,u);o>0&&(e.roundedTop=o),e.roundedEdge=u?0>t?"bottom":"top":0>t?"left":"right",n.gradientFill&&(e.fillGradient=n.gradientFill)}return h},point:function(e,t){const{scales:o,columns:i,getR:n,multiScales:r,resolvePieceStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=r.length>0,m=so(e),g=2*Math.PI,p=-Math.PI/2;for(const e of Object.values(i))for(const t of e.pieceData){const o=t.__rIndex??0,i=t.__rValue??n(t),l=d&&r[o]||s,f=a(t,e.name),y=f.r||5;let v,b;if(u){const t=p+(e.pctStart+e.pct/2)*g,o=l(i);v=Math.cos(t)*o,b=Math.sin(t)*o}else h?(v=e.middle,b=l(i)):(v=l(i),b=e.middle);lo(c,m,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:n,resolvePieceStyle:r}=e,{r:a,projection:s}=o,l=[],c="vertical"===s,h=so(e);for(const e of Object.values(i)){const t=e.width/2;for(let o=0;e.pieceData.length>o;o++){const i=e.pieceData[o],s=n(i),u=r(i,e.name),d=u.r||4,m=(7919*o%100/100-.5)*t*.8;lo(l,h,i,c?e.middle+m:a(s),c?a(s):e.middle+m,d,u)}}return l},pie:co,donut:co,boxplot:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u=!1!==n.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],n=o[o.length-1],l=ho(o,.25)??i,d=ho(o,.5)??(i+n)/2,m=ho(o,.75)??n,g=m-l,p=l-1.5*g,f=m+1.5*g,y=o.find(e=>e>=p)??i,v=[...o].reverse().find(e=>f>=e)??n,b={n:o.length,min:y,q1:l,median:d,q3:m,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},x=a(uo(t.pieceData,t.name,b),t.name),w=[];if(u)for(const e of t.pieceData){const o=r(e);if(p>o||o>f){const i=h?t.middle:s(o),n=h?s(o):t.middle;w.push({px:i,py:n,value:o,datum:e})}}if(c.push({type:"boxplot",x:h?t.middle:0,y:h?0:t.middle,projection:h?"vertical":"horizontal",columnWidth:.6*t.width,minPos:s(y),q1Pos:s(l),medianPos:s(d),q3Pos:s(m),maxPos:s(v),stats:b,style:x,datum:t.pieceData,category:t.name,outliers:w}),u)for(const t of w)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:x.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:x.cursor},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u=n.bins||20,d=!1!==n.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],n=(i-o)/u||1,l=Array(u).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/n),u-1)]++;const m=Ct(l,1),g=e.width/2*.9;let p;if(h){p=`M ${e.middle} ${s(o)}`;for(let t=0;u>t;t++){const i=s(o+(t+.5)*n);p+=` L ${e.middle+l[t]/m*g} ${i}`}p+=` L ${e.middle} ${s(i)}`;for(let t=u-1;t>=0;t--){const i=s(o+(t+.5)*n);p+=` L ${e.middle-l[t]/m*g} ${i}`}p+=" Z"}else{p=`M ${s(o)} ${e.middle}`;for(let t=0;u>t;t++)p+=` L ${s(o+(t+.5)*n)} ${e.middle-l[t]/m*g}`;p+=` L ${s(i)} ${e.middle}`;for(let t=u-1;t>=0;t--)p+=` L ${s(o+(t+.5)*n)} ${e.middle+l[t]/m*g}`;p+=" Z"}const f=mo(t),y=a(uo(e.pieceData,e.name,f),e.name);let v;if(d&&t.length>=4){const n=ho(t,.25)??o,r=ho(t,.5)??(o+i)/2,a=ho(t,.75)??i;v={q1Pos:s(n),medianPos:s(r),q3Pos:s(a),centerPos:e.middle,isVertical:h}}const b=h?{x:e.x,y:Math.min(s(i),s(o)),width:e.width,height:Math.abs(s(i)-s(o))}:{x:Math.min(s(o),s(i)),y:e.x,width:Math.abs(s(i)-s(o)),height:e.width};c.push({type:"violin",pathString:p,translateX:0,translateY:0,bounds:b,iqrLine:v,stats:f,style:y,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s}=o,l=[],c=n.bins||25,h=n.normalize,u=s.domain?.(),d=u?+u[0]:void 0,m=u?+u[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=_t(t),n=null!=d&&isFinite(d)?d:o,u=null!=m&&isFinite(m)?m:i,g=(u-n)/c||1,p=Array(c).fill(0);for(const e of t)n>e||e>u||p[Math.min(Math.floor((e-n)/g),c-1)]++;const f=t.length,y=Ct(p,1);for(let t=0;c>t;t++){if(0===p[t])continue;const o=(h?p[t]/f:p[t]/y)*e.width*.9,i=s(n+t*g),r=s(n+(t+1)*g),c=Math.min(i,r),u=Math.abs(r-i),d=e.x+e.width-o,m={...e.pieceData[0],bin:t,count:p[t],range:[n+t*g,n+(t+1)*g],category:e.name,data:e.pieceData},v=a(m,e.name);l.push(_(c,d,u,o,v,m,e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:n,getR:r,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h=n.bins||20,u="horizontal"===l,d=n.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>r(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],n=(i-o)/h||1,l=Array(h).fill(0);for(const e of t)o>e||e>i||l[Math.min(Math.floor((e-o)/n),h-1)]++;const m=Ct(l,1),g=mo(t),p=a(uo(e.pieceData,e.name,g),e.name),f=e.width*d;let y;if(u){const t=e.x+e.width;y=`M ${s(o)} ${t}`;for(let e=0;h>e;e++)y+=` L ${s(o+(e+.5)*n)} ${t-l[e]/m*f}`;y+=` L ${s(i)} ${t} Z`}else{const t=e.x;y=`M ${t} ${s(o)}`;for(let e=0;h>e;e++){const i=s(o+(e+.5)*n);y+=` L ${t+l[e]/m*f} ${i}`}y+=` L ${t} ${s(i)} Z`}const v=u?{x:Math.min(s(o),s(i)),y:e.x,width:Math.abs(s(i)-s(o)),height:e.width}:{x:e.x,y:Math.min(s(i),s(o)),width:e.width,height:Math.abs(s(i)-s(o))};c.push({type:"violin",pathString:y,translateX:0,translateY:0,bounds:v,stats:g,style:{...p,fillOpacity:p.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:n,resolvePieceStyle:r}=e,{r:a,projection:s}=o,l=[],c="horizontal"===s;for(const e of Object.values(i))for(const t of e.pieceData){const o=n(t);if(!o)continue;const[i,s]=o,h=r(t,e.name);if(c){const o=a(Math.min(i,s)),n=a(Math.max(i,s));l.push(_(o,e.x,n-o,e.width,h,t,e.name))}else{const o=a(Math.max(i,s)),n=a(Math.min(i,s));l.push(_(e.x,o,e.width,n-o,h,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:n,resolvePieceStyle:r}=e,a=[],s=t.width/2,l=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return a;const h=[],u=new Set;for(const e of c)for(const t of e.pieceData){const e=n?n(t):"_default";u.has(e)||(u.add(e),h.push(e))}const d=h.length>1&&"_default"!==h[0],m=[];let g=0;for(const e of c){const t=new Map;let o=0;for(const r of e.pieceData){const e=n?n(r):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(r);a.total+=s,a.pieces.push(r),o+=s}m.push({col:e,groups:t,stepTotal:o}),d||o>g&&(g=o)}if(d)for(const e of m){let t=0,o=0;for(let i=0;h.length>i;i++){const n=e.groups.get(h[i]);n&&(i%2==0?t+=n.total:o+=n.total)}const i=Math.max(t,o);i>g&&(g=i)}if(0===g)return a;const p=new Map;for(const e of h){const t=m[0].groups.get(e);p.set(e,t?.total??0)}const f=m[0].stepTotal,y=d?.95*s:.9*t.width,v=go().domain([0,g]).range([0,y]),b=e.config.connectorOpacity??.3;let x=new Map;for(let t=0;m.length>t;t++){const o=m[t],i=o.col,n=0===t,c=i.width,u=.55*c,g=i.x+(c-u)/2,y=new Map;if(d){let e=0;for(const t of h){const i=o.groups.get(t);i&&(e+=v(i.total))}let t=s,c=s;for(let d=0;h.length>d;d++){const m=h[d],f=o.groups.get(m);if(!f)continue;const b=v(f.total),x=d%2==0,w=x?t:c-b;x?t+=b:c-=b;const A=r(f.pieces[0],m),S=p.get(m)??f.total,k={...f.pieces[0],__funnelValue:f.total,__funnelPercent:S>0?f.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:n,__aggregateValue:f.total,__pieceCount:f.pieces.length,category:m};l&&(0===d&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=s,k.__funnelStepLabelY=g,k.__funnelRowWidth=e),k.__funnelValueLabelX=w+b/2,k.__funnelValueLabelY=g,k.__funnelBarW=b),a.push(_(w,g,b,u,A,k,m)),y.set(m,{x:w,y:g,w:b,h:u})}}else{const e=o.stepTotal,t=v(e),c=s-t/2,d=h[0],m="_default"!==d,p=o.groups.get(d)?.pieces[0]??i.pieceData[0],b=m?d:i.name,x=r(p,b),w=f>0?e/f*100:0,A={...p,__funnelValue:e,__funnelPercent:w,__funnelStep:i.name,__funnelIsFirstStep:n,category:m?d:i.name};l&&(A.__funnelStepLabel=i.name,A.__funnelStepLabelX=s,A.__funnelStepLabelY=g,A.__funnelRowWidth=t,A.__funnelValueLabelX=s,A.__funnelValueLabelY=g,A.__funnelBarW=t),a.push(_(c,g,t,u,x,A,b)),y.set(d,{x:c,y:g,w:t,h:u})}if(t>0&&x.size>0){const t=d?h:[h[0]];for(const n of t){const t=x.get(n),s=y.get(n);if(!t||!s)continue;const l=(()=>{const e=o.groups.get(n);return r(e?e.pieces[0]:i.pieceData[0],"_default"===n?i.name:n)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[s.x+s.w,s.y],[s.x,s.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:b,cursor:l.cursor},datum:o.groups.get(n)?.pieces[0]??i.pieceData[0],category:"_default"===n?i.name:n};a.push(c)}}x=y}return a},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:n,resolvePieceStyle:r,scales:a}=e,s=[],l=a.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return s;const c=[],h=new Set;for(const e of l)for(const t of e.pieceData){const e=n?n(t):"_default";h.has(e)||(h.add(e),c.push(e))}const u=c.length>1&&"_default"!==c[0],d=[];for(const e of l){const t=new Map;let o=0;for(const r of e.pieceData){const e=n?n(r):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(r);a.total+=s,a.pieces.push(r),o+=s}d.push({col:e,groups:t,stepTotal:o})}const m=new Map;for(const e of c){const t=d[0]?.groups.get(e);m.set(e,t?.total??0)}const g=a.r,p=u?c.length:1,f=u?.15:0;for(let e=0;d.length>e;e++){const t=d[e],o=t.col,i=0===e,n=e>0?d[e-1]:null,a=o.width/p,l=a*f,h=a-l;for(let e=0;c.length>e;e++){const d=c[e],p=t.groups.get(d);if(!p)continue;const f=p.total,y=m.get(d)??f,v=y>0?f/y*100:0,b=n?.groups.get(d),x=i?0:Math.max(0,(b?.total??f)-f),w=o.x+e*a+l/2,A=g(f),S=g(0)-A,k=r(p.pieces[0],u?d:o.name),R={...p.pieces[0],__barFunnelValue:f,__barFunnelPercent:v,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:x,__barFunnelCategory:"_default"===d?void 0:d,category:u?d:o.name,__barFunnelLabelX:w+h/2,__barFunnelLabelY:g(f+x)};if(s.push(_(w,A,h,S,k,R,u?d:o.name)),x>0){const e=g(f+x),t=A-e,i={...k},n={...p.pieces[0],__barFunnelValue:x,__barFunnelPercent:y>0?x/y*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===d?void 0:d,category:u?d:o.name};s.push(_(w,e,h,t,i,n,u?d:o.name))}}}return s},swimlane:function(e,t){const{scales:o,columns:i,getR:n,getStack:r,resolvePieceStyle:a}=e,{r:s,projection:l}=o,c=[],h="horizontal"===l,u=e.config.gradientFill,d=h?"left":"bottom",m=new Map,g=t=>{const o=m.get(t);if(void 0!==o)return o;const i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,n="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return m.set(t,n),n},p=e.config.trackFill;if(p){const e="string"==typeof p?p:p.color,t="string"==typeof p?1:p.opacity??1,[o,n]=s.range(),r=Math.min(o,n),a=Math.abs(n-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},n=h?_(r,o.x,a,o.width,i,null,"__track__"):_(o.x,r,o.width,a,i,null,"__track__"),s=g(o);s>0&&(n.cornerRadii={tl:s,tr:s,br:s,bl:s}),c.push(n)}}for(const e of Object.values(i)){let t=0;const o=c.length,i=g(e);for(const o of e.pieceData){const i=Math.abs(n(o));if(0===i)continue;const l=r?r(o):e.name,m=a(o,l);let g;if(h){const n=s(t),r=s(t+i);g=_(n,e.x,r-n,e.width,m,o,l)}else{const n=s(t+i),r=s(t);g=_(e.x,n,e.width,r-n,m,o,l)}u&&(g.fillGradient=u,g.roundedEdge=d),c.push(g),t+=i}if(i>0&&c.length>o){const e=c.slice(o),t=e[0],n=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:h?(t.cornerRadii={tl:i,bl:i},n.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},n.cornerRadii={tl:i,tr:i})}}return c}},fo=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],yo=["scene-style","data-paint","accessibility","evidence"],vo=(e,t)=>({retainedData:e,invalidations:t}),bo=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],xo=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],wo=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ao=["scene-geometry","data-paint","accessibility","evidence"],So=["scene-style","data-paint","accessibility","evidence"],ko=[],Ro={chartType:vo("rebuild",bo),runtimeMode:vo("rebuild",bo),categoryAccessor:vo("rebuild",bo),valueAccessor:vo("rebuild",bo),oAccessor:vo("rebuild",bo),rAccessor:vo("rebuild",bo),stackBy:vo("rebuild",bo),groupBy:vo("rebuild",bo),timeAccessor:vo("rebuild",bo),accessorRevision:vo("rebuild",bo),colorAccessor:vo("rebuild",So),symbolAccessor:vo("rebuild",Ao),connectorAccessor:vo("rebuild",Ao),dataIdAccessor:vo("rebuild",Ao),projection:vo("preserve",xo),extentPadding:vo("preserve",xo),axisExtent:vo("preserve",xo),rExtent:vo("preserve",xo),oExtent:vo("preserve",xo),multiAxis:vo("preserve",xo),normalize:vo("preserve",xo),bins:vo("preserve",xo),oSort:vo("preserve",wo),barPadding:vo("preserve",wo),roundedTop:vo("preserve",wo),baselinePadding:vo("preserve",wo),innerRadius:vo("preserve",wo),cornerRadius:vo("preserve",wo),startAngle:vo("preserve",wo),sweepAngle:vo("preserve",wo),trackFill:vo("preserve",wo),showOutliers:vo("preserve",wo),showIQR:vo("preserve",wo),amplitude:vo("preserve",wo),connectorOpacity:vo("preserve",wo),showLabels:vo("preserve",wo),dynamicColumnWidth:vo("rebuild",wo),customLayout:vo("preserve",wo),layoutConfig:vo("preserve",wo),layoutMargin:vo("preserve",wo),symbolMap:vo("preserve",Ao),pieceStyle:vo("preserve",So),summaryStyle:vo("preserve",So),connectorStyle:vo("preserve",So),gradientFill:vo("preserve",So),colorScheme:vo("preserve",So),themeCategorical:vo("preserve",So),themeSemantic:vo("preserve",So),themeSequential:vo("preserve",So),themeDiverging:vo("preserve",So),barColors:vo("preserve",So),decay:vo("preserve",So),pulse:vo("preserve",So),staleness:vo("preserve",So),layoutSelection:vo("preserve",So),windowSize:vo("preserve",ko),windowMode:vo("preserve",ko),clock:vo("preserve",ko),transition:vo("preserve",ko),introAnimation:vo("preserve",ko),onLayoutError:vo("preserve",ko)},Co=vo("preserve",wo),_o=class{constructor(){this.tracker=new Re}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},fo)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},yo):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=Ro[i]??Co;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as Po}from"d3-quadtree";var Lo=class{constructor(e){this.rExtent=new c,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new _o,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new ro,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new f(e.windowSize),this.getO=ce(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>le(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new c)):(this.getR=le(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=ce(e.stackBy),this.getGroup=ce(e.groupBy),this.getColor=ce(e.colorAccessor),this.getSymbol=ce(e.symbolAccessor),this.getConnector=ce(e.connectorAccessor),this.getDataId=ce(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new f(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:b(t,i):null)}currentTime(){return this.config.clock?.()??Ge()}ingest(e){const t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),x(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)A(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(const o of e.inserts){const e=A(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){const t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;const o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){const{config:t,buffer:o}=this,i=this.scales,n=this.multiScales,r=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);const a=this.getBufferArray(),s=t.projection||"vertical",l=t.oExtent||this.resolveCategories(a),c=this.computeValueDomain(a,l),h="horizontal"===s,u="radial"===s,d=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===s?e.width:e.height):.1));let m,g;if(u){m=io().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;g=no().domain(c).range([i,o])}else h?(m=io().domain(l).range([0,e.height]).padding(d),g=no().domain(c).range([0,e.width])):(m=io().domain(l).range([0,e.width]).padding(d),g=no().domain(c).range([e.height,0]));this.scales={o:m,r:g,projection:s},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,n)=>{const r=this.rExtents[n];r.dirty&&r.recalculate(o,i);let[a,s]=r.extent;a===1/0&&(a=0,s=1);const l=s-a,c=l>0?l*(t.extentPadding??.05):1;return a-=c,s+=c,a>0&&(a=0),h?no().domain([a,s]).range([0,e.width]):no().domain([a,s]).range([e.height,0])}):[];let p=a;this.rAccessors.length>1&&(p=a.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,l,m,s,e),this._customLayoutFailedThisBuild=!1;const f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=n,this.columns=r):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,a),this.config.pulse&&this.applyPulse(this.scene,a),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){const t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){const t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t;let n=null;if(o){n=new Set;for(const t of e)n.add(this.getO(t))}const r=n?Array.from(this.categories).filter(e=>n.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*n.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;n.has(e)||(this.categories.delete(e),t--)}}return r}if(!1===i)return r;if("function"==typeof i)return r.sort(i);const a=new Map;for(const t of e){const e=this.getO(t);a.set(e,(a.get(e)||0)+Math.abs(this.getR(t)))}return r.sort("asc"===i?(e,t)=>(a.get(e)||0)-(a.get(t)||0):(e,t)=>(a.get(t)||0)-(a.get(e)||0))}computeValueDomain(e,t){return function(e){const{data:t,chartType:o,projection:i,normalize:n,rExtent:r,extentPadding:a=.05,baselinePadding:s,axisExtent:l,getO:c,getR:h,getStack:u,rawRExtent:d}=e,m=a;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&u&&n)g=0,p=1;else if("bar"===o&&u){const e=new Map,o=new Map;for(const i of t){const t=c(i),n=h(i);0>n?o.set(t,(o.get(t)||0)+n):e.set(t,(e.get(t)||0)+n)}for(const t of e.values())t>p&&(p=t);for(const e of o.values())g>e&&(g=e)}else if("bar"===o){const e=new Map;for(const o of t){const t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){const e=new Map;for(const o of t){const t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(const e of t){const t=h(e);t>p&&(p=t),g>t&&(g=t)}else{const e=d[0],t=d[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}r&&(null!=r[0]&&(g=r[0]),null!=r[1]&&(p=r[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==r?.[0]&&null==r?.[1]&&(g>0&&(g=0),0>p&&(p=0)),"bar-funnel"!==o&&"exact"!==l){const e=p-g,t=e>0?e*m:1,i=f&&!s&&0===g,n=f&&!s&&0===p||"swimlane"===o;null!=r?.[0]||i||(g-=t),null!=r?.[1]||n||(p+=t)}return[g,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,n){return function(e){const{data:t,oExtent:o,oScale:i,projection:n,layout:r,dynamicColumnWidth:a,getO:s,getR:l}=e,c=Object.create(null),h=new Map;for(const e of t){const t=s(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let u=0;if("radial"===n)for(const e of t)u+=Math.abs(l(e));let d=null;if(a&&"radial"!==n){d=new Map;let e=0;for(const t of o){const o=h.get(t)||[];let i;i="string"==typeof a?o.reduce((e,t)=>e+(Number(t[a])||0),0):a(o),d.set(t,i),e+=i}const t=("horizontal"===n?r.height:r.width)-i.padding()*i.step()*o.length;if(e>0)for(const[o,i]of d)d.set(o,i/e*t)}let m=0,g=0;for(const e of o){const t=h.get(e)||[],o=t.reduce((e,t)=>e+Math.abs(l(t)),0),n=u>0?o/u:0;let r,a;d?(r=g,a=d.get(e)||i.bandwidth(),g+=a+i.padding()*i.step()):(r=i(e)??0,a=i.bandwidth()),c[e]={name:e,x:r,y:0,width:a,middle:r+a/2,padding:i.padding()*i.step(),pieceData:t,pct:n,pctStart:m},m+=n}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:n,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){const o=this.buildLayoutContext(e,t),i=U({family:"ordinal",logLabel:"ordinal customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:this.config.onLayoutError,run:()=>this.config.customLayout(o)});if("failure"===i.kind)return this.lastCustomLayoutFailure=i.diagnostic,this._customLayoutFailedThisBuild=!0,i.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);const n=i.result;this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null;const r=n.nodes??[];if(this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of r)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(r,this.config.layoutSelection??null)}return re({label:"ordinal customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=po[this.config.chartType];let n=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:n,getO:r}=e;if(!n||!o)return[];const a=[],{projection:s}=o,l=new Map;for(const e of t){if("point"!==e.type&&"rect"!==e.type)continue;const t=e.datum;if(!t)continue;const o=n(t);if(!o)continue;let i,a;"point"===e.type?(i=e.x,a=e.y):(i=e.x+e.w/2,a=e.y+("vertical"===s?0:e.h/2)),l.has(o)||l.set(o,[]),l.get(o).push({x:i,y:a,datum:t,category:r(t)})}const c=o.o.domain(),h=i.connectorStyle,u={stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5},d=(e,t,o)=>{var i;a.push({type:"connector",x1:e.x,y1:e.y,x2:t.x,y2:t.y,style:(i=e.datum,"function"==typeof h?h(i):h||u),datum:e.datum,group:o})};for(const[e,t]of l)if(t.length>=2){t.sort((e,t)=>c.indexOf(e.category)-c.indexOf(t.category));for(let o=0;t.length-1>o;o++)d(t[o],t[o+1],e);"radial"!==s||3>t.length||d(t[t.length-1],t[0],e)}return a}(o,n);n=[...e,...n]}return n}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},n=de(o.colorScheme,o.themeCategorical,Pt),r=this.scales;return{data:e,scales:{o:r.o,r:r.r,projection:r.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===r.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...n]},resolveColor:ue(n,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?z(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=E(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;const t=function(e,t){const o="function"==typeof t,i=o?null:t||"category",n=new Map;for(let r=0;e.length>r;r++){const a=e[r],s=o?t(a):a[i],l=n.get(s);l?l.push(r):n.set(s,[r])}return n}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){const e=function(e){let t=0,o=0;for(const i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let n=0;for(const t of e)"point"===t.type&&!1!==t.interactive&&(i[n++]=t);return{maxRadius:o,quadtree:Po().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;const o=t.length;if(1>=o)return;const i=this.getDatumIndexMap(t);for(const t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type)continue;if(!t.datum)continue;const e=i.get(t.datum);if(null==e)continue;const n=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*n}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,n,r){const a=e.color??"rgba(255,255,255,0.6)",s=e.glowRadius??4;let l=!1;for(const c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){const t=c.category;if(!t)continue;let i=0;for(const a of n(t)??[]){const t=o.get(a);null!=t&&(i=Math.max(i,v(e,t,r)))}l=k(c,i,a)||l;continue}if(null==c.datum)continue;const t=i.get(c.datum);if(null==t)continue;const h=o.get(t),u=null==h?0:v(e,h,r);l=k(c,u,a,s)||l}return l}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&w(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();const e=new Map,t=this.scales?.r(0)??0,o="horizontal"!==this.scales?.projection;let i;for(let n=0;this.scene.length>n;n++){const r=this.scene[n],a=this.getNodeKey(r,e);a&&("rect"===r.type?this.prevPositionMap.set(a,o?{x:r.x,y:t,w:r.w,h:0,opacity:r.style.opacity??1}:{x:t,y:r.y,w:0,h:r.h,opacity:r.style.opacity??1}):"point"===r.type?this.prevPositionMap.set(a,{x:r.x,y:r.y,r:0,opacity:0}):"wedge"===r.type&&(void 0===i&&(i=r.startAngle),this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:i,endAngle:i,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){const o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){const o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,n=t.get(i)||0;return t.set(i,n+1),0===n?i:`${i}:${n}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();const e=new Map;for(let t=0;this.scene.length>t;t++){const o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;const e=this.config.transition.duration??300;if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1;const o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){const n=this.scene[e],r=this.getNodeKey(n,i);if(!r)continue;n._transitionKey=r;const a=this.prevPositionMap.get(r);if("point"===n.type)a?(o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,(a.x!==n.x||a.y!==n.y||void 0!==a.r&&a.r!==n.r)&&(n._targetX=n.x,n._targetY=n.y,n._targetR=n.r,n.x=a.x,n.y=a.y,void 0!==a.r&&(n.r=a.r),t=!0)):(n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n._targetR=n.r,n.r=0,n.style={...n.style,opacity:0},t=!0);else if("rect"===n.type)a?(o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,a.x===n.x&&a.y===n.y&&a.w===n.w&&a.h===n.h||(n._targetX=n.x,n._targetY=n.y,n._targetW=n.w,n._targetH=n.h,n.x=a.x,n.y=a.y,n.w=a.w??n.w,n.h=a.h??n.h,t=!0)):(n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n.style={...n.style,opacity:0},t=!0);else if("wedge"===n.type)if(a)o.add(r),n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,a.startAngle===n.startAngle&&a.endAngle===n.endAngle||(n._targetStartAngle=n.startAngle,n._targetEndAngle=n.endAngle,n.startAngle=a.startAngle,n.endAngle=a.endAngle,t=!0);else{n._targetOpacity=n.style.opacity??n.style.fillOpacity??1,n._targetStartAngle=n.startAngle,n._targetEndAngle=n.endAngle;const e=n.startAngle;n.startAngle=e,n.endAngle=e,n.style={...n.style,opacity:0},this.prevPositionMap.set(r,{x:n.cx,y:n.cy,startAngle:e,endAngle:e,innerRadius:n.innerRadius,outerRadius:n.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(const[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){const t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;const t=He(e,this.activeTransition),o=Te(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(const e of this.scene){const t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ne(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Ne(i.x,e._targetX,o),e.y=Ne(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Ne(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ne(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;const i=this.prevPositionMap.get(t);if(!i)continue;e.x=Ne(i.x,e._targetX,o),e.y=Ne(i.y,e._targetY,o),void 0!==i.w&&(e.w=Ne(i.w,e._targetW,o),e.h=Ne(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style={...e.style,opacity:Ne(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){const i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=Ne(i.startAngle,e._targetStartAngle,o),e.endAngle=Ne(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(const e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,m(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=p(e),o=this.getDataId,i=e=>t.has(o(e));y(this.buffer,this.timestampBuffer,i);const n=this.buffer.remove(i);if(0===n.length)return this.updateResults.recordNoop("remove"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",n.length),n}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=p(e),i=this.getDataId,n=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&n.add(t)});const r=this.buffer.update(e=>o.has(i(e)),t);if(0===r.length)return this.updateResults.recordNoop("update"),r;for(const e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),n.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length),r}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){const o=this._customRestyle;if(o)for(const i of e){const e=this._baseStyles.get(i)??i.style??{},n=o(i,t);i.style=n?{...e,...n}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){const t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!se(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!se(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!se(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(se(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=ce(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let n=!1;if("valueAccessor"in e||"rAccessor"in e){const e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],r=Array.isArray(o)?o:[o];if(n=i.length!==r.length||i.some((e,t)=>!se(e,r[t])),n){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>le(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new c)):(this.getR=le(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!se(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?ce(this.config.stackBy):void 0),"groupBy"in e&&!se(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?ce(this.config.groupBy):void 0),"colorAccessor"in e&&!se(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?ce(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!se(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?ce(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!se(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?ce(this.config.connectorAccessor):void 0),(i||n||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function Mo(e,t,o){const i=q(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function Io(e,t,o,i=30){const n=t-e.x,r=o-e.y,a=Math.sqrt(n*n+r*r);return a>$(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function To(e,t,o,i=30){const n=t-e.x,r=o-e.y,a=Math.sqrt(n*n+r*r);return a>$(Yt(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function Ho(e,t,o,i=30){if(null==e.datum)return null;const n=Wt(e.glyph,e.size),r=e.x+n.centerDx,a=e.y+n.centerDy,s=t-r,l=o-a,c=Math.sqrt(s*s+l*l);return c>$(n.radius,i)?null:{datum:e.datum,x:r,y:a,distance:c}}function Bo(e,t,o){const i=t-e.cx,n=o-e.cy,r=Math.sqrt(i*i+n*n);if(e.innerRadius>r||r>e.outerRadius)return null;const a=Y(Math.atan2(n,i)),s=Y(e.startAngle),l=Y(e.endAngle);if(!(s>l?a>=s||l>=a:a>=s&&l>=a))return null;const c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function Oo(e,t,o){const i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{const n=e.y-i,r=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||n>o||o>r))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function Fo(e,t,o){if(!e.bounds)return null;const{x:i,y:n,width:r,height:a}=e.bounds;return i>t||t>i+r||n>o||o>n+a?null:{datum:e.datum,x:i+r/2,y:n+a/2,distance:0,category:e.category,stats:e.stats}}function Do(e,t,o,i){const n=e.style.strokeWidth??1;if(0>=n||"none"===e.style.stroke)return null;const r=No(t,o,e.x1,e.y1,e.x2,e.y2);return r?r.distance>Math.max(i,n/2)?null:{datum:e.datum,x:r.x,y:r.y,distance:r.distance,category:e.group}:null}function Eo(e,t,o){if(3>e.points.length)return null;const i=Wo(e.points,t,o),n=zo(e.points,t,o),r=e.style.strokeWidth??1;if(!(n||e.style.stroke&&"none"!==e.style.stroke&&r>0&&r/2>=i))return null;const a=jo(e.points);return{datum:e.datum,x:a.x,y:a.y,distance:n?0:i,category:e.category}}function jo(e){const t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function No(e,t,o,i,n,r){const a=n-o,s=r-i,l=a*a+s*s;if(0===l)return null;const c=Math.max(0,Math.min(1,((e-o)*a+(t-i)*s)/l)),h=o+c*a,u=i+c*s;return{x:h,y:u,distance:Math.hypot(e-h,t-u)}}function Wo(e,t,o){let i=1/0;for(let n=0;e.length>n;n++){const r=e[n],a=e[(n+1)%e.length],s=No(t,o,r[0],r[1],a[0],a[1]);s&&i>s.distance&&(i=s.distance)}return i}function zo(e,t,o){if(Wo(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let n=0,r=e.length-1;e.length>n;r=n++){const[a,s]=e[n],[l,c]=e[r];s>o!=c>o&&(l-a)*(o-s)/(c-s)+a>t&&(i=!i)}return i}function Vo(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>o||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};const i="radial"===e.projection,n=function(e,t,o,i=30,n,r=0){let a=null,s=null;if(n){const e=G(n,t,o,i,r);e&&!1!==e.node.interactive&&(a={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const r of e){let e=null;switch(r.type){case"rect":if(null==r.datum)break;e=Mo(r,t,o);break;case"point":if(!1===r.interactive)break;if(n)break;e=Io(r,t,o,i);break;case"symbol":e=To(r,t,o,i);break;case"glyph":e=Ho(r,t,o,i);break;case"wedge":if(null===r.datum)break;e=Bo(r,t,o);break;case"boxplot":e=Oo(r,t,o);break;case"violin":e=Fo(r,t,o);break;case"connector":e=Do(r,t,o,i);break;case"trapezoid":e=Eo(r,t,o)}e&&(e.node=r,"connector"===r.type?s&&e.distance>=s.distance||(s=e):a&&e.distance>=a.distance||(a=e))}return a??s??function(e,t,o){const i=new Map;for(const t of e){if("connector"!==t.type)continue;const e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(const e of i.values()){const i=e[0];if(2>e.length||!i.style.fill||"none"===i.style.fill)continue;const n=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!zo(n,t,o))continue;const r=jo(n);return{node:i,datum:i.datum,x:r.x,y:r.y,distance:0,category:i.group}}return null}(e,t,o)}(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return n?{kind:"hit",hit:n}:{kind:"miss"}}function Go(e,t){return Le(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}O(Lo);import{useMemo as $o,useRef as qo}from"react";import{Fragment as Xo,jsx as Yo,jsxs as Qo}from"react/jsx-runtime";function Ko(e){const{width:t,height:o,totalWidth:i,totalHeight:n,margin:r,scales:a,showAxes:s,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===a?.projection,m="horizontal"===a?.projection,p=$o(()=>!a||d?[]:(h||g(a.r,5,u)).map(e=>({value:e,pixel:a.r(e),label:(c||Zo)(e)})),[a,c,d,h,u]),f=l&&a&&!d,y=s&&a&&!d;return f||y?Yo("svg",{width:i,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:Qo("g",{transform:`translate(${r.left},${r.top})`,children:[f&&Yo("g",{className:"ordinal-grid",children:p.map((e,i)=>Yo("line",{x1:m?e.pixel:0,y1:m?0:e.pixel,x2:m?e.pixel:t,y2:m?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),y&&Yo(Xo,{children:Qo(Xo,m?{children:[Yo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[Yo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function Zo(e){return Math.round(100*e)/100+""}function Uo(e){const{width:t,height:o,totalWidth:i,totalHeight:n,margin:r,scales:a,showAxes:s,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:u,rFormat:d,showGrid:m,title:p,legend:f,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:S,annotations:k,onAnnotationActivate:R,onObservation:C,chartId:_,chartType:P,autoPlaceAnnotations:L,svgAnnotationRules:M,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:O=!0,children:F}=e,D=ct({onAnnotationActivate:R,onObservation:C,chartId:_,chartType:P}),E="radial"===a?.projection,j="horizontal"===a?.projection,N=!1!==l,W=!B||O,z=et({showAxes:s,projection:E?"radial":j?"horizontal":"vertical",hasCategoryLabel:!!c,hasValueLabel:!!h}),G=Je(A,z.leftAxis),$=f&&"left"===w&&G>0?G:r.left,q=$o(()=>{if(!s||!N||!a||E)return[];const e=a.o.bandwidth(),t=a.o.domain().map((t,o)=>({value:t,pixel:(a.o(t)??0)+e/2,label:u?u(t,o):t}));if(2>=t.length)return t;const o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,j?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),n=j?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+n))return t;const r=Math.max(...i)+n,l=Math.max(1,Math.ceil(r/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[s,N,a,u,E,j]),X=e.rTickValues,Y=e.tickLabelEdgeAlign,Q=e.axisExtent,K=$o(()=>s&&a&&!E?(X||g(a.r,5,Q)).map(e=>({value:e,pixel:a.r(e),label:(d||Zo)(e)})):[],[s,a,d,E,X,Q]),Z=qo(new Map),U=qo(k?.length??0),J=k?.length??0;U.current!==J&&(U.current=J,Z.current=new Map);const ee=$o(()=>{if(!k||0===k.length)return null;const e=V(k),i=Be("ordinal",D),n="horizontal"===a?.projection,r=a?.o?e=>(a.o(e)??0)+a.o.bandwidth()/2:null,s={scales:a?{x:n?a.r:r||a.r,y:n&&r||a.r,time:a.r,value:a.r,o:a.o}:null,timeAxis:"x",xAccessor:I,yAccessor:T,width:t,height:o,data:H,frameType:"ordinal",projection:n?"horizontal":"vertical",stickyPositionCache:Z.current},l=L?Ce({annotations:e,context:s,..."object"==typeof L?L:{}}):e;return Ye(l,i,M,s)},[k,L,M,t,o,a,I,T,H,D]);return s||p||f||S||ee&&ee.length>0||m||F?Qo("svg",{role:"img",width:i,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Yo("title",{children:"string"==typeof p?p:"Ordinal Chart"}),Yo("desc",{children:"string"==typeof p?p+" (ordinal data visualization)":"Ordinal data visualization"}),Qo("g",{transform:`translate(${r.left},${r.top})`,children:[m&&a&&!E&&W&&Yo("g",{className:"ordinal-grid",children:K.map((e,i)=>Yo("line",{x1:j?e.pixel:0,y1:j?0:e.pixel,x2:j?e.pixel:t,y2:j?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),s&&a&&!E&&(()=>{const e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return Yo("g",{className:"ordinal-axes",children:Qo(Xo,j?{children:[Qo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&Yo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>Qo("g",{transform:`translate(0,${t.pixel})`,children:[Yo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Yo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&Yo("text",{x:15-$,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-$}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&Yo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),W&&a?.r&&(()=>{const e=a.r(0);return e>1&&t-1>e?Yo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),K.map((t,i)=>{const n=Y?0===i?"start":i===K.length-1?"end":"middle":"middle";return Qo("g",{transform:`translate(${t.pixel},${o})`,children:[Yo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yo("text",{y:18,textAnchor:n,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&Yo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[Qo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&(()=>{const e=a?.r?a.r(0):o,i=0>e||e>o?o:e;return Yo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),q.map((t,i)=>Qo("g",{transform:`translate(${t.pixel},${o})`,children:[Yo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Yo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):Yo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Yo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&Yo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Qo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&Yo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),K.map((t,o)=>Qo("g",{transform:`translate(0,${t.pixel})`,children:[Yo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Yo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&Yo("text",{x:15-$,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-$}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),ee,S,F]}),Yo(xe,{title:p,totalWidth:i,marginTop:r.top}),Ke({legend:f,totalWidth:i,totalHeight:n,margin:r,legendPosition:w,title:p,legendLayout:A,axisChrome:z,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as Jo from"react";import{jsx as ei}from"react/jsx-runtime";var ti=null,oi=null;function ii(e){const[t,o]=Jo.useState(()=>ti);return Jo.useEffect(()=>{if(t)return;let e=!1;return(ti?Promise.resolve(ti):(oi||(oi=import("./c-52TEGIUJ.min.js").then(e=>ti=e.OrdinalBrushOverlay).catch(e=>{throw oi=null,e})),oi)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?ei(t,{...e}):null}import{arc as ni}from"d3-shape";function ri(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:n}=Pe({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),r=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(r);for(const t of n)e.fillStyle=qt(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();const a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=qt(e,t.style.stroke)||t.style.stroke,e.lineWidth=a,e.stroke(r),e.restore())}function ai(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function si(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=ni().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const n=new Path2D(i);e.fill(n);const r=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&r>0&&(e.lineWidth=r,e.stroke(n)),e.restore()}var li=(e,t,o,i)=>{const n=t.filter(e=>"wedge"===e.type);for(const t of n){const o=t.style.strokeWidth??1,i=t.style.stroke,n=!(!i||"none"===i||0>=o);if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)ri(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(ai(e,t),he(e,t)),e.globalAlpha=1;else{if(e.fillStyle=Xt(e,t.style.fill,"#007bff"),t.roundedEnds){n&&(e.strokeStyle=qt(e,i)||i,e.lineWidth=o);const r=_e({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);const a=new Path2D(r);e.fill(a),n&&e.stroke(a),e.restore()}else t.cornerRadius?(n&&(e.strokeStyle=qt(e,i)||i,e.lineWidth=o),si(e,t)):(ai(e,t),e.fill(),n&&(e.strokeStyle=qt(e,i)||i,e.lineWidth=o,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(ai(e,t),he(e,t)),e.globalAlpha=1}}},ci=(e,t,o,i)=>{const n=t.filter(e=>"boxplot"===e.type);for(const t of n){const o=t.columnWidth/2,i="vertical"===t.projection,n=qt(e,"var(--semiotic-primary, #007bff)"),r=qt(e,"var(--semiotic-text, #333)"),a=Xt(e,t.style.fill,n),s=t.style.stroke,l="string"==typeof s?qt(e,s)||s:r,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof s&&"none"===s.trim().toLowerCase()),u=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=u,e.fillStyle=a,i){const i=Math.min(t.q1Pos,t.q3Pos),n=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,n),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,n)}else{const i=Math.min(t.q1Pos,t.q3Pos),n=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,n,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,n,t.columnWidth)}h&&(e.strokeStyle=l,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},hi=(e,t,o,i)=>{const n=t.filter(e=>"violin"===e.type);for(const t of n){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=Xt(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1;const i=t.style.strokeWidth??1;if(t.style.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=qt(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke(o)),t.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;const o=t.iqrLine.centerPos,i=!1!==t.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(o,t.iqrLine.q1Pos),e.lineTo(o,t.iqrLine.q3Pos)):(e.moveTo(t.iqrLine.q1Pos,o),e.lineTo(t.iqrLine.q3Pos,o)),e.stroke(),e.beginPath(),i?e.arc(o,t.iqrLine.medianPos,3,0,2*Math.PI):e.arc(t.iqrLine.medianPos,o,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},ui=(e,t,o,i)=>{const n=t.filter(e=>"connector"===e.type);if(0===n.length)return;const r=new Map;for(const e of n){const t=e.group||"_default";r.has(t)||r.set(t,[]),r.get(t).push(e)}for(const[,t]of r){if(0===t.length)continue;const o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(const o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=jt(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t){const t=o.style.strokeWidth??1;t>0&&"none"!==o.style.stroke&&(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=qt(e,o.style.stroke)||Xt(e,o.style.fill,"")||qt(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},di=(e,t,o,i)=>{const n=t.filter(e=>"trapezoid"===e.type);for(const t of n){const o=t.points;if(4>o.length)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=jt(e,t.style?.fill)||"#999",e.fill();const i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=qt(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}};function mi(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function gi(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var pi=new Map;function fi(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=pi.get(o);if(void 0!==i)return i;const n=Nt({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),r=Vt(n)?null:n;return pi.set(o,r),r}function yi(e,t,o,i,n,r){e.moveTo(t+r,o),e.lineTo(t+i-r,o),e.quadraticCurveTo(t+i,o,t+i,o+r),e.lineTo(t+i,o+n-r),e.quadraticCurveTo(t+i,o+n,t+i-r,o+n),e.lineTo(t+r,o+n),e.quadraticCurveTo(t,o+n,t,o+n-r),e.lineTo(t,o+r),e.quadraticCurveTo(t,o,t+r,o),e.closePath()}function vi(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function bi(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function xi(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function wi(e){return(t,o,i,n)=>{e(t,o.filter(xi),{x:i.r,y:i.r},n)}}var Ai=wi(s),Si=wi(M),ki=wi(I),Ri=wi(T),Ci=e=>[ui,...e],_i={bar:Ci([Ai]),clusterbar:Ci([Ai]),point:Ci([Si,ki]),swarm:Ci([Si,ki]),pie:[li],donut:[li],boxplot:Ci([ci,Si]),violin:Ci([hi]),histogram:Ci([Ai]),ridgeline:Ci([hi]),timeline:Ci([Ai]),funnel:[Ai,di,(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0===n.length||!n.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX))return;const r=qt(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px "+r;for(const t of n){const o=t.datum;if(!o)continue;if(!o.__funnelStepLabel)continue;const i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;const n=o.__funnelStepLabelX,r=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,n,r),e.fillStyle="#fff",e.fillText(i,n,r)}e.font="bold 13px "+r;for(const t of n){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const n=o.__funnelValue;if(null==n||0===n)continue;const r=o.__funnelPercent,a=!0===o.__funnelIsFirstStep;let s;if(s=a?mi(n):null!=r?`${mi(n)} (${gi(r)})`:mi(n),e.measureText(s).width+16>i){if(a||null==r)continue;if(s=mi(n),e.measureText(s).width+16>i)continue}const l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(s,l,c),e.fillStyle="#fff",e.fillText(s,l,c)}e.lineWidth=1,e.lineJoin="miter"}],"bar-funnel":[Ai,(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of n){const o=("string"==typeof t.style.fill?t.style.fill:null)||qt(e,"var(--semiotic-border, #999)"),i=fi(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{const n=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===n.length)return;const r=qt(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif",a=function(e,t){const[o,i,n]=$t(e,t);return(.2126*o+.7152*i+.0722*n)/255>.6}(e,qt(e,"var(--semiotic-text, #333)")),s=a?"#1f2937":"#ffffff",l=a?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",c=a?"#f3f4f6":"#1a1a1a",h=c;for(const t of n){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const n=o.__barFunnelPercent,a=!(!0===o.__barFunnelIsFirstStep)&&null!=n,u=a?bi(n):"",d=vi(i);e.font="bold 13px "+r;const m=a?e.measureText(u).width:0;e.font="11px "+r;const g=e.measureText(d).width,p=Math.max(m,g)+12,f=a?32:17,y=o.__barFunnelLabelX,v=y-p/2,b=o.__barFunnelLabelY-f-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),yi(e,v,b,p,f,4),e.fill(),e.restore(),e.strokeStyle=l,e.lineWidth=.5,e.beginPath(),yi(e,v,b,p,f,4),e.stroke(),e.textAlign="center",e.textBaseline="top",a?(e.font="bold 13px "+r,e.fillStyle=c,e.fillText(u,y,b+3),e.font="11px "+r,e.fillStyle=h,e.fillText(d,y,b+3+13+2)):(e.font="bold 11px "+r,e.fillStyle=c,e.fillText(d,y,b+3))}e.lineWidth=1}],swimlane:Ci([Ai]),custom:Ci([Ai,Si,ki,Ri,li,ci,hi,di])};import*as Pi from"react";import{jsx as Li,jsxs as Mi}from"react/jsx-runtime";function Ii(e){return"connector"===e.node.type}function Ti(e,t,o,i){if(2>e.length)return null;const n=e[0].node,r=n.style.fill;if(!r||"none"===r)return null;const a=ot(`${t?t+"-":""}connector-${o}-${i}-hatch`),s=Vt(r)?zt(r,a):null,l=[`${n.x1},${n.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=Mi(Pi.Fragment,{children:[s&&Li("defs",{children:s}),Li("polygon",{points:l,fill:s?`url(#${a})`:st(r,"#999"),opacity:n.style.fillOpacity??n.style.opacity??.3,"data-semiotic-connector-fill":n.group||"_default"})]});return St(c,n,`ordinal-connector-fill-${o}-${i}`)}function Hi(e,t,o){const i=new Map;for(const t of e){if(!Ii(t))continue;const e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;const n=Array.from(i.values()).map((e,i)=>Mi("g",{children:[Ti(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),r=e[0],a=Ii(r)?null:r.element;for(const e of i.values())for(const t of e)t.element=null;r.element=Mi(Pi.Fragment,{children:[n,a]},"ordinal-connector-run-"+o)}function Bi(e){const t=K({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>qe(t,o,e.idPrefix)});let o=0;for(let i=0;t.length>i;){if(t[i].renderedByBackend){i++;continue}let n=i+1;for(;t.length>n&&!t[n].renderedByBackend;)n++;Hi(t.slice(i,n),e.idPrefix,o++),i=n}return t}import{jsx as Oi,jsxs as Fi}from"react/jsx-runtime";function Di(e){const t=rt(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:Fi("div",{className:"semiotic-tooltip",style:Oe,children:[null!=t.title&&Oi("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>Fi("div",{children:[Fi("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function Ei({hover:e}){const t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){const e=i||t[0]?.category||"";if(o)return Fi("div",{className:"semiotic-tooltip",style:Oe,children:[e&&Oi("div",{style:{fontWeight:"bold"},children:e+""}),Fi("div",{children:["n = ",o.n]}),Fi("div",{children:["Min: ",o.min.toLocaleString()]}),Fi("div",{children:["Q1: ",o.q1.toLocaleString()]}),Fi("div",{children:["Median: ",o.median.toLocaleString()]}),Fi("div",{children:["Q3: ",o.q3.toLocaleString()]}),Fi("div",{children:["Max: ",o.max.toLocaleString()]}),Fi("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const n=t.length;return Fi("div",{className:"semiotic-tooltip",style:Oe,children:[e&&Oi("div",{style:{fontWeight:"bold"},children:e+""}),Fi("div",{children:[n," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return Fi("div",{className:"semiotic-tooltip",style:Oe,children:[t.category&&Oi("div",{style:{fontWeight:"bold"},children:t.category+""}),Fi("div",{children:["Count: ",t.count]}),2===e.length&&Fi("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const n=e.__oAccessor,r=e.__rAccessor,a=e.__chartType;if("swarm"===a||"point"===a)return Di(t);const s=(n&&null!=t[n]?t[n]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(r&&null!=t[r]?t[r]:null)??t.value??t.__rValue??t.pct??"";return s||""!==l?Fi("div",{className:"semiotic-tooltip",style:Oe,children:[s&&Oi("div",{style:{fontWeight:"bold"},children:s+""}),""!==l&&Oi("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):Di(t)}Ei.ownsChrome=!0;import{jsx as ji,jsxs as Ni}from"react/jsx-runtime";var Wi=H,zi=Kt(Qt(function(e,t){const{chartType:o,runtimeMode:i,data:n,oAccessor:r="category",rAccessor:a="value",colorAccessor:s,symbolAccessor:c,symbolMap:m,stackBy:g,groupBy:p,multiAxis:f,timeAccessor:y,valueAccessor:v,categoryAccessor:b,accessorRevision:x,projection:w="vertical",size:A=[600,400],responsiveWidth:k,responsiveHeight:_,margin:P,maxDevicePixelRatio:M,barPadding:I,roundedTop:T,gradientFill:H,trackFill:O,baselinePadding:F,innerRadius:D,cornerRadius:E,normalize:j,startAngle:N,sweepAngle:z,dynamicColumnWidth:V,bins:G,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:K,connectorAccessor:U,connectorStyle:re,dataIdAccessor:se,rExtent:le,oExtent:ce,extentPadding:he=.05,oSort:ue,windowMode:de="sliding",windowSize:ye=200,pieceStyle:xe,summaryStyle:we,renderMode:Re,colorScheme:Ce,barColors:_e,showAxes:Pe=!0,showCategoryTicks:Le,categoryLabel:Me,valueLabel:Te,categoryFormat:He,valueFormat:Be,oLabel:Oe,rLabel:Ne,oFormat:We,rFormat:ze,rTickValues:Ve,tickLabelEdgeAlign:Ge,axisExtent:qe,enableHover:Ye=!0,hoverRadius:Qe=30,hoverAnnotation:Ke,tooltipContent:Ze,customHoverBehavior:Ue,customClickBehavior:Je,onObservation:et,annotationObservationCallback:tt,chartId:ot,annotations:rt,onAnnotationActivate:st,autoPlaceAnnotations:ct,svgAnnotationRules:ht,showGrid:dt=!1,legend:mt,legendHoverBehavior:vt,legendClickBehavior:bt,legendHighlightedCategory:xt,legendIsolatedCategories:At,legendPosition:St,legendLayout:kt,legendCategoryAccessor:Ct,onCategoriesChange:_t,backgroundGraphics:Pt,foregroundGraphics:Lt,title:Mt,className:It,background:Tt,centerContent:Ht,decay:Bt,pulse:Ot,transition:Ft,animate:Dt,staleness:Et,frameScheduler:jt,clock:Nt,random:Wt,seed:zt,paused:Vt=!1,suspendWhenHidden:Gt=!0,brush:$t,onBrush:qt,accessibleTable:Xt=!0,description:Yt,summary:Qt,customLayout:Kt,onLayoutError:io,layoutConfig:no,layoutSelection:ro}=e,{customHoverBehavior:ao,customClickBehavior:so,hasClickBehavior:lo}=C({customHoverBehavior:Ue,customClickBehavior:Je,onObservation:et,chartId:ot,chartType:"StreamOrdinalFrame"}),co=b??r,ho=v??a,uo=Me??Oe,mo=Te??Ne,go=He??We,po=Be??ze,fo=to(!0),yo=gt({sizeProp:A,responsiveWidth:k,responsiveHeight:_,userMargin:P,marginDefault:Wi,title:Mt,legend:mt,legendPosition:St,...u(e,mt),animate:Dt,transitionProp:Ft,frameScheduler:jt,clock:Nt,random:Wt,seed:zt,paused:Vt,suspendWhenHidden:Gt,themeDirtyRef:fo}),{reducedMotionRef:vo,responsiveRef:bo,size:xo,margin:wo,adjustedWidth:Ao,adjustedHeight:So,currentTheme:ko,transition:Ro,introEnabled:Co,tableId:_o,rafRef:Po,renderFnRef:Mo,scheduleRender:Io,frameRuntime:To}=yo;Ut(()=>at(()=>{fo.current=!0,Io()}),[Io]);const Ho=ft(),Bo=wt(),Oo=eo(()=>Fe(n),[n]),Fo=to(null),Do=to(!1),[Eo,jo]=oo(null),[No,Wo]=oo(null),zo=Z(Lt,xo,wo,No),$o=Z(Pt,xo,wo,No),qo=Pt||"transparent"===Tt?null:ji("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-wo.left,y:-wo.top,width:xo[0],height:xo[1],fill:Tt||"var(--semiotic-bg, transparent)"}),Xo=Pt&&Tt&&"transparent"!==Tt?ji("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-wo.left,y:-wo.top,width:xo[0],height:xo[1],fill:Tt}):null,[Yo,Qo]=oo(0),Zo=to(0),[Jo,ei]=oo(!1),ti=to({w:-1,h:-1}),oi=to(!1),ni=yt("StreamOrdinalFrame"),ri=Ye||Ke,ai="streaming"===i,si=eo(()=>({chartType:o,runtimeMode:ai?"streaming":"bounded",windowSize:ye,windowMode:de,extentPadding:he,projection:w,oAccessor:ai?void 0:co,rAccessor:ai?void 0:ho,accessorRevision:x,colorAccessor:s,symbolAccessor:c,symbolMap:m,stackBy:g,groupBy:p,multiAxis:f,timeAccessor:ai?y:void 0,valueAccessor:ai?v||("string"==typeof ho||"function"==typeof ho?ho:void 0):void 0,categoryAccessor:ai?co:void 0,rExtent:le,oExtent:ce,axisExtent:qe,barPadding:I,roundedTop:T,gradientFill:L(H),trackFill:O,baselinePadding:F,innerRadius:D,cornerRadius:E,normalize:j,startAngle:N,sweepAngle:z,dynamicColumnWidth:V,bins:G,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:K,connectorAccessor:U,connectorStyle:re,dataIdAccessor:se,oSort:ue,pieceStyle:xe,summaryStyle:we,colorScheme:Ce,themeCategorical:ko?.colors?.categorical,themeSemantic:Rt(ko),themeSequential:ko?.colors?.sequential,themeDiverging:ko?.colors?.diverging,barColors:_e,decay:Bt,pulse:Ot,transition:Ro,introAnimation:Co,staleness:Et,clock:To.now,customLayout:Kt,onLayoutError:io,layoutConfig:no,layoutMargin:wo}),[o,ai,ye,de,he,w,co,ho,x,s,c,m,g,p,f,y,v,le,ce,qe,I,T,H,O,F,D,E,j,N,z,V,G,$,q,X,Y,K,U,re,se,ue,xe,we,Ce,ko,_e,Bt,Ot,Ro,Co,Et,To.now,Kt,io,no,wo]),li=ie(si),ci=to(null);ci.current||(ci.current=new Lo(li));const hi=oe(ci,Ct,_t,e=>e.getData());ee(ci,li,fo,Io),te(ci,ro,fo,Io);const ui=to(null);ui.current||(ui.current=new l(e=>{const t=ci.current;t&&t.ingest(e)&&(fo.current=!0,Io())}));const di=Zt(e=>{ui.current?.push(e)},[]),mi=Zt(e=>{ui.current?.pushMany(e)},[]),gi=Zt(()=>{ui.current?.clear(),ci.current?.clear(),fo.current=!0,Io()},[Io]),pi=Zt(e=>{ui.current?.clearLastData(),ui.current?.setReplacementData(e)},[]);Jt(t,()=>({push:di,pushMany:mi,replace:pi,remove:e=>{ui.current?.flush();const t=ci.current?.remove(e)??[];if(t.length>0){const e=Fo.current?.data;!!Fo.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(Fo.current=null,jo(null)),fo.current=!0,Io()}return t},update:(e,t)=>{ui.current?.flush();const o=ci.current?.update(e,t)??[];return o.length>0&&(fo.current=!0,Io()),o},clear:gi,getData:()=>(ui.current?.flush(),ci.current?.getData()??[]),getScales:()=>ci.current?.scales??null,getCustomLayout:()=>ci.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>ci.current?.lastCustomLayoutFailure??null}),[di,mi,pi,gi,Io]),Ut(()=>{n&&ui.current?.setBoundedData(Oo)},[n,Oo]);const{canvasRef:fi,resolutionDirtyRef:yi}=pt(yo,{storeRef:ci,dirtyRef:fo,hydrated:Ho,wasHydratingFromSSR:Bo,cleanup:()=>ui.current?.clear(),maxDevicePixelRatio:M,canvasPaintDependencies:[o,Ao,So,Pe,Tt,Pt,Re,Io]}),{hoverHandlerRef:vi,hoverLeaveRef:bi,onPointerMove:xi,onPointerLeave:wi,pointerStateRef:Ai}=yo;vi.current=e=>{const t=fi.current;if(!t)return;const i=ci.current;if(!i)return void nt(t);const n=Vo({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:wo.left,top:wo.top},width:Ao,height:So,projection:w,hoverRadius:Qe,scene:i.scene,pointQuadtree:i.pointQuadtree,maxPointRadius:i.maxPointRadius});if(nt(t,"hit"===n.kind?it(n.hit.node):void 0),!ri)return;if("hit"!==n.kind)return void(Fo.current&&(Fo.current=null,jo(null),ao&&ao(null),Io()));const r=Go(n.hit,{oAccessor:co,rAccessor:ho,chartType:o});Fo.current=r,jo(r),ao?.(r),Io()},bi.current=()=>{nt(fi.current),Fo.current&&(Fo.current=null,jo(null),ao?.(null),Io())},ut(fi);const Si=Zt(e=>{if(Ee(e.target))return;if(!so)return;const t=fi.current;if(!t)return so(null),void Io();const i=ci.current;if(!i)return so(null),void Io();const n=Vo({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:wo.left,top:wo.top},width:Ao,height:So,projection:w,hoverRadius:Qe,scene:i.scene,pointQuadtree:i.pointQuadtree,maxPointRadius:i.maxPointRadius});if("hit"!==n.kind)return so(null),void Io();so(Go(n.hit,{oAccessor:co,rAccessor:ho,chartType:o}),{type:"activate",inputType:$e(e.nativeEvent.pointerType)}),Io()},[so,fi,wo.left,wo.top,Ao,So,w,Qe,co,ho,o,Io]),{kbFocusIndexRef:ki,focusedNavPointRef:Ri,onKeyDown:Ci}=R({storeRef:ci,hoverRef:Fo,setHoverPoint:jo,customHoverBehavior:ao,customClickBehavior:so,scheduleRender:Io,chartType:o,oAccessor:co,rAccessor:ho}),Pi=Zt(e=>{J(Ai,e,!!ri,Do.current,fi.current,"mouse")&&(ki.current=-1,Ri.current=null,xi(e))},[fi,ri,Ri,ki,xi,Ai]);Mo.current=()=>{if(Po.current=null,!To.isActive)return;const e=fi.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=ci.current;if(!i)return;const n=To.now(),r=null!=i.activeTransition,a=i.advanceTransition(vo.current?n+1e6:n),s=!vo.current&&a,l=ti.current.w!==Ao||ti.current.h!==So,c=fo.current,h=i.consumeStylePaintPending();let u=!1;const d=ni.current.beforeCompute(i.getLastUpdateResult(),s);var m;!c&&!l||s&&!l||(i.computeScene({width:Ao,height:So}),ti.current={w:Ao,h:So},u=!0,hi()),(u||h)&&(Do.current=lt(e,i.scene)),Do.current&&(r||u||h)&&Xe((m={canvas:e,pointer:Ai.current,store:i,margin:{left:wo.left,top:wo.top},width:Ao,height:So,projection:w,hoverRadius:Qe,geometryMoved:r||u}).canvas,m.pointer,e=>{const t=Vo({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?it(t.hit.node):void 0}),ni.current.afterCompute(d,u,l),fo.current=c&&s&&!u,yi.current=!1;const g=S(i,n,u,oi);(u||s)&&e.setAttribute("aria-label",Ie(i.scene,o+" chart"));const p=De(M,xo),f=xo[0]*p,y=xo[1]*p;e.width===f&&e.height===y||(e.width=f,e.height=y,e.style.width=xo[0]+"px",e.style.height=xo[1]+"px"),t.setTransform(p,0,0,p,0,0),t.clearRect(0,0,xo[0],xo[1]);const v=Et&&i.lastIngestTime>0&&n-i.lastIngestTime>(Et?.threshold??5e3);v&&(t.globalAlpha=Et?.dimOpacity??.5);const b="radial"===w;t.save(),t.beginPath(),t.rect(wo.left,wo.top,Ao,So),t.clip(),b?(t.save(),t.translate(wo.left+Ao/2,wo.top+So/2)):t.translate(wo.left,wo.top);const x=Kt?_i.custom:_i[o]||[],A={width:Ao,height:So},k=i.scales;k&&Q({context:t,nodes:i.scene,renderMode:Re,pixelRatio:p,paintBuiltIn:e=>{for(const o of x)o(t,e,k,A)}}),b&&t.restore(),t.restore(),v&&(t.globalAlpha=1),u&&i.scales?(Wo(i.scales),Qo(e=>e+1),Zo.current=n):s&&i.scales&&n-Zo.current>=33&&(Qo(e=>e+1),Zo.current=n),Et?.showBadge&&ei(!!v),(s||null!=i.activeTransition||g.pending)&&Io()},ne(Et,ci,fo,Io,To.now,Jo,ei);const Li=ri&&Eo?Ze?Ze(Eo):ji(Ei,{hover:Eo}):null,Mi="radial"===w,Ii=Li?ji(ve,{x:Eo?Mi?Eo.x+Ao/2:Eo.x:0,y:Eo?Mi?Eo.y+So/2:Eo.y:0,containerWidth:Ao,containerHeight:So,margin:wo,className:"stream-ordinal-tooltip",children:Li}):null,Ti="horizontal"===w?co:ho,Hi=d("horizontal"===w?ho:co,void 0,"__semiotic_resolvedO",""),Oi=d(Ti,void 0,"__semiotic_resolvedR",""),Fi=Hi.key,Di=Oi.key,zi=h(Hi,Oi,rt&&rt.length>0||!1);if(je||!Ho&&Bo){const e=ci.current;e&&n&&(e.ingest({inserts:Oo,bounded:!0}),e.computeScene({width:Ao,height:So}));const t=e?.scene??[],o=e?.scales??null,i=Z(Lt,xo,wo,o),r=Z(Pt,xo,wo,o),a="radial"===w,s=a?wo.left+Ao/2:wo.left,l=a?wo.top+So/2:wo.top;return Ni("div",{ref:bo,className:"stream-ordinal-frame"+(It?" "+It:""),role:"img","aria-label":Yt||("string"==typeof Mt?Mt:"Ordinal chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:k?"100%":xo[0],height:_?"100%":xo[1]},children:[ji(Se,{summary:Qt}),Ni("svg",{xmlns:"http://www.w3.org/2000/svg",width:xo[0],height:xo[1],style:{position:"absolute",left:0,top:0},children:[Ni("g",{transform:`translate(${wo.left},${wo.top})`,children:[Tt&&ji("rect",{x:0,y:0,width:Ao,height:So,fill:Tt}),r]}),ji("g",{transform:`translate(${s},${l})`,children:Bi({nodes:t,renderMode:Re,idPrefix:_o}).map(e=>e.element)})]}),ji(Uo,{width:Ao,height:So,totalWidth:xo[0],totalHeight:xo[1],margin:wo,scales:o,showAxes:Pe,showCategoryTicks:Le,oLabel:uo,rLabel:mo,oFormat:go,rFormat:po,rTickValues:Ve,tickLabelEdgeAlign:Ge,axisExtent:qe,showGrid:dt,title:Mt,legend:mt,legendHoverBehavior:vt,legendClickBehavior:bt,legendHighlightedCategory:xt,legendIsolatedCategories:At,legendPosition:St,legendLayout:kt,foregroundGraphics:W(i,ae(ci.current?.customLayoutOverlays,ro??null)),annotations:rt,onAnnotationActivate:st,onObservation:tt??et,chartId:ot,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ct,svgAnnotationRules:ht,annotationFrame:0,xAccessor:Fi,yAccessor:Di,annotationData:zi(e?.getData())}),Ht&&"radial"===w&&ji("div",{style:{position:"absolute",left:wo.left+Ao/2,top:wo.top+So/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:Ht})]})}return Ni("div",{ref:bo,className:"stream-ordinal-frame"+(It?" "+It:""),role:"group","aria-label":Yt||("string"==typeof Mt?Mt:"Ordinal chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:k?"100%":xo[0],height:_?"100%":xo[1],overflow:"visible"},onKeyDown:Ci,children:["production"!==process.env.NODE_ENV&&ci.current&&ji(Ae,{store:ci.current,diagnostics:ni.current}),Xt&&Ni(ge,{accessibleTable:Xt,children:[ji(ke,{tableId:_o}),ji(me,{scene:ci.current?.scene??[],chartType:o+" chart",tableId:_o,chartTitle:"string"==typeof Mt?Mt:void 0})]}),ji(Se,{summary:Qt}),ji(pe,{hoverPoint:Eo}),Ni("div",{role:"img","aria-label":Yt||("string"==typeof Mt?Mt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Pi,onMouseLeave:wi,onClick:lo?Si:void 0,children:[Ni(fe,{size:xo,margin:wo,children:[Xo,qo,$o]}),ji(Ko,{width:Ao,height:So,totalWidth:xo[0],totalHeight:xo[1],margin:wo,scales:No,showAxes:Pe,showGrid:dt,rFormat:po,rTickValues:Ve,axisExtent:qe}),ji("canvas",{ref:fi,"aria-label":Ie(ci.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:xo[0],height:xo[1]}}),ji(Uo,{width:Ao,height:So,totalWidth:xo[0],totalHeight:xo[1],margin:wo,scales:No,showAxes:Pe,showCategoryTicks:Le,oLabel:uo,rLabel:mo,oFormat:go,rFormat:po,rTickValues:Ve,axisExtent:qe,showGrid:dt,title:Mt,legend:mt,legendHoverBehavior:vt,legendClickBehavior:bt,legendHighlightedCategory:xt,legendIsolatedCategories:At,legendPosition:St,legendLayout:kt,foregroundGraphics:W(zo,ae(ci.current?.customLayoutOverlays,ro??null)),annotations:rt,onAnnotationActivate:st,onObservation:tt??et,chartId:ot,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ct,svgAnnotationRules:ht,annotationFrame:Yo,xAccessor:Fi,yAccessor:Di,annotationData:zi(ci.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),($t||qt)&&"radial"!==w&&ji(ii,{width:Ao,height:So,totalWidth:xo[0],totalHeight:xo[1],margin:wo,scales:No,onBrush:qt||(()=>{})}),Ht&&"radial"===w&&ji("div",{style:{position:"absolute",left:wo.left+Ao/2,top:wo.top+So/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:Ht}),Et?.showBadge&&ji(B,{isStale:Jo,position:Et.badgePosition}),ji(be,{active:ki.current>=0,hoverPoint:Eo,margin:wo,size:xo,shape:Ri.current?.shape,width:Ri.current?.w,height:Ri.current?.h}),Ii]})]})}));zi.displayName="StreamOrdinalFrame";var Vi=zi;import{useMemo as Gi,forwardRef as $i,useRef as qi}from"react";import{useImperativeHandle as Xi}from"react";function Yi({ref:e,frameRef:t,setup:o}){return Xi(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}import{useMemo as Qi}from"react";function Ki(e){const{colorBy:t,colorScale:o,color:i,themeCategorical:n,colorScheme:r,categoryIndexMap:a,userPieceStyle:s,stroke:l,strokeWidth:c,opacity:h,effectiveSelectionHook:u,resolvedSelection:d,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=Qi(()=>(e,s)=>{const l="function"==typeof g?g(e,s):g,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=Lt(e,t,o)}else c.fill=Ue(i,n,r,m?s:void 0,a);if(f&&f.length>0){const t=tt(e,f,{value:y?y(e,s):void 0,category:s});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,n,r,a,m,g,p,f,y]),b=Qi(()=>X(s?"function"==typeof s?(e,t)=>({...v(e,t),...s(e,t)||{}}):(e,t)=>({...v(e,t),...s}):v,{stroke:l,strokeWidth:c,opacity:h}),[v,s,l,c,h]);return Qi(()=>kt(b,u??null,d),[b,u,d])}import{useCallback as Zi,useMemo as Ui,useRef as Ji}from"react";function en({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const n=Ui(()=>ze("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),r="string"==typeof i?i:"value",a=ht({name:n?.name||"__unused_ordinal_brush__",xField:n?.xField||r}),s=Ji(a.brushInteraction);s.current=a.brushInteraction;const l=Zi(e=>{if(n){s.current.end(e?e.r:null)}t?.(e)},[t,n]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as tn}from"react/jsx-runtime";var on=$i(function(t,n){const r=dt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),a=qi(null),{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,sort:f=!1,barPadding:y=40,roundedTop:v,gradientFill:b=!1,styleRules:x,baselinePadding:w=!1,tooltip:A,annotations:S,regression:k,valueExtent:R,frameProps:C={},selection:_,linkedHover:P,linkedBrush:M,brush:I,onBrush:T,onObservation:H,onClick:B,hoverHighlight:O,chartId:E,loading:W,loadingContent:z,emptyContent:V,legendInteraction:G,legendPosition:$,color:q,stroke:X,strokeWidth:Y,opacity:Q,showCategoryTicks:K,categoryFormat:Z,dataIdAccessor:U}=t,{width:J,height:ee,enableHover:te,showGrid:oe,showLegend:ie,title:ne,description:re,summary:ae,accessibleTable:se,categoryLabel:le,valueLabel:ce}=r,he=Gi(()=>Fe(s),[s]),ue=i({data:he,rawData:s,colorBy:g,colorScheme:p,legendInteraction:G,legendPosition:$,frameLegend:C,selection:_,linkedHover:P,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!0,onObservation:H,onClick:B,hoverHighlight:O,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BarChart",chartId:E,showLegend:ie,userMargin:l,marginDefaults:r.marginDefaults,loading:W,loadingContent:z,emptyContent:V,width:J,height:ee,hasTitle:!!ne,axisChrome:et({showAxes:r.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!le,hasValueLabel:!!ce})}),{effectiveLegendProps:de,effectiveMargin:me}=Yi({ref:n,frameRef:a,setup:ue});At("BarChart",he,"categoryAccessor",h),At("BarChart",he,"valueAccessor",u);const ge=vt(he,f,u),pe=bt(),fe=Gi(()=>new Map,[]),ve=Gi(()=>We(u),[u]),be=en({brushProp:I,onBrushProp:T,linkedBrush:M,valueAccessor:u}),xe=Ki({colorBy:g,colorScale:ue.colorScale,color:q,themeCategorical:pe,colorScheme:p,categoryIndexMap:fe,userPieceStyle:C?.pieceStyle,stroke:X,strokeWidth:Y,opacity:Q,styleRules:x,resolveRuleValue:ve,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection}),Ae=Gi(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:g&&g!==h?g:void 0,groupLabel:"string"==typeof g?g:"group",valueFormat:m}),[h,u,g,m]),Se=Gi(()=>L(b),[b]);if(ue.earlyReturn)return ue.earlyReturn;const ke=o({componentName:"BarChart",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(ke)return tn(ye,{componentName:"BarChart",message:ke,width:J,height:ee});const Re=e(k),Ce=Re?[Re,...S||[]]:S,_e={chartType:"bar",...null!=s&&{data:ge},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:xe,size:[J,ee],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:me,barPadding:y,...null!=v&&{roundedTop:v},...Se&&{gradientFill:Se},...U&&{dataIdAccessor:U},baselinePadding:w,enableHover:te,showAxes:r.showAxes,oLabel:le,rLabel:ce,rFormat:m,...Z&&{oFormat:Z},showGrid:oe,showCategoryTicks:K,oSort:f,...de,...F({title:ne,description:re,summary:ae,accessibleTable:se,className:c,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...N({tooltip:A,defaultTooltipContent:Ae}),...D({linkedHover:P,selection:_,onObservation:H,onClick:B,hoverHighlight:O,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...Ce&&Ce.length>0&&{annotations:Ce},...R&&{rExtent:R},...be.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return tn(we,{componentName:"BarChart",width:J,height:ee,children:tn(Vi,{ref:a,..._e})})});on.displayName="BarChart";import{useMemo as nn,forwardRef as rn,useRef as an}from"react";import{jsx as sn}from"react/jsx-runtime";var ln=rn(function(e,t){const n=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=an(null),{data:a,margin:s,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,normalize:f=!1,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x,styleRules:w,baselinePadding:A=!1,tooltip:S,annotations:k,valueExtent:R,frameProps:C={},selection:_,linkedHover:P,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:O,emptyContent:E,legendInteraction:W,legendPosition:z,color:V,stroke:G,strokeWidth:$,opacity:q,categoryFormat:X}=e,{width:Y,height:Q,enableHover:K,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:ne}=n,re=nn(()=>Fe(a),[a]),ae=g||h,se=i({data:re,rawData:a,colorBy:ae,colorScheme:p,legendInteraction:W,legendPosition:z,frameLegend:C,selection:_,linkedHover:P,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:U,userMargin:s,marginDefaults:n.marginDefaults,loading:B,loadingContent:O,emptyContent:E,width:Y,height:Q,hasTitle:!!J,axisChrome:et({showAxes:n.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!ne})}),le=bt(),ce=nn(()=>new Map,[]),he=nn(()=>We(u),[u]),ue=Ki({colorBy:ae,colorScale:se.colorScale,color:V,themeCategorical:le,colorScheme:p,categoryIndexMap:ce,userPieceStyle:C?.pieceStyle,stroke:G,strokeWidth:$,opacity:q,styleRules:w,resolveRuleValue:he,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection}),de=nn(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),me=o({componentName:"StackedBarChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:ge,effectiveMargin:pe}=Yi({ref:t,frameRef:r,setup:se}),fe=nn(()=>L(x),[x]);if(se.earlyReturn)return se.earlyReturn;const ve={chartType:"bar",...null!=a&&{data:re},oAccessor:c,rAccessor:u,stackBy:h,normalize:f,oSort:y,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ue,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:v,...null!=b&&{roundedTop:b},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:n.showAxes,oLabel:ie,rLabel:ne,rFormat:m,...X&&{oFormat:X},showGrid:Z,...ge,...F({title:J,description:ee,summary:te,accessibleTable:oe,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:S,defaultTooltipContent:de}),...D({linkedHover:P,selection:_,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...k&&k.length>0&&{annotations:k},...R&&{rExtent:R},...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return me?sn(ye,{componentName:"StackedBarChart",message:me,width:Y,height:Q}):sn(we,{componentName:"StackedBarChart",width:Y,height:Q,children:sn(Vi,{ref:r,...ve})})});ln.displayName="StackedBarChart";import*as cn from"react";import{useMemo as hn,useCallback as un,forwardRef as dn,useRef as mn,useImperativeHandle as gn}from"react";import{useMemo as pn,useCallback as fn,useRef as yn}from"react";var vn={RdBu:Bt,PiYG:Ht,PRGn:Tt,BrBG:It,RdYlBu:Ot,RdYlGn:Ft,Spectral:Dt},bn="__likert_neutral_neg",xn="__likert_neutral_pos";function wn(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function An(e,t,o,i,n,r,a={}){const s=new Map,l=new Set(t);for(const a of e){const e=o(a);s.has(e)||s.set(e,new Map);const c=s.get(e);if(i){const e=i(a);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}const o=e-1;if(0>o||o>=t.length)continue;const n=t[o];c.set(n,(c.get(n)||0)+1)}else if(n&&r){const e=n(a),t=r(a);if(!l.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const c=[];for(const[e,o]of s){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let n=0;t.length>n;n++){const r=t[n],s=o.get(r)||0,l={};a.category&&(l[a.category]=e),a.level&&(l[a.level]=r),a.count&&(l[a.count]=s),a.score&&(l[a.score]=n+1),c.push({...l,__likertCategory:e,__likertLevel:r,__likertLevelLabel:r,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:n})}}return c}function Sn(e,t){const o=t.length,i=o%2!=0,n=Math.floor(o/2),r=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===n){const e=t.__likertPct/2;r.push({...t,__likertLevel:bn,__likertPct:-e}),r.push({...t,__likertLevel:xn,__likertPct:e})}else r.push(n>e?{...t,__likertPct:-t.__likertPct}:t)}return r}function kn(e,t){const o=t.length,i=o%2!=0,n=Math.floor(o/2),r=new Map;for(const t of e){const e=r.get(t.__likertCategory)||[];e.push(t),r.set(t.__likertCategory,e)}const a=[];for(const[,e]of r){const t=new Map;let r,s;for(const o of e)o.__likertLevel===bn?r=o:o.__likertLevel===xn?s=o:t.set(o.__likertLevelIndex,o);i&&r&&a.push(r);for(let e=n-1;e>=0;e--){const o=t.get(e);o&&a.push(o)}i&&s&&a.push(s);for(let e=i?n+1:n;o>e;e++){const o=t.get(e);o&&a.push(o)}}return a}var Rn=["Very Low","Low","Neutral","High","Very High"];import{jsx as Cn}from"react/jsx-runtime";var _n=new Map;function Pn(e){const t=e.__likertPct??e.data?.__likertPct;return"number"==typeof t&&Number.isFinite(t)?t:void 0}var Ln=dn(function(e,t){const n=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=mn(null),{data:s,margin:l,className:c,categoryAccessor:h="question",valueAccessor:u,levelAccessor:d,countAccessor:m="count",levels:g=Rn,orientation:p="horizontal",colorScheme:f,barPadding:y=20,styleRules:v,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:S,linkedHover:k,onObservation:R,onClick:C,hoverHighlight:_,chartId:P,valueFormat:L,loading:M,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,categoryFormat:O,stroke:F,strokeWidth:E,opacity:j}=e,{width:N,height:W,enableHover:z,showGrid:V,showLegend:G,title:$,description:q,summary:X,accessibleTable:Y,categoryLabel:Q,valueLabel:K}=n,Z="horizontal"===p,U=void 0===s,J=!d,ee=xt(),te=hn(()=>f&&Array.isArray(f)&&f.length>=g.length?f:function(e,t){if(0>=e)return[];if(t&&Object.prototype.hasOwnProperty.call(vn,t)){const o=vn[t];if(1===e)return[o(.5)];const i=[];for(let t=0;e>t;t++)i.push(o(t/(e-1)));return i}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],n="#a8a8a8";if(1===e)return[n];const r=e%2!=0,a=Math.floor(e/2),s=[];for(let e=0;a>e;e++)s.push(o[Math.min(Math.floor(e*o.length/a),o.length-1)]);r&&s.push(n);for(let e=0;a>e;e++)s.push(i[Math.min(Math.floor(e*i.length/a),i.length-1)]);return s}(g.length,ee),[f,g.length,ee]),oe=hn(()=>{const e=new Map;for(let t=0;g.length>t;t++)e.set(g[t],te[t]||"#888");return e},[g,te]),ie=hn(()=>{if(!1!==G)return{legendGroups:[{styleFn:e=>({fill:oe.get(e.label)||"#888"}),items:g.map(e=>({label:e})),label:""}]}},[G,g,oe]),ne=hn(()=>Object.hasOwn(A,"legend")?A:{...A,legend:ie},[A,ie]),{processedData:re,reAggregate:ae,accumulatorRef:se}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:n,countAccessor:r,isDiverging:a,frameRef:s}){const l=!n,c=pn(()=>wn(o,"question"),[o]),h=pn(()=>l?wn(i,"score"):null,[l,i]),u=pn(()=>l?null:wn(n,"level"),[l,n]),d=pn(()=>l?null:wn(r,"count"),[l,r]),m=yn([]),g=pn(()=>({category:"string"==typeof o?o:void 0,level:"string"==typeof n?n:void 0,count:"string"==typeof r?r:void 0,score:n||"string"!=typeof i?void 0:i}),[o,r,n,i]);return{processedData:pn(()=>{const o=e||[];if(0===o.length)return[];let i=An(o,t,c,h,u,d,g);return a&&(i=Sn(i,t),i=kn(i,t)),i},[e,t,c,h,u,d,g,a]),reAggregate:fn(e=>{let o=An(e,t,c,h,u,d,g);a&&(o=Sn(o,t),o=kn(o,t)),s.current?.replace(o)},[t,c,h,u,d,g,a,s]),accumulatorRef:m}}({data:s,levels:g,categoryAccessor:h,valueAccessor:u,levelAccessor:d,countAccessor:m,isDiverging:Z,frameRef:r}),le="__likertLevelLabel",ce=a({isPushMode:U,colorBy:le,colorScheme:te,showLegend:G,legendPosition:B}),{wrapPush:he,wrapPushMany:ue}=ce,de=un(e=>he(e=>{se.current.push(e),ae(se.current)})(e),[he,ae,se]),me=un(e=>ue(e=>{se.current.push(...e),ae(se.current)})(e),[ue,ae,se]);gn(t,()=>({push:de,pushMany:me,remove:e=>r.current?.remove(e)??[],update:(e,t)=>r.current?.update(e,t)??[],replace:e=>r.current?.replace(e),clear:()=>{se.current=[],ce.resetCategories(),r.current?.clear()},getData:()=>r.current?.getData()??[],getScales:()=>r.current?.getScales()??null}),[de,me,se,ce]);const ge=i({data:re,rawData:s,colorBy:le,colorScheme:te,legendInteraction:H,legendPosition:B,frameLegend:ne,selection:S,linkedHover:k,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:R,onClick:C,hoverHighlight:_,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"LikertChart",chartId:P,showLegend:G,userMargin:l,marginDefaults:n.marginDefaults,loading:M,loadingContent:I,emptyContent:T,width:N,height:W,hasTitle:!!$,axisChrome:{hasAxis:!1!==n.showAxes,hasAxisLabel:Z?!!K:!!Q}}),pe=hn(()=>{const e=g.length;return e%2!=0&&oe.get(g[Math.floor(e/2)])||"#888"},[g,oe]),fe=Ki({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:_n,userPieceStyle:A?.pieceStyle,stroke:F,strokeWidth:E,opacity:j,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection,styleRules:v,resolveRuleValue:Pn,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===bn||o===xn)return{fill:pe};const i=t||o;return i&&oe.has(i)?{fill:oe.get(i)}:{fill:"#888"}}}),ve=hn(()=>{const e=g.length;return e%2!=0?g[Math.floor(e/2)]:""},[g]),be=hn(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===bn||o===xn?ve:o,n=t.__likertCategory||"",r=Math.abs(t.__likertPct||0),a=o===bn||o===xn?2*r:r,s=t.__likertCount||0;return cn.createElement("div",{className:"semiotic-tooltip",style:Oe},cn.createElement("div",{style:{fontWeight:"bold"}},n),cn.createElement("div",{style:{marginTop:4}},`${i}: ${a.toFixed(1)}% (n=${s})`))},[ve]),xe=hn(()=>{if(!g||2>g.length)return"LikertChart requires `levels` with at least 2 entries.";if(u&&d)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(d&&!m)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==s&&0===s.length)return null;const e={categoryAccessor:h};return J?u&&(e.valueAccessor=u):(d&&(e.levelAccessor=d),m&&(e.countAccessor=m)),o({componentName:"LikertChart",data:s,accessors:e,requiredProps:{levels:g}})},[s,h,u,d,m,g,J]),Ae=ge.legendBehaviorProps,Se=hn(()=>{const e={...ge.margin};if(U&&ge.legend){const t=ge.legendPosition;"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(ce.streamingMarginAdjust)for(const[t,o]of Object.entries(ce.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Z&&100>e.left&&(e.left=100),e},[ge.margin,ge.legend,ge.legendPosition,ce.streamingMarginAdjust,Z,U]),ke=hn(()=>L||(Z?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Z,L]);if(ge.earlyReturn)return ge.earlyReturn;const Re={chartType:"bar",...null!=s&&{data:re},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:Z?"horizontal":"vertical",pieceStyle:fe,size:[N,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Se,barPadding:y,enableHover:z,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:n.showAxes,oLabel:Q,rLabel:K||(Z?void 0:"Percentage"),rFormat:ke,...O&&{oFormat:O},showGrid:V,...Ae,...$&&{title:$},...q&&{description:q},...X&&{summary:X},...void 0!==Y&&{accessibleTable:Y},...c&&{className:c},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===b?()=>null:!0===b?be:Ve(b)||be,...D({linkedHover:k,selection:S,onObservation:R,onClick:C,hoverHighlight:_,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return xe?Cn(ye,{componentName:"LikertChart",message:xe,width:N,height:W}):Cn(we,{componentName:"LikertChart",width:N,height:W,children:Cn(Vi,{ref:r,...Re})})});Ln.displayName="LikertChart";import{useMemo as Mn,forwardRef as In,useRef as Tn}from"react";import{jsx as Hn}from"react/jsx-runtime";var Bn=In(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=Tn(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,sizeBy:y,sizeRange:v=[3,8],symbolBy:b,symbolMap:x,pointRadius:w=4,pointOpacity:A=.7,categoryPadding:S=20,tooltip:k,annotations:R,valueExtent:C,brush:_,onBrush:P,linkedBrush:L,frameProps:M={},selection:I,linkedHover:T,onObservation:H,onClick:B,hoverHighlight:O,chartId:E,loading:W,loadingContent:z,emptyContent:V,legendInteraction:G,legendPosition:$,color:q,stroke:X,strokeWidth:Y,opacity:Q,showCategoryTicks:K,categoryFormat:Z}=e,{width:U,height:J,enableHover:ee,showGrid:te,showLegend:oe,title:ie,description:ne,summary:re,accessibleTable:ae,categoryLabel:se,valueLabel:le}=r,ce=Mn(()=>Fe(s),[s]),he=i({data:ce,rawData:s,colorBy:g,colorScheme:p,legendInteraction:G,legendPosition:$,frameLegend:M,selection:I,linkedHover:T,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:H,onClick:B,hoverHighlight:O,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"SwarmPlot",chartId:E,showLegend:oe,userMargin:l,marginDefaults:r.marginDefaults,loading:W,loadingContent:z,emptyContent:V,width:U,height:J,hasTitle:!!ie,axisChrome:et({showAxes:r.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!se,hasValueLabel:!!le})}),ue=en({brushProp:_,onBrushProp:P,linkedBrush:L,valueAccessor:u}),de=Mn(()=>{if(!y)return;const e=ce.map(e=>"function"==typeof y?y(e):e[y]);return _t(e)},[ce,y]),me=bt(),ge=Mn(()=>new Map,[]),pe=Mn(()=>We(u),[u]),fe=Ki({colorBy:g,colorScale:he.colorScale,color:q,themeCategorical:me,colorScheme:p,categoryIndexMap:ge,userPieceStyle:M?.pieceStyle,stroke:X,strokeWidth:Y,opacity:Q,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>({fillOpacity:A,r:y?Mt(e,y,v,de):w}),styleRules:f,resolveRuleValue:pe}),ve=Mn(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:g||void 0,valueFormat:m}),[h,u,g,m]);if(he.earlyReturn)return he.earlyReturn;const be=o({componentName:"SwarmPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(be)return Hn(ye,{componentName:"SwarmPlot",message:be,width:U,height:J});const xe={chartType:"swarm",...null!=s&&{data:ce},oAccessor:h,rAccessor:u,...b&&{symbolAccessor:b},...x&&{symbolMap:x},projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:fe,size:[U,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he.margin,barPadding:S,enableHover:ee,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:se,rLabel:le,rFormat:m,...Z&&{oFormat:Z},showGrid:te,showCategoryTicks:K,...he.legendBehaviorProps,...F({title:ie,description:ne,summary:re,accessibleTable:ae,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:k,defaultTooltipContent:ve}),...D({linkedHover:T,selection:I,onObservation:H,onClick:B,hoverHighlight:O,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...R&&R.length>0&&{annotations:R},...C&&{rExtent:C},...ue.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return Hn(we,{componentName:"SwarmPlot",width:U,height:J,children:Hn(Vi,{ref:a,...xe})})});Bn.displayName="SwarmPlot";import{useMemo as On,forwardRef as Fn,useRef as Dn}from"react";import{jsx as En,jsxs as jn}from"react/jsx-runtime";function Nn(e){return t=>{const o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return jn("div",{className:"semiotic-tooltip",style:Oe,children:[o&&En("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&jn("div",{children:["n = ",i.n]}),null!=i.min&&jn("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&jn("div",{children:["Q1: ",i.q1.toLocaleString()]}),jn("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&jn("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&jn("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&jn("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,n=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),r=n.length,a=r>0?r%2!=0?n[Math.floor(r/2)]:(n[r/2-1]+n[r/2])/2:null;return jn("div",{className:"semiotic-tooltip",style:Oe,children:[o&&En("div",{style:{fontWeight:"bold"},children:o+""}),r>0&&jn("div",{children:["n = ",r]}),null!=a&&jn("div",{children:["Median: ",a.toLocaleString()]})]})}return En("div",{className:"semiotic-tooltip",style:Oe,children:En("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as Wn}from"react/jsx-runtime";var zn=Fn(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=Dn(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,showOutliers:y=!0,outlierRadius:v=3,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,frameProps:S={},selection:k,linkedHover:R,onObservation:C,onClick:_,hoverHighlight:P,chartId:L,loading:M,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,color:O,stroke:E,strokeWidth:j,opacity:W,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:$,enableHover:q,showGrid:X,showLegend:Y,title:Q,description:K,summary:Z,accessibleTable:U,categoryLabel:J,valueLabel:ee}=r,te=On(()=>Fe(s),[s]),oe=i({data:te,rawData:s,colorBy:g,colorScheme:p,legendInteraction:H,legendPosition:B,frameLegend:S,selection:k,linkedHover:R,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BoxPlot",chartId:L,showLegend:Y,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:I,emptyContent:T,width:G,height:$,hasTitle:!!Q,axisChrome:et({showAxes:r.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!ee})}),ie=bt(),ne=On(()=>new Map,[]),re=On(()=>{const e=We(u);return t=>"number"==typeof t.median?t.median:e(t)},[u]),ae=Ki({colorBy:g,colorScale:oe.colorScale,color:O,themeCategorical:ie,colorScheme:p,categoryIndexMap:ne,userPieceStyle:void 0,stroke:E,strokeWidth:j,opacity:W,effectiveSelectionHook:oe.effectiveSelectionHook,resolvedSelection:oe.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:f,resolveRuleValue:re}),se=On(()=>Nn(),[]);if(oe.earlyReturn)return oe.earlyReturn;const le=o({componentName:"BoxPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(le)return Wn(ye,{componentName:"BoxPlot",message:le,width:G,height:$});const ce={chartType:"boxplot",...null!=s&&{data:te},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ae,showOutliers:y,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe.margin,barPadding:b,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:J,rLabel:ee,rFormat:m,...V&&{oFormat:V},showGrid:X,showCategoryTicks:z,...oe.legendBehaviorProps,...F({title:Q,description:K,summary:Z,accessibleTable:U,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:se}),...D({linkedHover:R,selection:k,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:oe.mobileInteraction,customHoverBehavior:oe.customHoverBehavior,customClickBehavior:oe.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Wn(we,{componentName:"BoxPlot",width:G,height:$,children:Wn(Vi,{ref:a,...ce})})});zn.displayName="BoxPlot";import{useMemo as Vn,forwardRef as Gn,useRef as $n}from"react";import{jsx as qn,jsxs as Xn}from"react/jsx-runtime";var Yn=e=>{const t=e?.category;return null==t?"All":t+""},Qn=Gn(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=$n(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h=Yn,valueAccessor:u="value",bins:d=25,relative:m=!1,valueFormat:g,colorBy:p,colorScheme:f,styleRules:y,categoryPadding:v=("sparkline"===r.mode?0:20),tooltip:b,annotations:x,valueExtent:w,brush:A,onBrush:S,linkedBrush:k,frameProps:R={},selection:C,linkedHover:_,onObservation:P,onClick:L,hoverHighlight:M,chartId:I,loading:T,loadingContent:H,emptyContent:B,legendInteraction:O,legendPosition:E,color:j,stroke:W,strokeWidth:z,opacity:V,showCategoryTicks:G,categoryFormat:$}=e,{width:q,height:X,enableHover:Y,showGrid:Q,showLegend:K,title:Z,description:U,summary:J,accessibleTable:ee,categoryLabel:te,valueLabel:oe}=r,ie=Vn(()=>Fe(s),[s]),ne=i({data:ie,rawData:s,colorBy:p,colorScheme:f,legendInteraction:O,legendPosition:E,frameLegend:R,selection:C,linkedHover:_,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:L,hoverHighlight:M,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"Histogram",chartId:I,showLegend:K,userMargin:l,marginDefaults:r.marginDefaults,loading:T,loadingContent:H,emptyContent:B,width:q,height:X,hasTitle:!!Z,axisChrome:et({showAxes:r.showAxes,projection:"horizontal",hasCategoryLabel:!!te,hasValueLabel:!!oe})}),re=en({brushProp:A,onBrushProp:S,linkedBrush:k,valueAccessor:u}),ae=Vn(()=>{if(0===ie.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of ie){const n=e(i);null!=n&&isFinite(n)&&(t>n&&(t=n),n>o&&(o=n))}return t>o?void 0:[t,o]},[ie,u]),se=bt(),le=Vn(()=>new Map,[]),ce=Vn(()=>{const e=We(u);return t=>"number"==typeof t.count?t.count:e(t)},[u]),he=Ki({colorBy:p,colorScale:ne.colorScale,color:j,themeCategorical:se,colorScheme:f,categoryIndexMap:le,userPieceStyle:void 0,stroke:W,strokeWidth:z,opacity:V,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:y,resolveRuleValue:ce}),ue=Vn(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,n=t.range;return Xn("div",{className:"semiotic-tooltip",style:Oe,children:[o&&qn("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&Xn("div",{children:["Count: ",i]}),n&&2===n.length&&Xn("div",{style:{opacity:.8},children:[Number(n[0]).toFixed(1)," – ",Number(n[1]).toFixed(1)]})]})},[]);if(ne.earlyReturn)return ne.earlyReturn;const de=o({componentName:"Histogram",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(de)return qn(ye,{componentName:"Histogram",message:de,width:q,height:X});const me={chartType:"histogram",...null!=s&&{data:ie},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:he,bins:d,normalize:m,...w?{rExtent:w}:ae&&{rExtent:ae},size:[q,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:v,enableHover:Y,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:te,rLabel:oe,rFormat:g,...$&&{oFormat:$},showGrid:Q,showCategoryTicks:G,...ne.legendBehaviorProps,...F({title:Z,description:U,summary:J,accessibleTable:ee,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:ue}),...D({linkedHover:_,selection:C,onObservation:P,onClick:L,hoverHighlight:M,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...x&&x.length>0&&{annotations:x},...re.brushStreamProps,...Object.fromEntries(Object.entries(R).filter(([e])=>"pieceStyle"!==e))};return qn(we,{componentName:"Histogram",width:q,height:X,children:qn(Vi,{ref:a,...me})})});Qn.displayName="Histogram";import{useMemo as Kn,forwardRef as Zn,useRef as Un}from"react";import{jsx as Jn}from"react/jsx-runtime";var er=Zn(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=Un(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",bins:m=25,curve:g="catmullRom",showIQR:p=!0,valueFormat:f,colorBy:y,colorScheme:v,styleRules:b,categoryPadding:x=20,tooltip:w,annotations:A,valueExtent:S,brush:k,onBrush:R,linkedBrush:C,frameProps:_={},selection:P,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:O,emptyContent:E,legendInteraction:j,legendPosition:W,color:z,stroke:V,strokeWidth:G,opacity:$,showCategoryTicks:q,categoryFormat:X}=e,{width:Y,height:Q,enableHover:K,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:ne}=r,re=Kn(()=>Fe(s),[s]),ae=i({data:re,rawData:s,colorBy:y,colorScheme:v,legendInteraction:j,legendPosition:W,frameLegend:_,selection:P,linkedHover:L,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ViolinPlot",chartId:H,showLegend:U,userMargin:l,marginDefaults:r.marginDefaults,loading:B,loadingContent:O,emptyContent:E,width:Y,height:Q,hasTitle:!!J,axisChrome:et({showAxes:r.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!ne})}),se=en({brushProp:k,onBrushProp:R,linkedBrush:C,valueAccessor:u}),le=bt(),ce=Kn(()=>new Map,[]),he=Kn(()=>{const e=We(u);return t=>"number"==typeof t.median?t.median:e(t)},[u]),ue=Ki({colorBy:y,colorScale:ae.colorScale,color:z,themeCategorical:le,colorScheme:v,categoryIndexMap:ce,userPieceStyle:void 0,stroke:V,strokeWidth:G,opacity:$,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0,styleRules:b,resolveRuleValue:he}),de=Kn(()=>Nn({valueAccessor:u}),[u]);if(ae.earlyReturn)return ae.earlyReturn;const me=o({componentName:"ViolinPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(me)return Jn(ye,{componentName:"ViolinPlot",message:me,width:Y,height:Q});const ge={chartType:"violin",...null!=s&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ue,bins:m,showIQR:p,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae.margin,barPadding:x,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:ie,rLabel:ne,rFormat:f,...X&&{oFormat:X},showGrid:Z,showCategoryTicks:q,...ae.legendBehaviorProps,...F({title:J,description:ee,summary:te,accessibleTable:oe,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:w,defaultTooltipContent:de}),...D({linkedHover:L,selection:P,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...A&&A.length>0&&{annotations:A},...S&&{rExtent:S},...se.brushStreamProps,...Object.fromEntries(Object.entries(_).filter(([e])=>"pieceStyle"!==e))};return Jn(we,{componentName:"ViolinPlot",width:Y,height:Q,children:Jn(Vi,{ref:a,...ge})})});er.displayName="ViolinPlot";import{useMemo as tr,forwardRef as or,useRef as ir}from"react";import{jsx as nr}from"react/jsx-runtime";var rr=or(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=ir(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="horizontal",bins:m=20,amplitude:g=1.5,valueFormat:p,colorBy:f,colorScheme:y,styleRules:v,categoryPadding:b=5,tooltip:x,annotations:w,valueExtent:A,frameProps:S={},selection:k,linkedHover:R,onObservation:C,onClick:_,hoverHighlight:P,chartId:L,loading:M,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,color:O,stroke:E,strokeWidth:j,opacity:W,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:$,enableHover:q,showGrid:X,showLegend:Y,title:Q,description:K,summary:Z,accessibleTable:U,categoryLabel:J,valueLabel:ee}=r,te=tr(()=>Fe(s),[s]),oe=i({data:te,rawData:s,colorBy:f,colorScheme:y,legendInteraction:H,legendPosition:B,frameLegend:S,selection:k,linkedHover:R,fallbackFields:f?["string"==typeof f?f:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"RidgelinePlot",chartId:L,showLegend:Y,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:I,emptyContent:T,width:G,height:$,hasTitle:!!Q,axisChrome:et({showAxes:r.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!ee})}),ie=bt(),ne=tr(()=>new Map,[]),re=tr(()=>{const e=We(u);return t=>"number"==typeof t.median?t.median:e(t)},[u]),ae=Ki({colorBy:f,colorScale:oe.colorScale,color:O,themeCategorical:ie,colorScheme:y,categoryIndexMap:ne,userPieceStyle:void 0,stroke:E,strokeWidth:j,opacity:W,effectiveSelectionHook:oe.effectiveSelectionHook,resolvedSelection:oe.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0,styleRules:v,resolveRuleValue:re}),se=tr(()=>Nn(),[]);if(oe.earlyReturn)return oe.earlyReturn;const le=o({componentName:"RidgelinePlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(le)return nr(ye,{componentName:"RidgelinePlot",message:le,width:G,height:$});const ce={chartType:"ridgeline",...null!=s&&{data:te},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ae,bins:m,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe.margin,barPadding:b,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:J,rLabel:ee,rFormat:p,...V&&{oFormat:V},showGrid:X,showCategoryTicks:z,oSort:!1,amplitude:g,...oe.legendBehaviorProps,...F({title:Q,description:K,summary:Z,accessibleTable:U,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:se}),...D({linkedHover:R,selection:k,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:oe.mobileInteraction,customHoverBehavior:oe.customHoverBehavior,customClickBehavior:oe.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return nr(we,{componentName:"RidgelinePlot",width:G,height:$,children:nr(Vi,{ref:a,...ce})})});rr.displayName="RidgelinePlot";import{useMemo as ar,forwardRef as sr,useRef as lr}from"react";import{jsx as cr}from"react/jsx-runtime";var hr=sr(function(t,r){const a=dt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid??!0,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),s=lr(null);n(r,{variant:"xy",frameRef:s});const{data:l,margin:c,className:h,categoryAccessor:u="category",valueAccessor:d="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,styleRules:y,sort:v="auto",dotRadius:b=5,categoryPadding:x=10,tooltip:w,annotations:A,regression:S,valueExtent:k,frameProps:R={},selection:C,linkedHover:_,onObservation:P,onClick:L,hoverHighlight:M,chartId:I,loading:T,loadingContent:H,emptyContent:B,legendInteraction:O,legendPosition:E,color:W,stroke:z,strokeWidth:V,opacity:G,categoryFormat:$}=t,{width:q,height:X,enableHover:Y,showGrid:Q,showLegend:K,title:Z,description:U,summary:J,accessibleTable:ee,categoryLabel:te,valueLabel:oe}=a,ie=ar(()=>Fe(l),[l]),ne=i({data:ie,rawData:l,colorBy:p,colorScheme:f,legendInteraction:O,legendPosition:E,frameLegend:R,selection:C,linkedHover:_,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof u?u:""],unwrapData:!0,onObservation:P,onClick:L,hoverHighlight:M,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"DotPlot",chartId:I,showLegend:K,userMargin:c,marginDefaults:a.marginDefaults,loading:T,loadingContent:H,emptyContent:B,width:q,height:X,hasTitle:!!Z,axisChrome:et({showAxes:a.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!te,hasValueLabel:!!oe})}),re=vt(ie,v,d),ae=bt(),se=ar(()=>new Map,[]),le=ar(()=>We(d),[d]),ce=Ki({colorBy:p,colorScale:ne.colorScale,color:W,themeCategorical:ae,colorScheme:f,categoryIndexMap:se,userPieceStyle:R?.pieceStyle,stroke:z,strokeWidth:V,opacity:G,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{r:b,fillOpacity:.8},styleRules:y,resolveRuleValue:le}),he=ar(()=>j({categoryAccessor:u,valueAccessor:d,valueFormat:g}),[u,d,g]);if(ne.earlyReturn)return ne.earlyReturn;const ue=o({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ue)return cr(ye,{componentName:"DotPlot",message:ue,width:q,height:X});const de=e(S),me=de?[de,...A||[]]:A,ge={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:ce,size:[q,X],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ne.margin,barPadding:x,enableHover:Y,...t.dataIdAccessor&&{dataIdAccessor:t.dataIdAccessor},showAxes:a.showAxes,oLabel:te,rLabel:oe,rFormat:g,...$&&{oFormat:$},showGrid:Q,oSort:v,...ne.legendBehaviorProps,...F({title:Z,description:U,summary:J,accessibleTable:ee,className:h,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...N({tooltip:w,defaultTooltipContent:he}),...D({linkedHover:_,selection:C,onObservation:P,onClick:L,hoverHighlight:M,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...me&&me.length>0&&{annotations:me},...k&&{rExtent:k},...Object.fromEntries(Object.entries(R).filter(([e])=>"pieceStyle"!==e))};return cr(we,{componentName:"DotPlot",width:q,height:X,children:cr(Vi,{ref:s,...ge})})});hr.displayName="DotPlot";import{useMemo as ur,forwardRef as dr,useRef as mr}from"react";import{jsx as gr}from"react/jsx-runtime";var pr=dr(function(e,t){const n=dt(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=mr(null),{data:a,margin:s,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,styleRules:m,startAngle:g=0,cornerRadius:p,tooltip:f,annotations:y,frameProps:v={},selection:b,linkedHover:x,onObservation:w,onClick:A,hoverHighlight:S,chartId:k,loading:R,loadingContent:C,emptyContent:_,legendInteraction:P,legendPosition:L,color:M,stroke:I,strokeWidth:T,opacity:H}=e,{width:B,height:O,enableHover:E,showLegend:W,title:z,description:V,summary:G,accessibleTable:$}=n,q=ur(()=>Fe(a),[a]),X=u||c,Y=i({data:q,rawData:a,colorBy:X,colorScheme:d,legendInteraction:P,legendPosition:L,frameLegend:v,selection:b,linkedHover:x,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:w,onClick:A,hoverHighlight:S,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:W,userMargin:s,marginDefaults:n.marginDefaults,loading:R,loadingContent:C,emptyContent:_,width:B,height:O,hasTitle:!!z,axisChrome:{hasAxis:!1}}),Q=bt(),K=ur(()=>new Map,[]),Z=ur(()=>{const e=We(h);return t=>{const o=e(t);return null==o?void 0:Math.abs(o)}},[h]),U=Ki({colorBy:X,colorScale:Y.colorScale,color:M,themeCategorical:Q,colorScheme:d,categoryIndexMap:K,userPieceStyle:v?.pieceStyle,stroke:I,strokeWidth:T,opacity:H,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,cycleByCategory:!0,styleRules:m,resolveRuleValue:Z}),J=ur(()=>j({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),ee=o({componentName:"PieChart",data:a,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:te,effectiveMargin:oe}=Yi({ref:t,frameRef:r,setup:Y});if(Y.earlyReturn)return Y.earlyReturn;const ie={chartType:"pie",...null!=a&&{data:q},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:U,startAngle:g,...null!=p&&{cornerRadius:p},size:[B,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe,enableHover:E,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...te,...F({title:z,description:V,summary:G,accessibleTable:$,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:f,defaultTooltipContent:J}),...D({linkedHover:x,selection:b,onObservation:w,onClick:A,hoverHighlight:S,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...y&&y.length>0&&{annotations:y},...Object.fromEntries(Object.entries(v).filter(([e])=>"pieceStyle"!==e))};return ee?gr(ye,{componentName:"PieChart",message:ee,width:B,height:O}):gr(we,{componentName:"PieChart",width:B,height:O,children:gr(Vi,{ref:r,...ie})})});pr.displayName="PieChart";import{useMemo as fr,forwardRef as yr,useRef as vr}from"react";import{jsx as br}from"react/jsx-runtime";var xr=yr(function(e,t){const n=dt(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),r=vr(null),{data:a,margin:s,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:m,colorScheme:g,styleRules:p,startAngle:f=0,cornerRadius:y,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:S,onClick:k,hoverHighlight:R,chartId:C,loading:_,loadingContent:P,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:O}=e,{width:E,height:W,enableHover:z,showLegend:V,title:G,description:$,summary:q,accessibleTable:X}=n,Y=fr(()=>Fe(a),[a]),Q=m||c,K=i({data:Y,rawData:a,colorBy:Q,colorScheme:g,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:S,onClick:k,hoverHighlight:R,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DonutChart",chartId:C,showLegend:V,userMargin:s,marginDefaults:n.marginDefaults,loading:_,loadingContent:P,emptyContent:L,width:E,height:W,hasTitle:!!G,axisChrome:{hasAxis:!1}}),Z=u??Math.max(2,.15*Math.min(E,W)),U=bt(),J=fr(()=>new Map,[]),ee=fr(()=>{const e=We(h);return t=>{const o=e(t);return null==o?void 0:Math.abs(o)}},[h]),te=Ki({colorBy:Q,colorScale:K.colorScale,color:T,themeCategorical:U,colorScheme:g,categoryIndexMap:J,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:O,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,cycleByCategory:!0,styleRules:p,resolveRuleValue:ee}),oe=fr(()=>j({categoryAccessor:c,valueAccessor:h,groupAccessor:m&&m!==c?m:void 0,groupLabel:"string"==typeof m?m:"group",pieData:!0}),[c,h,m]),ie=o({componentName:"DonutChart",data:a,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:ne,effectiveMargin:re}=Yi({ref:t,frameRef:r,setup:K});if(K.earlyReturn)return K.earlyReturn;const ae={chartType:"donut",...null!=a&&{data:Y},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:te,innerRadius:Z,startAngle:f,...null!=y&&{cornerRadius:y},centerContent:d,size:[E,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re,enableHover:z,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...ne,...F({title:G,description:$,summary:q,accessibleTable:X,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:v,defaultTooltipContent:oe}),...D({linkedHover:A,selection:w,onObservation:S,onClick:k,hoverHighlight:R,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...b&&b.length>0&&{annotations:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return ie?br(ye,{componentName:"DonutChart",message:ie,width:E,height:W}):br(we,{componentName:"DonutChart",width:E,height:W,children:br(Vi,{ref:r,...ae})})});xr.displayName="DonutChart";import{useMemo as wr,forwardRef as Ar,useRef as Sr}from"react";function kr(e=240){const t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function Rr(e){return Math.max(0,Math.min(1,e))}function Cr(e){const t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){const e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function _r(e,t,o){const i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function Pr(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Rr(e.offset),color:e.color??o,opacity:null==e.opacity?1:Rr(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const n=e=>{if(1===e.opacity)return e.color;const t=Cr(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return n(i[0]);const r=Rr(t);if(i[0].offset>=r)return n(i[0]);if(r>=i[i.length-1].offset)return n(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>r||r>o.offset)continue;const a=o.offset-t.offset,s=a>0?(r-t.offset)/a:0,l=Cr(t.color),c=Cr(o.color);if(!l||!c)return n(.5>s?t:o);const[h,u,d]=l,[m,g,p]=c,f=h+(m-h)*s,y=u+(g-u)*s,v=d+(p-d)*s,b=t.opacity+(o.opacity-t.opacity)*s;return 1===b?_r(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return n(i[i.length-1])}function Lr(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as Mr,jsxs as Ir}from"react/jsx-runtime";var Tr=Ar(function(e,t){const o=dt(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),i=Sr(null),n="context"===o.mode,{compactMode:a}=o,{value:s,min:l=0,max:c=100,thresholds:h,gradientFill:u,color:d,backgroundColor:m="var(--semiotic-grid, #e0e0e0)",arcWidth:g=.3,cornerRadius:p,showNeedle:f=!0,needleColor:y="var(--semiotic-text, #333)",centerContent:v,valueFormat:b,showScaleLabels:x=!a,sweep:w=240,fillZones:A=!0,tooltip:S,styleRules:k,annotations:R,frameProps:C={},className:_,stroke:L,strokeWidth:M,opacity:I}=e,{width:T,height:H,title:B,description:O,summary:F,accessibleTable:E}=o,j=P(u),N=Math.max(l,Math.min(c,s)),W=c-l||1,z=(N-l)/W,{gaugeData:V,pieceStyle:G,gaugeAnnotations:$}=wr(()=>function(e){const{min:t,max:o,value:i,thresholds:n,fillColor:r,backgroundColor:a,fillZones:s,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,u=o-t||1,d=(Math.max(t,Math.min(o,i))-t)/u;let m=n&&n.length>0?[...n].sort((e,t)=>e.value-t.value):[{value:o,color:r||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});const g=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(g){const e=s?d:1,t=Lr("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:a,opacity:.4}),e>0){const t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(Pr(c.stops,e*(t+.5)/o,r||m[0]?.color||"#007bff"));const n=Lr("fill",0);p.push({category:n,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(n,{fill:i[0]||a})}}else{let e=t;for(let o=0;m.length>o;o++){const i=m[o],n=(i.value-e)/u,r=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(s?Math.min(d,l):l)-r),h=s?Math.max(0,n-c):0;if(c>0){const e=Lr("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){const e=Lr("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:a,opacity:.4})}e=i.value}}if(l&&n&&n.length>0)for(const e of n)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:a},gaugeAnnotations:y}}({min:l,max:c,value:s,thresholds:h,fillColor:d,backgroundColor:m,fillZones:A,showScaleLabels:x,gradientFill:j}),[s,l,c,h,d,m,x,A,j]),q=wr(()=>Me(G,k,(e,t)=>({value:"number"==typeof e.value?e.value:void 0,category:t??(null==e.category?void 0:e.category+"")})),[G,k]),Y=wr(()=>X(q,{stroke:L,strokeWidth:M,opacity:I}),[q,L,M,I]),{activeSelectionHook:Q,customHoverBehavior:K,customClickBehavior:Z}=mt({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),U=r(e.selection),J=wr(()=>kt(Y,Q,U),[Y,Q,U]),{sweepRad:ee,startAngleDeg:te}=kr(w),oe=function(e=240){const{sweepRad:t,offsetRad:o}=kr(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||i.push([Math.cos(e),Math.sin(e)]);const n=i.map(e=>e[0]),r=i.map(e=>e[1]),[a,s]=_t(n),[l,c]=_t(r);return{minX:a,maxX:s,minY:l,maxY:c,width:s-a,height:c-l,cx:(a+s)/2,cy:(l+c)/2}}(w),ie=Math.min(10,Math.max(1,Math.min(T,H)/12)),ne=oe.cx,re=oe.cy,ae=Math.max(4,Math.min((T-2*ie)/oe.width,(H-2*ie)/oe.height)-2),se=Math.max(0,Math.min(ae-1.5,ae*(1-g))),le=T/2-ne*ae,ce=H/2-re*ae,he=2*(ae+4),ue=wr(()=>{if(a&&null==v)return null;if(null!=v)return"function"==typeof v?v(N,l,c):v;const e=b?b(N):Math.round(N)+"";return Ir("div",{style:{textAlign:"center",lineHeight:1.2},children:[Mr("div",{style:{fontSize:Math.max(16,.3*ae),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),x&&Ir("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[v,N,l,c,b,x,ae,a]),de=wr(()=>n&&null==v?{type:"gauge-value",text:b?b(N):Math.round(N)+""}:null,[n,v,N,b]),me=wr(()=>{if(!f)return null;const e=-Math.PI/2+te*Math.PI/180+z*ee,t=se>20?se-8:ae-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:y}},[f,te,z,ee,se,ae,y]),ge=wr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||T)/2,n=(o.height||H)/2,r=Math.max(1,ae-se),a=Math.max(1,Math.min(2.5,.4*r)),s=Math.max(1,Math.min(5,.6*r));return Ir("g",{transform:`translate(${i},${n})`,children:[Mr("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:a,strokeLinecap:"round"}),Mr("circle",{cx:0,cy:0,r:s,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+te*Math.PI/180+(e.value-l)/W*ee,n=(o.width||T)/2,r=(o.height||H)/2,a=se-1,s=ae+1,c=Math.cos(i)*a,h=Math.sin(i)*a,u=Math.cos(i)*s,d=Math.sin(i)*s,m=ae+10,g=Math.cos(i)*m,p=Math.sin(i)*m,f=((i+Math.PI/2)/(2*Math.PI)*12+12)%12;let y,v;return f>=11||1>f?(y="middle",v="auto"):f>=1&&5>f?(y="start",v="middle"):f>=5&&7>f?(y="middle",v="hanging"):(y="end",v="middle"),Ir("g",{transform:`translate(${n},${r})`,children:[Mr("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),Mr("text",{x:g,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?Mr("text",{x:(o.width||T)/2,y:(o.height||H)/2-.2*se,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*ae)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[T,H,l,W,te,ee,se,ae]),pe=wr(()=>{const e=[...$,...R||[]];return me&&e.push(me),de&&e.push(de),e},[$,R,me,de]),fe=wr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return Ir("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[Mr("div",{style:{fontWeight:600},children:o}),Mr("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(N):"Remaining"})]})},[N]),ve=Ze(e.loading,T,H,e.loadingContent),be=ve?null:Qe(Number.isFinite(s)?[{value:s}]:[],T,H,e.emptyContent);if(ve)return ve;if(be)return be;if(0===V.length)return Mr(ye,{componentName:"GaugeChart",message:"No data to display",width:T,height:H});const xe={chartType:"donut",data:V,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:J,innerRadius:se,startAngle:te,sweepAngle:w,...null!=p&&{cornerRadius:p},centerContent:ue,size:[T,H],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:ce-he/2,bottom:H-ce-he/2,left:le-he/2,right:T-le-he/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===S?()=>null:Ve(S)||fe,...D({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:K,customClickBehavior:Z}),svgAnnotationRules:ge,...pe.length>0&&{annotations:pe},...B&&{title:B},...O&&{description:O},...F&&{summary:F},...void 0!==E&&{accessibleTable:E},..._&&{className:_},...null!=e.animate&&{animate:e.animate},...C};return Mr(we,{componentName:"GaugeChart",width:T,height:H,children:Mr(Vi,{ref:i,...xe})})});Tr.displayName="GaugeChart";import{useMemo as Hr,forwardRef as Br,useRef as Or}from"react";import{jsx as Fr}from"react/jsx-runtime";var Dr=Br(function(e,t){const n=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=Or(null),{data:a,margin:s,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,sort:f=!1,barPadding:y=60,roundedTop:v,gradientFill:b,styleRules:x,baselinePadding:w=!1,tooltip:A,annotations:S,valueExtent:k,frameProps:R={},selection:C,linkedHover:_,onObservation:P,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:O,legendInteraction:E,legendPosition:W,color:z,stroke:V,strokeWidth:G,opacity:$,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=n,ne=Hr(()=>Fe(a),[a]),re=g||h,ae=i({data:ne,rawData:a,colorBy:re,colorScheme:p,legendInteraction:E,legendPosition:W,frameLegend:R,selection:C,linkedHover:_,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!0,onObservation:P,onClick:M,hoverHighlight:I,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:s,marginDefaults:n.marginDefaults,loading:H,loadingContent:B,emptyContent:O,width:X,height:Y,hasTitle:!!U,axisChrome:et({showAxes:n.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),se=bt(),le=Hr(()=>new Map,[]),ce=Hr(()=>We(u),[u]),he=Ki({colorBy:re,colorScale:ae.colorScale,color:z,themeCategorical:se,colorScheme:p,categoryIndexMap:le,userPieceStyle:R.pieceStyle,stroke:V,strokeWidth:G,opacity:$,styleRules:x,resolveRuleValue:ce,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),ue=Hr(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),de=o({componentName:"GroupedBarChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:me,effectiveMargin:ge}=Yi({ref:t,frameRef:r,setup:ae}),pe=Hr(()=>L(b),[b]);if(ae.earlyReturn)return ae.earlyReturn;const fe={chartType:"clusterbar",...null!=a&&{data:ne},oAccessor:c,rAccessor:u,groupBy:h,oSort:f,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:he,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge,barPadding:y,...null!=v&&{roundedTop:v},...pe&&{gradientFill:pe},baselinePadding:w,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:n.showAxes,oLabel:oe,rLabel:ie,rFormat:m,...q&&{oFormat:q},showGrid:K,...me,...F({title:U,description:J,summary:ee,accessibleTable:te,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:A,defaultTooltipContent:ue}),...D({linkedHover:_,selection:C,onObservation:P,onClick:M,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...S&&S.length>0&&{annotations:S},...k&&{rExtent:k},...Object.fromEntries(Object.entries(R).filter(([e])=>"pieceStyle"!==e))};return de?Fr(ye,{componentName:"GroupedBarChart",message:de,width:X,height:Y}):Fr(we,{componentName:"GroupedBarChart",width:X,height:Y,children:Fr(Vi,{ref:r,...fe})})});Dr.displayName="GroupedBarChart";import{useMemo as Er,forwardRef as jr,useRef as Nr}from"react";import{jsx as Wr,jsxs as zr}from"react/jsx-runtime";var Vr=jr(function(e,t){const r=dt(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),a=Nr(null);n(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:m,colorScheme:g,styleRules:p,orientation:f="horizontal",connectorOpacity:y=.3,showLabels:v=!0,tooltip:b,annotations:x,frameProps:w={},selection:A,linkedHover:S,onObservation:k,onClick:R,hoverHighlight:C,chartId:_,loading:P,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:O,opacity:F,categoryFormat:E}=e,j="vertical"===f,{width:N,height:W,enableHover:z,showLegend:V,title:G,description:$,summary:q,accessibleTable:X}=r,Y=j?{top:G?60:40,right:20,bottom:60,left:60}:{top:G?40:10,right:10,bottom:10,left:10},Q=Er(()=>Fe(s),[s]),K=m||d,Z=!K,U=i({data:Q,rawData:s,colorBy:K,colorScheme:g,legendInteraction:I,legendPosition:T,frameLegend:w,selection:A,linkedHover:S,fallbackFields:K?["string"==typeof K?K:""]:[],unwrapData:!0,onObservation:k,onClick:R,hoverHighlight:C,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"FunnelChart",chartId:_,showLegend:V,userMargin:l,marginDefaults:Y,loading:P,loadingContent:L,emptyContent:M,width:N,height:W,hasTitle:!!G,axisChrome:et({showAxes:j&&r.showAxes,projection:j?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});At("FunnelChart",Q,"stepAccessor",h),At("FunnelChart",Q,"valueAccessor",u);const J=bt(),ee=Er(()=>new Map,[]),te=Er(()=>We(u),[u]),oe=Er(()=>{if(Z)return H||(J?.[0]?J[0]:Array.isArray(g)&&g[0]?g[0]:"#4e79a7")},[Z,H,J,g]),ie=Ki({colorBy:oe?void 0:K,colorScale:U.colorScale,color:oe??H,themeCategorical:J,colorScheme:g,categoryIndexMap:ee,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:O,opacity:F,effectiveSelectionHook:U.effectiveSelectionHook,resolvedSelection:U.resolvedSelection,styleRules:p,resolveRuleValue:te}),ne=Er(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",n=t?.__funnelPercent??t?.__barFunnelPercent,r=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,a=t?.__barFunnelIsDropoff,s=t?.__barFunnelCategory??t?.category,l=null==n||r?"":` (${.05>Math.abs(n-Math.round(n))?Math.round(n)+"%":n.toFixed(1)+"%"})`;return zr("div",{className:"semiotic-tooltip",style:Oe,children:[o&&Wr("div",{style:{fontWeight:"bold"},children:o+""}),s&&s!==o&&Wr("div",{style:{marginTop:2,opacity:.8},children:s+""}),a&&Wr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),zr("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(U.earlyReturn)return U.earlyReturn;const re=o({componentName:"FunnelChart",data:s,accessors:{stepAccessor:h,valueAccessor:u}});if(re)return Wr(ye,{componentName:"FunnelChart",message:re,width:N,height:W});const ae={chartType:j?"bar-funnel":"funnel",...null!=s&&{data:Q},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:j?"vertical":"horizontal",barPadding:j?40:0,pieceStyle:ie,size:[N,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:U.margin,enableHover:z,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:j&&r.showAxes,showCategoryTicks:j&&r.showAxes,...E&&{oFormat:E},showGrid:j,...!j&&{connectorOpacity:y},showLabels:v,...U.legendBehaviorProps,...G&&{title:G},...$&&{description:$},...q&&{summary:q},...void 0!==X&&{accessibleTable:X},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===b?()=>null:!0===b||null==b?ne:Ve(b)||ne,...D({linkedHover:S,selection:A,onObservation:k,onClick:R,hoverHighlight:C,mobileInteraction:U.mobileInteraction,customHoverBehavior:U.customHoverBehavior,customClickBehavior:U.customClickBehavior}),...x&&x.length>0&&{annotations:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return Wr(we,{componentName:"FunnelChart",width:N,height:W,children:Wr(Vi,{ref:a,...ae})})});Vr.displayName="FunnelChart";import{useMemo as Gr,forwardRef as $r,useRef as qr}from"react";import{jsx as Xr}from"react/jsx-runtime";var Yr=$r(function(e,t){const r=qr(null);n(t,{variant:"xy",frameRef:r});const a=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:l,className:c,categoryAccessor:h="attribute",valueAccessor:u="value",seriesAccessor:d,colorBy:m,categoryFormat:g,colorScheme:p,styleRules:f,pointRadius:y=4,valueExtent:v,tooltip:b,annotations:x,frameProps:w={},selection:A,linkedHover:S,onObservation:k,onClick:R,hoverHighlight:C,chartId:_,loading:P,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:O,opacity:E}=e,{width:W,height:z,enableHover:V,showGrid:G,showLegend:$,title:q,description:X,summary:Y,accessibleTable:Q}=a,K=Gr(()=>Fe(s),[s]),Z=d||("string"==typeof m?m:void 0)||("function"==typeof m?m:void 0),U=Z??"__radar",J=m||Z,ee=i({data:K,rawData:s,colorBy:J,colorScheme:p,legendInteraction:I,legendPosition:T,frameLegend:w,selection:A,linkedHover:S,fallbackFields:["string"==typeof J?J:"","string"==typeof h?h:""].filter(Boolean),unwrapData:!0,onObservation:k,onClick:R,hoverHighlight:C,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"RadarChart",chartId:_,showLegend:$,userMargin:l,marginDefaults:a.marginDefaults,loading:P,loadingContent:L,emptyContent:M,width:W,height:z,hasTitle:!!q,axisChrome:et({showAxes:!0,projection:"radial",hasCategoryLabel:!1,hasValueLabel:!1})}),te=bt(),oe=Gr(()=>new Map,[]),ie=Gr(()=>We(u),[u]),ne=Ki({colorBy:J,colorScale:ee.colorScale,color:H,themeCategorical:te,colorScheme:p,categoryIndexMap:oe,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:O,opacity:E,effectiveSelectionHook:ee.effectiveSelectionHook,resolvedSelection:ee.resolvedSelection,baseStyleExtras:{r:y,fillOpacity:.85},styleRules:f,resolveRuleValue:ie}),re=Gr(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:Z,groupLabel:"string"==typeof Z?Z:"series"}),[h,u,Z]);if(ee.earlyReturn)return ee.earlyReturn;const ae=o({componentName:"RadarChart",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(ae)return Xr(ye,{componentName:"RadarChart",message:ae,width:W,height:z});const se={chartType:"point",projection:"radial",...null!=s&&{data:K},oAccessor:h,rAccessor:u,connectorAccessor:U,connectorStyle:e=>{const t="function"==typeof ne?ne(e):{},o="string"==typeof t.fill?t.fill:void 0;return{fill:o,fillOpacity:.15,stroke:o,strokeWidth:2,opacity:.7}},pieceStyle:ne,...g&&{oFormat:g},rExtent:v??[0],oLabel:"",size:[W,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee.margin,enableHover:V,showAxes:!0,showGrid:G,...ee.legendBehaviorProps,...F({title:q,description:X,summary:Y,accessibleTable:Q,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:re}),...D({linkedHover:S,selection:A,onObservation:k,onClick:R,hoverHighlight:C,mobileInteraction:ee.mobileInteraction,customHoverBehavior:ee.customHoverBehavior,customClickBehavior:ee.customClickBehavior}),...x&&x.length>0&&{annotations:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e&&"connectorStyle"!==e))};return Xr(we,{componentName:"RadarChart",width:W,height:z,children:Xr(Vi,{ref:r,...se})})});Yr.displayName="RadarChart";import{useMemo as Qr,forwardRef as Kr,useRef as Zr}from"react";import{jsx as Ur}from"react/jsx-runtime";var Jr=Kr(function(e,t){const n=dt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=Zr(null),{data:a,margin:s,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:d="horizontal",valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,barPadding:y,tooltip:v,annotations:b,brush:x,onBrush:w,linkedBrush:A,frameProps:S={},selection:k,linkedHover:R,onObservation:C,onClick:_,hoverHighlight:P,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:O,color:E,stroke:W,strokeWidth:z,opacity:V,categoryFormat:G,rTickValues:$,tickLabelEdgeAlign:q,showCategoryTicks:X,gradientFill:Y,trackFill:Q,roundedTop:K,valueExtent:Z}=e,{width:U,height:J,enableHover:ee,showGrid:te,showLegend:oe,title:ie,description:ne,summary:re,accessibleTable:ae,categoryLabel:se,valueLabel:le}=n,ce=Qr(()=>Fe(a),[a]),he=g||h,ue=Qr(()=>{if(null!=y)return y;if("sparkline"!==n.mode)return 40;const e=new Set(ce.map(e=>"function"==typeof c?c(e):e[c])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===d?J:U)-2*t)/(t-1))):1},[y,n.mode,ce,c,d,U,J]),de=i({data:ce,rawData:a,colorBy:he,colorScheme:p,legendInteraction:B,legendPosition:O,frameLegend:S,selection:k,linkedHover:R,fallbackFields:he?["string"==typeof he?he:""]:[],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"SwimlaneChart",chartId:M,showLegend:oe,userMargin:s,marginDefaults:n.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:U,height:J,hasTitle:!!ie,axisChrome:et({showAxes:n.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!1!==X&&!!se,hasValueLabel:!!le})}),me=en({brushProp:x,onBrushProp:w,linkedBrush:A,valueAccessor:u}),ge=bt(),pe=Qr(()=>new Map,[]),fe=Qr(()=>We(u),[u]),ve=Ki({colorBy:he,colorScale:de.colorScale,color:E,themeCategorical:ge,colorScheme:p,categoryIndexMap:pe,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:z,opacity:V,effectiveSelectionHook:de.effectiveSelectionHook,resolvedSelection:de.resolvedSelection,cycleByCategory:!0,styleRules:f,resolveRuleValue:fe}),be=Qr(()=>j({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),xe=o({componentName:"SwimlaneChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:Ae,effectiveMargin:Se}=Yi({ref:t,frameRef:r,setup:de}),ke=Qr(()=>L(Y),[Y]);if(de.earlyReturn)return de.earlyReturn;const Re={chartType:"swimlane",...null!=a&&{data:ce},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ve,size:[U,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Se,barPadding:ue,enableHover:ee,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:n.showAxes,oLabel:!1===X?void 0:se,rLabel:le,rFormat:m,...$&&{rTickValues:$},...null!=q&&{tickLabelEdgeAlign:q},...G&&{oFormat:G},...void 0!==X&&{showCategoryTicks:X},showGrid:te,...Ae,...F({title:ie,description:ne,summary:re,accessibleTable:ae,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:v,defaultTooltipContent:be}),...D({linkedHover:R,selection:k,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior}),...b&&b.length>0&&{annotations:b},...ke&&{gradientFill:ke},...null!=Q&&{trackFill:Q},...null!=K&&{roundedTop:K},...Z&&{rExtent:Z},...me.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return xe?Ur(ye,{componentName:"SwimlaneChart",message:xe,width:U,height:J}):Ur(we,{componentName:"SwimlaneChart",width:U,height:J,children:Ur(Vi,{ref:r,...Re})})});Jr.displayName="SwimlaneChart";import{forwardRef as ea,useMemo as ta}from"react";import{jsx as oa}from"react/jsx-runtime";var ia=ea(function(e,o){const{data:i,layout:n,layoutConfig:r,onLayoutError:a,categoryAccessor:s="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:m,colorBy:g,colorScheme:p,tooltip:f,showAxes:y=!1,annotations:v,onObservation:b,onClick:x,selection:w,linkedHover:A,chartId:S,loading:k,loadingContent:R,emptyContent:C,frameProps:_={}}=e,{frameRef:P,resolved:L,safeData:M,setup:I,earlyReturn:T}=t({imperativeRef:o,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:i,colorBy:g,colorScheme:p,frameLegend:_,selection:w,linkedHover:A,onObservation:b,onClick:x,chartId:S,loading:k,loadingContent:R,emptyContent:C,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),H=I.effectiveSelectionHook,B=ta(()=>H?.isActive?{isActive:!0,predicate:H.predicate}:null,[H?.isActive,H?.predicate]),O=ta(()=>Ve(f),[f]);if(T)return T;const{width:E,height:j,enableHover:N,showGrid:W,title:z,description:V,summary:G,accessibleTable:$}=L,q={chartType:"custom",...null!=i&&{data:M},customLayout:n,layoutConfig:r,onLayoutError:a,...B&&{layoutSelection:B},oAccessor:s,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:g,colorScheme:p,size:[E,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:I.margin,enableHover:N,showAxes:y,showGrid:W,annotations:v,...F({title:z,description:V,summary:G,accessibleTable:$,className:m,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===f?{tooltipContent:()=>null}:O?{tooltipContent:O}:{},...I.legendBehaviorProps,...D({linkedHover:A,selection:w,onObservation:b,onClick:x,hoverHighlight:!1,mobileInteraction:I.mobileInteraction,customHoverBehavior:I.customHoverBehavior,customClickBehavior:I.customClickBehavior}),..._};return oa(we,{componentName:"OrdinalCustomChart",width:E,height:j,children:oa(Vi,{ref:P,...q})})});ia.displayName="OrdinalCustomChart";export{Vi as StreamOrdinalFrame_default,on as BarChart,ln as StackedBarChart,Ln as LikertChart,Bn as SwarmPlot,zn as BoxPlot,Qn as Histogram,er as ViolinPlot,rr as RidgelinePlot,hr as DotPlot,pr as PieChart,xr as DonutChart,Tr as GaugeChart,Dr as GroupedBarChart,Vr as FunnelChart,Yr as RadarChart,Jr as SwimlaneChart,ia as OrdinalCustomChart};
|
package/dist/c-IUHFPMHD.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=["value","threshold","partition-boundary","time-window","range-boundary"];function t({controlType:e,controlId:t,chartId:a,chartType:o="VisualizationControl",onObservation:n}){return(r,i,s)=>{n?.({type:r,controlType:e,value:i,chartType:o,timestamp:Date.now(),...t?{controlId:t}:{},...a?{chartId:a}:{},...s?{source:s}:{}})}}function a(e,t,a,o,n){return{id:e,...t?{controlId:t}:{},status:a,message:o,...n?{remediation:n}:{}}}function o({controls:t=[],minimumTargetSize:o=24}){const n=[],r=new Set;for(const i of t){const t=i?.id,s="controls."+(t||"unknown"),l=i?.domain,u=Array.isArray(l)&&2===l.length&&Number.isFinite(l[0])&&Number.isFinite(l[1])&&l[1]>l[0],d=e.includes(i?.type),c="string"==typeof i?.target&&i.target.trim().length>0,p=["slider","buttons","native-range"].includes(i?.keyboard??""),m=i?.minimumTargetSize;n.push(a(s+".semantic-type",t,d?"pass":"fail",d?`Control uses the semantic type "${i.type}".`:"Control has no recognized semantic type.","Use one of VISUALIZATION_CONTROL_TYPES.")),n.push(a(s+".state-binding",t,c?"pass":"fail",c?`Control is bound to "${i.target}".`:"Control has no declarative state binding.","Declare the controlled state key with target.")),n.push(a(s+".domain",t,u?"pass":"fail",u?"Control has a finite ordered value domain.":"Control has no finite ordered value domain.","Declare domain as [minimum, maximum].")),n.push(a(s+".keyboard",t,p?"pass":"fail",p?`Control declares a ${i.keyboard} keyboard path.`:"Control does not declare a keyboard path.","Declare slider, buttons, or native-range keyboard interaction.")),n.push(a(s+".value-text",t,"string"==typeof i?.valueText&&i.valueText.trim().length>0?"pass":"fail","string"==typeof i?.valueText&&i.valueText.trim().length>0?"Control declares human-readable value text.":"Control does not declare human-readable value text.","Provide valueText, typically with a {value} placeholder.")),n.push(a(s+".target-size",t,"number"!=typeof m||o>m?"fail":"pass","number"!=typeof m||o>m?`Control target is below the ${o}px minimum or undeclared.`:`Control declares a ${m}px target.`,`Declare minimumTargetSize of at least ${o}.`)),null!=i?.step&&n.push(a(s+".step",t,Number.isFinite(i.step)&&i.step>0?"pass":"fail",Number.isFinite(i.step)&&i.step>0?"Control has a positive quantization step.":"Control step must be a positive finite number.","Use a positive finite step.")),i?.observations?.length&&n.push(a(s+".observations",t,i.observations.includes("control-change")?"pass":"warn",i.observations.includes("control-change")?"Control declares control-change observation coverage.":"Control declares observations but omits control-change.","Include control-change so observable state changes are represented.")),t&&!r.has(t)||n.push(a(s+".identity",t,"fail",t?"Control id is duplicated.":"Control id is missing.","Use a unique stable control id.")),t&&r.add(t)}return{ok:n.every(e=>"fail"!==e.status),findings:n}}export{e as VISUALIZATION_CONTROL_TYPES,t as createControlObservationAdapter,o as auditVisualizationControls};
|