semiotic 3.8.5 → 3.8.7
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/CLAUDE.md +37 -10
- package/README.md +83 -56
- package/ai/behaviorContracts.cjs +88 -3
- package/ai/componentMetadata.cjs +5 -10
- package/ai/dist/mcp-server.js +99 -10
- package/ai/examples.md +198 -9
- package/ai/schema.json +2002 -165
- package/ai/surface-manifest.json +14 -10
- package/ai/system-prompt.md +9 -3
- package/dist/{chunk-chartContainerDataAudit-74TLKIP6.module.min.js → chunk-chartContainerDataAudit-JDSVSKGM.module.min.js} +1 -1
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
- package/dist/chunk-chunk-2YAZHXL4.module.min.js +2 -0
- package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
- package/dist/{chunk-chunk-G7WFWHAD.module.min.js → chunk-chunk-4ITOQRXM.module.min.js} +1 -1
- package/dist/chunk-chunk-5SD6BHVW.module.min.js +2 -0
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +2 -0
- package/dist/chunk-chunk-7TTBHSAG.module.min.js +2 -0
- package/dist/chunk-chunk-7ZDJSYKI.module.min.js +2 -0
- package/dist/chunk-chunk-BGHPD3RA.module.min.js +1 -0
- package/dist/chunk-chunk-BMRZ2SPU.module.min.js +2 -0
- package/dist/chunk-chunk-BNGBEY7N.module.min.js +2 -0
- package/dist/chunk-chunk-C7APLVQD.module.min.js +2 -0
- package/dist/chunk-chunk-DGWFBOGB.module.min.js +1 -0
- package/dist/chunk-chunk-DIVE2DRA.module.min.js +2 -0
- package/dist/chunk-chunk-FBUNUIPV.module.min.js +2 -0
- package/dist/chunk-chunk-FQPKOAIH.module.min.js +2 -0
- package/dist/chunk-chunk-FRO4TRXK.module.min.js +2 -0
- package/dist/chunk-chunk-G7QVPZUD.module.min.js +2 -0
- package/dist/chunk-chunk-GBPYV4FP.module.min.js +2 -0
- package/dist/chunk-chunk-GU2EJIDJ.module.min.js +2 -0
- package/dist/chunk-chunk-J5QD4RAM.module.min.js +2 -0
- package/dist/{chunk-chunk-LJLS6DY7.module.min.js → chunk-chunk-JWXLNZSM.module.min.js} +1 -1
- package/dist/chunk-chunk-KXAFCCDB.module.min.js +2 -0
- package/dist/chunk-chunk-LG7YKJAK.module.min.js +2 -0
- package/dist/{chunk-chunk-I36PJ4OC.module.min.js → chunk-chunk-LVHDZAT3.module.min.js} +1 -1
- package/dist/chunk-chunk-LWITSR2O.module.min.js +2 -0
- package/dist/chunk-chunk-MX35T6RX.module.min.js +2 -0
- package/dist/chunk-chunk-NH4MEAKP.module.min.js +2 -0
- package/dist/chunk-chunk-NJETWX42.module.min.js +2 -0
- package/dist/chunk-chunk-NW25WGLS.module.min.js +2 -0
- package/dist/{chunk-chunk-TMWIZL3K.module.min.js → chunk-chunk-OI7R7EJB.module.min.js} +1 -1
- package/dist/chunk-chunk-ONMLEXHR.module.min.js +2 -0
- package/dist/chunk-chunk-OY66GCE6.module.min.js +1 -0
- package/dist/chunk-chunk-PZFT457G.module.min.js +1 -0
- package/dist/chunk-chunk-Q3WW6JGR.module.min.js +1 -0
- package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +1 -0
- package/dist/chunk-chunk-RJRM2E6P.module.min.js +1 -0
- package/dist/chunk-chunk-RPL7WYXI.module.min.js +1 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-TSCFL235.module.min.js +1 -0
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +2 -0
- package/dist/chunk-chunk-V3OAKG32.module.min.js +1 -0
- package/dist/chunk-chunk-WLOIUMWG.module.min.js +2 -0
- package/dist/chunk-chunk-XEGXX4F7.module.min.js +1 -0
- package/dist/chunk-chunk-XFRBLXYM.module.min.js +1 -0
- package/dist/chunk-chunk-Z2AJERX5.module.min.js +2 -0
- package/dist/chunk-chunk-ZXYDYAB7.module.min.js +2 -0
- package/dist/components/ai/SemioticVACPBridge.d.ts +22 -0
- package/dist/components/ai/chartCapabilities.d.ts +5 -3
- package/dist/components/ai/conversationArc.d.ts +2 -176
- package/dist/components/ai/conversationArcTypes.d.ts +202 -0
- package/dist/components/ai/readerGrounding.d.ts +12 -0
- package/dist/components/ai/vacpAdapter.d.ts +13 -0
- package/dist/components/ai/vacpAdapterActions.d.ts +2 -0
- package/dist/components/ai/vacpAdapterModel.d.ts +7 -0
- package/dist/components/ai/vacpAdapterRuntime.d.ts +26 -0
- package/dist/components/ai/vacpAdapterState.d.ts +3 -0
- package/dist/components/ai/vacpAdapterTypes.d.ts +169 -0
- package/dist/components/ai/vacpTypes.d.ts +160 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
- package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
- package/dist/components/charts/index.d.ts +7 -4
- package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
- package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
- package/dist/components/charts/physics/ChainReactionChart.capability.d.ts +9 -0
- package/dist/components/charts/physics/ChainReactionChart.d.ts +29 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +1 -1
- package/dist/components/charts/physics/EventDropChart.d.ts +7 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +1 -1
- package/dist/components/charts/physics/{PhysicsPileChart.capability.d.ts → PacketFlowChart.capability.d.ts} +1 -1
- package/dist/components/charts/physics/{PhysicalFlowChart.d.ts → PacketFlowChart.d.ts} +22 -6
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +1 -1
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +7 -4
- package/dist/components/charts/physics/{PhysicalFlowChart.capability.d.ts → UnitPileChart.capability.d.ts} +1 -1
- package/dist/components/charts/physics/{PhysicsPileChart.d.ts → UnitPileChart.d.ts} +19 -6
- package/dist/components/charts/physics/crucibleChartProps.d.ts +1 -1
- package/dist/components/charts/physics/crucibleChartUtils.d.ts +9 -0
- package/dist/components/charts/physics/gauntletChartProps.d.ts +6 -1
- package/dist/components/charts/physics/gauntletTerminal.d.ts +61 -0
- package/dist/components/charts/physics/packetFlowSemantics.d.ts +6 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +45 -2
- package/dist/components/charts/shared/auditAccessibilityStyles.d.ts +9 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +2 -4
- package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
- package/dist/components/charts/shared/gradient.d.ts +35 -0
- package/dist/components/charts/shared/hatchFill.d.ts +3 -10
- package/dist/components/charts/shared/hooks.d.ts +2 -50
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
- package/dist/components/charts/shared/useChartLegend.d.ts +65 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +12 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/xy/AreaChart.d.ts +25 -42
- package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
- package/dist/components/charts/xy/BumpChart.d.ts +161 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
- package/dist/components/charts/xy/Heatmap.d.ts +3 -0
- package/dist/components/charts/xy/LineChart.d.ts +6 -8
- package/dist/components/data/portability/capabilityBinding.d.ts +41 -0
- package/dist/components/data/portability/index.d.ts +2 -0
- package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
- package/dist/components/legendLayout.d.ts +75 -1
- package/dist/components/recipes/geographicDotGrid.d.ts +82 -0
- package/dist/components/recipes/geographicGrid.d.ts +100 -0
- package/dist/components/recipes/physics.d.ts +2 -0
- package/dist/components/recipes/physicsStageGeography.d.ts +137 -0
- package/dist/components/semiotic-ai.d.ts +6 -4
- package/dist/components/semiotic-experimental-vacp.d.ts +11 -0
- package/dist/components/semiotic-experimental.d.ts +6 -3
- package/dist/components/semiotic-geo.d.ts +5 -0
- package/dist/components/semiotic-network.d.ts +1 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-physics.d.ts +10 -6
- package/dist/components/semiotic-realtime-core.d.ts +1 -0
- package/dist/components/semiotic-recipes-core.d.ts +6 -1
- package/dist/components/semiotic-server-edge.d.ts +1 -1
- package/dist/components/semiotic-server.d.ts +1 -1
- package/dist/components/semiotic-xy.d.ts +4 -0
- package/dist/components/semiotic.d.ts +4 -4
- package/dist/components/server/renderEvidence.d.ts +1 -1
- package/dist/components/server/renderToStaticSVG.d.ts +2 -1
- package/dist/components/server/serverChartConfigHeatmap.d.ts +6 -0
- package/dist/components/server/serverChartConfigNetworkStyles.d.ts +12 -0
- package/dist/components/server/serverChartConfigShared.d.ts +16 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -2
- package/dist/components/server/serverChartConfigsPhysics.d.ts +2 -2
- package/dist/components/server/serverChartConfigsXY.d.ts +1 -1
- package/dist/components/server/staticLegend.d.ts +10 -2
- package/dist/components/server/staticSVGChrome.d.ts +14 -6
- package/dist/components/server/staticValue.d.ts +8 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +4 -10
- package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
- package/dist/components/stream/SVGOverlay.d.ts +2 -6
- package/dist/components/stream/StalenessBadge.d.ts +2 -6
- package/dist/components/stream/geoPipelineConfig.d.ts +10 -0
- package/dist/components/stream/geoTypes.d.ts +3 -6
- package/dist/components/stream/legendRenderer.d.ts +10 -6
- package/dist/components/stream/ordinalTypes.d.ts +7 -31
- package/dist/components/stream/physics/PhysicsEvidence.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +5 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
- package/dist/components/stream/physics/physicsFramePipelineConfig.d.ts +19 -0
- package/dist/components/stream/physics/physicsPipelineSettle.d.ts +52 -0
- package/dist/components/stream/physics/physicsRegionRuntime.d.ts +23 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -15
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
- package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
- package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
- package/dist/components/stream/types.d.ts +34 -56
- package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
- package/dist/components/types/legendTypes.d.ts +31 -6
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.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.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- 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 +6 -4
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.d.ts +11 -0
- package/dist/semiotic-experimental-vacp.min.js +1 -0
- package/dist/semiotic-experimental-vacp.module.min.js +1 -0
- package/dist/semiotic-experimental.d.ts +6 -3
- package/dist/semiotic-experimental.min.js +2 -1
- package/dist/semiotic-experimental.module.min.js +2 -1
- package/dist/semiotic-geo.d.ts +5 -0
- package/dist/semiotic-network.d.ts +1 -0
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-physics.d.ts +10 -6
- package/dist/semiotic-realtime-core.d.ts +1 -0
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +6 -1
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.d.ts +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-server.d.ts +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -0
- package/dist/semiotic.d.ts +4 -4
- 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 +18 -2
- package/spec/README.md +94 -2
- package/spec/bindings/README.md +14 -3
- package/spec/v0.1/examples/annotation-provenance-reviewed-revision.json +27 -0
- package/spec/v0.1/examples/annotation-provenance-watcher-threshold.json +21 -0
- package/spec/v0.1/examples/audience-profile-executive-review.json +24 -0
- package/spec/v0.1/examples/audience-profile-incident-operators.json +42 -0
- package/spec/v0.1/examples/chart-capability-bar-comparison.json +48 -0
- package/spec/v0.1/examples/chart-capability-service-flow.json +54 -0
- package/dist/chunk-chunk-4AANPFOX.module.min.js +0 -2
- package/dist/chunk-chunk-5I3UZV4Q.module.min.js +0 -2
- package/dist/chunk-chunk-5RKXZQ2P.module.min.js +0 -1
- package/dist/chunk-chunk-74CCPVXB.module.min.js +0 -1
- package/dist/chunk-chunk-7ALTGHK6.module.min.js +0 -1
- package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
- package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
- package/dist/chunk-chunk-BANTPINB.module.min.js +0 -2
- package/dist/chunk-chunk-C4YA6TDR.module.min.js +0 -1
- package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
- package/dist/chunk-chunk-CKMD5NV3.module.min.js +0 -2
- package/dist/chunk-chunk-CO5KQMGH.module.min.js +0 -1
- package/dist/chunk-chunk-CWQ5YIHX.module.min.js +0 -2
- package/dist/chunk-chunk-E6TXX6MI.module.min.js +0 -1
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +0 -1
- package/dist/chunk-chunk-JCG72SGW.module.min.js +0 -2
- package/dist/chunk-chunk-K3DMEW22.module.min.js +0 -1
- package/dist/chunk-chunk-KT2VAZMZ.module.min.js +0 -1
- package/dist/chunk-chunk-L6EA5V3G.module.min.js +0 -2
- package/dist/chunk-chunk-LJPCLYSC.module.min.js +0 -2
- package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
- package/dist/chunk-chunk-N5DDKCCF.module.min.js +0 -1
- package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
- package/dist/chunk-chunk-NLO44TOS.module.min.js +0 -2
- package/dist/chunk-chunk-PZJ2SBLL.module.min.js +0 -2
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +0 -1
- package/dist/chunk-chunk-QUJ6TTLY.module.min.js +0 -1
- package/dist/chunk-chunk-RBIDBUT4.module.min.js +0 -2
- package/dist/chunk-chunk-RCF52Z42.module.min.js +0 -2
- package/dist/chunk-chunk-RFLAG356.module.min.js +0 -1
- package/dist/chunk-chunk-RPU4IZAV.module.min.js +0 -2
- package/dist/chunk-chunk-SKMBCFIL.module.min.js +0 -2
- package/dist/chunk-chunk-TAE7W424.module.min.js +0 -2
- package/dist/chunk-chunk-TUBMTZMU.module.min.js +0 -2
- package/dist/chunk-chunk-UFFEXJQY.module.min.js +0 -1
- package/dist/chunk-chunk-XSCHTS4D.module.min.js +0 -2
- package/dist/chunk-chunk-XXWSHGPL.module.min.js +0 -2
- package/dist/chunk-chunk-ZOAQDIJO.module.min.js +0 -1
- package/dist/chunk-chunk-ZXIXAPRE.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
- package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{validateArrayData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,normalizePartialMargin as n,useChartSetup as i,useCustomChartSetup as r,useFrameImperativeHandle as a,useResolvedSelection as s}from"./chunk-chunk-SKMBCFIL.module.min.js";import{StreamXYFrame_default as l}from"./chunk-chunk-CKMD5NV3.module.min.js";import{accessorName as c,bandTooltipFields as h,buildBaseMetadataProps as d,buildCustomBehaviorProps as m,buildDefaultTooltip as u,buildTooltipProps as p}from"./chunk-chunk-XXWSHGPL.module.min.js";import{makeXYRuleContext as f,resolveStyleRules as y}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as g,DEFAULT_COLOR as b,DEFAULT_COLORS as v,DEFAULT_SELECTION_OPACITY as x,LinkedCharts as A,MultiPointTooltip as w,composeLegendConfigs as k,defaultTooltipStyle as S,filterSparseArray as C,getColor as L,getCrosshairProps as H,getSequentialInterpolator as I,getSize as B,interpolateViridis as F,normalizeLinkedBrush as R,normalizeTooltip as _,resolveMobileInteraction as N,useBrushSelection as P,useChartLegendAndMargin as W,useChartMode as D,useChartSelection as M,useColorScale as E,useLegendInteraction as O,useSelection as T,useSelectionSelector as G,useThemeCategorical as z,useThemeSequential as j,wrapStyleWithSelection as $}from"./chunk-chunk-CWQ5YIHX.module.min.js";import{getMax as Q,getMinMax as X}from"./chunk-chunk-JJ2OOIET.module.min.js";import{ChartError as V,SafeRender as Y,renderEmptyState as q,renderLoadingState as J,warnMissingField as K}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as U from"react";import{useMemo as Z,useCallback as ee,forwardRef as te,useRef as oe}from"react";import{useMemo as ne}from"react";function ie(e){const{colorBy:t,colorScale:n,color:i,pointRadius:r=5,radiusFn:a,fillOpacity:s=1,fallbackFill:l,baseStyleExtras:c,stroke:h,strokeWidth:d,opacity:m,effectiveSelectionHook:u,resolvedSelection:p,colorDatumAccessor:f,styleRules:g,ruleContext:v}=e,x=ne(()=>e=>{const o="function"==typeof c?c(e):c,h=o?{...o}:{};if(void 0===h.fillOpacity&&(h.fillOpacity=s),void 0===h.fill)if(t){if(n){const o=f?f(e):e;h.fill=L(o,t,n)}}else h.fill=l?l(e):i||b;return void 0===h.r&&(h.r=a?a(e):r),g&&g.length>0&&Object.assign(h,y(e,g,v?v(e):{value:void 0})),h},[t,n,i,r,a,s,l,c,f,g,v]),A=ne(()=>o(x,{stroke:h,strokeWidth:d,opacity:m}),[x,h,d,m]);return ne(()=>$(A,u??null,p),[A,u,p])}import{useCallback as re,useMemo as ae,useRef as se,useState as le}from"react";function ce(e){const{accessor:t,data:o,isPushMode:n}=e,i=se(null),[r,a]=le(0),s=re(e=>{if(!n||!t)return;let o=!1;for(const n of e){const e="function"==typeof t?t(n):n[t];if(null==e)continue;const r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(i.current?(i.current[0]>r&&(i.current[0]=r,o=!0),r>i.current[1]&&(i.current[1]=r,o=!0)):(i.current=[r,r],o=!0))}o&&a(e=>e+1)},[n,t]),l=re(()=>{n&&(i.current=null,a(e=>e+1))},[n]);return{domain:ae(()=>{if(n)return i.current??void 0;if(!t||0===o.length)return;const e="function"==typeof t?t:e=>e[t];let r=1/0,a=-1/0;for(const t of o){const o=e(t);if(null==o)continue;const n="number"==typeof o?o:Number(o);Number.isFinite(n)&&(r>n&&(r=n),n>a&&(a=n))}return Number.isFinite(r)&&Number.isFinite(a)?[r,a]:void 0},[o,t,n,r]),trackPushed:s,reset:l}}import{useEffect as he,useMemo as de,useRef as me,useState as ue}from"react";var pe="__forecastSegment",fe=null;async function ye(){return fe||(fe=await import("./chunk-statisticalOverlays-6MVAK5RW.module.min.js")),fe}var ge="__semiotic_resolvedX",be="__semiotic_resolvedY";function ve(e){const{data:t,xAccessor:o,yAccessor:n,forecast:i,anomaly:r,groupBy:a}=e,s="string"==typeof o?o:ge,l="string"==typeof n?n:be,c=de(()=>{if(!i&&!r)return t;const e="function"==typeof o,a="function"==typeof n;return e||a?t.map(t=>{const i={...t};return e&&(i[ge]=o(t)),a&&(i[be]=n(t)),i}):t},[t,i,r,o,n]),[h,d]=ue(null),[m,u]=ue([]),p=me(i),f=me(r);return he(()=>{if(!i&&!r)return void((p.current||f.current)&&(d(null),u([]),p.current=i,f.current=r));let e=!1;const t=i!==p.current||r!==f.current;if(p.current=i,f.current=r,t&&(d(null),u([])),i){const t=a&&"string"==typeof a&&"object"==typeof i?{...i,_groupBy:a}:i;(async function(...e){return(await ye()).buildForecast(...e)})(c,s,l,t,r).then(t=>{e||(d(t),u(t.annotations))}).catch(()=>{e||(d(null),u([]))})}else r&&async function(...e){return(await ye()).buildAnomalyAnnotations(...e)}(r).then(t=>{e||(d(null),u(t))}).catch(()=>{e||u([])});return()=>{e=!0}},[c,i,r,s,l,a]),{effectiveData:h?h.processedData:t,statisticalAnnotations:m,hasForecast:!!h,xAccessorKey:s,yAccessorKey:l}}import{jsx as xe}from"react/jsx-runtime";var Ae=te(function(o,n){const r=oe(null),s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:x="x",yAccessor:A="y",xScaleType:w,yScaleType:k,colorBy:S,colorScheme:L,styleRules:H,sizeBy:I,sizeRange:F=[3,15],symbolBy:_,symbolMap:N,pointRadius:W=5,pointOpacity:M=.8,tooltip:E,marginalGraphics:O,pointIdAccessor:T,annotations:G,regression:z,forecast:j,anomaly:$,xExtent:Q,yExtent:X,frameProps:q={},selection:J,linkedHover:te,linkedBrush:ne,onObservation:re,onClick:ae,hoverHighlight:se,chartId:le,loading:he,loadingContent:de,emptyContent:me,legendInteraction:ue,legendPosition:pe,color:fe,stroke:ye,strokeWidth:ge,opacity:be}=o,{width:Ae,height:we,enableHover:ke,showGrid:Se,showLegend:Ce,title:Le,description:He,summary:Ie,accessibleTable:Be,xLabel:Fe,yLabel:Re}=s,_e=Z(()=>C(h),[h]),Ne=void 0===h,{domain:Pe,trackPushed:We,reset:De}=ce({accessor:I,data:_e,isPushMode:Ne}),Me=ee(e=>{We([e]),r.current?.push(e)},[We]),Ee=ee(e=>{We(e),r.current?.pushMany(e)},[We]);a(n,{variant:"xy",frameRef:r,overrides:{push:Me,pushMany:Ee,clear:()=>{De(),r.current?.clear()}}});const Oe=i({data:_e,rawData:h,colorBy:S,colorScheme:L,legendInteraction:ue,legendPosition:pe,selection:J,linkedHover:te,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:re,onClick:ae,hoverHighlight:se,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"Scatterplot",chartId:le,showLegend:Ce,userMargin:y,marginDefaults:s.marginDefaults,loading:he,loadingContent:de,emptyContent:me,width:Ae,height:we}),Te=R(ne),Ge=P({name:Te?.name||"__unused_brush__",xField:Te?.xField||("string"==typeof x?x:void 0),yField:Te?.yField||("string"==typeof A?A:void 0)}),ze=Te?"xyBrush"===Ge.brushInteraction.brush?"xy":"xBrush"===Ge.brushInteraction.brush?"x":"y":void 0,je=U.useRef(Ge.brushInteraction);je.current=Ge.brushInteraction;const $e=ee(e=>{const t=je.current;t.end(e?"xyBrush"===t.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===t.brush?e.x:e.y:null)},[]);K("Scatterplot",_e,"xAccessor",x),K("Scatterplot",_e,"yAccessor",A);const Qe=Z(()=>I?Pe??[0,1]:void 0,[I,Pe]),Xe=Z(()=>I?e=>B(e,I,F,Qe):void 0,[I,F,Qe]),Ve=Z(()=>f(x,A),[x,A]),Ye=ie({colorBy:S,colorScale:Oe.colorScale,color:fe,pointRadius:W,fillOpacity:M,radiusFn:Xe,stroke:ye,strokeWidth:ge,opacity:be,styleRules:H,ruleContext:Ve,effectiveSelectionHook:Oe.effectiveSelectionHook,resolvedSelection:Oe.resolvedSelection}),qe=Z(()=>u([{label:Fe||c(x),accessor:x,role:"x",format:b},{label:Re||c(A),accessor:A,role:"y",format:v},...S?[{label:c(S),accessor:S,role:"color"}]:[],...I?[{label:c(I),accessor:I,role:"size"}]:[]]),[x,A,Fe,Re,S,I,b,v]),{effectiveData:Je,statisticalAnnotations:Ke}=ve({data:_e,xAccessor:x,yAccessor:A,forecast:j,anomaly:$}),Ue=Z(()=>{const t=e(z);return t||0!==Ke.length?[...t?[t]:[],...G||[],...Ke]:G},[z,G,Ke]);if(Oe.earlyReturn)return Oe.earlyReturn;const Ze=t({componentName:"Scatterplot",data:h,accessors:{xAccessor:x,yAccessor:A}});if(Ze)return xe(V,{componentName:"Scatterplot",message:Ze,width:Ae,height:we});const et={chartType:"scatter",...null!=h&&{data:Je},xAccessor:x,yAccessor:A,xScaleType:w,yScaleType:k,colorAccessor:S||void 0,sizeAccessor:I||void 0,..._&&{symbolAccessor:_},...N&&{symbolMap:N},sizeRange:F,pointStyle:Ye,colorScheme:L,size:[Ae,we],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:Oe.margin,showAxes:s.showAxes,xLabel:Fe,yLabel:Re,xFormat:b,yFormat:v,enableHover:ke,showGrid:Se,...Oe.legendBehaviorProps,...d({title:Le,description:He,summary:Ie,accessibleTable:Be,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:E,defaultTooltipContent:qe}),...m({linkedHover:te,selection:J,onObservation:re,onClick:ae,hoverHighlight:se,mobileInteraction:Oe.mobileInteraction,customHoverBehavior:Oe.customHoverBehavior,customClickBehavior:Oe.customClickBehavior}),...O&&{marginalGraphics:O},...T&&{pointIdAccessor:T},...Ue&&Ue.length>0&&{annotations:Ue},...Q&&{xExtent:Q},...X&&{yExtent:X},...Te&&{brush:{dimension:ze},onBrush:$e},...Oe.crosshairProps,...q};return xe(Y,{componentName:"Scatterplot",width:Ae,height:we,children:xe(l,{ref:r,...et})})});Ae.displayName="Scatterplot";import{useMemo as we,forwardRef as ke,useRef as Se}from"react";import{Fragment as Ce,jsx as Le}from"react/jsx-runtime";function He(e,t){return F(1===t?.5:e/(t-1))}var Ie=ke(function(o,n){const r=Se(null);a(n,{variant:"xy",frameRef:r});const s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:A="x",yAccessor:w="y",orderAccessor:k,orderLabel:S,styleRules:C,pointRadius:L=4,tooltip:H,pointIdAccessor:I,annotations:B,regression:F,forecast:R,anomaly:_,xExtent:N,yExtent:P,frameProps:W={},selection:M,linkedHover:E,onObservation:O,onClick:T,hoverHighlight:G,chartId:z,loading:j,loadingContent:$,emptyContent:Q,legendInteraction:X,stroke:q,strokeWidth:J,opacity:U}=o,{width:Z,height:ee,enableHover:te,showGrid:oe,title:ne,description:re,summary:ae,accessibleTable:se,xLabel:le,yLabel:ce}=s,{safeData:he,orderMap:de}=we(()=>{const e=h||[],t="function"==typeof A?A:e=>e[A],o="function"==typeof w?w:e=>e[w];let n=e;if(k&&e.length>0){const t="function"==typeof k?k:e=>e[k];n=[...e].sort((e,o)=>{const n=t(e),i=t(o);return(n instanceof Date?n.getTime():+n)-(i instanceof Date?i.getTime():+i)})}const i=new WeakMap;let r=0;for(const e of n){const n=t(e),i=o(e);null!=n&&null!=i&&isFinite(n)&&isFinite(i)&&r++}let a=0;for(const e of n){const n=t(e),s=o(e);null!=n&&null!=s&&isFinite(n)&&isFinite(s)&&i.set(e,{idx:a++,total:r})}return{safeData:n,orderMap:i}},[h,k,A,w]);K("ConnectedScatterplot",he,"xAccessor",A),K("ConnectedScatterplot",he,"yAccessor",w);const me=i({data:he,rawData:h,colorBy:void 0,colorScheme:void 0,legendInteraction:X,selection:M,linkedHover:E,fallbackFields:[],unwrapData:!1,onObservation:O,onClick:T,hoverHighlight:G,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"ConnectedScatterplot",chartId:z,showLegend:void 0,userMargin:y,marginDefaults:s.marginDefaults,loading:j,loadingContent:$,emptyContent:Q,width:Z,height:ee}),ue=me.resolvedSelection?.unselectedOpacity??x,pe=we(()=>(e,t)=>{const o=t.filter(e=>"point"===e.type);if(2>o.length)return;const n=me.effectiveSelectionHook?.isActive,i=me.effectiveSelectionHook?.predicate,r=100>o.length,a=o.length;e.lineCap="round";for(let t=0;a-1>t;t++){const s=o[t],l=o[t+1],c=He(t,a),h=!n||!i||i(s.datum??s)||i(l.datum??l),d=n?h?1:ue:1;r&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=L+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=L,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[L,me.effectiveSelectionHook,ue]),fe=we(()=>[pe],[pe]),ye=we(()=>(e,t,o)=>{const n=e.filter(e=>"point"===e.type);if(2>n.length)return null;const i=n.length,r=100>i,a=[];for(let e=0;i-1>e;e++){const t=n[e],o=n[e+1],s=He(e,i),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof o.style?.opacity?o.style.opacity:1);r&&a.push(Le("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:L+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),a.push(Le("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:s,strokeWidth:L,strokeLinecap:"round",opacity:l},"seg-"+e))}return Le(Ce,{children:a})},[L]),ge=we(()=>[ye],[ye]),be=ie({colorScale:void 0,baseStyleExtras:we(()=>e=>{const t=de.get(e),o=t?.idx??0,n=t?.total??1;return{fill:n>0?He(o,n):"#6366f1",stroke:"white",strokeWidth:1,r:L,fillOpacity:1}},[L,de]),stroke:q,strokeWidth:J,opacity:U,styleRules:C,ruleContext:we(()=>f(A,w),[A,w]),effectiveSelectionHook:me.effectiveSelectionHook,resolvedSelection:me.resolvedSelection}),xe=S||("string"==typeof k?k:"Order"),Ae=we(()=>u([{label:le||c(A),accessor:A,role:"x",format:b},{label:ce||c(w),accessor:w,role:"y",format:v},...k?[{label:xe,accessor:k,role:"group"}]:[]]),[A,w,le,ce,k,xe,b,v]),ke=t({componentName:"ConnectedScatterplot",data:h,accessors:{xAccessor:A,yAccessor:w}}),{effectiveData:Ie,statisticalAnnotations:Be}=ve({data:he,xAccessor:A,yAccessor:w,forecast:R,anomaly:_});if(me.earlyReturn)return me.earlyReturn;const Fe=e(F),Re=Fe||Be.length>0?[...Fe?[Fe]:[],...B||[],...Be]:B,_e={chartType:"scatter",...null!=h&&{data:Ie},xAccessor:A,yAccessor:w,pointStyle:be,size:[Z,ee],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:me.margin,showAxes:s.showAxes,xLabel:le,yLabel:ce,xFormat:b,yFormat:v,enableHover:te,showGrid:oe,...d({title:ne,description:re,summary:ae,accessibleTable:se,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:H,defaultTooltipContent:Ae}),...m({linkedHover:E,selection:M,onObservation:O,onClick:T,hoverHighlight:G,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior}),...I&&{pointIdAccessor:I},canvasPreRenderers:fe,svgPreRenderers:ge,...Re&&Re.length>0&&{annotations:Re},...N&&{xExtent:N},...P&&{yExtent:P},...me.crosshairProps,...W};return ke?Le(V,{componentName:"ConnectedScatterplot",message:ke,width:Z,height:ee}):Le(Y,{componentName:"ConnectedScatterplot",width:Z,height:ee,children:Le(l,{ref:r,..._e})})});Ie.displayName="ConnectedScatterplot";import{useMemo as Be,useCallback as Fe,useState as Re,useEffect as _e,forwardRef as Ne,useRef as Pe}from"react";import{useMemo as We}from"react";function De(e){const{lineWidth:t=2,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:m,resolvedSelection:u,styleRules:p,ruleContext:f}=e,g=We(()=>function(e){const{lineWidth:t=2,colorBy:o,colorScale:n,color:i,resolveStroke:r,fillArea:a,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,h)=>{const d={strokeWidth:t},m=!0===a||Array.isArray(a)&&null!=h&&a.includes(h);let u;return r?u=r(e,h):o?n&&(u=L(e,o,n)):u=i||b,void 0!==u&&(d.stroke=u,m&&(d.fill=u,d.fillOpacity=s)),l?.length&&Object.assign(d,y(e,l,c?c(e,h):{value:void 0,category:h})),d}}({lineWidth:t,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l,styleRules:p,ruleContext:f}),[t,n,i,r,a,s,l,p,f]),v=We(()=>o(g,{stroke:c,strokeWidth:h,opacity:d}),[g,c,h,d]);return We(()=>$(v,m??null,u),[v,m,u])}import{jsx as Me}from"react/jsx-runtime";var Ee="__lineObjectSeries",Oe=Ne(function(e,o){const n=Pe(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:d,className:p,xFormat:y,yFormat:g,axisExtent:v,xAccessor:x="x",yAccessor:A="y",lineBy:S,lineDataAccessor:H="coordinates",colorBy:I,colorScheme:B,styleRules:F,curve:R="linear",showPoints:N=!1,pointRadius:P=3,fillArea:W=!1,areaOpacity:M=.3,lineWidth:E=2,lineGradient:O,tooltip:T,pointIdAccessor:G,annotations:z,directLabel:j,gapStrategy:$="break",anomaly:Q,forecast:X,band:q,xExtent:J,yExtent:U,frameProps:Z={},selection:ee,linkedHover:te,onObservation:oe,onClick:ne,hoverHighlight:ie,hoverRadius:re,chartId:ae,loading:se,loadingContent:le,emptyContent:ce,legendInteraction:he,legendPosition:de,legend:me,xScaleType:ue,yScaleType:fe,color:ge,stroke:be,strokeWidth:xe,opacity:Ae}=e,{legend:we,...ke}=Z,Se=Be(()=>k(we,me),[we,me]),{width:Ce,height:Le,enableHover:He,showGrid:Ie,showLegend:Ne,title:We,description:Oe,summary:Te,accessibleTable:Ge,xLabel:ze,yLabel:je}=r,$e=Be(()=>C(s),[s]),Qe=Array.isArray($e[0]?.[H])?$e[0][H]:$e;K("LineChart",Qe,"xAccessor",x),K("LineChart",Qe,"yAccessor",A);const{effectiveData:Xe,statisticalAnnotations:Ve}=ve({data:$e,xAccessor:x,yAccessor:A,forecast:X,anomaly:Q,groupBy:S}),Ye="__compoundGroup",qe=!(!X||!S),Je=qe?Ye:X?pe:S,Ke=Be(()=>{if(!qe)return Xe;const e="function"==typeof S?S:e=>e[S];return Xe.map(t=>{const o={...t};return o[Ye]=`${e(t)}__${t[pe]||"observed"}`,o})},[Xe,qe,S]),Ue=qe?Ke:Xe,Ze=I||S,et=Be(()=>{if(!X)return;const e=X.upperBounds,t=X.lowerBounds;if(!e&&!t)return;const o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,n="function"==typeof t?t:"string"==typeof t?e=>e[t]:null;let i=1/0,r=-1/0;const a=Xe;for(const e of a){const t="function"==typeof A?A(e):+e[A];if(isFinite(t)&&(i>t&&(i=t),t>r&&(r=t)),o){const t=o(e);null!=t&&isFinite(t)&&(t>r&&(r=t),i>t&&(i=t))}if(n){const t=n(e);null!=t&&isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}}return isFinite(i)&&isFinite(r)?[i,r]:void 0},[X,Xe,A]),tt=Fe(e=>{const t="function"==typeof x?x(e):e[x],o="function"==typeof A?A(e):e[A];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[x,A]),ot=void 0!==Ue[0]?.[H],nt=ot?Ee:Je,it=Be(()=>{if(ot)return Ue.map((e,t)=>{const o="function"==typeof S?S(e):"string"==typeof S?e[S]:void 0,n=null==o?"line-"+t:o+"",i=Array.isArray(e[H])?e[H]:[];return{...e,[Ee]:n,[H]:i.map(t=>({...t,[Ee]:n,parentLine:e,..."string"==typeof S&&void 0!==e[S]?{[S]:e[S]}:{}}))}});if(Je){const e=Ue.reduce((e,t)=>{const o="function"==typeof Je?Je(t):t[Je];if(!e[o]){const n={[H]:[]};"string"==typeof Je&&(n[Je]=o),qe&&(n[pe]=t[pe],"string"==typeof S&&(n[S]=t[S])),e[o]=n}return e[o][H].push(t),e},{});return Object.values(e)}return[{[H]:Ue}]},[ot,Je,H,Ue,S,qe]),{gapProcessedLineData:rt,hasGaps:at}=Be(()=>{if("interpolate"===$){let e=!1;const t=[];for(const o of it){const n=(o[H]||[]).filter(t=>!tt(t)||(e=!0,!1));n.length>0&&t.push({...o,[H]:n})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===$){let e=!1;const t=[];for(const o of it){const n=o[H]||[];let i=[],r=0;const a=nt&&"string"==typeof nt?o[nt]:void 0;for(const s of n)if(tt(s))e=!0,i.length>0&&(t.push({...o,[H]:i}),i=[],r++);else{const e=null!=a?`${a}__seg${r}`:"__seg"+r;i.push({...s,_gapSegment:e})}i.length>0&&t.push({...o,[H]:i})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===$){let e=!1;const t="string"==typeof A?A:"y",o=[];for(const n of it){const i=n[H]||[],r=[];for(const o of i)tt(o)?(e=!0,r.push({...o,[t]:0})):r.push(o);o.push({...n,[H]:r})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:it,hasGaps:!1}},[it,$,H,tt,nt,A]),st="object"==typeof j?j:{},lt=st.position||"end",ct=st.fontSize||11,ht=Be(()=>{if(!j||!Ze)return[];const e="function"==typeof Ze?Ze:e=>e[Ze],t=new Set;for(const o of rt){const n=o[H]||[];if(0===n.length)continue;const i=e("end"===lt?n[n.length-1]:n[0])??e(o);if(null==i)continue;const r=i+"";""!==r&&t.add(r)}return Array.from(t)},[j,Ze,rt,H,lt]),dt=Be(()=>{if(!j)return r.marginDefaults;const e=ht.reduce((e,t)=>Math.max(e,t.length*(.6*ct)),0)+10,t="end"===lt?"right":"left";return{...r.marginDefaults,[t]:Math.max(r.marginDefaults[t]||0,e)}},[j,ht,ct,lt,r.marginDefaults]),mt=i({data:Xe,rawData:s,colorBy:Ze,colorScheme:B,legendInteraction:he,legendPosition:de,selection:ee,linkedHover:te,fallbackFields:Ze?["string"==typeof Ze?Ze:""]:[],unwrapData:!1,onObservation:oe,onClick:ne,hoverHighlight:ie,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"LineChart",chartId:ae,showLegend:(!j||void 0!==Ne)&&Ne,legend:Se,userMargin:d,marginDefaults:dt,loading:se,loadingContent:le,emptyContent:ce,width:Ce,height:Le}),ut=mt.colorScale,pt=mt.effectiveSelectionHook,ft=mt.resolvedSelection,yt=mt.customHoverBehavior,gt=mt.customClickBehavior,bt=mt.crosshairProps,vt=Be(()=>{if(Ze)return ot?e=>{const t=e.parentLine||e;return"function"==typeof Ze?Ze(t):t[Ze]}:Ze},[Ze,ot]),xt=Be(()=>f(x,A),[x,A]),At=De({lineWidth:E,colorBy:vt,colorScale:ut,color:ge,fillArea:W,areaOpacity:M,stroke:be,strokeWidth:xe,opacity:Ae,effectiveSelectionHook:pt,resolvedSelection:ft,styleRules:F,ruleContext:xt}),[wt,kt]=Re(null);_e(()=>{if(!X)return void kt(null);let e=!1;return async function(...e){return(await ye()).createSegmentLineStyle(...e)}(At,X).then(t=>{e||kt(()=>t)}).catch(()=>{e||kt(null)}),()=>{e=!0}},[At,X]);const St=wt||At,Ct=Be(()=>{if(N)return e=>{const t={r:P,fillOpacity:1};return Ze?ut&&(t.fill=L(e.parentLine||e,Ze,ut)):t.fill=ge||b,t}},[N,P,Ze,ut,ge]),Lt=Array.isArray(W)?"mixed":W?"area":"line",Ht=Be(()=>{if(!j||!Ze)return[];const e="function"==typeof x?x:e=>e[x],t="function"==typeof A?A:e=>e[A],o="function"==typeof Ze?Ze:e=>e[Ze],n=new Map;for(const e of rt){const t=e[H]||[];if(0===t.length)continue;const i="end"===lt?t[t.length-1]:t[0],r=o(i)??o(e);if(null==r)continue;const a=r+"";""===a||n.has(a)||n.set(a,i)}const i=Array.from(n.entries()).map(([o,n])=>({type:"text",label:o,["string"==typeof x?x:"x"]:e(n),["string"==typeof A?A:"y"]:t(n),dx:"end"===lt?6:-6,dy:0,color:ut?ut(o):b,fontSize:ct}));i.sort((e,t)=>{const o="string"==typeof A?A:"y";return e[o]-t[o]});for(let e=1;i.length>e;e++){const t="string"==typeof A?A:"y",o=i[e-1],n=i[e];ct+2>Math.abs(n[t]+n.dy-(o[t]+o.dy))&&(n.dy+=ct+2)}return i},[j,Ze,ut,rt,H,x,A,lt,ct]),It=mt.margin,Bt=S||I,Ft=Be(()=>u([{label:ze||c(x),accessor:x,role:"x",format:y},{label:je||c(A),accessor:A,role:"y",format:g},...Bt?[{label:c(Bt),accessor:Bt,role:"group"}]:[],...h(q,g)]),[x,A,ze,je,Bt,y,g,q]),Rt=t({componentName:"LineChart",data:ot?Xe[0]?.[H]||[]:s,accessors:{xAccessor:x,yAccessor:A}}),_t=Be(()=>ot||nt||at?rt.flatMap(e=>{const t=e[H]||[];return nt&&"string"==typeof nt?t.map(t=>({...t,[nt]:t[nt]??e[nt]})):t}):Ue,[rt,H,ot,nt,Ue,at]),Nt={chartType:Lt,...Array.isArray(W)&&{areaGroups:W},...O&&{lineGradient:O},...null!=s&&{data:_t},xAccessor:x,yAccessor:A,xScaleType:ue,yScaleType:fe,...J&&{xExtent:J},...!U||null==U[0]&&null==U[1]?et?{yExtent:et}:{}:{yExtent:U},groupAccessor:"break"===$&&at?"_gapSegment":nt||void 0,...q&&{band:q},curve:R,lineStyle:St,...N&&{pointStyle:Ct},size:[Ce,Le],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:It,showAxes:r.showAxes,xLabel:ze,yLabel:je,xFormat:y,yFormat:g,...void 0!==v&&{axisExtent:v},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:He,showGrid:Ie,...mt.legendBehaviorProps,...We&&{title:We},...Oe&&{description:Oe},...Te&&{summary:Te},...void 0!==Ge&&{accessibleTable:Ge},...p&&{className:p},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===T?()=>null:"multi"===T?w():_(T)||Ft,..."multi"===T&&{tooltipMode:"multi"},...m({linkedHover:te,selection:ee,onObservation:oe,onClick:ne,hoverRadius:re,hoverHighlight:ie,mobileInteraction:mt.mobileInteraction,customHoverBehavior:yt,customClickBehavior:gt}),...G&&{pointIdAccessor:G},...(z?.length||Ve.length||Ht.length)&&{annotations:[...z||[],...Ve,...Ht]},...bt,...ke};return mt.earlyReturn?mt.earlyReturn:Rt?Me(V,{componentName:"LineChart",message:Rt,width:Ce,height:Le}):Me(Y,{componentName:"LineChart",width:Ce,height:Le,children:Me(l,{ref:n,...Nt})})});Oe.displayName="LineChart";import{useMemo as Te,forwardRef as Ge,useRef as ze}from"react";import{useMemo as je}from"react";function $e(e){const{safeData:t,data:n,areaBy:i,lineDataAccessor:r,colorBy:a,colorScale:s,color:l,stroke:d,strokeWidth:m,opacity:p,effectiveSelectionHook:f,resolvedSelection:g,areaOpacity:v,showLine:x,lineWidth:A,showPoints:w,pointRadius:k,xAccessor:S,yAccessor:C,xLabel:H,yLabel:I,xFormat:B,yFormat:F,groupField:R,styleRules:_,ruleContext:N}=e,P=je(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:n}){if(null==e)return[];const i=void 0!==t[0]?.[n];if(!i&&!o)return t;let r;if(i)r=t;else{const e=t.reduce((e,t)=>{const i="function"==typeof o?o(t):t[o],r=i+"";if(!e[r]){const t={[n]:[]};"string"==typeof o&&(t[o]=i),e[r]=t}return e[r][n].push(t),e},{});r=Object.values(e)}return r.flatMap(e=>{const t=Array.isArray(e[n])?e[n]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}({data:n,safeData:t,areaBy:i,lineDataAccessor:r}),[n,t,i,r]),W=je(()=>e=>{const t={};if(a){if(s){const o=L(e,a,s);t.fill=o,x?(t.stroke=o,t.strokeWidth=A):t.stroke="none"}}else{const e=l||b;t.fill=e,x?(t.stroke=e,t.strokeWidth=A):t.stroke="none"}return t.fillOpacity=v,_&&_.length>0&&Object.assign(t,y(e,_,N?N(e):{value:void 0})),t},[a,s,l,v,x,A,_,N]),D=je(()=>o(W,{stroke:d,strokeWidth:m,opacity:p}),[W,d,m,p]);return{flattenedData:P,lineStyle:je(()=>$(D,f??null,g),[D,f,g]),pointStyle:je(()=>{if(w)return e=>{const t={r:k,fillOpacity:1};return a?s&&(t.fill=L(e.parentLine||e,a,s)):t.fill=l||b,t}},[w,k,a,s,l]),defaultTooltipContent:je(()=>u([{label:H||c(S),accessor:S,role:"x",format:B},{label:I||c(C),accessor:C,role:"y",format:F},...R?[{label:c(R),accessor:R,role:"group"}]:[],...h(e.band,F)]),[S,C,H,I,R,B,F,e.band])}}import{jsx as Qe}from"react/jsx-runtime";function Xe(e,t){if(null==t)return e;const o=e.trim(),n=o.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(n){const e=n[1],o=3===e.length?e.split("").map(e=>e+e).join(""):e;return`rgba(${parseInt(o.slice(0,2),16)}, ${parseInt(o.slice(2,4),16)}, ${parseInt(o.slice(4,6),16)}, ${t})`}if(o.startsWith("rgba(")){const e=o.lastIndexOf(","),n=o.lastIndexOf(")");if(-1!==e&&n>e)return`${o.slice(0,e+1)} ${t})`}return o.startsWith("rgb(")?o.replace(/^rgb\(/,"rgba(").replace(/\)$/,`, ${t})`):e}var Ve=Ge(function(e,o){const n=ze(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:u,yFormat:y,xAccessor:g="x",yAccessor:b="y",areaBy:v,y0Accessor:x,gradientFill:A=!1,semanticGradient:k,lineDataAccessor:S="coordinates",colorBy:L,colorScheme:H,styleRules:I,curve:B="monotoneX",areaOpacity:F=.7,lineGradient:R,showLine:_=!0,lineWidth:N=2,showPoints:P=!1,pointRadius:W=3,tooltip:M,annotations:E,forecast:O,anomaly:T,band:G,xExtent:z,yExtent:j,frameProps:$={},selection:Q,linkedHover:X,onObservation:q,onClick:J,hoverHighlight:U,chartId:Z,loading:ee,loadingContent:te,emptyContent:oe,legendInteraction:ne,legendPosition:ie,color:re,stroke:ae,strokeWidth:se,opacity:le}=e,{width:ce,height:he,enableHover:de,showGrid:me,showLegend:ue,title:pe,description:fe,summary:ye,accessibleTable:ge,xLabel:be,yLabel:xe}=r,Ae=Te(()=>C(s),[s]),we=L||v,ke=Te(()=>{return k&&k.length>0?{colorStops:(e=k,e.filter(e=>Number.isFinite(e.at)).map(e=>({offset:1-Math.max(0,Math.min(100,e.at))/100,color:Xe(e.color,e.opacity)})).sort((e,t)=>e.offset-t.offset))}:A;var e},[k,A]);K("AreaChart",Ae,"xAccessor",g),K("AreaChart",Ae,"yAccessor",b);const Se=i({data:Ae,rawData:s,colorBy:we,colorScheme:H,legendInteraction:ne,legendPosition:ie,selection:Q,linkedHover:X,fallbackFields:we?["string"==typeof we?we:""]:[],unwrapData:!1,onObservation:q,onClick:J,hoverHighlight:U,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"AreaChart",chartId:Z,showLegend:ue,userMargin:c,marginDefaults:r.marginDefaults,loading:ee,loadingContent:te,emptyContent:oe,width:ce,height:he}),{effectiveData:Ce,statisticalAnnotations:Le}=ve({data:Ae,xAccessor:g,yAccessor:b,forecast:O,anomaly:T,groupBy:v}),He=Te(()=>f(g,b),[g,b]),{flattenedData:Ie,lineStyle:Be,pointStyle:Fe,defaultTooltipContent:Re}=$e({safeData:Ce,data:s,areaBy:v,lineDataAccessor:S,colorBy:we,colorScale:Se.colorScale,color:re,stroke:ae,strokeWidth:se,opacity:le,effectiveSelectionHook:Se.effectiveSelectionHook,resolvedSelection:Se.resolvedSelection,areaOpacity:F,showLine:_,lineWidth:N,showPoints:P,pointRadius:W,xAccessor:g,yAccessor:b,xLabel:be,yLabel:xe,xFormat:u,yFormat:y,groupField:v||L,band:G,styleRules:I,ruleContext:He}),_e=t({componentName:"AreaChart",data:s,accessors:{xAccessor:g,yAccessor:b}}),Ne={chartType:"area",...null!=s&&{data:Ie},xAccessor:g,yAccessor:b,groupAccessor:v||void 0,...x&&{y0Accessor:x},...G&&{band:G},...ke&&{gradientFill:ke},...R&&{lineGradient:R},curve:B,lineStyle:Be,...P&&Fe&&{pointStyle:Fe},size:[ce,he],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Se.margin,showAxes:r.showAxes,xLabel:be,yLabel:xe,xFormat:u,yFormat:y,enableHover:de,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:me,...Se.legendBehaviorProps,...d({title:pe,description:fe,summary:ye,accessibleTable:ge,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===M?{tooltipContent:w(),tooltipMode:"multi"}:p({tooltip:M,defaultTooltipContent:Re}),...m({linkedHover:X,selection:Q,onObservation:q,onClick:J,hoverHighlight:U,mobileInteraction:Se.mobileInteraction,customHoverBehavior:Se.customHoverBehavior,customClickBehavior:Se.customClickBehavior}),...(E&&E.length>0||Le.length>0)&&{annotations:[...E||[],...Le]},...z&&{xExtent:z},...j&&{yExtent:j},...Se.crosshairProps,...$};return Se.earlyReturn?Se.earlyReturn:_e?Qe(V,{componentName:"AreaChart",message:_e,width:ce,height:he}):Qe(Y,{componentName:"AreaChart",width:ce,height:he,children:Qe(l,{ref:n,...Ne})})});Ve.displayName="AreaChart";import{useMemo as Ye,forwardRef as qe,useRef as Je,useState as Ke,useImperativeHandle as Ue,useCallback as Ze}from"react";import{jsx as et,jsxs as tt}from"react/jsx-runtime";function ot(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;const t=+e;return Number.isFinite(t)?t:NaN}return NaN}var nt=qe(function(e,t){const o=Je(null),n=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:s,xFormat:c,yFormat:h,xAccessor:u="x",seriesAAccessor:p="a",seriesBAccessor:f="b",seriesALabel:y="A",seriesBLabel:g="B",seriesAColor:b="var(--semiotic-danger, #dc2626)",seriesBColor:v="var(--semiotic-info, #2563eb)",showLines:x=!0,lineWidth:A=1.5,showPoints:w=!1,pointRadius:k=3,curve:L="linear",areaOpacity:H=.6,gradientFill:I,tooltip:B,annotations:F,xExtent:R,yExtent:N,frameProps:P={},selection:W,linkedHover:M,onObservation:E,onClick:O,hoverHighlight:T,chartId:G,loading:z,loadingContent:j,emptyContent:$,legendInteraction:Q,legendPosition:X,pointIdAccessor:V,windowSize:q}=e,{width:J,height:K,enableHover:U,showGrid:Z,showLegend:ee,title:te,description:oe,summary:ne,accessibleTable:ie,xLabel:re,yLabel:ae}=n,se=Ye(()=>"function"==typeof u?e=>ot(u(e)):e=>ot(e[u]),[u]),le=Ye(()=>"function"==typeof p?e=>ot(p(e)):e=>ot(e[p]),[p]),ce=Ye(()=>"function"==typeof f?e=>ot(f(e)):e=>ot(e[f]),[f]),[he,de]=Ke([]),me=Je([]),ue=null==r,pe=Ye(()=>C(ue?he:r),[ue,he,r]),fe=Ye(()=>function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];let a=0,s=null,l=null,c=[];const h=(e,t)=>e>t?"A":t>e?"B":null,d=e=>`seg-${a}-${e}`,m=e=>r.push(e),u=(e,t)=>{m({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:d(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;i.length>e;e++){const r=i[e],p=t(r),f=o(r),y=n(r);if(!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(y))continue;const g=h(f,y);if(null!==g)if(null!=s){if(l&&l.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{const o=f-l.a-(y-l.b);if(0!==o){const n=Math.max(0,Math.min(1,(l.b-l.a)/o));e=l.x+n*(p-l.x),t=l.a+n*(f-l.a)}else e=l.x,t=l.a}m({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t}),a++,s=g,m({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t});for(let e=1;c.length>e;e++)u(c[e],s)}else for(const e of c)u(e,s);c=[],m({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:d(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:r}),l={x:p,a:f,b:y,w:g}}else{s=g;for(const e of c)u(e,s);c=[],m({__x:p,__y:y>f?y:f,__y0:y>f?f:y,__diffSegment:d(s),__diffWinner:s,__valA:f,__valB:y,__sourceDatum:r}),l={x:p,a:f,b:y,w:g}}else c.push({x:p,y:f,datum:r})}for(const e of c)u(e,s??"A");return r}(pe,se,le,ce),[pe,se,le,ce]),ye=Ye(()=>x?function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(const e of i){const i=t(e),a=o(e),s=n(e);Number.isFinite(a)&&r.push({__x:i,__y:a,__diffSegment:"line-A"}),Number.isFinite(s)&&r.push({__x:i,__y:s,__diffSegment:"line-B"})}return r}(pe,se,le,ce):[],[x,pe,se,le,ce]),ge=Ye(()=>[...fe,...ye],[fe,ye]),be=Ye(()=>{const e=new Set;for(const t of fe)e.add(t.__diffSegment);return Array.from(e)},[fe]);Ue(t,()=>{const e=e=>{const t=q&&e.length>q?e.slice(e.length-q):e;me.current=t,de(t)},t=V?"function"==typeof V?V:e=>e[V]:null;return{push:t=>e([...me.current,t]),pushMany:t=>e([...me.current,...t]),remove:o=>{if(!t)return[];const n=Array.isArray(o)?o:[o],i=[],r=[];for(const e of me.current)n.includes(t(e))?i.push(e):r.push(e);return e(r),i},update:(o,n)=>{if(!t)return[];const i=Array.isArray(o)?o:[o],r=[],a=me.current.map(e=>{if(i.includes(t(e))){const t=n(e);return r.push(t),t}return e});return e(a),r},clear:()=>e([]),getData:()=>ue?me.current:pe,getScales:()=>o.current?.getScales()??null}},[ue,pe,V,q]);const ve=i({data:pe,rawData:r,colorBy:"__diffWinner",colorScheme:[b,v],legendInteraction:Q,legendPosition:X,selection:W,linkedHover:M,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:E,onClick:O,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DifferenceChart",chartId:G,showLegend:ee,userMargin:a,marginDefaults:n.marginDefaults,loading:z,loadingContent:j,emptyContent:$,width:J,height:K}),xe=Ye(()=>{if(!1!==ee)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:y,color:b},{label:g,color:v}]}]}},[ee,y,g,b,v]),Ae=Ze(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?b:v,stroke:"none",fillOpacity:H}},[b,v,H]),we=Ze(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,strokeWidth:A,fill:"none"}),[b,v,A]),ke=Ze(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?b:v,r:k}),[b,v,k]),Se=Ze(e=>{const t=e.data,o=e.allSeries,n=e.xValue??t?.__x;let i=t?.__valA,r=t?.__valB;if(o&&o.length>0){const e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(i=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=n&&(null==i||null==r)){const e=pe.find(e=>se(e)===n);e&&(null==i&&(i=le(e)),null==r&&(r=ce(e)))}const a=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=c&&null!=n?c(n):null!=n?n+"":"";return tt("div",{className:"semiotic-tooltip",style:S,children:[s&&et("div",{style:{fontWeight:600,marginBottom:4},children:s}),tt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[et("span",{style:{width:10,height:10,background:b,display:"inline-block",borderRadius:2}}),tt("span",{children:[y,": ",a(i)]})]}),tt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[et("span",{style:{width:10,height:10,background:v,display:"inline-block",borderRadius:2}}),tt("span",{children:[g,": ",a(r)]})]}),null!=i&&null!=r&&Number.isFinite(i)&&Number.isFinite(r)&&tt("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",a(i-r)]})]})},[pe,se,le,ce,c,b,v,y,g]),Ce="multi"===B,Le=Ye(()=>!1===B?()=>null:Ce?Se:_(B)||Se,[B,Ce,Se]);if(ve.earlyReturn)return ve.earlyReturn;const He={chartType:"mixed",data:ge,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:be,curve:L,areaStyle:Ae,lineStyle:we,...w&&{pointStyle:ke},size:[J,K],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve.margin,showAxes:n.showAxes,xLabel:re,yLabel:ae,xFormat:c,yFormat:h,enableHover:U,showGrid:Z,...I&&{gradientFill:!0===I?{topOpacity:.85,bottomOpacity:.15}:I},...xe&&{legend:xe,legendPosition:ve.legendPosition},...d({title:te,description:oe,summary:ne,accessibleTable:ie,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Le,...Ce&&{tooltipMode:"multi"},...m({linkedHover:M,selection:W,onObservation:E,onClick:O,hoverHighlight:T,mobileInteraction:ve.mobileInteraction,customHoverBehavior:ve.customHoverBehavior,customClickBehavior:ve.customClickBehavior}),...F&&F.length>0&&{annotations:F},...R&&{xExtent:R},...N&&{yExtent:N},...ve.crosshairProps,...P};return et(Y,{componentName:"DifferenceChart",width:J,height:K,children:et(l,{ref:o,...He})})});"function"==typeof nt&&(nt.displayName="DifferenceChart");import{useMemo as it,forwardRef as rt,useRef as at}from"react";import{jsx as st}from"react/jsx-runtime";var lt=rt(function(e,o){const n=at(null),r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:u,yFormat:y,xAccessor:g="x",yAccessor:b="y",areaBy:v,lineDataAccessor:x="coordinates",colorBy:A,colorScheme:k,styleRules:S,curve:L="monotoneX",areaOpacity:H=.7,showLine:I=!0,lineWidth:B=2,showPoints:F=!1,pointRadius:R=3,normalize:_=!1,baseline:N="zero",stackOrder:P,tooltip:W,annotations:M,xExtent:E,yExtent:O,frameProps:T={},selection:G,linkedHover:z,onObservation:j,onClick:$,hoverHighlight:Q,chartId:X,loading:q,loadingContent:J,emptyContent:K,legendInteraction:U,legendPosition:Z,color:ee,stroke:te,strokeWidth:oe,opacity:ne}=e,{width:ie,height:re,enableHover:ae,showGrid:se,showLegend:le,title:ce,description:he,summary:de,accessibleTable:me,xLabel:ue,yLabel:pe}=r,fe=it(()=>C(s),[s]),ye=A||v;a(o,{variant:"xy",frameRef:n});const ge=i({data:fe,rawData:s,colorBy:ye,colorScheme:k,legendInteraction:U,legendPosition:Z,selection:G,linkedHover:z,fallbackFields:ye?["string"==typeof ye?ye:""]:[],unwrapData:!1,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"StackedAreaChart",chartId:X,showLegend:le,userMargin:c,marginDefaults:r.marginDefaults,loading:q,loadingContent:J,emptyContent:K,width:ie,height:re}),be=it(()=>f(g,b),[g,b]),{flattenedData:ve,lineStyle:xe,pointStyle:Ae,defaultTooltipContent:we}=$e({safeData:fe,data:s,areaBy:v,lineDataAccessor:x,colorBy:ye,colorScale:ge.colorScale,color:ee,stroke:te,strokeWidth:oe,opacity:ne,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection,areaOpacity:H,showLine:I,lineWidth:B,showPoints:F,pointRadius:R,xAccessor:g,yAccessor:b,xLabel:ue,yLabel:pe,xFormat:u,yFormat:y,groupField:v||A,styleRules:S,ruleContext:be}),ke=t({componentName:"StackedAreaChart",data:s,accessors:{xAccessor:g,yAccessor:b}}),Se={chartType:"stackedarea",...null!=s&&{data:ve},xAccessor:g,yAccessor:b,groupAccessor:v||void 0,curve:L,normalize:_,baseline:_?"zero":N,stackOrder:P,lineStyle:xe,...F&&Ae&&{pointStyle:Ae},size:[ie,re],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge.margin,showAxes:r.showAxes,xLabel:ue,yLabel:pe,xFormat:u,yFormat:y,enableHover:ae,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:se,...ge.legendBehaviorProps,...d({title:ce,description:he,summary:de,accessibleTable:me,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===W?{tooltipContent:w(),tooltipMode:"multi"}:p({tooltip:W,defaultTooltipContent:we}),...m({linkedHover:z,selection:G,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...M&&M.length>0&&{annotations:M},...E&&{xExtent:E},...O&&{yExtent:O},...ge.crosshairProps,...T};return ge.earlyReturn?ge.earlyReturn:ke?st(V,{componentName:"StackedAreaChart",message:ke,width:ie,height:re}):st(Y,{componentName:"StackedAreaChart",width:ie,height:re,children:st(l,{ref:n,...Se})})});lt.displayName="StackedAreaChart";import{useMemo as ct,forwardRef as ht,useRef as dt}from"react";import{scaleSequential as mt}from"d3-scale";import{jsx as ut}from"react/jsx-runtime";var pt=ht(function(e,o){const n=dt(null);a(o,{variant:"xy",frameRef:n});const i=D(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:h,className:f,xAccessor:y="x",yAccessor:g="y",valueAccessor:b="value",xFormat:v,yFormat:x,colorScheme:A,customColorScale:w,showValues:k=!1,valueFormat:S,cellBorderColor:L="#fff",cellBorderWidth:B=1,tooltip:F,annotations:R,xExtent:_,yExtent:N,frameProps:P={},selection:E,linkedHover:T,onObservation:G,onClick:z,hoverHighlight:$,chartId:Q,loading:K,loadingContent:U,emptyContent:Z,showLegend:ee,legendPosition:te,legendInteraction:oe}=e,{width:ne,height:ie,enableHover:re,title:ae,description:se,summary:le,accessibleTable:ce,xLabel:he,yLabel:de}=i,me=J(K,ne,ie,U),ue=me?null:q(r,ne,ie,Z),pe=ct(()=>C(r),[r]),fe=j(),ye=A??fe??"blues",ge=ee??!1,be=te??"right",{margin:ve}=W({data:pe,colorBy:ge?"value":void 0,colorScale:void 0,showLegend:ge,legendPosition:be,userMargin:h,defaults:i.marginDefaults}),{customHoverBehavior:xe,customClickBehavior:Ae,crosshairSourceId:we}=M({selection:E,linkedHover:T,fallbackFields:[],onObservation:G,onClick:z,chartType:"Heatmap",chartId:Q,hoverHighlight:$,colorByField:void 0,mobileInteraction:i.mobileInteraction});s(E);const ke=H(T,we);O(oe,void 0,[]);const Se=ct(()=>"function"==typeof b?e=>b(e):e=>e[b],[b]),Ce=ct(()=>{const e=pe.map(Se);return X(e)},[pe,Se]),Le=ct(()=>{if("custom"===ye&&w)return w;const e=I(ye);return mt(e).domain(Ce)},[ye,w,Ce]),He=ct(()=>{const e=Number.isFinite(B)?Math.max(0,B):1;return()=>({stroke:L,strokeWidth:e})},[L,B]),Ie=ct(()=>u([{label:he||c(y),accessor:y,role:"x",format:v},{label:de||c(g),accessor:g,role:"y",format:x},{label:c(b),accessor:b,role:"value",format:S}]),[y,g,he,de,b,v,x,S]),Be=t({componentName:"Heatmap",data:r,accessors:{xAccessor:y,yAccessor:g,valueAccessor:b}}),Fe=ct(()=>{if(ge)return{gradient:{colorFn:e=>Le(e),domain:Ce,label:"string"==typeof b?b:"value",format:S}}},[ge,Le,Ce,b,S]),Re={chartType:"heatmap",...null!=r&&{data:pe},xAccessor:y,yAccessor:g,valueAccessor:b,colorScheme:"custom"!==ye?ye:void 0,areaStyle:He,showValues:k,heatmapValueFormat:S,size:[ne,ie],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,showAxes:i.showAxes,xLabel:he,yLabel:de,xFormat:v,yFormat:x,enableHover:re,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Fe&&{legend:Fe,legendPosition:be},...d({title:ae,description:se,summary:le,accessibleTable:ce,className:f,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...p({tooltip:F,defaultTooltipContent:Ie}),...m({linkedHover:T,selection:E,onObservation:G,onClick:z,hoverHighlight:$,mobileInteraction:i.mobileInteraction,customHoverBehavior:xe,customClickBehavior:Ae}),...R&&R.length>0&&{annotations:R},..._&&{xExtent:_},...N&&{yExtent:N},...ke,...P};return me||ue||(Be?ut(V,{componentName:"Heatmap",message:Be,width:ne,height:ie}):ut(Y,{componentName:"Heatmap",width:ne,height:ie,children:ut(l,{ref:n,...Re})}))});pt.displayName="Heatmap";import{useMemo as ft,useCallback as yt,forwardRef as gt,useRef as bt}from"react";import{jsx as vt}from"react/jsx-runtime";var xt=gt(function(o,n){const r=bt(null),s=D(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:h,margin:y,className:g,xFormat:b,yFormat:v,xAccessor:x="x",yAccessor:A="y",sizeBy:w,sizeRange:k=[5,40],colorBy:S,colorScheme:L,styleRules:H,bubbleOpacity:I=.6,bubbleStrokeWidth:F=1,bubbleStrokeColor:_="white",tooltip:N,marginalGraphics:W,pointIdAccessor:M,annotations:E,regression:O,xExtent:T,yExtent:G,frameProps:z={},selection:j,linkedHover:$,linkedBrush:Q,onObservation:X,onClick:q,hoverHighlight:J,chartId:K,loading:U,loadingContent:Z,emptyContent:ee,legendInteraction:te,legendPosition:oe,color:ne,stroke:re,strokeWidth:ae,opacity:se}=o,{width:le,height:he,enableHover:de,showGrid:me,showLegend:ue,title:pe,description:fe,summary:ye,accessibleTable:ge,xLabel:be,yLabel:ve}=s,xe=ft(()=>C(h),[h]),Ae=void 0===h,we=i({data:xe,rawData:h,colorBy:S,colorScheme:L,legendInteraction:te,legendPosition:oe,selection:j,linkedHover:$,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:X,onClick:q,hoverHighlight:J,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"BubbleChart",chartId:K,showLegend:ue,userMargin:y,marginDefaults:s.marginDefaults,loading:U,loadingContent:Z,emptyContent:ee,width:le,height:he}),{domain:ke,trackPushed:Se,reset:Ce}=ce({accessor:w,data:xe,isPushMode:Ae}),Le=yt(e=>{Se([e]),r.current?.push(e)},[Se]),He=yt(e=>{Se(e),r.current?.pushMany(e)},[Se]);a(n,{variant:"xy",frameRef:r,overrides:{push:Le,pushMany:He,clear:()=>{Ce(),r.current?.clear()}}});const Ie=R(Q),Be=(P({name:Ie?.name||"__unused_brush__",xField:Ie?.xField||("string"==typeof x?x:void 0),yField:Ie?.yField||("string"==typeof A?A:void 0)}),ft(()=>({stroke:_,strokeWidth:F}),[_,F])),Fe=ft(()=>ke??[0,1],[ke]),Re=yt(e=>B(e,w,k,Fe),[w,k,Fe]),_e=ft(()=>f(x,A),[x,A]),Ne=ie({colorBy:S,colorScale:we.colorScale,color:ne,fillOpacity:I,radiusFn:Re,baseStyleExtras:Be,stroke:re,strokeWidth:ae,opacity:se,styleRules:H,ruleContext:_e,effectiveSelectionHook:we.effectiveSelectionHook,resolvedSelection:we.resolvedSelection}),Pe=ft(()=>u([{label:be||c(x),accessor:x,role:"x",format:b},{label:ve||c(A),accessor:A,role:"y",format:v},{label:c(w),accessor:w,role:"size"},...S?[{label:c(S),accessor:S,role:"color"}]:[]]),[x,A,be,ve,w,S,b,v]);if(we.earlyReturn)return we.earlyReturn;const We=t({componentName:"BubbleChart",data:h,accessors:{xAccessor:x,yAccessor:A},requiredProps:{sizeBy:w}});if(We)return vt(V,{componentName:"BubbleChart",message:We,width:le,height:he});const De=e(O),Me=De?[De,...E||[]]:E,Ee={chartType:"bubble",...null!=h&&{data:xe},xAccessor:x,yAccessor:A,colorAccessor:S||void 0,sizeAccessor:w,sizeRange:k,pointStyle:Ne,colorScheme:L,size:[le,he],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:we.margin,showAxes:s.showAxes,xLabel:be,yLabel:ve,xFormat:b,yFormat:v,enableHover:de,showGrid:me,...we.legendBehaviorProps,...d({title:pe,description:fe,summary:ye,accessibleTable:ge,className:g,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...p({tooltip:N,defaultTooltipContent:Pe}),...m({linkedHover:$,selection:j,onObservation:X,onClick:q,hoverHighlight:J,mobileInteraction:we.mobileInteraction,customHoverBehavior:we.customHoverBehavior,customClickBehavior:we.customClickBehavior}),...W&&{marginalGraphics:W},...M&&{pointIdAccessor:M},...Me&&Me.length>0&&{annotations:Me},...T&&{xExtent:T},...G&&{yExtent:G},...we.crosshairProps,...z};return vt(Y,{componentName:"BubbleChart",width:le,height:he,children:vt(l,{ref:r,...Ee})})});xt.displayName="BubbleChart";import*as At from"react";import{useMemo as wt,useCallback as kt,useState as St,useRef as Ct}from"react";import*as Lt from"react";import{jsx as Ht}from"react/jsx-runtime";var It=null,Bt=null;function Ft(e){const[t,o]=Lt.useState(()=>It);return Lt.useEffect(()=>{if(t)return;let e=!1;return(It?Promise.resolve(It):(Bt||(Bt=import("./chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js").then(e=>It=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw Bt=null,e})),Bt)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Ht(t,{...e}):null}import{jsx as Rt,jsxs as _t}from"react/jsx-runtime";var Nt="__splomIdx",Pt={top:4,bottom:4,left:4,right:4};function Wt({data:e,xField:t,yField:o,cellSize:n,pointRadius:i,pointOpacity:r,colorBy:a,colorScale:s,brushSelectionName:c,hoverSelectionName:h,unselectedOpacity:d,mobileInteraction:u,mode:p,onPointHover:f,onPointClick:y}){const g=Ct(null),v=T({name:c,clientId:`splom-${t}-${o}`,fields:[t,o]}),x=P({name:c,xField:t,yField:o}),A=T({name:h,clientId:"splom-hover-source",fields:[Nt]}),w=A.selectPoints,k=kt(e=>{e?x.brushInteraction.during(e):x.brushInteraction.end(null)},[x.brushInteraction]),S=kt(e=>{if(!e)return void f?.(null);const t=e.data,o=t?.[Nt];void 0!==o&&(w({[Nt]:[o]}),f?.(t,e.x+Pt.left,e.y+Pt.top))},[w,f]),C=kt(e=>{if(!e)return void y?.(null);const t=e.data;t&&y?.(t,e.x+Pt.left,e.y+Pt.top)},[y]),H=kt(e=>{const t={opacity:r,r:i};return t.fill=a?L(e,a,s):b,"hover"===p?A.isActive&&A.predicate(e)?(t.opacity=1,t.r=2.5*i,t.stroke="#333",t.strokeWidth=1.5):A.isActive&&(t.opacity=.6*r):v.isActive&&!v.predicate(e)&&(t.opacity=d),t},[r,i,a,p,s,A,v,d]);return _t("div",{style:{position:"relative",width:n,height:n},children:[Rt(l,{ref:g,chartType:"scatter",data:e,size:[n,n],xAccessor:t,yAccessor:o,pointStyle:H,margin:Pt,showAxes:!1,enableHover:"hover"===p,...m({forceHoverBehavior:"hover"===p,forceClickBehavior:!!y,mobileInteraction:u,customHoverBehavior:S,customClickBehavior:C}),tooltipContent:"hover"===p?()=>null:void 0}),"brush"===p&&Rt(Ft,{frameRef:g,cellSize:n,onBrush:k})]})}function Dt({data:e,field:t,label:o,cellSize:n,bins:i,colorBy:r,colorScale:a,brushSelectionName:s,hoverSelectionName:l,mode:c}){const h=T({name:s,clientId:"splom-diag-"+t,fields:[t]}),d=T({name:l,clientId:`splom-diag-${t}-hover`,fields:[Nt]}),m="hover"===c?d:h,u=m.isActive,p=m.predicate,f=wt(()=>{const o="string"==typeof r?r:null,a=[],s=new Set;for(const n of e){const e=n[t];if(null==e||isNaN(e)||a.push(Number(e)),o){const e=n[o];null!=e&&s.add(e+"")}}if(0===a.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[l,c]=X(a),h=(c-l)/i||1,d=Array.from(s),m=new Map(d.map((e,t)=>[e,t])),f=Array(i).fill(0),y=Array(i).fill(0),g=Array.from({length:i},()=>Array(d.length).fill(0)),b=Array.from({length:i},()=>Array(d.length).fill(0));for(const n of e){const e=n[t];if(null==e||isNaN(e))continue;const r=Math.min(Math.floor((e-l)/h),i-1);if(f[r]++,u&&!p(n)||y[r]++,o){const e=m.get(n[o]+"");void 0!==e&&(g[r][e]++,u&&!p(n)||b[r][e]++)}}const v=Q(f,1),x=g.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})});return{bars:f.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),selectedBars:y.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),categoryBars:x,selectedCategoryBars:A,max:v,categories:d}},[e,t,i,n,u,p,r]);return _t("svg",{width:n,height:n,style:{overflow:"hidden"},children:[Rt("text",{x:n/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"#333",children:o}),f.categories.length>0?f.categoryBars.map((e,t)=>e.map((e,o)=>Rt("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):b,opacity:u?.3:.6},`bg-${t}-${o}`))):f.bars.map((e,t)=>Rt("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:b,opacity:u?.3:.6},"bg-"+t)),u&&(f.categories.length>0?f.selectedCategoryBars.map((e,t)=>e.map((e,o)=>Rt("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):b,opacity:.7},`sel-${t}-${o}`))):f.selectedBars.map((e,t)=>Rt("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:b,opacity:.7},"sel-"+t)))]})}function Mt({label:e,cellSize:t}){return Rt("svg",{width:t,height:t,children:Rt("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"#333",children:e})})}function Et(e){const{data:t,fields:o,fieldLabels:n={},colorBy:i,colorScheme:r,cellSize:a=150,cellGap:s=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:d=20,brushMode:m="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:f=!1,tooltip:y,showLegend:g,idAccessor:v,width:x,className:A,onObservation:w,onClick:k,chartId:S}=e,C="splom",L="splom-hover",H=N(e.mobileInteraction,{mode:e.mode,width:x??o.length*a,mobileSemantics:e.mobileSemantics}),I=u?"hover":m?"brush":"hover",B=G(e=>e.clearSelection),[F,R]=St(null),_=kt(()=>{B(L),R(null)},[B,L]),P=wt(()=>(t||[]).map((e,t)=>void 0!==e[Nt]?e:{...e,[Nt]:t}),[t]),W=E(P,i,r),D=kt((e,t,o,n)=>[40+e*(a+s)+(o??0),t*(a+s)+(n??0)],[40,a,s]),M=void 0!==g?g:!!i,O=wt(()=>{if(!M||!i)return null;const e="string"==typeof i?i:null;return e?Array.from(new Set(P.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:W?W(e+""):b})):null},[M,i,P,W]),T=wt(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>a+"px").join(" "),gridTemplateRows:o.map(()=>a+"px").join(" ")+" 40px",gap:s+"px",width:"fit-content"}),[o,a,s,40]);return _t("div",{className:A,style:{position:"relative"},children:[O&&Rt("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:O.map(e=>_t("div",{style:{display:"flex",alignItems:"center",gap:4},children:[Rt("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),Rt("span",{style:{fontSize:11},children:e.label})]},e.label))}),_t("div",{style:T,onMouseLeave:"hover"===I?_:void 0,children:[o.map((e,t)=>_t(At.Fragment,{children:[Rt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e}),o.map((o,r)=>t===r?"label"===h?Rt(Mt,{label:n[e]||e,cellSize:a},"diag-"+e):Rt(Dt,{data:P,field:e,label:n[e]||e,cellSize:a,bins:d,colorBy:i,colorScale:W,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,mode:I},"diag-"+e):Rt(Wt,{data:P,xField:o,yField:e,fieldLabels:n,cellSize:a,pointRadius:l,pointOpacity:c,colorBy:i,colorScale:W,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,showGrid:f,tooltip:y,mobileInteraction:H,mode:I,onPointHover:"hover"===I?(n,i,a)=>{if(n){if(R({datum:n,xField:o,yField:e,colIndex:r,rowIndex:t,px:i??0,py:a??0}),w){const[e,o]=D(r,t,i,a);w({type:"hover",datum:n,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}}else R(null),w&&w({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0,onPointClick:k||w?(e,o,n)=>{if(!e)return;const[i,a]=D(r,t,o,n);k&&k(e,{x:i,y:a}),w&&w({type:"click",datum:e,x:i,y:a,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),Rt("div",{})," ",o.map(e=>Rt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e},"col-label-"+e))]}),F&&"hover"===I&&(()=>{const e=F.datum,t=n[F.xField]||F.xField,o=n[F.yField]||F.yField,r=i?"function"==typeof i?i(e):e[i]:null,l=v?"function"==typeof v?v(e):e[v]:"Row "+e[Nt];return _t("div",{style:{position:"absolute",left:40+F.colIndex*(a+s)+F.px,top:F.rowIndex*(a+s)+F.py-8,transform:"translate(-50%, -100%)",color:"#333",background:"rgba(255,255,255,0.95)",border:"1px solid #ddd",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[Rt("div",{style:{fontWeight:"bold",marginBottom:2},children:l+""}),_t("div",{children:[t,": ",null!=e[F.xField]?Number(e[F.xField]).toFixed(1):"–"]}),_t("div",{children:[o,": ",null!=e[F.yField]?Number(e[F.yField]).toFixed(1):"–"]}),null!=r&&_t("div",{style:{opacity:.8},children:["string"==typeof i?i:"group",": ",r+""]})]})})()]})}function Ot(e){const{brushMode:t="crossfilter",hoverMode:o=!0}=e,n={};return!o&&t&&(n.splom={resolution:t}),o&&(n["splom-hover"]={resolution:"union"}),Rt(A,{selections:n,children:Rt(Et,{...e})})}Ot.displayName="ScatterplotMatrix";import{useState as Tt,useRef as Gt,useEffect as zt,useMemo as jt,useCallback as $t}from"react";import*as Qt from"react";import{jsx as Xt}from"react/jsx-runtime";var Vt=null,Yt=null;function qt(e){const[t,o]=Qt.useState(()=>Vt);return Qt.useEffect(()=>{if(t)return;let e=!1;return(Vt?Promise.resolve(Vt):(Yt||(Yt=import("./chunk-minimapBrushOverlay-JU57U7NM.module.min.js").then(e=>Vt=e.MinimapBrushOverlay).catch(e=>{throw Yt=null,e})),Yt)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Xt(t,{...e}):null}import{jsx as Jt,jsxs as Kt}from"react/jsx-runtime";function Ut(e){const{data:o,width:n=600,height:i=400,margin:r,className:a,title:s,description:h,summary:d,xLabel:m,yLabel:p,xFormat:f,yFormat:y,xAccessor:g="x",yAccessor:v="y",lineBy:x,lineDataAccessor:A="coordinates",colorBy:w,colorScheme:k,curve:S="linear",lineWidth:H=2,fillArea:I=!1,areaOpacity:B=.3,showPoints:F=!1,pointRadius:R=3,enableHover:N=!0,showGrid:P=!1,showLegend:D,legendPosition:M,tooltip:O,minimap:T={},renderBefore:G=!1,onBrush:z,brushExtent:j,yExtent:$,frameProps:Q={},loading:X,loadingContent:K,emptyContent:U}=e,Z=J(X,n,i,K),ee=Z?null:q(o,n,i,U),te=jt(()=>C(o),[o]),[oe,ne]=Tt(null),ie=j??oe,re=$t(e=>{j||ne(e),z?.(e)},[j,z]),ae=Gt(null),[se,le]=Tt(null);zt(()=>{let e=0,t=!1;const o=()=>{if(t)return;const n=ae.current?.getScales?.();n?le(n):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[o]);const ce=void 0!==te[0]?.[A],he=jt(()=>{if(ce)return te;if(x){const e=te.reduce((e,t)=>{const o="function"==typeof x?x(t):t[x];if(!e[o]){const t={[A]:[]};"string"==typeof x&&(t[x]=o),e[o]=t}return e[o][A].push(t),e},{});return Object.values(e)}return[{[A]:te}]},[te,x,A,ce]),de=jt(()=>ce||x?he.flatMap(e=>{const t=e[A]||[];return x&&"string"==typeof x?t.map(t=>({...t,[x]:e[x]})):t}):te,[he,A,ce,x,te]),me=E(te,w,k),ue=De({lineWidth:H,colorBy:w,colorScale:me,fillArea:I,areaOpacity:B}),pe=jt(()=>{if(T.lineStyle)return T.lineStyle},[T.lineStyle]),fe=De({lineWidth:1,colorBy:w,colorScale:me}),ye=pe??fe,ge=jt(()=>{if(F)return e=>{const t={r:R,fillOpacity:1};return t.fill=w?L(e.parentLine||e,w,me):b,t}},[F,R,w,me]),{legend:be,margin:ve,legendPosition:xe}=W({data:he,colorBy:w,colorScale:me,showLegend:D,legendPosition:M,userMargin:r}),Ae=T.height||60,we=jt(()=>({top:T.margin?.top??0,bottom:T.margin?.bottom??20,left:T.margin?.left??ve.left,right:T.margin?.right??ve.right}),[T.margin,ve]),ke=T.brushDirection||"x",Se=jt(()=>u([{label:m||c(g),accessor:g,role:"x",format:f},{label:p||c(v),accessor:v,role:"y",format:y}]),[g,v,m,p,f,y]),Ce=t({componentName:"MinimapChart",data:o,accessors:{xAccessor:g,yAccessor:v}});if(Ce)return Jt(V,{componentName:"MinimapChart",message:Ce,width:n,height:i});const Le=I?"area":"line",He={chartType:Le,data:de,xAccessor:g,yAccessor:v,groupAccessor:x||void 0,curve:S,lineStyle:ue,...F&&{pointStyle:ge},size:[n,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,showAxes:!0,xLabel:m,yLabel:p,xFormat:f,yFormat:y,enableHover:N,showGrid:P,...be&&{legend:be,legendPosition:xe},...s&&{title:s},...h&&{description:h},...d&&{summary:d},tooltipContent:!1===O?()=>null:_(O)||Se,...ie&&{xExtent:ie},...$&&{yExtent:$},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...Q},Ie={chartType:Le,data:de,xAccessor:g,yAccessor:v,groupAccessor:x||void 0,curve:S,lineStyle:ye,size:[n,Ae+we.top+we.bottom],margin:we,showAxes:T.showAxes??!1,background:T.background,enableHover:!1,...$&&{yExtent:$}},Be=Kt("div",{style:{position:"relative",width:n,overflow:"hidden"},children:[Jt(l,{ref:ae,...Ie}),Jt(qt,{width:n-we.left-we.right,height:Ae,margin:we,scales:se,brushDirection:ke,extent:ie,onBrush:re})]},"minimap"),Fe=Jt("div",{style:{overflow:"hidden"},children:Jt(l,{...He})},"main");return Z||ee||Jt(Y,{componentName:"MinimapChart",width:n,height:i,children:Kt("div",{className:"minimap-chart"+(a?" "+a:""),children:[G?Be:Fe,G?Fe:Be]})})}Ut.displayName="MinimapChart";import{useMemo as Zt,forwardRef as eo,useRef as to}from"react";var oo={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as no,jsx as io,jsxs as ro}from"react/jsx-runtime";function ao(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}var so=eo(function(e,o){const n=to(null);a(o,{variant:"xy",frameRef:n});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:h,className:d,xFormat:p,yFormat:y,xAccessor:g="x",yAccessor:v="y",xCenter:x,yCenter:A,quadrants:w,centerlineStyle:k={},showQuadrantLabels:S=!0,quadrantLabelSize:L=12,colorBy:H,colorScheme:I,styleRules:F,sizeBy:R,sizeRange:N=[3,15],pointRadius:P=5,pointOpacity:W=.8,tooltip:M,pointIdAccessor:E,annotations:O,frameProps:T={},selection:G,linkedHover:z,onObservation:j,onClick:$,hoverHighlight:Q,chartId:q,loading:J,loadingContent:U,emptyContent:Z,legendInteraction:ee,legendPosition:te,color:oe,stroke:ne,strokeWidth:re,opacity:ae}=e,{width:se,height:le,enableHover:ce,showGrid:he,showLegend:de,title:me,description:ue,summary:pe,accessibleTable:fe,xLabel:ye,yLabel:ge}=r,be=Zt(()=>({topLeft:ao(oo.topLeft,w?.topLeft),topRight:ao(oo.topRight,w?.topRight),bottomLeft:ao(oo.bottomLeft,w?.bottomLeft),bottomRight:ao(oo.bottomRight,w?.bottomRight)}),[w]),ve=Zt(()=>C(s),[s]),xe=i({data:ve,rawData:s,colorBy:H,colorScheme:I,legendInteraction:ee,legendPosition:te,selection:G,linkedHover:z,fallbackFields:"string"==typeof H?[H]:[],unwrapData:!1,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"QuadrantChart",chartId:q,showLegend:de,userMargin:h,marginDefaults:r.marginDefaults,loading:J,loadingContent:U,emptyContent:Z,width:se,height:le});K("QuadrantChart",ve,"xAccessor",g),K("QuadrantChart",ve,"yAccessor",v);const Ae=Zt(()=>{if(!ve.length)return;const e="function"==typeof g?g:e=>+e[g],t="function"==typeof v?v:e=>+e[v];let o=1/0,n=-1/0,i=1/0,r=-1/0;for(const a of ve){const s=e(a),l=t(a);isFinite(s)&&(o>s&&(o=s),s>n&&(n=s)),isFinite(l)&&(i>l&&(i=l),l>r&&(r=l))}if(null!=x&&isFinite(x)&&(o>x&&(o=x),x>n&&(n=x)),null!=A&&isFinite(A)&&(i>A&&(i=A),A>r&&(r=A)),o===1/0)return;const a=.1*(n-o)||1,s=.1*(r-i)||1;return{xExtent:[o-a,n+a],yExtent:[i-s,r+s]}},[ve,g,v,x,A]),we=Zt(()=>{if(!R||0===ve.length)return;const e=ve.map(e=>"function"==typeof R?R(e):e[R]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?X(e):void 0},[ve,R]),ke=Zt(()=>"function"==typeof g?g:e=>+e[g],[g]),Se=Zt(()=>"function"==typeof v?v:e=>+e[v],[v]),Ce=Zt(()=>e=>{const t=ke(e),o=Se(e),n=null!=x?t>=x:void 0,i=null!=A?o>=A:void 0;return void 0===i||void 0===n?oe||b:i&&n?be.topRight.color:i&&!n?be.topLeft.color:!i&&n?be.bottomRight.color:be.bottomLeft.color},[ke,Se,x,A,be,oe]),Le=Zt(()=>R?e=>B(e,R,N,we):void 0,[R,N,we]),He=Zt(()=>f(g,v),[g,v]),Ie=ie({colorBy:H,colorScale:xe.colorScale,color:oe,pointRadius:P,fillOpacity:W,radiusFn:Le,fallbackFill:Ce,stroke:ne,strokeWidth:re,opacity:ae,styleRules:F,ruleContext:He,effectiveSelectionHook:xe.effectiveSelectionHook,resolvedSelection:xe.resolvedSelection}),Be=Zt(()=>{if(!ve.length)return;const e=new Set;"string"==typeof g&&e.add(g),"string"==typeof v&&e.add(v),"string"==typeof H&&e.add(H),"string"==typeof R&&e.add(R);const t=ve[0];for(const o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[ve,g,v,H,R]),Fe=Zt(()=>u([...Be?[{label:Be,accessor:Be,role:"title"}]:[],{label:ye||c(g),accessor:g,role:"x",format:p},{label:ge||c(v),accessor:v,role:"y",format:y},...H?[{label:c(H),accessor:H,role:"color"}]:[],...R?[{label:c(R),accessor:R,role:"size"}]:[]]),[Be,g,v,ye,ge,H,R,p,y]),Re=t({componentName:"QuadrantChart",data:s,accessors:{xAccessor:g,yAccessor:v}}),_e=Zt(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray||[]};return[(t,o,n,i)=>{if(!n?.x||!n?.y)return;const r=i.width,a=i.height,s=null!=x?n.x(x):r/2,l=null!=A?n.y(A):a/2;if(null!=x&&!isFinite(s))return;if(null!=A&&!isFinite(l))return;const c=Math.max(0,Math.min(r,s)),h=Math.max(0,Math.min(a,l)),d=[{config:be.topLeft,x:0,y:0,w:c,h:h},{config:be.topRight,x:c,y:0,w:r-c,h:h},{config:be.bottomLeft,x:0,y:h,w:c,h:a-h},{config:be.bottomRight,x:c,y:h,w:r-c,h:a-h}];for(const e of d)e.w>0&&e.h>0&&(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,a),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[x,A,be,k]),Ne=Zt(()=>S?[..._e,(e,t,o,n)=>{if(!o?.x||!o?.y)return;const i=n.width,r=n.height,a=null!=x?o.x(x):i/2,s=null!=A?o.y(A):r/2;(null==x||isFinite(a))&&(null==A||isFinite(s))&&(e.font=`600 ${L}px sans-serif`,e.globalAlpha=.5,e.fillStyle=be.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(be.topLeft.label,8,8),e.fillStyle=be.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(be.topRight.label,i-8,8),e.fillStyle=be.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(be.bottomLeft.label,8,r-8),e.fillStyle=be.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(be.bottomRight.label,i-8,r-8),e.globalAlpha=1)}]:_e,[_e,S,L,be,x,A]),Pe=Zt(()=>{const e=T.canvasPreRenderers||[];return[...Ne,...e]},[Ne,T.canvasPreRenderers]),We=Zt(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray?Array.isArray(k.strokeDasharray)?k.strokeDasharray.join(","):k.strokeDasharray:void 0};return[(t,o,n)=>{if(!o?.x||!o?.y)return null;const i=n.width,r=n.height,a=null!=x?o.x(x):i/2,s=null!=A?o.y(A):r/2;if(null!=x&&!isFinite(a))return null;if(null!=A&&!isFinite(s))return null;const l=Math.max(0,Math.min(i,a)),c=Math.max(0,Math.min(r,s));return ro(no,{children:[[{config:be.topLeft,x:0,y:0,w:l,h:c},{config:be.topRight,x:l,y:0,w:i-l,h:c},{config:be.bottomLeft,x:0,y:c,w:l,h:r-c},{config:be.bottomRight,x:l,y:c,w:i-l,h:r-c}].map((e,t)=>e.w>0&&e.h>0?io("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),io("line",{x1:l,y1:0,x2:l,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),io("line",{x1:0,y1:c,x2:i,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),S&&ro(no,{children:[io("text",{x:8,y:8+L,fill:be.topLeft.color,fontWeight:600,fontSize:L,opacity:.5,children:be.topLeft.label}),io("text",{x:i-8,y:8+L,fill:be.topRight.color,fontWeight:600,fontSize:L,opacity:.5,textAnchor:"end",children:be.topRight.label}),io("text",{x:8,y:r-8,fill:be.bottomLeft.color,fontWeight:600,fontSize:L,opacity:.5,children:be.bottomLeft.label}),io("text",{x:i-8,y:r-8,fill:be.bottomRight.color,fontWeight:600,fontSize:L,opacity:.5,textAnchor:"end",children:be.bottomRight.label})]})]})}]},[x,A,be,k,S,L]);if(xe.earlyReturn)return xe.earlyReturn;const De={chartType:"scatter",...null!=s&&{data:ve},xAccessor:g,yAccessor:v,colorAccessor:H||void 0,sizeAccessor:R||void 0,sizeRange:N,pointStyle:Ie,colorScheme:I,size:[se,le],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe.margin,showAxes:r.showAxes,xLabel:ye,yLabel:ge,xFormat:p,yFormat:y,enableHover:ce,showGrid:he,...Ae&&{xExtent:Ae.xExtent,yExtent:Ae.yExtent},...xe.legendBehaviorProps,...me&&{title:me},...ue&&{description:ue},...pe&&{summary:pe},...void 0!==fe&&{accessibleTable:fe},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===M?()=>null:!0===M||void 0===M?Fe:_(M)||Fe,...m({linkedHover:z,selection:G,onObservation:j,onClick:$,hoverHighlight:Q,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior}),...E&&{pointIdAccessor:E},...O&&O.length>0&&{annotations:O},canvasPreRenderers:Pe,...xe.crosshairProps,...T,...Pe.length>0&&{canvasPreRenderers:Pe},svgPreRenderers:We};return Re?io(V,{componentName:"QuadrantChart",message:Re,width:se,height:le}):io(Y,{componentName:"QuadrantChart",width:se,height:le,children:io(l,{ref:n,...De})})});so.displayName="QuadrantChart";import*as lo from"react";import{useMemo as co,useCallback as ho,forwardRef as mo,useRef as uo,useImperativeHandle as po}from"react";import{jsx as fo}from"react/jsx-runtime";var yo="__ma_unitized",go="__ma_series";function bo(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function vo(e,t){return t[0]+e*(t[1]-t[0])}var xo=mo(function(e,o){const n=uo(null),r=uo([]),a=uo(e.series);a.current=e.series,po(o,()=>{const e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!n.current)return;const o=e(),i=t;for(let e=0;o.length>e&&2>e;e++){const t=o[e],a=t.extent||r.current[e];if(!a)continue;const s=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(i);null!=s&&isFinite(s)&&n.current.push({...i,[yo]:bo(s,a),[go]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!n.current)return;const o=e(),i=[];for(const e of t)for(let t=0;o.length>t&&2>t;t++){const n=o[t],a=n.extent||r.current[t];if(!a)continue;const s=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=s&&isFinite(s)&&i.push({...e,[yo]:bo(s,a),[go]:n.label||"Series "+(t+1)})}n.current.pushMany(i)},remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],clear:()=>n.current?.clear(),getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}},[]);const s=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:c,margin:h,className:d,xFormat:u,xAccessor:p="x",series:f,colorScheme:y,curve:b="monotoneX",lineWidth:x=2,tooltip:A,annotations:w,frameProps:k={},selection:S,linkedHover:L,onObservation:H,onClick:I,hoverHighlight:B,chartId:F,loading:R,loadingContent:N,emptyContent:P,legendInteraction:W,legendPosition:M,stroke:E,strokeWidth:O,opacity:T}=e,{width:G,height:j,enableHover:$,showGrid:Q,showLegend:X=!0,title:K,description:U,summary:Z,accessibleTable:ee,xLabel:te}=s,oe=co(()=>C(c),[c]),ne=co(()=>C(f),[f]),ie=ne,re=2===ne.length;"undefined"==typeof process||"production"===process.env?.NODE_ENV||re||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${ne.length}. Rendering as a standard multi-line chart.`);const ae=J(R,G,j,N),se=ae?null:q(c,G,j,P),le=z(),ce=co(()=>{let e;if(Array.isArray(y))e=y;else if(le&&le.length>0)e=le;else{const t=g[y];e=Array.isArray(t)?t:v}return ie.map((t,o)=>t.color||e[o%e.length])},[ie,y,le]),he=co(()=>ne.map((e,t)=>e.label||"Series "+(t+1)),[ne]),{unitizedData:de,extents:me}=co(()=>{if(0===oe.length){const e=ne.map(e=>e.extent||null).filter(Boolean);return e.length===ne.length&&(r.current=e),{unitizedData:[],extents:e.length===ne.length?e:[]}}const e=ne.map(e=>e.extent||function(e,t){let o=1/0,n=-1/0;const i="function"==typeof t?t:e=>e[t];for(const t of e){const e=i(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>n&&(n=e))}if(!isFinite(o)||!isFinite(n))return[0,1];if(o===n){const e=0===o?1:.1*Math.abs(o);return[o-e,n+e]}return[o,n]}(oe,e.yAccessor));if(r.current=e,!re){const t=[];for(const e of oe)for(let o=0;ne.length>o;o++){const n=ne[o],i=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=i&&t.push({...e,[yo]:i,[go]:he[o]})}return{unitizedData:t,extents:e}}const t=[];for(const o of oe)for(let n=0;2>n;n++){const i=ne[n],r=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(o);null!=r&&t.push({...o,[yo]:bo(r,e[n]),[go]:he[n]})}return{unitizedData:t,extents:e}},[oe,ne,re,he]),ue=co(()=>{if(re&&me.length>=2)return[{orient:"left",label:he[0],tickFormat:ne[0].format||(e=>{const t=vo(e,me[0]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"right",label:he[1],tickFormat:ne[1].format||(e=>{const t=vo(e,me[1]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"bottom"}]},[re,me,ne,he]),pe=co(()=>de.length>0?de:he.map(e=>({[go]:e})),[de,he]),fe=i({data:pe,rawData:c,colorBy:go,colorScheme:ce,legendInteraction:W,legendPosition:M,selection:S,linkedHover:L,fallbackFields:[go],unwrapData:!1,onObservation:H,onClick:I,hoverHighlight:B,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"MultiAxisLineChart",chartId:F,showLegend:X,userMargin:h,marginDefaults:re?{...s.marginDefaults,left:70,right:70}:s.marginDefaults,loading:R,loadingContent:N,emptyContent:P,width:G,height:j}),ye=co(()=>{const e=new Map;return he.forEach((t,o)=>e.set(t,ce[o])),e},[he,ce]),ge=De({lineWidth:x,resolveStroke:ho(e=>ye.get(e[go])||ce[0],[ye,ce]),stroke:E,strokeWidth:O,opacity:T,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),be=co(()=>{if(!1===A)return()=>null;return _(A)||(e=>{const t=e.data||e,o=t[go],n=he.indexOf(o),i=t[yo],r=re&&n>=0&&me[n]?vo(i,me[n]):i,a=n>=0&&ne[n]?.format?ne[n].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),s="function"==typeof p?p(t):t[p];return lo.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},lo.createElement("div",{style:{fontWeight:600,marginBottom:4,color:ce[n]||"inherit"}},o),lo.createElement("div",null,`${"string"==typeof p?p:"x"}: ${s}`),lo.createElement("div",null,`${o}: ${a(r)}`))})},[A,he,ce,me,re,ne,p]);if(fe.earlyReturn)return fe.earlyReturn;const ve=t({componentName:"MultiAxisLineChart",data:c,accessors:{xAccessor:p}}),xe=re?[0,1]:void 0,Ae={chartType:"line",...null!=c&&{data:de},xAccessor:p,yAccessor:yo,groupAccessor:go,lineStyle:ge,colorScheme:ce,size:[G,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe.margin,showAxes:s.showAxes,...ue&&{axes:ue},xLabel:te,...re?{}:{yLabel:he[0]},xFormat:u,...re&&xe&&{yExtent:xe},enableHover:$,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:Q,curve:b,...fe.legendBehaviorProps,...K&&{title:K},...U&&{description:U},...Z&&{summary:Z},...void 0!==ee&&{accessibleTable:ee},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:be,...w&&{annotations:w},...m({linkedHover:L,selection:S,onObservation:H,onClick:I,hoverHighlight:B,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...fe.crosshairProps,...k};return ae||se||(ve?fo(V,{componentName:"MultiAxisLineChart",message:ve,width:G,height:j}):fo(Y,{componentName:"MultiAxisLineChart",width:G,height:j,children:fo(l,{ref:n,...Ae})}))});xo.displayName="MultiAxisLineChart";import{useMemo as Ao,forwardRef as wo,useRef as ko}from"react";import{jsx as So}from"react/jsx-runtime";var Co=wo(function(e,o){const i=ko(null);a(o,{variant:"xy",frameRef:i});const r=D(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:h,className:f,xFormat:y,yFormat:g,xAccessor:b="x",highAccessor:v="high",lowAccessor:x="low",openAccessor:A,closeAccessor:w,candlestickStyle:k,tooltip:S,annotations:L,xExtent:I,yExtent:B,frameProps:F={},selection:R,linkedHover:_,onObservation:N,onClick:P,chartId:W,loading:E,loadingContent:O,emptyContent:T}=e,{width:G,height:z,enableHover:j,showGrid:$,title:Q,description:X,summary:U,accessibleTable:Z,xLabel:ee,yLabel:te}=r,oe=J(E,G,z,O),ne=oe?null:q(s,G,z,T),ie=Ao(()=>C(s),[s]),re=null==A||null==w;K("CandlestickChart",ie,"xAccessor",b),K("CandlestickChart",ie,"highAccessor",v),K("CandlestickChart",ie,"lowAccessor",x),re||(K("CandlestickChart",ie,"openAccessor",A),K("CandlestickChart",ie,"closeAccessor",w));const{customHoverBehavior:ae,customClickBehavior:se,crosshairSourceId:le}=M({selection:R,linkedHover:_,onObservation:N,onClick:P,chartType:"CandlestickChart",chartId:W,mobileInteraction:r.mobileInteraction}),ce=H(_,le),he=Ao(()=>{const e=r.marginDefaults,t="sparkline"===r.mode?{...e,top:0,bottom:0}:e;return null==h?t:{...t,...n(h)}},[h,r.marginDefaults,r.mode]),de=Ao(()=>{const e=[{label:ee||c(b),accessor:b,role:"x",format:y}];return re?(e.push({label:"High",accessor:v,role:"y",format:g}),e.push({label:"Low",accessor:x,format:g})):(e.push({label:"Open",accessor:A,format:g}),e.push({label:"High",accessor:v,format:g}),e.push({label:"Low",accessor:x,format:g}),e.push({label:"Close",accessor:w,format:g})),u(e)},[b,ee,y,g,v,x,A,w,re]),me=t({componentName:"CandlestickChart",data:s,accessors:{xAccessor:b,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:w}}}),ue={chartType:"candlestick",...null!=s&&{data:ie},xAccessor:b,yAccessor:v,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:w},...k&&{candlestickStyle:k},scalePadding:Math.max(2,Math.min(12,Math.round(G/40))),extentPadding:G>200?.1:.02,size:[G,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he,showAxes:r.showAxes,xLabel:ee,yLabel:te,xFormat:y,yFormat:g,enableHover:j,showGrid:$,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...d({title:Q,description:X,summary:U,accessibleTable:Z,className:f,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...p({tooltip:S,defaultTooltipContent:de}),...m({linkedHover:_,selection:R,onObservation:N,onClick:P,mobileInteraction:r.mobileInteraction,customHoverBehavior:ae,customClickBehavior:se}),...L&&L.length>0&&{annotations:L},...I&&{xExtent:I},...B&&{yExtent:B},...ce,...F};return oe||ne||(me?So(V,{componentName:"CandlestickChart",message:me,width:G,height:z}):So(Y,{componentName:"CandlestickChart",width:G,height:z,children:So(l,{ref:i,...ue})}))});Co.displayName="CandlestickChart";import{forwardRef as Lo,useMemo as Ho}from"react";import{jsx as Io}from"react/jsx-runtime";var Bo=Lo(function(e,t){const{data:o,layout:n,layoutConfig:i,onLayoutError:a,xExtent:s,yExtent:c,showAxes:h=!1,margin:u,className:p,annotations:f,onObservation:y,onClick:g,selection:b,linkedHover:v,chartId:x,loading:A,loadingContent:w,emptyContent:S,colorBy:C,colorScheme:L,legend:H,frameProps:I={}}=e,{legend:B,...F}=I,R=Ho(()=>k(B,H),[B,H]),{frameRef:_,resolved:N,safeData:P,setup:W,earlyReturn:D}=r({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:C,colorScheme:L,legend:R,selection:b,linkedHover:v,onObservation:y,onClick:g,chartId:x,loading:A,loadingContent:w,emptyContent:S,margin:u,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),M=W.effectiveSelectionHook,E=Ho(()=>M?.isActive?{isActive:!0,predicate:M.predicate}:null,[M?.isActive,M?.predicate]);if(D)return D;const{width:O,height:T,enableHover:G,showGrid:z,title:j,description:$,summary:Q,accessibleTable:X,xLabel:V,yLabel:q}=N,J={chartType:"custom",...null!=o&&{data:P},customLayout:n,layoutConfig:i,onLayoutError:a,...E&&{layoutSelection:E},xExtent:s,yExtent:c,colorAccessor:C,colorScheme:L,size:[O,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:W.margin,showAxes:h,xLabel:V,yLabel:q,enableHover:G,showGrid:z,...W.legendBehaviorProps,...d({title:j,description:$,summary:Q,accessibleTable:X,className:p,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...null!=e.tooltip&&{tooltipContent:e.tooltip},...m({linkedHover:v,selection:b,onObservation:y,onClick:g,hoverHighlight:!1,mobileInteraction:W.mobileInteraction,customHoverBehavior:W.customHoverBehavior,customClickBehavior:W.customClickBehavior}),...f&&f.length>0&&{annotations:f},...W.crosshairProps,...F};return Io(Y,{componentName:"XYCustomChart",width:O,height:T,children:Io(l,{ref:_,...J})})});Bo.displayName="XYCustomChart";export{Ae as Scatterplot,Ie as ConnectedScatterplot,Oe as LineChart,Ve as AreaChart,nt as DifferenceChart,lt as StackedAreaChart,pt as Heatmap,xt as BubbleChart,Ot as ScatterplotMatrix,Ut as MinimapChart,oo as DEFAULT_QUADRANTS,so as QuadrantChart,xo as MultiAxisLineChart,Co as CandlestickChart,Bo as XYCustomChart};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{STREAMING_PALETTE as e,createColorScale as t,filterSparseArray as r,getCrosshairProps as o,resolveMobileInteraction as n,useCategoryColors as a,useChartLegendAndMargin as i,useChartMode as l,useChartSelection as c,useColorScale as u,useLegendInteraction as s,useThemeCategorical as g}from"./chunk-chunk-CWQ5YIHX.module.min.js";import{useThemeSelector as d}from"./chunk-chunk-WCX6U47H.module.min.js";import{renderEmptyState as m,renderLoadingState as h}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useMemo as p}from"react";function y(e){const t=d(e=>e.theme.colors.selectionOpacity);return p(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}import{useCallback as f,useMemo as v,useState as b}from"react";function L(l){const{data:d,rawData:p,colorBy:L,colorScheme:k,legendInteraction:C,legendPosition:H,selection:S,linkedHover:w,fallbackFields:B,unwrapData:D=!1,onObservation:M,chartType:I,chartId:R,showLegend:F,legend:A,userMargin:P,marginDefaults:T,onClick:O,hoverHighlight:W,mobileInteraction:x,mobileSemantics:j,loading:z,loadingContent:G,emptyContent:N,width:X,height:_}=l,Q=void 0===p,U=v(()=>r(d),[d]),[V,Y]=b([]),q=f(e=>{Y(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),E="string"==typeof l.colorBy?l.colorBy:void 0,J=v(()=>n(x,{width:X,mobileSemantics:j}),[x,X,j]),{activeSelectionHook:K,hoverSelectionHook:Z,customHoverBehavior:$,customClickBehavior:ee,crosshairSourceId:te}=c({selection:S,linkedHover:w,fallbackFields:B,unwrapData:D,onObservation:M,chartType:I,chartId:R,onClick:O,hoverHighlight:W,colorByField:E,mobileInteraction:J}),re=o(w,te),oe=u(U,L,k),ne=v(()=>{if(!L)return[];const e=new Set;for(const t of U){const r="function"==typeof L?L(t):t[L];null!=r&&e.add(r+"")}return Array.from(e)},[U,L]),ae=v(()=>Q&&V.length>0?V:ne,[Q,V,ne]),ie=s(C,L,ae),le=v(()=>Z||(ie.legendSelectionHook?ie.legendSelectionHook:K),[Z,ie.legendSelectionHook,K]),ce=y(S),ue=g(),se=a(),ge=v(()=>{if(oe)return oe;if(!L||0===ae.length)return;const r=Array.isArray(k)&&k.length>0||"string"==typeof k&&k.length>0?k:ue&&ue.length>0?ue:e,o="__streamCat",n=ae.map(e=>({[o]:e})),a=t(n,o,r);return e=>se?.[e]||a(e)||"#999"},[oe,L,ae,k,ue,se]),{legend:de,margin:me,legendPosition:he}=i({data:U,colorBy:L,colorScale:ge,showLegend:F,legendPosition:H,userMargin:P,defaults:T,categories:ae,additionalLegend:A}),pe=v(()=>{const e={};return de&&(e.legend=de,e.legendPosition=he),C&&"none"!==C&&(e.legendHoverBehavior=ie.onLegendHover,e.legendClickBehavior=ie.onLegendClick,e.legendHighlightedCategory=ie.highlightedCategory,e.legendIsolatedCategories=ie.isolatedCategories),Q&&L&&(e.legendCategoryAccessor=L,e.onCategoriesChange=q),e},[de,he,C,ie.onLegendHover,ie.onLegendClick,ie.highlightedCategory,ie.isolatedCategories,Q,L,q]),ye=Array.isArray(p)?r(p):p,fe=h(z,X,_,G),ve=fe?null:m(ye,X,_,N);return{data:U,colorScale:oe,allCategories:ae,legendState:ie,effectiveSelectionHook:le,activeSelectionHook:K,customHoverBehavior:$,customClickBehavior:ee,mobileInteraction:J,legend:de,margin:me,legendPosition:he,earlyReturn:fe||ve||null,legendBehaviorProps:pe,crosshairProps:re,resolvedSelection:ce}}import{useImperativeHandle as k,useRef as C}from"react";function H(e,t){const{variant:r,frameRef:o,overrides:n}=t,a=C(n);a.current=n,k(e,()=>{const e=function(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const r=Array.isArray(t)?t:[t],o=e.current?.getTopology()?.nodes??[],n=[];for(const t of r){const r=o.find(e=>e.id===t);r&&n.push({...r.data??{},id:t}),e.current?.removeNode(t)}return n},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const o=e.current?.updateNode(t,r);return o?[{...o,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{const o=e.current?.removePoint(t)??[];for(const t of o)e.current?.push(r(t));return o},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{const o=r.current?.removeLine(e)??[];for(const e of o)r.current?.pushLine(t(e));return o},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}(r,o);return new Proxy(e,{get(e,t,r){if("string"==typeof t){const e=a.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!a.current||!(t in a.current))||Reflect.has(e,t)})},[])}function S(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));const r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function w(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}import{useMemo as B,useRef as D}from"react";function M(e){const t=D(null);return H(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:l(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:B(()=>w(e.margin),[e.margin])}}function I(e){const t=M(e),{resolved:r,normalizedMargin:o}=t,n=L({data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:void 0,selection:e.selection,linkedHover:e.linkedHover,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:r.showLegend,legend:e.legend,userMargin:o,marginDefaults:r.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:r.width,height:r.height});return{...t,safeData:n.data,setup:n,earlyReturn:n.earlyReturn}}export{y as useResolvedSelection,L as useChartSetup,H as useFrameImperativeHandle,S as mergeShapeStyle,w as normalizePartialMargin,M as useCustomChartScaffold,I as useCustomChartSetup};
|