semiotic 3.8.6 → 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 +33 -7
- package/README.md +82 -55
- package/ai/behaviorContracts.cjs +86 -1
- package/ai/componentMetadata.cjs +4 -9
- package/ai/dist/mcp-server.js +97 -10
- package/ai/examples.md +154 -7
- package/ai/schema.json +1611 -145
- package/ai/surface-manifest.json +12 -10
- package/ai/system-prompt.md +9 -3
- package/dist/{chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js → chunk-chartContainerDataAudit-JDSVSKGM.module.min.js} +1 -1
- package/dist/chunk-chunk-2YAZHXL4.module.min.js +2 -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-Q2BS46W2.module.min.js → chunk-chunk-DIVE2DRA.module.min.js} +1 -1
- 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-RA7JCG7D.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-XP3OHHFX.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-SMVD3EQJ.module.min.js → chunk-chunk-MX35T6RX.module.min.js} +1 -1
- 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-GFTVACTO.module.min.js → chunk-chunk-OI7R7EJB.module.min.js} +1 -1
- package/dist/{chunk-chunk-OM6NWS4H.module.min.js → chunk-chunk-ONMLEXHR.module.min.js} +1 -1
- 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 +4 -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/index.d.ts +4 -4
- 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/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +8 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +7 -0
- package/dist/components/data/portability/capabilityBinding.d.ts +41 -0
- package/dist/components/data/portability/index.d.ts +2 -0
- package/dist/components/legendLayout.d.ts +56 -0
- 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 +4 -3
- 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 +4 -0
- package/dist/components/semiotic-physics.d.ts +9 -6
- package/dist/components/semiotic-recipes-core.d.ts +6 -1
- 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 +2 -2
- package/dist/components/server/serverChartConfigsPhysics.d.ts +2 -2
- package/dist/components/server/serverChartConfigsXY.d.ts +0 -1
- package/dist/components/server/staticLegend.d.ts +6 -0
- package/dist/components/server/staticSVGChrome.d.ts +10 -2
- package/dist/components/server/staticValue.d.ts +8 -0
- package/dist/components/stream/geoPipelineConfig.d.ts +10 -0
- package/dist/components/stream/legendRenderer.d.ts +8 -0
- package/dist/components/stream/physics/PhysicsEvidence.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +9 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +5 -0
- 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/types.d.ts +2 -0
- package/dist/components/types/legendTypes.d.ts +17 -1
- 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 +4 -3
- 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 +4 -0
- package/dist/semiotic-physics.d.ts +9 -6
- 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.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-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.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-2CHN2TA3.module.min.js +0 -1
- package/dist/chunk-chunk-3SHB24AG.module.min.js +0 -1
- package/dist/chunk-chunk-4MMOOYTX.module.min.js +0 -2
- package/dist/chunk-chunk-5RKXZQ2P.module.min.js +0 -1
- package/dist/chunk-chunk-75OTQSXS.module.min.js +0 -1
- package/dist/chunk-chunk-7ALTGHK6.module.min.js +0 -1
- package/dist/chunk-chunk-A5GRQUOF.module.min.js +0 -1
- package/dist/chunk-chunk-AAF5LZAU.module.min.js +0 -2
- package/dist/chunk-chunk-ARZGA4LJ.module.min.js +0 -2
- package/dist/chunk-chunk-C4YA6TDR.module.min.js +0 -1
- package/dist/chunk-chunk-CAFLML4L.module.min.js +0 -2
- package/dist/chunk-chunk-CO5KQMGH.module.min.js +0 -1
- package/dist/chunk-chunk-FHBN7OEB.module.min.js +0 -2
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +0 -1
- package/dist/chunk-chunk-IP2UE74X.module.min.js +0 -1
- package/dist/chunk-chunk-ITDWLZXV.module.min.js +0 -2
- package/dist/chunk-chunk-JCG72SGW.module.min.js +0 -2
- package/dist/chunk-chunk-LPSPATPC.module.min.js +0 -1
- package/dist/chunk-chunk-PX5YQGDP.module.min.js +0 -2
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +0 -1
- package/dist/chunk-chunk-RCF52Z42.module.min.js +0 -2
- package/dist/chunk-chunk-RNUHEXZA.module.min.js +0 -2
- package/dist/chunk-chunk-ROZWKEUG.module.min.js +0 -1
- package/dist/chunk-chunk-T2FKJD4O.module.min.js +0 -2
- package/dist/chunk-chunk-UDREYOLV.module.min.js +0 -1
- package/dist/chunk-chunk-VOWE3SAP.module.min.js +0 -2
- package/dist/chunk-chunk-VQPNBUSW.module.min.js +0 -2
- package/dist/chunk-chunk-WAWCIHFJ.module.min.js +0 -1
- package/dist/chunk-chunk-WYARAXHR.module.min.js +0 -2
- package/dist/chunk-chunk-XV3KGYTR.module.min.js +0 -2
- package/dist/chunk-chunk-YC2IVEPX.module.min.js +0 -1
- package/dist/chunk-chunk-ZOAQDIJO.module.min.js +0 -1
- package/dist/chunk-chunk-ZXIXAPRE.module.min.js +0 -2
|
@@ -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,useChartSetup as i,useCustomChartSetup as r,useFrameImperativeHandle as n}from"./chunk-chunk-VQPNBUSW.module.min.js";import{DataSourceAdapter as s,IncrementalExtent as a,accessorsEquivalent as l,barCanvasRenderer as c,buildEnrichAnnotationData as h,buildRectNode as u,normalizeColorGradient as d,normalizeGradient as g,resolveAccessor as m,resolveAnnotationAccessor as p,resolveFrameGraphics as f,resolveStringAccessor as y,symbolCanvasRenderer as v,ticksForMode as b,toIdSet as x}from"./chunk-chunk-XV3KGYTR.module.min.js";import{RingBuffer as w,compactTimestampBufferForRemoval as A,computePulseIntensity as k,createTimestampBufferForData as S,ensureRingBufferCapacity as _,hasActivePulses as C,pointCanvasRenderer as P,pushWithTimestamp as R,refreshIdlePulse as M,setPulseState as L,useLegendCategoryEmission as I,useOrdinalKeyboardNavigation as T,useSemanticFrameInteractions as H}from"./chunk-chunk-OM6NWS4H.module.min.js";import{StalenessBadge as B,attachUpdateResultStore as F,buildBaseMetadataProps as O,buildCustomBehaviorProps as E,buildDatumIndexMap as N,buildOrdinalTooltip as D,buildTooltipProps as W,composeOverlays as j,computeDecayOpacity as z,createCustomLayoutFailureDiagnostic as G,filterAnnotationsByStatus as $,findHitPointInQuadtree as V,getHitRadius as q,glyphCanvasRenderer as X,hitTestRect as Y,normalizeAngle as Q,paintSceneWithBackend as K,renderPathPulse as Z,renderSceneWithBackend as U,useConfigSync as J,useLayoutSelectionSync as ee,useStableShallow as te,useStalenessCheck as oe,warnCustomLayoutDiagnostics as ie}from"./chunk-chunk-WYARAXHR.module.min.js";import{wrapWithCustomLayoutSelection as re}from"./chunk-chunk-5UKL5W76.module.min.js";import{makeRuleValueResolver as ne,resolveStyleRules as se}from"./chunk-chunk-EMO5NUGE.module.min.js";import{buildResolveColor as ae,resolveCustomLayoutPalette as le}from"./chunk-chunk-RA7JCG7D.module.min.js";import{AccessibleDataTable as ce,AriaLiveTooltip as he,CanvasFrameBackground as ue,FlippingTooltip as de,FocusRing as ge,STREAMING_PALETTE as me,SYMBOL_SEQUENCE as pe,SceneRevisionDiagnosticsObserver as fe,ScreenReaderSummary as ye,SkipToTableLink as ve,TITLE_BASELINE as be,UpdateResultTracker as xe,annotationLayout as we,annularSectorPath as Ae,buildGaugeGradientGeometry as ke,buildHoverData as Se,coerceCanvasFill as _e,computeCanvasAriaLabel as Ce,computeEasing as Pe,computeRawProgress as Re,createColorScale as Me,createDefaultAnnotationRules as Le,createHatchPattern as Ie,createLegend as Te,defaultTooltipStyle as He,filterSparseArray as Be,getColor as Fe,getDevicePixelRatio as Oe,getSize as Ee,interpolateBrBG as Ne,interpolatePRGn as De,interpolatePiYG as We,interpolateRdBu as je,interpolateRdYlBu as ze,interpolateRdYlGn as Ge,interpolateSpectral as $e,isAnnotationActivationTarget as Ve,isHatchFill as qe,isServerEnvironment as Xe,lerp as Ye,normalizeLinkedBrush as Qe,normalizeTooltip as Ke,now as Ze,observationInputType as Ue,ordinalSceneNodeToSVG as Je,parseCanvasColor as et,renderAnnotationPass as tt,renderLegendFromConfig as ot,resolveCSSColor as it,resolveCanvasFill as rt,resolveDefaultFill as nt,smartTooltipEntries as st,symbolRadius as at,useAnnotationActivationOptions as lt,useBrushSelection as ct,useCategoryColors as ht,useChartMode as ut,useFrame as dt,useFrameCanvasHost as gt,useLinkedChartCategories as mt,useSceneRevisionDiagnostics as pt,useSortedData as ft,useThemeCategorical as yt,useThemeDiverging as vt,wrapStyleWithSelection as bt}from"./chunk-chunk-PX5YQGDP.module.min.js";import{getMax as xt,getMinMax as wt}from"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveThemeSemanticColors as At}from"./chunk-chunk-WCX6U47H.module.min.js";import{glyphHitGeometry as kt}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as St,SafeRender as _t,useHydration as Ct,useWasHydratingFromSSR as Pt,warnMissingField as Rt}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useRef as Mt,useState as Lt,useEffect as It,useMemo as Tt,useCallback as Ht,useImperativeHandle as Bt,forwardRef as Ft,memo as Ot}from"react";import{scaleBand as Et,scaleLinear as Nt}from"d3-scale";var Dt=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){const i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:e.barColors[o]||"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){const o=this.colorSchemeMap.get(t);if(o)return o;const i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||me,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};function Wt(e){const t=e.getSymbol;if(!t)return null;const o=e.config.symbolMap,i=new Map;let r=0;return e=>{const n=t(e)+"",s=o?.[n];if(s)return s;let a=i.get(n);return a||(a=pe[r%pe.length],r++,i.set(n,a)),a}}function jt(e,t,o,i,r,n,s){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*n*n,symbolType:t(o),style:s,datum:o}:{type:"point",x:i,y:r,r:n,style:s,datum:o})}function zt(e,t){const{columns:o,config:i,resolvePieceStyle:r}=e,n=[],s=Math.min(t.width,t.height)/2-4,a="donut"===i.chartType?i.innerRadius||60:0,l=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,u=Object.values(o),d=u.some(e=>{const t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),g=h&&!d&&u.length>1&&(i.cornerRadius??0)>0;for(let e=0;u.length>e;e++){const t=u[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d=l+h*c,m=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===u.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:a,outerRadius:s,startAngle:d,endAngle:m,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:g&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),n.push(v)}return n}import{quantile as Gt}from"d3-array";function $t(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Gt(e,.25)??o,median:Gt(e,.5)??(o+i)/2,q3:Gt(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as Vt}from"d3-scale";var qt={bar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getStack:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,h=[],d="vertical"===c,g="horizontal"===c,m=r.normalize,p=[];if(s){const e=new Set;for(const t of Object.values(i))for(const o of t.pieceData){const t=s(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(const e of Object.values(i)){const t=new Map;for(const o of e.pieceData){const e=s?s(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(m)for(const e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(const n of p){const c=t.get(n);if(!c)continue;let p=c.total;m&&o>0&&(p/=o);const f=a(c.pieces[0],s?n:e.name),y={...c.pieces[0],__aggregateValue:c.total,__pieceCount:c.pieces.length,category:e.name};if(d){const t=l(0>p?r:i+p),o=0>p?l(r+p)-l(r):l(i)-l(i+p);h.push(u(e.x,t,e.width,Math.abs(o),f,y,n)),0>p?r+=p:i+=p}else if(g){const t=l(0>p?r+p:i),o=0>p?l(r)-l(r+p):l(i+p)-l(i);h.push(u(t,e.x,Math.abs(o),e.width,f,y,n)),0>p?r+=p:i+=p}}}const f="vertical"===c,y=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of h){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(y>0){const e=new Map;for(const t of h){if("rect"!==t.type)continue;const o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(const t of e.values()){if(0===t.length)continue;const e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));e.length>0&&(e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t).roundedTop=y),o.length>0&&(o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t).roundedTop=y)}}return h},clusterbar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getGroup:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,h=[],d="vertical"===c,g=[],m=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=s?s(t):"_default";m.has(e)||(m.add(e),g.push(e))}const p=g.length||1;for(const e of Object.values(i)){const t=e.width/p,o=.2*t,i=t-o,r=new Map;for(const t of e.pieceData){const e=s?s(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let s=0;g.length>s;s++){const c=r.get(g[s])||[];for(const r of c){const c=n(r),m=a(r,g[s]);if(d){const n=e.x+s*t+o/2,a=l(0),d=l(c);h.push(u(n,Math.min(a,d),i,Math.abs(a-d),m,r,g[s]))}else{const n=e.x+s*t+o/2,a=l(0),d=l(c);h.push(u(Math.min(a,d),n,Math.abs(d-a),i,m,r,g[s]))}}}}const f=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of h){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=n(e.datum);f>0&&(e.roundedTop=f),e.roundedEdge=d?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}return h},point:function(e,t){const{scales:o,columns:i,getR:r,multiScales:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=n.length>0,g=Wt(e),m=2*Math.PI,p=-Math.PI/2;for(const e of Object.values(i))for(const t of e.pieceData){const o=t.__rIndex??0,i=t.__rValue??r(t),l=d&&n[o]||a,f=s(t,e.name),y=f.r||5;let v,b;if(u){const t=p+(e.pctStart+e.pct/2)*m,o=l(i);v=Math.cos(t)*o,b=Math.sin(t)*o}else h?(v=e.middle,b=l(i)):(v=l(i),b=e.middle);jt(c,g,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="vertical"===a,h=Wt(e);for(const e of Object.values(i)){const t=e.width/2;for(let o=0;e.pieceData.length>o;o++){const i=e.pieceData[o],a=r(i),u=n(i,e.name),d=u.r||4,g=(7919*o%100/100-.5)*t*.8;jt(l,h,i,c?e.middle+g:s(a),c?s(a):e.middle+g,d,u)}}return l},pie:zt,donut:zt,boxplot:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=!1!==r.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],r=o[o.length-1],l=Gt(o,.25)??i,d=Gt(o,.5)??(i+r)/2,g=Gt(o,.75)??r,m=g-l,p=l-1.5*m,f=g+1.5*m,y=o.find(e=>e>=p)??i,v=[...o].reverse().find(e=>f>=e)??r,b=s(t.pieceData[0],t.name),x=[];if(u)for(const e of t.pieceData){const o=n(e);if(p>o||o>f){const i=h?t.middle:a(o),r=h?a(o):t.middle;x.push({px:i,py:r,value:o,datum:e})}}if(c.push({type:"boxplot",x:h?t.middle:0,y:h?0:t.middle,projection:h?"vertical":"horizontal",columnWidth:.6*t.width,minPos:a(y),q1Pos:a(l),medianPos:a(d),q3Pos:a(g),maxPos:a(v),stats:{n:o.length,min:y,q1:l,median:d,q3:g,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),u)for(const t of x)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:b.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=r.bins||20,d=!1!==r.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],r=(i-o)/u||1,l=Array(u).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/r),u-1)]++;const g=xt(l,1),m=e.width/2*.9;let p;if(h){p=`M ${e.middle} ${a(o)}`;for(let t=0;u>t;t++){const i=a(o+(t+.5)*r);p+=` L ${e.middle+l[t]/g*m} ${i}`}p+=` L ${e.middle} ${a(i)}`;for(let t=u-1;t>=0;t--){const i=a(o+(t+.5)*r);p+=` L ${e.middle-l[t]/g*m} ${i}`}p+=" Z"}else{p=`M ${a(o)} ${e.middle}`;for(let t=0;u>t;t++)p+=` L ${a(o+(t+.5)*r)} ${e.middle-l[t]/g*m}`;p+=` L ${a(i)} ${e.middle}`;for(let t=u-1;t>=0;t--)p+=` L ${a(o+(t+.5)*r)} ${e.middle+l[t]/g*m}`;p+=" Z"}const f=s(e.pieceData[0],e.name);let y;if(d&&t.length>=4){const r=Gt(t,.25)??o,n=Gt(t,.5)??(o+i)/2,s=Gt(t,.75)??i;y={q1Pos:a(r),medianPos:a(n),q3Pos:a(s),centerPos:e.middle,isVertical:h}}const v=h?{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))}:{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width};c.push({type:"violin",pathString:p,translateX:0,translateY:0,bounds:v,iqrLine:y,stats:$t(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a}=o,l=[],c=r.bins||25,h=r.normalize,d=a.domain?.(),g=d?+d[0]:void 0,m=d?+d[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=wt(t),r=null!=g&&isFinite(g)?g:o,d=null!=m&&isFinite(m)?m:i,p=(d-r)/c||1,f=Array(c).fill(0);for(const e of t)r>e||e>d||f[Math.min(Math.floor((e-r)/p),c-1)]++;const y=t.length,v=xt(f,1),b=s(e.pieceData[0],e.name);for(let t=0;c>t;t++){if(0===f[t])continue;const o=(h?f[t]/y:f[t]/v)*e.width*.9,i=a(r+t*p),n=a(r+(t+1)*p);l.push(u(Math.min(i,n),e.x+e.width-o,Math.abs(n-i),o,b,{bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name},e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h=r.bins||20,u="horizontal"===l,d=r.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],r=(i-o)/h||1,l=Array(h).fill(0);for(const e of t)o>e||e>i||l[Math.min(Math.floor((e-o)/r),h-1)]++;const g=xt(l,1),m=s(e.pieceData[0],e.name),p=e.width*d;let f;if(u){const t=e.x+e.width;f=`M ${a(o)} ${t}`;for(let e=0;h>e;e++)f+=` L ${a(o+(e+.5)*r)} ${t-l[e]/g*p}`;f+=` L ${a(i)} ${t} Z`}else{const t=e.x;f=`M ${t} ${a(o)}`;for(let e=0;h>e;e++){const i=a(o+(e+.5)*r);f+=` L ${t+l[e]/g*p} ${i}`}f+=` L ${t} ${a(i)} Z`}const y=u?{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width}:{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))};c.push({type:"violin",pathString:f,translateX:0,translateY:0,bounds:y,stats:$t(t),style:{...m,fillOpacity:m.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="horizontal"===a;for(const e of Object.values(i))for(const t of e.pieceData){const o=r(t);if(!o)continue;const[i,a]=o,h=n(t,e.name);if(c){const o=s(Math.min(i,a)),r=s(Math.max(i,a));l.push(u(o,e.x,r-o,e.width,h,t,e.name))}else{const o=s(Math.max(i,a)),r=s(Math.min(i,a));l.push(u(e.x,o,e.width,r-o,h,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n}=e,s=[],a=t.width/2,l=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return s;const h=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=r?r(t):"_default";d.has(e)||(d.add(e),h.push(e))}const g=h.length>1&&"_default"!==h[0],m=[];let p=0;for(const e of c){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}m.push({col:e,groups:t,stepTotal:o}),g||o>p&&(p=o)}if(g)for(const e of m){let t=0,o=0;for(let i=0;h.length>i;i++){const r=e.groups.get(h[i]);r&&(i%2==0?t+=r.total:o+=r.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return s;const f=new Map;for(const e of h){const t=m[0].groups.get(e);f.set(e,t?.total??0)}const y=m[0].stepTotal,v=g?.95*a:.9*t.width,b=Vt().domain([0,p]).range([0,v]),x=e.config.connectorOpacity??.3;let w=new Map;for(let t=0;m.length>t;t++){const o=m[t],i=o.col,r=0===t,c=i.width,d=.55*c,p=i.x+(c-d)/2,v=new Map;if(g){let e=0;for(const t of h){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=a,c=a;for(let g=0;h.length>g;g++){const m=h[g],y=o.groups.get(m);if(!y)continue;const x=b(y.total),w=g%2==0,A=w?t:c-x;w?t+=x:c-=x;const k=n(y.pieces[0],m),S=f.get(m)??y.total,_={...y.pieces[0],__funnelValue:y.total,__funnelPercent:S>0?y.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:m};l&&(0===g&&(_.__funnelStepLabel=i.name,_.__funnelStepLabelX=a,_.__funnelStepLabelY=p,_.__funnelRowWidth=e),_.__funnelValueLabelX=A+x/2,_.__funnelValueLabelY=p,_.__funnelBarW=x),s.push(u(A,p,x,d,k,_,m)),v.set(m,{x:A,y:p,w:x,h:d})}}else{const e=o.stepTotal,t=b(e),c=a-t/2,g=h[0],m="_default"!==g,f=o.groups.get(g)?.pieces[0]??i.pieceData[0],x=m?g:i.name,w=n(f,x),A=y>0?e/y*100:0,k={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:r,category:m?g:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=a,k.__funnelStepLabelY=p,k.__funnelRowWidth=t,k.__funnelValueLabelX=a,k.__funnelValueLabelY=p,k.__funnelBarW=t),s.push(u(c,p,t,d,w,k,x)),v.set(g,{x:c,y:p,w:t,h:d})}if(t>0&&w.size>0){const t=g?h:[h[0]];for(const r of t){const t=w.get(r),a=v.get(r);if(!t||!a)continue;const l=(()=>{const e=o.groups.get(r);return n(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[a.x+a.w,a.y],[a.x,a.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:x},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};s.push(c)}}w=v}return s},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n,scales:s}=e,a=[],l=s.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return a;const c=[],h=new Set;for(const e of l)for(const t of e.pieceData){const e=r?r(t):"_default";h.has(e)||(h.add(e),c.push(e))}const d=c.length>1&&"_default"!==c[0],g=[];for(const e of l){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}g.push({col:e,groups:t,stepTotal:o})}const m=new Map;for(const e of c){const t=g[0]?.groups.get(e);m.set(e,t?.total??0)}const p=s.r,f=d?c.length:1,y=d?.15:0;for(let e=0;g.length>e;e++){const t=g[e],o=t.col,i=0===e,r=e>0?g[e-1]:null,s=o.width/f,l=s*y,h=s-l;for(let e=0;c.length>e;e++){const g=c[e],f=t.groups.get(g);if(!f)continue;const y=f.total,v=m.get(g)??y,b=v>0?y/v*100:0,x=r?.groups.get(g),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*s+l/2,k=p(y),S=p(0)-k,_=n(f.pieces[0],d?g:o.name),C={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name,__barFunnelLabelX:A+h/2,__barFunnelLabelY:p(y+w)};if(a.push(u(A,k,h,S,_,C,d?g:o.name)),w>0){const e=p(y+w),t=k-e,i={..._},r={...f.pieces[0],__barFunnelValue:w,__barFunnelPercent:v>0?w/v*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name};a.push(u(A,e,h,t,i,r,d?g:o.name))}}}return a},swimlane:function(e,t){const{scales:o,columns:i,getR:r,getStack:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="horizontal"===l,d=e.config.gradientFill,g=h?"left":"bottom",m=e.config.trackFill;if(m){const e="string"==typeof m?m:m.color,t="string"==typeof m?1:m.opacity??1,[o,r]=a.range(),n=Math.min(o,r),s=Math.abs(r-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},r=h?u(n,o.x,s,o.width,i,null,"__track__"):u(o.x,n,o.width,s,i,null,"__track__");c.push(r)}}const p=e.config.roundedTop&&e.config.roundedTop>0?Math.max(0,e.config.roundedTop):0;for(const e of Object.values(i)){let t=0;const o=c.length;for(const o of e.pieceData){const i=Math.abs(r(o));if(0===i)continue;const l=n?n(o):e.name,m=s(o,l);let p;if(h){const r=a(t),n=a(t+i);p=u(r,e.x,n-r,e.width,m,o,l)}else{const r=a(t+i),n=a(t);p=u(e.x,r,e.width,n-r,m,o,l)}d&&(p.fillGradient=d,p.roundedEdge=g),c.push(p),t+=i}if(p>0&&c.length>o){const e=c.slice(o),t=e[0],i=e[e.length-1];1===e.length?t.cornerRadii={tl:p,tr:p,br:p,bl:p}:h?(t.cornerRadii={tl:p,bl:p},i.cornerRadii={tr:p,br:p}):(t.cornerRadii={bl:p,br:p},i.cornerRadii={tl:p,tr:p})}}return c}},Xt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yt=["scene-style","data-paint","accessibility","evidence"],Qt=(e,t)=>({retainedData:e,invalidations:t}),Kt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Zt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ut=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jt=["scene-geometry","data-paint","accessibility","evidence"],eo=["scene-style","data-paint","accessibility","evidence"],to=[],oo={chartType:Qt("rebuild",Kt),runtimeMode:Qt("rebuild",Kt),categoryAccessor:Qt("rebuild",Kt),valueAccessor:Qt("rebuild",Kt),oAccessor:Qt("rebuild",Kt),rAccessor:Qt("rebuild",Kt),stackBy:Qt("rebuild",Kt),groupBy:Qt("rebuild",Kt),timeAccessor:Qt("rebuild",Kt),accessorRevision:Qt("rebuild",Kt),colorAccessor:Qt("rebuild",eo),symbolAccessor:Qt("rebuild",Jt),connectorAccessor:Qt("rebuild",Jt),dataIdAccessor:Qt("rebuild",Jt),projection:Qt("preserve",Zt),extentPadding:Qt("preserve",Zt),axisExtent:Qt("preserve",Zt),rExtent:Qt("preserve",Zt),oExtent:Qt("preserve",Zt),multiAxis:Qt("preserve",Zt),normalize:Qt("preserve",Zt),bins:Qt("preserve",Zt),oSort:Qt("preserve",Ut),barPadding:Qt("preserve",Ut),roundedTop:Qt("preserve",Ut),baselinePadding:Qt("preserve",Ut),innerRadius:Qt("preserve",Ut),cornerRadius:Qt("preserve",Ut),startAngle:Qt("preserve",Ut),sweepAngle:Qt("preserve",Ut),trackFill:Qt("preserve",Ut),showOutliers:Qt("preserve",Ut),showIQR:Qt("preserve",Ut),amplitude:Qt("preserve",Ut),connectorOpacity:Qt("preserve",Ut),showLabels:Qt("preserve",Ut),dynamicColumnWidth:Qt("rebuild",Ut),customLayout:Qt("preserve",Ut),layoutConfig:Qt("preserve",Ut),layoutMargin:Qt("preserve",Ut),symbolMap:Qt("preserve",Jt),pieceStyle:Qt("preserve",eo),summaryStyle:Qt("preserve",eo),connectorStyle:Qt("preserve",eo),gradientFill:Qt("preserve",eo),colorScheme:Qt("preserve",eo),themeCategorical:Qt("preserve",eo),themeSemantic:Qt("preserve",eo),themeSequential:Qt("preserve",eo),themeDiverging:Qt("preserve",eo),barColors:Qt("preserve",eo),decay:Qt("preserve",eo),pulse:Qt("preserve",eo),staleness:Qt("preserve",eo),layoutSelection:Qt("preserve",eo),windowSize:Qt("preserve",to),windowMode:Qt("preserve",to),clock:Qt("preserve",to),transition:Qt("preserve",to),introAnimation:Qt("preserve",to),onLayoutError:Qt("preserve",to)},io=Qt("preserve",Ut),ro=class{constructor(){this.tracker=new xe}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Xt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Yt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=oo[i]??io;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as no}from"d3-quadtree";var so=class{constructor(e){this.rExtent=new a,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new ro,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Dt,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new w(e.windowSize),this.getO=y(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>m(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new a)):(this.getR=m(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=y(e.stackBy),this.getGroup=y(e.groupBy),this.getColor=y(e.colorAccessor),this.getSymbol=y(e.symbolAccessor),this.getConnector=y(e.connectorAccessor),this.getDataId=y(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new w(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:S(t,i):null)}currentTime(){return this.config.clock?.()??Ze()}ingest(e){const t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),_(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)R(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(const o of e.inserts){const e=R(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){const t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;const o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){const{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,n=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);const s=this.getBufferArray(),a=t.projection||"vertical",l=t.oExtent||this.resolveCategories(s),c=this.computeValueDomain(s,l),h="horizontal"===a,u="radial"===a,d=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===a?e.width:e.height):.1));let g,m;if(u){g=Et().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;m=Nt().domain(c).range([i,o])}else h?(g=Et().domain(l).range([0,e.height]).padding(d),m=Nt().domain(c).range([0,e.width])):(g=Et().domain(l).range([0,e.width]).padding(d),m=Nt().domain(c).range([e.height,0]));this.scales={o:g,r:m,projection:a},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{const n=this.rExtents[r];n.dirty&&n.recalculate(o,i);let[s,a]=n.extent;s===1/0&&(s=0,a=1);const l=a-s,c=l>0?l*(t.extentPadding??.05):1;return s-=c,a+=c,s>0&&(s=0),h?Nt().domain([s,a]).range([0,e.width]):Nt().domain([s,a]).range([e.height,0])}):[];let p=s;this.rAccessors.length>1&&(p=s.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,l,g,a,e),this._customLayoutFailedThisBuild=!1;const f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=n):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){const t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){const t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t;let r=null;if(o){r=new Set;for(const t of e)r.add(this.getO(t))}const n=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return n}if(!1===i)return n;if("function"==typeof i)return n.sort(i);const s=new Map;for(const t of e){const e=this.getO(t);s.set(e,(s.get(e)||0)+Math.abs(this.getR(t)))}return n.sort("asc"===i?(e,t)=>(s.get(e)||0)-(s.get(t)||0):(e,t)=>(s.get(t)||0)-(s.get(e)||0))}computeValueDomain(e,t){return function(e){const{data:t,chartType:o,projection:i,normalize:r,rExtent:n,extentPadding:s=.05,baselinePadding:a,axisExtent:l,getO:c,getR:h,getStack:u,rawRExtent:d}=e,g=s;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let m=0,p=0;if("bar"===o&&u&&r)m=0,p=1;else if("bar"===o&&u){const e=new Map,o=new Map;for(const i of t){const t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(const t of e.values())t>p&&(p=t);for(const e of o.values())m>e&&(m=e)}else if("bar"===o){const e=new Map;for(const o of t){const t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t),m>t&&(m=t)}else if("swimlane"===o){const e=new Map;for(const o of t){const t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(const e of t){const t=h(e);t>p&&(p=t),m>t&&(m=t)}else{const e=d[0],t=d[1];e!==1/0&&(m=e),t!==-1/0&&(p=t)}n&&(null!=n[0]&&(m=n[0]),null!=n[1]&&(p=n[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==n?.[0]&&null==n?.[1]&&(m>0&&(m=0),0>p&&(p=0)),"bar-funnel"!==o&&"exact"!==l){const e=p-m,t=e>0?e*g:1,i=f&&!a&&0===m,r=f&&!a&&0===p||"swimlane"===o;null!=n?.[0]||i||(m-=t),null!=n?.[1]||r||(p+=t)}return[m,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return function(e){const{data:t,oExtent:o,oScale:i,projection:r,layout:n,dynamicColumnWidth:s,getO:a,getR:l}=e,c={},h=new Map;for(const e of t){const t=a(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let u=0;if("radial"===r)for(const e of t)u+=Math.abs(l(e));let d=null;if(s&&"radial"!==r){d=new Map;let e=0;for(const t of o){const o=h.get(t)||[];let i;i="string"==typeof s?o.reduce((e,t)=>e+(Number(t[s])||0),0):s(o),d.set(t,i),e+=i}const t=("horizontal"===r?n.height:n.width)-i.padding()*i.step()*o.length;if(e>0)for(const[o,i]of d)d.set(o,i/e*t)}let g=0,m=0;for(const e of o){const t=h.get(e)||[],o=t.reduce((e,t)=>e+Math.abs(l(t)),0),r=u>0?o/u:0;let n,s;d?(n=m,s=d.get(e)||i.bandwidth(),m+=s+i.padding()*i.step()):(n=i(e)??0,s=i.bandwidth()),c[e]={name:e,x:n,y:0,width:s,middle:n+s/2,padding:i.padding()*i.step(),pieceData:t,pct:r,pctStart:g},g+=r}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){const o=this.buildLayoutContext(e,t);let i;try{i=this.config.customLayout(o)}catch(e){const t=null!==this.lastCustomLayoutResult,o=G("ordinal",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] ordinal customLayout threw:",e);try{this.config.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const r=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of r)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(r,this.config.layoutSelection??null)}return ie({label:"ordinal customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=qt[this.config.chartType];let r=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:r,getO:n}=e;if(!r||!o)return[];const s=[],{projection:a}=o,l=new Map;for(const e of t){if("point"!==e.type&&"rect"!==e.type)continue;const t=e.datum;if(!t)continue;const o=r(t);if(!o)continue;let i,s;"point"===e.type?(i=e.x,s=e.y):(i=e.x+e.w/2,s=e.y+("vertical"===a?0:e.h/2)),l.has(o)||l.set(o,[]),l.get(o).push({x:i,y:s,datum:t,category:n(t)})}const c=o.o.domain(),h=i.connectorStyle;for(const[t,o]of l)if(o.length>=2){o.sort((e,t)=>c.indexOf(e.category)-c.indexOf(t.category));for(let i=0;o.length-1>i;i++){const r=o[i],n=o[i+1],a="function"==typeof h?h(r.datum):h||{stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5};s.push({type:"connector",x1:r.x,y1:r.y,x2:n.x,y2:n.y,style:a,datum:r.datum,group:t})}}return s}(o,r);r=[...e,...r]}return r}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=le(o.colorScheme,o.themeCategorical,me),n=this.scales;return{data:e,scales:{o:n.o,r:n.r,projection:n.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===n.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:ae(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?z(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=N(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;const t=function(e,t){const o="function"==typeof t,i=o?null:t||"category",r=new Map;for(let n=0;e.length>n;n++){const s=e[n],a=o?t(s):s[i],l=r.get(a);l?l.push(n):r.set(a,[n])}return r}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){const e=function(e){let t=0,o=0;for(const i of e)"point"===i.type&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let r=0;for(const t of e)"point"===t.type&&(i[r++]=t);return{maxRadius:o,quadtree:no().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;const o=t.length;if(1>=o)return;const i=this.getDatumIndexMap(t);for(const t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type)continue;if(!t.datum)continue;const e=i.get(t.datum);if(null==e)continue;const r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,n){const s=e.color??"rgba(255,255,255,0.6)",a=e.glowRadius??4;let l=!1;for(const c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){const t=c.category;if(!t)continue;let i=0;for(const s of r(t)??[]){const t=o.get(s);null!=t&&(i=Math.max(i,k(e,t,n)))}l=L(c,i,s)||l;continue}if(null==c.datum)continue;const t=i.get(c.datum);if(null==t)continue;const h=o.get(t),u=null==h?0:k(e,h,n);l=L(c,u,s,a)||l}return l}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&C(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();const e=new Map,t=this.scales?.r(0)??0,o="horizontal"!==this.scales?.projection;let i;for(let r=0;this.scene.length>r;r++){const n=this.scene[r],s=this.getNodeKey(n,e);s&&("rect"===n.type?this.prevPositionMap.set(s,o?{x:n.x,y:t,w:n.w,h:0,opacity:n.style.opacity??1}:{x:t,y:n.y,w:0,h:n.h,opacity:n.style.opacity??1}):"point"===n.type?this.prevPositionMap.set(s,{x:n.x,y:n.y,r:0,opacity:0}):"wedge"===n.type&&(void 0===i&&(i=n.startAngle),this.prevPositionMap.set(s,{x:n.cx,y:n.cy,startAngle:i,endAngle:i,innerRadius:n.innerRadius,outerRadius:n.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){const o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}return"rect"===e.type?`r:${e.group||""}:${e.datum?.category??""}`:"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();const e=new Map;for(let t=0;this.scene.length>t;t++){const o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;const e=this.config.transition.duration??300;if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1;const o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){const r=this.scene[e],n=this.getNodeKey(r,i);if(!n)continue;r._transitionKey=n;const s=this.prevPositionMap.get(n);if("point"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,(s.x!==r.x||s.y!==r.y||void 0!==s.r&&s.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=s.x,r.y=s.y,void 0!==s.r&&(r.r=s.r),t=!0)):(r._targetOpacity=r.style.opacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,s.x===r.x&&s.y===r.y&&s.w===r.w&&s.h===r.h||(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=s.x,r.y=s.y,r.w=s.w??r.w,r.h=s.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(s)o.add(n),r._targetOpacity=r.style.opacity??1,s.startAngle===r.startAngle&&s.endAngle===r.endAngle||(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=s.startAngle,r.endAngle=s.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;const e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(n,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(const[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){const t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;const t=Re(e,this.activeTransition),o=Pe(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(const e of this.scene){const t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ye(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Ye(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ye(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;const i=this.prevPositionMap.get(t);if(!i)continue;e.x=Ye(i.x,e._targetX,o),e.y=Ye(i.y,e._targetY,o),void 0!==i.w&&(e.w=Ye(i.w,e._targetW,o),e.h=Ye(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style={...e.style,opacity:Ye(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){const i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=Ye(i.startAngle,e._targetStartAngle,o),e.endAngle=Ye(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(const e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=x(e),o=this.getDataId,i=e=>t.has(o(e));A(this.buffer,this.timestampBuffer,i);const r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=x(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});const n=this.buffer.update(e=>o.has(i(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){const o=this._customRestyle;if(o)for(const i of e){const e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){const t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!l(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!l(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!l(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(l(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=y(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){const e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],n=Array.isArray(o)?o:[o];if(r=i.length!==n.length||i.some((e,t)=>!l(e,n[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>m(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new a)):(this.getR=m(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!l(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?y(this.config.stackBy):void 0),"groupBy"in e&&!l(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?y(this.config.groupBy):void 0),"colorAccessor"in e&&!l(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?y(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!l(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?y(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!l(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?y(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function ao(e,t,o,i=30,r,n=0){let s=null;if(r){const e=V(r,t,o,i,n);e&&(s={datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const n of e){let e=null;switch(n.type){case"rect":if(null==n.datum)break;e=lo(n,t,o);break;case"point":if(r)break;e=co(n,t,o,i);break;case"symbol":e=ho(n,t,o,i);break;case"glyph":e=uo(n,t,o,i);break;case"wedge":if(null===n.datum)break;e=go(n,t,o);break;case"boxplot":e=mo(n,t,o);break;case"violin":e=po(n,t,o)}e&&i>e.distance&&(s&&e.distance>=s.distance||(s=e))}return s}function lo(e,t,o){const i=Y(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function co(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>q(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function ho(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>q(at(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function uo(e,t,o,i=30){if(null==e.datum)return null;const r=kt(e.glyph,e.size),n=e.x+r.centerDx,s=e.y+r.centerDy,a=t-n,l=o-s,c=Math.sqrt(a*a+l*l);return c>q(r.radius,i)?null:{datum:e.datum,x:n,y:s,distance:c}}function go(e,t,o){const i=t-e.cx,r=o-e.cy,n=Math.sqrt(i*i+r*r);if(e.innerRadius>n||n>e.outerRadius)return null;const s=Q(Math.atan2(r,i)),a=Q(e.startAngle),l=Q(e.endAngle);if(!(a>l?s>=a||l>=s:s>=a&&l>=s))return null;const c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function mo(e,t,o){const i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{const r=e.y-i,n=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>n))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function po(e,t,o){if(!e.bounds)return null;const{x:i,y:r,width:n,height:s}=e.bounds;return i>t||t>i+n||r>o||o>r+s?null:{datum:e.datum,x:i+n/2,y:r+s/2,distance:0,category:e.category,stats:e.stats}}F(so);import{useMemo as fo,useRef as yo}from"react";import{Fragment as vo,jsx as bo,jsxs as xo}from"react/jsx-runtime";function wo(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===s?.projection,g="horizontal"===s?.projection,m=fo(()=>!s||d?[]:(h||b(s.r,5,u)).map(e=>({value:e,pixel:s.r(e),label:(c||Ao)(e)})),[s,c,d,h,u]),p=l&&s&&!d,f=a&&s&&!d;return p||f?bo("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:xo("g",{transform:`translate(${n.left},${n.top})`,children:[p&&bo("g",{className:"ordinal-grid",children:m.map((e,i)=>bo("line",{x1:g?e.pixel:0,y1:g?0:e.pixel,x2:g?e.pixel:t,y2:g?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),f&&bo(vo,{children:xo(vo,g?{children:[bo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),bo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[bo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),bo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function Ao(e){return Math.round(100*e)/100+""}function ko(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:u,rFormat:d,showGrid:g,title:m,legend:p,legendHoverBehavior:f,legendClickBehavior:y,legendHighlightedCategory:v,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:k,annotations:S,onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R,autoPlaceAnnotations:M,svgAnnotationRules:L,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:F=!0,children:O}=e,E=lt({onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R}),N="radial"===s?.projection,D="horizontal"===s?.projection,W=!1!==l,j=!B||F,z=fo(()=>{if(!a||!W||!s||N)return[];const e=s.o.bandwidth(),t=s.o.domain().map((t,o)=>({value:t,pixel:(s.o(t)??0)+e/2,label:u?u(t,o):t}));if(2>=t.length)return t;const o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,D?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=D?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;const n=Math.max(...i)+r,l=Math.max(1,Math.ceil(n/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[a,W,s,u,N,D]),G=e.rTickValues,V=e.tickLabelEdgeAlign,q=e.axisExtent,X=fo(()=>a&&s&&!N?(G||b(s.r,5,q)).map(e=>({value:e,pixel:s.r(e),label:(d||Ao)(e)})):[],[a,s,d,N,G,q]),Y=yo(new Map),Q=yo(S?.length??0),K=S?.length??0;Q.current!==K&&(Q.current=K,Y.current=new Map);const Z=fo(()=>{if(!S||0===S.length)return null;const e=$(S),i=Le("ordinal",E),r="horizontal"===s?.projection,n=s?.o?e=>(s.o(e)??0)+s.o.bandwidth()/2:null,a={scales:s?{x:r?s.r:n||s.r,y:r&&n||s.r,time:s.r,value:s.r,o:s.o}:null,timeAxis:"x",xAccessor:I,yAccessor:T,width:t,height:o,data:H,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:Y.current},l=M?we({annotations:e,context:a,..."object"==typeof M?M:{}}):e;return tt(l,i,L,a)},[S,M,L,t,o,s,I,T,H,E]);return a||m||p||k||Z&&Z.length>0||g||O?xo("svg",{role:"img",width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[bo("title",{children:"string"==typeof m?m:"Ordinal Chart"}),bo("desc",{children:"string"==typeof m?m+" (ordinal data visualization)":"Ordinal data visualization"}),xo("g",{transform:`translate(${n.left},${n.top})`,children:[g&&s&&!N&&j&&bo("g",{className:"ordinal-grid",children:X.map((e,i)=>bo("line",{x1:D?e.pixel:0,y1:D?0:e.pixel,x2:D?e.pixel:t,y2:D?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),a&&s&&!N&&(()=>{const e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return bo("g",{className:"ordinal-axes",children:xo(vo,D?{children:[xo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&bo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),z.map((t,o)=>xo("g",{transform:`translate(0,${t.pixel})`,children:[bo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?bo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):bo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:bo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&bo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),xo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&bo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),j&&s?.r&&(()=>{const e=s.r(0);return e>1&&t-1>e?bo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),X.map((t,i)=>{const r=V?0===i?"start":i===X.length-1?"end":"middle":"middle";return xo("g",{transform:`translate(${t.pixel},${o})`,children:[bo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),bo("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&bo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[xo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&(()=>{const e=s?.r?s.r(0):o,i=0>e||e>o?o:e;return bo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),z.map((t,i)=>xo("g",{transform:`translate(${t.pixel},${o})`,children:[bo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?bo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):bo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:bo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&bo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),xo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&bo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),X.map((t,o)=>xo("g",{transform:`translate(0,${t.pixel})`,children:[bo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),bo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&bo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),Z,k,O]}),m&&"string"==typeof m?bo("text",{x:i/2,y:be,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:m}):m?bo("foreignObject",{x:0,y:0,width:i,height:n.top,children:m}):null,ot({legend:p,totalWidth:i,totalHeight:r,margin:n,legendPosition:w,title:m,legendLayout:A,legendHoverBehavior:f,legendClickBehavior:y,legendHighlightedCategory:v,legendIsolatedCategories:x})]}):null}import*as So from"react";import{jsx as _o}from"react/jsx-runtime";var Co=null,Po=null;function Ro(e){const[t,o]=So.useState(()=>Co);return So.useEffect(()=>{if(t)return;let e=!1;return(Co?Promise.resolve(Co):(Po||(Po=import("./chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js").then(e=>Co=e.OrdinalBrushOverlay).catch(e=>{throw Po=null,e})),Po)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?_o(t,{...e}):null}import{arc as Mo}from"d3-shape";function Lo(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:r}=ke({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),n=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(n);for(const t of r)e.fillStyle=it(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore(),t.style.stroke&&"none"!==t.style.stroke&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(n),e.restore())}function Io(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function To(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=Mo().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const r=new Path2D(i);e.fill(r),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(r),e.restore()}var Ho=(e,t,o,i)=>{const r=t.filter(e=>"wedge"===e.type);for(const t of r)if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)Lo(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(Io(e,t),Z(e,t)),e.globalAlpha=1;else{if(e.fillStyle=rt(e,t.style.fill,"#007bff"),t.roundedEnds){t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1);const o=Ae({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);const i=new Path2D(o);e.fill(i),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(i),e.restore()}else t.cornerRadius?(t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1),To(e,t)):(Io(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(Io(e,t),Z(e,t)),e.globalAlpha=1}},Bo=(e,t,o,i)=>{const r=t.filter(e=>"boxplot"===e.type);for(const t of r){const o=t.columnWidth/2,i="vertical"===t.projection,r=it(e,"var(--semiotic-primary, #007bff)"),n=it(e,"var(--semiotic-text, #333)"),s=rt(e,t.style.fill,r),a=t.style.stroke,l="string"==typeof a?it(e,a)||a:n,c=t.style.strokeWidth||1,h=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke(),e.globalAlpha=h,e.fillStyle=s,i){const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,e.strokeRect(t.x-o,i,t.columnWidth,r)}else{const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,e.strokeRect(i,t.y-o,r,t.columnWidth)}e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke(),e.restore()}},Fo=(e,t,o,i)=>{const r=t.filter(e=>"violin"===e.type);for(const t of r){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);if(e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=rt(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1,t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(o)),t.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;const o=t.iqrLine.centerPos,i=!1!==t.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(o,t.iqrLine.q1Pos),e.lineTo(o,t.iqrLine.q3Pos)):(e.moveTo(t.iqrLine.q1Pos,o),e.lineTo(t.iqrLine.q3Pos,o)),e.stroke(),e.beginPath(),i?e.arc(o,t.iqrLine.medianPos,3,0,2*Math.PI):e.arc(t.iqrLine.medianPos,o,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},Oo=(e,t,o,i)=>{const r=t.filter(e=>"connector"===e.type);if(0===r.length)return;const n=new Map;for(const e of r){const t=e.group||"_default";n.has(t)||n.set(t,[]),n.get(t).push(e)}for(const[,t]of n){if(0===t.length)continue;const o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(const o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=_e(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t)e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=it(e,o.style.stroke)||rt(e,o.style.fill,"")||it(e,"var(--semiotic-border, #999)"),e.lineWidth=o.style.strokeWidth||1,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1}},Eo=(e,t,o,i)=>{const r=t.filter(e=>"trapezoid"===e.type);for(const t of r){const o=t.points;if(o.length>=4){e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=_e(e,t.style?.fill)||"#999",e.fill(),t.style?.stroke&&(e.strokeStyle=it(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()),e.globalAlpha=1}}};function No(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function Do(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var Wo=new Map;function jo(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=Wo.get(o);if(void 0!==i)return i;const r=Ie({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),n=qe(r)?null:r;return Wo.set(o,n),n}function zo(e,t,o,i,r,n){e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath()}function Go(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function $o(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function Vo(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function qo(e){return(t,o,i,r)=>{e(t,o.filter(Vo),{x:i.r,y:i.r},r)}}var Xo=qo(c),Yo=qo(P),Qo=qo(v),Ko=qo(X),Zo=e=>[Oo,...e],Uo={bar:Zo([Xo]),clusterbar:Zo([Xo]),point:Zo([Yo,Qo]),swarm:Zo([Yo,Qo]),pie:[Ho],donut:[Ho],boxplot:Zo([Bo,Yo]),violin:Zo([Fo]),histogram:Zo([Xo]),ridgeline:Zo([Fo]),timeline:Zo([Xo]),funnel:[Xo,Eo,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0!==r.length&&r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX)){e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(!o.__funnelStepLabel)continue;const i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;const r=o.__funnelStepLabelX,n=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,n),e.fillStyle="#fff",e.fillText(i,r,n)}e.font="bold 13px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const r=o.__funnelValue;if(null==r||0===r)continue;const n=o.__funnelPercent,s=!0===o.__funnelIsFirstStep;let a;if(a=s?No(r):null!=n?`${No(r)} (${Do(n)})`:No(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=No(r),e.measureText(a).width+16>i)continue}const l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,l,c),e.fillStyle="#fff",e.fillText(a,l,c)}e.lineWidth=1,e.lineJoin="miter"}}],"bar-funnel":[Xo,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of r){const o=("string"==typeof t.style.fill?t.style.fill:null)||it(e,"var(--semiotic-border, #999)"),i=jo(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;const n=function(e,t){const[o,i,r]=et(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,it(e,"var(--semiotic-text, #333)")),s=n?"#1f2937":"#ffffff",a=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",l=n?"#f3f4f6":"#1a1a1a",c=l;for(const t of r){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,h=n?$o(r):"",u=Go(i);e.font="bold 13px sans-serif";const d=n?e.measureText(h).width:0;e.font="11px sans-serif";const g=e.measureText(u).width,m=Math.max(d,g)+12,p=n?32:17,f=o.__barFunnelLabelX,y=f-m/2,v=o.__barFunnelLabelY-p-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),zo(e,y,v,m,p,4),e.fill(),e.restore(),e.strokeStyle=a,e.lineWidth=.5,e.beginPath(),zo(e,y,v,m,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px sans-serif",e.fillStyle=l,e.fillText(h,f,v+3),e.font="11px sans-serif",e.fillStyle=c,e.fillText(u,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(u,f,v+3))}e.lineWidth=1}],swimlane:Zo([Xo]),custom:Zo([Xo,Yo,Qo,Ko,Ho,Bo,Fo,Eo])};import{jsx as Jo,jsxs as ei}from"react/jsx-runtime";function ti(e){const t=st(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:ei("div",{className:"semiotic-tooltip",style:He,children:[null!=t.title&&Jo("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>ei("div",{children:[ei("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function oi({hover:e}){const t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){const e=i||t[0]?.category||"";if(o)return ei("div",{className:"semiotic-tooltip",style:He,children:[e&&Jo("div",{style:{fontWeight:"bold"},children:e+""}),ei("div",{children:["n = ",o.n]}),ei("div",{children:["Min: ",o.min.toLocaleString()]}),ei("div",{children:["Q1: ",o.q1.toLocaleString()]}),ei("div",{children:["Median: ",o.median.toLocaleString()]}),ei("div",{children:["Q3: ",o.q3.toLocaleString()]}),ei("div",{children:["Max: ",o.max.toLocaleString()]}),ei("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const r=t.length;return ei("div",{className:"semiotic-tooltip",style:He,children:[e&&Jo("div",{style:{fontWeight:"bold"},children:e+""}),ei("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return ei("div",{className:"semiotic-tooltip",style:He,children:[t.category&&Jo("div",{style:{fontWeight:"bold"},children:t.category+""}),ei("div",{children:["Count: ",t.count]}),2===e.length&&ei("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const r=e.__oAccessor,n=e.__rAccessor,s=e.__chartType;if("swarm"===s||"point"===s)return ti(t);const a=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(n&&null!=t[n]?t[n]:null)??t.value??t.__rValue??t.pct??"";return a||""!==l?ei("div",{className:"semiotic-tooltip",style:He,children:[a&&Jo("div",{style:{fontWeight:"bold"},children:a+""}),""!==l&&Jo("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):ti(t)}oi.ownsChrome=!0;import{jsx as ii,jsxs as ri}from"react/jsx-runtime";var ni={top:50,right:40,bottom:60,left:70},si=Ot(Ft(function(e,t){const{chartType:o,runtimeMode:i,data:r,oAccessor:n="category",rAccessor:a="value",colorAccessor:l,symbolAccessor:c,symbolMap:u,stackBy:d,groupBy:m,multiAxis:y,timeAccessor:v,valueAccessor:b,categoryAccessor:x,accessorRevision:w,projection:A="vertical",size:k=[600,400],responsiveWidth:S,responsiveHeight:_,margin:C,barPadding:P,roundedTop:R,gradientFill:L,trackFill:F,baselinePadding:O,innerRadius:E,cornerRadius:N,normalize:D,startAngle:W,sweepAngle:z,dynamicColumnWidth:G,bins:$,showOutliers:V,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:Q,connectorAccessor:Z,connectorStyle:ie,dataIdAccessor:ne,rExtent:se,oExtent:ae,extentPadding:le=.05,oSort:me,windowMode:pe="sliding",windowSize:be=200,pieceStyle:xe,summaryStyle:we,renderMode:Ae,colorScheme:ke,barColors:_e,showAxes:Pe=!0,showCategoryTicks:Re,categoryLabel:Me,valueLabel:Le,categoryFormat:Ie,valueFormat:Te,oLabel:He,rLabel:Fe,oFormat:Ee,rFormat:Ne,rTickValues:De,tickLabelEdgeAlign:We,axisExtent:je,enableHover:ze=!0,hoverAnnotation:Ge,tooltipContent:$e,customHoverBehavior:qe,customClickBehavior:Ye,onObservation:Qe,annotationObservationCallback:Ke,chartId:Ze,annotations:et,onAnnotationActivate:tt,autoPlaceAnnotations:ot,svgAnnotationRules:it,showGrid:rt=!1,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,legendCategoryAccessor:mt,onCategoriesChange:ft,backgroundGraphics:yt,foregroundGraphics:vt,title:bt,className:xt,background:wt,centerContent:kt,decay:St,pulse:_t,transition:Rt,animate:Ft,staleness:Ot,frameScheduler:Et,clock:Nt,random:Dt,seed:Wt,paused:jt=!1,suspendWhenHidden:zt=!0,brush:Gt,onBrush:$t,accessibleTable:Vt=!0,description:qt,summary:Xt,customLayout:Yt,onLayoutError:Qt,layoutConfig:Kt,layoutSelection:Zt}=e,{customHoverBehavior:Ut,customClickBehavior:Jt,hasClickBehavior:eo}=H({customHoverBehavior:qe,customClickBehavior:Ye,onObservation:Qe,chartId:Ze,chartType:"StreamOrdinalFrame"}),to=x??n,oo=b??a,io=Mt(!0),ro=dt({sizeProp:k,responsiveWidth:S,responsiveHeight:_,userMargin:C,marginDefault:ni,title:bt,legend:nt,legendPosition:ht,animate:Ft,transitionProp:Rt,frameScheduler:Et,clock:Nt,random:Dt,seed:Wt,paused:jt,suspendWhenHidden:zt,themeDirtyRef:io}),{reducedMotionRef:no,responsiveRef:lo,size:co,margin:ho,adjustedWidth:uo,adjustedHeight:go,currentTheme:mo,transition:po,introEnabled:fo,tableId:yo,rafRef:vo,renderFnRef:bo,scheduleRender:xo,frameRuntime:Ao}=ro,So=Ct(),_o=Pt(),Co=Tt(()=>Be(r),[r]),Po=Me??He,Mo=Le??Fe,Lo=Ie??Ee,Io=Te??Ne,To=Mt(null),[Ho,Bo]=Lt(null),[Fo,Oo]=Lt(null),Eo=f(vt,co,ho,Fo),No=f(yt,co,ho,Fo),Do=yt||"transparent"===wt?null:ii("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-ho.left,y:-ho.top,width:co[0],height:co[1],fill:wt||"var(--semiotic-bg, transparent)"}),[Wo,jo]=Lt(0),zo=Mt(0),[Go,$o]=Lt(!1),Vo=Mt({w:-1,h:-1}),qo=Mt(!1),Xo=pt("StreamOrdinalFrame"),Yo=ze||Ge,Qo="streaming"===i,Ko=Tt(()=>({chartType:o,runtimeMode:Qo?"streaming":"bounded",windowSize:be,windowMode:pe,extentPadding:le,projection:A,oAccessor:Qo?void 0:to,rAccessor:Qo?void 0:oo,accessorRevision:w,colorAccessor:l,symbolAccessor:c,symbolMap:u,stackBy:d,groupBy:m,multiAxis:y,timeAccessor:Qo?v:void 0,valueAccessor:Qo?b||("string"==typeof oo||"function"==typeof oo?oo:void 0):void 0,categoryAccessor:Qo?to:void 0,rExtent:se,oExtent:ae,axisExtent:je,barPadding:P,roundedTop:R,gradientFill:g(L),trackFill:F,baselinePadding:O,innerRadius:E,cornerRadius:N,normalize:D,startAngle:W,sweepAngle:z,dynamicColumnWidth:G,bins:$,showOutliers:V,showIQR:q,amplitude:X,connectorOpacity:Y,showLabels:Q,connectorAccessor:Z,connectorStyle:ie,dataIdAccessor:ne,oSort:me,pieceStyle:xe,summaryStyle:we,colorScheme:ke,themeCategorical:mo?.colors?.categorical,themeSemantic:At(mo),themeSequential:mo?.colors?.sequential,themeDiverging:mo?.colors?.diverging,barColors:_e,decay:St,pulse:_t,transition:po,introAnimation:fo,staleness:Ot,clock:Ao.now,customLayout:Yt,onLayoutError:Qt,layoutConfig:Kt,layoutMargin:ho}),[o,Qo,be,pe,le,A,to,oo,w,l,c,u,d,m,y,v,b,se,ae,je,P,R,L,F,O,E,N,D,W,z,G,$,V,q,X,Y,Q,Z,ie,ne,me,xe,we,ke,mo,_e,St,_t,po,fo,Ot,Ao.now,Yt,Qt,Kt,ho]),Zo=te(Ko),Jo=Mt(null);Jo.current||(Jo.current=new so(Zo));const ei=I(Jo,mt,ft,e=>e.getData());J(Jo,Zo,io,xo),ee(Jo,Zt,io,xo);const ti=Mt(null);ti.current||(ti.current=new s(e=>{const t=Jo.current;t&&t.ingest(e)&&(io.current=!0,xo())}));const si=Ht(e=>{ti.current?.push(e)},[]),ai=Ht(e=>{ti.current?.pushMany(e)},[]),li=Ht(()=>{ti.current?.clear(),Jo.current?.clear(),io.current=!0,xo()},[xo]),ci=Ht(e=>{ti.current?.clearLastData(),ti.current?.setReplacementData(e)},[]);Bt(t,()=>({push:si,pushMany:ai,replace:ci,remove:e=>{ti.current?.flush();const t=Jo.current?.remove(e)??[];if(t.length>0){const e=To.current?.data;!!To.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(To.current=null,Bo(null)),io.current=!0,xo()}return t},update:(e,t)=>{ti.current?.flush();const o=Jo.current?.update(e,t)??[];return o.length>0&&(io.current=!0,xo()),o},clear:li,getData:()=>(ti.current?.flush(),Jo.current?.getData()??[]),getScales:()=>Jo.current?.scales??null,getCustomLayout:()=>Jo.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Jo.current?.lastCustomLayoutFailure??null}),[si,ai,ci,li,xo]),It(()=>{r&&ti.current?.setBoundedData(Co)},[r,Co]);const{canvasRef:hi}=gt(ro,{storeRef:Jo,dirtyRef:io,hydrated:So,wasHydratingFromSSR:_o,cleanup:()=>ti.current?.clear(),canvasPaintDependencies:[o,uo,go,Pe,wt,yt,Ae,xo]}),{hoverHandlerRef:ui,hoverLeaveRef:di,onPointerMove:gi,onPointerLeave:mi}=ro;ui.current=e=>{if(!Yo)return;const t=hi.current;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left-ho.left,n=e.clientY-i.top-ho.top;if(0>r||r>uo||0>n||n>go)return void(To.current&&(To.current=null,Bo(null),Ut&&Ut(null),xo()));const s=Jo.current;if(!s||0===s.scene.length)return;const a="radial"===A,l=ao(s.scene,a?r-uo/2:r,a?n-go/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return void(To.current&&(To.current=null,Bo(null),Ut&&Ut(null),xo()));const c=Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof to?to:void 0,__rAccessor:"string"==typeof oo?oo:void 0,__chartType:o});To.current=c,Bo(c),Ut&&(Ut(c),io.current=!0),xo()},di.current=()=>{To.current&&(To.current=null,Bo(null),Ut&&(Ut(null),io.current=!0),xo())};const pi=Ht(e=>{if(Ve(e.target))return;if(!Jt)return;const t=hi.current;if(!t)return Jt(null),io.current=!0,void xo();const i=t.getBoundingClientRect(),r=e.clientX-i.left-ho.left,n=e.clientY-i.top-ho.top;if(0>r||r>uo||0>n||n>go)return Jt(null),io.current=!0,void xo();const s=Jo.current;if(!s||0===s.scene.length)return Jt(null),io.current=!0,void xo();const a="radial"===A,l=ao(s.scene,a?r-uo/2:r,a?n-go/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return Jt(null),io.current=!0,void xo();Jt(Se(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof to?to:void 0,__rAccessor:"string"==typeof oo?oo:void 0,__chartType:o}),{type:"activate",inputType:Ue(e.nativeEvent.pointerType)}),io.current=!0,xo()},[Jt,hi,ho.left,ho.top,uo,go,A,to,oo,o,xo]),{kbFocusIndexRef:fi,focusedNavPointRef:yi,onKeyDown:vi}=T({storeRef:Jo,hoverRef:To,setHoverPoint:Bo,customHoverBehavior:Ut,customClickBehavior:Jt,scheduleRender:xo,chartType:o,oAccessor:to,rAccessor:oo}),bi=Ht(e=>{fi.current=-1,yi.current=null,gi(e)},[yi,fi,gi]);bo.current=()=>{if(vo.current=null,!Ao.isActive)return;const e=hi.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=Jo.current;if(!i)return;const r=Ao.now(),n=i.advanceTransition(no.current?r+1e6:r),s=!no.current&&n,a=Vo.current.w!==uo||Vo.current.h!==go,l=io.current;let c=!1;const h=Xo.current.beforeCompute(i.getLastUpdateResult(),s);!l&&!a||s&&!a||(i.computeScene({width:uo,height:go}),Vo.current={w:uo,h:go},c=!0,ei()),Xo.current.afterCompute(h,c,a),io.current=l&&s&&!c;const u=M(i,r,c,qo);(c||s)&&e.setAttribute("aria-label",Ce(i.scene,o+" chart"));const d=Oe(),g=co[0]*d,m=co[1]*d;e.width===g&&e.height===m||(e.width=g,e.height=m,e.style.width=co[0]+"px",e.style.height=co[1]+"px"),t.setTransform(d,0,0,d,0,0),t.clearRect(0,0,co[0],co[1]);const p=Ot&&i.lastIngestTime>0&&r-i.lastIngestTime>(Ot?.threshold??5e3);p&&(t.globalAlpha=Ot?.dimOpacity??.5);const f="radial"===A;t.save(),t.beginPath(),t.rect(ho.left,ho.top,uo,go),t.clip(),f?(t.save(),t.translate(ho.left+uo/2,ho.top+go/2)):t.translate(ho.left,ho.top);const y=Yt?Uo.custom:Uo[o]||[],v={width:uo,height:go},b=i.scales;b&&K({context:t,nodes:i.scene,renderMode:Ae,pixelRatio:d,paintBuiltIn:e=>{for(const o of y)o(t,e,b,v)}}),f&&t.restore(),t.restore(),p&&(t.globalAlpha=1),c&&i.scales?(Oo(i.scales),jo(e=>e+1),zo.current=r):s&&i.scales&&r-zo.current>=33&&(jo(e=>e+1),zo.current=r),Ot?.showBadge&&$o(!!p),(s||null!=i.activeTransition||u.pending)&&xo()},oe(Ot,Jo,io,xo,Go,$o);const xi=Yo&&Ho?$e?$e(Ho):ii(oi,{hover:Ho}):null,wi="radial"===A,Ai=xi?ii(de,{x:Ho?wi?Ho.x+uo/2:Ho.x:0,y:Ho?wi?Ho.y+go/2:Ho.y:0,containerWidth:uo,containerHeight:go,margin:ho,className:"stream-ordinal-tooltip",children:xi}):null,ki="horizontal"===A?to:oo,Si=p("horizontal"===A?oo:to,void 0,"__semiotic_resolvedO",""),_i=p(ki,void 0,"__semiotic_resolvedR",""),Ci=Si.key,Pi=_i.key,Ri=h(Si,_i,et&&et.length>0||!1);if(Xe||!So&&_o){const e=Jo.current;e&&r&&(e.ingest({inserts:Co,bounded:!0}),e.computeScene({width:uo,height:go}));const t=e?.scene??[],o=e?.scales??null,i=f(vt,co,ho,o),n=f(yt,co,ho,o),s="radial"===A,a=s?ho.left+uo/2:ho.left,l=s?ho.top+go/2:ho.top;return ri("div",{ref:lo,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:S?"100%":co[0],height:_?"100%":co[1]},children:[ii(ye,{summary:Xt}),ri("svg",{xmlns:"http://www.w3.org/2000/svg",width:co[0],height:co[1],style:{position:"absolute",left:0,top:0},children:[n&&ii("g",{transform:`translate(${ho.left},${ho.top})`,children:n}),ri("g",{transform:`translate(${a},${l})`,children:[wt&&ii("rect",{x:0,y:0,width:uo,height:go,fill:wt}),t.map((e,t)=>U({node:e,index:t,renderMode:Ae,fallback:()=>Je(e,t,yo)})).filter(Boolean)]})]}),ii(ko,{width:uo,height:go,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:o,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Mo,oFormat:Lo,rFormat:Io,rTickValues:De,tickLabelEdgeAlign:We,axisExtent:je,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:j(i,re(Jo.current?.customLayoutOverlays,Zt??null)),annotations:et,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:0,xAccessor:Ci,yAccessor:Pi,annotationData:Ri(e?.getData())}),kt&&"radial"===A&&ii("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+go/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt})]})}return ri("div",{ref:lo,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"group","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),tabIndex:0,style:{position:"relative",width:S?"100%":co[0],height:_?"100%":co[1],overflow:"visible"},onKeyDown:vi,children:["production"!==process.env.NODE_ENV&&Jo.current&&ii(fe,{store:Jo.current,diagnostics:Xo.current}),Vt&&ii(ve,{tableId:yo}),Vt&&ii(ce,{scene:Jo.current?.scene??[],chartType:o+" chart",tableId:yo,chartTitle:"string"==typeof bt?bt:void 0}),ii(ye,{summary:Xt}),ii(he,{hoverPoint:Ho}),ri("div",{role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Yo?bi:void 0,onMouseLeave:Yo?mi:void 0,onClick:eo?pi:void 0,children:[ri(ue,{size:co,margin:ho,children:[Do,No]}),ii(wo,{width:uo,height:go,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,showAxes:Pe,showGrid:rt,rFormat:Io,rTickValues:De,axisExtent:je}),ii("canvas",{ref:hi,"aria-label":Ce(Jo.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:co[0],height:co[1]}}),ii(ko,{width:uo,height:go,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Mo,oFormat:Lo,rFormat:Io,rTickValues:De,axisExtent:je,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:j(Eo,re(Jo.current?.customLayoutOverlays,Zt??null)),annotations:et,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:Wo,xAccessor:Ci,yAccessor:Pi,annotationData:Ri(Jo.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Gt||$t)&&"radial"!==A&&ii(Ro,{width:uo,height:go,totalWidth:co[0],totalHeight:co[1],margin:ho,scales:Fo,onBrush:$t||(()=>{})}),kt&&"radial"===A&&ii("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+go/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:kt}),Ot?.showBadge&&ii(B,{isStale:Go,position:Ot.badgePosition}),ii(ge,{active:fi.current>=0,hoverPoint:Ho,margin:ho,size:co,shape:yi.current?.shape,width:yi.current?.w,height:yi.current?.h}),Ai]})]})}));si.displayName="StreamOrdinalFrame";var ai=si;import{forwardRef as li,useMemo as ci}from"react";import{jsx as hi}from"react/jsx-runtime";var ui=li(function(e,t){const{data:o,layout:i,layoutConfig:n,onLayoutError:s,categoryAccessor:a="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:g,colorBy:m,colorScheme:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:A,loading:k,loadingContent:S,emptyContent:_,frameProps:C={}}=e,{frameRef:P,resolved:R,safeData:M,setup:L,earlyReturn:I}=r({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:p,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:A,loading:k,loadingContent:S,emptyContent:_,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=L.effectiveSelectionHook,H=ci(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]);if(I)return I;const{width:B,height:F,enableHover:N,showGrid:D,title:W,description:j,summary:z,accessibleTable:G}=R,$={chartType:"custom",...null!=o&&{data:M},customLayout:i,layoutConfig:n,onLayoutError:s,...H&&{layoutSelection:H},oAccessor:a,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:m,colorScheme:p,size:[B,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:L.margin,enableHover:N,showAxes:f,showGrid:D,annotations:y,...O({title:W,description:j,summary:z,accessibleTable:G,className:g,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...E({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:L.mobileInteraction,customHoverBehavior:L.customHoverBehavior,customClickBehavior:L.customClickBehavior}),...C};return hi(_t,{componentName:"OrdinalCustomChart",width:B,height:F,children:hi(ai,{ref:P,...$})})});ui.displayName="OrdinalCustomChart";import{useMemo as di,forwardRef as gi,useRef as mi}from"react";import{useImperativeHandle as pi}from"react";function fi({ref:e,frameRef:t,setup:o}){return pi(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}import{useMemo as yi}from"react";function vi(e){const{colorBy:t,colorScale:i,color:r,themeCategorical:n,colorScheme:s,categoryIndexMap:a,userPieceStyle:l,stroke:c,strokeWidth:h,opacity:u,effectiveSelectionHook:d,resolvedSelection:g,cycleByCategory:m=!1,baseStyleExtras:p,linkStrokeToFill:f=!1,styleRules:y,resolveRuleValue:v}=e,b=yi(()=>(e,o)=>{const l="function"==typeof p?p(e,o):p,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!i)return c;c.fill=Fe(e,t,i)}else c.fill=nt(r,n,s,m?o:void 0,a);if(y&&y.length>0){const t=se(e,y,{value:v?v(e):void 0,category:o});Object.assign(c,t)}return f&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,i,r,n,s,a,m,p,f,y,v]),x=yi(()=>o(l?"function"==typeof l?(e,t)=>({...b(e,t),...l(e,t)||{}}):(e,t)=>({...b(e,t),...l}):b,{stroke:c,strokeWidth:h,opacity:u}),[b,l,c,h,u]);return yi(()=>bt(x,d??null,g),[x,d,g])}import{jsx as bi}from"react/jsx-runtime";var xi=gi(function(o,r){const n=ut(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),s=mi(null),{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x=!1,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,regression:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:N,legendInteraction:j,legendPosition:z,color:G,stroke:$,strokeWidth:V,opacity:q,showCategoryTicks:X,categoryFormat:Y,dataIdAccessor:Q}=o,{width:K,height:Z,enableHover:U,showGrid:J,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:re,categoryLabel:se,valueLabel:ae}=n,le=di(()=>Be(a),[a]),ce=i({data:le,rawData:a,colorBy:p,colorScheme:f,legendInteraction:j,legendPosition:z,selection:R,linkedHover:M,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"BarChart",chartId:H,showLegend:ee,userMargin:l,marginDefaults:n.marginDefaults,loading:B,loadingContent:F,emptyContent:N,width:K,height:Z,hasTitle:!!te}),{effectiveLegendProps:he,effectiveMargin:ue}=fi({ref:r,frameRef:s,setup:ce});Rt("BarChart",le,"categoryAccessor",h),Rt("BarChart",le,"valueAccessor",u);const de=ft(le,y,u),ge=yt(),me=di(()=>new Map,[]),pe=di(()=>ne(u),[u]),fe=vi({colorBy:p,colorScale:ce.colorScale,color:G,themeCategorical:ge,colorScheme:f,categoryIndexMap:me,userPieceStyle:P?.pieceStyle,stroke:$,strokeWidth:V,opacity:q,styleRules:w,resolveRuleValue:pe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),ye=di(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:p&&p!==h?p:void 0,groupLabel:"string"==typeof p?p:"group",valueFormat:m}),[h,u,p,m]),ve=di(()=>g(x),[x]);if(ce.earlyReturn)return ce.earlyReturn;const be=t({componentName:"BarChart",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(be)return bi(St,{componentName:"BarChart",message:be,width:K,height:Z});const xe=e(_),we=xe?[xe,...S||[]]:S,Ae={chartType:"bar",...null!=a&&{data:de},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:fe,size:[K,Z],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ue,barPadding:v,...null!=b&&{roundedTop:b},...ve&&{gradientFill:ve},...Q&&{dataIdAccessor:Q},baselinePadding:A,enableHover:U,showAxes:n.showAxes,oLabel:se,rLabel:ae,rFormat:m,...Y&&{oFormat:Y},showGrid:J,showCategoryTicks:X,oSort:y,...he,...O({title:te,description:oe,summary:ie,accessibleTable:re,className:c,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...W({tooltip:k,defaultTooltipContent:ye}),...E({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...we&&we.length>0&&{annotations:we},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return bi(_t,{componentName:"BarChart",width:K,height:Z,children:bi(ai,{ref:s,...Ae})})});xi.displayName="BarChart";import{useMemo as wi,forwardRef as Ai,useRef as ki}from"react";import{jsx as Si}from"react/jsx-runtime";var _i=Ai(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=ki(null),{data:s,margin:a,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:p,colorScheme:f,normalize:y=!1,sort:v=!1,barPadding:b=40,roundedTop:x,gradientFill:w,styleRules:A,baselinePadding:k=!1,tooltip:S,annotations:_,valueExtent:C,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:N,legendInteraction:j,legendPosition:z,color:G,stroke:$,strokeWidth:V,opacity:q,categoryFormat:X}=e,{width:Y,height:Q,enableHover:K,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=r,se=wi(()=>Be(s),[s]),ae=p||h,le=i({data:se,rawData:s,colorBy:ae,colorScheme:f,legendInteraction:j,legendPosition:z,selection:R,linkedHover:M,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:U,userMargin:a,marginDefaults:r.marginDefaults,loading:B,loadingContent:F,emptyContent:N,width:Y,height:Q,hasTitle:!!J}),ce=yt(),he=wi(()=>new Map,[]),ue=wi(()=>ne(u),[u]),de=vi({colorBy:ae,colorScale:le.colorScale,color:G,themeCategorical:ce,colorScheme:f,categoryIndexMap:he,userPieceStyle:P?.pieceStyle,stroke:$,strokeWidth:V,opacity:q,styleRules:A,resolveRuleValue:ue,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),ge=wi(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),me=t({componentName:"StackedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:pe,effectiveMargin:fe}=fi({ref:o,frameRef:n,setup:le}),ye=wi(()=>g(w),[w]);if(le.earlyReturn)return le.earlyReturn;const ve={chartType:"bar",...null!=s&&{data:se},oAccessor:c,rAccessor:u,stackBy:h,normalize:y,oSort:v,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:de,size:[Y,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:b,...null!=x&&{roundedTop:x},...ye&&{gradientFill:ye},baselinePadding:k,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:ie,rLabel:re,rFormat:m,...X&&{oFormat:X},showGrid:Z,...pe,...O({title:J,description:ee,summary:te,accessibleTable:oe,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:S,defaultTooltipContent:ge}),...E({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),..._&&_.length>0&&{annotations:_},...C&&{rExtent:C},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return me?Si(St,{componentName:"StackedBarChart",message:me,width:Y,height:Q}):Si(_t,{componentName:"StackedBarChart",width:Y,height:Q,children:Si(ai,{ref:n,...ve})})});_i.displayName="StackedBarChart";import*as Ci from"react";import{useMemo as Pi,useCallback as Ri,forwardRef as Mi,useRef as Li,useImperativeHandle as Ii}from"react";import{useRef as Ti,useState as Hi,useCallback as Bi,useMemo as Fi}from"react";import{useMemo as Oi,useCallback as Ei,useRef as Ni}from"react";var Di={RdBu:je,PiYG:We,PRGn:De,BrBG:Ne,RdYlBu:ze,RdYlGn:Ge,Spectral:$e},Wi="__likert_neutral_neg",ji="__likert_neutral_pos";function zi(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function Gi(e,t,o,i,r,n){const s=new Map,a=new Set(t);for(const l of e){const e=o(l);s.has(e)||s.set(e,new Map);const c=s.get(e);if(i){const e=i(l);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}const o=e-1;if(0>o||o>=t.length)continue;const r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&n){const e=r(l),t=n(l);if(!a.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const l=[];for(const[e,o]of s){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){const n=t[r],s=o.get(n)||0;l.push({__likertCategory:e,__likertLevel:n,__likertLevelLabel:n,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:r})}}return l}function $i(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===r){const e=t.__likertPct/2;n.push({...t,__likertLevel:Wi,__likertPct:-e}),n.push({...t,__likertLevel:ji,__likertPct:e})}else n.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return n}function Vi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=new Map;for(const t of e){const e=n.get(t.__likertCategory)||[];e.push(t),n.set(t.__likertCategory,e)}const s=[];for(const[,e]of n){const t=new Map;let n,a;for(const o of e)o.__likertLevel===Wi?n=o:o.__likertLevel===ji?a=o:t.set(o.__likertLevelIndex,o);i&&n&&s.push(n);for(let e=r-1;e>=0;e--){const o=t.get(e);o&&s.push(o)}i&&a&&s.push(a);for(let e=i?r+1:r;o>e;e++){const o=t.get(e);o&&s.push(o)}}return s}var qi=["Very Low","Low","Neutral","High","Very High"];import{jsx as Xi}from"react/jsx-runtime";var Yi=new Map,Qi=Mi(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Li(null),{data:s,margin:a,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:u,countAccessor:d="count",levels:g=qi,orientation:m="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,valueFormat:P,loading:R,loadingContent:M,emptyContent:L,legendInteraction:I,legendPosition:T,categoryFormat:H,stroke:B,strokeWidth:F,opacity:O}=e,{width:N,height:D,enableHover:W,showGrid:j,showLegend:z,title:G,description:$,summary:V,accessibleTable:q,categoryLabel:X,valueLabel:Y}=r,Q="horizontal"===m,K=void 0===s,Z=!u,U=vt(),J=Pi(()=>p&&Array.isArray(p)&&p.length>=g.length?p:function(e,t){if(0>=e)return[];if(t){const o=Di[t];if(o){if(1===e)return[o(.5)];const t=[];for(let i=0;e>i;i++)t.push(o(i/(e-1)));return t}}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];const n=e%2!=0,s=Math.floor(e/2),a=[];for(let e=0;s>e;e++)a.push(o[Math.min(Math.floor(e*o.length/s),o.length-1)]);n&&a.push(r);for(let e=0;s>e;e++)a.push(i[Math.min(Math.floor(e*i.length/s),i.length-1)]);return a}(g.length,U),[p,g.length,U]),ee=Pi(()=>{const e=new Map;for(let t=0;g.length>t;t++)e.set(g[t],J[t]||"#888");return e},[g,J]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:n,isDiverging:s,frameRef:a}){const l=!r,c=Oi(()=>zi(o,"question"),[o]),h=Oi(()=>l?zi(i,"score"):null,[l,i]),u=Oi(()=>l?null:zi(r,"level"),[l,r]),d=Oi(()=>l?null:zi(n,"count"),[l,n]),g=Ni([]);return{processedData:Oi(()=>{const o=e||[];if(0===o.length)return[];let i=Gi(o,t,c,h,u,d);return s&&(i=$i(i,t),i=Vi(i,t)),i},[e,t,c,h,u,d,s]),reAggregate:Ei(e=>{let o=Gi(e,t,c,h,u,d);s&&(o=$i(o,t),o=Vi(o,t)),a.current?.replace(o)},[t,c,h,u,d,s,a]),accumulatorRef:g}}({data:s,levels:g,categoryAccessor:c,valueAccessor:h,levelAccessor:u,countAccessor:d,isDiverging:Q,frameRef:n}),re="__likertLevelLabel",ne=function({isPushMode:e,colorBy:t,colorScheme:o,showLegend:i,legendPosition:r="right"}){const n=Ti(new Set),s=Ti([]),[a,l]=Hi(0),c=ht(),h=yt(),u=Bi(e=>{if(!t)return null;const o="function"==typeof t?t(e):e[t];return null!=o?o+"":null},[t]),d=Bi(o=>{if(!e||!t)return;let i=!1;for(const e of o){if(!e||"object"!=typeof e)continue;const t=u(e);null==t||n.current.has(t)||(n.current.add(t),s.current.push(t),i=!0)}i&&l(e=>e+1)},[e,t,u]),g=Bi(o=>{if(!e||!t)return;const i=Array.from(new Set(o.map(String))),r=s.current;r.length===i.length&&r.every((e,t)=>e===i[t])||(n.current=new Set(i),s.current=i,l(e=>e+1))},[e,t]),m=Bi(e=>t=>{d([t]),e(t)},[d]),p=Bi(e=>t=>{d(t),e(t)},[d]),f=Bi(()=>{n.current=new Set,s.current=[],l(e=>e+1)},[]);mt(e&&t?s.current:[]);const y=Fi(()=>{if(!e||!t||!1===i)return;const r=s.current;if(0===r.length)return;const n=Array.isArray(o)&&o.length>0||"string"==typeof o&&o.length>0?o:h&&h.length>0?h:me,a="string"==typeof t?t:"__streamCat",l=r.map(e=>({[a]:e})),u=Me(l,a,n);return Te({data:l,colorBy:a,colorScale:e=>c?.[e]||u(e)||"#999",getColor:Fe})},[e,t,i,o,c,h,a]),v=Fi(()=>{if(y)return"right"===r?{right:110}:"left"===r?{left:110}:"top"===r?{top:50}:"bottom"===r?{bottom:80}:{right:110}},[y,r]);return{wrapPush:m,wrapPushMany:p,resetCategories:f,categories:s.current,categoryDomainProps:e&&t?{legendCategoryAccessor:t,onCategoriesChange:g}:{},streamingLegend:y,streamingMarginAdjust:v}}({isPushMode:K,colorBy:re,colorScheme:J,showLegend:z,legendPosition:T}),{wrapPush:se,wrapPushMany:ae}=ne,le=Ri(e=>se(e=>{ie.current.push(e),oe(ie.current)})(e),[se,oe,ie]),ce=Ri(e=>ae(e=>{ie.current.push(...e),oe(ie.current)})(e),[ae,oe,ie]);Ii(o,()=>({push:le,pushMany:ce,remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],replace:e=>n.current?.replace(e),clear:()=>{ie.current=[],ne.resetCategories(),n.current?.clear()},getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}),[le,ce,ie,ne]);const he=i({data:te,rawData:s,colorBy:re,colorScheme:J,legendInteraction:I,legendPosition:T,selection:w,linkedHover:A,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"LikertChart",chartId:C,showLegend:z,userMargin:a,marginDefaults:r.marginDefaults,loading:R,loadingContent:M,emptyContent:L,width:N,height:D,hasTitle:!!G}),ue=Pi(()=>{const e=g.length;return e%2!=0&&ee.get(g[Math.floor(e/2)])||"#888"},[g,ee]),de=vi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:Yi,userPieceStyle:x?.pieceStyle,stroke:B,strokeWidth:F,opacity:O,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===Wi||o===ji)return{fill:ue};const i=t||o;return i&&ee.has(i)?{fill:ee.get(i)}:{fill:"#888"}}}),ge=Pi(()=>{const e=g.length;return e%2!=0?g[Math.floor(e/2)]:""},[g]),pe=Pi(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===Wi||o===ji?ge:o,r=t.__likertCategory||"",n=Math.abs(t.__likertPct||0),s=o===Wi||o===ji?2*n:n,a=t.__likertCount||0;return Ci.createElement("div",{className:"semiotic-tooltip",style:He},Ci.createElement("div",{style:{fontWeight:"bold"}},r),Ci.createElement("div",{style:{marginTop:4}},`${i}: ${s.toFixed(1)}% (n=${a})`))},[ge]),fe=Pi(()=>{if(!g||2>g.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&u)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(u&&!d)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==s&&0===s.length)return null;const e={categoryAccessor:c};return Z?h&&(e.valueAccessor=h):(u&&(e.levelAccessor=u),d&&(e.countAccessor=d)),t({componentName:"LikertChart",data:s,accessors:e,requiredProps:{levels:g}})},[s,c,h,u,d,g,Z]),ye=Pi(()=>[{styleFn:e=>({fill:ee.get(e.label)||"#888"}),items:g.map(e=>({label:e})),label:""}],[g,ee]),ve=Pi(()=>!1!==z?{...he.legendBehaviorProps,legend:{legendGroups:ye},legendPosition:T||he.legendPosition||"bottom"}:he.legendBehaviorProps,[he.legendBehaviorProps,he.legendPosition,T,z,ye]),be=Pi(()=>{const e={...he.margin};if(K&&!1!==z){const t=T||"bottom";"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(ne.streamingMarginAdjust)for(const[t,o]of Object.entries(ne.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Q&&100>e.left&&(e.left=100),e},[he.margin,ne.streamingMarginAdjust,Q,K,z,T]),xe=Pi(()=>P||(Q?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Q,P]);if(he.earlyReturn)return he.earlyReturn;const we={chartType:"bar",...null!=s&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:Q?"horizontal":"vertical",pieceStyle:de,size:[N,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:X,rLabel:Y||(Q?void 0:"Percentage"),rFormat:xe,...H&&{oFormat:H},showGrid:j,...ve,...G&&{title:G},...$&&{description:$},...V&&{summary:V},...void 0!==q&&{accessibleTable:q},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===y?()=>null:!0===y?pe:Ke(y)||pe,...E({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fe?Xi(St,{componentName:"LikertChart",message:fe,width:N,height:D}):Xi(_t,{componentName:"LikertChart",width:N,height:D,children:Xi(ai,{ref:n,...we})})});Qi.displayName="LikertChart";import{useMemo as Ki,forwardRef as Zi,useRef as Ui}from"react";import{useCallback as Ji,useRef as er}from"react";function tr({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const r=Qe("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),n="string"==typeof i?i:"value",s=ct({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||n}),a=er(s.brushInteraction);a.current=s.brushInteraction;const l=Ji(e=>{if(r){a.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as or}from"react/jsx-runtime";var ir=Zi(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Ui(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,sizeBy:f,sizeRange:y=[3,8],symbolBy:v,symbolMap:b,pointRadius:x=4,pointOpacity:w=.7,categoryPadding:A=20,tooltip:k,annotations:S,valueExtent:_,brush:C,onBrush:P,linkedBrush:R,frameProps:M={},selection:L,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:B,chartId:F,loading:N,loadingContent:j,emptyContent:z,legendInteraction:G,legendPosition:$,color:V,stroke:q,strokeWidth:X,opacity:Y,showCategoryTicks:Q,categoryFormat:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:se,valueLabel:ae}=r,le=Ki(()=>Be(a),[a]),ce=i({data:le,rawData:a,colorBy:m,colorScheme:p,legendInteraction:G,legendPosition:$,selection:L,linkedHover:I,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"SwarmPlot",chartId:F,showLegend:te,userMargin:l,marginDefaults:r.marginDefaults,loading:N,loadingContent:j,emptyContent:z,width:Z,height:U,hasTitle:!!oe}),he=tr({brushProp:C,onBrushProp:P,linkedBrush:R,valueAccessor:u}),ue=Ki(()=>{if(!f)return;const e=le.map(e=>"function"==typeof f?f(e):e[f]);return wt(e)},[le,f]),de=yt(),ge=Ki(()=>new Map,[]),me=vi({colorBy:m,colorScale:ce.colorScale,color:V,themeCategorical:de,colorScheme:p,categoryIndexMap:ge,userPieceStyle:M?.pieceStyle,stroke:q,strokeWidth:X,opacity:Y,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:w,r:f?Ee(e,f,y,ue):x})}),pe=Ki(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:m||void 0,valueFormat:g}),[h,u,m,g]);if(ce.earlyReturn)return ce.earlyReturn;const fe=t({componentName:"SwarmPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(fe)return or(St,{componentName:"SwarmPlot",message:fe,width:Z,height:U});const ye={chartType:"swarm",...null!=a&&{data:le},oAccessor:h,rAccessor:u,...v&&{symbolAccessor:v},...b&&{symbolMap:b},projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:me,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:A,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:se,rLabel:ae,rFormat:g,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...O({title:oe,description:ie,summary:re,accessibleTable:ne,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:k,defaultTooltipContent:pe}),...E({linkedHover:I,selection:L,onObservation:T,onClick:H,hoverHighlight:B,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...he.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return or(_t,{componentName:"SwarmPlot",width:Z,height:U,children:or(ai,{ref:s,...ye})})});ir.displayName="SwarmPlot";import{useMemo as rr,forwardRef as nr,useRef as sr}from"react";import{jsx as ar,jsxs as lr}from"react/jsx-runtime";function cr(e){return t=>{const o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return lr("div",{className:"semiotic-tooltip",style:He,children:[o&&ar("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&lr("div",{children:["n = ",i.n]}),null!=i.min&&lr("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&lr("div",{children:["Q1: ",i.q1.toLocaleString()]}),lr("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&lr("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&lr("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&lr("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),n=r.length,s=n>0?n%2!=0?r[Math.floor(n/2)]:(r[n/2-1]+r[n/2])/2:null;return lr("div",{className:"semiotic-tooltip",style:He,children:[o&&ar("div",{style:{fontWeight:"bold"},children:o+""}),n>0&&lr("div",{children:["n = ",n]}),null!=s&&lr("div",{children:["Median: ",s.toLocaleString()]})]})}return ar("div",{className:"semiotic-tooltip",style:He,children:ar("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as hr}from"react/jsx-runtime";var ur=nr(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=sr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,showOutliers:f=!0,outlierRadius:y=3,categoryPadding:v=20,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:N,opacity:D,showCategoryTicks:j,categoryFormat:z}=e,{width:G,height:$,enableHover:V,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=r,ee=rr(()=>Be(a),[a]),te=i({data:ee,rawData:a,colorBy:m,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BoxPlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:$,hasTitle:!!Y}),oe=yt(),ie=rr(()=>new Map,[]),re=vi({colorBy:m,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:D,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ne=rr(()=>cr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=t({componentName:"BoxPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return hr(St,{componentName:"BoxPlot",message:se,width:G,height:$});const ae={chartType:"boxplot",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,showOutliers:f,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:U,rLabel:J,rFormat:g,...z&&{oFormat:z},showGrid:q,showCategoryTicks:j,...te.legendBehaviorProps,...O({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:b,defaultTooltipContent:ne}),...E({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return hr(_t,{componentName:"BoxPlot",width:G,height:$,children:hr(ai,{ref:s,...ae})})});ur.displayName="BoxPlot";import{useMemo as dr,forwardRef as gr,useRef as mr}from"react";import{jsx as pr,jsxs as fr}from"react/jsx-runtime";var yr=e=>{const t=e?.category;return null==t?"All":t+""},vr=gr(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=mr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h=yr,valueAccessor:u="value",bins:d=25,relative:g=!1,valueFormat:m,colorBy:p,colorScheme:f,categoryPadding:y=("sparkline"===r.mode?0:20),tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:A,linkedBrush:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:N,stroke:D,strokeWidth:j,opacity:z,showCategoryTicks:G,categoryFormat:$}=e,{width:V,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=r,oe=dr(()=>Be(a),[a]),ie=i({data:oe,rawData:a,colorBy:p,colorScheme:f,legendInteraction:B,legendPosition:F,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"Histogram",chartId:L,showLegend:Q,userMargin:l,marginDefaults:r.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:V,height:q,hasTitle:!!K}),re=tr({brushProp:w,onBrushProp:A,linkedBrush:k,valueAccessor:u}),ne=dr(()=>{if(0===oe.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of oe){const r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[oe,u]),se=yt(),ae=dr(()=>new Map,[]),le=vi({colorBy:p,colorScale:ie.colorScale,color:N,themeCategorical:se,colorScheme:f,categoryIndexMap:ae,userPieceStyle:void 0,stroke:D,strokeWidth:j,opacity:z,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=dr(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return fr("div",{className:"semiotic-tooltip",style:He,children:[o&&pr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&fr("div",{children:["Count: ",i]}),r&&2===r.length&&fr("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=t({componentName:"Histogram",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(he)return pr(St,{componentName:"Histogram",message:he,width:V,height:q});const ue={chartType:"histogram",...null!=a&&{data:oe},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:le,bins:d,normalize:g,...x?{rExtent:x}:ne&&{rExtent:ne},size:[V,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:ee,rLabel:te,rFormat:m,...$&&{oFormat:$},showGrid:Y,showCategoryTicks:G,...ie.legendBehaviorProps,...O({title:K,description:Z,summary:U,accessibleTable:J,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:v,defaultTooltipContent:ce}),...E({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return pr(_t,{componentName:"Histogram",width:V,height:q,children:pr(ai,{ref:s,...ue})})});vr.displayName="Histogram";import{useMemo as br,forwardRef as xr,useRef as wr}from"react";import{jsx as Ar}from"react/jsx-runtime";var kr=xr(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=wr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",bins:g=25,curve:m="catmullRom",showIQR:p=!0,valueFormat:f,colorBy:y,colorScheme:v,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,brush:k,onBrush:S,linkedBrush:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:N,legendPosition:D,color:j,stroke:z,strokeWidth:G,opacity:$,showCategoryTicks:V,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=r,re=br(()=>Be(a),[a]),ne=i({data:re,rawData:a,colorBy:y,colorScheme:v,legendInteraction:N,legendPosition:D,selection:P,linkedHover:R,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:l,marginDefaults:r.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:X,height:Y,hasTitle:!!U}),se=tr({brushProp:k,onBrushProp:S,linkedBrush:_,valueAccessor:u}),ae=yt(),le=br(()=>new Map,[]),ce=vi({colorBy:y,colorScale:ne.colorScale,color:j,themeCategorical:ae,colorScheme:v,categoryIndexMap:le,userPieceStyle:void 0,stroke:z,strokeWidth:G,opacity:$,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=br(()=>cr({valueAccessor:u}),[u]);if(ne.earlyReturn)return ne.earlyReturn;const ue=t({componentName:"ViolinPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(ue)return Ar(St,{componentName:"ViolinPlot",message:ue,width:X,height:Y});const de={chartType:"violin",...null!=a&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ce,bins:g,showIQR:p,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:b,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:oe,rLabel:ie,rFormat:f,...q&&{oFormat:q},showGrid:K,showCategoryTicks:V,...ne.legendBehaviorProps,...O({title:U,description:J,summary:ee,accessibleTable:te,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:x,defaultTooltipContent:he}),...E({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...se.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return Ar(_t,{componentName:"ViolinPlot",width:X,height:Y,children:Ar(ai,{ref:s,...de})})});kr.displayName="ViolinPlot";import{useMemo as Sr,forwardRef as _r,useRef as Cr}from"react";import{jsx as Pr}from"react/jsx-runtime";var Rr=_r(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Cr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="horizontal",bins:g=20,amplitude:m=1.5,valueFormat:p,colorBy:f,colorScheme:y,categoryPadding:v=5,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:N,opacity:D,showCategoryTicks:j,categoryFormat:z}=e,{width:G,height:$,enableHover:V,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=r,ee=Sr(()=>Be(a),[a]),te=i({data:ee,rawData:a,colorBy:f,colorScheme:y,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:f?["string"==typeof f?f:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"RidgelinePlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:$,hasTitle:!!Y}),oe=yt(),ie=Sr(()=>new Map,[]),re=vi({colorBy:f,colorScale:te.colorScale,color:B,themeCategorical:oe,colorScheme:y,categoryIndexMap:ie,userPieceStyle:void 0,stroke:F,strokeWidth:N,opacity:D,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),ne=Sr(()=>cr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=t({componentName:"RidgelinePlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return Pr(St,{componentName:"RidgelinePlot",message:se,width:G,height:$});const ae={chartType:"ridgeline",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,bins:g,size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:U,rLabel:J,rFormat:p,...z&&{oFormat:z},showGrid:q,showCategoryTicks:j,oSort:!1,amplitude:m,...te.legendBehaviorProps,...O({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:b,defaultTooltipContent:ne}),...E({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Pr(_t,{componentName:"RidgelinePlot",width:G,height:$,children:Pr(ai,{ref:s,...ae})})});Rr.displayName="RidgelinePlot";import{useMemo as Mr,forwardRef as Lr,useRef as Ir}from"react";import{jsx as Tr,jsxs as Hr}from"react/jsx-runtime";var Br=Lr(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Ir(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:g,colorScheme:m,orientation:p="horizontal",connectorOpacity:f=.3,showLabels:y=!0,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,loading:P,loadingContent:R,emptyContent:M,legendInteraction:L,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,categoryFormat:O}=e,N="vertical"===p,{width:D,height:W,enableHover:j,showLegend:z,title:G,description:$,summary:V,accessibleTable:q}=r,X=N?{top:G?60:40,right:20,bottom:60,left:60}:{top:G?40:10,right:10,bottom:10,left:10},Y=Mr(()=>Be(a),[a]),Q=g||d,K=!Q,Z=i({data:Y,rawData:a,colorBy:Q,colorScheme:m,legendInteraction:L,legendPosition:I,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"FunnelChart",chartId:C,showLegend:z,userMargin:l,marginDefaults:X,loading:P,loadingContent:R,emptyContent:M,width:D,height:W,hasTitle:!!G});Rt("FunnelChart",Y,"stepAccessor",h),Rt("FunnelChart",Y,"valueAccessor",u);const U=yt(),J=Mr(()=>new Map,[]),ee=Mr(()=>{if(K)return T||(U?.[0]?U[0]:Array.isArray(m)&&m[0]?m[0]:"#4e79a7")},[K,T,U,m]),te=vi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:U,colorScheme:m,categoryIndexMap:J,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=Mr(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,n=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,s=t?.__barFunnelIsDropoff,a=t?.__barFunnelCategory??t?.category,l=null==r||n?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return Hr("div",{className:"semiotic-tooltip",style:He,children:[o&&Tr("div",{style:{fontWeight:"bold"},children:o+""}),a&&a!==o&&Tr("div",{style:{marginTop:2,opacity:.8},children:a+""}),s&&Tr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Hr("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=t({componentName:"FunnelChart",data:a,accessors:{stepAccessor:h,valueAccessor:u}});if(ie)return Tr(St,{componentName:"FunnelChart",message:ie,width:D,height:W});const re={chartType:N?"bar-funnel":"funnel",...null!=a&&{data:Y},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:N?"vertical":"horizontal",barPadding:N?40:0,pieceStyle:te,size:[D,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:N,showCategoryTicks:N,...O&&{oFormat:O},showGrid:N,...!N&&{connectorOpacity:f},showLabels:y,...Z.legendBehaviorProps,...G&&{title:G},...$&&{description:$},...V&&{summary:V},...void 0!==q&&{accessibleTable:q},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===v?()=>null:!0===v||null==v?oe:Ke(v)||oe,...E({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...b&&b.length>0&&{annotations:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Tr(_t,{componentName:"FunnelChart",width:D,height:W,children:Tr(ai,{ref:s,...re})})});Br.displayName="FunnelChart";import{useMemo as Fr,forwardRef as Or,useRef as Er}from"react";import{jsx as Nr}from"react/jsx-runtime";var Dr=Or(function(o,r){const s=ut(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid??!0,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),a=Er(null);n(r,{variant:"xy",frameRef:a});const{data:l,margin:c,className:h,categoryAccessor:u="category",valueAccessor:d="value",orientation:g="horizontal",valueFormat:m,colorBy:p,colorScheme:f,sort:y="auto",dotRadius:v=5,categoryPadding:b=10,tooltip:x,annotations:w,regression:A,valueExtent:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:N,stroke:j,strokeWidth:z,opacity:G,categoryFormat:$}=o,{width:V,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=s,oe=Fr(()=>Be(l),[l]),ie=i({data:oe,rawData:l,colorBy:p,colorScheme:f,legendInteraction:B,legendPosition:F,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof u?u:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"DotPlot",chartId:L,showLegend:Q,userMargin:c,marginDefaults:s.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:V,height:q,hasTitle:!!K}),re=ft(oe,y,d),ne=yt(),se=Fr(()=>new Map,[]),ae=vi({colorBy:p,colorScale:ie.colorScale,color:N,themeCategorical:ne,colorScheme:f,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:j,strokeWidth:z,opacity:G,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:v,fillOpacity:.8}}),le=Fr(()=>D({categoryAccessor:u,valueAccessor:d,valueFormat:m}),[u,d,m]);if(ie.earlyReturn)return ie.earlyReturn;const ce=t({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ce)return Nr(St,{componentName:"DotPlot",message:ce,width:V,height:q});const he=e(A),ue=he?[he,...w||[]]:w,de={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===g?"horizontal":"vertical",pieceStyle:ae,size:[V,q],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ie.margin,barPadding:b,enableHover:X,...o.dataIdAccessor&&{dataIdAccessor:o.dataIdAccessor},showAxes:s.showAxes,oLabel:ee,rLabel:te,rFormat:m,...$&&{oFormat:$},showGrid:Y,oSort:y,...ie.legendBehaviorProps,...O({title:K,description:Z,summary:U,accessibleTable:J,className:h,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...W({tooltip:x,defaultTooltipContent:le}),...E({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...ue&&ue.length>0&&{annotations:ue},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Nr(_t,{componentName:"DotPlot",width:V,height:q,children:Nr(ai,{ref:a,...de})})});Dr.displayName="DotPlot";import{useMemo as Wr,forwardRef as jr,useRef as zr}from"react";import{jsx as Gr}from"react/jsx-runtime";var $r=jr(function(e,o){const r=ut(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=zr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,startAngle:g=0,cornerRadius:m,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:A,chartId:k,loading:S,loadingContent:_,emptyContent:C,legendInteraction:P,legendPosition:R,color:M,stroke:L,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:F,showLegend:N,title:j,description:z,summary:G,accessibleTable:$}=r,V=Wr(()=>Be(s),[s]),q=u||c,X=i({data:V,rawData:s,colorBy:q,colorScheme:d,legendInteraction:P,legendPosition:R,selection:v,linkedHover:b,fallbackFields:q?["string"==typeof q?q:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:N,userMargin:a,marginDefaults:r.marginDefaults,loading:S,loadingContent:_,emptyContent:C,width:H,height:B,hasTitle:!!j}),Y=yt(),Q=Wr(()=>new Map,[]),K=vi({colorBy:q,colorScale:X.colorScale,color:M,themeCategorical:Y,colorScheme:d,categoryIndexMap:Q,userPieceStyle:y?.pieceStyle,stroke:L,strokeWidth:I,opacity:T,effectiveSelectionHook:X.effectiveSelectionHook,resolvedSelection:X.resolvedSelection,cycleByCategory:!0}),Z=Wr(()=>D({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),U=t({componentName:"PieChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:J,effectiveMargin:ee}=fi({ref:o,frameRef:n,setup:X});if(X.earlyReturn)return X.earlyReturn;const te={chartType:"pie",...null!=s&&{data:V},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:K,startAngle:g,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...O({title:j,description:z,summary:G,accessibleTable:$,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:p,defaultTooltipContent:Z}),...E({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:X.mobileInteraction,customHoverBehavior:X.customHoverBehavior,customClickBehavior:X.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return U?Gr(St,{componentName:"PieChart",message:U,width:H,height:B}):Gr(_t,{componentName:"PieChart",width:H,height:B,children:Gr(ai,{ref:n,...te})})});$r.displayName="PieChart";import{useMemo as Vr,forwardRef as qr,useRef as Xr}from"react";import{jsx as Yr}from"react/jsx-runtime";var Qr=qr(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),n=Xr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:g,colorScheme:m,startAngle:p=0,cornerRadius:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:A,onClick:k,hoverHighlight:S,chartId:_,loading:C,loadingContent:P,emptyContent:R,legendInteraction:M,legendPosition:L,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:N,enableHover:j,showLegend:z,title:G,description:$,summary:V,accessibleTable:q}=r,X=Vr(()=>Be(s),[s]),Y=g||c,Q=i({data:X,rawData:s,colorBy:Y,colorScheme:m,legendInteraction:M,legendPosition:L,selection:x,linkedHover:w,fallbackFields:Y?["string"==typeof Y?Y:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"DonutChart",chartId:_,showLegend:z,userMargin:a,marginDefaults:r.marginDefaults,loading:C,loadingContent:P,emptyContent:R,width:F,height:N,hasTitle:!!G}),K=u??Math.max(2,.15*Math.min(F,N)),Z=yt(),U=Vr(()=>new Map,[]),J=vi({colorBy:Y,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:m,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=Vr(()=>D({categoryAccessor:c,valueAccessor:h,groupAccessor:g&&g!==c?g:void 0,groupLabel:"string"==typeof g?g:"group",pieData:!0}),[c,h,g]),te=t({componentName:"DonutChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:oe,effectiveMargin:ie}=fi({ref:o,frameRef:n,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const re={chartType:"donut",...null!=s&&{data:X},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:J,innerRadius:K,startAngle:p,...null!=f&&{cornerRadius:f},centerContent:d,size:[F,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...O({title:G,description:$,summary:V,accessibleTable:q,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:y,defaultTooltipContent:ee}),...E({linkedHover:w,selection:x,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return te?Yr(St,{componentName:"DonutChart",message:te,width:F,height:N}):Yr(_t,{componentName:"DonutChart",width:F,height:N,children:Yr(ai,{ref:n,...re})})});Qr.displayName="DonutChart";import{useMemo as Kr,forwardRef as Zr,useRef as Ur}from"react";function Jr(e=240){const t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function en(e){return Math.max(0,Math.min(1,e))}function tn(e){const t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){const e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function on(e,t,o){const i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function rn(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:en(e.offset),color:e.color??o,opacity:null==e.opacity?1:en(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const r=e=>{if(1===e.opacity)return e.color;const t=tn(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);const n=en(t);if(i[0].offset>=n)return r(i[0]);if(n>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>n||n>o.offset)continue;const s=o.offset-t.offset,a=s>0?(n-t.offset)/s:0,l=tn(t.color),c=tn(o.color);if(!l||!c)return r(.5>a?t:o);const[h,u,d]=l,[g,m,p]=c,f=h+(g-h)*a,y=u+(m-u)*a,v=d+(p-d)*a,b=t.opacity+(o.opacity-t.opacity)*a;return 1===b?on(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function nn(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as sn,jsxs as an}from"react/jsx-runtime";var ln=Zr(function(e,t){const i=ut(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),r=Ur(null),n="context"===i.mode,{compactMode:s}=i,{value:a,min:l=0,max:c=100,thresholds:h,gradientFill:u,color:g,backgroundColor:m="var(--semiotic-grid, #e0e0e0)",arcWidth:p=.3,cornerRadius:f,showNeedle:y=!0,needleColor:v="var(--semiotic-text, #333)",centerContent:b,valueFormat:x,showScaleLabels:w=!s,sweep:A=240,fillZones:k=!0,tooltip:S,annotations:_,frameProps:C={},className:P,stroke:R,strokeWidth:M,opacity:L}=e,{width:I,height:T,title:H,description:B,summary:F,accessibleTable:O}=i,E=d(u),N=Math.max(l,Math.min(c,a)),D=c-l||1,W=(N-l)/D,{gaugeData:j,pieceStyle:z,gaugeAnnotations:G}=Kr(()=>function(e){const{min:t,max:o,value:i,thresholds:r,fillColor:n,backgroundColor:s,fillZones:a,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,u=o-t||1,d=(Math.max(t,Math.min(o,i))-t)/u;let g=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:n||"#007bff"}];g=g.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>g[g.length-1].value&&g.push({value:o,color:g[g.length-1].color});const m=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(m){const e=a?d:1,t=nn("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:s,opacity:.4}),e>0){const t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(rn(c.stops,e*(t+.5)/o,n||g[0]?.color||"#007bff"));const r=nn("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||s})}}else{let e=t;for(let o=0;g.length>o;o++){const i=g[o],r=(i.value-e)/u,n=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(a?Math.min(d,l):l)-n),h=a?Math.max(0,r-c):0;if(c>0){const e=nn("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){const e=nn("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:s,opacity:.4})}e=i.value}}if(l&&r&&r.length>0)for(const e of r)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:s},gaugeAnnotations:y}}({min:l,max:c,value:a,thresholds:h,fillColor:g,backgroundColor:m,fillZones:k,showScaleLabels:w,gradientFill:E}),[a,l,c,h,g,m,w,k,E]),$=Kr(()=>o(z,{stroke:R,strokeWidth:M,opacity:L}),[z,R,M,L]),{sweepRad:V,startAngleDeg:q}=Jr(A),X=function(e=240){const{sweepRad:t,offsetRad:o}=Jr(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||i.push([Math.cos(e),Math.sin(e)]);const r=i.map(e=>e[0]),n=i.map(e=>e[1]),[s,a]=wt(r),[l,c]=wt(n);return{minX:s,maxX:a,minY:l,maxY:c,width:a-s,height:c-l,cx:(s+a)/2,cy:(l+c)/2}}(A),Y=Math.min(10,Math.max(1,Math.min(I,T)/12)),Q=X.cx,K=X.cy,Z=Math.max(4,Math.min((I-2*Y)/X.width,(T-2*Y)/X.height)-2),U=Math.max(0,Math.min(Z-1.5,Z*(1-p))),J=I/2-Q*Z,ee=T/2-K*Z,te=2*(Z+4),oe=Kr(()=>{if(s&&null==b)return null;if(null!=b)return"function"==typeof b?b(N,l,c):b;const e=x?x(N):Math.round(N)+"";return an("div",{style:{textAlign:"center",lineHeight:1.2},children:[sn("div",{style:{fontSize:Math.max(16,.3*Z),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),w&&an("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[b,N,l,c,x,w,Z,s]),ie=Kr(()=>n&&null==b?{type:"gauge-value",text:x?x(N):Math.round(N)+""}:null,[n,b,N,x]),re=Kr(()=>{if(!y)return null;const e=-Math.PI/2+q*Math.PI/180+W*V,t=U>20?U-8:Z-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:v}},[y,q,W,V,U,Z,v]),ne=Kr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||I)/2,r=(o.height||T)/2,n=Math.max(1,Z-U),s=Math.max(1,Math.min(2.5,.4*n)),a=Math.max(1,Math.min(5,.6*n));return an("g",{transform:`translate(${i},${r})`,children:[sn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:s,strokeLinecap:"round"}),sn("circle",{cx:0,cy:0,r:a,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+q*Math.PI/180+(e.value-l)/D*V,r=(o.width||I)/2,n=(o.height||T)/2,s=U-1,a=Z+1,c=Math.cos(i)*s,h=Math.sin(i)*s,u=Math.cos(i)*a,d=Math.sin(i)*a,g=Z+10,m=Math.cos(i)*g,p=Math.sin(i)*g,f=((i+Math.PI/2)/(2*Math.PI)*12+12)%12;let y,v;return f>=11||1>f?(y="middle",v="auto"):f>=1&&5>f?(y="start",v="middle"):f>=5&&7>f?(y="middle",v="hanging"):(y="end",v="middle"),an("g",{transform:`translate(${r},${n})`,children:[sn("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),sn("text",{x:m,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?sn("text",{x:(o.width||I)/2,y:(o.height||T)/2-.2*U,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*Z)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[I,T,l,D,q,V,U,Z]),se=Kr(()=>{const e=[...G,..._||[]];return re&&e.push(re),ie&&e.push(ie),e},[G,_,re,ie]),ae=Kr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return an("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[sn("div",{style:{fontWeight:600},children:o}),sn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(N):"Remaining"})]})},[N]);if(0===j.length)return sn(St,{componentName:"GaugeChart",message:"No data to display",width:I,height:T});const le={chartType:"donut",data:j,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:$,innerRadius:U,startAngle:q,sweepAngle:A,...null!=f&&{cornerRadius:f},centerContent:oe,size:[I,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:{top:ee-te/2,bottom:T-ee-te/2,left:J-te/2,right:I-J-te/2},enableHover:i.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===S?()=>null:Ke(S)||ae,svgAnnotationRules:ne,...se.length>0&&{annotations:se},...H&&{title:H},...B&&{description:B},...F&&{summary:F},...void 0!==O&&{accessibleTable:O},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...C};return sn(_t,{componentName:"GaugeChart",width:I,height:T,children:sn(ai,{ref:r,...le})})});ln.displayName="GaugeChart";import{useMemo as cn,forwardRef as hn,useRef as un}from"react";import{jsx as dn}from"react/jsx-runtime";var gn=hn(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=un(null),{data:s,margin:a,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=60,roundedTop:b,gradientFill:x,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,valueExtent:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:N,legendPosition:j,color:z,stroke:G,strokeWidth:$,opacity:V,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=r,re=cn(()=>Be(s),[s]),se=p||h,ae=i({data:re,rawData:s,colorBy:se,colorScheme:f,legendInteraction:N,legendPosition:j,selection:P,linkedHover:R,fallbackFields:se?["string"==typeof se?se:""]:[],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:a,marginDefaults:r.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:X,height:Y,hasTitle:!!U}),le=yt(),ce=cn(()=>new Map,[]),he=cn(()=>ne(u),[u]),ue=vi({colorBy:se,colorScale:ae.colorScale,color:z,themeCategorical:le,colorScheme:f,categoryIndexMap:ce,userPieceStyle:C.pieceStyle,stroke:G,strokeWidth:$,opacity:V,styleRules:w,resolveRuleValue:he,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),de=cn(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),ge=t({componentName:"GroupedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:me,effectiveMargin:pe}=fi({ref:o,frameRef:n,setup:ae}),fe=cn(()=>g(x),[x]);if(ae.earlyReturn)return ae.earlyReturn;const ye={chartType:"clusterbar",...null!=s&&{data:re},oAccessor:c,rAccessor:u,groupBy:h,oSort:y,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ue,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:v,...null!=b&&{roundedTop:b},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:oe,rLabel:ie,rFormat:m,...q&&{oFormat:q},showGrid:K,...me,...O({title:U,description:J,summary:ee,accessibleTable:te,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:k,defaultTooltipContent:de}),...E({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return ge?dn(St,{componentName:"GroupedBarChart",message:ge,width:X,height:Y}):dn(_t,{componentName:"GroupedBarChart",width:X,height:Y,children:dn(ai,{ref:n,...ye})})});gn.displayName="GroupedBarChart";import{useMemo as mn,forwardRef as pn,useRef as fn}from"react";import{jsx as yn}from"react/jsx-runtime";var vn=pn(function(e,o){const r=ut(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=fn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:d="horizontal",valueFormat:m,colorBy:p,colorScheme:f,barPadding:y,tooltip:v,annotations:b,brush:x,onBrush:w,linkedBrush:A,frameProps:k={},selection:S,linkedHover:_,onObservation:C,onClick:P,hoverHighlight:R,chartId:M,loading:L,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:B,color:F,stroke:N,strokeWidth:j,opacity:z,categoryFormat:G,rTickValues:$,tickLabelEdgeAlign:V,showCategoryTicks:q,gradientFill:X,trackFill:Y,roundedTop:Q,valueExtent:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:se,valueLabel:ae}=r,le=mn(()=>Be(s),[s]),ce=p||h,he=mn(()=>{if(null!=y)return y;if("sparkline"!==r.mode)return 40;const e=new Set(le.map(e=>"function"==typeof c?c(e):e[c])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===d?U:Z)-2*t)/(t-1))):1},[y,r.mode,le,c,d,Z,U]),ue=i({data:le,rawData:s,colorBy:ce,colorScheme:f,legendInteraction:H,legendPosition:B,selection:S,linkedHover:_,fallbackFields:ce?["string"==typeof ce?ce:""]:[],unwrapData:!0,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"SwimlaneChart",chartId:M,showLegend:te,userMargin:a,marginDefaults:r.marginDefaults,loading:L,loadingContent:I,emptyContent:T,width:Z,height:U,hasTitle:!!oe}),de=tr({brushProp:x,onBrushProp:w,linkedBrush:A,valueAccessor:u}),ge=yt(),me=mn(()=>new Map,[]),pe=vi({colorBy:ce,colorScale:ue.colorScale,color:F,themeCategorical:ge,colorScheme:f,categoryIndexMap:me,userPieceStyle:k?.pieceStyle,stroke:N,strokeWidth:j,opacity:z,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,cycleByCategory:!0}),fe=mn(()=>D({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:m}),[h,c,u,m]),ye=t({componentName:"SwimlaneChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ve,effectiveMargin:be}=fi({ref:o,frameRef:n,setup:ue}),xe=mn(()=>g(X),[X]);if(ue.earlyReturn)return ue.earlyReturn;const we={chartType:"swimlane",...null!=s&&{data:le},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:pe,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:he,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:!1===q?void 0:se,rLabel:ae,rFormat:m,...$&&{rTickValues:$},...null!=V&&{tickLabelEdgeAlign:V},...G&&{oFormat:G},...void 0!==q&&{showCategoryTicks:q},showGrid:ee,...ve,...O({title:oe,description:ie,summary:re,accessibleTable:ne,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W({tooltip:v,defaultTooltipContent:fe}),...E({linkedHover:_,selection:S,onObservation:C,onClick:P,hoverHighlight:R,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...b&&b.length>0&&{annotations:b},...xe&&{gradientFill:xe},...null!=Y&&{trackFill:Y},...null!=Q&&{roundedTop:Q},...K&&{rExtent:K},...de.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return ye?yn(St,{componentName:"SwimlaneChart",message:ye,width:Z,height:U}):yn(_t,{componentName:"SwimlaneChart",width:Z,height:U,children:yn(ai,{ref:n,...we})})});vn.displayName="SwimlaneChart";export{ai as StreamOrdinalFrame_default,ui as OrdinalCustomChart,xi as BarChart,_i as StackedBarChart,Qi as LikertChart,ir as SwarmPlot,ur as BoxPlot,vr as Histogram,kr as ViolinPlot,Rr as RidgelinePlot,Br as FunnelChart,Dr as DotPlot,$r as PieChart,Qr as DonutChart,ln as GaugeChart,gn as GroupedBarChart,vn as SwimlaneChart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getMinMax as t}from"./chunk-chunk-JJ2OOIET.module.min.js";function a(t,a=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)*(1-a)),o=Math.round(parseInt(n[2],16)*(1-a)),e=Math.round(parseInt(n[3],16)*(1-a));return`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}`}function n(t,a=.5){const n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!n)return t;const r=Math.round(parseInt(n[1],16)+(255-parseInt(n[1],16))*a),o=Math.round(parseInt(n[2],16)+(255-parseInt(n[2],16))*a),e=Math.round(parseInt(n[3],16)+(255-parseInt(n[3],16))*a);return`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}`}function r(t=240){const a=360-t,n=180+a/2,r=n*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:a,startAngleDeg:n,startAngleRad:r,offsetRad:-Math.PI/2+r}}function o(t,a,n,r,o){const e=n-a||1;return o+(Math.max(a,Math.min(n,t))-a)/e*r}function e(a=240){const{sweepRad:n,offsetRad:o}=r(a),e=[[Math.cos(o),Math.sin(o)],[Math.cos(o+n),Math.sin(o+n)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>n+.001||e.push([Math.cos(t),Math.sin(t)]);const s=e.map(t=>t[0]),h=e.map(t=>t[1]),[i,p]=t(s),[c,u]=t(h);return{minX:i,maxX:p,minY:c,maxY:u,width:p-i,height:u-c,cx:(i+p)/2,cy:(c+u)/2}}export{a as darkenColor,n as lightenColor,r as sweepToAngles,o as valueToAngle,e as computeArcBoundingBox};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{validateNetworkData as e,validateObjectData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,useCustomChartScaffold as n,useFrameImperativeHandle as i,useResolvedSelection as r}from"./chunk-chunk-VQPNBUSW.module.min.js";import{StreamNetworkFrame_default as s,buildRibbonGeometry as a}from"./chunk-chunk-ARZGA4LJ.module.min.js";import{buildBaseMetadataProps as l,buildCustomBehaviorProps as c}from"./chunk-chunk-WYARAXHR.module.min.js";import{mulberry32 as d}from"./chunk-chunk-SIRIJ3DY.module.min.js";import{composeStyleRules as m,makeNodeRuleContext as h}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as g,DEFAULT_COLORS as u,DEFAULT_SELECTION_OPACITY as f,DEPTH_PALETTE_COLORS as p,filterSparseArray as b,getColor as y,normalizeTooltip as v,resolveAxisFreeMarginDefaults as k,resolveCategoricalPalette as S,resolveDefaultFill as w,resolveMobileInteraction as C,useChartLegendAndMargin as T,useChartMode as A,useChartSelection as I,useColorScale as M,useLegendInteraction as H,useThemeCategorical as x}from"./chunk-chunk-PX5YQGDP.module.min.js";import{getMin as B}from"./chunk-chunk-JJ2OOIET.module.min.js";import{ChartError as N,SafeRender as D,renderEmptyState as O,renderLoadingState as P}from"./chunk-chunk-ACLDBMRH.module.min.js";import{forwardRef as L,useMemo as E}from"react";import{jsx as W}from"react/jsx-runtime";var R=L(function(e,t){const{nodes:o,edges:i,layout:r,layoutConfig:a,onLayoutError:d,nodeIDAccessor:m="id",sourceAccessor:h="source",targetAccessor:g="target",margin:u,className:f,colorBy:p,colorScheme:y,selection:v,linkedHover:k,onObservation:S,onClick:w,chartId:T,annotations:A,autoPlaceAnnotations:M,frameProps:H={}}=e,{frameRef:x,resolved:B,normalizedMargin:N}=n({imperativeRef:t,imperativeVariant:"network",margin:u,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),L=E(()=>b(o),[o]),R=E(()=>b(i),[i]),z=E(()=>void 0===o&&void 0===i?void 0:[...L,...R],[i,o,R,L]),F=C(e.mobileInteraction,{mode:e.mode,width:B.width,mobileSemantics:e.mobileSemantics}),{customHoverBehavior:j,customClickBehavior:$,activeSelectionHook:_}=I({selection:v,linkedHover:k,fallbackFields:"string"==typeof p?[p]:[],onObservation:S,onClick:w,chartType:"NetworkCustomChart",chartId:T,colorByField:"string"==typeof p?p:void 0,mobileInteraction:F}),G=E(()=>_?.isActive?{isActive:!0,predicate:_.predicate}:null,[_?.isActive,_?.predicate]),{width:q,height:X,enableHover:J,title:Y,description:Q,summary:Z,accessibleTable:K}=B,U=P(e.loading,q,X,e.loadingContent),V=U?null:O(z,q,X,e.emptyContent);if(U||V)return U||V;const ee={chartType:"force",...null!=o&&{nodes:L},...null!=i&&{edges:R},customNetworkLayout:r,layoutConfig:a,onLayoutError:d,nodeIDAccessor:m,sourceAccessor:h,targetAccessor:g,colorBy:p,colorScheme:y,size:[q,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:N,enableHover:J,...l({title:Y,description:Q,summary:Z,accessibleTable:K,className:f,animate:e.animate,autoPlaceAnnotations:M}),...c({linkedHover:k,selection:v,onObservation:S,onClick:w,mobileInteraction:F,customHoverBehavior:j,customClickBehavior:$,linkedHoverInClickPredicate:!1}),layoutSelection:G,...null!=A&&{annotations:A},...H};return W(D,{componentName:"NetworkCustomChart",width:q,height:X,children:W(s,{ref:x,...ee})})});R.displayName="NetworkCustomChart";import{useMemo as z,forwardRef as F,useRef as j}from"react";import{useMemo as $}from"react";function _(e,t){if(!e)return[];const o=[],n=e=>{o.push(e);const i="function"==typeof t?t(e):e[t];i&&Array.isArray(i)&&i.forEach(n)};return n(e),o}function G(e,t,o,n){if(e&&e.length>0)return e;const i=new Set;return t.forEach(e=>{const t="function"==typeof o?o(e):e[o],r="function"==typeof n?n(e):e[n];i.add(t),i.add(r)}),Array.from(i).map(e=>({id:e}))}function q(e){return"function"==typeof e?e:t=>t[e]||1}function X({edgeColorBy:e,colorBy:t,colorScale:o,nodeStyleFn:n,edgeOpacity:i,baseStyle:r={}}){return s=>{const a={fillOpacity:i,...r};if("function"==typeof e)a.fill=e(s);else if("source"===e){const e="object"==typeof s.source?s.source:null;t&&e?a.fill=y(e.data||e,t,o):e&&(a.fill=n(e,e.index).fill)}else if("target"===e){const e="object"==typeof s.target?s.target:null;t&&e?a.fill=y(e.data||e,t,o):e&&(a.fill=n(e,e.index).fill)}else"gradient"===e&&(a.fill="#999",a.fillOpacity=.7*i);return a}}function J(e){const{nodes:t,edges:o,inferNodes:n=!0,sourceAccessor:i="source",targetAccessor:r="target",colorBy:s,colorScheme:a,showLegend:l,legendPosition:c,legendInteraction:d,selection:m,linkedHover:h,onObservation:g,onClick:f,mobileInteraction:p,mobileSemantics:y,chartType:v,chartId:k,marginDefaults:w,userMargin:A,width:B,height:N,hasTitle:D,loading:L,loadingContent:E,emptyContent:W,emptyDataKey:R="edges"}=e,z=$(()=>b(o),[o]),F=$(()=>b(t),[t]),j=P(L,B,N,E),_=j?null:O("nodes"===R?void 0===t?void 0:F:void 0===o?void 0:z,B,N,W),q=$(()=>n?G(F,z,i,r):F,[n,F,z,i,r]),X=M(q,s,a),J=x(),Y=$(()=>Array.isArray(a)&&a.length>0?a:[...S(a,J,u)],[a,J]),Q=$(()=>{if(!s)return[];const e=new Set;for(const t of q){const o="function"==typeof s?s(t):t[s];null!=o&&e.add(o+"")}return Array.from(e)},[q,s]),Z=H(d,s,Q),{legend:K,margin:U,legendPosition:V}=T({data:q,colorBy:s,colorScale:X,showLegend:l,legendPosition:c,userMargin:A,defaults:w,categories:Q,chartWidth:B,hasTitle:D}),ee=$(()=>C(p,{width:B,mobileSemantics:y}),[p,B,y]),te=I({selection:m,linkedHover:h,fallbackFields:s?["string"==typeof s?s:""]:[],unwrapData:!0,onObservation:g,onClick:f,mobileInteraction:ee,chartType:v,chartId:k}),{customHoverBehavior:oe,customClickBehavior:ne,activeSelectionHook:ie,hoverSelectionHook:re,crosshairSourceId:se}=te;return{safeNodes:q,safeEdges:z,colorScale:X,effectivePalette:Y,themeCategorical:J,allCategories:Q,legendState:Z,legend:K,margin:U,legendPosition:V,mobileInteraction:ee,customHoverBehavior:oe,customClickBehavior:ne,activeSelectionHook:ie,hoverSelectionHook:re,crosshairSourceId:se,loadingEl:j,emptyEl:_}}import{jsx as Y}from"react/jsx-runtime";var Q=F(function(t,n){const r=j(null);i(n,{variant:"network",frameRef:r});const a=A(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLegend:t.showLegend,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:600,height:600}),{nodes:l,edges:d,margin:g,className:u,nodeIdAccessor:f,nodeIDAccessor:p,sourceAccessor:b="source",targetAccessor:k="target",nodeLabel:S,colorBy:C,colorScheme:T,styleRules:I,nodeSize:M=8,nodeSizeRange:H=[5,20],nodeStroke:x,nodeStrokeWidth:B,edgeWidth:O,edgeColor:P,edgeOpacity:L,iterations:E=300,forceStrength:W=.1,layoutExecution:R="auto",layoutLoadingContent:F,onLayoutStateChange:$,tooltip:_,frameProps:G={},onObservation:q,onClick:X,chartId:Q,selection:Z,linkedHover:K,loading:U,loadingContent:V,emptyContent:ee,legendInteraction:te,legendPosition:oe,stroke:ne,strokeWidth:ie,opacity:re}=t,se=f??p??"id",{width:ae,height:le,enableHover:ce,showLegend:de,showLabels:me=!1,title:he,description:ge,summary:ue,accessibleTable:fe}=a,pe=J({nodes:l,edges:d,inferNodes:!1,nodeIdAccessor:se,sourceAccessor:b,targetAccessor:k,colorBy:C,colorScheme:T,showLegend:de,legendPosition:oe,legendInteraction:te,selection:Z,linkedHover:K,onObservation:q,onClick:X,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ForceDirectedGraph",chartId:Q,marginDefaults:a.marginDefaults,userMargin:g,width:ae,height:le,hasTitle:!!he,loading:U,loadingContent:V,emptyContent:ee,emptyDataKey:"nodes"}),be=z(()=>new Map,[]),ye=z(()=>e=>{const t={};return t.fill=C?y(e.data||e,C,pe.colorScale):w(void 0,pe.themeCategorical,T,void 0,be),"number"==typeof M&&(t.r=M),t},[C,pe.colorScale,M,pe.themeCategorical,T,be]),ve=z(()=>h(C,"number"==typeof M?void 0:M),[C,M]),ke=z(()=>o(m(ye,I,ve,e=>e.data||e),{stroke:x??ne,strokeWidth:B??ie,opacity:re}),[ye,I,ve,x,ne,B,ie,re]),Se=P??ne??"#999",we=L??re??.6,Ce=ie??1,Te=z(()=>e=>{const t=e.data||e;let o;if(void 0===O)o=Ce;else if("number"==typeof O)o=O;else if("function"==typeof O)o=O(t);else{const e=t[O],n="number"==typeof e?e:Number(e);o=Number.isFinite(n)&&n>0?n:Ce}return{stroke:Se,strokeWidth:o,opacity:we}},[O,Se,we,Ce]),Ae=z(()=>{if(me&&S)return"function"==typeof S?S:e=>e.data?.[S]??e[S]??e.id},[me,S]),Ie=e({componentName:"ForceDirectedGraph",nodes:l,edges:d,nodesRequired:!0,edgesRequired:!0,accessors:{nodeIDAccessor:se}});return Ie?Y(N,{componentName:"ForceDirectedGraph",message:Ie,width:ae,height:le}):pe.loadingEl?pe.loadingEl:pe.emptyEl?pe.emptyEl:Y(D,{componentName:"ForceDirectedGraph",width:ae,height:le,children:Y(s,{ref:r,chartType:"force",...null!=l&&{nodes:pe.safeNodes},...null!=d&&{edges:pe.safeEdges},size:[ae,le],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:pe.margin,nodeIDAccessor:se,sourceAccessor:b,targetAccessor:k,iterations:E,forceStrength:W,layoutExecution:R,layoutLoadingContent:F,onLayoutStateChange:$,nodeStyle:ke,edgeStyle:Te,colorBy:C,colorScheme:pe.effectivePalette,nodeSize:M,nodeSizeRange:H,nodeLabel:Ae,showLabels:me,enableHover:ce,tooltipContent:!1===_?()=>null:v(_)||void 0,...c({linkedHover:K,selection:Z,onObservation:q,onClick:X,mobileInteraction:pe.mobileInteraction,customHoverBehavior:pe.customHoverBehavior,customClickBehavior:pe.customClickBehavior,linkedHoverInClickPredicate:!1}),legend:pe.legend,legendPosition:pe.legendPosition,...te&&"none"!==te&&{legendHoverBehavior:pe.legendState.onLegendHover,legendClickBehavior:pe.legendState.onLegendClick,legendHighlightedCategory:pe.legendState.highlightedCategory,legendIsolatedCategories:pe.legendState.isolatedCategories},className:u,title:he,description:ge,summary:ue,accessibleTable:fe,...null!=t.animate&&{animate:t.animate},...G})})});Q.displayName="ForceDirectedGraph";import{useMemo as Z,forwardRef as K,useRef as U}from"react";import{jsx as V}from"react/jsx-runtime";var ee=K(function(t,n){const r=U(null);i(n,{variant:"network",frameRef:r,overrides:{getData:()=>r.current?.getTopology()?.edges?.map(e=>e.data)??[]}});const a=A(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:600,height:600}),{nodes:l,edges:d,margin:f,className:p,sourceAccessor:b="source",targetAccessor:k="target",valueAccessor:S="value",nodeIdAccessor:C="id",colorBy:T,colorScheme:I,styleRules:M,edgeColorBy:H="source",padAngle:x=.01,groupWidth:B=20,sortGroups:O,nodeLabel:P,edgeOpacity:L=.5,tooltip:E,frameProps:W={},onObservation:R,onClick:z,chartId:F,selection:j,linkedHover:$,loading:_,loadingContent:G,emptyContent:q,legendInteraction:Y,stroke:Q,strokeWidth:K,opacity:ee}=t,{width:te,height:oe,enableHover:ne,showLabels:ie=!0,title:re,description:se,summary:ae,accessibleTable:le}=a,ce=J({nodes:l,edges:d,inferNodes:!0,nodeIdAccessor:C,sourceAccessor:b,targetAccessor:k,colorBy:T,colorScheme:I,showLegend:!1,legendInteraction:Y,selection:j,linkedHover:$,onObservation:R,onClick:z,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ChordDiagram",chartId:F,marginDefaults:a.marginDefaults,userMargin:f,width:te,height:oe,hasTitle:!!re,loading:_,loadingContent:G,emptyContent:q}),de=Z(()=>new Map,[]),me=Z(()=>new Map,[]),he=ce.safeNodes.length>0,ge=Z(()=>{if(he)return(e,t)=>{const o={stroke:"black",strokeWidth:1};if(T)o.fill=y(e.data||e,T,ce.colorScale);else{const n=Array.isArray(I)?I:g[I]||u,i=Array.isArray(n)?n:u,r=(e.id??e.data?.[C]??"")+"";me.has(r)||me.set(r,me.size);const s=e.index??t??me.get(r);o.fill=i[s%i.length]}return o}},[he,T,ce.colorScale,I,C,me]),ue=Z(()=>h(T),[T]),fe=Z(()=>{if(ge||M&&M.length>0)return o(m(ge,M,ue,e=>e.data||e),{stroke:Q,strokeWidth:K,opacity:ee})},[ge,M,ue,Q,K,ee]),pe=Z(()=>{if(he)return X({edgeColorBy:H,colorBy:T,colorScale:ce.colorScale,nodeStyleFn:fe||(e=>({fill:w(void 0,ce.themeCategorical,I,void 0,de)})),edgeOpacity:L,baseStyle:{stroke:"black",strokeWidth:.5,strokeOpacity:L}})},[he,H,T,ce.colorScale,fe,L,ce.themeCategorical,I,de]),be=Z(()=>pe?o(pe,{stroke:Q,strokeWidth:K,opacity:ee}):void 0,[pe,Q,K,ee]),ye=Z(()=>{if(!ie)return;const e=P||C;return"function"==typeof e?e:t=>t.data?.[e]??t[e]??t.id},[ie,P,C]),ve=e({componentName:"ChordDiagram",edges:d,edgesRequired:!0});return ve?V(N,{componentName:"ChordDiagram",message:ve,width:te,height:oe}):ce.loadingEl?ce.loadingEl:ce.emptyEl?ce.emptyEl:V(D,{componentName:"ChordDiagram",width:te,height:oe,children:V(s,{ref:r,chartType:"chord",...ce.safeNodes.length>0&&{nodes:ce.safeNodes},...null!=d&&{edges:ce.safeEdges},size:[te,oe],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ce.margin,nodeIDAccessor:C,sourceAccessor:b,targetAccessor:k,valueAccessor:S,padAngle:x,groupWidth:B,sortGroups:O,nodeStyle:fe,edgeStyle:be,colorBy:T,colorScheme:ce.effectivePalette,edgeColorBy:H,edgeOpacity:L,nodeLabel:ye,showLabels:ie,enableHover:ne,tooltipContent:!1===E?()=>null:v(E)||void 0,...c({linkedHover:$,selection:j,onObservation:R,onClick:z,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior,linkedHoverInClickPredicate:!1}),...Y&&"none"!==Y&&{legendHoverBehavior:ce.legendState.onLegendHover,legendClickBehavior:ce.legendState.onLegendClick,legendHighlightedCategory:ce.legendState.highlightedCategory,legendIsolatedCategories:ce.legendState.isolatedCategories},className:p,title:re,description:se,summary:ae,accessibleTable:le,...null!=t.animate&&{animate:t.animate},...W})})});ee.displayName="ChordDiagram";import{useMemo as te,forwardRef as oe,useRef as ne}from"react";import{jsx as ie}from"react/jsx-runtime";var re=oe(function(t,n){const r=ne(null);i(n,{variant:"network",frameRef:r,overrides:{getData:()=>r.current?.getTopology()?.edges?.map(e=>e.data)??[]}});const a=A(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:800,height:600}),{nodes:l,edges:d,margin:g,className:u,sourceAccessor:f="source",targetAccessor:p="target",valueAccessor:b="value",nodeIdAccessor:k="id",colorBy:S,colorScheme:C,styleRules:T,edgeColorBy:I="source",orientation:M="horizontal",nodeAlign:H="justify",nodePaddingRatio:x=.05,nodeWidth:B=15,nodeLabel:O,edgeOpacity:P=.5,edgeSort:L,tooltip:E,frameProps:W={},onObservation:R,onClick:z,chartId:F,selection:j,linkedHover:$,loading:_,loadingContent:G,emptyContent:q,showLegend:Y,legendPosition:Q,legendInteraction:Z,stroke:K,strokeWidth:U,opacity:V}=t,{width:ee,height:oe,enableHover:re,showLabels:se=!0,title:ae,description:le,summary:ce,accessibleTable:de}=a,me=J({nodes:l,edges:d,inferNodes:!0,nodeIdAccessor:k,sourceAccessor:f,targetAccessor:p,colorBy:S,colorScheme:C,showLegend:Y,legendPosition:Q,legendInteraction:Z,selection:j,linkedHover:$,onObservation:R,onClick:z,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"SankeyDiagram",chartId:F,marginDefaults:a.marginDefaults,userMargin:g,width:ee,height:oe,hasTitle:!!ae,loading:_,loadingContent:G,emptyContent:q}),he=te(()=>new Map,[]),ge=te(()=>e=>{const t={stroke:"black",strokeWidth:1};return t.fill=S?y(e.data||e,S,me.colorScale):w(void 0,me.themeCategorical,C,void 0,he),t},[S,me.colorScale,me.themeCategorical,C,he]),ue=te(()=>h(S,b),[S,b]),fe=te(()=>o(m(ge,T,ue,e=>e.data||e),{stroke:K,strokeWidth:U,opacity:V}),[ge,T,ue,K,U,V]),pe=te(()=>X({edgeColorBy:I,colorBy:S,colorScale:me.colorScale,nodeStyleFn:fe,edgeOpacity:P,baseStyle:{stroke:"none",strokeWidth:0}}),[I,S,me.colorScale,fe,P]),be=te(()=>o(pe,{stroke:K,strokeWidth:U,opacity:V}),[pe,K,U,V]),ye=te(()=>{if(!se)return;const e=O||k;return"function"==typeof e?e:t=>t.data?.[e]??t[e]??t.id},[se,O,k]),ve=e({componentName:"SankeyDiagram",edges:d,edgesRequired:!0});return ve?ie(N,{componentName:"SankeyDiagram",message:ve,width:ee,height:oe}):me.loadingEl?me.loadingEl:me.emptyEl?me.emptyEl:ie(D,{componentName:"SankeyDiagram",width:ee,height:oe,children:ie(s,{ref:r,chartType:"sankey",...me.safeNodes.length>0&&{nodes:me.safeNodes},...null!=d&&{edges:me.safeEdges},size:[ee,oe],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:me.margin,nodeIDAccessor:k,sourceAccessor:f,targetAccessor:p,valueAccessor:b,orientation:M,nodeAlign:H,nodePaddingRatio:x,nodeWidth:B,nodeStyle:fe,edgeStyle:be,colorBy:S,colorScheme:me.effectivePalette,edgeColorBy:I,edgeOpacity:P,edgeSort:L,nodeLabel:ye,showLabels:se,enableHover:re,tooltipContent:!1===E?()=>null:v(E)||void 0,...c({linkedHover:$,selection:j,onObservation:R,onClick:z,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior,linkedHoverInClickPredicate:!1}),legend:me.legend,legendPosition:me.legendPosition,...Z&&"none"!==Z&&{legendHoverBehavior:me.legendState.onLegendHover,legendClickBehavior:me.legendState.onLegendClick,legendHighlightedCategory:me.legendState.highlightedCategory,legendIsolatedCategories:me.legendState.isolatedCategories},className:u,title:ae,description:le,summary:ce,accessibleTable:de,...null!=t.animate&&{animate:t.animate},...W})})});function se(e,t,o){const n=[],i=new Set(e.map(e=>e.id)),r=Array.isArray(o)&&2===o.length,s=r&&Number.isFinite(o[0])&&Number.isFinite(o[1]);r&&s&&s&&o[1]>=o[0]||n.push({kind:"invalid-domain"});for(const t of e)null!=t.xExtent&&(Array.isArray(t.xExtent)&&2===t.xExtent.length&&Number.isFinite(t.xExtent[0])&&Number.isFinite(t.xExtent[1])&&t.xExtent[1]>=t.xExtent[0]||n.push({kind:"invalid-node-time",id:t.id}));for(const e of t)i.has(e.source)||n.push({kind:"missing-node",id:e.id,endpoint:"source",nodeId:e.source}),i.has(e.target)||n.push({kind:"missing-node",id:e.id,endpoint:"target",nodeId:e.target}),Number.isFinite(e.startTime)&&Number.isFinite(e.endTime)?(Number.isFinite(e.value)&&e.value>0||n.push({kind:"invalid-value",id:e.id}),e.endTime>e.startTime||n.push({kind:"backward-edge",id:e.id,source:e.source,target:e.target})):n.push({kind:"invalid-edge-time",id:e.id});return n}function ae(e){return"invalid-node-time"===e.kind?`node ${e.id} has an invalid xExtent (must be [start, end] with start <= end)`:"invalid-edge-time"===e.kind?`edge ${e.id} has an invalid startTime or endTime`:"invalid-domain"===e.kind?"time domain must be a 2-tuple of finite times [start, end] with start <= end":"invalid-value"===e.kind?`edge ${e.id} must have a positive finite value`:"missing-node"===e.kind?`edge ${e.id} references missing ${e.endpoint} node "${e.nodeId}"`:"backward-edge"===e.kind?`edge ${e.id} (${e.source}->${e.target}) ends before it starts`:e.kind}function le(e,t,o){const n=t.incoming[e.id],i=t.outgoing[e.id],r=[];for(const e of n)r.push({time:e.endTime,delta:+e.value,edge:e,kind:"in",side:o.get(e.id).targetSide});for(const e of i)r.push({time:e.startTime,delta:-e.value,edge:e,kind:"out",side:o.get(e.id).sourceSide});const s={create:0,in:1,"transfer-out":2,"transfer-in":3,out:4},a=()=>{r.sort((e,t)=>e.time-t.time||(s[e.kind]??99)-(s[t.kind]??99))},l=r.length?B(r.map(e=>e.time)):null,c=Array.isArray(e.xExtent)&&Number.isFinite(e.xExtent[0])?e.xExtent[0]:null,d=null!=c?c-1:null!=l&&Number.isFinite(l)?l-1:null,m=[...new Set(r.map(e=>e.time))].sort((e,t)=>e-t),h=new Map;for(let e=1;m.length>e;e++)h.set(m[e],m[e-1]);const g=e=>{const t=h.get(e);return null!=t?(t+e)/2:null!=d?d:e};a();const u=[];let f=0,p=0;for(const e of r)if("out"===e.kind){const t=Math.abs(e.delta);let o=t-("top"===e.side?f:p);if(o>0){const t="top"===e.side?"bot":"top",n=Math.min(o,"top"===t?f:p);if(n>0){const i=g(e.time);u.push({time:i,delta:-n,kind:"transfer-out",side:t}),u.push({time:i,delta:+n,kind:"transfer-in",side:e.side}),"top"===t?f-=n:p-=n,"top"===e.side?f+=n:p+=n,o-=n}o>0&&null!==d&&(u.push({time:d,delta:+o,kind:"create",side:e.side}),"top"===e.side?f+=o:p+=o)}"top"===e.side?f-=t:p-=t}else if("in"===e.kind){const t=Math.abs(e.delta);"top"===e.side?f+=t:p+=t}r.push(...u),a();let b=0,y=0,v=0,k=0,S=0;const w=[],C=new Map;for(const e of r){if(w.push({t:e.time,topMass:b,botMass:y}),("in"===e.kind||"out"===e.kind)&&e.edge){const t="top"===e.side?b:y;C.set(e.edge.id,{side:e.side,time:e.time,sideMassBefore:t,sideMassAfter:t+e.delta,kind:e.kind,value:Math.abs(e.delta)})}"top"===e.side?b+=e.delta:y+=e.delta,b+y>v&&(v=b+y),b>k&&(k=b),y>S&&(S=y),w.push({t:e.time,topMass:b,botMass:y})}const T=[];let A=0;for(;w.length>A;){let e=A;for(;w.length>e+1&&w[e+1].t===w[A].t;)e++;T.push(w[A]);for(let t=A+1;e>=t;t++){const e=T[T.length-1];w[t].topMass===e.topMass&&w[t].botMass===e.botMass||T.push(w[t])}A=e+1}const I=Array.isArray(e.xExtent)&&Number.isFinite(e.xExtent[1])?e.xExtent[1]:null;let M=null;for(const e of i)null!=e.systemInTime&&Number.isFinite(e.systemInTime)&&e.startTime>e.systemInTime&&(null===M||M>e.systemInTime)&&(M=e.systemInTime);let H=null;for(const e of n)null!=e.systemOutTime&&Number.isFinite(e.systemOutTime)&&e.systemOutTime>e.endTime&&(null===H||e.systemOutTime>H)&&(H=e.systemOutTime);if(T.length>0){const e=T[T.length-1],t=Math.max(null!=I?I:-1/0,null!=H?H:-1/0);Number.isFinite(t)&&t>e.t&&e.topMass+e.botMass>0&&T.push({t:t,topMass:e.topMass,botMass:e.botMass});const o=T[0],n=Math.min(null!=c?c:1/0,null!=M?M:1/0);Number.isFinite(n)&&o.t>n&&o.topMass+o.botMass>0&&T.unshift({t:n,topMass:o.topMass,botMass:o.botMass})}return{samples:T,peak:v,topPeak:k,botPeak:S,localAttachments:C}}function ce(e,t){return t?Math.max(t[0],Math.min(t[1],e)):e}function de(e,t){return e.map(e=>({t:ce(e.t,t),topMass:e.topMass,botMass:e.botMass}))}function me(e,t,o){const n=e.value*o;if("out"===e.kind){const i=e.sideMassBefore*o;if("top"===e.side){const e=t-i;return[e,e+n]}const r=t+i;return[r-n,r]}const i=e.sideMassAfter*o;if("top"===e.side){const e=t-i;return[e,e+n]}const r=t+i;return[r-n,r]}function he(e,t){let o=0;for(let n=0;t.length>n;n++)for(let i=n+1;t.length>i;i++){const r=t[n],s=t[i];r.source!==s.source&&r.target!==s.target&&r.source!==s.target&&r.target!==s.source&&(Math.min(r.endTime,s.endTime)>Math.max(r.startTime,s.startTime)&&e[s.source]>e[r.source]!=e[s.target]>e[r.target]&&o++)}return o}function ge(e,t){let o=0;for(const n of t)o+=Math.abs(e[n.source]-e[n.target])*(n.value||1);return o}function ue(e,t){return 1e3*he(e,t)+ge(e,t)}function fe(e,t){return{slots:e.map(e=>({peak:{...e.peak},occupants:e.occupants.slice()})),map:{...t}}}function pe(e,t,o){e.length>8||o.length>40?(function(e,t,o,n=6){const i=e.length;if(1>=i)return;let r=fe(e,t),s=ue(t,o);for(let a=0;n>a;a++){const n=Array(i).fill(0),a=Array(i).fill(0);for(const e of o){const o=t[e.source],i=t[e.target];n[o]+=i*(e.value||1),a[o]+=e.value||1,n[i]+=o*(e.value||1),a[i]+=e.value||1}const l=Array.from({length:i},(e,t)=>t).sort((e,t)=>(a[e]>0?n[e]/a[e]:e)-(a[t]>0?n[t]/a[t]:t)),c=l.map(t=>e[t]),d=new Map;l.forEach((e,t)=>d.set(e,t));for(const e of Object.keys(t))t[e]=d.get(t[e]);e.length=0;for(const t of c)e.push(t);const m=ue(t,o);if(s>m)s=m,r=fe(e,t);else if(m===s)break}!function(e,t,o){e.length=0;for(const t of o.slots)e.push(t);for(const e of Object.keys(t))delete t[e];for(const e of Object.keys(o.map))t[e]=o.map[e]}(e,t,r)}(e,t,o,6),function(e,t,o,n=6){const i=e.length;if(1>=i)return;let r=ue(t,o);for(let s=0;n>s;s++){let n=!1;for(let s=0;i-1>s;s++){const i=e[s];e[s]=e[s+1],e[s+1]=i;for(const e of Object.keys(t))t[e]===s?t[e]=s+1:t[e]===s+1&&(t[e]=s);const a=ue(t,o);if(r>a)r=a,n=!0;else{const o=e[s];e[s]=e[s+1],e[s+1]=o;for(const e of Object.keys(t))t[e]===s?t[e]=s+1:t[e]===s+1&&(t[e]=s)}}if(!n)break}}(e,t,o,6)):function(e,t,o){const n=e.length;if(1>=n)return;const i={...t},r=Object.keys(i),s=Array.from({length:n},(e,t)=>t),a=s.slice(),l={...i};let c=s.slice(),d=1/0;const m=()=>{for(const e of r)l[e]=a[i[e]];const e=ue(l,o);d>e&&(d=e,c=s.slice())},h=(e,t)=>{const o=s[e],n=s[t];s[e]=n,s[t]=o,a[o]=t,a[n]=e};m();const g=Array(n).fill(0);let u=0;for(;n>u;)u>g[u]?(h(u%2==0?0:g[u],u),m(),g[u]++,u=0):(g[u]=0,u++);const f=c.map(t=>e[t]),p=new Map;c.forEach((e,t)=>p.set(e,t));for(const e of Object.keys(t))t[e]=p.get(t[e]);e.length=0;for(const t of f)e.push(t)}(e,t,o)}function be(e,t,o,n,i){const{plotH:r,padding:s,valueScale:a,packing:l,laneOrder:c,lifetimeMode:d="full"}=i,m={},h={};for(const t of e)m[t.id]=o[t.id].topPeak||0,h[t.id]=o[t.id].botPeak||0;const g="half"===d,u={};for(const t of e){const e=Array.isArray(t.xExtent)?t.xExtent[0]:null,o=Array.isArray(t.xExtent)?t.xExtent[1]:null;let i=null!=e&&Number.isFinite(e)?e:1/0,r=null!=o&&Number.isFinite(o)?o:-1/0;for(const e of n.outgoing[t.id]){i>e.startTime&&(i=e.startTime),null!=e.systemInTime&&Number.isFinite(e.systemInTime)&&i>e.systemInTime&&(i=e.systemInTime);const t=g?(e.startTime+e.endTime)/2:e.endTime;t>r&&(r=t)}for(const e of n.incoming[t.id]){const t=g?(e.startTime+e.endTime)/2:e.startTime;i>t&&(i=t),e.endTime>r&&(r=e.endTime),null!=e.systemOutTime&&Number.isFinite(e.systemOutTime)&&e.systemOutTime>r&&(r=e.systemOutTime)}u[t.id]={start:Number.isFinite(i)?i:null,end:Number.isFinite(r)?r:null}}const f={},p=[];if("reuse"===l){const o=new Map;for(const t of e)o.set(t.id,0);const i=new Map;for(const t of e)i.set(t.id,0);for(const e of t)i.set(e.target,(i.get(e.target)??0)+1);const r=[];for(const t of e)0===(i.get(t.id)??0)&&r.push(t.id);for(;r.length;){const e=r.shift();for(const t of n.outgoing[e]??[]){const n=(o.get(e)??0)+1;n>(o.get(t.target)??0)&&o.set(t.target,n),i.set(t.target,i.get(t.target)-1),0===i.get(t.target)&&r.push(t.target)}}const s=[...e].filter(e=>null!==u[e.id].start).sort((e,t)=>{const n=o.get(e.id)??0,i=o.get(t.id)??0;return n!==i?n-i:u[e.id].start-u[t.id].start}),a=e.filter(e=>null===u[e.id].start);for(const e of[...s,...a]){const t=u[e.id];let o=-1;for(let e=0;p.length>e;e++){const n=p[e].occupants[p[e].occupants.length-1];if(null===t.start||void 0===n||t.start>=n.end){o=e;break}}-1===o&&(p.push({occupants:[],peak:{topPeak:0,botPeak:0}}),o=p.length-1),p[o].occupants.push({id:e.id,end:t?.end??-1/0}),p[o].peak.topPeak=Math.max(p[o].peak.topPeak,m[e.id]),p[o].peak.botPeak=Math.max(p[o].peak.botPeak,h[e.id]),f[e.id]=o}}else e.forEach((e,t)=>{p.push({occupants:[{id:e.id,end:u[e.id]?.end??-1/0}],peak:{topPeak:m[e.id],botPeak:h[e.id]}}),f[e.id]=t});let b=null,y=null,v=null,k=null;const S=()=>{b=he(f,t),v=ge(f,t)},w=()=>{y=he(f,t),k=ge(f,t)};"crossing-min"===c?(S(),pe(p,f,t),w()):"inside-out"===c?(S(),function(e,t){const o=e.length;if(1>=o)return;const n=e=>e.peak.topPeak+e.peak.botPeak,i=e.map((e,t)=>({slot:e,idx:t})).sort((e,t)=>n(t.slot)-n(e.slot)),r=Array(o),s=Math.floor((o-1)/2);r[s]=i[0].idx;let a=s-1,l=s+1;for(let e=1;i.length>e;e++)e%2==1&&o>l||0>a?r[l++]=i[e].idx:r[a--]=i[e].idx;const c=r.map(t=>e[t]),d=new Map;r.forEach((e,t)=>d.set(e,t));for(const e of Object.keys(t))t[e]=d.get(t[e]);e.length=0;for(const t of c)e.push(t)}(p,f),w()):"crossing-min+inside-out"===c&&(S(),pe(p,f,t),function(e,t,o){const n=e.length;if(1>=n)return;const i=e.map(e=>{return{slot:e,size:(t=e,t.peak.topPeak+t.peak.botPeak)};var t}).sort((e,t)=>t.size-e.size),r=Math.floor((n-1)/2);let s=ue(t,o);for(const{slot:a}of i){const i=e.indexOf(a);if(0>i)continue;const l=r;if(i===l)continue;const c=e[i];e.splice(i,1),e.splice(l,0,c);const d=new Map;for(let e=0;n>e;e++)d.set(e,e);if(l>i){for(let e=i+1;l>=e;e++)d.set(e,e-1);d.set(i,l)}else{for(let e=l;i>e;e++)d.set(e,e+1);d.set(i,l)}for(const e of Object.keys(t))t[e]=d.get(t[e]);const m=ue(t,o);if(m>s){const o=e[l];e.splice(l,1),e.splice(i,0,o);const r=new Map;for(let e=0;n>e;e++)r.set(e,e);if(i>l){for(let e=l+1;i>=e;e++)r.set(e,e-1);r.set(l,i)}else{for(let e=i;l>e;e++)r.set(e,e+1);r.set(l,i)}for(const e of Object.keys(t))t[e]=r.get(t[e])}else s=m}}(p,f,t),w());const C=p.map(e=>{const t=new Map;for(const n of e.occupants){const e=o[n.id];if(e)for(const o of e.samples){const e=t.get(o.t)||{top:0,bot:0};t.set(o.t,{top:Math.max(e.top,o.topMass),bot:Math.max(e.bot,o.botMass)})}}return[...t.entries()].sort((e,t)=>e[0]-t[0])}),T=(e,t)=>{let o={top:0,bot:0};for(const[n,i]of e){if(n>t)break;o=i}return o},A=[];for(let e=0;p.length-1>e;e++){const t=C[e],o=C[e+1],n=new Set([...t.map(e=>e[0]),...o.map(e=>e[0])]);let i=0;for(const e of n){const n=T(t,e),r=T(o,e);n.bot+r.top>i&&(i=n.bot+r.top)}A.push(i)}const I=[];let M=s+(p[0]?.peak.topPeak??0)*a;p.length>0&&I.push(M);for(let e=1;p.length>e;e++)M+=A[e-1]*a+s,I.push(M);if(p.length>0&&(M+=p[p.length-1].peak.botPeak*a+s),M>r){const e=r/M;for(let t=0;I.length>t;t++)I[t]*=e}const H=0===p.length?0:p[0].peak.topPeak+A.reduce((e,t)=>e+t,0)+p[p.length-1].peak.botPeak,x={};for(const t of e)x[t.id]=I[f[t.id]];return{effectiveSlotsHeight:H,centerlines:x,laneLifetime:u,slots:p,slotByNode:f,slotCenter:I,crossingsBefore:b,crossingsAfter:y,lengthBefore:v,lengthAfter:k}}re.displayName="SankeyDiagram";import{useMemo as ye,useState as ve,useRef as ke,useCallback as Se}from"react";import{scaleTime as we}from"d3-scale";import{forwardRef as Ce}from"react";var Te=e=>{const{bands:t=[],ribbons:o=[],showLabels:n=!0}=e.config,i=[];for(const e of o)i.push({type:"bezier",pathD:e.pathD,...e.bezier&&{bezierCache:e.bezier},style:{fill:e.fill,opacity:e.opacity,stroke:"none"},datum:{__kind:"ribbon",data:e.rawDatum,id:e.id}});for(const e of t)if(e.gradientStubs)for(let t=0;e.gradientStubs.length>t;t++){const o=e.gradientStubs[t];i.push({type:"bezier",pathD:o.pathD,interactive:!1,style:{fill:e.fill,fillOpacity:.86,stroke:"none"},_gradient:{x0:o.x0,x1:o.x1,from:o.from,to:o.to},datum:{__kind:"band",data:e.rawDatum,id:`${e.id}__stub${t}`}})}for(const e of t)i.push({type:"bezier",pathD:e.pathD,style:{...e.gradientStubs&&e.gradientStubs.length>0?{fill:"none"}:{fill:e.fill,fillOpacity:.86},stroke:e.stroke??e.fill,strokeWidth:e.strokeWidth??.5},datum:{__kind:"band",data:e.rawDatum,id:e.id}});const r=n?t.map(e=>({x:e.labelX,y:e.labelY,text:e.labelText,anchor:"end",baseline:"middle",fontSize:11,fontWeight:600})):[];return{sceneNodes:t.map(e=>({type:"circle",id:e.id,cx:-1e4,cy:-1e4,r:0,style:{fill:e.fill},datum:{__kind:"band",data:e.rawDatum,id:e.id}})),sceneEdges:i,labels:r}};function Ae(e){return"object"==typeof e&&null!==e&&"__kind"in e&&("band"===e.__kind||"ribbon"===e.__kind)}import{Fragment as Ie,jsx as Me,jsxs as He}from"react/jsx-runtime";function xe(e){return null==e?NaN:e instanceof Date?e.getTime():"number"==typeof e?e:new Date(e).getTime()}function Be(e,t){return"function"==typeof e?e(t):t[e]}var Ne=Ce(function(e,t){const{nodes:o,edges:n,domain:r,axisTicks:l=[],nodeIdAccessor:c="id",sourceAccessor:d="source",targetAccessor:m="target",valueAccessor:h="value",startTimeAccessor:g="startTime",endTimeAccessor:u="endTime",systemInTimeAccessor:f,systemOutTimeAccessor:p,xExtentAccessor:k="xExtent",edgeIdAccessor:S="id",colorBy:w,colorScheme:C,showLegend:T,legendPosition:A="right",pairing:I="temporal",packing:M="reuse",laneOrder:H="crossing-min",ribbonLane:x="both",lifetimeMode:B="half",showLaneRails:N=!1,showQualityReadout:D=!1,showLabels:O=!0,width:P=600,height:L=400,margin:E,title:W,description:R,summary:z,accessibleTable:F,responsiveWidth:j,responsiveHeight:$,loading:_,loadingContent:q,emptyContent:X,edgeOpacity:Y=.35,timeFormat:Q,valueFormat:Z,tooltip:K,enableHover:U=!0,onObservation:V,onClick:ee,showParticles:te=!1,particleStyle:oe,chartId:ne,frameProps:ie={}}=e,[re,he]=ve([]),[ge,ue]=ve([]),fe=ke(re),pe=ke(ge);fe.current=re,pe.current=ge;const Ce=Se(e=>{fe.current=e,he(e)},[]),Ne=Se(e=>{pe.current=e,ue(e)},[]),De=void 0!==n,Oe=b(De?n:re),Pe=ye(()=>{const e=b(o??[]),t=ge;if(0===e.length&&0===t.length)return G([],Oe,d,m);const n=new Set,i=[];for(const t of e){const e=Be(c,t)+"";n.has(e)||(n.add(e),i.push(t))}for(const e of t){const t=Be(c,e)+"";n.has(t)||(n.add(t),i.push(e))}const r=G([],Oe,d,m);for(const e of r)n.has(e.id)||(n.add(e.id),i.push(e));return i},[o,ge,Oe,c,d,m]),Le=ke(null),Ee=Se((e,t)=>{const o=Be(S,e);return null!=o?o+"":`${Be(d,e)}-${Be(m,e)}-${t}`},[S,d,m]),We=Se(e=>{if(null==e)return!1;const t=e;return null!=Be(d,t)&&null!=Be(m,t)},[d,m]);i(t,{variant:"network",frameRef:Le,overrides:{push(e){if(We(e)){if(De)return void console.warn("ProcessSankey.push: edge ignored — `edges` prop is controlled.");Ce([...fe.current,e])}else Ne([...pe.current,e])},pushMany(e){const t=[],o=[];for(const n of e)We(n)?t.push(n):o.push(n);t.length>0&&(De?console.warn("ProcessSankey.pushMany: edges ignored — `edges` prop is controlled."):Ce([...fe.current,...t])),o.length>0&&Ne([...pe.current,...o])},remove(e){const t=new Set(Array.isArray(e)?e:[e]),o=[];if(!De){const e=fe.current,n=[];for(let i=0;e.length>i;i++){const r=e[i];t.has(Ee(r,i))?o.push(r):n.push(r)}n.length!==e.length&&Ce(n)}const n=pe.current,i=[];for(const e of n){const n=Be(c,e)+"";t.has(n)?o.push(e):i.push(e)}return i.length!==n.length&&Ne(i),o},update(e,t){const o=new Set(Array.isArray(e)?e:[e]),n=[];if(!De){let e=!1;const i=fe.current.map((i,r)=>o.has(Ee(i,r))?(n.push(i),e=!0,t(i)):i);e&&Ce(i)}let i=!1;const r=pe.current.map(e=>{const r=Be(c,e)+"";return o.has(r)?(n.push(e),i=!0,t(e)):e});return i&&Ne(r),n},clear(){De||Ce([]),Ne([]),Le.current?.clear()},getData:()=>Oe??[],getScales:()=>null}});const Re=Ee,ze=Se(e=>Be(c,e)+"",[c]),{nodes:Fe,edges:je,domain:$e,rawNodeById:_e,rawEdgeById:Ge}=ye(()=>{const e=(Pe??[]).map(e=>{const t={id:ze(e),__raw:e},o=k?Be(k,e):null;if(Array.isArray(o)&&2===o.length){const e=xe(o[0]),n=xe(o[1]);Number.isFinite(e)&&Number.isFinite(n)&&(t.xExtent=[e,n])}return t}),t=(Oe??[]).map((e,t)=>{const o={id:Re(e,t),source:Be(d,e)+"",target:Be(m,e)+"",value:Number(Be(h,e)),startTime:xe(Be(g,e)),endTime:xe(Be(u,e)),__raw:e};if(f){const t=xe(Be(f,e));Number.isFinite(t)&&(o.systemInTime=t)}if(p){const t=xe(Be(p,e));Number.isFinite(t)&&(o.systemOutTime=t)}return o}),o=[xe(r[0]),xe(r[1])],n=new Map;for(const t of e)null!=t.__raw&&n.set(t.id,t.__raw);const i=new Map;for(const e of t)null!=e.__raw&&i.set(e.id,e.__raw);return{nodes:e,edges:t,domain:o,rawNodeById:n,rawEdgeById:i}},[Pe,Oe,r,ze,Re,k,d,m,h,g,u,f,p]),qe=J({nodes:Pe,edges:Oe,inferNodes:!1,nodeIdAccessor:c,sourceAccessor:d,targetAccessor:m,colorBy:w,colorScheme:C,showLegend:!1,legendPosition:A,selection:void 0,linkedHover:void 0,onObservation:V,onClick:ee,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"ProcessSankey",chartId:ne,marginDefaults:{top:30,right:80,bottom:40,left:80},userMargin:E,width:P,height:L,hasTitle:!!W,loading:_,loadingContent:q,emptyContent:X}),Xe=(T??!!w)&&!!w,Je=Se(e=>null!=E&&("number"==typeof E||null!=E[e]),[E]),Ye=ye(()=>{const e={...qe.margin};return Xe&&("right"===A&&!Je("right")&&140>e.right?e.right=140:"bottom"===A&&!Je("bottom")&&80>e.bottom&&(e.bottom=80)),e},[qe.margin,Xe,A,Je]),Qe=P-Ye.left-Ye.right,Ze=L-Ye.top-Ye.bottom,Ke=ye(()=>se(Fe,je,$e),[Fe,je,$e]),Ue=ye(()=>Ke.length>0?null:function(e,t,o){const{plotH:n,pairing:i="temporal",packing:r="reuse",laneOrder:s="crossing-min",lifetimeMode:a="half"}=o,l=function(e,t){const o={},n={};for(const t of e)o[t.id]=[],n[t.id]=[];for(const e of t)n[e.source]&&n[e.source].push(e),o[e.target]&&o[e.target].push(e);return{incoming:o,outgoing:n}}(e,t),c=function(e,t,o,n="value"){const i="temporal"===n?(e,t)=>e.endTime-t.endTime:(e,t)=>t.value-e.value,r="temporal"===n?(e,t)=>e.startTime-t.startTime:(e,t)=>t.value-e.value,s=new Map;for(const e of t)s.set(e.id,{});const a=(e,t)=>{const o=new Map;for(const n of e){const e=n[t];o.has(e)||o.set(e,{partner:e,edges:[],total:0,earliestStart:1/0,latestEnd:-1/0});const i=o.get(e);i.edges.push(n),i.total+=n.value,i.earliestStart=Math.min(i.earliestStart,n.startTime),i.latestEnd=Math.max(i.latestEnd,n.endTime)}const s=[...o.values()];s.sort("temporal"===n?(e,o)=>"target"===t?e.earliestStart-o.earliestStart:e.latestEnd-o.latestEnd:(e,t)=>t.total-e.total);for(const e of s)e.edges.sort("target"===t?r:i);return s};for(const t of e){const e=o.outgoing[t.id],n=o.incoming[t.id];if(0===n.length)a(e,"target").forEach((e,t)=>{const o=t%2==0?"top":"bot";for(const t of e.edges)s.get(t.id).sourceSide=o});else if(0===e.length)a(n,"source").forEach((e,t)=>{const o=t%2==0?"top":"bot";for(const t of e.edges)s.get(t.id).targetSide=o});else{const t=a(n,"source"),o=a(e,"target"),i=Math.max(t.length,o.length);for(let e=0;i>e;e++){const n=e%2==0?"top":"bot";if(t[e])for(const o of t[e].edges)s.get(o.id).targetSide=n;if(o[e])for(const t of o[e].edges)s.get(t.id).sourceSide=n}}}return s}(e,t,l,i);let d={};for(const t of e)d[t.id]=le(t,l,c);const m=be(e,t,d,l,{plotH:n,padding:12,valueScale:1,packing:r,laneOrder:s,lifetimeMode:a}),h=new Set;for(const e of t){const t=m.slotByNode[e.source],o=m.slotByNode[e.target];if(void 0===t||void 0===o)continue;const n=c.get(e.id);t!==o?t>o?(n.sourceSide="top",n.targetSide="bot"):(n.sourceSide="bot",n.targetSide="top"):(h.add(e.id),n.sourceSide="bot",n.targetSide="bot")}for(const t of e){const e=l.outgoing[t.id],o=l.incoming[t.id],n=new Set(e.map(e=>c.get(e.id).sourceSide)),i=new Set(o.map(e=>c.get(e.id).targetSide));if(1===n.size&&o.length>0){const e=[...n][0];for(const t of o)m.slotByNode[t.source]===m.slotByNode[t.target]&&(c.get(t.id).targetSide=e)}if(1===i.size&&e.length>0){const t=[...i][0];for(const o of e)m.slotByNode[o.source]===m.slotByNode[o.target]&&(c.get(o.id).sourceSide=t)}}for(const t of e){const e=l.incoming[t.id],o=l.outgoing[t.id];if(0===e.length||0===o.length)continue;const n=()=>{const t={inTop:0,inBot:0,outTop:0,outBot:0};for(const o of e)"top"===c.get(o.id).targetSide?t.inTop+=o.value:t.inBot+=o.value;for(const e of o)"top"===c.get(e.id).sourceSide?t.outTop+=e.value:t.outBot+=e.value;return t},i=(e,t)=>{const i=n(),r="top"===e?i.outTop-i.inTop:i.outBot-i.inBot,s="top"===t?i.inTop-i.outTop:i.inBot-i.outBot;if(0>=r||0>=s)return!1;const a=Math.min(r,s),l=o.filter(t=>!h.has(t.id)&&c.get(t.id).sourceSide===e&&a>=t.value).sort((e,t)=>t.value-e.value);return 0!==l.length&&(c.get(l[0].id).sourceSide=t,!0)};let r=o.length+1;for(;r-- >0&&(i("top","bot")||i("bot","top")););}d={};for(const t of e)d[t.id]=le(t,l,c);const g=be(e,t,d,l,{plotH:n,padding:12,valueScale:1,packing:r,laneOrder:s,lifetimeMode:a}),u=g.effectiveSlotsHeight??g.slots.reduce((e,t)=>e+t.peak.topPeak+t.peak.botPeak,0),f=Math.min(12,.35*n/Math.max(g.slots.length+1,1)),p=u>0?Math.max(0,(n-f*(g.slots.length+1))/u):1,b=be(e,t,d,l,{plotH:n,padding:f,valueScale:p,packing:r,laneOrder:s,lifetimeMode:a});return{nodeData:d,sides:c,valueScale:p,padding:f,compressedPadding:12>f,centerlines:b.centerlines,laneLifetime:b.laneLifetime,slots:b.slots,slotByNode:b.slotByNode,crossingsBefore:b.crossingsBefore,crossingsAfter:b.crossingsAfter,lengthBefore:b.lengthBefore,lengthAfter:b.lengthAfter}}(Fe,je,{plotH:Ze,pairing:I,packing:M,laneOrder:H,lifetimeMode:B}),[Ke,Fe,je,Ze,I,M,H,B]),Ve=ye(()=>we().domain($e).range([0,Qe]),[$e,Qe]),et=Se((e,t)=>{if(w&&Pe){const t=_e.get(e);if(t)return y(t,w,qe.colorScale)}return qe.effectivePalette[t%qe.effectivePalette.length]||"#475569"},[w,Pe,_e,qe.colorScale,qe.effectivePalette]),tt=ye(()=>{const e=new Map;return Fe.forEach((t,o)=>e.set(t.id,o)),e},[Fe]),ot=ye(()=>{if(!Ue)return{bands:[],ribbons:[]};const{centerlines:e,nodeData:t,valueScale:o}=Ue,n=[],i=[];return Fe.forEach((i,r)=>{const s=t[i.id];if(!s||0===s.samples.length)return;const a=function(e,t,o,n,i){if(0===e.length)return null;const r=de(e,i),s=e=>t-r[e].topMass*o,a=e=>t+r[e].botMass*o;let l=`M${n(r[0].t)},${s(0)}`;for(let e=1;r.length>e;e++)l+=` L${n(r[e].t)},${s(e)}`;l+=` L${n(r[r.length-1].t)},${a(r.length-1)}`;for(let e=r.length-2;e>=0;e--)l+=` L${n(r[e].t)},${a(e)}`;return l+" Z"}(s.samples,e[i.id],o,Ve,$e);if(!a)return;const l=de(s.samples,$e),c=l.find(e=>e.topMass+e.botMass>0)||l[0],d=e[i.id]+(c.botMass-c.topMass)*o/2,m=et(i.id,r),h=_e.get(i.id)??i,g=function(e,t,o,n,i){const r=o.nodeData[e];if(!r||0===r.samples.length)return[];const s=o.valueScale,a=o.centerlines[e],l=de(r.samples,i),c=l.find(e=>e.topMass+e.botMass>0)||l[0],d=[...l].reverse().find(e=>e.topMass+e.botMass>0)||l[l.length-1],m=n(c.t),h=n(d.t),g=e=>n(ce(e,i)),u=[],f=(e,t,o,n)=>`M${e},${t} L${o},${t} L${o},${n} L${e},${n} Z`;for(const o of t){if(o.source===e&&null!=o.systemInTime&&Number.isFinite(o.systemInTime)){const e=r.localAttachments.get(o.id);if(e&&"out"===e.kind&&o.startTime>o.systemInTime){const t=g(o.systemInTime),n=g(o.startTime),i=t-20,r=Math.max(m,i);if(n>r){const[o,l]=me(e,a,s);u.push({pathD:f(r,o,n,l),x0:i,x1:t,from:0,to:1})}}}if(o.target===e&&null!=o.systemOutTime&&Number.isFinite(o.systemOutTime)){const e=r.localAttachments.get(o.id);if(e&&"in"===e.kind&&o.systemOutTime>o.endTime){const t=g(o.systemOutTime),n=g(o.endTime),i=t+20,r=Math.min(h,i);if(r>n){const[o,l]=me(e,a,s);u.push({pathD:f(n,o,r,l),x0:t,x1:i,from:1,to:0})}}}}return u}(i.id,je,Ue,Ve,$e);n.push({id:i.id,pathD:a,fill:m,stroke:m,strokeWidth:.5,...g.length>0&&{gradientStubs:g},rawDatum:h,labelX:Ve(c.t)-4,labelY:d,labelText:i.id})}),je.forEach(n=>{const r=t[n.source]?.localAttachments.get(n.id),s=t[n.target]?.localAttachments.get(n.id);if(!r||!s)return;const l=tt.get(n.source)??0,c=et(n.source,l),d=function(e,t,o,n,i,r,s,a){const l=i,c=e=>a?Math.max(a[0],Math.min(a[1],e)):e,d=r(c(e.time)),m=r(c(o.time)),h=e.value*l,g=o.value*l,u=e.sideMassBefore*l,f=o.sideMassAfter*l;let p,b,y,v;"top"===e.side?(p=t-u,b=p+h):(b=t+u,p=b-h),"top"===o.side?(y=n-f,v=y+g):(v=n+f,y=v-g);const k="source"===s?d+.85*(m-d):"target"===s?d+.15*(m-d):(d+m)/2;return{sx:d,sTop:p,sBot:b,tx:m,tTop:y,tBot:v,cp1X:k,cp2X:k}}(r,e[n.source],s,e[n.target],o,Ve,x,$e),{pathD:m,bezier:h}=a(d),g=Ge.get(n.id)??n;i.push({id:n.id,pathD:m,fill:c,opacity:Y,rawDatum:g,bezier:h})}),{bands:n,ribbons:i}},[Ue,Fe,je,Ve,$e,et,_e,Ge,x,Y,tt]),nt=ye(()=>({bands:ot.bands,ribbons:ot.ribbons,showLabels:O}),[ot,O]),it=ye(()=>{if(!Xe||!w)return;const e=new Map;(Pe??[]).forEach((t,o)=>{const n=Be(w,t),i=null==n?"":n+"";i&&!e.has(i)&&e.set(i,{label:i,color:et(ze(t),o)})});const t=Array.from(e.values());return 0!==t.length?{legendGroups:[{type:"fill",label:"",items:t,styleFn:e=>{const t=e.color||"#333";return{fill:t,stroke:t}}}]}:void 0},[Xe,w,Pe,et,ze]),rt=ye(()=>!1!==K&&U?void 0===K||!0===K?null:v(K)||null:null,[K,U]),st=Se(e=>Q?Q(new Date(e)):Number.isFinite(e)?1e10>Math.abs(e)?Number.isInteger(e)?e+"":e.toFixed(2):new Date(e).toISOString().slice(0,10):"",[Q]),at=Se(e=>Z?Z(e):e+"",[Z]),lt=Se(e=>{if(!e||!e.data)return null;const t=e.data;if(!Ae(t))return null;const o=t.data;if(rt)return rt(o);if("band"===t.__kind){const e=t.id,o=Ue?function(e){if(!e)return[];const t=new Set,o=[];for(const n of e.samples){const e=n.topMass+n.botMass,i=`${n.t}:${e}`;t.has(i)||(t.add(i),o.push({t:n.t,total:e}))}return o}(Ue.nodeData[e]):[],n=5,i=o.length>n?o.length:null,r=function(e,t=5){if(t>=e.length)return e.slice();const o=[...e].sort((e,t)=>e.total-t.total),n=o.length-1,i=[{...o[0],mark:"min"},{...o[Math.floor(.25*n)],mark:"q25"},{...o[Math.floor(.5*n)],mark:"median"},{...o[Math.floor(.75*n)],mark:"q75"},{...o[n],mark:"max"}],r=new Set,s=[];for(const e of i)r.has(e.t)||(r.add(e.t),s.push(e));return s.sort((e,t)=>e.t-t.t)}(o,n);return He("div",{style:{minWidth:160},children:[Me("div",{style:{fontWeight:600,marginBottom:4},children:e}),r.length>0&&He("table",{style:{borderCollapse:"collapse",fontSize:11,width:"100%"},children:[Me("thead",{children:He("tr",{style:{opacity:.6},children:[Me("th",{style:{textAlign:"left",fontWeight:500,paddingRight:8},children:"Time"}),Me("th",{style:{textAlign:"right",fontWeight:500},children:"Mass"}),null!=i&&Me("th",{})]})}),Me("tbody",{children:r.map((e,t)=>He("tr",{children:[Me("td",{style:{paddingRight:8},children:st(e.t)}),Me("td",{style:{textAlign:"right"},children:at(e.total)}),null!=i&&Me("td",{style:{textAlign:"right",paddingLeft:8,opacity:.55},children:e.mark})]},t))})]}),null!=i&&He("div",{style:{marginTop:4,fontSize:10,opacity:.55},children:["showing ",r.length," of ",i," samples"]})]})}const n=o,i=Be(d,n),r=Be(m,n),s=Be(h,n),a=Be(g,n),l=Be(u,n);return He("div",{style:{minWidth:160},children:[He("div",{style:{fontWeight:600,marginBottom:4},children:[i+""," → ",r+""]}),He("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:8,fontSize:11},children:[null!=s&&He(Ie,{children:[Me("span",{style:{opacity:.6},children:"value"}),Me("span",{style:{textAlign:"right"},children:at(Number(s))})]}),null!=a&&He(Ie,{children:[Me("span",{style:{opacity:.6},children:"start"}),Me("span",{style:{textAlign:"right"},children:st(xe(a))})]}),null!=l&&He(Ie,{children:[Me("span",{style:{opacity:.6},children:"end"}),Me("span",{style:{textAlign:"right"},children:st(xe(l))})]})]})]})},[Ue,rt,st,at,d,m,h,g,u]),ct=ye(()=>{if(!Ue)return null;const{centerlines:e,laneLifetime:t,nodeData:o,valueScale:n,compressedPadding:i,crossingsBefore:r,crossingsAfter:s,lengthBefore:a,lengthAfter:c}=Ue;let d=null,m=null;for(const e of Fe){const o=t[e.id];if(!o||null===o.start||null===o.end)continue;const n=Ve(o.start),i=Ve(o.end);(null===d||d>n)&&(d=n),(null===m||i>m)&&(m=i)}const h=e=>Math.max(0,Math.min(Qe,e)),g=h(d??0),u=Math.max(g,h(m??Qe));return He("g",{children:[D&&null!==(s??null)&&He("text",{x:Qe,y:-12,fontSize:10,fill:"#94a3b8",textAnchor:"end",children:["crossings: ",r," → ",s," ","edge length: ",Math.round(a)," → ",Math.round(c)]}),i&&Me("text",{x:Qe,y:2,fontSize:10,fill:"#94a3b8",textAnchor:"end",children:"dense layout: lane gaps compressed"}),l.map((e,t)=>{const o=Ve(xe(e.date));return g-.5>o||o>u+.5?null:Me("line",{x1:o,y1:0,x2:o,y2:Ze,stroke:"#94a3b8",strokeOpacity:.15,strokeDasharray:"2 4"},"grid-"+t)}),N&&Fe.map((i,r)=>{const s=t[i.id];if(!s||null===s.start)return null;const a=o[i.id],l=a?{topPeak:a.topPeak,botPeak:a.botPeak}:{topPeak:0,botPeak:0},c=e[i.id]+(l.botPeak-l.topPeak)*n/2,d=Ve(s.start),m=Ve(s.end),h=et(i.id,r);return He("g",{children:[Me("line",{x1:d,y1:c,x2:m,y2:c,stroke:h,strokeOpacity:.35,strokeWidth:1,strokeDasharray:"3 3"}),Me("line",{x1:d,y1:c-4,x2:d,y2:c+4,stroke:h,strokeOpacity:.5}),Me("line",{x1:m,y1:c-4,x2:m,y2:c+4,stroke:h,strokeOpacity:.5})]},"lane-"+i.id)}),Me("line",{x1:g,y1:Ze+4,x2:u,y2:Ze+4,stroke:"#94a3b8"}),l.map((e,t)=>{const o=xe(e.date),n=Ve(o);if(g-.5>n||n>u+.5)return null;const i=null!=e.label?e.label:Q?Q(new Date(o)):"";return He("g",{transform:`translate(${n},${Ze+4})`,children:[Me("line",{y2:6,stroke:"#94a3b8"}),Me("text",{y:20,textAnchor:"middle",fontSize:11,fill:"#475569",children:i})]},t)})]})},[Ue,l,Ve,Qe,Ze,N,Fe,et,D,Q]),dt=ye(()=>(Pe??[]).map(e=>({id:ze(e),data:e})),[Pe,ze]),mt=ye(()=>{const e=new Map;for(const t of ot.ribbons)t.bezier&&e.set(t.id,t.bezier);return e},[ot]),ht=ye(()=>(Oe??[]).map((e,t)=>{const o=Re(e,t),n=Number(Be(h,e));return{id:o,source:Be(d,e)+"",target:Be(m,e)+"",value:Number.isFinite(n)?n:0,bezier:mt.get(o),data:e}}),[Oe,Re,d,m,h,mt]),gt=qe.loadingEl,ut=qe.emptyEl;return Ke.length>0?He("svg",{width:P,height:L,role:"img","aria-label":W??"Process Sankey validation failed",children:[Me("text",{x:20,y:30,fontSize:13,fontWeight:600,fill:"var(--semiotic-danger, #dc2626)",children:"ProcessSankey: data invalid"}),Ke.map((e,t)=>Me("text",{x:20,y:56+18*t,fontSize:12,fill:"#64748b",children:"• "+ae(e)},t))]}):gt||ut||Me(s,{ref:Le,chartType:"force",nodes:dt,edges:ht,customNetworkLayout:Te,layoutConfig:nt,size:[P,L],responsiveWidth:j,responsiveHeight:$,margin:Ye,title:W,description:R??"Temporal process flow with lifetime-bounded node lanes, mass bands, and value-scaled ribbons.",summary:z,accessibleTable:F,enableHover:U,tooltipContent:!1===K?()=>null:lt,backgroundGraphics:ct,showParticles:te,particleStyle:oe,legend:it,legendPosition:A,onObservation:V,...ee&&{customClickBehavior:e=>{if(!e||!e.data||!ee)return;const t=e.data;Ae(t)&&ee(t.data,{x:e.x,y:e.y})}},chartId:ne,colorScheme:Array.isArray(C)?C:void 0,...ie})});Ne.displayName="ProcessSankey";import{useMemo as De}from"react";import{jsx as Oe}from"react/jsx-runtime";function Pe(e){const n=A(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,layout:l="tree",orientation:d="vertical",childrenAccessor:m="children",valueAccessor:h="value",nodeIdAccessor:g="name",colorBy:u,colorScheme:f,colorByDepth:b=!1,edgeStyle:k="curve",nodeLabel:S,nodeSize:C=5,tooltip:T,frameProps:I={},onObservation:M,onClick:H,chartId:x,selection:B,linkedHover:O,loading:P,loadingContent:L,legendInteraction:E,stroke:W,strokeWidth:R,opacity:z}=e,{width:F,height:j,enableHover:$,showLabels:G=!0,title:X,description:Y,summary:Q,accessibleTable:Z}=n,K=J({nodes:De(()=>_(i??null,m),[i,m]),edges:void 0,inferNodes:!1,colorBy:b?void 0:u,colorScheme:f,showLegend:!1,legendInteraction:E,selection:B,linkedHover:O,onObservation:M,onClick:H,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"TreeDiagram",chartId:x,marginDefaults:n.marginDefaults,userMargin:r,width:F,height:j,hasTitle:!!X,loading:P,loadingContent:L}),U=De(()=>new Map,[]),V=De(()=>e=>{const t={stroke:"black",strokeWidth:1};return t.fill=b?p[(e.depth||0)%p.length]:u?y(e.data||e,u,K.colorScale):w(void 0,K.themeCategorical,f,void 0,U),t},[u,b,K.colorScale,K.themeCategorical,f,U]),ee=De(()=>o(V,{stroke:W,strokeWidth:R,opacity:z}),[V,W,R,z]),te=De(()=>()=>({stroke:"#999",strokeWidth:1,fill:"none"}),[]),oe=De(()=>o(te,{stroke:W,strokeWidth:R,opacity:z}),[te,W,R,z]),ne=De(()=>{if("treemap"===l||"circlepack"===l||"partition"===l)return q(h)},[l,h]),ie=t({componentName:"TreeDiagram",data:i});return ie?Oe(N,{componentName:"TreeDiagram",message:ie,width:F,height:j}):K.loadingEl?K.loadingEl:Oe(D,{componentName:"TreeDiagram",width:F,height:j,children:Oe(s,{chartType:l,...null!=i&&{data:i},size:[F,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,nodeIDAccessor:g,childrenAccessor:m,hierarchySum:ne,treeOrientation:d,edgeType:k,nodeStyle:ee,edgeStyle:oe,colorBy:u,colorScheme:K.effectivePalette,colorByDepth:b,nodeSize:C,nodeLabel:G?S||g:void 0,showLabels:G,enableHover:$,tooltipContent:!1===T?()=>null:v(T)||void 0,...c({linkedHover:O,selection:B,onObservation:M,onClick:H,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior,linkedHoverInClickPredicate:!1}),...E&&"none"!==E&&{legendHoverBehavior:K.legendState.onLegendHover,legendClickBehavior:K.legendState.onLegendClick,legendHighlightedCategory:K.legendState.highlightedCategory,legendIsolatedCategories:K.legendState.isolatedCategories},className:a,title:X,description:Y,summary:Q,accessibleTable:Z,...null!=e.animate&&{animate:e.animate},...I})})}Pe.displayName="TreeDiagram";import{useMemo as Le,useCallback as Ee}from"react";import{jsx as We}from"react/jsx-runtime";function Re(e){const n=A(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:a,className:l,childrenAccessor:d="children",valueAccessor:m="value",nodeIdAccessor:h="name",colorBy:g,colorScheme:u,colorByDepth:b=!1,labelMode:k="leaf",nodeLabel:S,padding:C=4,paddingTop:T,nodeStyle:I,tooltip:M,frameProps:H={},selection:x,linkedHover:B,onObservation:O,onClick:P,chartId:L,loading:E,loadingContent:W,legendInteraction:R,stroke:z,strokeWidth:F,opacity:j}=e,{nodeStyle:$,...G}=H,{width:X,height:Y,enableHover:Q,showLabels:Z=!0,title:K,description:U,summary:V,accessibleTable:ee}=n,te=J({nodes:Le(()=>_(i??null,d),[i,d]),edges:void 0,inferNodes:!1,colorBy:b?void 0:g,colorScheme:u,showLegend:!1,legendInteraction:R,selection:x,linkedHover:B,onObservation:O,onClick:P,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"Treemap",chartId:L,marginDefaults:n.marginDefaults,userMargin:a,width:X,height:Y,hasTitle:!!K,loading:E,loadingContent:W}),oe=r(x),ne=te.customHoverBehavior,ie=Ee(e=>{if(!e)return ne(null);const t=e.data||e;ne({data:t?.data||t})},[ne]),re=Le(()=>new Map,[]),se=Le(()=>e=>{const t={stroke:"var(--semiotic-cell-border, var(--semiotic-border, #fff))",strokeWidth:1,strokeOpacity:.8};return t.fill=b?p[(e.depth||0)%p.length]:g?y(e.data||e,g,te.colorScale):w(void 0,te.themeCategorical,u,void 0,re),t},[g,b,te.colorScale,te.themeCategorical,u,re]),ae=Le(()=>I||$?e=>({...se(e),...$?$(e)??{}:{},...I?I(e)??{}:{}}):se,[se,I,$]),le=Le(()=>o(ae,{stroke:z,strokeWidth:F,opacity:j}),[ae,z,F,j]),ce=Le(()=>te.activeSelectionHook?e=>{const t={...le(e)};if(te.activeSelectionHook.isActive)if(te.activeSelectionHook.predicate(e.data||e))oe?.selectedStyle&&Object.assign(t,oe.selectedStyle);else{const e=oe?.unselectedOpacity??f;t.opacity=e,t.fillOpacity=e,t.strokeOpacity=e,oe?.unselectedStyle&&Object.assign(t,oe.unselectedStyle)}return t}:le,[le,te.activeSelectionHook,oe]),de=Le(()=>q(m),[m]),me=void 0!==T?T:!Z||"parent"!==k&&"all"!==k?void 0:18,he=t({componentName:"Treemap",data:i});return he?We(N,{componentName:"Treemap",message:he,width:X,height:Y}):te.loadingEl?te.loadingEl:We(D,{componentName:"Treemap",width:X,height:Y,children:We(s,{chartType:"treemap",...null!=i&&{data:i},size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,nodeIDAccessor:h,childrenAccessor:d,hierarchySum:de,padding:C,paddingTop:me,nodeStyle:ce,colorBy:g,colorScheme:te.effectivePalette,colorByDepth:b,nodeLabel:Z?S||h:void 0,showLabels:Z,labelMode:k,enableHover:Q,tooltipContent:!1===M?()=>null:v(M)||void 0,...c({linkedHover:B,selection:x,onObservation:O,onClick:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:ie,customClickBehavior:te.customClickBehavior,linkedHoverInClickPredicate:!1}),...R&&"none"!==R&&{legendHoverBehavior:te.legendState.onLegendHover,legendClickBehavior:te.legendState.onLegendClick,legendHighlightedCategory:te.legendState.highlightedCategory,legendIsolatedCategories:te.legendState.isolatedCategories},className:l,title:K,description:U,summary:V,accessibleTable:ee,...null!=e.animate&&{animate:e.animate},...G})})}Re.displayName="Treemap";import{useMemo as ze}from"react";import{jsx as Fe}from"react/jsx-runtime";function je(e){const n=A(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,childrenAccessor:l="children",valueAccessor:d="value",nodeIdAccessor:m="name",colorBy:h,colorScheme:g,colorByDepth:u=!1,nodeLabel:f,circleOpacity:b=.7,padding:k=4,tooltip:S,frameProps:C={},onObservation:T,onClick:I,chartId:M,selection:H,linkedHover:x,loading:B,loadingContent:O,legendInteraction:P,stroke:L,strokeWidth:E,opacity:W}=e,{width:R,height:z,enableHover:F,showLabels:j=!0,title:$,description:G,summary:X,accessibleTable:Y}=n,Q=J({nodes:ze(()=>_(i??null,l),[i,l]),edges:void 0,inferNodes:!1,colorBy:u?void 0:h,colorScheme:g,showLegend:!1,legendInteraction:P,selection:H,linkedHover:x,onObservation:T,onClick:I,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"CirclePack",chartId:M,marginDefaults:n.marginDefaults,userMargin:r,width:R,height:z,hasTitle:!!$,loading:B,loadingContent:O}),Z=ze(()=>new Map,[]),K=ze(()=>e=>{const t={stroke:"currentColor",strokeWidth:1,strokeOpacity:.3,fillOpacity:b};return t.fill=u?p[(e.depth||0)%p.length]:h?y(e.data||e,h,Q.colorScale):w(void 0,Q.themeCategorical,g,void 0,Z),t},[h,u,Q.colorScale,b,Q.themeCategorical,g,Z]),U=ze(()=>o(K,{stroke:L,strokeWidth:E,opacity:W}),[K,L,E,W]),V=ze(()=>q(d),[d]),ee=t({componentName:"CirclePack",data:i});return ee?Fe(N,{componentName:"CirclePack",message:ee,width:R,height:z}):Q.loadingEl?Q.loadingEl:Fe(D,{componentName:"CirclePack",width:R,height:z,children:Fe(s,{chartType:"circlepack",...null!=i&&{data:i},size:[R,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Q.margin,nodeIDAccessor:m,childrenAccessor:l,hierarchySum:V,padding:k,nodeStyle:U,colorBy:h,colorScheme:Q.effectivePalette,colorByDepth:u,nodeLabel:j?f||m:void 0,showLabels:j,enableHover:F,tooltipContent:!1===S?()=>null:v(S)||void 0,...c({linkedHover:x,selection:H,onObservation:T,onClick:I,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior,linkedHoverInClickPredicate:!1}),...P&&"none"!==P&&{legendHoverBehavior:Q.legendState.onLegendHover,legendClickBehavior:Q.legendState.onLegendClick,legendHighlightedCategory:Q.legendState.highlightedCategory,legendIsolatedCategories:Q.legendState.isolatedCategories},className:a,title:$,description:G,summary:X,accessibleTable:Y,...null!=e.animate&&{animate:e.animate},...C})})}je.displayName="CirclePack";import{useMemo as $e}from"react";import{jsx as _e}from"react/jsx-runtime";var Ge=p;function qe(e){const n=A(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,childrenAccessor:l="children",nodeIdAccessor:d="name",colorBy:m,colorScheme:h,colorByDepth:f=!1,orbitMode:p="flat",orbitSize:b=2.95,speed:S=.25,revolution:C,revolutionStyle:T,eccentricity:I=1,showRings:M=!0,nodeRadius:H=6,showLabels:x=!1,animated:B=!0,tooltip:O,foregroundGraphics:P,annotations:L,frameProps:E={},onObservation:W,onClick:R,chartId:z,selection:F,linkedHover:j,loading:$,loadingContent:G,stroke:q,strokeWidth:X,opacity:Y}=e,{width:Q,height:Z,enableHover:K,title:U,description:V,summary:ee,accessibleTable:te}=n,oe=J({nodes:$e(()=>_(i,l),[i,l]),edges:void 0,inferNodes:!1,colorBy:f?void 0:m,colorScheme:h,showLegend:!1,legendInteraction:void 0,selection:F,linkedHover:j,onObservation:W,onClick:R,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"OrbitDiagram",chartId:z,marginDefaults:k(n),userMargin:r,width:Q,height:Z,hasTitle:!!U,loading:$,loadingContent:G}),ne=$e(()=>new Map,[]),{colorScale:ie,customClickBehavior:re,customHoverBehavior:se,themeCategorical:ae}=oe,le=$e(()=>{if(Array.isArray(h))return h;const e=g[h];return Array.isArray(e)?e:u},[h]),ce=$e(()=>e=>{const t={stroke:"#fff",strokeWidth:1},o=0===(e.depth??0);return t.fill=f?o?le[0]:Ge[(e.depth||0)%Ge.length]:m?y(e.data||e,m,ie):w(void 0,ae,h,void 0,ne),t.opacity=o?1:.85,t},[m,f,ie,le,ae,h,ne]),de=$e(()=>o(ce,{stroke:q,strokeWidth:X,opacity:Y}),[ce,q,X,Y]),me=$e(()=>()=>({stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1}),[]),he=$e(()=>e=>{se(e&&e.data&&void 0!==e.data.data?{...e,data:e.data.data}:e)},[se]),ge=$e(()=>e=>{re(e&&e.data&&void 0!==e.data.data?{...e,data:e.data.data}:e)},[re]),ue=t({componentName:"OrbitDiagram",data:i});return ue?_e(N,{componentName:"OrbitDiagram",message:ue,width:Q,height:Z}):oe.loadingEl?oe.loadingEl:_e(D,{componentName:"OrbitDiagram",width:Q,height:Z,children:_e(s,{chartType:"orbit",...null!=i&&{data:i},size:[Q,Z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe.margin,nodeIDAccessor:d,childrenAccessor:l,nodeStyle:de,edgeStyle:me,colorBy:m,colorScheme:oe.effectivePalette,colorByDepth:f,nodeSize:H,nodeLabel:x?d:void 0,showLabels:x,enableHover:!B&&K,tooltipContent:B?void 0:!1===O?()=>null:v(O)||void 0,...c({linkedHover:j,selection:F,onObservation:W,onClick:R,mobileInteraction:oe.mobileInteraction,customHoverBehavior:he,customClickBehavior:ge,linkedHoverInClickPredicate:!1}),foregroundGraphics:P,annotations:L,className:a,title:U,description:V,summary:ee,orbitMode:p,orbitSize:b,orbitSpeed:S,orbitRevolution:C,orbitRevolutionStyle:T,orbitEccentricity:I,orbitShowRings:M,orbitAnimated:B,accessibleTable:te,...null!=e.animate&&{animate:e.animate},...E})})}qe.displayName="OrbitDiagram";import{forceCenter as Xe,forceCollide as Je,forceLink as Ye,forceManyBody as Qe,forceSimulation as Ze,forceX as Ke,forceY as Ue}from"d3-force";function Ve(e,t,o={}){const n=o.iterations??260,i=o.repulsion??5200,r=o.linkDistance??165,s=o.linkStrength??.045,a=o.centerStrength??.018,l=o.damping??.84,c=o.nodeRadius??12,m=o.nodePadding??3,h=o.inset??.06,g=d(o.seed??1),u=new Map;for(const t of e)u.set(t.id,0);for(const e of t)u.set(e.source,(u.get(e.source)??0)+1),u.set(e.target,(u.get(e.target)??0)+1);const f=500,p=e.map(e=>({id:e.id,data:e,x:200+600*g(),y:200+600*g()})),b=new Set(e.map(e=>e.id)),y=t.filter(e=>b.has(e.source)&&b.has(e.target)).map(e=>({source:e.source,target:e.target}));if(n>0){const e=Ze(p).randomSource(g).alphaDecay(1-Math.pow(.001,1/n)).velocityDecay(Math.max(0,Math.min(1,1-l))).force("charge",Qe().strength(e=>{const t=u.get(e.id)??0;return 2.5*-Math.sqrt(i)*Math.sqrt(t+1)})).force("collide",Je(e=>(e=>"function"==typeof c?c(e.data):c)(e)+m).strength(.9).iterations(2)).force("center",Xe(f,f).strength(.8)).force("x",Ke(f).strength(a)).force("y",Ue(f).strength(a));y.length>0&&e.force("link",Ye(y).id(e=>e.id).distance(r).strength(e=>{const t="string"==typeof e.target?e.target:e.target.id,o=Math.max(1,Math.min(u.get("string"==typeof e.source?e.source:e.source.id)??1,u.get(t)??1));return s/.045/o})),e.stop();for(let t=0;n>t;t+=1)e.tick()}let v=1/0,k=1/0,S=-1/0,w=-1/0;for(const e of p){const t=e.x??f,o=e.y??f;v>t&&(v=t),k>o&&(k=o),t>S&&(S=t),o>w&&(w=o)}const C=S-v,T=w-k,A={};for(const e of p)A[e.id]={x:0===C?.5:h+((e.x??f)-v)/C*(1-2*h),y:0===T?.5:h+((e.y??f)-k)/T*(1-2*h)};return A}export{R as NetworkCustomChart,Q as ForceDirectedGraph,ee as ChordDiagram,re as SankeyDiagram,se as validateProcessSankey,ae as formatProcessSankeyIssue,Ne as ProcessSankey,Pe as TreeDiagram,Re as Treemap,je as CirclePack,qe as OrbitDiagram,Ve as forceLayout};
|