semiotic 3.8.9 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -81
- package/agent-skill/semiotic-charts/SKILL.md +11 -2
- package/ai/behaviorContracts.cjs +33 -3
- package/ai/cli.js +53 -2
- package/ai/componentMetadata.cjs +15 -0
- package/ai/dist/mcp-server.js +1530 -611
- package/ai/examples.md +48 -42
- package/{CLAUDE.md → ai/reference.md} +43 -22
- package/ai/schema.json +10603 -986
- package/ai/surface-manifest.json +643 -2
- package/ai/system-prompt.md +83 -130
- package/dist/c-3BLJEQNG.min.js +1 -0
- package/dist/c-3KZD6AXJ.min.js +1 -0
- package/dist/c-4TWEX5HG.min.js +1 -0
- package/dist/c-52TEGIUJ.min.js +1 -0
- package/dist/c-5YCIX3VZ.min.js +1 -0
- package/dist/c-6FEKTA3U.min.js +1 -0
- package/dist/c-6O5EVOPH.min.js +1 -0
- package/dist/c-74HEEZGK.min.js +1 -0
- package/dist/c-AKAF6JAD.min.js +1 -0
- package/dist/c-BBKITSXB.min.js +1 -0
- package/dist/c-BWNB6USU.min.js +1 -0
- package/dist/c-C25ENHIK.min.js +1 -0
- package/dist/c-CDR5AO3R.min.js +1 -0
- package/dist/c-COHXCW3Q.min.js +1 -0
- package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
- package/dist/c-E3JFRRMI.min.js +1 -0
- package/dist/c-EBFPQHHO.min.js +1 -0
- package/dist/c-G36WS6LN.min.js +1 -0
- package/dist/c-GIKRQI4X.min.js +1 -0
- package/dist/c-GPYOFETM.min.js +1 -0
- package/dist/c-IDUHYYSI.min.js +1 -0
- package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
- package/dist/c-J5G56TUH.min.js +1 -0
- package/dist/c-JAZ73J32.min.js +1 -0
- package/dist/c-KG3NXHAL.min.js +1 -0
- package/dist/c-KII3PLZE.min.js +1 -0
- package/dist/c-LIXGXMNS.min.js +1 -0
- package/dist/c-LVEY6D6B.min.js +1 -0
- package/dist/c-M4Y3BHFR.min.js +1 -0
- package/dist/c-MAIICR2Z.min.js +1 -0
- package/dist/c-MG5DM6VE.min.js +1 -0
- package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
- package/dist/c-MT3WBK7M.min.js +1 -0
- package/dist/c-NY3JWV2K.min.js +1 -0
- package/dist/c-O6U6K4CW.min.js +1 -0
- package/dist/c-OCI56QF2.min.js +1 -0
- package/dist/c-OQ7M4AGV.min.js +1 -0
- package/dist/c-OXYMVK7Q.min.js +1 -0
- package/dist/c-PPWDL5ZI.min.js +1 -0
- package/dist/c-QHF5YON3.min.js +1 -0
- package/dist/c-RR3GO5SW.min.js +1 -0
- package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
- package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
- package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
- package/dist/c-SUILCHWU.min.js +1 -0
- package/dist/c-TZW3JGJ5.min.js +1 -0
- package/dist/c-US5ZFT6E.min.js +1 -0
- package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
- package/dist/c-UUKVD4WB.min.js +1 -0
- package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
- package/dist/c-W3CE4A4S.min.js +1 -0
- package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
- package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
- package/dist/c-YDAY2WFR.min.js +1 -0
- package/dist/c-ZOWWU34K.min.js +1 -0
- package/dist/components/AccessibleNavTree.d.ts +1 -1
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/GradientLegend.d.ts +14 -0
- package/dist/components/Legend.d.ts +2 -7
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
- package/dist/components/ObservationReadout.d.ts +45 -0
- package/dist/components/ThemeProvider.d.ts +4 -4
- package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
- package/dist/components/Tooltip/Tooltip.d.ts +30 -5
- package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
- package/dist/components/ai/chartClinic.d.ts +2 -0
- package/dist/components/ai/deriveProfileFields.d.ts +40 -0
- package/dist/components/ai/evaluateChart.d.ts +85 -0
- package/dist/components/ai/fieldPolicy.d.ts +7 -0
- package/dist/components/ai/fieldRoles.d.ts +24 -0
- package/dist/components/ai/generativeChart.d.ts +18 -2
- package/dist/components/ai/inferIntent.d.ts +26 -2
- package/dist/components/ai/intents.d.ts +35 -0
- package/dist/components/ai/navigationTree.d.ts +2 -2
- package/dist/components/ai/observedSceneAudit.d.ts +2 -1
- package/dist/components/ai/profileData.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +2 -3
- package/dist/components/ai/semanticEvidence.d.ts +4 -0
- package/dist/components/ai/semanticViability.d.ts +11 -0
- package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
- package/dist/components/ai/streamingTypes.d.ts +4 -0
- package/dist/components/ai/suggestCharts.d.ts +5 -6
- package/dist/components/ai/suggestDashboard.d.ts +2 -3
- package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
- package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
- package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
- package/dist/components/ai/variantDiscovery.d.ts +3 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
- package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
- package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
- package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
- package/dist/components/charts/index.d.ts +4 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
- package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
- package/dist/components/charts/network/Treemap.d.ts +2 -1
- package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
- package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
- package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
- package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
- package/dist/components/charts/physics/chainReactionTypes.d.ts +5 -1
- package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
- package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
- package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
- package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
- package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +25 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
- package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +15 -12
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +35 -14
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +21 -14
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +20 -13
- package/dist/components/charts/realtime/aggregate.d.ts +4 -1
- package/dist/components/charts/realtime/eventTime.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
- package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
- package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
- package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
- package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
- package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
- package/dist/components/charts/shared/annotationRules.d.ts +1 -15
- package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
- package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
- package/dist/components/charts/shared/chartMode.d.ts +3 -2
- package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
- package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
- package/dist/components/charts/shared/gradient.d.ts +16 -0
- package/dist/components/charts/shared/hatchFill.d.ts +15 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -4
- package/dist/components/charts/shared/legendUtils.d.ts +1 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -1
- package/dist/components/charts/shared/styleRules.d.ts +9 -2
- package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
- package/dist/components/charts/shared/types.d.ts +18 -9
- package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
- package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
- package/dist/components/charts/value/types.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
- package/dist/components/charts/xy/BumpChart.d.ts +13 -73
- package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +2 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
- package/dist/components/charts/xy/bumpData.d.ts +44 -0
- package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
- package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
- package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
- package/dist/components/legendLayout.d.ts +131 -4
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
- package/dist/components/realtime/types.d.ts +10 -1
- package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
- package/dist/components/recipes/directedReachability.d.ts +14 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
- package/dist/components/recipes/gridObservatory.d.ts +1 -1
- package/dist/components/recipes/networkAnalysis.d.ts +1 -18
- package/dist/components/recipes/physics.d.ts +7 -4
- package/dist/components/recipes/processPhysics.d.ts +0 -1
- package/dist/components/recipes/waffle.d.ts +7 -4
- package/dist/components/semiotic-ai-core.d.ts +13 -4
- package/dist/components/semiotic-ai-observations.d.ts +3 -0
- package/dist/components/semiotic-ai.d.ts +16 -9
- package/dist/components/semiotic-client-shared.d.ts +10 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-geo.d.ts +4 -1
- package/dist/components/semiotic-network.d.ts +7 -4
- package/dist/components/semiotic-ordinal.d.ts +4 -1
- package/dist/components/semiotic-physics.d.ts +11 -4
- package/dist/components/semiotic-realtime-core.d.ts +11 -4
- package/dist/components/semiotic-realtime-react.d.ts +4 -3
- package/dist/components/semiotic-realtime.d.ts +3 -1
- package/dist/components/semiotic-recipes-core.d.ts +7 -5
- package/dist/components/semiotic-server-edge.d.ts +3 -2
- package/dist/components/semiotic-server.d.ts +3 -2
- package/dist/components/semiotic-themes-core.d.ts +5 -48
- package/dist/components/semiotic-utils-core.d.ts +10 -5
- package/dist/components/semiotic-utils-react.d.ts +2 -0
- package/dist/components/semiotic-utils.d.ts +1 -1
- package/dist/components/semiotic-xy.d.ts +4 -1
- package/dist/components/semiotic.d.ts +68 -26
- package/dist/components/server/animatedGif.d.ts +1 -1
- package/dist/components/server/renderEvidence.d.ts +25 -2
- package/dist/components/server/renderToStaticSVG.d.ts +15 -7
- package/dist/components/server/serverChartConfigShared.d.ts +8 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
- package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
- package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
- package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
- package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
- package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
- package/dist/components/server/staticAnnotations.d.ts +28 -1
- package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticLegendMargin.d.ts +41 -0
- package/dist/components/server/staticOrdinal.d.ts +8 -2
- package/dist/components/server/staticPhysics.d.ts +13 -1
- package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
- package/dist/components/server/staticRawLegend.d.ts +15 -0
- package/dist/components/server/staticSVGChrome.d.ts +16 -55
- package/dist/components/server/staticXYAxes.d.ts +27 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
- package/dist/components/server/staticXYGrid.d.ts +11 -0
- package/dist/components/server/themeResolver.d.ts +5 -1
- package/dist/components/store/ThemeStore.d.ts +2 -98
- package/dist/components/store/designTokens.d.ts +1 -1
- package/dist/components/store/themeCSSVariables.d.ts +10 -0
- package/dist/components/store/themeCore.d.ts +91 -0
- package/dist/components/store/themePresets.d.ts +81 -0
- package/dist/components/store/themeSerialization.d.ts +2 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
- package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +2 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
- package/dist/components/stream/SVGChartTitle.d.ts +9 -0
- package/dist/components/stream/SVGOverlay.d.ts +1 -21
- package/dist/components/stream/SVGUnderlay.d.ts +24 -0
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +1 -1
- package/dist/components/stream/accessibleDataRows.d.ts +11 -0
- package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
- package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +19 -0
- package/dist/components/stream/canvasBackground.d.ts +10 -0
- package/dist/components/stream/canvasSetup.d.ts +9 -0
- package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
- package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
- package/dist/components/stream/frameGraphics.d.ts +18 -0
- package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
- package/dist/components/stream/frameLegendOptions.d.ts +18 -0
- package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
- package/dist/components/stream/geoTypes.d.ts +10 -11
- package/dist/components/stream/hitTarget.d.ts +61 -2
- package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
- package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
- package/dist/components/stream/networkCustomLayout.d.ts +2 -2
- package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
- package/dist/components/stream/networkFramePaint.d.ts +7 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +30 -32
- package/dist/components/stream/normalizeXYData.d.ts +7 -0
- package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
- package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
- package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
- package/dist/components/stream/ordinalTypes.d.ts +10 -4
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
- package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +23 -4
- package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
- package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
- package/dist/components/stream/pipelineConfig.d.ts +6 -17
- package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
- package/dist/components/stream/renderBackend.d.ts +2 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
- package/dist/components/stream/responsiveSize.d.ts +17 -0
- package/dist/components/stream/sceneCursor.d.ts +41 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
- package/dist/components/stream/types.d.ts +25 -12
- package/dist/components/stream/useCanvasFrameHost.d.ts +3 -1
- package/dist/components/stream/useFrame.d.ts +24 -1
- package/dist/components/stream/useResponsiveSize.d.ts +6 -1
- package/dist/components/stream/useStalenessCheck.d.ts +1 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +15 -4
- package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
- package/dist/components/types/legendTypes.d.ts +6 -0
- package/dist/components/types/marginType.d.ts +7 -8
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.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/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +13 -4
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +16 -9
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -0
- package/dist/semiotic-client-glyph.module.min.js +2 -0
- package/dist/semiotic-client-responsive.module.min.js +2 -0
- package/dist/semiotic-client-shared.module.min.js +2 -0
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node.module.min.js +2 -0
- package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
- 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-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -1
- package/dist/semiotic-network.d.ts +7 -4
- package/dist/semiotic-ordinal.d.ts +4 -1
- package/dist/semiotic-physics.d.ts +11 -4
- package/dist/semiotic-realtime-core.d.ts +11 -4
- package/dist/semiotic-realtime-core.min.js +2 -1
- package/dist/semiotic-realtime-core.module.min.js +2 -1
- package/dist/semiotic-realtime-react.d.ts +4 -3
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
- package/dist/semiotic-recipes-core.d.ts +7 -5
- package/dist/semiotic-recipes-core.min.js +9 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +7 -1
- package/dist/semiotic-recipes.module.min.js +2 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -0
- package/dist/semiotic-server-edge.d.ts +3 -2
- 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-server.d.ts +3 -2
- package/dist/semiotic-themes-core.d.ts +5 -48
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.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 +10 -5
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.d.ts +2 -0
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.d.ts +1 -1
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -1
- package/dist/semiotic.d.ts +68 -26
- package/dist/semiotic.min.js +1 -1
- 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.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +53 -19
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
- package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
- package/dist/chunk-chunk-2X3FJCME.module.min.js +0 -1
- package/dist/chunk-chunk-2ZHHWZQM.module.min.js +0 -2
- package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
- package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
- package/dist/chunk-chunk-5ZON5NMV.module.min.js +0 -2
- package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
- package/dist/chunk-chunk-6S3YGYW7.module.min.js +0 -1
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
- package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +0 -2
- package/dist/chunk-chunk-A3I4HBD5.module.min.js +0 -1
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
- package/dist/chunk-chunk-AFQHURLO.module.min.js +0 -2
- package/dist/chunk-chunk-DDB4TLQG.module.min.js +0 -2
- package/dist/chunk-chunk-DTH3SUOU.module.min.js +0 -2
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
- package/dist/chunk-chunk-DVCWU7MT.module.min.js +0 -2
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
- package/dist/chunk-chunk-FSIHAW6L.module.min.js +0 -2
- package/dist/chunk-chunk-G2RGVEYY.module.min.js +0 -2
- package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
- package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
- package/dist/chunk-chunk-HAJVODLO.module.min.js +0 -2
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
- package/dist/chunk-chunk-HIV7AW2V.module.min.js +0 -2
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
- package/dist/chunk-chunk-JZAMMSQQ.module.min.js +0 -2
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
- package/dist/chunk-chunk-MXMRXSCI.module.min.js +0 -2
- package/dist/chunk-chunk-MXVBXFKW.module.min.js +0 -2
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
- package/dist/chunk-chunk-OFAP623Y.module.min.js +0 -2
- package/dist/chunk-chunk-OHLRAEQZ.module.min.js +0 -2
- package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
- package/dist/chunk-chunk-PRNXOCYZ.module.min.js +0 -2
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
- package/dist/chunk-chunk-RLKZVJMQ.module.min.js +0 -2
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
- package/dist/chunk-chunk-SK2TQMG4.module.min.js +0 -2
- package/dist/chunk-chunk-SKLYXNYW.module.min.js +0 -2
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
- package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
- package/dist/chunk-chunk-U4NZCU5T.module.min.js +0 -2
- package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
- package/dist/chunk-chunk-VKL6DI43.module.min.js +0 -2
- package/dist/chunk-chunk-W62673ZE.module.min.js +0 -1
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
- package/dist/chunk-chunk-XCC25CZZ.module.min.js +0 -2
- package/dist/chunk-chunk-XECNOUZY.module.min.js +0 -2
- package/dist/chunk-chunk-XYZDTYAF.module.min.js +0 -2
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
- package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
- package/dist/test-utils/canvasMock.d.ts +0 -86
- package/dist/test-utils/capturedFrameProps.d.ts +0 -67
- package/dist/test-utils/frameMock.d.ts +0 -81
- package/dist/test-utils/ordinalFixtures.d.ts +0 -48
- /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
- /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
- /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
- /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{mergeShapeStyle as t,useChartSetup as o,useCustomChartSetup as i,useFrameImperativeHandle as r}from"./chunk-chunk-MXMRXSCI.module.min.js";import{validateArrayData as n}from"./chunk-chunk-J5QD4RAM.module.min.js";import{DataSourceAdapter as a,IncrementalExtent as s,barCanvasRenderer as l,buildEnrichAnnotationData as c,buildRectNode as h,normalizeColorGradient as u,normalizeGradient as d,resolveAnnotationAccessor as m,resolveFrameGraphics as g,snapOrdinalIntroTargets as p,ticksForMode as f,toIdSet as y}from"./chunk-chunk-U4NZCU5T.module.min.js";import{RingBuffer as v,compactTimestampBufferForRemoval as b,computePulseIntensity as x,createTimestampBufferForData as w,ensureRingBufferCapacity as A,hasActivePulses as k,pointCanvasRenderer as S,pushWithTimestamp as _,refreshIdlePulse as C,setPulseState as P,useLegendCategoryEmission as R,useOrdinalKeyboardNavigation as M,useSemanticFrameInteractions as L}from"./chunk-chunk-VKL6DI43.module.min.js";import{symbolCanvasRenderer as I}from"./chunk-chunk-PRNXOCYZ.module.min.js";import{StalenessBadge as T,attachUpdateResultStore as H,buildBaseMetadataProps as B,buildCustomBehaviorProps as D,buildDatumIndexMap as O,buildOrdinalTooltip as F,buildTooltipProps as E,composeOverlays as N,computeDecayOpacity as j,createCustomLayoutFailureDiagnostic as W,findHitPointInQuadtree as z,getHitRadius as G,glyphCanvasRenderer as V,hitTestRect as $,normalizeAngle as q,paintSceneWithBackend as X,renderPathPulse as Y,renderSceneWithBackend as Q,useConfigSync as K,useLayoutSelectionSync as Z,useStableShallow as U,useStalenessCheck as J,warnCustomLayoutDiagnostics as ee}from"./chunk-chunk-DVCWU7MT.module.min.js";import{wrapWithCustomLayoutSelection as te}from"./chunk-chunk-5UKL5W76.module.min.js";import{accessorsEquivalent as oe,resolveAccessor as ie,resolveStringAccessor as re}from"./chunk-chunk-NWIGA3UK.module.min.js";import{filterAnnotationsByStatus as ne}from"./chunk-chunk-XYZDTYAF.module.min.js";import{makeRuleValueResolver as ae,resolveStyleRules as se}from"./chunk-chunk-EMO5NUGE.module.min.js";import{buildResolveColor as le,resolveCustomLayoutPalette as ce}from"./chunk-chunk-OHLRAEQZ.module.min.js";import{AccessibleDataTable as he,AriaLiveTooltip as ue,CanvasFrameBackground as de,FlippingTooltip as me,FocusRing as ge,STREAMING_PALETTE as pe,SceneRevisionDiagnosticsObserver as fe,ScreenReaderSummary as ye,SkipToTableLink as ve,TITLE_BASELINE as be,UpdateResultTracker as xe,annotationLayout as we,annularSectorPath as Ae,buildGaugeGradientGeometry as ke,buildHoverData as Se,coerceCanvasFill as _e,computeCanvasAriaLabel as Ce,computeEasing as Pe,computeRawProgress as Re,createColorScale as Me,createDefaultAnnotationRules as Le,createHatchPattern as Ie,createLegend as Te,defaultTooltipStyle as He,filterSparseArray as Be,getColor as De,getDevicePixelRatio as Oe,getSize as Fe,interpolateBrBG as Ee,interpolatePRGn as Ne,interpolatePiYG as je,interpolateRdBu as We,interpolateRdYlBu as ze,interpolateRdYlGn as Ge,interpolateSpectral as Ve,isAnnotationActivationTarget as $e,isHatchFill as qe,isServerEnvironment as Xe,lerp as Ye,makeSymbolResolver as Qe,normalizeLinkedBrush as Ke,normalizeTooltip as Ze,now as Ue,observationInputType as Je,ordinalSceneNodeToSVG as et,parseCanvasColor as tt,renderAnnotationPass as ot,renderLegendFromConfig as it,resolveCSSColor as rt,resolveCanvasFill as nt,resolveDefaultFill as at,resolveOrdinalAxisChrome as st,smartTooltipEntries as lt,symbolRadius as ct,useAnnotationActivationOptions as ht,useBrushSelection as ut,useCategoryColors as dt,useChartMode as mt,useFrame as gt,useFrameCanvasHost as pt,useLinkedChartCategories as ft,useSceneRevisionDiagnostics as yt,useSortedData as vt,useThemeCategorical as bt,useThemeDiverging as xt,wrapStyleWithSelection as wt}from"./chunk-chunk-SK2TQMG4.module.min.js";import{getMax as At,getMinMax as kt}from"./chunk-chunk-2NVFEB7P.module.min.js";import{resolveThemeSemanticColors as St}from"./chunk-chunk-PMR47KRY.module.min.js";import{glyphHitGeometry as _t}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as Ct,SafeRender as Pt,useHydration as Rt,useWasHydratingFromSSR as Mt,warnMissingField as Lt}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useRef as It,useState as Tt,useEffect as Ht,useMemo as Bt,useCallback as Dt,useImperativeHandle as Ot,forwardRef as Ft,memo as Et}from"react";import{scaleBand as Nt,scaleLinear as jt}from"d3-scale";var Wt=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: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||pe,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};function zt(e){const t=e.getSymbol;return t?Qe(t,e.config.symbolMap):null}function Gt(e,t,o,i,r,n,a){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*n*n,symbolType:t(o),style:a,datum:o}:{type:"point",x:i,y:r,r:n,style:a,datum:o})}function Vt(e,t){const{columns:o,config:i,resolvePieceStyle:r}=e,n=[],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=r(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),n.push(v)}return n}import{quantile as $t}from"d3-array";function qt(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:$t(e,.25)??o,median:$t(e,.5)??(o+i)/2,q3:$t(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as Xt}from"d3-scale";var Yt={bar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getStack:a,resolvePieceStyle:s}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m="horizontal"===c,g=r.normalize,p=[];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),p.push(t))}}else p.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+=n(o),i.pieces.push(o)}let o=0;if(g)for(const e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(const n of p){const c=t.get(n);if(!c)continue;let p=c.total;g&&o>0&&(p/=o);const f=s(c.pieces[0],a?n:e.name),y={...c.pieces[0],__aggregateValue:c.total,__pieceCount:c.pieces.length,category:e.name};if(d){const t=l(0>p?r:i+p),o=0>p?l(r+p)-l(r):l(i)-l(i+p);u.push(h(e.x,t,e.width,Math.abs(o),f,y,n)),0>p?r+=p:i+=p}else if(m){const t=l(0>p?r+p:i),o=0>p?l(r)-l(r+p):l(i+p)-l(i);u.push(h(t,e.x,Math.abs(o),e.width,f,y,n)),0>p?r+=p:i+=p}}}const f="vertical"===c,y=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(y>0){const e=new Map;for(const t of u){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));e.length>0&&(e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t).roundedTop=y),o.length>0&&(o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t).roundedTop=y)}}return u},clusterbar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getGroup:a,resolvePieceStyle:s}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m=[],g=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=a?a(t):"_default";g.has(e)||(g.add(e),m.push(e))}const p=m.length||1;for(const e of Object.values(i)){const t=e.width/p,o=.2*t,i=t-o,r=new Map;for(const t of e.pieceData){const e=a?a(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let a=0;m.length>a;a++){const c=r.get(m[a])||[];for(const r of c){const c=n(r),g=s(r,m[a]);if(d){const n=e.x+a*t+o/2,s=l(0),d=l(c);u.push(h(n,Math.min(s,d),i,Math.abs(s-d),g,r,m[a]))}else{const n=e.x+a*t+o/2,s=l(0),d=l(c);u.push(h(Math.min(s,d),n,Math.abs(d-s),i,g,r,m[a]))}}}}const f=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=n(e.datum);f>0&&(e.roundedTop=f),e.roundedEdge=d?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}return u},point:function(e,t){const{scales:o,columns:i,getR:r,multiScales:n,resolvePieceStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=n.length>0,m=zt(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??r(t),l=d&&n[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);Gt(c,m,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:r,resolvePieceStyle:n}=e,{r:a,projection:s}=o,l=[],c="vertical"===s,h=zt(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=r(i),u=n(i,e.name),d=u.r||4,m=(7919*o%100/100-.5)*t*.8;Gt(l,h,i,c?e.middle+m:a(s),c?a(s):e.middle+m,d,u)}}return l},pie:Vt,donut:Vt,boxplot:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u=!1!==r.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],r=o[o.length-1],l=$t(o,.25)??i,d=$t(o,.5)??(i+r)/2,m=$t(o,.75)??r,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)??r,b=a(t.pieceData[0],t.name),x=[];if(u)for(const e of t.pieceData){const o=n(e);if(p>o||o>f){const i=h?t.middle:s(o),r=h?s(o):t.middle;x.push({px:i,py:r,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:{n:o.length,min:y,q1:l,median:d,q3:m,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),u)for(const t of x)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:b.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,u=r.bins||20,d=!1!==r.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(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],r=(i-o)/u||1,l=Array(u).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/r),u-1)]++;const m=At(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)*r);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)*r);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)*r)} ${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)*r)} ${e.middle+l[t]/m*g}`;p+=" Z"}const f=a(e.pieceData[0],e.name);let y;if(d&&t.length>=4){const r=$t(t,.25)??o,n=$t(t,.5)??(o+i)/2,a=$t(t,.75)??i;y={q1Pos:s(r),medianPos:s(n),q3Pos:s(a),centerPos:e.middle,isVertical:h}}const v=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:v,iqrLine:y,stats:qt(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:a}=e,{r:s}=o,l=[],c=r.bins||25,u=r.normalize,d=s.domain?.(),m=d?+d[0]:void 0,g=d?+d[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=kt(t),r=null!=m&&isFinite(m)?m:o,d=null!=g&&isFinite(g)?g:i,p=(d-r)/c||1,f=Array(c).fill(0);for(const e of t)r>e||e>d||f[Math.min(Math.floor((e-r)/p),c-1)]++;const y=t.length,v=At(f,1),b=a(e.pieceData[0],e.name);for(let t=0;c>t;t++){if(0===f[t])continue;const o=(u?f[t]/y:f[t]/v)*e.width*.9,i=s(r+t*p),n=s(r+(t+1)*p);l.push(h(Math.min(i,n),e.x+e.width-o,Math.abs(n-i),o,b,{bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name},e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:a}=e,{r:s,projection:l}=o,c=[],h=r.bins||20,u="horizontal"===l,d=r.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(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],r=(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)/r),h-1)]++;const m=At(l,1),g=a(e.pieceData[0],e.name),p=e.width*d;let f;if(u){const t=e.x+e.width;f=`M ${s(o)} ${t}`;for(let e=0;h>e;e++)f+=` L ${s(o+(e+.5)*r)} ${t-l[e]/m*p}`;f+=` L ${s(i)} ${t} Z`}else{const t=e.x;f=`M ${t} ${s(o)}`;for(let e=0;h>e;e++){const i=s(o+(e+.5)*r);f+=` L ${t+l[e]/m*p} ${i}`}f+=` L ${t} ${s(i)} Z`}const y=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:f,translateX:0,translateY:0,bounds:y,stats:qt(t),style:{...g,fillOpacity:g.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:r,resolvePieceStyle:n}=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=r(t);if(!o)continue;const[i,s]=o,u=n(t,e.name);if(c){const o=a(Math.min(i,s)),r=a(Math.max(i,s));l.push(h(o,e.x,r-o,e.width,u,t,e.name))}else{const o=a(Math.max(i,s)),r=a(Math.min(i,s));l.push(h(e.x,o,e.width,r-o,u,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n}=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 u=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=r?r(t):"_default";d.has(e)||(d.add(e),u.push(e))}const m=u.length>1&&"_default"!==u[0],g=[];let p=0;for(const e of c){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(n);a.total+=s,a.pieces.push(n),o+=s}g.push({col:e,groups:t,stepTotal:o}),m||o>p&&(p=o)}if(m)for(const e of g){let t=0,o=0;for(let i=0;u.length>i;i++){const r=e.groups.get(u[i]);r&&(i%2==0?t+=r.total:o+=r.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return a;const f=new Map;for(const e of u){const t=g[0].groups.get(e);f.set(e,t?.total??0)}const y=g[0].stepTotal,v=m?.95*s:.9*t.width,b=Xt().domain([0,p]).range([0,v]),x=e.config.connectorOpacity??.3;let w=new Map;for(let t=0;g.length>t;t++){const o=g[t],i=o.col,r=0===t,c=i.width,d=.55*c,p=i.x+(c-d)/2,v=new Map;if(m){let e=0;for(const t of u){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=s,c=s;for(let m=0;u.length>m;m++){const g=u[m],y=o.groups.get(g);if(!y)continue;const x=b(y.total),w=m%2==0,A=w?t:c-x;w?t+=x:c-=x;const k=n(y.pieces[0],g),S=f.get(g)??y.total,_={...y.pieces[0],__funnelValue:y.total,__funnelPercent:S>0?y.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:g};l&&(0===m&&(_.__funnelStepLabel=i.name,_.__funnelStepLabelX=s,_.__funnelStepLabelY=p,_.__funnelRowWidth=e),_.__funnelValueLabelX=A+x/2,_.__funnelValueLabelY=p,_.__funnelBarW=x),a.push(h(A,p,x,d,k,_,g)),v.set(g,{x:A,y:p,w:x,h:d})}}else{const e=o.stepTotal,t=b(e),c=s-t/2,m=u[0],g="_default"!==m,f=o.groups.get(m)?.pieces[0]??i.pieceData[0],x=g?m:i.name,w=n(f,x),A=y>0?e/y*100:0,k={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:r,category:g?m:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=s,k.__funnelStepLabelY=p,k.__funnelRowWidth=t,k.__funnelValueLabelX=s,k.__funnelValueLabelY=p,k.__funnelBarW=t),a.push(h(c,p,t,d,w,k,x)),v.set(m,{x:c,y:p,w:t,h:d})}if(t>0&&w.size>0){const t=m?u:[u[0]];for(const r of t){const t=w.get(r),s=v.get(r);if(!t||!s)continue;const l=(()=>{const e=o.groups.get(r);return n(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),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:x},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};a.push(c)}}w=v}return a},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n,scales:a}=e,s=[],l=a.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return s;const c=[],u=new Set;for(const e of l)for(const t of e.pieceData){const e=r?r(t):"_default";u.has(e)||(u.add(e),c.push(e))}const d=c.length>1&&"_default"!==c[0],m=[];for(const e of l){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const a=t.get(e),s=i(n);a.total+=s,a.pieces.push(n),o+=s}m.push({col:e,groups:t,stepTotal:o})}const g=new Map;for(const e of c){const t=m[0]?.groups.get(e);g.set(e,t?.total??0)}const p=a.r,f=d?c.length:1,y=d?.15:0;for(let e=0;m.length>e;e++){const t=m[e],o=t.col,i=0===e,r=e>0?m[e-1]:null,a=o.width/f,l=a*y,u=a-l;for(let e=0;c.length>e;e++){const m=c[e],f=t.groups.get(m);if(!f)continue;const y=f.total,v=g.get(m)??y,b=v>0?y/v*100:0,x=r?.groups.get(m),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*a+l/2,k=p(y),S=p(0)-k,_=n(f.pieces[0],d?m:o.name),C={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===m?void 0:m,category:d?m:o.name,__barFunnelLabelX:A+u/2,__barFunnelLabelY:p(y+w)};if(s.push(h(A,k,u,S,_,C,d?m:o.name)),w>0){const e=p(y+w),t=k-e,i={..._},r={...f.pieces[0],__barFunnelValue:w,__barFunnelPercent:v>0?w/v*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===m?void 0:m,category:d?m:o.name};s.push(h(A,e,u,t,i,r,d?m:o.name))}}}return s},swimlane:function(e,t){const{scales:o,columns:i,getR:r,getStack:n,resolvePieceStyle:a}=e,{r:s,projection:l}=o,c=[],u="horizontal"===l,d=e.config.gradientFill,m=u?"left":"bottom",g=e.config.trackFill;if(g){const e="string"==typeof g?g:g.color,t="string"==typeof g?1:g.opacity??1,[o,r]=s.range(),n=Math.min(o,r),a=Math.abs(r-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},r=u?h(n,o.x,a,o.width,i,null,"__track__"):h(o.x,n,o.width,a,i,null,"__track__");c.push(r)}}const p=e.config.roundedTop&&e.config.roundedTop>0?Math.max(0,e.config.roundedTop):0;for(const e of Object.values(i)){let t=0;const o=c.length;for(const o of e.pieceData){const i=Math.abs(r(o));if(0===i)continue;const l=n?n(o):e.name,g=a(o,l);let p;if(u){const r=s(t),n=s(t+i);p=h(r,e.x,n-r,e.width,g,o,l)}else{const r=s(t+i),n=s(t);p=h(e.x,r,e.width,n-r,g,o,l)}d&&(p.fillGradient=d,p.roundedEdge=m),c.push(p),t+=i}if(p>0&&c.length>o){const e=c.slice(o),t=e[0],i=e[e.length-1];1===e.length?t.cornerRadii={tl:p,tr:p,br:p,bl:p}:u?(t.cornerRadii={tl:p,bl:p},i.cornerRadii={tr:p,br:p}):(t.cornerRadii={bl:p,br:p},i.cornerRadii={tl:p,tr:p})}}return c}},Qt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kt=["scene-style","data-paint","accessibility","evidence"],Zt=(e,t)=>({retainedData:e,invalidations:t}),Ut=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],eo=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],to=["scene-geometry","data-paint","accessibility","evidence"],oo=["scene-style","data-paint","accessibility","evidence"],io=[],ro={chartType:Zt("rebuild",Ut),runtimeMode:Zt("rebuild",Ut),categoryAccessor:Zt("rebuild",Ut),valueAccessor:Zt("rebuild",Ut),oAccessor:Zt("rebuild",Ut),rAccessor:Zt("rebuild",Ut),stackBy:Zt("rebuild",Ut),groupBy:Zt("rebuild",Ut),timeAccessor:Zt("rebuild",Ut),accessorRevision:Zt("rebuild",Ut),colorAccessor:Zt("rebuild",oo),symbolAccessor:Zt("rebuild",to),connectorAccessor:Zt("rebuild",to),dataIdAccessor:Zt("rebuild",to),projection:Zt("preserve",Jt),extentPadding:Zt("preserve",Jt),axisExtent:Zt("preserve",Jt),rExtent:Zt("preserve",Jt),oExtent:Zt("preserve",Jt),multiAxis:Zt("preserve",Jt),normalize:Zt("preserve",Jt),bins:Zt("preserve",Jt),oSort:Zt("preserve",eo),barPadding:Zt("preserve",eo),roundedTop:Zt("preserve",eo),baselinePadding:Zt("preserve",eo),innerRadius:Zt("preserve",eo),cornerRadius:Zt("preserve",eo),startAngle:Zt("preserve",eo),sweepAngle:Zt("preserve",eo),trackFill:Zt("preserve",eo),showOutliers:Zt("preserve",eo),showIQR:Zt("preserve",eo),amplitude:Zt("preserve",eo),connectorOpacity:Zt("preserve",eo),showLabels:Zt("preserve",eo),dynamicColumnWidth:Zt("rebuild",eo),customLayout:Zt("preserve",eo),layoutConfig:Zt("preserve",eo),layoutMargin:Zt("preserve",eo),symbolMap:Zt("preserve",to),pieceStyle:Zt("preserve",oo),summaryStyle:Zt("preserve",oo),connectorStyle:Zt("preserve",oo),gradientFill:Zt("preserve",oo),colorScheme:Zt("preserve",oo),themeCategorical:Zt("preserve",oo),themeSemantic:Zt("preserve",oo),themeSequential:Zt("preserve",oo),themeDiverging:Zt("preserve",oo),barColors:Zt("preserve",oo),decay:Zt("preserve",oo),pulse:Zt("preserve",oo),staleness:Zt("preserve",oo),layoutSelection:Zt("preserve",oo),windowSize:Zt("preserve",io),windowMode:Zt("preserve",io),clock:Zt("preserve",io),transition:Zt("preserve",io),introAnimation:Zt("preserve",io),onLayoutError:Zt("preserve",io)},no=Zt("preserve",eo),ao=class{constructor(){this.tracker=new xe}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}},Qt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Kt):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]??no;"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 so}from"d3-quadtree";var lo=class{constructor(e){this.rExtent=new s,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new ao,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Wt,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 v(e.windowSize),this.getO=re(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>ie(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new s)):(this.getR=ie(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=re(e.stackBy),this.getGroup=re(e.groupBy),this.getColor=re(e.colorAccessor),this.getSymbol=re(e.symbolAccessor),this.getConnector=re(e.connectorAccessor),this.getDataId=re(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new v(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:w(t,i):null)}currentTime(){return this.config.clock?.()??Ue()}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(),A(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)_(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=_(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,r=this.multiScales,n=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=Nt().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;g=jt().domain(c).range([i,o])}else h?(m=Nt().domain(l).range([0,e.height]).padding(d),g=jt().domain(c).range([0,e.width])):(m=Nt().domain(l).range([0,e.width]).padding(d),g=jt().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,r)=>{const n=this.rExtents[r];n.dirty&&n.recalculate(o,i);let[a,s]=n.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?jt().domain([a,s]).range([0,e.width]):jt().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=r,this.columns=n):(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 r=null;if(o){r=new Set;for(const t of e)r.add(this.getO(t))}const n=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return n}if(!1===i)return n;if("function"==typeof i)return n.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 n.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:r,rExtent:n,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&&r)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),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}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)}n&&(null!=n[0]&&(g=n[0]),null!=n[1]&&(p=n[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==n?.[0]&&null==n?.[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,r=f&&!s&&0===p||"swimlane"===o;null!=n?.[0]||i||(g-=t),null!=n?.[1]||r||(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,r){return function(e){const{data:t,oExtent:o,oScale:i,projection:r,layout:n,dynamicColumnWidth:a,getO:s,getR:l}=e,c={},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"===r)for(const e of t)u+=Math.abs(l(e));let d=null;if(a&&"radial"!==r){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"===r?n.height:n.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),r=u>0?o/u:0;let n,a;d?(n=g,a=d.get(e)||i.bandwidth(),g+=a+i.padding()*i.step()):(n=i(e)??0,a=i.bandwidth()),c[e]={name:e,x:n,y:0,width:a,middle:n+a/2,padding:i.padding()*i.step(),pieceData:t,pct:r,pctStart:m},m+=r}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,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);let i;try{i=this.config.customLayout(o)}catch(e){const t=null!==this.lastCustomLayoutResult,o=W("ordinal",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] ordinal customLayout threw:",e);try{this.config.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const r=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.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 ee({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=Yt[this.config.chartType];let r=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:r,getO:n}=e;if(!r||!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=r(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:n(t)})}const c=o.o.domain(),h=i.connectorStyle;for(const[t,o]of l)if(o.length>=2){o.sort((e,t)=>c.indexOf(e.category)-c.indexOf(t.category));for(let i=0;o.length-1>i;i++){const r=o[i],n=o[i+1],s="function"==typeof h?h(r.datum):h||{stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5};a.push({type:"connector",x1:r.x,y1:r.y,x2:n.x,y2:n.y,style:s,datum:r.datum,group:t})}}return a}(o,r);r=[...e,...r]}return r}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=ce(o.colorScheme,o.themeCategorical,pe),n=this.scales;return{data:e,scales:{o:n.o,r:n.r,projection:n.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===n.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:[...r]},resolveColor:le(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?j(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=O(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",r=new Map;for(let n=0;e.length>n;n++){const a=e[n],s=o?t(a):a[i],l=r.get(s);l?l.push(n):r.set(s,[n])}return r}(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&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let r=0;for(const t of e)"point"===t.type&&(i[r++]=t);return{maxRadius:o,quadtree:so().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 r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,n){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 r(t)??[]){const t=o.get(a);null!=t&&(i=Math.max(i,x(e,t,n)))}l=P(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:x(e,h,n);l=P(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&&k(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 r=0;this.scene.length>r;r++){const n=this.scene[r],a=this.getNodeKey(n,e);a&&("rect"===n.type?this.prevPositionMap.set(a,o?{x:n.x,y:t,w:n.w,h:0,opacity:n.style.opacity??1}:{x:t,y:n.y,w:0,h:n.h,opacity:n.style.opacity??1}):"point"===n.type?this.prevPositionMap.set(a,{x:n.x,y:n.y,r:0,opacity:0}):"wedge"===n.type&&(void 0===i&&(i=n.startAngle),this.prevPositionMap.set(a,{x:n.cx,y:n.cy,startAngle:i,endAngle:i,innerRadius:n.innerRadius,outerRadius:n.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}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}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 r=this.scene[e],n=this.getNodeKey(r,i);if(!n)continue;r._transitionKey=n;const a=this.prevPositionMap.get(n);if("point"===r.type)a?(o.add(n),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(a.x!==r.x||a.y!==r.y||void 0!==a.r&&a.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=a.x,r.y=a.y,void 0!==a.r&&(r.r=a.r),t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)a?(o.add(n),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,a.x===r.x&&a.y===r.y&&a.w===r.w&&a.h===r.h||(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=a.x,r.y=a.y,r.w=a.w??r.w,r.h=a.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(a)o.add(n),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,a.startAngle===r.startAngle&&a.endAngle===r.endAngle||(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=a.startAngle,r.endAngle=a.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;const e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(n,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.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=Re(e,this.activeTransition),o=Pe(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=Ye(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Ye(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ye(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=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o),void 0!==i.w&&(e.w=Ye(i.w,e._targetW,o),e.h=Ye(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:Ye(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=Ye(i.startAngle,e._targetStartAngle,o),e.endAngle=Ye(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,p(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=y(e),o=this.getDataId,i=e=>t.has(o(e));b(this.buffer,this.timestampBuffer,i);const r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)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",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=y(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});const n=this.buffer.update(e=>o.has(i(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}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??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),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&&!oe(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!oe(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!oe(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)&&(oe(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=re(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!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],n=Array.isArray(o)?o:[o];if(r=i.length!==n.length||i.some((e,t)=>!oe(e,n[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>ie(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new s)):(this.getR=ie(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!oe(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?re(this.config.stackBy):void 0),"groupBy"in e&&!oe(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?re(this.config.groupBy):void 0),"colorAccessor"in e&&!oe(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?re(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!oe(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?re(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!oe(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?re(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function co(e,t,o,i=30,r,n=0){let a=null;if(r){const e=z(r,t,o,i,n);e&&(a={datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const n of e){let e=null;switch(n.type){case"rect":if(null==n.datum)break;e=ho(n,t,o);break;case"point":if(r)break;e=uo(n,t,o,i);break;case"symbol":e=mo(n,t,o,i);break;case"glyph":e=go(n,t,o,i);break;case"wedge":if(null===n.datum)break;e=po(n,t,o);break;case"boxplot":e=fo(n,t,o);break;case"violin":e=yo(n,t,o)}e&&i>e.distance&&(a&&e.distance>=a.distance||(a=e))}return a}function ho(e,t,o){const i=$(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function uo(e,t,o,i=30){const r=t-e.x,n=o-e.y,a=Math.sqrt(r*r+n*n);return a>G(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function mo(e,t,o,i=30){const r=t-e.x,n=o-e.y,a=Math.sqrt(r*r+n*n);return a>G(ct(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:a}}function go(e,t,o,i=30){if(null==e.datum)return null;const r=_t(e.glyph,e.size),n=e.x+r.centerDx,a=e.y+r.centerDy,s=t-n,l=o-a,c=Math.sqrt(s*s+l*l);return c>G(r.radius,i)?null:{datum:e.datum,x:n,y:a,distance:c}}function po(e,t,o){const i=t-e.cx,r=o-e.cy,n=Math.sqrt(i*i+r*r);if(e.innerRadius>n||n>e.outerRadius)return null;const a=q(Math.atan2(r,i)),s=q(e.startAngle),l=q(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 fo(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 r=e.y-i,n=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>n))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function yo(e,t,o){if(!e.bounds)return null;const{x:i,y:r,width:n,height:a}=e.bounds;return i>t||t>i+n||r>o||o>r+a?null:{datum:e.datum,x:i+n/2,y:r+a/2,distance:0,category:e.category,stats:e.stats}}H(lo);import{useMemo as vo,useRef as bo}from"react";import{Fragment as xo,jsx as wo,jsxs as Ao}from"react/jsx-runtime";function ko(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:a,showAxes:s,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===a?.projection,m="horizontal"===a?.projection,g=vo(()=>!a||d?[]:(h||f(a.r,5,u)).map(e=>({value:e,pixel:a.r(e),label:(c||So)(e)})),[a,c,d,h,u]),p=l&&a&&!d,y=s&&a&&!d;return p||y?wo("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:Ao("g",{transform:`translate(${n.left},${n.top})`,children:[p&&wo("g",{className:"ordinal-grid",children:g.map((e,i)=>wo("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&&wo(xo,{children:Ao(xo,m?{children:[wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[wo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function So(e){return Math.round(100*e)/100+""}function _o(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:a,showAxes:s,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:u,rFormat:d,showGrid:m,title:g,legend:p,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:k,annotations:S,onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R,autoPlaceAnnotations:M,svgAnnotationRules:L,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:D=!0,children:O}=e,F=ht({onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R}),E="radial"===a?.projection,N="horizontal"===a?.projection,j=!1!==l,W=!B||D,z=vo(()=>{if(!s||!j||!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,N?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=N?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;const n=Math.max(...i)+r,l=Math.max(1,Math.ceil(n/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[s,j,a,u,E,N]),G=e.rTickValues,V=e.tickLabelEdgeAlign,$=e.axisExtent,q=vo(()=>s&&a&&!E?(G||f(a.r,5,$)).map(e=>({value:e,pixel:a.r(e),label:(d||So)(e)})):[],[s,a,d,E,G,$]),X=bo(new Map),Y=bo(S?.length??0),Q=S?.length??0;Y.current!==Q&&(Y.current=Q,X.current=new Map);const K=vo(()=>{if(!S||0===S.length)return null;const e=ne(S),i=Le("ordinal",F),r="horizontal"===a?.projection,n=a?.o?e=>(a.o(e)??0)+a.o.bandwidth()/2:null,s={scales:a?{x:r?a.r:n||a.r,y:r&&n||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:r?"horizontal":"vertical",stickyPositionCache:X.current},l=M?we({annotations:e,context:s,..."object"==typeof M?M:{}}):e;return ot(l,i,L,s)},[S,M,L,t,o,a,I,T,H,F]);return s||g||p||k||K&&K.length>0||m||O?Ao("svg",{role:"img",width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[wo("title",{children:"string"==typeof g?g:"Ordinal Chart"}),wo("desc",{children:"string"==typeof g?g+" (ordinal data visualization)":"Ordinal data visualization"}),Ao("g",{transform:`translate(${n.left},${n.top})`,children:[m&&a&&!E&&W&&wo("g",{className:"ordinal-grid",children:q.map((e,i)=>wo("line",{x1:N?e.pixel:0,y1:N?0:e.pixel,x2:N?e.pixel:t,y2:N?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 wo("g",{className:"ordinal-axes",children:Ao(xo,N?{children:[Ao("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),z.map((t,o)=>Ao("g",{transform:`translate(0,${t.pixel})`,children:[wo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?wo("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}):wo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:wo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&wo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Ao("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&wo("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?wo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),q.map((t,i)=>{const r=V?0===i?"start":i===q.length-1?"end":"middle":"middle";return Ao("g",{transform:`translate(${t.pixel},${o})`,children:[wo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&wo("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:[Ao("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 wo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),z.map((t,i)=>Ao("g",{transform:`translate(${t.pixel},${o})`,children:[wo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?wo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):wo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:wo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&wo("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})]}),Ao("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>Ao("g",{transform:`translate(0,${t.pixel})`,children:[wo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("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&&wo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),K,k,O]}),g&&"string"==typeof g?wo("text",{x:i/2,y:be,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:g}):g?wo("foreignObject",{x:0,y:0,width:i,height:n.top,children:g}):null,it({legend:p,totalWidth:i,totalHeight:r,margin:n,legendPosition:w,title:g,legendLayout:A,axisChrome:{hasAxis:!!s&&!E,hasAxisLabel:N?!!h:!!c},legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as Co from"react";import{jsx as Po}from"react/jsx-runtime";var Ro=null,Mo=null;function Lo(e){const[t,o]=Co.useState(()=>Ro);return Co.useEffect(()=>{if(t)return;let e=!1;return(Ro?Promise.resolve(Ro):(Mo||(Mo=import("./chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js").then(e=>Ro=e.OrdinalBrushOverlay).catch(e=>{throw Mo=null,e})),Mo)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Po(t,{...e}):null}import{arc as Io}from"d3-shape";function To(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:r}=ke({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}),n=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(n);for(const t of r)e.fillStyle=rt(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore(),t.style.stroke&&"none"!==t.style.stroke&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(n),e.restore())}function Ho(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 Bo(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=Io().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const r=new Path2D(i);e.fill(r),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(r),e.restore()}var Do=(e,t,o,i)=>{const r=t.filter(e=>"wedge"===e.type);for(const t of r)if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)To(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(Ho(e,t),Y(e,t)),e.globalAlpha=1;else{if(e.fillStyle=nt(e,t.style.fill,"#007bff"),t.roundedEnds){t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1);const o=Ae({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 i=new Path2D(o);e.fill(i),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(i),e.restore()}else t.cornerRadius?(t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1),Bo(e,t)):(Ho(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(Ho(e,t),Y(e,t)),e.globalAlpha=1}},Oo=(e,t,o,i)=>{const r=t.filter(e=>"boxplot"===e.type);for(const t of r){const o=t.columnWidth/2,i="vertical"===t.projection,r=rt(e,"var(--semiotic-primary, #007bff)"),n=rt(e,"var(--semiotic-text, #333)"),a=nt(e,t.style.fill,r),s=t.style.stroke,l="string"==typeof s?rt(e,s)||s:n,c=t.style.strokeWidth||1,h=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),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=h,e.fillStyle=a,i){const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,e.strokeRect(t.x-o,i,t.columnWidth,r)}else{const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,e.strokeRect(i,t.y-o,r,t.columnWidth)}e.strokeStyle="#fff",e.lineWidth=2,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()}},Fo=(e,t,o,i)=>{const r=t.filter(e=>"violin"===e.type);for(const t of r){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);if(e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=nt(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1,t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,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()}},Eo=(e,t,o,i)=>{const r=t.filter(e=>"connector"===e.type);if(0===r.length)return;const n=new Map;for(const e of r){const t=e.group||"_default";n.has(t)||n.set(t,[]),n.get(t).push(e)}for(const[,t]of n){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=_e(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t)e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=rt(e,o.style.stroke)||nt(e,o.style.fill,"")||rt(e,"var(--semiotic-border, #999)"),e.lineWidth=o.style.strokeWidth||1,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1}},No=(e,t,o,i)=>{const r=t.filter(e=>"trapezoid"===e.type);for(const t of r){const o=t.points;if(o.length>=4){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=_e(e,t.style?.fill)||"#999",e.fill(),t.style?.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()),e.globalAlpha=1}}};function jo(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 Wo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var zo=new Map;function Go(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=zo.get(o);if(void 0!==i)return i;const r=Ie({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),n=qe(r)?null:r;return zo.set(o,n),n}function Vo(e,t,o,i,r,n){e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath()}function $o(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 qo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function Xo(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function Yo(e){return(t,o,i,r)=>{e(t,o.filter(Xo),{x:i.r,y:i.r},r)}}var Qo=Yo(l),Ko=Yo(S),Zo=Yo(I),Uo=Yo(V),Jo=e=>[Eo,...e],ei={bar:Jo([Qo]),clusterbar:Jo([Qo]),point:Jo([Ko,Zo]),swarm:Jo([Ko,Zo]),pie:[Do],donut:[Do],boxplot:Jo([Oo,Ko]),violin:Jo([Fo]),histogram:Jo([Qo]),ridgeline:Jo([Fo]),timeline:Jo([Qo]),funnel:[Qo,No,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0!==r.length&&r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX)){e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px sans-serif";for(const t of r){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 r=o.__funnelStepLabelX,n=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,n),e.fillStyle="#fff",e.fillText(i,r,n)}e.font="bold 13px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const r=o.__funnelValue;if(null==r||0===r)continue;const n=o.__funnelPercent,a=!0===o.__funnelIsFirstStep;let s;if(s=a?jo(r):null!=n?`${jo(r)} (${Wo(n)})`:jo(r),e.measureText(s).width+16>i){if(a||null==n)continue;if(s=jo(r),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":[Qo,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of r){const o=("string"==typeof t.style.fill?t.style.fill:null)||rt(e,"var(--semiotic-border, #999)"),i=Go(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 r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;const n=function(e,t){const[o,i,r]=tt(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,rt(e,"var(--semiotic-text, #333)")),a=n?"#1f2937":"#ffffff",s=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",l=n?"#f3f4f6":"#1a1a1a",c=l;for(const t of r){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,h=n?qo(r):"",u=$o(i);e.font="bold 13px sans-serif";const d=n?e.measureText(h).width:0;e.font="11px sans-serif";const m=e.measureText(u).width,g=Math.max(d,m)+12,p=n?32:17,f=o.__barFunnelLabelX,y=f-g/2,v=o.__barFunnelLabelY-p-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=a,e.beginPath(),Vo(e,y,v,g,p,4),e.fill(),e.restore(),e.strokeStyle=s,e.lineWidth=.5,e.beginPath(),Vo(e,y,v,g,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px sans-serif",e.fillStyle=l,e.fillText(h,f,v+3),e.font="11px sans-serif",e.fillStyle=c,e.fillText(u,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(u,f,v+3))}e.lineWidth=1}],swimlane:Jo([Qo]),custom:Jo([Qo,Ko,Zo,Uo,Do,Oo,Fo,No])};import{jsx as ti,jsxs as oi}from"react/jsx-runtime";function ii(e){const t=lt(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:oi("div",{className:"semiotic-tooltip",style:He,children:[null!=t.title&&ti("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>oi("div",{children:[oi("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function ri({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 oi("div",{className:"semiotic-tooltip",style:He,children:[e&&ti("div",{style:{fontWeight:"bold"},children:e+""}),oi("div",{children:["n = ",o.n]}),oi("div",{children:["Min: ",o.min.toLocaleString()]}),oi("div",{children:["Q1: ",o.q1.toLocaleString()]}),oi("div",{children:["Median: ",o.median.toLocaleString()]}),oi("div",{children:["Q3: ",o.q3.toLocaleString()]}),oi("div",{children:["Max: ",o.max.toLocaleString()]}),oi("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const r=t.length;return oi("div",{className:"semiotic-tooltip",style:He,children:[e&&ti("div",{style:{fontWeight:"bold"},children:e+""}),oi("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return oi("div",{className:"semiotic-tooltip",style:He,children:[t.category&&ti("div",{style:{fontWeight:"bold"},children:t.category+""}),oi("div",{children:["Count: ",t.count]}),2===e.length&&oi("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const r=e.__oAccessor,n=e.__rAccessor,a=e.__chartType;if("swarm"===a||"point"===a)return ii(t);const s=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(n&&null!=t[n]?t[n]:null)??t.value??t.__rValue??t.pct??"";return s||""!==l?oi("div",{className:"semiotic-tooltip",style:He,children:[s&&ti("div",{style:{fontWeight:"bold"},children:s+""}),""!==l&&ti("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):ii(t)}ri.ownsChrome=!0;import{jsx as ni,jsxs as ai}from"react/jsx-runtime";var si={top:50,right:40,bottom:60,left:70},li=Et(Ft(function(e,t){const{chartType:o,runtimeMode:i,data:r,oAccessor:n="category",rAccessor:s="value",colorAccessor:l,symbolAccessor:h,symbolMap:u,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:v,valueAccessor:b,categoryAccessor:x,accessorRevision:w,projection:A="vertical",size:k=[600,400],responsiveWidth:S,responsiveHeight:_,margin:P,maxDevicePixelRatio:I,barPadding:H,roundedTop:B,gradientFill:D,trackFill:O,baselinePadding:F,innerRadius:E,cornerRadius:j,normalize:W,startAngle:z,sweepAngle:G,dynamicColumnWidth:V,bins:$,showOutliers:q,showIQR:Y,amplitude:ee,connectorOpacity:oe,showLabels:ie,connectorAccessor:re,connectorStyle:ne,dataIdAccessor:ae,rExtent:se,oExtent:le,extentPadding:ce=.05,oSort:pe,windowMode:be="sliding",windowSize:xe=200,pieceStyle:we,summaryStyle:Ae,renderMode:ke,colorScheme:_e,barColors:Pe,showAxes:Re=!0,showCategoryTicks:Me,categoryLabel:Le,valueLabel:Ie,categoryFormat:Te,valueFormat:He,oLabel:De,rLabel:Fe,oFormat:Ee,rFormat:Ne,rTickValues:je,tickLabelEdgeAlign:We,axisExtent:ze,enableHover:Ge=!0,hoverAnnotation:Ve,tooltipContent:qe,customHoverBehavior:Ye,customClickBehavior:Qe,onObservation:Ke,annotationObservationCallback:Ze,chartId:Ue,annotations:tt,onAnnotationActivate:ot,autoPlaceAnnotations:it,svgAnnotationRules:rt,showGrid:nt=!1,legend:at,legendHoverBehavior:st,legendClickBehavior:lt,legendHighlightedCategory:ct,legendIsolatedCategories:ht,legendPosition:ut,legendLayout:dt,legendCategoryAccessor:mt,onCategoriesChange:ft,backgroundGraphics:vt,foregroundGraphics:bt,title:xt,className:wt,background:At,centerContent:kt,decay:_t,pulse:Ct,transition:Pt,animate:Lt,staleness:Ft,frameScheduler:Et,clock:Nt,random:jt,seed:Wt,paused:zt=!1,suspendWhenHidden:Gt=!0,brush:Vt,onBrush:$t,accessibleTable:qt=!0,description:Xt,summary:Yt,customLayout:Qt,onLayoutError:Kt,layoutConfig:Zt,layoutSelection:Ut}=e,{customHoverBehavior:Jt,customClickBehavior:eo,hasClickBehavior:to}=L({customHoverBehavior:Ye,customClickBehavior:Qe,onObservation:Ke,chartId:Ue,chartType:"StreamOrdinalFrame"}),oo=x??n,io=b??s,ro=It(!0),no=gt({sizeProp:k,responsiveWidth:S,responsiveHeight:_,userMargin:P,marginDefault:si,title:xt,legend:at,legendPosition:ut,animate:Lt,transitionProp:Pt,frameScheduler:Et,clock:Nt,random:jt,seed:Wt,paused:zt,suspendWhenHidden:Gt,themeDirtyRef:ro}),{reducedMotionRef:ao,responsiveRef:so,size:ho,margin:uo,adjustedWidth:mo,adjustedHeight:go,currentTheme:po,transition:fo,introEnabled:yo,tableId:vo,rafRef:bo,renderFnRef:xo,scheduleRender:wo,frameRuntime:Ao}=no,So=Rt(),Co=Mt(),Po=Bt(()=>Be(r),[r]),Ro=Le??De,Mo=Ie??Fe,Io=Te??Ee,To=He??Ne,Ho=It(null),[Bo,Do]=Tt(null),[Oo,Fo]=Tt(null),Eo=g(bt,ho,uo,Oo),No=g(vt,ho,uo,Oo),jo=vt||"transparent"===At?null:ni("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-uo.left,y:-uo.top,width:ho[0],height:ho[1],fill:At||"var(--semiotic-bg, transparent)"}),[Wo,zo]=Tt(0),Go=It(0),[Vo,$o]=Tt(!1),qo=It({w:-1,h:-1}),Xo=It(!1),Yo=yt("StreamOrdinalFrame"),Qo=Ge||Ve,Ko="streaming"===i,Zo=Bt(()=>({chartType:o,runtimeMode:Ko?"streaming":"bounded",windowSize:xe,windowMode:be,extentPadding:ce,projection:A,oAccessor:Ko?void 0:oo,rAccessor:Ko?void 0:io,accessorRevision:w,colorAccessor:l,symbolAccessor:h,symbolMap:u,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:Ko?v:void 0,valueAccessor:Ko?b||("string"==typeof io||"function"==typeof io?io:void 0):void 0,categoryAccessor:Ko?oo:void 0,rExtent:se,oExtent:le,axisExtent:ze,barPadding:H,roundedTop:B,gradientFill:d(D),trackFill:O,baselinePadding:F,innerRadius:E,cornerRadius:j,normalize:W,startAngle:z,sweepAngle:G,dynamicColumnWidth:V,bins:$,showOutliers:q,showIQR:Y,amplitude:ee,connectorOpacity:oe,showLabels:ie,connectorAccessor:re,connectorStyle:ne,dataIdAccessor:ae,oSort:pe,pieceStyle:we,summaryStyle:Ae,colorScheme:_e,themeCategorical:po?.colors?.categorical,themeSemantic:St(po),themeSequential:po?.colors?.sequential,themeDiverging:po?.colors?.diverging,barColors:Pe,decay:_t,pulse:Ct,transition:fo,introAnimation:yo,staleness:Ft,clock:Ao.now,customLayout:Qt,onLayoutError:Kt,layoutConfig:Zt,layoutMargin:uo}),[o,Ko,xe,be,ce,A,oo,io,w,l,h,u,p,f,y,v,b,se,le,ze,H,B,D,O,F,E,j,W,z,G,V,$,q,Y,ee,oe,ie,re,ne,ae,pe,we,Ae,_e,po,Pe,_t,Ct,fo,yo,Ft,Ao.now,Qt,Kt,Zt,uo]),Uo=U(Zo),Jo=It(null);Jo.current||(Jo.current=new lo(Uo));const ti=R(Jo,mt,ft,e=>e.getData());K(Jo,Uo,ro,wo),Z(Jo,Ut,ro,wo);const oi=It(null);oi.current||(oi.current=new a(e=>{const t=Jo.current;t&&t.ingest(e)&&(ro.current=!0,wo())}));const ii=Dt(e=>{oi.current?.push(e)},[]),li=Dt(e=>{oi.current?.pushMany(e)},[]),ci=Dt(()=>{oi.current?.clear(),Jo.current?.clear(),ro.current=!0,wo()},[wo]),hi=Dt(e=>{oi.current?.clearLastData(),oi.current?.setReplacementData(e)},[]);Ot(t,()=>({push:ii,pushMany:li,replace:hi,remove:e=>{oi.current?.flush();const t=Jo.current?.remove(e)??[];if(t.length>0){const e=Ho.current?.data;!!Ho.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(Ho.current=null,Do(null)),ro.current=!0,wo()}return t},update:(e,t)=>{oi.current?.flush();const o=Jo.current?.update(e,t)??[];return o.length>0&&(ro.current=!0,wo()),o},clear:ci,getData:()=>(oi.current?.flush(),Jo.current?.getData()??[]),getScales:()=>Jo.current?.scales??null,getCustomLayout:()=>Jo.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Jo.current?.lastCustomLayoutFailure??null}),[ii,li,hi,ci,wo]),Ht(()=>{r&&oi.current?.setBoundedData(Po)},[r,Po]);const{canvasRef:ui,resolutionDirtyRef:di}=pt(no,{storeRef:Jo,dirtyRef:ro,hydrated:So,wasHydratingFromSSR:Co,cleanup:()=>oi.current?.clear(),maxDevicePixelRatio:I,canvasPaintDependencies:[o,mo,go,Re,At,vt,ke,wo]}),{hoverHandlerRef:mi,hoverLeaveRef:gi,onPointerMove:pi,onPointerLeave:fi}=no;mi.current=e=>{if(!Qo)return;const t=ui.current;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left-uo.left,n=e.clientY-i.top-uo.top;if(0>r||r>mo||0>n||n>go)return void(Ho.current&&(Ho.current=null,Do(null),Jt&&Jt(null),wo()));const a=Jo.current;if(!a||0===a.scene.length)return;const s="radial"===A,l=co(a.scene,s?r-mo/2:r,s?n-go/2:n,30,a.pointQuadtree,a.maxPointRadius);if(!l)return void(Ho.current&&(Ho.current=null,Do(null),Jt&&Jt(null),wo()));const c=Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof oo?oo:void 0,__rAccessor:"string"==typeof io?io:void 0,__chartType:o});Ho.current=c,Do(c),Jt?.(c),wo()},gi.current=()=>{Ho.current&&(Ho.current=null,Do(null),Jt?.(null),wo())};const yi=Dt(e=>{if($e(e.target))return;if(!eo)return;const t=ui.current;if(!t)return eo(null),void wo();const i=t.getBoundingClientRect(),r=e.clientX-i.left-uo.left,n=e.clientY-i.top-uo.top;if(0>r||r>mo||0>n||n>go)return eo(null),void wo();const a=Jo.current;if(!a||0===a.scene.length)return eo(null),void wo();const s="radial"===A,l=co(a.scene,s?r-mo/2:r,s?n-go/2:n,30,a.pointQuadtree,a.maxPointRadius);if(!l)return eo(null),void wo();eo(Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof oo?oo:void 0,__rAccessor:"string"==typeof io?io:void 0,__chartType:o}),{type:"activate",inputType:Je(e.nativeEvent.pointerType)}),wo()},[eo,ui,uo.left,uo.top,mo,go,A,oo,io,o,wo]),{kbFocusIndexRef:vi,focusedNavPointRef:bi,onKeyDown:xi}=M({storeRef:Jo,hoverRef:Ho,setHoverPoint:Do,customHoverBehavior:Jt,customClickBehavior:eo,scheduleRender:wo,chartType:o,oAccessor:oo,rAccessor:io}),wi=Dt(e=>{vi.current=-1,bi.current=null,pi(e)},[bi,vi,pi]);xo.current=()=>{if(bo.current=null,!Ao.isActive)return;const e=ui.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=Jo.current;if(!i)return;const r=Ao.now(),n=i.advanceTransition(ao.current?r+1e6:r),a=!ao.current&&n,s=qo.current.w!==mo||qo.current.h!==go,l=ro.current;let c=!1;const h=Yo.current.beforeCompute(i.getLastUpdateResult(),a);!l&&!s||a&&!s||(i.computeScene({width:mo,height:go}),qo.current={w:mo,h:go},c=!0,ti()),Yo.current.afterCompute(h,c,s),ro.current=l&&a&&!c,di.current=!1;const u=C(i,r,c,Xo);(c||a)&&e.setAttribute("aria-label",Ce(i.scene,o+" chart"));const d=Oe(I),m=ho[0]*d,g=ho[1]*d;e.width===m&&e.height===g||(e.width=m,e.height=g,e.style.width=ho[0]+"px",e.style.height=ho[1]+"px"),t.setTransform(d,0,0,d,0,0),t.clearRect(0,0,ho[0],ho[1]);const p=Ft&&i.lastIngestTime>0&&r-i.lastIngestTime>(Ft?.threshold??5e3);p&&(t.globalAlpha=Ft?.dimOpacity??.5);const f="radial"===A;t.save(),t.beginPath(),t.rect(uo.left,uo.top,mo,go),t.clip(),f?(t.save(),t.translate(uo.left+mo/2,uo.top+go/2)):t.translate(uo.left,uo.top);const y=Qt?ei.custom:ei[o]||[],v={width:mo,height:go},b=i.scales;b&&X({context:t,nodes:i.scene,renderMode:ke,pixelRatio:d,paintBuiltIn:e=>{for(const o of y)o(t,e,b,v)}}),f&&t.restore(),t.restore(),p&&(t.globalAlpha=1),c&&i.scales?(Fo(i.scales),zo(e=>e+1),Go.current=r):a&&i.scales&&r-Go.current>=33&&(zo(e=>e+1),Go.current=r),Ft?.showBadge&&$o(!!p),(a||null!=i.activeTransition||u.pending)&&wo()},J(Ft,Jo,ro,wo,Vo,$o);const Ai=Qo&&Bo?qe?qe(Bo):ni(ri,{hover:Bo}):null,ki="radial"===A,Si=Ai?ni(me,{x:Bo?ki?Bo.x+mo/2:Bo.x:0,y:Bo?ki?Bo.y+go/2:Bo.y:0,containerWidth:mo,containerHeight:go,margin:uo,className:"stream-ordinal-tooltip",children:Ai}):null,_i="horizontal"===A?oo:io,Ci=m("horizontal"===A?io:oo,void 0,"__semiotic_resolvedO",""),Pi=m(_i,void 0,"__semiotic_resolvedR",""),Ri=Ci.key,Mi=Pi.key,Li=c(Ci,Pi,tt&&tt.length>0||!1);if(Xe||!So&&Co){const e=Jo.current;e&&r&&(e.ingest({inserts:Po,bounded:!0}),e.computeScene({width:mo,height:go}));const t=e?.scene??[],o=e?.scales??null,i=g(bt,ho,uo,o),n=g(vt,ho,uo,o),a="radial"===A,s=a?uo.left+mo/2:uo.left,l=a?uo.top+go/2:uo.top;return ai("div",{ref:so,className:"stream-ordinal-frame"+(wt?" "+wt:""),role:"img","aria-label":Xt||("string"==typeof xt?xt:"Ordinal chart"),style:{position:"relative",width:S?"100%":ho[0],height:_?"100%":ho[1]},children:[ni(ye,{summary:Yt}),ai("svg",{xmlns:"http://www.w3.org/2000/svg",width:ho[0],height:ho[1],style:{position:"absolute",left:0,top:0},children:[n&&ni("g",{transform:`translate(${uo.left},${uo.top})`,children:n}),ai("g",{transform:`translate(${s},${l})`,children:[At&&ni("rect",{x:0,y:0,width:mo,height:go,fill:At}),t.map((e,t)=>Q({node:e,index:t,renderMode:ke,fallback:()=>et(e,t,vo)})).filter(Boolean)]})]}),ni(_o,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:o,showAxes:Re,showCategoryTicks:Me,oLabel:Ro,rLabel:Mo,oFormat:Io,rFormat:To,rTickValues:je,tickLabelEdgeAlign:We,axisExtent:ze,showGrid:nt,title:xt,legend:at,legendHoverBehavior:st,legendClickBehavior:lt,legendHighlightedCategory:ct,legendIsolatedCategories:ht,legendPosition:ut,legendLayout:dt,foregroundGraphics:N(i,te(Jo.current?.customLayoutOverlays,Ut??null)),annotations:tt,onAnnotationActivate:ot,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:it,svgAnnotationRules:rt,annotationFrame:0,xAccessor:Ri,yAccessor:Mi,annotationData:Li(e?.getData())}),kt&&"radial"===A&&ni("div",{style:{position:"absolute",left:uo.left+mo/2,top:uo.top+go/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt})]})}return ai("div",{ref:so,className:"stream-ordinal-frame"+(wt?" "+wt:""),role:"group","aria-label":Xt||("string"==typeof xt?xt:"Ordinal chart"),tabIndex:0,style:{position:"relative",width:S?"100%":ho[0],height:_?"100%":ho[1],overflow:"visible"},onKeyDown:xi,children:["production"!==process.env.NODE_ENV&&Jo.current&&ni(fe,{store:Jo.current,diagnostics:Yo.current}),qt&&ni(ve,{tableId:vo}),qt&&ni(he,{scene:Jo.current?.scene??[],chartType:o+" chart",tableId:vo,chartTitle:"string"==typeof xt?xt:void 0}),ni(ye,{summary:Yt}),ni(ue,{hoverPoint:Bo}),ai("div",{role:"img","aria-label":Xt||("string"==typeof xt?xt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Qo?wi:void 0,onMouseLeave:Qo?fi:void 0,onClick:to?yi:void 0,children:[ai(de,{size:ho,margin:uo,children:[jo,No]}),ni(ko,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Oo,showAxes:Re,showGrid:nt,rFormat:To,rTickValues:je,axisExtent:ze}),ni("canvas",{ref:ui,"aria-label":Ce(Jo.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:ho[0],height:ho[1]}}),ni(_o,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Oo,showAxes:Re,showCategoryTicks:Me,oLabel:Ro,rLabel:Mo,oFormat:Io,rFormat:To,rTickValues:je,axisExtent:ze,showGrid:nt,title:xt,legend:at,legendHoverBehavior:st,legendClickBehavior:lt,legendHighlightedCategory:ct,legendIsolatedCategories:ht,legendPosition:ut,legendLayout:dt,foregroundGraphics:N(Eo,te(Jo.current?.customLayoutOverlays,Ut??null)),annotations:tt,onAnnotationActivate:ot,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:it,svgAnnotationRules:rt,annotationFrame:Wo,xAccessor:Ri,yAccessor:Mi,annotationData:Li(Jo.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Vt||$t)&&"radial"!==A&&ni(Lo,{width:mo,height:go,totalWidth:ho[0],totalHeight:ho[1],margin:uo,scales:Oo,onBrush:$t||(()=>{})}),kt&&"radial"===A&&ni("div",{style:{position:"absolute",left:uo.left+mo/2,top:uo.top+go/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt}),Ft?.showBadge&&ni(T,{isStale:Vo,position:Ft.badgePosition}),ni(ge,{active:vi.current>=0,hoverPoint:Bo,margin:uo,size:ho,shape:bi.current?.shape,width:bi.current?.w,height:bi.current?.h}),Si]})]})}));li.displayName="StreamOrdinalFrame";var ci=li;import{forwardRef as hi,useMemo as ui}from"react";import{jsx as di}from"react/jsx-runtime";var mi=hi(function(e,t){const{data:o,layout:r,layoutConfig:n,onLayoutError:a,categoryAccessor:s="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:m,colorBy:g,colorScheme:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:A,loading:k,loadingContent:S,emptyContent:_,frameProps:C={}}=e,{frameRef:P,resolved:R,safeData:M,setup:L,earlyReturn:I}=i({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:g,colorScheme:p,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:A,loading:k,loadingContent:S,emptyContent:_,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}),T=L.effectiveSelectionHook,H=ui(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]);if(I)return I;const{width:O,height:F,enableHover:E,showGrid:N,title:j,description:W,summary:z,accessibleTable:G}=R,V={chartType:"custom",...null!=o&&{data:M},customLayout:r,layoutConfig:n,onLayoutError:a,...H&&{layoutSelection:H},oAccessor:s,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:g,colorScheme:p,size:[O,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:L.margin,enableHover:E,showAxes:f,showGrid:N,annotations:y,...B({title:j,description:W,summary:z,accessibleTable:G,className:m,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...D({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:L.mobileInteraction,customHoverBehavior:L.customHoverBehavior,customClickBehavior:L.customClickBehavior}),...C};return di(Pt,{componentName:"OrdinalCustomChart",width:O,height:F,children:di(ci,{ref:P,...V})})});mi.displayName="OrdinalCustomChart";import{useMemo as gi,forwardRef as pi,useRef as fi}from"react";import{useImperativeHandle as yi}from"react";function vi({ref:e,frameRef:t,setup:o}){return yi(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 bi}from"react";function xi(e){const{colorBy:o,colorScale:i,color:r,themeCategorical:n,colorScheme:a,categoryIndexMap:s,userPieceStyle:l,stroke:c,strokeWidth:h,opacity:u,effectiveSelectionHook:d,resolvedSelection:m,cycleByCategory:g=!1,baseStyleExtras:p,linkStrokeToFill:f=!1,styleRules:y,resolveRuleValue:v}=e,b=bi(()=>(e,t)=>{const l="function"==typeof p?p(e,t):p,c=l?{...l}:{};if(void 0===c.fill)if(o){if(!i)return c;c.fill=De(e,o,i)}else c.fill=at(r,n,a,g?t:void 0,s);if(y&&y.length>0){const o=se(e,y,{value:v?v(e):void 0,category:t});Object.assign(c,o)}return f&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[o,i,r,n,a,s,g,p,f,y,v]),x=bi(()=>t(l?"function"==typeof l?(e,t)=>({...b(e,t),...l(e,t)||{}}):(e,t)=>({...b(e,t),...l}):b,{stroke:c,strokeWidth:h,opacity:u}),[b,l,c,h,u]);return bi(()=>wt(x,d??null,m),[x,d,m])}import{jsx as wi}from"react/jsx-runtime";var Ai=pi(function(t,i){const r=mt(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=fi(null),{data:s,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x=!1,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,regression:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:O,loadingContent:N,emptyContent:j,legendInteraction:W,legendPosition:z,color:G,stroke:V,strokeWidth:$,opacity:q,showCategoryTicks:X,categoryFormat:Y,dataIdAccessor:Q}=t,{width:K,height:Z,enableHover:U,showGrid:J,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:re,categoryLabel:ne,valueLabel:se}=r,le=gi(()=>Be(s),[s]),ce=o({data:le,rawData:s,colorBy:p,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BarChart",chartId:H,showLegend:ee,userMargin:l,marginDefaults:r.marginDefaults,loading:O,loadingContent:N,emptyContent:j,width:K,height:Z,hasTitle:!!te,axisChrome:st({showAxes:r.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ne,hasValueLabel:!!se})}),{effectiveLegendProps:he,effectiveMargin:ue}=vi({ref:i,frameRef:a,setup:ce});Lt("BarChart",le,"categoryAccessor",h),Lt("BarChart",le,"valueAccessor",u);const de=vt(le,y,u),me=bt(),ge=gi(()=>new Map,[]),pe=gi(()=>ae(u),[u]),fe=xi({colorBy:p,colorScale:ce.colorScale,color:G,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:P?.pieceStyle,stroke:V,strokeWidth:$,opacity:q,styleRules:w,resolveRuleValue:pe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),ye=gi(()=>F({categoryAccessor:h,valueAccessor:u,groupAccessor:p&&p!==h?p:void 0,groupLabel:"string"==typeof p?p:"group",valueFormat:g}),[h,u,p,g]),ve=gi(()=>d(x),[x]);if(ce.earlyReturn)return ce.earlyReturn;const be=n({componentName:"BarChart",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(be)return wi(Ct,{componentName:"BarChart",message:be,width:K,height:Z});const xe=e(_),we=xe?[xe,...S||[]]:S,Ae={chartType:"bar",...null!=s&&{data:de},oAccessor:h,rAccessor:u,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:fe,size:[K,Z],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ue,barPadding:v,...null!=b&&{roundedTop:b},...ve&&{gradientFill:ve},...Q&&{dataIdAccessor:Q},baselinePadding:A,enableHover:U,showAxes:r.showAxes,oLabel:ne,rLabel:se,rFormat:g,...Y&&{oFormat:Y},showGrid:J,showCategoryTicks:X,oSort:y,...he,...B({title:te,description:oe,summary:ie,accessibleTable:re,className:c,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...E({tooltip:k,defaultTooltipContent:ye}),...D({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...we&&we.length>0&&{annotations:we},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return wi(Pt,{componentName:"BarChart",width:K,height:Z,children:wi(ci,{ref:a,...Ae})})});Ai.displayName="BarChart";import{useMemo as ki,forwardRef as Si,useRef as _i}from"react";import{jsx as Ci}from"react/jsx-runtime";var Pi=Si(function(e,t){const i=mt(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=_i(null),{data:a,margin:s,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,normalize:y=!1,sort:v=!1,barPadding:b=40,roundedTop:x,gradientFill:w,styleRules:A,baselinePadding:k=!1,tooltip:S,annotations:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:O,loadingContent:N,emptyContent:j,legendInteraction:W,legendPosition:z,color:G,stroke:V,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:re}=i,ne=ki(()=>Be(a),[a]),se=p||h,le=o({data:ne,rawData:a,colorBy:se,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:se?["string"==typeof se?se:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:U,userMargin:s,marginDefaults:i.marginDefaults,loading:O,loadingContent:N,emptyContent:j,width:Y,height:Q,hasTitle:!!J,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!re})}),ce=bt(),he=ki(()=>new Map,[]),ue=ki(()=>ae(u),[u]),de=xi({colorBy:se,colorScale:le.colorScale,color:G,themeCategorical:ce,colorScheme:f,categoryIndexMap:he,userPieceStyle:P?.pieceStyle,stroke:V,strokeWidth:$,opacity:q,styleRules:A,resolveRuleValue:ue,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),me=ki(()=>F({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ge=n({componentName:"StackedBarChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:pe,effectiveMargin:fe}=vi({ref:t,frameRef:r,setup:le}),ye=ki(()=>d(w),[w]);if(le.earlyReturn)return le.earlyReturn;const ve={chartType:"bar",...null!=a&&{data:ne},oAccessor:c,rAccessor:u,stackBy:h,normalize:y,oSort:v,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:de,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:b,...null!=x&&{roundedTop:x},...ye&&{gradientFill:ye},baselinePadding:k,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ie,rLabel:re,rFormat:g,...X&&{oFormat:X},showGrid:Z,...pe,...B({title:J,description:ee,summary:te,accessibleTable:oe,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:S,defaultTooltipContent:me}),...D({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),..._&&_.length>0&&{annotations:_},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return ge?Ci(Ct,{componentName:"StackedBarChart",message:ge,width:Y,height:Q}):Ci(Pt,{componentName:"StackedBarChart",width:Y,height:Q,children:Ci(ci,{ref:r,...ve})})});Pi.displayName="StackedBarChart";import*as Ri from"react";import{useMemo as Mi,useCallback as Li,forwardRef as Ii,useRef as Ti,useImperativeHandle as Hi}from"react";import{useRef as Bi,useState as Di,useCallback as Oi,useMemo as Fi}from"react";import{useMemo as Ei,useCallback as Ni,useRef as ji}from"react";var Wi={RdBu:We,PiYG:je,PRGn:Ne,BrBG:Ee,RdYlBu:ze,RdYlGn:Ge,Spectral:Ve},zi="__likert_neutral_neg",Gi="__likert_neutral_pos";function Vi(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function $i(e,t,o,i,r,n){const a=new Map,s=new Set(t);for(const l of e){const e=o(l);a.has(e)||a.set(e,new Map);const c=a.get(e);if(i){const e=i(l);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 r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&n){const e=r(l),t=n(l);if(!s.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const l=[];for(const[e,o]of a){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){const n=t[r],a=o.get(n)||0;l.push({__likertCategory:e,__likertLevel:n,__likertLevelLabel:n,__likertCount:a,__likertPct:a/i*100,__likertLevelIndex:r})}}return l}function qi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===r){const e=t.__likertPct/2;n.push({...t,__likertLevel:zi,__likertPct:-e}),n.push({...t,__likertLevel:Gi,__likertPct:e})}else n.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return n}function Xi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=new Map;for(const t of e){const e=n.get(t.__likertCategory)||[];e.push(t),n.set(t.__likertCategory,e)}const a=[];for(const[,e]of n){const t=new Map;let n,s;for(const o of e)o.__likertLevel===zi?n=o:o.__likertLevel===Gi?s=o:t.set(o.__likertLevelIndex,o);i&&n&&a.push(n);for(let e=r-1;e>=0;e--){const o=t.get(e);o&&a.push(o)}i&&s&&a.push(s);for(let e=i?r+1:r;o>e;e++){const o=t.get(e);o&&a.push(o)}}return a}var Yi=["Very Low","Low","Neutral","High","Very High"];import{jsx as Qi}from"react/jsx-runtime";var Ki=new Map,Zi=Ii(function(e,t){const i=mt(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=Ti(null),{data:a,margin:s,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:u,countAccessor:d="count",levels:m=Yi,orientation:g="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,valueFormat:P,loading:R,loadingContent:M,emptyContent:L,legendInteraction:I,legendPosition:T,categoryFormat:H,stroke:B,strokeWidth:O,opacity:F}=e,{width:E,height:N,enableHover:j,showGrid:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q,categoryLabel:X,valueLabel:Y}=i,Q="horizontal"===g,K=void 0===a,Z=!u,U=xt(),J=Mi(()=>p&&Array.isArray(p)&&p.length>=m.length?p:function(e,t){if(0>=e)return[];if(t){const o=Wi[t];if(o){if(1===e)return[o(.5)];const t=[];for(let i=0;e>i;i++)t.push(o(i/(e-1)));return t}}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];const n=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)]);n&&s.push(r);for(let e=0;a>e;e++)s.push(i[Math.min(Math.floor(e*i.length/a),i.length-1)]);return s}(m.length,U),[p,m.length,U]),ee=Mi(()=>{const e=new Map;for(let t=0;m.length>t;t++)e.set(m[t],J[t]||"#888");return e},[m,J]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:n,isDiverging:a,frameRef:s}){const l=!r,c=Ei(()=>Vi(o,"question"),[o]),h=Ei(()=>l?Vi(i,"score"):null,[l,i]),u=Ei(()=>l?null:Vi(r,"level"),[l,r]),d=Ei(()=>l?null:Vi(n,"count"),[l,n]),m=ji([]);return{processedData:Ei(()=>{const o=e||[];if(0===o.length)return[];let i=$i(o,t,c,h,u,d);return a&&(i=qi(i,t),i=Xi(i,t)),i},[e,t,c,h,u,d,a]),reAggregate:Ni(e=>{let o=$i(e,t,c,h,u,d);a&&(o=qi(o,t),o=Xi(o,t)),s.current?.replace(o)},[t,c,h,u,d,a,s]),accumulatorRef:m}}({data:a,levels:m,categoryAccessor:c,valueAccessor:h,levelAccessor:u,countAccessor:d,isDiverging:Q,frameRef:r}),re="__likertLevelLabel",ne=function({isPushMode:e,colorBy:t,colorScheme:o,showLegend:i,legendPosition:r="right"}){const n=Bi(new Set),a=Bi([]),[s,l]=Di(0),c=dt(),h=bt(),u=Oi(e=>{if(!t)return null;const o="function"==typeof t?t(e):e[t];return null!=o?o+"":null},[t]),d=Oi(o=>{if(!e||!t)return;let i=!1;for(const e of o){if(!e||"object"!=typeof e)continue;const t=u(e);null==t||n.current.has(t)||(n.current.add(t),a.current.push(t),i=!0)}i&&l(e=>e+1)},[e,t,u]),m=Oi(o=>{if(!e||!t)return;const i=Array.from(new Set(o.map(String))),r=a.current;r.length===i.length&&r.every((e,t)=>e===i[t])||(n.current=new Set(i),a.current=i,l(e=>e+1))},[e,t]),g=Oi(e=>t=>{d([t]),e(t)},[d]),p=Oi(e=>t=>{d(t),e(t)},[d]),f=Oi(()=>{n.current=new Set,a.current=[],l(e=>e+1)},[]);ft(e&&t?a.current:[]);const y=Fi(()=>{if(!e||!t||!1===i)return;const r=a.current;if(0===r.length)return;const n=Array.isArray(o)&&o.length>0||"string"==typeof o&&o.length>0?o:h&&h.length>0?h:pe,s="string"==typeof t?t:"__streamCat",l=r.map(e=>({[s]:e})),u=Me(l,s,n);return Te({data:l,colorBy:s,colorScale:e=>c?.[e]||u(e)||"#999",getColor:De})},[e,t,i,o,c,h,s]),v=Fi(()=>{if(y)return"right"===r?{right:110}:"left"===r?{left:110}:"top"===r?{top:50}:"bottom"===r?{bottom:80}:{right:110}},[y,r]);return{wrapPush:g,wrapPushMany:p,resetCategories:f,categories:a.current,categoryDomainProps:e&&t?{legendCategoryAccessor:t,onCategoriesChange:m}:{},streamingLegend:y,streamingMarginAdjust:v}}({isPushMode:K,colorBy:re,colorScheme:J,showLegend:z,legendPosition:T}),{wrapPush:ae,wrapPushMany:se}=ne,le=Li(e=>ae(e=>{ie.current.push(e),oe(ie.current)})(e),[ae,oe,ie]),ce=Li(e=>se(e=>{ie.current.push(...e),oe(ie.current)})(e),[se,oe,ie]);Hi(t,()=>({push:le,pushMany:ce,remove:e=>r.current?.remove(e)??[],update:(e,t)=>r.current?.update(e,t)??[],replace:e=>r.current?.replace(e),clear:()=>{ie.current=[],ne.resetCategories(),r.current?.clear()},getData:()=>r.current?.getData()??[],getScales:()=>r.current?.getScales()??null}),[le,ce,ie,ne]);const he=o({data:te,rawData:a,colorBy:re,colorScheme:J,legendInteraction:I,legendPosition:T,selection:w,linkedHover:A,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"LikertChart",chartId:C,showLegend:z,userMargin:s,marginDefaults:i.marginDefaults,loading:R,loadingContent:M,emptyContent:L,width:E,height:N,hasTitle:!!G,axisChrome:{hasAxis:!1!==i.showAxes,hasAxisLabel:Q?!!Y:!!X}}),ue=Mi(()=>{const e=m.length;return e%2!=0&&ee.get(m[Math.floor(e/2)])||"#888"},[m,ee]),de=xi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:Ki,userPieceStyle:x?.pieceStyle,stroke:B,strokeWidth:O,opacity:F,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===zi||o===Gi)return{fill:ue};const i=t||o;return i&&ee.has(i)?{fill:ee.get(i)}:{fill:"#888"}}}),me=Mi(()=>{const e=m.length;return e%2!=0?m[Math.floor(e/2)]:""},[m]),ge=Mi(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===zi||o===Gi?me:o,r=t.__likertCategory||"",n=Math.abs(t.__likertPct||0),a=o===zi||o===Gi?2*n:n,s=t.__likertCount||0;return Ri.createElement("div",{className:"semiotic-tooltip",style:He},Ri.createElement("div",{style:{fontWeight:"bold"}},r),Ri.createElement("div",{style:{marginTop:4}},`${i}: ${a.toFixed(1)}% (n=${s})`))},[me]),fe=Mi(()=>{if(!m||2>m.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&u)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(u&&!d)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==a&&0===a.length)return null;const e={categoryAccessor:c};return Z?h&&(e.valueAccessor=h):(u&&(e.levelAccessor=u),d&&(e.countAccessor=d)),n({componentName:"LikertChart",data:a,accessors:e,requiredProps:{levels:m}})},[a,c,h,u,d,m,Z]),ye=Mi(()=>[{styleFn:e=>({fill:ee.get(e.label)||"#888"}),items:m.map(e=>({label:e})),label:""}],[m,ee]),ve=Mi(()=>!1!==z?{...he.legendBehaviorProps,legend:{legendGroups:ye},legendPosition:T||he.legendPosition||"bottom"}:he.legendBehaviorProps,[he.legendBehaviorProps,he.legendPosition,T,z,ye]),be=Mi(()=>{const e={...he.margin};if(K&&!1!==z){const t=T||"bottom";"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(ne.streamingMarginAdjust)for(const[t,o]of Object.entries(ne.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Q&&100>e.left&&(e.left=100),e},[he.margin,ne.streamingMarginAdjust,Q,K,z,T]),xe=Mi(()=>P||(Q?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Q,P]);if(he.earlyReturn)return he.earlyReturn;const we={chartType:"bar",...null!=a&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:Q?"horizontal":"vertical",pieceStyle:de,size:[E,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:be,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:X,rLabel:Y||(Q?void 0:"Percentage"),rFormat:xe,...H&&{oFormat:H},showGrid:W,...ve,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===y?()=>null:!0===y?ge:Ze(y)||ge,...D({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fe?Qi(Ct,{componentName:"LikertChart",message:fe,width:E,height:N}):Qi(Pt,{componentName:"LikertChart",width:E,height:N,children:Qi(ci,{ref:r,...we})})});Zi.displayName="LikertChart";import{useMemo as Ui,forwardRef as Ji,useRef as er}from"react";import{useCallback as tr,useMemo as or,useRef as ir}from"react";function rr({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const r=or(()=>Ke("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),n="string"==typeof i?i:"value",a=ut({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||n}),s=ir(a.brushInteraction);s.current=a.brushInteraction;const l=tr(e=>{if(r){s.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as nr}from"react/jsx-runtime";var ar=Ji(function(e,t){const i=mt(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=er(null);r(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,sizeBy:f,sizeRange:y=[3,8],symbolBy:v,symbolMap:b,pointRadius:x=4,pointOpacity:w=.7,categoryPadding:A=20,tooltip:k,annotations:S,valueExtent:_,brush:C,onBrush:P,linkedBrush:R,frameProps:M={},selection:L,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:O,chartId:N,loading:j,loadingContent:W,emptyContent:z,legendInteraction:G,legendPosition:V,color:$,stroke:q,strokeWidth:X,opacity:Y,showCategoryTicks:Q,categoryFormat:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:ae,valueLabel:se}=i,le=Ui(()=>Be(s),[s]),ce=o({data:le,rawData:s,colorBy:g,colorScheme:p,legendInteraction:G,legendPosition:V,selection:L,linkedHover:I,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:O,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwarmPlot",chartId:N,showLegend:te,userMargin:l,marginDefaults:i.marginDefaults,loading:j,loadingContent:W,emptyContent:z,width:Z,height:U,hasTitle:!!oe,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!ae,hasValueLabel:!!se})}),he=rr({brushProp:C,onBrushProp:P,linkedBrush:R,valueAccessor:u}),ue=Ui(()=>{if(!f)return;const e=le.map(e=>"function"==typeof f?f(e):e[f]);return kt(e)},[le,f]),de=bt(),me=Ui(()=>new Map,[]),ge=xi({colorBy:g,colorScale:ce.colorScale,color:$,themeCategorical:de,colorScheme:p,categoryIndexMap:me,userPieceStyle:M?.pieceStyle,stroke:q,strokeWidth:X,opacity:Y,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:w,r:f?Fe(e,f,y,ue):x})}),pe=Ui(()=>F({categoryAccessor:h,valueAccessor:u,groupAccessor:g||void 0,valueFormat:m}),[h,u,g,m]);if(ce.earlyReturn)return ce.earlyReturn;const fe=n({componentName:"SwarmPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(fe)return nr(Ct,{componentName:"SwarmPlot",message:fe,width:Z,height:U});const ye={chartType:"swarm",...null!=s&&{data:le},oAccessor:h,rAccessor:u,...v&&{symbolAccessor:v},...b&&{symbolMap:b},projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ge,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:A,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ae,rLabel:se,rFormat:m,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...B({title:oe,description:ie,summary:re,accessibleTable:ne,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:k,defaultTooltipContent:pe}),...D({linkedHover:I,selection:L,onObservation:T,onClick:H,hoverHighlight:O,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...he.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return nr(Pt,{componentName:"SwarmPlot",width:Z,height:U,children:nr(ci,{ref:a,...ye})})});ar.displayName="SwarmPlot";import{useMemo as sr,forwardRef as lr,useRef as cr}from"react";import{jsx as hr,jsxs as ur}from"react/jsx-runtime";function dr(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 ur("div",{className:"semiotic-tooltip",style:He,children:[o&&hr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&ur("div",{children:["n = ",i.n]}),null!=i.min&&ur("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&ur("div",{children:["Q1: ",i.q1.toLocaleString()]}),ur("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&ur("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&ur("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&ur("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,r=(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),n=r.length,a=n>0?n%2!=0?r[Math.floor(n/2)]:(r[n/2-1]+r[n/2])/2:null;return ur("div",{className:"semiotic-tooltip",style:He,children:[o&&hr("div",{style:{fontWeight:"bold"},children:o+""}),n>0&&ur("div",{children:["n = ",n]}),null!=a&&ur("div",{children:["Median: ",a.toLocaleString()]})]})}return hr("div",{className:"semiotic-tooltip",style:He,children:hr("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as mr}from"react/jsx-runtime";var gr=lr(function(e,t){const i=mt(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=cr(null);r(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,showOutliers:f=!0,outlierRadius:y=3,categoryPadding:v=20,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:O,stroke:F,strokeWidth:N,opacity:j,showCategoryTicks:W,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=sr(()=>Be(s),[s]),te=o({data:ee,rawData:s,colorBy:g,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BoxPlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V,hasTitle:!!Y,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=bt(),ie=sr(()=>new Map,[]),re=xi({colorBy:g,colorScale:te.colorScale,color:O,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:j,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ne=sr(()=>dr(),[]);if(te.earlyReturn)return te.earlyReturn;const ae=n({componentName:"BoxPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(ae)return mr(Ct,{componentName:"BoxPlot",message:ae,width:G,height:V});const se={chartType:"boxplot",...null!=s&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,showOutliers:f,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:m,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,...te.legendBehaviorProps,...B({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:b,defaultTooltipContent:ne}),...D({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return mr(Pt,{componentName:"BoxPlot",width:G,height:V,children:mr(ci,{ref:a,...se})})});gr.displayName="BoxPlot";import{useMemo as pr,forwardRef as fr,useRef as yr}from"react";import{jsx as vr,jsxs as br}from"react/jsx-runtime";var xr=e=>{const t=e?.category;return null==t?"All":t+""},wr=fr(function(e,t){const i=mt(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=yr(null);r(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,categoryAccessor:h=xr,valueAccessor:u="value",bins:d=25,relative:m=!1,valueFormat:g,colorBy:p,colorScheme:f,categoryPadding:y=("sparkline"===i.mode?0:20),tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:A,linkedBrush:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:O,legendPosition:F,color:N,stroke:j,strokeWidth:W,opacity:z,showCategoryTicks:G,categoryFormat:V}=e,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=i,oe=pr(()=>Be(s),[s]),ie=o({data:oe,rawData:s,colorBy:p,colorScheme:f,legendInteraction:O,legendPosition:F,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"Histogram",chartId:L,showLegend:Q,userMargin:l,marginDefaults:i.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q,hasTitle:!!K,axisChrome:st({showAxes:i.showAxes,projection:"horizontal",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=rr({brushProp:w,onBrushProp:A,linkedBrush:k,valueAccessor:u}),ne=pr(()=>{if(0===oe.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of oe){const r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[oe,u]),ae=bt(),se=pr(()=>new Map,[]),le=xi({colorBy:p,colorScale:ie.colorScale,color:N,themeCategorical:ae,colorScheme:f,categoryIndexMap:se,userPieceStyle:void 0,stroke:j,strokeWidth:W,opacity:z,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=pr(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return br("div",{className:"semiotic-tooltip",style:He,children:[o&&vr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&br("div",{children:["Count: ",i]}),r&&2===r.length&&br("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=n({componentName:"Histogram",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(he)return vr(Ct,{componentName:"Histogram",message:he,width:$,height:q});const ue={chartType:"histogram",...null!=s&&{data:oe},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:le,bins:d,normalize:m,...x?{rExtent:x}:ne&&{rExtent:ne},size:[$,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ee,rLabel:te,rFormat:g,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:G,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:v,defaultTooltipContent:ce}),...D({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return vr(Pt,{componentName:"Histogram",width:$,height:q,children:vr(ci,{ref:a,...ue})})});wr.displayName="Histogram";import{useMemo as Ar,forwardRef as kr,useRef as Sr}from"react";import{jsx as _r}from"react/jsx-runtime";var Cr=kr(function(e,t){const i=mt(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=Sr(null);r(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,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,brush:k,onBrush:S,linkedBrush:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:O,emptyContent:F,legendInteraction:N,legendPosition:j,color:W,stroke:z,strokeWidth:G,opacity:V,showCategoryTicks:$,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}=i,re=Ar(()=>Be(s),[s]),ne=o({data:re,rawData:s,colorBy:y,colorScheme:v,legendInteraction:N,legendPosition:j,selection:P,linkedHover:R,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:l,marginDefaults:i.marginDefaults,loading:H,loadingContent:O,emptyContent:F,width:X,height:Y,hasTitle:!!U,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),ae=rr({brushProp:k,onBrushProp:S,linkedBrush:_,valueAccessor:u}),se=bt(),le=Ar(()=>new Map,[]),ce=xi({colorBy:y,colorScale:ne.colorScale,color:W,themeCategorical:se,colorScheme:v,categoryIndexMap:le,userPieceStyle:void 0,stroke:z,strokeWidth:G,opacity:V,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=Ar(()=>dr({valueAccessor:u}),[u]);if(ne.earlyReturn)return ne.earlyReturn;const ue=n({componentName:"ViolinPlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(ue)return _r(Ct,{componentName:"ViolinPlot",message:ue,width:X,height:Y});const de={chartType:"violin",...null!=s&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ce,bins:m,showIQR:p,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:b,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:f,...q&&{oFormat:q},showGrid:K,showCategoryTicks:$,...ne.legendBehaviorProps,...B({title:U,description:J,summary:ee,accessibleTable:te,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:x,defaultTooltipContent:he}),...D({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...ae.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return _r(Pt,{componentName:"ViolinPlot",width:X,height:Y,children:_r(ci,{ref:a,...de})})});Cr.displayName="ViolinPlot";import{useMemo as Pr,forwardRef as Rr,useRef as Mr}from"react";import{jsx as Lr}from"react/jsx-runtime";var Ir=Rr(function(e,t){const i=mt(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=Mr(null);r(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,categoryPadding:v=5,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:O,stroke:F,strokeWidth:N,opacity:j,showCategoryTicks:W,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=Pr(()=>Be(s),[s]),te=o({data:ee,rawData:s,colorBy:f,colorScheme:y,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:f?["string"==typeof f?f:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RidgelinePlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V,hasTitle:!!Y,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=bt(),ie=Pr(()=>new Map,[]),re=xi({colorBy:f,colorScale:te.colorScale,color:O,themeCategorical:oe,colorScheme:y,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:j,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),ne=Pr(()=>dr(),[]);if(te.earlyReturn)return te.earlyReturn;const ae=n({componentName:"RidgelinePlot",data:s,accessors:{categoryAccessor:h,valueAccessor:u}});if(ae)return Lr(Ct,{componentName:"RidgelinePlot",message:ae,width:G,height:V});const se={chartType:"ridgeline",...null!=s&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,bins:m,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:p,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,oSort:!1,amplitude:g,...te.legendBehaviorProps,...B({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:b,defaultTooltipContent:ne}),...D({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Lr(Pt,{componentName:"RidgelinePlot",width:G,height:V,children:Lr(ci,{ref:a,...se})})});Ir.displayName="RidgelinePlot";import{useMemo as Tr,forwardRef as Hr,useRef as Br}from"react";import{jsx as Dr,jsxs as Or}from"react/jsx-runtime";var Fr=Hr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,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=Br(null);r(t,{variant:"xy",frameRef:a});const{data:s,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:m,colorScheme:g,orientation:p="horizontal",connectorOpacity:f=.3,showLabels:y=!0,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,loading:P,loadingContent:R,emptyContent:M,legendInteraction:L,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:O,categoryFormat:F}=e,E="vertical"===p,{width:N,height:j,enableHover:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=i,X=E?{top:G?60:40,right:20,bottom:60,left:60}:{top:G?40:10,right:10,bottom:10,left:10},Y=Tr(()=>Be(s),[s]),Q=m||d,K=!Q,Z=o({data:Y,rawData:s,colorBy:Q,colorScheme:g,legendInteraction:L,legendPosition:I,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FunnelChart",chartId:C,showLegend:z,userMargin:l,marginDefaults:X,loading:P,loadingContent:R,emptyContent:M,width:N,height:j,hasTitle:!!G,axisChrome:st({showAxes:E,projection:E?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Lt("FunnelChart",Y,"stepAccessor",h),Lt("FunnelChart",Y,"valueAccessor",u);const U=bt(),J=Tr(()=>new Map,[]),ee=Tr(()=>{if(K)return T||(U?.[0]?U[0]:Array.isArray(g)&&g[0]?g[0]:"#4e79a7")},[K,T,U,g]),te=xi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:U,colorScheme:g,categoryIndexMap:J,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:O,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=Tr(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,n=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,a=t?.__barFunnelIsDropoff,s=t?.__barFunnelCategory??t?.category,l=null==r||n?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return Or("div",{className:"semiotic-tooltip",style:He,children:[o&&Dr("div",{style:{fontWeight:"bold"},children:o+""}),s&&s!==o&&Dr("div",{style:{marginTop:2,opacity:.8},children:s+""}),a&&Dr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Or("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=n({componentName:"FunnelChart",data:s,accessors:{stepAccessor:h,valueAccessor:u}});if(ie)return Dr(Ct,{componentName:"FunnelChart",message:ie,width:N,height:j});const re={chartType:E?"bar-funnel":"funnel",...null!=s&&{data:Y},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:E?"vertical":"horizontal",barPadding:E?40:0,pieceStyle:te,size:[N,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Z.margin,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:E,showCategoryTicks:E,...F&&{oFormat:F},showGrid:E,...!E&&{connectorOpacity:f},showLabels:y,...Z.legendBehaviorProps,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===v?()=>null:!0===v||null==v?oe:Ze(v)||oe,...D({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...b&&b.length>0&&{annotations:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Dr(Pt,{componentName:"FunnelChart",width:N,height:j,children:Dr(ci,{ref:a,...re})})});Fr.displayName="FunnelChart";import{useMemo as Er,forwardRef as Nr,useRef as jr}from"react";import{jsx as Wr}from"react/jsx-runtime";var zr=Nr(function(t,i){const a=mt(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=jr(null);r(i,{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,sort:y="auto",dotRadius:v=5,categoryPadding:b=10,tooltip:x,annotations:w,regression:A,valueExtent:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:O,legendPosition:N,color:j,stroke:W,strokeWidth:z,opacity:G,categoryFormat:V}=t,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=a,oe=Er(()=>Be(l),[l]),ie=o({data:oe,rawData:l,colorBy:p,colorScheme:f,legendInteraction:O,legendPosition:N,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof u?u:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"DotPlot",chartId:L,showLegend:Q,userMargin:c,marginDefaults:a.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q,hasTitle:!!K,axisChrome:st({showAxes:a.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=vt(oe,y,d),ne=bt(),ae=Er(()=>new Map,[]),se=xi({colorBy:p,colorScale:ie.colorScale,color:j,themeCategorical:ne,colorScheme:f,categoryIndexMap:ae,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:z,opacity:G,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:v,fillOpacity:.8}}),le=Er(()=>F({categoryAccessor:u,valueAccessor:d,valueFormat:g}),[u,d,g]);if(ie.earlyReturn)return ie.earlyReturn;const ce=n({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ce)return Wr(Ct,{componentName:"DotPlot",message:ce,width:$,height:q});const he=e(A),ue=he?[he,...w||[]]:w,de={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:se,size:[$,q],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ie.margin,barPadding:b,enableHover:X,...t.dataIdAccessor&&{dataIdAccessor:t.dataIdAccessor},showAxes:a.showAxes,oLabel:ee,rLabel:te,rFormat:g,...V&&{oFormat:V},showGrid:Y,oSort:y,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:h,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...E({tooltip:x,defaultTooltipContent:le}),...D({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...ue&&ue.length>0&&{annotations:ue},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Wr(Pt,{componentName:"DotPlot",width:$,height:q,children:Wr(ci,{ref:s,...de})})});zr.displayName="DotPlot";import{useMemo as Gr,forwardRef as Vr,useRef as $r}from"react";import{jsx as qr}from"react/jsx-runtime";var Xr=Vr(function(e,t){const i=mt(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=$r(null),{data:a,margin:s,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,startAngle:m=0,cornerRadius:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:A,chartId:k,loading:S,loadingContent:_,emptyContent:C,legendInteraction:P,legendPosition:R,color:M,stroke:L,strokeWidth:I,opacity:T}=e,{width:H,height:O,enableHover:N,showLegend:j,title:W,description:z,summary:G,accessibleTable:V}=i,$=Gr(()=>Be(a),[a]),q=u||c,X=o({data:$,rawData:a,colorBy:q,colorScheme:d,legendInteraction:P,legendPosition:R,selection:v,linkedHover:b,fallbackFields:q?["string"==typeof q?q:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:j,userMargin:s,marginDefaults:i.marginDefaults,loading:S,loadingContent:_,emptyContent:C,width:H,height:O,hasTitle:!!W,axisChrome:{hasAxis:!1}}),Y=bt(),Q=Gr(()=>new Map,[]),K=xi({colorBy:q,colorScale:X.colorScale,color:M,themeCategorical:Y,colorScheme:d,categoryIndexMap:Q,userPieceStyle:y?.pieceStyle,stroke:L,strokeWidth:I,opacity:T,effectiveSelectionHook:X.effectiveSelectionHook,resolvedSelection:X.resolvedSelection,cycleByCategory:!0}),Z=Gr(()=>F({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),U=n({componentName:"PieChart",data:a,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:J,effectiveMargin:ee}=vi({ref:t,frameRef:r,setup:X});if(X.earlyReturn)return X.earlyReturn;const te={chartType:"pie",...null!=a&&{data:$},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:K,startAngle:m,...null!=g&&{cornerRadius:g},size:[H,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:N,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...B({title:W,description:z,summary:G,accessibleTable:V,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:p,defaultTooltipContent:Z}),...D({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:X.mobileInteraction,customHoverBehavior:X.customHoverBehavior,customClickBehavior:X.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return U?qr(Ct,{componentName:"PieChart",message:U,width:H,height:O}):qr(Pt,{componentName:"PieChart",width:H,height:O,children:qr(ci,{ref:r,...te})})});Xr.displayName="PieChart";import{useMemo as Yr,forwardRef as Qr,useRef as Kr}from"react";import{jsx as Zr}from"react/jsx-runtime";var Ur=Qr(function(e,t){const i=mt(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=Kr(null),{data:a,margin:s,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:m,colorScheme:g,startAngle:p=0,cornerRadius:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:A,onClick:k,hoverHighlight:S,chartId:_,loading:C,loadingContent:P,emptyContent:R,legendInteraction:M,legendPosition:L,color:I,stroke:T,strokeWidth:H,opacity:O}=e,{width:N,height:j,enableHover:W,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=i,X=Yr(()=>Be(a),[a]),Y=m||c,Q=o({data:X,rawData:a,colorBy:Y,colorScheme:g,legendInteraction:M,legendPosition:L,selection:x,linkedHover:w,fallbackFields:Y?["string"==typeof Y?Y:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DonutChart",chartId:_,showLegend:z,userMargin:s,marginDefaults:i.marginDefaults,loading:C,loadingContent:P,emptyContent:R,width:N,height:j,hasTitle:!!G,axisChrome:{hasAxis:!1}}),K=u??Math.max(2,.15*Math.min(N,j)),Z=bt(),U=Yr(()=>new Map,[]),J=xi({colorBy:Y,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:g,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:O,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=Yr(()=>F({categoryAccessor:c,valueAccessor:h,groupAccessor:m&&m!==c?m:void 0,groupLabel:"string"==typeof m?m:"group",pieData:!0}),[c,h,m]),te=n({componentName:"DonutChart",data:a,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:oe,effectiveMargin:ie}=vi({ref:t,frameRef:r,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const re={chartType:"donut",...null!=a&&{data:X},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:J,innerRadius:K,startAngle:p,...null!=f&&{cornerRadius:f},centerContent:d,size:[N,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...B({title:G,description:V,summary:$,accessibleTable:q,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:y,defaultTooltipContent:ee}),...D({linkedHover:w,selection:x,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return te?Zr(Ct,{componentName:"DonutChart",message:te,width:N,height:j}):Zr(Pt,{componentName:"DonutChart",width:N,height:j,children:Zr(ci,{ref:r,...re})})});Ur.displayName="DonutChart";import{useMemo as Jr,forwardRef as en,useRef as tn}from"react";function on(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 rn(e){return Math.max(0,Math.min(1,e))}function nn(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 an(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 sn(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:rn(e.offset),color:e.color??o,opacity:null==e.opacity?1:rn(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const r=e=>{if(1===e.opacity)return e.color;const t=nn(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);const n=rn(t);if(i[0].offset>=n)return r(i[0]);if(n>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>n||n>o.offset)continue;const a=o.offset-t.offset,s=a>0?(n-t.offset)/a:0,l=nn(t.color),c=nn(o.color);if(!l||!c)return r(.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?an(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function ln(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as cn,jsxs as hn}from"react/jsx-runtime";var un=en(function(e,o){const i=mt(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}),r=tn(null),n="context"===i.mode,{compactMode:a}=i,{value:s,min:l=0,max:c=100,thresholds:h,gradientFill:d,color:m,backgroundColor:g="var(--semiotic-grid, #e0e0e0)",arcWidth:p=.3,cornerRadius:f,showNeedle:y=!0,needleColor:v="var(--semiotic-text, #333)",centerContent:b,valueFormat:x,showScaleLabels:w=!a,sweep:A=240,fillZones:k=!0,tooltip:S,annotations:_,frameProps:C={},className:P,stroke:R,strokeWidth:M,opacity:L}=e,{width:I,height:T,title:H,description:B,summary:D,accessibleTable:O}=i,F=u(d),E=Math.max(l,Math.min(c,s)),N=c-l||1,j=(E-l)/N,{gaugeData:W,pieceStyle:z,gaugeAnnotations:G}=Jr(()=>function(e){const{min:t,max:o,value:i,thresholds:r,fillColor:n,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=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:n||"#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=ln("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(sn(c.stops,e*(t+.5)/o,n||m[0]?.color||"#007bff"));const r=ln("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||a})}}else{let e=t;for(let o=0;m.length>o;o++){const i=m[o],r=(i.value-e)/u,n=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(s?Math.min(d,l):l)-n),h=s?Math.max(0,r-c):0;if(c>0){const e=ln("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=ln("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&&r&&r.length>0)for(const e of r)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:m,backgroundColor:g,fillZones:k,showScaleLabels:w,gradientFill:F}),[s,l,c,h,m,g,w,k,F]),V=Jr(()=>t(z,{stroke:R,strokeWidth:M,opacity:L}),[z,R,M,L]),{sweepRad:$,startAngleDeg:q}=on(A),X=function(e=240){const{sweepRad:t,offsetRad:o}=on(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 r=i.map(e=>e[0]),n=i.map(e=>e[1]),[a,s]=kt(r),[l,c]=kt(n);return{minX:a,maxX:s,minY:l,maxY:c,width:s-a,height:c-l,cx:(a+s)/2,cy:(l+c)/2}}(A),Y=Math.min(10,Math.max(1,Math.min(I,T)/12)),Q=X.cx,K=X.cy,Z=Math.max(4,Math.min((I-2*Y)/X.width,(T-2*Y)/X.height)-2),U=Math.max(0,Math.min(Z-1.5,Z*(1-p))),J=I/2-Q*Z,ee=T/2-K*Z,te=2*(Z+4),oe=Jr(()=>{if(a&&null==b)return null;if(null!=b)return"function"==typeof b?b(E,l,c):b;const e=x?x(E):Math.round(E)+"";return hn("div",{style:{textAlign:"center",lineHeight:1.2},children:[cn("div",{style:{fontSize:Math.max(16,.3*Z),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),w&&hn("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[b,E,l,c,x,w,Z,a]),ie=Jr(()=>n&&null==b?{type:"gauge-value",text:x?x(E):Math.round(E)+""}:null,[n,b,E,x]),re=Jr(()=>{if(!y)return null;const e=-Math.PI/2+q*Math.PI/180+j*$,t=U>20?U-8:Z-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:v}},[y,q,j,$,U,Z,v]),ne=Jr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||I)/2,r=(o.height||T)/2,n=Math.max(1,Z-U),a=Math.max(1,Math.min(2.5,.4*n)),s=Math.max(1,Math.min(5,.6*n));return hn("g",{transform:`translate(${i},${r})`,children:[cn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:a,strokeLinecap:"round"}),cn("circle",{cx:0,cy:0,r:s,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+q*Math.PI/180+(e.value-l)/N*$,r=(o.width||I)/2,n=(o.height||T)/2,a=U-1,s=Z+1,c=Math.cos(i)*a,h=Math.sin(i)*a,u=Math.cos(i)*s,d=Math.sin(i)*s,m=Z+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"),hn("g",{transform:`translate(${r},${n})`,children:[cn("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),cn("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?cn("text",{x:(o.width||I)/2,y:(o.height||T)/2-.2*U,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*Z)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[I,T,l,N,q,$,U,Z]),ae=Jr(()=>{const e=[...G,..._||[]];return re&&e.push(re),ie&&e.push(ie),e},[G,_,re,ie]),se=Jr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return hn("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:[cn("div",{style:{fontWeight:600},children:o}),cn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(E):"Remaining"})]})},[E]);if(0===W.length)return cn(Ct,{componentName:"GaugeChart",message:"No data to display",width:I,height:T});const le={chartType:"donut",data:W,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:V,innerRadius:U,startAngle:q,sweepAngle:A,...null!=f&&{cornerRadius:f},centerContent:oe,size:[I,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:ee-te/2,bottom:T-ee-te/2,left:J-te/2,right:I-J-te/2},enableHover:i.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===S?()=>null:Ze(S)||se,svgAnnotationRules:ne,...ae.length>0&&{annotations:ae},...H&&{title:H},...B&&{description:B},...D&&{summary:D},...void 0!==O&&{accessibleTable:O},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...C};return cn(Pt,{componentName:"GaugeChart",width:I,height:T,children:cn(ci,{ref:r,...le})})});un.displayName="GaugeChart";import{useMemo as dn,forwardRef as mn,useRef as gn}from"react";import{jsx as pn}from"react/jsx-runtime";var fn=mn(function(e,t){const i=mt(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=gn(null),{data:a,margin:s,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=60,roundedTop:b,gradientFill:x,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,valueExtent:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:O,emptyContent:N,legendInteraction:j,legendPosition:W,color:z,stroke:G,strokeWidth:V,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}=i,re=dn(()=>Be(a),[a]),ne=p||h,se=o({data:re,rawData:a,colorBy:ne,colorScheme:f,legendInteraction:j,legendPosition:W,selection:P,linkedHover:R,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:s,marginDefaults:i.marginDefaults,loading:H,loadingContent:O,emptyContent:N,width:X,height:Y,hasTitle:!!U,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),le=bt(),ce=dn(()=>new Map,[]),he=dn(()=>ae(u),[u]),ue=xi({colorBy:ne,colorScale:se.colorScale,color:z,themeCategorical:le,colorScheme:f,categoryIndexMap:ce,userPieceStyle:C.pieceStyle,stroke:G,strokeWidth:V,opacity:$,styleRules:w,resolveRuleValue:he,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection}),de=dn(()=>F({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),me=n({componentName:"GroupedBarChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:ge,effectiveMargin:pe}=vi({ref:t,frameRef:r,setup:se}),fe=dn(()=>d(x),[x]);if(se.earlyReturn)return se.earlyReturn;const ye={chartType:"clusterbar",...null!=a&&{data:re},oAccessor:c,rAccessor:u,groupBy:h,oSort:y,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:ue,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:v,...null!=b&&{roundedTop:b},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:g,...q&&{oFormat:q},showGrid:K,...ge,...B({title:U,description:J,summary:ee,accessibleTable:te,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:k,defaultTooltipContent:de}),...D({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return me?pn(Ct,{componentName:"GroupedBarChart",message:me,width:X,height:Y}):pn(Pt,{componentName:"GroupedBarChart",width:X,height:Y,children:pn(ci,{ref:r,...ye})})});fn.displayName="GroupedBarChart";import{useMemo as yn,forwardRef as vn,useRef as bn}from"react";import{jsx as xn}from"react/jsx-runtime";var wn=vn(function(e,t){const i=mt(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=bn(null),{data:a,margin:s,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,barPadding:y,tooltip:v,annotations:b,brush:x,onBrush:w,linkedBrush:A,frameProps:k={},selection:S,linkedHover:_,onObservation:C,onClick:P,hoverHighlight:R,chartId:M,loading:L,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:O,color:N,stroke:j,strokeWidth:W,opacity:z,categoryFormat:G,rTickValues:V,tickLabelEdgeAlign:$,showCategoryTicks:q,gradientFill:X,trackFill:Y,roundedTop:Q,valueExtent:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:ae,valueLabel:se}=i,le=yn(()=>Be(a),[a]),ce=p||h,he=yn(()=>{if(null!=y)return y;if("sparkline"!==i.mode)return 40;const e=new Set(le.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"===m?U:Z)-2*t)/(t-1))):1},[y,i.mode,le,c,m,Z,U]),ue=o({data:le,rawData:a,colorBy:ce,colorScheme:f,legendInteraction:H,legendPosition:O,selection:S,linkedHover:_,fallbackFields:ce?["string"==typeof ce?ce:""]:[],unwrapData:!0,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwimlaneChart",chartId:M,showLegend:te,userMargin:s,marginDefaults:i.marginDefaults,loading:L,loadingContent:I,emptyContent:T,width:Z,height:U,hasTitle:!!oe,axisChrome:st({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!1!==q&&!!ae,hasValueLabel:!!se})}),de=rr({brushProp:x,onBrushProp:w,linkedBrush:A,valueAccessor:u}),me=bt(),ge=yn(()=>new Map,[]),pe=xi({colorBy:ce,colorScale:ue.colorScale,color:N,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:k?.pieceStyle,stroke:j,strokeWidth:W,opacity:z,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,cycleByCategory:!0}),fe=yn(()=>F({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ye=n({componentName:"SwimlaneChart",data:a,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ve,effectiveMargin:be}=vi({ref:t,frameRef:r,setup:ue}),xe=yn(()=>d(X),[X]);if(ue.earlyReturn)return ue.earlyReturn;const we={chartType:"swimlane",...null!=a&&{data:le},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:pe,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:he,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:!1===q?void 0:ae,rLabel:se,rFormat:g,...V&&{rTickValues:V},...null!=$&&{tickLabelEdgeAlign:$},...G&&{oFormat:G},...void 0!==q&&{showCategoryTicks:q},showGrid:ee,...ve,...B({title:oe,description:ie,summary:re,accessibleTable:ne,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({tooltip:v,defaultTooltipContent:fe}),...D({linkedHover:_,selection:S,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...b&&b.length>0&&{annotations:b},...xe&&{gradientFill:xe},...null!=Y&&{trackFill:Y},...null!=Q&&{roundedTop:Q},...K&&{rExtent:K},...de.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return ye?xn(Ct,{componentName:"SwimlaneChart",message:ye,width:Z,height:U}):xn(Pt,{componentName:"SwimlaneChart",width:Z,height:U,children:xn(ci,{ref:r,...we})})});wn.displayName="SwimlaneChart";export{ci as StreamOrdinalFrame_default,mi as OrdinalCustomChart,Ai as BarChart,Pi as StackedBarChart,Zi as LikertChart,ar as SwarmPlot,gr as BoxPlot,wr as Histogram,Cr as ViolinPlot,Ir as RidgelinePlot,Fr as FunnelChart,zr as DotPlot,Xr as PieChart,Ur as DonutChart,un as GaugeChart,fn as GroupedBarChart,wn as SwimlaneChart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getMinMax as t}from"./chunk-chunk-JJ2OOIET.module.min.js";function e(t){if(null==t)return()=>{};const e="function"==typeof t?t:e=>e[t];return t=>i(e(t))}function n(t,n){const r=e(t),i=e(n);return(t,e)=>{const n=i(t);return{value:n,x:r(t),y:n,category:e}}}function r(t,n){const r=e(n??"value"),i=null==t?void 0:"function"==typeof t?t:e=>e[t];return t=>{const e=i?i(t):void 0;return{value:r(t),category:null==e?void 0:e+""}}}function i(t){if("number"==typeof t)return Number.isFinite(t)?t:void 0;if("string"==typeof t&&""!==t.trim()){const e=Number(t);return Number.isFinite(e)?e:void 0}}function o(t,e,n){const r=null!=t.axis?n[t.axis]:null!=t.field?e[t.field]:n.value;if(void 0!==t.eq&&r!==t.eq)return!1;if(void 0!==t.ne&&r===t.ne)return!1;if(void 0!==t.in&&!t.in.includes(r))return!1;if(void 0===t.gt&&void 0===t.gte&&void 0===t.lt&&void 0===t.lte&&void 0===t.within&&void 0===t.outside)return!0;const o=i(r);if(void 0===o)return!1;if(void 0!==t.gt&&t.gt>=o)return!1;if(void 0!==t.gte&&t.gte>o)return!1;if(void 0!==t.lt&&o>=t.lt)return!1;if(void 0!==t.lte&&o>t.lte)return!1;if(void 0!==t.within){const[e,n]=t.within;if(e>o||o>n)return!1}if(void 0!==t.outside){const[e,n]=t.outside;if(o>=e&&n>=o)return!1}return!0}function s(t,e,n){const r=t.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(e,n):o(r,e,n))}function a(t,e,n){if(!e||0===e.length)return{};let r={};for(const i of e){if(!s(i,t,n))continue;const e="function"==typeof i.style?i.style(t,n):i.style;e&&(r={...r,...e})}return r}function u(t,e,n,r=t=>t){const i=t??(()=>({}));return e&&0!==e.length?(t,o)=>{const s=r(t),u={...i(t,o)};return Object.assign(u,a(s,e,n(s,o))),u}:i}function c(t,e,n){return t&&0!==t.length?(r,i)=>{const o=a(r,t,e(r,i)),s=n?n(r,i):void 0;return s?{...o,...s}:o}:n}function d(t,e,n,i){if(!t||0===t.length)return i;const o=r(e,n);return(e,n)=>{const r=e&&e.data||e,s=a(r,t,o(r)),u=i?i(e,n):void 0;return u?{...s,...u}:s}}function f(t,e,r,i){return c(t,n(e,r),i)}function l(t,e=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)*(1-e)),i=Math.round(parseInt(n[2],16)*(1-e)),o=Math.round(parseInt(n[3],16)*(1-e));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function h(t,e=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)+(255-parseInt(n[1],16))*e),i=Math.round(parseInt(n[2],16)+(255-parseInt(n[2],16))*e),o=Math.round(parseInt(n[3],16)+(255-parseInt(n[3],16))*e);return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function m(t=240){const e=360-t,n=180+e/2,r=n*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:e,startAngleDeg:n,startAngleRad:r,offsetRad:-Math.PI/2+r}}function g(t,e,n,r,i){const o=n-e||1;return i+(Math.max(e,Math.min(n,t))-e)/o*r}function p(e=240){const{sweepRad:n,offsetRad:r}=m(e),i=[[Math.cos(r),Math.sin(r)],[Math.cos(r+n),Math.sin(r+n)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>n+.001||i.push([Math.cos(t),Math.sin(t)]);const o=i.map(t=>t[0]),s=i.map(t=>t[1]),[a,u]=t(o),[c,d]=t(s);return{minX:a,maxX:u,minY:c,maxY:d,width:u-a,height:d-c,cx:(a+u)/2,cy:(c+d)/2}}function y(t){const e=[],n=t.domain;null==n?e.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} as numbers or Date-compatible values."}):Array.isArray(n)&&2===n.length&&Number.isFinite(Number(n[0]))&&Number.isFinite(Number(n[1]))||e.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const r=t.edges;if(Array.isArray(r)&&r.length>0){const t=r[0];null!=t.startTime&&null!=t.endTime||e.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const i=t.nodes,o=Array.isArray(i)?i.length:0;return!0!==t.showLabels||24>o||e.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${o} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),80>(Array.isArray(r)?r.length:0)||null!=t.layoutExecution||"off"===t.packing||e.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),e}export{e as makeRuleValueResolver,n as makeXYRuleContext,r as makeNodeRuleContext,o as matchesThreshold,s as ruleMatches,a as resolveStyleRules,u as composeStyleRules,c as makeStyleRuleStyleFn,d as styleRulesToNodeStyle,f as styleRulesToXYStyle,l as darkenColor,h as lightenColor,m as sweepToAngles,g as valueToAngle,p as computeArcBoundingBox,y as diagnoseProcessSankeyProps};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{StreamPhysicsFrame_default as e}from"./chunk-chunk-7C5EDZ3Z.module.min.js";import{resolveMotionAccessor as t}from"./chunk-chunk-AFQHURLO.module.min.js";function n(e,t,n={}){const s=new Set,o=[...e.get(t)??[]];let i=0;for(;o.length>i;){const t=o[i];if(i+=1,!s.has(t)){s.add(t);for(const n of e.get(t)??[])o.push(n)}}return n.includeStart&&s.add(t),s}function s(e,n,s){return t(s,e,n)}function o(e,t){return t>e?-1:e>t?1:0}function i(e,t){return`dependency:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function r(e,t){return`socket:${encodeURIComponent(e)}:${t}`}function a(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):0}function c(e){const t=[],n=new Map,c=[],d=new Set;e.data.forEach((i,r)=>{const l=(s(i,r,e.taskIDAccessor)??"")+"";if(!l)return void t.push({code:"duplicate-task-id",message:`Task row ${r} has an empty id.`,taskIDs:[]});if(n.has(l))return void t.push({code:"duplicate-task-id",message:`Task id "${l}" occurs more than once.`,taskIDs:[l]});const h=(s(i,r,e.laneAccessor)??"Unassigned")+"";d.has(h)||(d.add(h),c.push(h));const m=s(i,r,e.dependencyAccessor)??[],u=Array.from(new Set(Array.from(m,e=>e+""))).sort(o),p=s(i,r,e.blockerAccessor),g=s(i,r,e.statusAccessor)??(p?"blocked":"waiting");n.set(l,{id:l,label:(s(i,r,e.labelAccessor)??l)+"",lane:h,laneIndex:0,level:0,index:r,datum:i,dependencyIDs:u,incomingEdgeIDs:[],outgoingEdgeIDs:[],socketIDs:[],start:s(i,r,e.startAccessor),end:s(i,r,e.endAccessor),progress:a(s(i,r,e.progressAccessor)),status:g,completionTime:s(i,r,e.completionTimeAccessor),blockerReason:p||void 0,milestone:!!s(i,r,e.milestoneAccessor)})});const l=e.laneOrder?[...e.laneOrder,...c.filter(t=>!e.laneOrder?.includes(t))]:c,h=new Map(l.map((e,t)=>[e,t]));for(const e of n.values())e.laneIndex=h.get(e.lane)??0;const m=new Map,u=new Map;for(const e of n.keys())m.set(e,[]),u.set(e,[]);const p=[],g=[...n.values()].sort((e,t)=>e.index-t.index);for(const e of g)e.dependencyIDs.forEach((s,o)=>{const a=n.get(s);if(!a)return void t.push({code:"missing-dependency",message:`Task "${e.id}" depends on missing task "${s}".`,taskIDs:[e.id,s]});const c={id:i(s,e.id),sourceID:s,targetID:e.id,sourceIndex:a.index,targetIndex:e.index,socketID:r(e.id,o),socketIndex:o};p.push(c),m.get(e.id)?.push(c),u.get(s)?.push(c),e.incomingEdgeIDs.push(c.id),e.socketIDs.push(c.socketID),a.outgoingEdgeIDs.push(c.id)});for(const e of m.values())e.sort((e,t)=>o(e.sourceID,t.sourceID)),e.forEach((e,t)=>{e.socketIndex=t,e.socketID=r(e.targetID,t)});for(const e of u.values())e.sort((e,t)=>o(e.targetID,t.targetID));for(const e of n.values()){const t=m.get(e.id)??[];e.incomingEdgeIDs=t.map(e=>e.id),e.socketIDs=t.map(e=>e.socketID),e.outgoingEdgeIDs=(u.get(e.id)??[]).map(e=>e.id)}const f=new Map,y=new Map;for(const e of n.keys())f.set(e,m.get(e)?.length??0),y.set(e,0);const k=[...n.keys()].filter(e=>0===f.get(e)).sort(o);let x=0;for(;k.length;){const e=k.shift();x+=1;for(const t of u.get(e)??[]){const n=Math.max(y.get(t.targetID)??0,(y.get(e)??0)+1);y.set(t.targetID,n);const s=(f.get(t.targetID)??0)-1;if(f.set(t.targetID,s),0===s){const e=k.findIndex(e=>e>t.targetID);0>e?k.push(t.targetID):k.splice(e,0,t.targetID)}}}if(x!==n.size){const e=[...n.keys()].filter(e=>(f.get(e)??0)>0).sort(o);t.push({code:"cycle",message:`Dependency graph contains a cycle involving: ${e.join(", ")}.`,taskIDs:e})}let I=0;const D=[...n.values()].sort((e,t)=>e.index-t.index);for(const e of D)e.level=y.get(e.id)??0,I=Math.max(I,e.level);return{nodes:D,edges:p,byID:n,incoming:m,outgoing:u,lanes:l,maxLevel:I,diagnostics:t,valid:0===t.length}}function d(e,t,n={}){const s=Math.max(240,t.width),i=Math.max(220,t.height),r=t.paddingX??48,a=t.paddingTop??48,c=t.paddingBottom??44,d=Math.max(70,(s-2*r)/Math.max(1,e.lanes.length)),l=Math.max(76,(i-a-c)/Math.max(1,e.maxLevel+1)),h=Math.min(n.taskWidth??112,Math.max(58,.78*d)),m=Math.min(n.taskHeight??58,.64*l),u=n.socketRadius??5,p=Math.max(1,Math.round(n.gutterCount??3)),g=new Map;for(const t of e.nodes){const e=`${t.laneIndex}:${t.level}`,n=g.get(e)??[];n.push(t),g.set(e,n)}for(const e of g.values())e.sort((e,t)=>o(e.id,t.id));const f=.86*l,y=e.nodes.map(e=>{const t=g.get(`${e.laneIndex}:${e.level}`)??[e],n=Math.max(0,t.findIndex(t=>t.id===e.id))-(t.length-1)/2,s=(o=t.length)>1?Math.max(22,Math.min(m,(f-4*(o-1))/o)):m;var o;return{taskID:e.id,lane:e.lane,laneIndex:e.laneIndex,level:e.level,x:r+d*(e.laneIndex+.5),y:a+l*(e.level+.5)+n*(s+4),width:h,height:s}}),k=new Map(y.map(e=>[e.taskID,e])),x=[],I=[];e.edges.forEach((t,n)=>{const s=k.get(t.sourceID),o=k.get(t.targetID);if(!s||!o)return;const i=e.incoming.get(t.targetID)??[],r=Math.min(.72*o.width,14*Math.max(1,i.length-1)),a=i.length>1?o.x-r/2+r*t.socketIndex/(i.length-1):o.x,c=o.y-o.height/2-u-2;x.push({id:t.socketID,edgeID:t.id,taskID:o.taskID,index:t.socketIndex,x:a,y:c,radius:u});const d={x:s.x,y:s.y+s.height/2+3},l=Math.min(c-10,d.y+.48*Math.max(18,c-d.y)+7*(n%p-(p-1)/2));var h;I.push({edgeID:t.id,sourceID:t.sourceID,targetID:t.targetID,socketID:t.socketID,points:(h=[d,{x:d.x,y:l},{x:a,y:l},{x:a,y:c}],h.filter((e,t)=>{const n=h[t-1];return!n||n.x!==e.x||n.y!==e.y}))})});const D=new Map(x.map(e=>[e.id,e])),v=new Map(I.map(e=>[e.edgeID,e]));return{tasks:y,sockets:x,routes:I,taskByID:k,socketByID:D,routeByEdgeID:v}}function l(e,t,n="all"){const s=Array.from(new Set(t)).sort(o),i=new Set,r=()=>s.every(e=>i.has(e));return{taskID:e,mode:n,incomingEdgeIDs:s,deliver:e=>s.includes(e)?(i.add(e),r()):r(),reset:(e=[])=>{i.clear();for(const t of e)s.includes(t)&&i.add(t)},isSatisfied:r,getSnapshot:()=>({taskID:e,mode:n,incomingEdgeIDs:[...s],deliveredEdgeIDs:[...i].sort(o),satisfied:r()})}}function h(e){return e instanceof Date?e.getTime():Number(e)}function m(e,t){const n=h("object"!=typeof t||t instanceof Date?t:t.currentTime),s=e.map((e,t)=>({event:e,index:t,time:h(e.at)})).filter(e=>Number.isFinite(e.time)&&n>=e.time).sort((e,t)=>e.time-t.time||e.index-t.index),o=new Set,i=new Map,r=new Set,a=new Set;for(const{event:e}of s)"task-completed"===e.type?(o.add(e.taskID),i.delete(e.taskID)):"task-blocked"===e.type?i.set(e.taskID,e.reason):"task-unblocked"===e.type?i.delete(e.taskID):"dependency-delivered"===e.type?r.add(e.edgeID):"task-armed"===e.type&&a.add(e.taskID);return{currentTime:n,appliedEvents:s.map(e=>e.event),completedTaskIDs:o,blockedByTaskID:i,deliveredEdgeIDs:r,armedTaskIDs:a}}function u(e,t,s={}){const o=new Set(s.completedTaskIDs??[]),i=[...n(function(e,t){const n=new Map;for(const t of e)n.set(t.id,new Set);for(const e of t)n.has(e.source)||n.set(e.source,new Set),n.has(e.target)||n.set(e.target,new Set),n.get(e.source).add(e.target);return n}(e.nodes,e.edges.map(e=>({source:e.sourceID,target:e.targetID}))),t)].map(t=>e.byID.get(t)).filter(e=>null!=e).filter(e=>!(s.isComplete?s.isComplete(e):o.has(e.id)||"done"===e.status)).sort((e,t)=>e.index-t.index),r=Array.from(new Set(i.map(e=>e.lane)));return{blockerID:t,downstreamTaskCount:i.length,affectedLaneCount:r.length,downstreamTaskIDs:i.map(e=>e.id),affectedLanes:r}}import{forwardRef as p,useCallback as g,useEffect as f,useImperativeHandle as y,useMemo as k,useRef as x,useState as I}from"react";var D=[];function v(e,t=0){if(e instanceof Date)return e.getTime();const n=Number(e);return Number.isFinite(n)?n:t}function b(e){if(null==e.completionTime)return null;const t=v(e.completionTime,NaN);return Number.isFinite(t)?t:null}function w(e,t,n,s){const o=new Set;for(const i of e.nodes){const r=e.incoming.get(i.id)??[];(s.has(i.id)||!n.has(i.id)&&r.every(e=>t.has(e.id)))&&o.add(i.id)}return o}function T(e,t,n,s){const o=e.nodes.map(b).filter(e=>null!=e),i=o.length?Math.min(...o)-1:0,r="replay"!==t||s?n:i,a=new Set,c=new Map;for(const n of e.nodes){const e=b(n);(null!=e&&r>=e||"done"===n.status&&"replay"!==t)&&a.add(n.id),n.blockerReason&&!a.has(n.id)&&c.set(n.id,n.blockerReason)}const d=new Set;if("replay"!==t||s)for(const t of e.edges)a.has(t.sourceID)&&d.add(t.id);return{currentTime:r,playing:!1,completed:a,delivered:d,inFlight:new Set,armed:w(e,d,c,a),blockers:c,previewTaskID:null}}function M(e){return{...e,completed:new Set(e.completed),delivered:new Set(e.delivered),inFlight:new Set(e.inFlight),armed:new Set(e.armed),blockers:new Map(e.blockers)}}function S(e){const t=e.datum;return"dependency-ball"===t?.kind&&Array.isArray(t.route)?t:null}function A(e){const t=S(e.body);if(!t||2>t.route.length)return null;const n=function(e){let t=0;for(let n=1;e.length>n;n+=1)t+=Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t}(t.route),s=function(e,t){let n=1/0,s=0,o=0;for(let i=1;t.length>i;i+=1){const r=t[i-1],a=t[i],c=a.x-r.x,d=a.y-r.y,l=c*c+d*d,h=Math.sqrt(l);if(0>=h)continue;const m=Math.max(0,Math.min(1,((e.x-r.x)*c+(e.y-r.y)*d)/l)),u=Math.hypot(e.x-(r.x+c*m),e.y-(r.y+d*m));n>u&&(n=u,s=o+m*h),o+=h}return s}(e.body,t.route),o=function(e,t){if(2>e.length)return{point:e[0]??{x:0,y:0},tangent:{x:0,y:1}};let n=0;for(let s=1;e.length>s;s+=1){const o=e[s-1],i=e[s],r=i.x-o.x,a=i.y-o.y,c=Math.hypot(r,a);if(c>0){if(n+c>=t){const e=Math.max(0,Math.min(1,(t-n)/c));return{point:{x:o.x+r*e,y:o.y+a*e},tangent:{x:r/c,y:a/c}}}n+=c}}const s=e[e.length-2],o=e[e.length-1],i=o.x-s.x,r=o.y-s.y,a=Math.hypot(i,r)||1;return{point:o,tangent:{x:i/a,y:r/a}}}(t.route,Math.min(n,s+22));return{x:2.5*(78*o.tangent.x-e.body.vx)+8*(o.point.x-e.body.x),y:2.5*(78*o.tangent.y-e.body.vy)+8*(o.point.y-e.body.y)}}function C(e,t){const n=t.points[0]??{x:0,y:0},s=t.points[1]??n,o=s.x-n.x,i=s.y-n.y,r=Math.hypot(o,i)||1;return{id:"dependency-ball:"+e.id,x:n.x,y:n.y,vx:o/r*42,vy:i/r*42,mass:.7,restitution:.02,friction:.12,bodyCollisions:!1,shape:{type:"circle",radius:5},datum:{kind:"dependency-ball",edgeID:e.id,sourceID:e.sourceID,targetID:e.targetID,route:t.points}}}import{jsx as $,jsxs as E}from"react/jsx-runtime";function L({machine:e,layout:t,runtime:n,downstreamSet:s,selectedSet:o,width:i,height:r,seed:a,reduced:c,onSelectTask:d}){const l=t.tasks.length?Math.min(...t.tasks.map(e=>e.y-e.height/2)):60,h=Math.max(20,l-12),m=Math.max(26,l-6);return E("svg",{"aria-hidden":"true",width:i,height:r,viewBox:`0 0 ${i} ${r}`,style:{position:"absolute",inset:0,overflow:"visible",pointerEvents:"none"},children:[$("defs",{children:$("filter",{id:"chain-shadow-"+a,x:"-20%",y:"-20%",width:"140%",height:"150%",children:$("feDropShadow",{dx:"0",dy:"2",stdDeviation:"2",floodOpacity:"0.2"})})}),e.lanes.map((e,n)=>{const s=t.tasks.filter(e=>e.laneIndex===n),o=s[0]?.x??0;return E("g",{children:[$("line",{x1:o,x2:o,y1:m,y2:r-24,stroke:"var(--semiotic-grid, #d7dde0)",strokeWidth:1,strokeDasharray:"3 7"}),$("text",{x:o,y:h,textAnchor:"middle",fontSize:12,fontWeight:700,fill:"var(--semiotic-text, #243039)",children:e})]},e)}),t.routes.map(e=>{const t=n.delivered.has(e.edgeID),o=n.inFlight.has(e.edgeID),i=s.has(e.targetID)||s.has(e.sourceID),r=e.points.map(e=>`${e.x},${e.y}`).join(" ");return $("polyline",{points:r,fill:"none",stroke:i?"var(--semiotic-selection-color, #e08a1e)":t?"var(--semiotic-success, #2b8a66)":"var(--semiotic-grid, #aeb8bd)",strokeWidth:i?4:o?3:2,strokeOpacity:t||o||i?.95:.48,strokeLinecap:"round",strokeLinejoin:"round"},e.edgeID)}),t.sockets.map(e=>{const t=n.delivered.has(e.edgeID);return E("g",{children:[$("circle",{cx:e.x,cy:e.y,r:e.radius+2,fill:"var(--semiotic-bg, #fff)",stroke:"var(--semiotic-text, #243039)",strokeWidth:1.5}),t&&$("circle",{cx:e.x,cy:e.y,r:e.radius-.5,fill:"var(--semiotic-success, #2b8a66)"})]},e.id)}),e.nodes.map(e=>{const i=t.taskByID.get(e.id);if(!i)return null;const r=n.completed.has(e.id),l=n.blockers.has(e.id),h=n.previewTaskID===e.id,m=o.has(e.id)||h,u=s.has(e.id),p=function(e,t){return t.completed.has(e.id)?"var(--semiotic-success, #2b8a66)":t.blockers.has(e.id)?"var(--semiotic-error, #c64035)":"in-progress"===e.status?"var(--semiotic-warning, #d18a22)":t.armed.has(e.id)?"var(--semiotic-primary, #2474a6)":"var(--semiotic-text-secondary, #75818a)"}(e,n),g=i.x-i.width/2,f=i.y-i.height/2,y=Math.max(2,i.height*e.progress);return E("g",{children:[E("g",{style:{transform:`rotate(${r?76:0}deg)`,transformBox:"fill-box",transformOrigin:"50% 100%",transition:c?"none":"transform 520ms cubic-bezier(.2,.8,.25,1)",filter:"url(#chain-shadow-"+a+")"},children:[$("rect",{x:g,y:f,width:i.width,height:i.height,rx:e.milestone?12:4,fill:"var(--semiotic-bg, #fff)",stroke:m||u?"var(--semiotic-selection-color, #e08a1e)":p,strokeWidth:m?4:u?3:2}),$("rect",{x:g+3,y:f+i.height-y+1,width:i.width-6,height:Math.max(0,y-4),rx:2,fill:p,opacity:r?.86:.46})]}),l&&E("g",{opacity:h?.28:1,children:[$("line",{x1:g-8,x2:g+14,y1:i.y+9,y2:i.y-9,stroke:"var(--semiotic-error, #c64035)",strokeWidth:7,strokeLinecap:"round"}),$("circle",{cx:g-8,cy:i.y+9,r:3,fill:"var(--semiotic-error, #c64035)"})]}),E("g",{onPointerDown:()=>d(e.id),style:{cursor:"pointer",pointerEvents:"auto"},children:[$("rect",{x:g,y:f,width:i.width,height:i.height,fill:"transparent"}),$("text",{x:i.x,y:i.y-4,textAnchor:"middle",fontSize:10.5,fontWeight:700,fill:"var(--semiotic-text, #243039)",children:e.label.length>24?e.label.slice(0,22)+"…":e.label}),E("text",{x:i.x,y:i.y+12,textAnchor:"middle",fontSize:9.5,fill:"var(--semiotic-text-secondary, #5f6b72)",children:[Math.round(100*e.progress),"% · ",r?"done":l?"blocked":n.armed.has(e.id)?"ready":"waiting"]})]})]},e.id)})]})}import{jsx as F,jsxs as W}from"react/jsx-runtime";var N={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1},R=p(function(t,n){const{data:s,taskIDAccessor:o,labelAccessor:i,laneAccessor:r,dependencyAccessor:a,startAccessor:l,endAccessor:h,progressAccessor:m,statusAccessor:p,completionTimeAccessor:$,blockerAccessor:E,milestoneAccessor:R,mode:B="snapshot",insight:j="blocker-amplification",currentTime:z,controls:O=!1,selectedTaskIDs:P,onSelectionChange:H,onObservation:U,reducedMotion:q,seed:Z=31,width:G=920,height:Q=620,responsiveWidth:V,responsiveHeight:X,title:J="Dependency chain reaction",description:K,className:Y,accessibleTable:_=!0,enableHover:ee=!0}=t,te=x(null),[ne,se]=I([]),oe=P?Array.from(P):ne,ie=k(()=>new Set(oe),[oe]),re=v(z,1/0),ae="settle"===q,ce=k(()=>c({data:s,taskIDAccessor:o,labelAccessor:i,laneAccessor:r,dependencyAccessor:a,startAccessor:l,endAccessor:h,progressAccessor:m,statusAccessor:p,completionTimeAccessor:$,blockerAccessor:E,milestoneAccessor:R}),[s,o,i,r,a,l,h,m,p,$,E,R]),de=k(()=>d(ce,{width:G,height:Q}),[ce,G,Q]),[le,he]=I(()=>T(ce,B,re,ae)),me=x(le),ue=g(e=>{me.current=e,he(e)},[]),pe=g(e=>U?.(e),[U]);f(()=>{const e=T(ce,B,re,ae);te.current?.clear(),me.current=e,he(e)},[ce,B,re,ae]);const ge=g(e=>{const t=ie.has(e)?oe.filter(t=>t!==e):[e];P||se(t),H?.(t)},[P,H,ie,oe]),fe=g(e=>{if(ae)return;const t=M(me.current),n=[];for(const s of ce.outgoing.get(e)??[]){if(t.delivered.has(s.id)||t.inFlight.has(s.id))continue;const e=de.routeByEdgeID.get(s.id);e&&(t.inFlight.add(s.id),n.push(C(s,e)))}n.length&&(ue(t),te.current?.pushMany(n,{pacing:{ratePerSec:8}}))},[ue,de,ce,ae]),ye=g((e,t)=>{const n=ce.byID.get(e),s=me.current;if(!n||s.completed.has(e))return;const o=M(s);o.completed.add(e),o.blockers.delete(e),o.armed.add(e),null!=t&&(o.currentTime=t),ue(o),pe({type:"task-completed",taskID:e,datum:n.datum}),fe(e)},[ue,pe,ce,fe]),ke=g(e=>{const t=M(me.current),n=[],s=[];for(const s of e){if(t.delivered.has(s))continue;const e=ce.edges.find(e=>e.id===s);e&&(t.delivered.add(s),t.inFlight.delete(s),n.push(e))}for(const e of n){const n=ce.byID.get(e.targetID);!n||t.blockers.has(n.id)||t.armed.has(n.id)||(ce.incoming.get(n.id)??[]).every(e=>t.delivered.has(e.id))&&(t.armed.add(n.id),s.push(n.id))}if(n.length){ue(t);for(const e of n)pe({type:"dependency-delivered",sourceID:e.sourceID,targetID:e.targetID});for(const e of s)pe({type:"task-armed",taskID:e})}},[ue,pe,ce]),xe=g((e,t)=>{const n=[],s=[];for(const e of t.readBodies()){const t=S(e);if(!t||me.current.delivered.has(t.edgeID))continue;const o=t.route[t.route.length-1];o&&9>=Math.hypot(e.x-o.x,e.y-o.y)&&(n.push(t.edgeID),s.push(e.id))}s.length&&t.remove(s),n.length&&ke(n)},[ke]),Ie=g(()=>{const e=M(me.current);for(const t of ce.edges)e.completed.has(t.sourceID)&&e.delivered.add(t.id);e.inFlight.clear(),e.armed=w(ce,e.delivered,e.blockers,e.completed),e.playing=!1,te.current?.settle(),ue(e),pe({type:"machine-settled"})},[ue,pe,ce]),De=g(()=>{const e=M(me.current);e.playing=!1,ue(e)},[ue]),ve=g(()=>{const e=me.current,t=ce.nodes.map(e=>({node:e,time:b(e)})).filter(t=>null!=t.time&&t.time>e.currentTime&&!e.completed.has(t.node.id)).sort((e,t)=>e.time-t.time||e.node.index-t.node.index)[0];if(t)return void ye(t.node.id,t.time);De();const n=[...e.blockers.keys()].map(t=>u(ce,t,{completedTaskIDs:e.completed})).sort((e,t)=>t.affectedLaneCount-e.affectedLaneCount||t.downstreamTaskCount-e.downstreamTaskCount);n[0]&&pe({type:"machine-stalled",blockerID:n[0].blockerID,downstreamTaskCount:n[0].downstreamTaskCount,affectedLaneCount:n[0].affectedLaneCount})},[pe,ce,De,ye]),be=g(()=>{if(ae)return void Ie();const e=M(me.current);e.playing=!0,ue(e)},[ue,ae,Ie]);f(()=>{if(!le.playing||"replay"!==B||ae)return;const e=window.setInterval(ve,760);return()=>window.clearInterval(e)},[B,ae,le.playing,ve]);const we=g(()=>{te.current?.clear(),ue(T(ce,B,re,ae))},[ue,ce,B,re,ae]),Te=g(e=>{if(!ce.byID.has(e))return;const t=M(me.current);t.previewTaskID=e,ue(t);const n=u(ce,e,{completedTaskIDs:t.completed});pe({type:"blocker-previewed",blockerID:e,downstreamTaskIDs:n.downstreamTaskIDs})},[ue,pe,ce]),Me=g(()=>{const e=M(me.current);e.previewTaskID=null,ue(e)},[ue]),Se=g((e,t)=>{if(!ce.byID.has(e))return;const n=M(me.current);n.blockers.set(e,t),n.armed.delete(e),ue(n)},[ue,ce]),Ae=g(e=>{if(!ce.byID.has(e))return;const t=M(me.current);t.blockers.delete(e),(ce.incoming.get(e)??[]).every(e=>t.delivered.has(e.id))&&t.armed.add(e),ue(t)},[ue,ce]),Ce=g(e=>u(ce,e,{completedTaskIDs:me.current.completed}),[ce]),$e=g(()=>{const e=me.current;return{currentTime:e.currentTime,playing:e.playing,previewTaskID:e.previewTaskID,selectedTaskIDs:[...oe],tasks:ce.nodes.map(t=>({taskID:t.id,completed:e.completed.has(t.id),armed:e.armed.has(t.id),blocked:e.blockers.has(t.id),blockerReason:e.blockers.get(t.id)})),dependencies:ce.edges.map(t=>({edgeID:t.id,sourceID:t.sourceID,targetID:t.targetID,state:e.delivered.has(t.id)?"delivered":e.inFlight.has(t.id)?"in-flight":"waiting"}))}},[ce,oe]);y(n,()=>({play:be,pause:De,step:ve,reset:we,settle:Ie,previewResolve:Te,clearPreview:Me,completeTask:ye,blockTask:Se,unblockTask:Ae,getAmplification:Ce,getMachineState:$e}),[Se,Me,Ce,$e,De,ye,be,Te,we,Ie,ve,Ae]);const Ee=le.previewTaskID??oe[0]??null,Le=Ee?u(ce,Ee,{completedTaskIDs:le.completed}):null,Fe=k(()=>new Set(Le?.downstreamTaskIDs??[]),[Le?.downstreamTaskIDs]),We=k(()=>function(e,t,n){return e.nodes.flatMap(s=>{const o=t.taskByID.get(s.id);if(!o)return[];const i=e.incoming.get(s.id)??[],r=i.filter(e=>n.delivered.has(e.id)).length,a=n.blockers.get(s.id),c=n.completed.has(s.id)?"completed":a?"blocked: "+a:n.armed.has(s.id)?"armed":"waiting";return[{id:s.id,label:`${s.label}, ${s.lane}, ${Math.round(100*s.progress)}%, ${c}`,description:`${r} of ${i.length} prerequisites delivered.`,datum:s.datum,x:o.x,y:o.y,width:o.width,height:o.height,shape:"rect",group:s.lane}]})}(ce,de,le),[de,ce,le]),Ne=k(()=>F(L,{machine:ce,layout:de,runtime:le,downstreamSet:Fe,selectedSet:ie,width:G,height:Q,seed:Z,reduced:ae,onSelectTask:ge}),[Fe,Q,de,ce,ae,le,Z,ge,ie,G]),Re=k(()=>{const e=[...le.blockers.keys()].map(e=>u(ce,e,{completedTaskIDs:le.completed})).sort((e,t)=>t.affectedLaneCount-e.affectedLaneCount||t.downstreamTaskCount-e.downstreamTaskCount);return e.length?e.map(e=>`${ce.byID.get(e.blockerID)?.label??e.blockerID} affects ${e.downstreamTaskCount} unfinished tasks across ${e.affectedLaneCount} lanes.`).join(" "):"No explicit blockers are active."},[ce,le.blockers,le.completed]),Be=k(()=>[{id:"chain-left",shape:{type:"segment",x1:2,y1:0,x2:2,y2:Q,thickness:4}},{id:"chain-right",shape:{type:"segment",x1:G-2,y1:0,x2:G-2,y2:Q,thickness:4}},{id:"chain-top",shape:{type:"segment",x1:0,y1:2,x2:G,y2:2,thickness:4}},{id:"chain-bottom",shape:{type:"segment",x1:0,y1:Q-2,x2:G,y2:Q-2,thickness:4}}],[Q,G]),je=!0===O?["play","pause","step","reset","settle"]:O||[];return W("div",ce.valid?{className:Y,style:{width:G,maxWidth:"100%",position:"relative"},children:[je.length>0&&F("div",{"aria-label":"Chain reaction replay controls",style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:je.map(e=>F("button",{type:"button",onClick:"play"===e?be:"pause"===e?De:"step"===e?ve:"reset"===e?we:Ie,"aria-pressed":"play"===e?le.playing:void 0,children:e[0].toUpperCase()+e.slice(1)},e))}),F(e,{ref:te,size:[G,Q],responsiveWidth:V,responsiveHeight:X,maxDevicePixelRatio:t.maxDevicePixelRatio,title:J,description:K??"Tasks are arranged by workstream and dependency depth. Balls represent satisfied prerequisites; task completion remains an explicit data event.",summary:`${Re}${Le&&"blocker-amplification"===j?` Selected task reaches ${Le.downstreamTaskCount} unfinished tasks across ${Le.affectedLaneCount} lanes.`:""}`,accessibleTable:!1,enableHover:ee,initialSpawns:D,bodyForces:A,bodyStyle:{fill:"var(--semiotic-primary, #f0a329)",stroke:"var(--semiotic-text, #243039)",strokeWidth:1.25},bodySemanticItems:!1,semanticItems:We,onSemanticItemActivate:e=>e.id&&ge(e.id),foregroundGraphics:()=>Ne,paused:ae,continuous:le.inFlight.size>0,onTick:xe,config:{bodyLimit:Math.max(16,ce.edges.length+4),colliders:Be,settleStepLimit:2200,kernel:{seed:Z,gravity:{x:0,y:7},fixedDt:1/60,cellSize:28,collisionIterations:2,velocityDamping:.992,restitution:.02,friction:.12,maxVelocity:150,sleepSpeed:1.1,sleepAfter:.8},observation:{chartType:"ChainReactionChart"}}}),_&&W("table",{style:N,children:[F("caption",{children:Re}),F("thead",{children:W("tr",{children:[F("th",{children:"Task"}),F("th",{children:"Lane"}),F("th",{children:"Progress"}),F("th",{children:"State"}),F("th",{children:"Waiting on"}),F("th",{children:"Downstream reach"})]})}),F("tbody",{children:ce.nodes.map(e=>{const t=u(ce,e.id,{completedTaskIDs:le.completed});return W("tr",{children:[F("th",{scope:"row",children:e.label}),F("td",{children:e.lane}),W("td",{children:[Math.round(100*e.progress),"%"]}),F("td",{children:le.completed.has(e.id)?"Completed":le.blockers.has(e.id)?"Blocked":le.armed.has(e.id)?"Armed":"Waiting"}),F("td",{children:le.blockers.get(e.id)??(e.dependencyIDs.filter(e=>!le.completed.has(e)).join(", ")||"None")}),W("td",{children:[t.downstreamTaskCount," tasks / ",t.affectedLaneCount," lanes"]})]},e.id)})})]})]}:{className:Y,role:"alert",style:{width:G,maxWidth:"100%"},children:[F("strong",{children:"ChainReactionChart could not compile this dependency graph."}),F("ul",{children:ce.diagnostics.map((e,t)=>F("li",{children:e.message},`${e.code}-${t}`))})]})});R.displayName="ChainReactionChart";export{c as compileDependencyMachine,d as routeDependencyTracks,l as createLogicalJoin,m as replayStateTransitions,u as calculateBlockerAmplification,R as ChainReactionChart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=new WeakMap,e=0,n=!1,r=null,i=null;function o(a,s){if(!s)return s;const u=function(t){const e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;const n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){const t=n.trim();return t.startsWith("--")?{name:t}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}(s);if(!u)return s;const c=()=>u.fallback?o(a,u.fallback):s,d=a.canvas;if(!d)return c();!function(){if(n)return;if("undefined"==typeof window||"undefined"==typeof document)return;n=!0;const t=()=>{e++};if("undefined"!=typeof MutationObserver&&document.documentElement&&new MutationObserver(t).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme"],subtree:!0}),"function"==typeof window.matchMedia)try{r=window.matchMedia("(prefers-color-scheme: dark)"),i=t,"function"==typeof r.addEventListener?r.addEventListener("change",i):"function"==typeof r.addListener&&r.addListener(i)}catch{}}();let f=t.get(d);f&&f.version===e||(f={version:e,map:new Map},t.set(d,f));const l=f.map.get(s);if(void 0!==l)return l;const m=getComputedStyle(d).getPropertyValue(u.name).trim()||c()||s;return f.map.set(s,m),m}function a(t){e++}function s(){return e}export{o as resolveCSSColor,a as clearCSSColorCache,s as getCSSColorCacheVersion};
|
|
File without changes
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var t={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},e=8;function n(t){return null==t?void 0:t+""}function r(e){const r=n(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...t},datum:e.datum,pointId:r,_transitionKey:r}}function a(t){return r(t)}function i(e){const[[n,r],[a,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((a-n)*(i-r)),style:{...t},datum:e.datum,group:e.group,interactive:!0}}function u(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t},datum:e.datum,group:e.group,_transitionKey:n(e.id)}}function o(e){const r=n(e.id);return"width"in e&&"height"in e?{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...t},datum:e.datum,id:r,label:e.label}:{type:"circle",cx:e.x,cy:e.y,r:e.r??8,style:{...t},datum:e.datum,id:r,label:e.label}}export{e as DEFAULT_HIT_RADIUS,r as hitTargetPoint,a as geoHitTarget,i as geoAreaHitTarget,u as hitTargetRect,o as networkHitTarget};
|