semiotic 3.8.7 → 3.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +56 -46
  3. package/ai/dist/mcp-server.js +28 -2
  4. package/ai/schema.json +124 -4
  5. package/ai/surface-manifest.json +1 -1
  6. package/ai/system-prompt.md +1 -1
  7. package/dist/{chunk-chartContainerDataAudit-JDSVSKGM.module.min.js → chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js} +1 -1
  8. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +2 -0
  9. package/dist/chunk-chunk-2NVFEB7P.module.min.js +2 -0
  10. package/dist/chunk-chunk-3GCILWPB.module.min.js +2 -0
  11. package/dist/chunk-chunk-46KRGJQP.module.min.js +1 -0
  12. package/dist/{chunk-chunk-5SD6BHVW.module.min.js → chunk-chunk-4MLLQUGW.module.min.js} +1 -1
  13. package/dist/chunk-chunk-57RBPDBQ.module.min.js +2 -0
  14. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +1 -0
  15. package/dist/chunk-chunk-66PCWJUG.module.min.js +1 -0
  16. package/dist/chunk-chunk-7LE56WAE.module.min.js +2 -0
  17. package/dist/chunk-chunk-7T25U75Z.module.min.js +2 -0
  18. package/dist/chunk-chunk-AF53TBSN.module.min.js +2 -0
  19. package/dist/chunk-chunk-BTZYH2IE.module.min.js +1 -0
  20. package/dist/chunk-chunk-BWV55BZK.module.min.js +2 -0
  21. package/dist/{chunk-chunk-FRO4TRXK.module.min.js → chunk-chunk-BZNOAHJV.module.min.js} +1 -1
  22. package/dist/chunk-chunk-CD6PVVS3.module.min.js +2 -0
  23. package/dist/chunk-chunk-DTSNLGRK.module.min.js +2 -0
  24. package/dist/{chunk-chunk-BNGBEY7N.module.min.js → chunk-chunk-FC3NZWYR.module.min.js} +1 -1
  25. package/dist/chunk-chunk-FEPXDKJP.module.min.js +1 -0
  26. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +1 -0
  27. package/dist/chunk-chunk-FRGBMTZR.module.min.js +1 -0
  28. package/dist/chunk-chunk-G75OPF5N.module.min.js +2 -0
  29. package/dist/{chunk-chunk-NH4MEAKP.module.min.js → chunk-chunk-H5IFO6CU.module.min.js} +1 -1
  30. package/dist/chunk-chunk-HADHLMY5.module.min.js +1 -0
  31. package/dist/chunk-chunk-HBFA4NN6.module.min.js +1 -0
  32. package/dist/chunk-chunk-HCNDE26Q.module.min.js +2 -0
  33. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +2 -0
  34. package/dist/chunk-chunk-JRHXQGEV.module.min.js +2 -0
  35. package/dist/chunk-chunk-L6FFYGYS.module.min.js +1 -0
  36. package/dist/{chunk-chunk-Z2AJERX5.module.min.js → chunk-chunk-LJDH3WV3.module.min.js} +1 -1
  37. package/dist/chunk-chunk-LSJUXBMF.module.min.js +1 -0
  38. package/dist/chunk-chunk-N3Q33XCB.module.min.js +2 -0
  39. package/dist/chunk-chunk-NWIGA3UK.module.min.js +1 -0
  40. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +2 -0
  41. package/dist/{chunk-chunk-XEVJDUTH.module.min.js → chunk-chunk-OZK46A5U.module.min.js} +1 -1
  42. package/dist/chunk-chunk-PMR47KRY.module.min.js +2 -0
  43. package/dist/chunk-chunk-QQJNG23C.module.min.js +2 -0
  44. package/dist/{chunk-chunk-LG7YKJAK.module.min.js → chunk-chunk-RGJ6TKAH.module.min.js} +1 -1
  45. package/dist/{chunk-chunk-JWXLNZSM.module.min.js → chunk-chunk-SFLUSZ73.module.min.js} +1 -1
  46. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +1 -0
  47. package/dist/{chunk-chunk-LVHDZAT3.module.min.js → chunk-chunk-UEZ6SHW5.module.min.js} +1 -1
  48. package/dist/chunk-chunk-VUWYT7DY.module.min.js +2 -0
  49. package/dist/{chunk-chunk-OI7R7EJB.module.min.js → chunk-chunk-W5HWGQMD.module.min.js} +1 -1
  50. package/dist/chunk-chunk-WFHZHWT7.module.min.js +1 -0
  51. package/dist/chunk-chunk-WGROBM3I.module.min.js +2 -0
  52. package/dist/{chunk-chunk-GU2EJIDJ.module.min.js → chunk-chunk-WSDJFBKX.module.min.js} +1 -1
  53. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +2 -0
  54. package/dist/components/charts/index.d.ts +2 -2
  55. package/dist/components/charts/network/ProcessSankey.d.ts +105 -74
  56. package/dist/components/charts/network/processSankey/accessors.d.ts +7 -0
  57. package/dist/components/charts/network/processSankey/algorithm.d.ts +14 -193
  58. package/dist/components/charts/network/processSankey/axisChrome.d.ts +31 -0
  59. package/dist/components/charts/network/processSankey/bandPaths.d.ts +45 -0
  60. package/dist/components/charts/network/processSankey/buildScenes.d.ts +41 -3
  61. package/dist/components/charts/network/processSankey/fixtures.d.ts +17 -0
  62. package/dist/components/charts/network/processSankey/frameMargins.d.ts +11 -0
  63. package/dist/components/charts/network/processSankey/groupBonding.d.ts +13 -0
  64. package/dist/components/charts/network/processSankey/inventoryAtTime.d.ts +41 -0
  65. package/dist/components/charts/network/processSankey/labelPlacement.d.ts +34 -0
  66. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +47 -0
  67. package/dist/components/charts/network/processSankey/layoutOrchestrator.d.ts +44 -0
  68. package/dist/components/charts/network/processSankey/layoutQualityProduct.d.ts +27 -0
  69. package/dist/components/charts/network/processSankey/massSimulation.d.ts +16 -0
  70. package/dist/components/charts/network/processSankey/ordering.d.ts +55 -0
  71. package/dist/components/charts/network/processSankey/orderingBond.d.ts +33 -0
  72. package/dist/components/charts/network/processSankey/orientation.d.ts +5 -0
  73. package/dist/components/charts/network/processSankey/packing.d.ts +8 -0
  74. package/dist/components/charts/network/processSankey/packingCache.d.ts +23 -0
  75. package/dist/components/charts/network/processSankey/processSankeyLayoutAsync.d.ts +27 -0
  76. package/dist/components/charts/network/processSankey/processSankeyLayoutWorkerClient.d.ts +72 -0
  77. package/dist/components/charts/network/processSankey/processSankeyTooltip.d.ts +26 -0
  78. package/dist/components/charts/network/processSankey/processSankeyTypes.d.ts +163 -0
  79. package/dist/components/charts/network/processSankey/ribbonInputs.d.ts +26 -2
  80. package/dist/components/charts/network/processSankey/ribbonRunway.d.ts +45 -0
  81. package/dist/components/charts/network/processSankey/streamingLayout.d.ts +23 -0
  82. package/dist/components/charts/network/processSankey/time.d.ts +11 -0
  83. package/dist/components/charts/network/processSankey/useProcessSankeyPush.d.ts +29 -0
  84. package/dist/components/charts/network/processSankey/useProcessSankeyScenes.d.ts +26 -0
  85. package/dist/components/charts/network/processSankey/validation.d.ts +33 -0
  86. package/dist/components/charts/shared/chartFamilySets.d.ts +1 -0
  87. package/dist/components/charts/shared/formatUtils.d.ts +12 -1
  88. package/dist/components/charts/shared/hatchFill.d.ts +2 -0
  89. package/dist/components/charts/shared/hooks.d.ts +1 -1
  90. package/dist/components/charts/shared/leastSquaresRegression.d.ts +31 -0
  91. package/dist/components/charts/shared/styleRules.d.ts +5 -1
  92. package/dist/components/charts/shared/useChartLegend.d.ts +6 -0
  93. package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
  94. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  95. package/dist/components/charts/shared/withChartWrapper.d.ts +0 -6
  96. package/dist/components/data/numericFieldProfiler.d.ts +2 -0
  97. package/dist/components/recipes/layout1d.d.ts +68 -0
  98. package/dist/components/semiotic-network.d.ts +2 -2
  99. package/dist/components/semiotic-recipes-core.d.ts +2 -0
  100. package/dist/components/semiotic.d.ts +2 -0
  101. package/dist/components/server/staticSVGChrome.d.ts +2 -1
  102. package/dist/components/store/createStore.d.ts +2 -0
  103. package/dist/components/stream/OrdinalPipelineStore.d.ts +3 -0
  104. package/dist/components/stream/PipelineStore.d.ts +5 -0
  105. package/dist/components/stream/accessorUtils.d.ts +21 -0
  106. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -2
  107. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +3 -8
  108. package/dist/components/stream/layouts/index.d.ts +1 -1
  109. package/dist/components/stream/moduleWorkerSession.d.ts +67 -0
  110. package/dist/components/stream/networkTypes.d.ts +2 -0
  111. package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +2 -1
  112. package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
  113. package/dist/components/stream/pipelineIntroCancellation.d.ts +6 -0
  114. package/dist/components/stream/pipelineTransitions.d.ts +15 -1
  115. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +16 -4
  116. package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +4 -0
  117. package/dist/components/stream/symbolPath.d.ts +8 -0
  118. package/dist/components/stream/types.d.ts +2 -0
  119. package/dist/components/stream/useCanvasFrameHost.d.ts +6 -0
  120. package/dist/components/stream/useSemanticFrameInteractions.d.ts +12 -3
  121. package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -0
  122. package/dist/forceLayoutWorker.js +1 -1
  123. package/dist/geo.min.js +1 -1
  124. package/dist/geo.module.min.js +1 -1
  125. package/dist/network.min.js +1 -1
  126. package/dist/network.module.min.js +1 -1
  127. package/dist/ordinal.min.js +1 -1
  128. package/dist/ordinal.module.min.js +1 -1
  129. package/dist/physics.min.js +1 -1
  130. package/dist/physics.module.min.js +1 -1
  131. package/dist/physicsWorker.js +1 -1
  132. package/dist/processSankeyLayoutWorker.js +1 -0
  133. package/dist/realtime.min.js +1 -1
  134. package/dist/realtime.module.min.js +1 -1
  135. package/dist/semiotic-ai-core.min.js +1 -1
  136. package/dist/semiotic-ai-core.module.min.js +1 -1
  137. package/dist/semiotic-ai.min.js +1 -1
  138. package/dist/semiotic-ai.module.min.js +1 -1
  139. package/dist/semiotic-experimental-vacp.min.js +1 -1
  140. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  141. package/dist/semiotic-experimental.min.js +1 -1
  142. package/dist/semiotic-experimental.module.min.js +1 -1
  143. package/dist/semiotic-network.d.ts +2 -2
  144. package/dist/semiotic-realtime-core.min.js +1 -1
  145. package/dist/semiotic-realtime-core.module.min.js +1 -1
  146. package/dist/semiotic-recipes-core.d.ts +2 -0
  147. package/dist/semiotic-recipes-core.min.js +1 -1
  148. package/dist/semiotic-recipes-core.module.min.js +1 -1
  149. package/dist/semiotic-recipes.min.js +1 -1
  150. package/dist/semiotic-recipes.module.min.js +1 -1
  151. package/dist/semiotic-server-edge.min.js +1 -1
  152. package/dist/semiotic-server-edge.module.min.js +1 -1
  153. package/dist/semiotic-server-node.min.js +1 -1
  154. package/dist/semiotic-server-node.module.min.js +1 -1
  155. package/dist/semiotic-themes-core.module.min.js +1 -1
  156. package/dist/semiotic-themes-react.module.min.js +1 -1
  157. package/dist/semiotic-themes.module.min.js +1 -1
  158. package/dist/semiotic-utils-core.min.js +1 -1
  159. package/dist/semiotic-utils-core.module.min.js +1 -1
  160. package/dist/semiotic-utils-react.module.min.js +1 -1
  161. package/dist/semiotic-utils.min.js +1 -1
  162. package/dist/semiotic-utils.module.min.js +1 -1
  163. package/dist/semiotic-value.min.js +1 -1
  164. package/dist/semiotic-value.module.min.js +1 -1
  165. package/dist/semiotic.d.ts +2 -0
  166. package/dist/semiotic.min.js +1 -1
  167. package/dist/semiotic.module.min.js +1 -1
  168. package/dist/server.min.js +1 -1
  169. package/dist/server.module.min.js +1 -1
  170. package/dist/xy.min.js +1 -1
  171. package/dist/xy.module.min.js +1 -1
  172. package/package.json +4 -3
  173. package/dist/chunk-chunk-2YAZHXL4.module.min.js +0 -2
  174. package/dist/chunk-chunk-3NGIKFD6.module.min.js +0 -1
  175. package/dist/chunk-chunk-7TTBHSAG.module.min.js +0 -2
  176. package/dist/chunk-chunk-7ZDJSYKI.module.min.js +0 -2
  177. package/dist/chunk-chunk-BGHPD3RA.module.min.js +0 -1
  178. package/dist/chunk-chunk-BMRZ2SPU.module.min.js +0 -2
  179. package/dist/chunk-chunk-C7APLVQD.module.min.js +0 -2
  180. package/dist/chunk-chunk-DGWFBOGB.module.min.js +0 -1
  181. package/dist/chunk-chunk-DIVE2DRA.module.min.js +0 -2
  182. package/dist/chunk-chunk-DSNGDNJY.module.min.js +0 -1
  183. package/dist/chunk-chunk-FBUNUIPV.module.min.js +0 -2
  184. package/dist/chunk-chunk-G7QVPZUD.module.min.js +0 -2
  185. package/dist/chunk-chunk-GBPYV4FP.module.min.js +0 -2
  186. package/dist/chunk-chunk-KXAFCCDB.module.min.js +0 -2
  187. package/dist/chunk-chunk-LWITSR2O.module.min.js +0 -2
  188. package/dist/chunk-chunk-MX35T6RX.module.min.js +0 -2
  189. package/dist/chunk-chunk-NJETWX42.module.min.js +0 -2
  190. package/dist/chunk-chunk-NW25WGLS.module.min.js +0 -2
  191. package/dist/chunk-chunk-ONMLEXHR.module.min.js +0 -2
  192. package/dist/chunk-chunk-OY66GCE6.module.min.js +0 -1
  193. package/dist/chunk-chunk-PRDGLMJT.module.min.js +0 -2
  194. package/dist/chunk-chunk-PZFT457G.module.min.js +0 -1
  195. package/dist/chunk-chunk-Q3WW6JGR.module.min.js +0 -1
  196. package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +0 -1
  197. package/dist/chunk-chunk-RJRM2E6P.module.min.js +0 -1
  198. package/dist/chunk-chunk-RPL7WYXI.module.min.js +0 -1
  199. package/dist/chunk-chunk-V3OAKG32.module.min.js +0 -1
  200. package/dist/chunk-chunk-WCX6U47H.module.min.js +0 -2
  201. package/dist/chunk-chunk-WLOIUMWG.module.min.js +0 -2
  202. package/dist/chunk-chunk-XEGXX4F7.module.min.js +0 -1
  203. package/dist/chunk-chunk-XFRBLXYM.module.min.js +0 -1
  204. package/dist/chunk-chunk-ZXYDYAB7.module.min.js +0 -2
  205. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +0 -2
  206. package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{mergeShapeStyle as t,useChartSetup as o,useCustomChartSetup as i,useFrameImperativeHandle as r}from"./chunk-chunk-VUWYT7DY.module.min.js";import{validateArrayData as n}from"./chunk-chunk-J5QD4RAM.module.min.js";import{DataSourceAdapter as s,IncrementalExtent as a,barCanvasRenderer as l,buildEnrichAnnotationData as c,buildRectNode as h,normalizeColorGradient as u,normalizeGradient as d,resolveAnnotationAccessor as m,resolveFrameGraphics as g,snapOrdinalIntroTargets as p,ticksForMode as f,toIdSet as y}from"./chunk-chunk-57RBPDBQ.module.min.js";import{RingBuffer as v,compactTimestampBufferForRemoval as b,computePulseIntensity as x,createTimestampBufferForData as w,ensureRingBufferCapacity as A,hasActivePulses as k,pointCanvasRenderer as S,pushWithTimestamp as C,refreshIdlePulse as _,setPulseState as P,useLegendCategoryEmission as R,useOrdinalKeyboardNavigation as M,useSemanticFrameInteractions as L}from"./chunk-chunk-QQJNG23C.module.min.js";import{symbolCanvasRenderer as I}from"./chunk-chunk-CD6PVVS3.module.min.js";import{StalenessBadge as T,attachUpdateResultStore as H,buildBaseMetadataProps as B,buildCustomBehaviorProps as O,buildDatumIndexMap as F,buildOrdinalTooltip as E,buildTooltipProps as N,composeOverlays as D,computeDecayOpacity as j,createCustomLayoutFailureDiagnostic as W,findHitPointInQuadtree as z,getHitRadius as V,glyphCanvasRenderer as G,hitTestRect as $,normalizeAngle as q,paintSceneWithBackend as Y,renderPathPulse as X,renderSceneWithBackend as Q,useConfigSync as K,useLayoutSelectionSync as Z,useStableShallow as U,useStalenessCheck as J,warnCustomLayoutDiagnostics as ee}from"./chunk-chunk-H5IFO6CU.module.min.js";import{wrapWithCustomLayoutSelection as te}from"./chunk-chunk-5UKL5W76.module.min.js";import{accessorsEquivalent as oe,resolveAccessor as ie,resolveStringAccessor as re}from"./chunk-chunk-NWIGA3UK.module.min.js";import{filterAnnotationsByStatus as ne}from"./chunk-chunk-FC3NZWYR.module.min.js";import{makeRuleValueResolver as se,resolveStyleRules as ae}from"./chunk-chunk-EMO5NUGE.module.min.js";import{buildResolveColor as le,resolveCustomLayoutPalette as ce}from"./chunk-chunk-SFLUSZ73.module.min.js";import{AccessibleDataTable as he,AriaLiveTooltip as ue,CanvasFrameBackground as de,FlippingTooltip as me,FocusRing as ge,STREAMING_PALETTE as pe,SceneRevisionDiagnosticsObserver as fe,ScreenReaderSummary as ye,SkipToTableLink as ve,TITLE_BASELINE as be,UpdateResultTracker as xe,annotationLayout as we,annularSectorPath as Ae,buildGaugeGradientGeometry as ke,buildHoverData as Se,coerceCanvasFill as Ce,computeCanvasAriaLabel as _e,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 Oe,getDevicePixelRatio as Fe,getSize as Ee,interpolateBrBG as Ne,interpolatePRGn as De,interpolatePiYG as je,interpolateRdBu as We,interpolateRdYlBu as ze,interpolateRdYlGn as Ve,interpolateSpectral as Ge,isAnnotationActivationTarget as $e,isHatchFill as qe,isServerEnvironment as Ye,lerp as Xe,makeSymbolResolver as Qe,normalizeLinkedBrush as Ke,normalizeTooltip as Ze,now as Ue,observationInputType as Je,ordinalSceneNodeToSVG as et,parseCanvasColor as tt,renderAnnotationPass as ot,renderLegendFromConfig as it,resolveCSSColor as rt,resolveCanvasFill as nt,resolveDefaultFill as st,resolveOrdinalAxisChrome as at,smartTooltipEntries as lt,symbolRadius as ct,useAnnotationActivationOptions as ht,useBrushSelection as ut,useCategoryColors as dt,useChartMode as mt,useFrame as gt,useFrameCanvasHost as pt,useLinkedChartCategories as ft,useSceneRevisionDiagnostics as yt,useSortedData as vt,useThemeCategorical as bt,useThemeDiverging as xt,wrapStyleWithSelection as wt}from"./chunk-chunk-HCNDE26Q.module.min.js";import{getMax as At,getMinMax as kt}from"./chunk-chunk-2NVFEB7P.module.min.js";import{resolveThemeSemanticColors as St}from"./chunk-chunk-PMR47KRY.module.min.js";import{glyphHitGeometry as Ct}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as _t,SafeRender as Pt,useHydration as Rt,useWasHydratingFromSSR as Mt,warnMissingField as Lt}from"./chunk-chunk-ACLDBMRH.module.min.js";import{useRef as It,useState as Tt,useEffect as Ht,useMemo as Bt,useCallback as Ot,useImperativeHandle as Ft,forwardRef as Et,memo as Nt}from"react";import{scaleBand as Dt,scaleLinear as jt}from"d3-scale";var Wt=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){const i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:e.barColors[o]||"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){const o=this.colorSchemeMap.get(t);if(o)return o;const i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||pe,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};function zt(e){const t=e.getSymbol;return t?Qe(t,e.config.symbolMap):null}function Vt(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 Gt(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)}),m=h&&!d&&u.length>1&&(i.cornerRadius??0)>0;for(let e=0;u.length>e;e++){const t=u[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d=l+h*c,g=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===u.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:a,outerRadius:s,startAngle:d,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),n.push(v)}return n}import{quantile as $t}from"d3-array";function qt(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:$t(e,.25)??o,median:$t(e,.5)??(o+i)/2,q3:$t(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as Yt}from"d3-scale";var Xt={bar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getStack:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m="horizontal"===c,g=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(g)for(const e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(const n of p){const c=t.get(n);if(!c)continue;let p=c.total;g&&o>0&&(p/=o);const f=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);u.push(h(e.x,t,e.width,Math.abs(o),f,y,n)),0>p?r+=p:i+=p}else if(m){const t=l(0>p?r+p:i),o=0>p?l(r)-l(r+p):l(i+p)-l(i);u.push(h(t,e.x,Math.abs(o),e.width,f,y,n)),0>p?r+=p:i+=p}}}const f="vertical"===c,y=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(y>0){const e=new Map;for(const t of u){if("rect"!==t.type)continue;const o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(const t of e.values()){if(0===t.length)continue;const e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));e.length>0&&(e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t).roundedTop=y),o.length>0&&(o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t).roundedTop=y)}}return u},clusterbar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getGroup:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,u=[],d="vertical"===c,m=[],g=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=s?s(t):"_default";g.has(e)||(g.add(e),m.push(e))}const p=m.length||1;for(const e of Object.values(i)){const t=e.width/p,o=.2*t,i=t-o,r=new Map;for(const t of e.pieceData){const e=s?s(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let s=0;m.length>s;s++){const c=r.get(m[s])||[];for(const r of c){const c=n(r),g=a(r,m[s]);if(d){const n=e.x+s*t+o/2,a=l(0),d=l(c);u.push(h(n,Math.min(a,d),i,Math.abs(a-d),g,r,m[s]))}else{const n=e.x+s*t+o/2,a=l(0),d=l(c);u.push(h(Math.min(a,d),n,Math.abs(d-a),i,g,r,m[s]))}}}}const f=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of u){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=n(e.datum);f>0&&(e.roundedTop=f),e.roundedEdge=d?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}return u},point:function(e,t){const{scales:o,columns:i,getR:r,multiScales:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=n.length>0,m=zt(e),g=2*Math.PI,p=-Math.PI/2;for(const e of Object.values(i))for(const t of e.pieceData){const o=t.__rIndex??0,i=t.__rValue??r(t),l=d&&n[o]||a,f=s(t,e.name),y=f.r||5;let v,b;if(u){const t=p+(e.pctStart+e.pct/2)*g,o=l(i);v=Math.cos(t)*o,b=Math.sin(t)*o}else h?(v=e.middle,b=l(i)):(v=l(i),b=e.middle);Vt(c,m,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=zt(e);for(const e of Object.values(i)){const t=e.width/2;for(let o=0;e.pieceData.length>o;o++){const i=e.pieceData[o],a=r(i),u=n(i,e.name),d=u.r||4,m=(7919*o%100/100-.5)*t*.8;Vt(l,h,i,c?e.middle+m:s(a),c?s(a):e.middle+m,d,u)}}return l},pie:Gt,donut:Gt,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=$t(o,.25)??i,d=$t(o,.5)??(i+r)/2,m=$t(o,.75)??r,g=m-l,p=l-1.5*g,f=m+1.5*g,y=o.find(e=>e>=p)??i,v=[...o].reverse().find(e=>f>=e)??r,b=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(m),maxPos:a(v),stats:{n:o.length,min:y,q1:l,median:d,q3:m,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),u)for(const t of x)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:b.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle: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 m=At(l,1),g=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]/m*g} ${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]/m*g} ${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]/m*g}`;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]/m*g}`;p+=" Z"}const f=s(e.pieceData[0],e.name);let y;if(d&&t.length>=4){const r=$t(t,.25)??o,n=$t(t,.5)??(o+i)/2,s=$t(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:qt(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a}=o,l=[],c=r.bins||25,u=r.normalize,d=a.domain?.(),m=d?+d[0]:void 0,g=d?+d[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=kt(t),r=null!=m&&isFinite(m)?m:o,d=null!=g&&isFinite(g)?g:i,p=(d-r)/c||1,f=Array(c).fill(0);for(const e of t)r>e||e>d||f[Math.min(Math.floor((e-r)/p),c-1)]++;const y=t.length,v=At(f,1),b=s(e.pieceData[0],e.name);for(let t=0;c>t;t++){if(0===f[t])continue;const o=(u?f[t]/y:f[t]/v)*e.width*.9,i=a(r+t*p),n=a(r+(t+1)*p);l.push(h(Math.min(i,n),e.x+e.width-o,Math.abs(n-i),o,b,{bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name},e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle: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 m=At(l,1),g=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]/m*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]/m*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:qt(t),style:{...g,fillOpacity:g.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:r,resolvePieceStyle:n}=e,{r: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,u=n(t,e.name);if(c){const o=s(Math.min(i,a)),r=s(Math.max(i,a));l.push(h(o,e.x,r-o,e.width,u,t,e.name))}else{const o=s(Math.max(i,a)),r=s(Math.min(i,a));l.push(h(e.x,o,e.width,r-o,u,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n}=e,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 u=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=r?r(t):"_default";d.has(e)||(d.add(e),u.push(e))}const m=u.length>1&&"_default"!==u[0],g=[];let p=0;for(const e of c){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}g.push({col:e,groups:t,stepTotal:o}),m||o>p&&(p=o)}if(m)for(const e of g){let t=0,o=0;for(let i=0;u.length>i;i++){const r=e.groups.get(u[i]);r&&(i%2==0?t+=r.total:o+=r.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return s;const f=new Map;for(const e of u){const t=g[0].groups.get(e);f.set(e,t?.total??0)}const y=g[0].stepTotal,v=m?.95*a:.9*t.width,b=Yt().domain([0,p]).range([0,v]),x=e.config.connectorOpacity??.3;let w=new Map;for(let t=0;g.length>t;t++){const o=g[t],i=o.col,r=0===t,c=i.width,d=.55*c,p=i.x+(c-d)/2,v=new Map;if(m){let e=0;for(const t of u){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=a,c=a;for(let m=0;u.length>m;m++){const g=u[m],y=o.groups.get(g);if(!y)continue;const x=b(y.total),w=m%2==0,A=w?t:c-x;w?t+=x:c-=x;const k=n(y.pieces[0],g),S=f.get(g)??y.total,C={...y.pieces[0],__funnelValue:y.total,__funnelPercent:S>0?y.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:g};l&&(0===m&&(C.__funnelStepLabel=i.name,C.__funnelStepLabelX=a,C.__funnelStepLabelY=p,C.__funnelRowWidth=e),C.__funnelValueLabelX=A+x/2,C.__funnelValueLabelY=p,C.__funnelBarW=x),s.push(h(A,p,x,d,k,C,g)),v.set(g,{x:A,y:p,w:x,h:d})}}else{const e=o.stepTotal,t=b(e),c=a-t/2,m=u[0],g="_default"!==m,f=o.groups.get(m)?.pieces[0]??i.pieceData[0],x=g?m:i.name,w=n(f,x),A=y>0?e/y*100:0,k={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:r,category:g?m:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=a,k.__funnelStepLabelY=p,k.__funnelRowWidth=t,k.__funnelValueLabelX=a,k.__funnelValueLabelY=p,k.__funnelBarW=t),s.push(h(c,p,t,d,w,k,x)),v.set(m,{x:c,y:p,w:t,h:d})}if(t>0&&w.size>0){const t=m?u:[u[0]];for(const r of t){const t=w.get(r),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=[],u=new Set;for(const e of l)for(const t of e.pieceData){const e=r?r(t):"_default";u.has(e)||(u.add(e),c.push(e))}const d=c.length>1&&"_default"!==c[0],m=[];for(const e of l){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}m.push({col:e,groups:t,stepTotal:o})}const g=new Map;for(const e of c){const t=m[0]?.groups.get(e);g.set(e,t?.total??0)}const p=s.r,f=d?c.length:1,y=d?.15:0;for(let e=0;m.length>e;e++){const t=m[e],o=t.col,i=0===e,r=e>0?m[e-1]:null,s=o.width/f,l=s*y,u=s-l;for(let e=0;c.length>e;e++){const m=c[e],f=t.groups.get(m);if(!f)continue;const y=f.total,v=g.get(m)??y,b=v>0?y/v*100:0,x=r?.groups.get(m),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*s+l/2,k=p(y),S=p(0)-k,C=n(f.pieces[0],d?m:o.name),_={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===m?void 0:m,category:d?m:o.name,__barFunnelLabelX:A+u/2,__barFunnelLabelY:p(y+w)};if(a.push(h(A,k,u,S,C,_,d?m:o.name)),w>0){const e=p(y+w),t=k-e,i={...C},r={...f.pieces[0],__barFunnelValue:w,__barFunnelPercent:v>0?w/v*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===m?void 0:m,category:d?m:o.name};a.push(h(A,e,u,t,i,r,d?m: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=[],u="horizontal"===l,d=e.config.gradientFill,m=u?"left":"bottom",g=e.config.trackFill;if(g){const e="string"==typeof g?g:g.color,t="string"==typeof g?1:g.opacity??1,[o,r]=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=u?h(n,o.x,s,o.width,i,null,"__track__"):h(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,g=s(o,l);let p;if(u){const r=a(t),n=a(t+i);p=h(r,e.x,n-r,e.width,g,o,l)}else{const r=a(t+i),n=a(t);p=h(e.x,r,e.width,n-r,g,o,l)}d&&(p.fillGradient=d,p.roundedEdge=m),c.push(p),t+=i}if(p>0&&c.length>o){const e=c.slice(o),t=e[0],i=e[e.length-1];1===e.length?t.cornerRadii={tl:p,tr:p,br:p,bl:p}:u?(t.cornerRadii={tl:p,bl:p},i.cornerRadii={tr:p,br:p}):(t.cornerRadii={bl:p,br:p},i.cornerRadii={tl:p,tr:p})}}return c}},Qt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kt=["scene-style","data-paint","accessibility","evidence"],Zt=(e,t)=>({retainedData:e,invalidations:t}),Ut=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],eo=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],to=["scene-geometry","data-paint","accessibility","evidence"],oo=["scene-style","data-paint","accessibility","evidence"],io=[],ro={chartType:Zt("rebuild",Ut),runtimeMode:Zt("rebuild",Ut),categoryAccessor:Zt("rebuild",Ut),valueAccessor:Zt("rebuild",Ut),oAccessor:Zt("rebuild",Ut),rAccessor:Zt("rebuild",Ut),stackBy:Zt("rebuild",Ut),groupBy:Zt("rebuild",Ut),timeAccessor:Zt("rebuild",Ut),accessorRevision:Zt("rebuild",Ut),colorAccessor:Zt("rebuild",oo),symbolAccessor:Zt("rebuild",to),connectorAccessor:Zt("rebuild",to),dataIdAccessor:Zt("rebuild",to),projection:Zt("preserve",Jt),extentPadding:Zt("preserve",Jt),axisExtent:Zt("preserve",Jt),rExtent:Zt("preserve",Jt),oExtent:Zt("preserve",Jt),multiAxis:Zt("preserve",Jt),normalize:Zt("preserve",Jt),bins:Zt("preserve",Jt),oSort:Zt("preserve",eo),barPadding:Zt("preserve",eo),roundedTop:Zt("preserve",eo),baselinePadding:Zt("preserve",eo),innerRadius:Zt("preserve",eo),cornerRadius:Zt("preserve",eo),startAngle:Zt("preserve",eo),sweepAngle:Zt("preserve",eo),trackFill:Zt("preserve",eo),showOutliers:Zt("preserve",eo),showIQR:Zt("preserve",eo),amplitude:Zt("preserve",eo),connectorOpacity:Zt("preserve",eo),showLabels:Zt("preserve",eo),dynamicColumnWidth:Zt("rebuild",eo),customLayout:Zt("preserve",eo),layoutConfig:Zt("preserve",eo),layoutMargin:Zt("preserve",eo),symbolMap:Zt("preserve",to),pieceStyle:Zt("preserve",oo),summaryStyle:Zt("preserve",oo),connectorStyle:Zt("preserve",oo),gradientFill:Zt("preserve",oo),colorScheme:Zt("preserve",oo),themeCategorical:Zt("preserve",oo),themeSemantic:Zt("preserve",oo),themeSequential:Zt("preserve",oo),themeDiverging:Zt("preserve",oo),barColors:Zt("preserve",oo),decay:Zt("preserve",oo),pulse:Zt("preserve",oo),staleness:Zt("preserve",oo),layoutSelection:Zt("preserve",oo),windowSize:Zt("preserve",io),windowMode:Zt("preserve",io),clock:Zt("preserve",io),transition:Zt("preserve",io),introAnimation:Zt("preserve",io),onLayoutError:Zt("preserve",io)},no=Zt("preserve",eo),so=class{constructor(){this.tracker=new xe}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Qt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Kt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=ro[i]??no;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as ao}from"d3-quadtree";var lo=class{constructor(e){this.rExtent=new a,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new so,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Wt,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new v(e.windowSize),this.getO=re(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>ie(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new a)):(this.getR=ie(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=re(e.stackBy),this.getGroup=re(e.groupBy),this.getColor=re(e.colorAccessor),this.getSymbol=re(e.symbolAccessor),this.getConnector=re(e.connectorAccessor),this.getDataId=re(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new v(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:w(t,i):null)}currentTime(){return this.config.clock?.()??Ue()}ingest(e){const t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),A(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)C(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=C(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 m,g;if(u){m=Dt().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;g=jt().domain(c).range([i,o])}else h?(m=Dt().domain(l).range([0,e.height]).padding(d),g=jt().domain(c).range([0,e.width])):(m=Dt().domain(l).range([0,e.width]).padding(d),g=jt().domain(c).range([e.height,0]));this.scales={o:m,r:g,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?jt().domain([s,a]).range([0,e.width]):jt().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,m,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,m=s;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&u&&r)g=0,p=1;else if("bar"===o&&u){const e=new Map,o=new Map;for(const i of t){const t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(const t of e.values())t>p&&(p=t);for(const e of o.values())g>e&&(g=e)}else if("bar"===o){const e=new Map;for(const o of t){const t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){const e=new Map;for(const o of t){const t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(const e of t){const t=h(e);t>p&&(p=t),g>t&&(g=t)}else{const e=d[0],t=d[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}n&&(null!=n[0]&&(g=n[0]),null!=n[1]&&(p=n[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==n?.[0]&&null==n?.[1]&&(g>0&&(g=0),0>p&&(p=0)),"bar-funnel"!==o&&"exact"!==l){const e=p-g,t=e>0?e*m:1,i=f&&!a&&0===g,r=f&&!a&&0===p||"swimlane"===o;null!=n?.[0]||i||(g-=t),null!=n?.[1]||r||(p+=t)}return[g,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return function(e){const{data:t,oExtent:o,oScale:i,projection:r,layout:n,dynamicColumnWidth: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 m=0,g=0;for(const e of o){const t=h.get(e)||[],o=t.reduce((e,t)=>e+Math.abs(l(t)),0),r=u>0?o/u:0;let n,s;d?(n=g,s=d.get(e)||i.bandwidth(),g+=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:m},m+=r}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){const o=this.buildLayoutContext(e,t);let i;try{i=this.config.customLayout(o)}catch(e){const t=null!==this.lastCustomLayoutResult,o=W("ordinal",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] ordinal customLayout threw:",e);try{this.config.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const r=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of r)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(r,this.config.layoutSelection??null)}return ee({label:"ordinal customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=Xt[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=ce(o.colorScheme,o.themeCategorical,pe),n=this.scales;return{data:e,scales:{o:n.o,r:n.r,projection:n.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===n.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:le(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?j(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=F(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:ao().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,x(e,t,n)))}l=P(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:x(e,h,n);l=P(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&&k(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();const e=new Map,t=this.scales?.r(0)??0,o="horizontal"!==this.scales?.projection;let i;for(let r=0;this.scene.length>r;r++){const n=this.scene[r],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}`}if("rect"===e.type){const o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();const e=new Map;for(let t=0;this.scene.length>t;t++){const o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;const e=this.config.transition.duration??300;if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1;const o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){const r=this.scene[e],n=this.getNodeKey(r,i);if(!n)continue;r._transitionKey=n;const s=this.prevPositionMap.get(n);if("point"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??r.style.fillOpacity??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??r.style.fillOpacity??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??r.style.fillOpacity??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??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(s)o.add(n),r._targetOpacity=r.style.opacity??r.style.fillOpacity??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??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;const e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(n,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(const[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){const t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;const t=Re(e,this.activeTransition),o=Pe(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(const e of this.scene){const t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Xe(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Xe(i.x,e._targetX,o),e.y=Xe(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Xe(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Xe(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=Xe(i.x,e._targetX,o),e.y=Xe(i.y,e._targetY,o),void 0!==i.w&&(e.w=Xe(i.w,e._targetW,o),e.h=Xe(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:Xe(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=Xe(i.startAngle,e._targetStartAngle,o),e.endAngle=Xe(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(const e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,p(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=y(e),o=this.getDataId,i=e=>t.has(o(e));b(this.buffer,this.timestampBuffer,i);const r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=y(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});const n=this.buffer.update(e=>o.has(i(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){const o=this._customRestyle;if(o)for(const i of e){const e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){const t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!oe(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!oe(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!oe(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(oe(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=re(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){const e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],n=Array.isArray(o)?o:[o];if(r=i.length!==n.length||i.some((e,t)=>!oe(e,n[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>ie(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new a)):(this.getR=ie(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!oe(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?re(this.config.stackBy):void 0),"groupBy"in e&&!oe(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?re(this.config.groupBy):void 0),"colorAccessor"in e&&!oe(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?re(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!oe(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?re(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!oe(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?re(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function co(e,t,o,i=30,r,n=0){let s=null;if(r){const e=z(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=ho(n,t,o);break;case"point":if(r)break;e=uo(n,t,o,i);break;case"symbol":e=mo(n,t,o,i);break;case"glyph":e=go(n,t,o,i);break;case"wedge":if(null===n.datum)break;e=po(n,t,o);break;case"boxplot":e=fo(n,t,o);break;case"violin":e=yo(n,t,o)}e&&i>e.distance&&(s&&e.distance>=s.distance||(s=e))}return s}function ho(e,t,o){const i=$(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function uo(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>V(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function mo(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>V(ct(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function go(e,t,o,i=30){if(null==e.datum)return null;const r=Ct(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>V(r.radius,i)?null:{datum:e.datum,x:n,y:s,distance:c}}function po(e,t,o){const i=t-e.cx,r=o-e.cy,n=Math.sqrt(i*i+r*r);if(e.innerRadius>n||n>e.outerRadius)return null;const 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 fo(e,t,o){const i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{const r=e.y-i,n=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>n))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function yo(e,t,o){if(!e.bounds)return null;const{x:i,y:r,width:n,height: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}}H(lo);import{useMemo as vo,useRef as bo}from"react";import{Fragment as xo,jsx as wo,jsxs as Ao}from"react/jsx-runtime";function ko(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===s?.projection,m="horizontal"===s?.projection,g=vo(()=>!s||d?[]:(h||f(s.r,5,u)).map(e=>({value:e,pixel:s.r(e),label:(c||So)(e)})),[s,c,d,h,u]),p=l&&s&&!d,y=a&&s&&!d;return p||y?wo("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:Ao("g",{transform:`translate(${n.left},${n.top})`,children:[p&&wo("g",{className:"ordinal-grid",children:g.map((e,i)=>wo("line",{x1:m?e.pixel:0,y1:m?0:e.pixel,x2:m?e.pixel:t,y2:m?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),y&&wo(xo,{children:Ao(xo,m?{children:[wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[wo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function So(e){return Math.round(100*e)/100+""}function Co(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:m,title:g,legend:p,legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:k,annotations:S,onAnnotationActivate:C,onObservation:_,chartId:P,chartType:R,autoPlaceAnnotations:M,svgAnnotationRules:L,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:O=!0,children:F}=e,E=ht({onAnnotationActivate:C,onObservation:_,chartId:P,chartType:R}),N="radial"===s?.projection,D="horizontal"===s?.projection,j=!1!==l,W=!B||O,z=vo(()=>{if(!a||!j||!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,j,s,u,N,D]),V=e.rTickValues,G=e.tickLabelEdgeAlign,$=e.axisExtent,q=vo(()=>a&&s&&!N?(V||f(s.r,5,$)).map(e=>({value:e,pixel:s.r(e),label:(d||So)(e)})):[],[a,s,d,N,V,$]),Y=bo(new Map),X=bo(S?.length??0),Q=S?.length??0;X.current!==Q&&(X.current=Q,Y.current=new Map);const K=vo(()=>{if(!S||0===S.length)return null;const e=ne(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 ot(l,i,L,a)},[S,M,L,t,o,s,I,T,H,E]);return a||g||p||k||K&&K.length>0||m||F?Ao("svg",{role:"img",width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[wo("title",{children:"string"==typeof g?g:"Ordinal Chart"}),wo("desc",{children:"string"==typeof g?g+" (ordinal data visualization)":"Ordinal data visualization"}),Ao("g",{transform:`translate(${n.left},${n.top})`,children:[m&&s&&!N&&W&&wo("g",{className:"ordinal-grid",children:q.map((e,i)=>wo("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 wo("g",{className:"ordinal-axes",children:Ao(xo,D?{children:[Ao("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),z.map((t,o)=>Ao("g",{transform:`translate(0,${t.pixel})`,children:[wo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?wo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):wo("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:wo("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&wo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Ao("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&wo("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),W&&s?.r&&(()=>{const e=s.r(0);return e>1&&t-1>e?wo("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),q.map((t,i)=>{const r=G?0===i?"start":i===q.length-1?"end":"middle":"middle";return Ao("g",{transform:`translate(${t.pixel},${o})`,children:[wo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&wo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[Ao("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[W&&(()=>{const e=s?.r?s.r(0):o,i=0>e||e>o?o:e;return wo("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),z.map((t,i)=>Ao("g",{transform:`translate(${t.pixel},${o})`,children:[wo("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?wo("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):wo("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:wo("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&wo("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),Ao("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[W&&wo("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>Ao("g",{transform:`translate(0,${t.pixel})`,children:[wo("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),wo("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&wo("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),K,k,F]}),g&&"string"==typeof g?wo("text",{x:i/2,y:be,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:g}):g?wo("foreignObject",{x:0,y:0,width:i,height:n.top,children:g}):null,it({legend:p,totalWidth:i,totalHeight:r,margin:n,legendPosition:w,title:g,legendLayout:A,axisChrome:{hasAxis:!!a&&!N,hasAxisLabel:D?!!h:!!c},legendHoverBehavior:y,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as _o from"react";import{jsx as Po}from"react/jsx-runtime";var Ro=null,Mo=null;function Lo(e){const[t,o]=_o.useState(()=>Ro);return _o.useEffect(()=>{if(t)return;let e=!1;return(Ro?Promise.resolve(Ro):(Mo||(Mo=import("./chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js").then(e=>Ro=e.OrdinalBrushOverlay).catch(e=>{throw Mo=null,e})),Mo)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?Po(t,{...e}):null}import{arc as Io}from"d3-shape";function To(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:r}=ke({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),n=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(n);for(const t of r)e.fillStyle=rt(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore(),t.style.stroke&&"none"!==t.style.stroke&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(n),e.restore())}function Ho(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function Bo(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=Io().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const r=new Path2D(i);e.fill(r),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(r),e.restore()}var Oo=(e,t,o,i)=>{const r=t.filter(e=>"wedge"===e.type);for(const t of r)if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)To(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(Ho(e,t),X(e,t)),e.globalAlpha=1;else{if(e.fillStyle=nt(e,t.style.fill,"#007bff"),t.roundedEnds){t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1);const o=Ae({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);const i=new Path2D(o);e.fill(i),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(i),e.restore()}else t.cornerRadius?(t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1),Bo(e,t)):(Ho(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(Ho(e,t),X(e,t)),e.globalAlpha=1}},Fo=(e,t,o,i)=>{const r=t.filter(e=>"boxplot"===e.type);for(const t of r){const o=t.columnWidth/2,i="vertical"===t.projection,r=rt(e,"var(--semiotic-primary, #007bff)"),n=rt(e,"var(--semiotic-text, #333)"),s=nt(e,t.style.fill,r),a=t.style.stroke,l="string"==typeof a?rt(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()}},Eo=(e,t,o,i)=>{const r=t.filter(e=>"violin"===e.type);for(const t of r){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);if(e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=nt(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1,t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(o)),t.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;const o=t.iqrLine.centerPos,i=!1!==t.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(o,t.iqrLine.q1Pos),e.lineTo(o,t.iqrLine.q3Pos)):(e.moveTo(t.iqrLine.q1Pos,o),e.lineTo(t.iqrLine.q3Pos,o)),e.stroke(),e.beginPath(),i?e.arc(o,t.iqrLine.medianPos,3,0,2*Math.PI):e.arc(t.iqrLine.medianPos,o,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},No=(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=Ce(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t)e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=rt(e,o.style.stroke)||nt(e,o.style.fill,"")||rt(e,"var(--semiotic-border, #999)"),e.lineWidth=o.style.strokeWidth||1,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1}},Do=(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=Ce(e,t.style?.fill)||"#999",e.fill(),t.style?.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=rt(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()),e.globalAlpha=1}}};function jo(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function Wo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var zo=new Map;function Vo(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=zo.get(o);if(void 0!==i)return i;const r=Ie({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),n=qe(r)?null:r;return zo.set(o,n),n}function Go(e,t,o,i,r,n){e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath()}function $o(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function qo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function Yo(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function Xo(e){return(t,o,i,r)=>{e(t,o.filter(Yo),{x:i.r,y:i.r},r)}}var Qo=Xo(l),Ko=Xo(S),Zo=Xo(I),Uo=Xo(G),Jo=e=>[No,...e],ei={bar:Jo([Qo]),clusterbar:Jo([Qo]),point:Jo([Ko,Zo]),swarm:Jo([Ko,Zo]),pie:[Oo],donut:[Oo],boxplot:Jo([Fo,Ko]),violin:Jo([Eo]),histogram:Jo([Qo]),ridgeline:Jo([Eo]),timeline:Jo([Qo]),funnel:[Qo,Do,(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?jo(r):null!=n?`${jo(r)} (${Wo(n)})`:jo(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=jo(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":[Qo,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of r){const o=("string"==typeof t.style.fill?t.style.fill:null)||rt(e,"var(--semiotic-border, #999)"),i=Vo(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;const n=function(e,t){const[o,i,r]=tt(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,rt(e,"var(--semiotic-text, #333)")),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?qo(r):"",u=$o(i);e.font="bold 13px sans-serif";const d=n?e.measureText(h).width:0;e.font="11px sans-serif";const m=e.measureText(u).width,g=Math.max(d,m)+12,p=n?32:17,f=o.__barFunnelLabelX,y=f-g/2,v=o.__barFunnelLabelY-p-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),Go(e,y,v,g,p,4),e.fill(),e.restore(),e.strokeStyle=a,e.lineWidth=.5,e.beginPath(),Go(e,y,v,g,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px sans-serif",e.fillStyle=l,e.fillText(h,f,v+3),e.font="11px sans-serif",e.fillStyle=c,e.fillText(u,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(u,f,v+3))}e.lineWidth=1}],swimlane:Jo([Qo]),custom:Jo([Qo,Ko,Zo,Uo,Oo,Fo,Eo,Do])};import{jsx as ti,jsxs as oi}from"react/jsx-runtime";function ii(e){const t=lt(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:oi("div",{className:"semiotic-tooltip",style:He,children:[null!=t.title&&ti("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>oi("div",{children:[oi("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function ri({hover:e}){const t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){const e=i||t[0]?.category||"";if(o)return oi("div",{className:"semiotic-tooltip",style:He,children:[e&&ti("div",{style:{fontWeight:"bold"},children:e+""}),oi("div",{children:["n = ",o.n]}),oi("div",{children:["Min: ",o.min.toLocaleString()]}),oi("div",{children:["Q1: ",o.q1.toLocaleString()]}),oi("div",{children:["Median: ",o.median.toLocaleString()]}),oi("div",{children:["Q3: ",o.q3.toLocaleString()]}),oi("div",{children:["Max: ",o.max.toLocaleString()]}),oi("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const r=t.length;return oi("div",{className:"semiotic-tooltip",style:He,children:[e&&ti("div",{style:{fontWeight:"bold"},children:e+""}),oi("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return oi("div",{className:"semiotic-tooltip",style:He,children:[t.category&&ti("div",{style:{fontWeight:"bold"},children:t.category+""}),oi("div",{children:["Count: ",t.count]}),2===e.length&&oi("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const r=e.__oAccessor,n=e.__rAccessor,s=e.__chartType;if("swarm"===s||"point"===s)return ii(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?oi("div",{className:"semiotic-tooltip",style:He,children:[a&&ti("div",{style:{fontWeight:"bold"},children:a+""}),""!==l&&ti("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):ii(t)}ri.ownsChrome=!0;import{jsx as ni,jsxs as si}from"react/jsx-runtime";var ai={top:50,right:40,bottom:60,left:70},li=Nt(Et(function(e,t){const{chartType:o,runtimeMode:i,data:r,oAccessor:n="category",rAccessor:a="value",colorAccessor:l,symbolAccessor:h,symbolMap:u,stackBy:p,groupBy:f,multiAxis:y,timeAccessor:v,valueAccessor:b,categoryAccessor:x,accessorRevision:w,projection:A="vertical",size:k=[600,400],responsiveWidth:S,responsiveHeight:C,margin:P,barPadding:I,roundedTop:H,gradientFill:B,trackFill:O,baselinePadding:F,innerRadius:E,cornerRadius:N,normalize:j,startAngle:W,sweepAngle:z,dynamicColumnWidth:V,bins:G,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:ee,showLabels:oe,connectorAccessor:ie,connectorStyle:re,dataIdAccessor:ne,rExtent:se,oExtent:ae,extentPadding:le=.05,oSort:ce,windowMode:pe="sliding",windowSize:be=200,pieceStyle:xe,summaryStyle:we,renderMode:Ae,colorScheme:ke,barColors:Ce,showAxes:Pe=!0,showCategoryTicks:Re,categoryLabel:Me,valueLabel:Le,categoryFormat:Ie,valueFormat:Te,oLabel:He,rLabel:Oe,oFormat:Ee,rFormat:Ne,rTickValues:De,tickLabelEdgeAlign:je,axisExtent:We,enableHover:ze=!0,hoverAnnotation:Ve,tooltipContent:Ge,customHoverBehavior:qe,customClickBehavior:Xe,onObservation:Qe,annotationObservationCallback:Ke,chartId:Ze,annotations:Ue,onAnnotationActivate:tt,autoPlaceAnnotations:ot,svgAnnotationRules:it,showGrid:rt=!1,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,legendCategoryAccessor:dt,onCategoriesChange:mt,backgroundGraphics:ft,foregroundGraphics:vt,title:bt,className:xt,background:wt,centerContent:At,decay:kt,pulse:Ct,transition:_t,animate:Pt,staleness:Lt,frameScheduler:Et,clock:Nt,random:Dt,seed:jt,paused:Wt=!1,suspendWhenHidden:zt=!0,brush:Vt,onBrush:Gt,accessibleTable:$t=!0,description:qt,summary:Yt,customLayout:Xt,onLayoutError:Qt,layoutConfig:Kt,layoutSelection:Zt}=e,{customHoverBehavior:Ut,customClickBehavior:Jt,hasClickBehavior:eo}=L({customHoverBehavior:qe,customClickBehavior:Xe,onObservation:Qe,chartId:Ze,chartType:"StreamOrdinalFrame"}),to=x??n,oo=b??a,io=It(!0),ro=gt({sizeProp:k,responsiveWidth:S,responsiveHeight:C,userMargin:P,marginDefault:ai,title:bt,legend:nt,legendPosition:ht,animate:Pt,transitionProp:_t,frameScheduler:Et,clock:Nt,random:Dt,seed:jt,paused:Wt,suspendWhenHidden:zt,themeDirtyRef:io}),{reducedMotionRef:no,responsiveRef:so,size:ao,margin:ho,adjustedWidth:uo,adjustedHeight:mo,currentTheme:go,transition:po,introEnabled:fo,tableId:yo,rafRef:vo,renderFnRef:bo,scheduleRender:xo,frameRuntime:wo}=ro,Ao=Rt(),So=Mt(),_o=Bt(()=>Be(r),[r]),Po=Me??He,Ro=Le??Oe,Mo=Ie??Ee,Io=Te??Ne,To=It(null),[Ho,Bo]=Tt(null),[Oo,Fo]=Tt(null),Eo=g(vt,ao,ho,Oo),No=g(ft,ao,ho,Oo),Do=ft||"transparent"===wt?null:ni("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-ho.left,y:-ho.top,width:ao[0],height:ao[1],fill:wt||"var(--semiotic-bg, transparent)"}),[jo,Wo]=Tt(0),zo=It(0),[Vo,Go]=Tt(!1),$o=It({w:-1,h:-1}),qo=It(!1),Yo=yt("StreamOrdinalFrame"),Xo=ze||Ve,Qo="streaming"===i,Ko=Bt(()=>({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:h,symbolMap:u,stackBy:p,groupBy:f,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:We,barPadding:I,roundedTop:H,gradientFill:d(B),trackFill:O,baselinePadding:F,innerRadius:E,cornerRadius:N,normalize:j,startAngle:W,sweepAngle:z,dynamicColumnWidth:V,bins:G,showOutliers:$,showIQR:q,amplitude:X,connectorOpacity:ee,showLabels:oe,connectorAccessor:ie,connectorStyle:re,dataIdAccessor:ne,oSort:ce,pieceStyle:xe,summaryStyle:we,colorScheme:ke,themeCategorical:go?.colors?.categorical,themeSemantic:St(go),themeSequential:go?.colors?.sequential,themeDiverging:go?.colors?.diverging,barColors:Ce,decay:kt,pulse:Ct,transition:po,introAnimation:fo,staleness:Lt,clock:wo.now,customLayout:Xt,onLayoutError:Qt,layoutConfig:Kt,layoutMargin:ho}),[o,Qo,be,pe,le,A,to,oo,w,l,h,u,p,f,y,v,b,se,ae,We,I,H,B,O,F,E,N,j,W,z,V,G,$,q,X,ee,oe,ie,re,ne,ce,xe,we,ke,go,Ce,kt,Ct,po,fo,Lt,wo.now,Xt,Qt,Kt,ho]),Zo=U(Ko),Uo=It(null);Uo.current||(Uo.current=new lo(Zo));const Jo=R(Uo,dt,mt,e=>e.getData());K(Uo,Zo,io,xo),Z(Uo,Zt,io,xo);const ti=It(null);ti.current||(ti.current=new s(e=>{const t=Uo.current;t&&t.ingest(e)&&(io.current=!0,xo())}));const oi=Ot(e=>{ti.current?.push(e)},[]),ii=Ot(e=>{ti.current?.pushMany(e)},[]),li=Ot(()=>{ti.current?.clear(),Uo.current?.clear(),io.current=!0,xo()},[xo]),ci=Ot(e=>{ti.current?.clearLastData(),ti.current?.setReplacementData(e)},[]);Ft(t,()=>({push:oi,pushMany:ii,replace:ci,remove:e=>{ti.current?.flush();const t=Uo.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=Uo.current?.update(e,t)??[];return o.length>0&&(io.current=!0,xo()),o},clear:li,getData:()=>(ti.current?.flush(),Uo.current?.getData()??[]),getScales:()=>Uo.current?.scales??null,getCustomLayout:()=>Uo.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Uo.current?.lastCustomLayoutFailure??null}),[oi,ii,ci,li,xo]),Ht(()=>{r&&ti.current?.setBoundedData(_o)},[r,_o]);const{canvasRef:hi}=pt(ro,{storeRef:Uo,dirtyRef:io,hydrated:Ao,wasHydratingFromSSR:So,cleanup:()=>ti.current?.clear(),canvasPaintDependencies:[o,uo,mo,Pe,wt,ft,Ae,xo]}),{hoverHandlerRef:ui,hoverLeaveRef:di,onPointerMove:mi,onPointerLeave:gi}=ro;ui.current=e=>{if(!Xo)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>mo)return void(To.current&&(To.current=null,Bo(null),Ut&&Ut(null),xo()));const s=Uo.current;if(!s||0===s.scene.length)return;const a="radial"===A,l=co(s.scene,a?r-uo/2:r,a?n-mo/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?.(c),xo()},di.current=()=>{To.current&&(To.current=null,Bo(null),Ut?.(null),xo())};const pi=Ot(e=>{if($e(e.target))return;if(!Jt)return;const t=hi.current;if(!t)return Jt(null),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>mo)return Jt(null),void xo();const s=Uo.current;if(!s||0===s.scene.length)return Jt(null),void xo();const a="radial"===A,l=co(s.scene,a?r-uo/2:r,a?n-mo/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return Jt(null),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:Je(e.nativeEvent.pointerType)}),xo()},[Jt,hi,ho.left,ho.top,uo,mo,A,to,oo,o,xo]),{kbFocusIndexRef:fi,focusedNavPointRef:yi,onKeyDown:vi}=M({storeRef:Uo,hoverRef:To,setHoverPoint:Bo,customHoverBehavior:Ut,customClickBehavior:Jt,scheduleRender:xo,chartType:o,oAccessor:to,rAccessor:oo}),bi=Ot(e=>{fi.current=-1,yi.current=null,mi(e)},[yi,fi,mi]);bo.current=()=>{if(vo.current=null,!wo.isActive)return;const e=hi.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=Uo.current;if(!i)return;const r=wo.now(),n=i.advanceTransition(no.current?r+1e6:r),s=!no.current&&n,a=$o.current.w!==uo||$o.current.h!==mo,l=io.current;let c=!1;const h=Yo.current.beforeCompute(i.getLastUpdateResult(),s);!l&&!a||s&&!a||(i.computeScene({width:uo,height:mo}),$o.current={w:uo,h:mo},c=!0,Jo()),Yo.current.afterCompute(h,c,a),io.current=l&&s&&!c;const u=_(i,r,c,qo);(c||s)&&e.setAttribute("aria-label",_e(i.scene,o+" chart"));const d=Fe(),m=ao[0]*d,g=ao[1]*d;e.width===m&&e.height===g||(e.width=m,e.height=g,e.style.width=ao[0]+"px",e.style.height=ao[1]+"px"),t.setTransform(d,0,0,d,0,0),t.clearRect(0,0,ao[0],ao[1]);const p=Lt&&i.lastIngestTime>0&&r-i.lastIngestTime>(Lt?.threshold??5e3);p&&(t.globalAlpha=Lt?.dimOpacity??.5);const f="radial"===A;t.save(),t.beginPath(),t.rect(ho.left,ho.top,uo,mo),t.clip(),f?(t.save(),t.translate(ho.left+uo/2,ho.top+mo/2)):t.translate(ho.left,ho.top);const y=Xt?ei.custom:ei[o]||[],v={width:uo,height:mo},b=i.scales;b&&Y({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?(Fo(i.scales),Wo(e=>e+1),zo.current=r):s&&i.scales&&r-zo.current>=33&&(Wo(e=>e+1),zo.current=r),Lt?.showBadge&&Go(!!p),(s||null!=i.activeTransition||u.pending)&&xo()},J(Lt,Uo,io,xo,Vo,Go);const xi=Xo&&Ho?Ge?Ge(Ho):ni(ri,{hover:Ho}):null,wi="radial"===A,Ai=xi?ni(me,{x:Ho?wi?Ho.x+uo/2:Ho.x:0,y:Ho?wi?Ho.y+mo/2:Ho.y:0,containerWidth:uo,containerHeight:mo,margin:ho,className:"stream-ordinal-tooltip",children:xi}):null,ki="horizontal"===A?to:oo,Si=m("horizontal"===A?oo:to,void 0,"__semiotic_resolvedO",""),Ci=m(ki,void 0,"__semiotic_resolvedR",""),_i=Si.key,Pi=Ci.key,Ri=c(Si,Ci,Ue&&Ue.length>0||!1);if(Ye||!Ao&&So){const e=Uo.current;e&&r&&(e.ingest({inserts:_o,bounded:!0}),e.computeScene({width:uo,height:mo}));const t=e?.scene??[],o=e?.scales??null,i=g(vt,ao,ho,o),n=g(ft,ao,ho,o),s="radial"===A,a=s?ho.left+uo/2:ho.left,l=s?ho.top+mo/2:ho.top;return si("div",{ref:so,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:S?"100%":ao[0],height:C?"100%":ao[1]},children:[ni(ye,{summary:Yt}),si("svg",{xmlns:"http://www.w3.org/2000/svg",width:ao[0],height:ao[1],style:{position:"absolute",left:0,top:0},children:[n&&ni("g",{transform:`translate(${ho.left},${ho.top})`,children:n}),si("g",{transform:`translate(${a},${l})`,children:[wt&&ni("rect",{x:0,y:0,width:uo,height:mo,fill:wt}),t.map((e,t)=>Q({node:e,index:t,renderMode:Ae,fallback:()=>et(e,t,yo)})).filter(Boolean)]})]}),ni(Co,{width:uo,height:mo,totalWidth:ao[0],totalHeight:ao[1],margin:ho,scales:o,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Ro,oFormat:Mo,rFormat:Io,rTickValues:De,tickLabelEdgeAlign:je,axisExtent:We,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:D(i,te(Uo.current?.customLayoutOverlays,Zt??null)),annotations:Ue,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:0,xAccessor:_i,yAccessor:Pi,annotationData:Ri(e?.getData())}),At&&"radial"===A&&ni("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+mo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:At})]})}return si("div",{ref:so,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%":ao[0],height:C?"100%":ao[1],overflow:"visible"},onKeyDown:vi,children:["production"!==process.env.NODE_ENV&&Uo.current&&ni(fe,{store:Uo.current,diagnostics:Yo.current}),$t&&ni(ve,{tableId:yo}),$t&&ni(he,{scene:Uo.current?.scene??[],chartType:o+" chart",tableId:yo,chartTitle:"string"==typeof bt?bt:void 0}),ni(ye,{summary:Yt}),ni(ue,{hoverPoint:Ho}),si("div",{role:"img","aria-label":qt||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Xo?bi:void 0,onMouseLeave:Xo?gi:void 0,onClick:eo?pi:void 0,children:[si(de,{size:ao,margin:ho,children:[Do,No]}),ni(ko,{width:uo,height:mo,totalWidth:ao[0],totalHeight:ao[1],margin:ho,scales:Oo,showAxes:Pe,showGrid:rt,rFormat:Io,rTickValues:De,axisExtent:We}),ni("canvas",{ref:hi,"aria-label":_e(Uo.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:ao[0],height:ao[1]}}),ni(Co,{width:uo,height:mo,totalWidth:ao[0],totalHeight:ao[1],margin:ho,scales:Oo,showAxes:Pe,showCategoryTicks:Re,oLabel:Po,rLabel:Ro,oFormat:Mo,rFormat:Io,rTickValues:De,axisExtent:We,showGrid:rt,title:bt,legend:nt,legendHoverBehavior:st,legendClickBehavior:at,legendHighlightedCategory:lt,legendIsolatedCategories:ct,legendPosition:ht,legendLayout:ut,foregroundGraphics:D(Eo,te(Uo.current?.customLayoutOverlays,Zt??null)),annotations:Ue,onAnnotationActivate:tt,onObservation:Ke??Qe,chartId:Ze,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:ot,svgAnnotationRules:it,annotationFrame:jo,xAccessor:_i,yAccessor:Pi,annotationData:Ri(Uo.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(Vt||Gt)&&"radial"!==A&&ni(Lo,{width:uo,height:mo,totalWidth:ao[0],totalHeight:ao[1],margin:ho,scales:Oo,onBrush:Gt||(()=>{})}),At&&"radial"===A&&ni("div",{style:{position:"absolute",left:ho.left+uo/2,top:ho.top+mo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:At}),Lt?.showBadge&&ni(T,{isStale:Vo,position:Lt.badgePosition}),ni(ge,{active:fi.current>=0,hoverPoint:Ho,margin:ho,size:ao,shape:yi.current?.shape,width:yi.current?.w,height:yi.current?.h}),Ai]})]})}));li.displayName="StreamOrdinalFrame";var ci=li;import{forwardRef as hi,useMemo as ui}from"react";import{jsx as di}from"react/jsx-runtime";var mi=hi(function(e,t){const{data:o,layout:r,layoutConfig:n,onLayoutError:s,categoryAccessor:a="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:m,colorBy:g,colorScheme:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:A,loading:k,loadingContent:S,emptyContent:C,frameProps:_={}}=e,{frameRef:P,resolved:R,safeData:M,setup:L,earlyReturn:I}=i({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:g,colorScheme:p,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:A,loading:k,loadingContent:S,emptyContent:C,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=L.effectiveSelectionHook,H=ui(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]);if(I)return I;const{width:F,height:E,enableHover:N,showGrid:D,title:j,description:W,summary:z,accessibleTable:V}=R,G={chartType:"custom",...null!=o&&{data:M},customLayout:r,layoutConfig:n,onLayoutError:s,...H&&{layoutSelection:H},oAccessor:a,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:g,colorScheme:p,size:[F,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:L.margin,enableHover:N,showAxes:f,showGrid:D,annotations:y,...B({title:j,description:W,summary:z,accessibleTable:V,className:m,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...O({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:L.mobileInteraction,customHoverBehavior:L.customHoverBehavior,customClickBehavior:L.customClickBehavior}),..._};return di(Pt,{componentName:"OrdinalCustomChart",width:F,height:E,children:di(ci,{ref:P,...G})})});mi.displayName="OrdinalCustomChart";import{useMemo as gi,forwardRef as pi,useRef as fi}from"react";import{useImperativeHandle as yi}from"react";function vi({ref:e,frameRef:t,setup:o}){return yi(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}import{useMemo as bi}from"react";function xi(e){const{colorBy:o,colorScale:i,color:r,themeCategorical:n,colorScheme:s,categoryIndexMap:a,userPieceStyle:l,stroke:c,strokeWidth:h,opacity:u,effectiveSelectionHook:d,resolvedSelection:m,cycleByCategory:g=!1,baseStyleExtras:p,linkStrokeToFill:f=!1,styleRules:y,resolveRuleValue:v}=e,b=bi(()=>(e,t)=>{const l="function"==typeof p?p(e,t):p,c=l?{...l}:{};if(void 0===c.fill)if(o){if(!i)return c;c.fill=Oe(e,o,i)}else c.fill=st(r,n,s,g?t:void 0,a);if(y&&y.length>0){const o=ae(e,y,{value:v?v(e):void 0,category:t});Object.assign(c,o)}return f&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[o,i,r,n,s,a,g,p,f,y,v]),x=bi(()=>t(l?"function"==typeof l?(e,t)=>({...b(e,t),...l(e,t)||{}}):(e,t)=>({...b(e,t),...l}):b,{stroke:c,strokeWidth:h,opacity:u}),[b,l,c,h,u]);return bi(()=>wt(x,d??null,m),[x,d,m])}import{jsx as wi}from"react/jsx-runtime";var Ai=pi(function(t,i){const r=mt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),s=fi(null),{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=40,roundedTop:b,gradientFill:x=!1,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,regression:C,valueExtent:_,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:F,loadingContent:D,emptyContent:j,legendInteraction:W,legendPosition:z,color:V,stroke:G,strokeWidth:$,opacity:q,showCategoryTicks:Y,categoryFormat:X,dataIdAccessor:Q}=t,{width:K,height:Z,enableHover:U,showGrid:J,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:re,categoryLabel:ne,valueLabel:ae}=r,le=gi(()=>Be(a),[a]),ce=o({data:le,rawData:a,colorBy:p,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BarChart",chartId:H,showLegend:ee,userMargin:l,marginDefaults:r.marginDefaults,loading:F,loadingContent:D,emptyContent:j,width:K,height:Z,hasTitle:!!te,axisChrome:at({showAxes:r.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ne,hasValueLabel:!!ae})}),{effectiveLegendProps:he,effectiveMargin:ue}=vi({ref:i,frameRef:s,setup:ce});Lt("BarChart",le,"categoryAccessor",h),Lt("BarChart",le,"valueAccessor",u);const de=vt(le,y,u),me=bt(),ge=gi(()=>new Map,[]),pe=gi(()=>se(u),[u]),fe=xi({colorBy:p,colorScale:ce.colorScale,color:V,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:P?.pieceStyle,stroke:G,strokeWidth:$,opacity:q,styleRules:w,resolveRuleValue:pe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),ye=gi(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:p&&p!==h?p:void 0,groupLabel:"string"==typeof p?p:"group",valueFormat:g}),[h,u,p,g]),ve=gi(()=>d(x),[x]);if(ce.earlyReturn)return ce.earlyReturn;const be=n({componentName:"BarChart",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(be)return wi(_t,{componentName:"BarChart",message:be,width:K,height:Z});const xe=e(C),we=xe?[xe,...S||[]]:S,Ae={chartType:"bar",...null!=a&&{data:de},oAccessor:h,rAccessor:u,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:fe,size:[K,Z],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ue,barPadding:v,...null!=b&&{roundedTop:b},...ve&&{gradientFill:ve},...Q&&{dataIdAccessor:Q},baselinePadding:A,enableHover:U,showAxes:r.showAxes,oLabel:ne,rLabel:ae,rFormat:g,...X&&{oFormat:X},showGrid:J,showCategoryTicks:Y,oSort:y,...he,...B({title:te,description:oe,summary:ie,accessibleTable:re,className:c,animate:t.animate,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...N({tooltip:k,defaultTooltipContent:ye}),...O({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},..._&&{rExtent:_},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return wi(Pt,{componentName:"BarChart",width:K,height:Z,children:wi(ci,{ref:s,...Ae})})});Ai.displayName="BarChart";import{useMemo as ki,forwardRef as Si,useRef as Ci}from"react";import{jsx as _i}from"react/jsx-runtime";var Pi=Si(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=Ci(null),{data:s,margin:a,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,normalize:y=!1,sort:v=!1,barPadding:b=40,roundedTop:x,gradientFill:w,styleRules:A,baselinePadding:k=!1,tooltip:S,annotations:C,valueExtent:_,frameProps:P={},selection:R,linkedHover:M,onObservation:L,onClick:I,hoverHighlight:T,chartId:H,loading:F,loadingContent:D,emptyContent:j,legendInteraction:W,legendPosition:z,color:V,stroke:G,strokeWidth:$,opacity:q,categoryFormat:Y}=e,{width:X,height:Q,enableHover:K,showGrid:Z,showLegend:U,title:J,description:ee,summary:te,accessibleTable:oe,categoryLabel:ie,valueLabel:re}=i,ne=ki(()=>Be(s),[s]),ae=p||h,le=o({data:ne,rawData:s,colorBy:ae,colorScheme:f,legendInteraction:W,legendPosition:z,selection:R,linkedHover:M,fallbackFields:ae?["string"==typeof ae?ae:""]:[],unwrapData:!0,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:U,userMargin:a,marginDefaults:i.marginDefaults,loading:F,loadingContent:D,emptyContent:j,width:X,height:Q,hasTitle:!!J,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ie,hasValueLabel:!!re})}),ce=bt(),he=ki(()=>new Map,[]),ue=ki(()=>se(u),[u]),de=xi({colorBy:ae,colorScale:le.colorScale,color:V,themeCategorical:ce,colorScheme:f,categoryIndexMap:he,userPieceStyle:P?.pieceStyle,stroke:G,strokeWidth:$,opacity:q,styleRules:A,resolveRuleValue:ue,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),me=ki(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ge=n({componentName:"StackedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:pe,effectiveMargin:fe}=vi({ref:t,frameRef:r,setup:le}),ye=ki(()=>d(w),[w]);if(le.earlyReturn)return le.earlyReturn;const ve={chartType:"bar",...null!=s&&{data:ne},oAccessor:c,rAccessor:u,stackBy:h,normalize:y,oSort:v,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:de,size:[X,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe,barPadding:b,...null!=x&&{roundedTop:x},...ye&&{gradientFill:ye},baselinePadding:k,enableHover:K,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ie,rLabel:re,rFormat:g,...Y&&{oFormat:Y},showGrid:Z,...pe,...B({title:J,description:ee,summary:te,accessibleTable:oe,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:S,defaultTooltipContent:me}),...O({linkedHover:M,selection:R,onObservation:L,onClick:I,hoverHighlight:T,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),...C&&C.length>0&&{annotations:C},..._&&{rExtent:_},...Object.fromEntries(Object.entries(P).filter(([e])=>"pieceStyle"!==e))};return ge?_i(_t,{componentName:"StackedBarChart",message:ge,width:X,height:Q}):_i(Pt,{componentName:"StackedBarChart",width:X,height:Q,children:_i(ci,{ref:r,...ve})})});Pi.displayName="StackedBarChart";import*as Ri from"react";import{useMemo as Mi,useCallback as Li,forwardRef as Ii,useRef as Ti,useImperativeHandle as Hi}from"react";import{useRef as Bi,useState as Oi,useCallback as Fi,useMemo as Ei}from"react";import{useMemo as Ni,useCallback as Di,useRef as ji}from"react";var Wi={RdBu:We,PiYG:je,PRGn:De,BrBG:Ne,RdYlBu:ze,RdYlGn:Ve,Spectral:Ge},zi="__likert_neutral_neg",Vi="__likert_neutral_pos";function Gi(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function $i(e,t,o,i,r,n){const 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 qi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===r){const e=t.__likertPct/2;n.push({...t,__likertLevel:zi,__likertPct:-e}),n.push({...t,__likertLevel:Vi,__likertPct:e})}else n.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return n}function Yi(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===zi?n=o:o.__likertLevel===Vi?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 Xi=["Very Low","Low","Neutral","High","Very High"];import{jsx as Qi}from"react/jsx-runtime";var Ki=new Map,Zi=Ii(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=Ti(null),{data:s,margin:a,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:u,countAccessor:d="count",levels:m=Xi,orientation:g="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:C,chartId:_,valueFormat:P,loading:R,loadingContent:M,emptyContent:L,legendInteraction:I,legendPosition:T,categoryFormat:H,stroke:B,strokeWidth:F,opacity:E}=e,{width:N,height:D,enableHover:j,showGrid:W,showLegend:z,title:V,description:G,summary:$,accessibleTable:q,categoryLabel:Y,valueLabel:X}=i,Q="horizontal"===g,K=void 0===s,Z=!u,U=xt(),J=Mi(()=>p&&Array.isArray(p)&&p.length>=m.length?p:function(e,t){if(0>=e)return[];if(t){const o=Wi[t];if(o){if(1===e)return[o(.5)];const t=[];for(let i=0;e>i;i++)t.push(o(i/(e-1)));return t}}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];const n=e%2!=0,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}(m.length,U),[p,m.length,U]),ee=Mi(()=>{const e=new Map;for(let t=0;m.length>t;t++)e.set(m[t],J[t]||"#888");return e},[m,J]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:n,isDiverging:s,frameRef:a}){const l=!r,c=Ni(()=>Gi(o,"question"),[o]),h=Ni(()=>l?Gi(i,"score"):null,[l,i]),u=Ni(()=>l?null:Gi(r,"level"),[l,r]),d=Ni(()=>l?null:Gi(n,"count"),[l,n]),m=ji([]);return{processedData:Ni(()=>{const o=e||[];if(0===o.length)return[];let i=$i(o,t,c,h,u,d);return s&&(i=qi(i,t),i=Yi(i,t)),i},[e,t,c,h,u,d,s]),reAggregate:Di(e=>{let o=$i(e,t,c,h,u,d);s&&(o=qi(o,t),o=Yi(o,t)),a.current?.replace(o)},[t,c,h,u,d,s,a]),accumulatorRef:m}}({data:s,levels:m,categoryAccessor:c,valueAccessor:h,levelAccessor:u,countAccessor:d,isDiverging:Q,frameRef:r}),re="__likertLevelLabel",ne=function({isPushMode:e,colorBy:t,colorScheme:o,showLegend:i,legendPosition:r="right"}){const n=Bi(new Set),s=Bi([]),[a,l]=Oi(0),c=dt(),h=bt(),u=Fi(e=>{if(!t)return null;const o="function"==typeof t?t(e):e[t];return null!=o?o+"":null},[t]),d=Fi(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]),m=Fi(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]),g=Fi(e=>t=>{d([t]),e(t)},[d]),p=Fi(e=>t=>{d(t),e(t)},[d]),f=Fi(()=>{n.current=new Set,s.current=[],l(e=>e+1)},[]);ft(e&&t?s.current:[]);const y=Ei(()=>{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:pe,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:Oe})},[e,t,i,o,c,h,a]),v=Ei(()=>{if(y)return"right"===r?{right:110}:"left"===r?{left:110}:"top"===r?{top:50}:"bottom"===r?{bottom:80}:{right:110}},[y,r]);return{wrapPush:g,wrapPushMany:p,resetCategories:f,categories:s.current,categoryDomainProps:e&&t?{legendCategoryAccessor:t,onCategoriesChange:m}:{},streamingLegend:y,streamingMarginAdjust:v}}({isPushMode:K,colorBy:re,colorScheme:J,showLegend:z,legendPosition:T}),{wrapPush:se,wrapPushMany:ae}=ne,le=Li(e=>se(e=>{ie.current.push(e),oe(ie.current)})(e),[se,oe,ie]),ce=Li(e=>ae(e=>{ie.current.push(...e),oe(ie.current)})(e),[ae,oe,ie]);Hi(t,()=>({push:le,pushMany:ce,remove:e=>r.current?.remove(e)??[],update:(e,t)=>r.current?.update(e,t)??[],replace:e=>r.current?.replace(e),clear:()=>{ie.current=[],ne.resetCategories(),r.current?.clear()},getData:()=>r.current?.getData()??[],getScales:()=>r.current?.getScales()??null}),[le,ce,ie,ne]);const he=o({data:te,rawData:s,colorBy:re,colorScheme:J,legendInteraction:I,legendPosition:T,selection:w,linkedHover:A,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:C,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"LikertChart",chartId:_,showLegend:z,userMargin:a,marginDefaults:i.marginDefaults,loading:R,loadingContent:M,emptyContent:L,width:N,height:D,hasTitle:!!V,axisChrome:{hasAxis:!1!==i.showAxes,hasAxisLabel:Q?!!X:!!Y}}),ue=Mi(()=>{const e=m.length;return e%2!=0&&ee.get(m[Math.floor(e/2)])||"#888"},[m,ee]),de=xi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:Ki,userPieceStyle:x?.pieceStyle,stroke:B,strokeWidth:F,opacity:E,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===zi||o===Vi)return{fill:ue};const i=t||o;return i&&ee.has(i)?{fill:ee.get(i)}:{fill:"#888"}}}),me=Mi(()=>{const e=m.length;return e%2!=0?m[Math.floor(e/2)]:""},[m]),ge=Mi(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===zi||o===Vi?me:o,r=t.__likertCategory||"",n=Math.abs(t.__likertPct||0),s=o===zi||o===Vi?2*n:n,a=t.__likertCount||0;return Ri.createElement("div",{className:"semiotic-tooltip",style:He},Ri.createElement("div",{style:{fontWeight:"bold"}},r),Ri.createElement("div",{style:{marginTop:4}},`${i}: ${s.toFixed(1)}% (n=${a})`))},[me]),fe=Mi(()=>{if(!m||2>m.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&u)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(u&&!d)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==s&&0===s.length)return null;const e={categoryAccessor:c};return Z?h&&(e.valueAccessor=h):(u&&(e.levelAccessor=u),d&&(e.countAccessor=d)),n({componentName:"LikertChart",data:s,accessors:e,requiredProps:{levels:m}})},[s,c,h,u,d,m,Z]),ye=Mi(()=>[{styleFn:e=>({fill:ee.get(e.label)||"#888"}),items:m.map(e=>({label:e})),label:""}],[m,ee]),ve=Mi(()=>!1!==z?{...he.legendBehaviorProps,legend:{legendGroups:ye},legendPosition:T||he.legendPosition||"bottom"}:he.legendBehaviorProps,[he.legendBehaviorProps,he.legendPosition,T,z,ye]),be=Mi(()=>{const e={...he.margin};if(K&&!1!==z){const t=T||"bottom";"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(ne.streamingMarginAdjust)for(const[t,o]of Object.entries(ne.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Q&&100>e.left&&(e.left=100),e},[he.margin,ne.streamingMarginAdjust,Q,K,z,T]),xe=Mi(()=>P||(Q?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Q,P]);if(he.earlyReturn)return he.earlyReturn;const we={chartType:"bar",...null!=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:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:Y,rLabel:X||(Q?void 0:"Percentage"),rFormat:xe,...H&&{oFormat:H},showGrid:W,...ve,...V&&{title:V},...G&&{description:G},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===y?()=>null:!0===y?ge:Ze(y)||ge,...O({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:C,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fe?Qi(_t,{componentName:"LikertChart",message:fe,width:N,height:D}):Qi(Pt,{componentName:"LikertChart",width:N,height:D,children:Qi(ci,{ref:r,...we})})});Zi.displayName="LikertChart";import{useMemo as Ui,forwardRef as Ji,useRef as er}from"react";import{useCallback as tr,useMemo as or,useRef as ir}from"react";function rr({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const r=or(()=>Ke("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),n="string"==typeof i?i:"value",s=ut({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||n}),a=ir(s.brushInteraction);a.current=s.brushInteraction;const l=tr(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 nr}from"react/jsx-runtime";var sr=Ji(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=er(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,sizeBy:f,sizeRange:y=[3,8],symbolBy:v,symbolMap:b,pointRadius:x=4,pointOpacity:w=.7,categoryPadding:A=20,tooltip:k,annotations:S,valueExtent:C,brush:_,onBrush:P,linkedBrush:R,frameProps:M={},selection:L,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:F,chartId:D,loading:j,loadingContent:W,emptyContent:z,legendInteraction:V,legendPosition:G,color:$,stroke:q,strokeWidth:Y,opacity:X,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}=i,le=Ui(()=>Be(a),[a]),ce=o({data:le,rawData:a,colorBy:g,colorScheme:p,legendInteraction:V,legendPosition:G,selection:L,linkedHover:I,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:F,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwarmPlot",chartId:D,showLegend:te,userMargin:l,marginDefaults:i.marginDefaults,loading:j,loadingContent:W,emptyContent:z,width:Z,height:U,hasTitle:!!oe,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!se,hasValueLabel:!!ae})}),he=rr({brushProp:_,onBrushProp:P,linkedBrush:R,valueAccessor:u}),ue=Ui(()=>{if(!f)return;const e=le.map(e=>"function"==typeof f?f(e):e[f]);return kt(e)},[le,f]),de=bt(),me=Ui(()=>new Map,[]),ge=xi({colorBy:g,colorScale:ce.colorScale,color:$,themeCategorical:de,colorScheme:p,categoryIndexMap:me,userPieceStyle:M?.pieceStyle,stroke:q,strokeWidth:Y,opacity:X,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:w,r:f?Ee(e,f,y,ue):x})}),pe=Ui(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:g||void 0,valueFormat:m}),[h,u,g,m]);if(ce.earlyReturn)return ce.earlyReturn;const fe=n({componentName:"SwarmPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(fe)return nr(_t,{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:ge,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:A,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:se,rLabel:ae,rFormat:m,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...B({title:oe,description:ie,summary:re,accessibleTable:ne,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:k,defaultTooltipContent:pe}),...O({linkedHover:I,selection:L,onObservation:T,onClick:H,hoverHighlight:F,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...S&&S.length>0&&{annotations:S},...C&&{rExtent:C},...he.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return nr(Pt,{componentName:"SwarmPlot",width:Z,height:U,children:nr(ci,{ref:s,...ye})})});sr.displayName="SwarmPlot";import{useMemo as ar,forwardRef as lr,useRef as cr}from"react";import{jsx as hr,jsxs as ur}from"react/jsx-runtime";function dr(e){return t=>{const o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return ur("div",{className:"semiotic-tooltip",style:He,children:[o&&hr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&ur("div",{children:["n = ",i.n]}),null!=i.min&&ur("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&ur("div",{children:["Q1: ",i.q1.toLocaleString()]}),ur("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&ur("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&ur("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&ur("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),n=r.length,s=n>0?n%2!=0?r[Math.floor(n/2)]:(r[n/2-1]+r[n/2])/2:null;return ur("div",{className:"semiotic-tooltip",style:He,children:[o&&hr("div",{style:{fontWeight:"bold"},children:o+""}),n>0&&ur("div",{children:["n = ",n]}),null!=s&&ur("div",{children:["Median: ",s.toLocaleString()]})]})}return hr("div",{className:"semiotic-tooltip",style:He,children:hr("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as mr}from"react/jsx-runtime";var gr=lr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=cr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:m,colorBy:g,colorScheme:p,showOutliers:f=!0,outlierRadius:y=3,categoryPadding:v=20,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:C,onClick:_,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:F,stroke:E,strokeWidth:D,opacity:j,showCategoryTicks:W,categoryFormat:z}=e,{width:V,height:G,enableHover:$,showGrid:q,showLegend:Y,title:X,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=ar(()=>Be(a),[a]),te=o({data:ee,rawData:a,colorBy:g,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BoxPlot",chartId:R,showLegend:Y,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:V,height:G,hasTitle:!!X,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=bt(),ie=ar(()=>new Map,[]),re=xi({colorBy:g,colorScale:te.colorScale,color:F,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:E,strokeWidth:D,opacity:j,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ne=ar(()=>dr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=n({componentName:"BoxPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return mr(_t,{componentName:"BoxPlot",message:se,width:V,height:G});const ae={chartType:"boxplot",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,showOutliers:f,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:m,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,...te.legendBehaviorProps,...B({title:X,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:ne}),...O({linkedHover:S,selection:k,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return mr(Pt,{componentName:"BoxPlot",width:V,height:G,children:mr(ci,{ref:s,...ae})})});gr.displayName="BoxPlot";import{useMemo as pr,forwardRef as fr,useRef as yr}from"react";import{jsx as vr,jsxs as br}from"react/jsx-runtime";var xr=e=>{const t=e?.category;return null==t?"All":t+""},wr=fr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=yr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h=xr,valueAccessor:u="value",bins:d=25,relative:m=!1,valueFormat:g,colorBy:p,colorScheme:f,categoryPadding:y=("sparkline"===i.mode?0:20),tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:A,linkedBrush:k,frameProps:S={},selection:C,linkedHover:_,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:F,legendPosition:E,color:D,stroke:j,strokeWidth:W,opacity:z,showCategoryTicks:V,categoryFormat:G}=e,{width:$,height:q,enableHover:Y,showGrid:X,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=i,oe=pr(()=>Be(a),[a]),ie=o({data:oe,rawData:a,colorBy:p,colorScheme:f,legendInteraction:F,legendPosition:E,selection:C,linkedHover:_,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"Histogram",chartId:L,showLegend:Q,userMargin:l,marginDefaults:i.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q,hasTitle:!!K,axisChrome:at({showAxes:i.showAxes,projection:"horizontal",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=rr({brushProp:w,onBrushProp:A,linkedBrush:k,valueAccessor:u}),ne=pr(()=>{if(0===oe.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of oe){const r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[oe,u]),se=bt(),ae=pr(()=>new Map,[]),le=xi({colorBy:p,colorScale:ie.colorScale,color:D,themeCategorical:se,colorScheme:f,categoryIndexMap:ae,userPieceStyle:void 0,stroke:j,strokeWidth:W,opacity:z,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=pr(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return br("div",{className:"semiotic-tooltip",style:He,children:[o&&vr("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&br("div",{children:["Count: ",i]}),r&&2===r.length&&br("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=n({componentName:"Histogram",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(he)return vr(_t,{componentName:"Histogram",message:he,width:$,height:q});const ue={chartType:"histogram",...null!=a&&{data:oe},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:le,bins:d,normalize:m,...x?{rExtent:x}:ne&&{rExtent:ne},size:[$,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:Y,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:ee,rLabel:te,rFormat:g,...G&&{oFormat:G},showGrid:X,showCategoryTicks:V,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:v,defaultTooltipContent:ce}),...O({linkedHover:_,selection:C,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return vr(Pt,{componentName:"Histogram",width:$,height:q,children:vr(ci,{ref:s,...ue})})});wr.displayName="Histogram";import{useMemo as Ar,forwardRef as kr,useRef as Sr}from"react";import{jsx as Cr}from"react/jsx-runtime";var _r=kr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Sr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",bins:m=25,curve:g="catmullRom",showIQR:p=!0,valueFormat:f,colorBy:y,colorScheme:v,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,brush:k,onBrush:S,linkedBrush:C,frameProps:_={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:F,emptyContent:E,legendInteraction:D,legendPosition:j,color:W,stroke:z,strokeWidth:V,opacity:G,showCategoryTicks:$,categoryFormat:q}=e,{width:Y,height:X,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,re=Ar(()=>Be(a),[a]),ne=o({data:re,rawData:a,colorBy:y,colorScheme:v,legendInteraction:D,legendPosition:j,selection:P,linkedHover:R,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:l,marginDefaults:i.marginDefaults,loading:H,loadingContent:F,emptyContent:E,width:Y,height:X,hasTitle:!!U,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),se=rr({brushProp:k,onBrushProp:S,linkedBrush:C,valueAccessor:u}),ae=bt(),le=Ar(()=>new Map,[]),ce=xi({colorBy:y,colorScale:ne.colorScale,color:W,themeCategorical:ae,colorScheme:v,categoryIndexMap:le,userPieceStyle:void 0,stroke:z,strokeWidth:V,opacity:G,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=Ar(()=>dr({valueAccessor:u}),[u]);if(ne.earlyReturn)return ne.earlyReturn;const ue=n({componentName:"ViolinPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(ue)return Cr(_t,{componentName:"ViolinPlot",message:ue,width:Y,height:X});const de={chartType:"violin",...null!=a&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ce,bins:m,showIQR:p,size:[Y,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:b,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:f,...q&&{oFormat:q},showGrid:K,showCategoryTicks:$,...ne.legendBehaviorProps,...B({title:U,description:J,summary:ee,accessibleTable:te,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:he}),...O({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(_).filter(([e])=>"pieceStyle"!==e))};return Cr(Pt,{componentName:"ViolinPlot",width:Y,height:X,children:Cr(ci,{ref:s,...de})})});_r.displayName="ViolinPlot";import{useMemo as Pr,forwardRef as Rr,useRef as Mr}from"react";import{jsx as Lr}from"react/jsx-runtime";var Ir=Rr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Mr(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="horizontal",bins:m=20,amplitude:g=1.5,valueFormat:p,colorBy:f,colorScheme:y,categoryPadding:v=5,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:C,onClick:_,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:F,stroke:E,strokeWidth:D,opacity:j,showCategoryTicks:W,categoryFormat:z}=e,{width:V,height:G,enableHover:$,showGrid:q,showLegend:Y,title:X,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=i,ee=Pr(()=>Be(a),[a]),te=o({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:C,onClick:_,hoverHighlight:P,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RidgelinePlot",chartId:R,showLegend:Y,userMargin:l,marginDefaults:i.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:V,height:G,hasTitle:!!X,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===d?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),oe=bt(),ie=Pr(()=>new Map,[]),re=xi({colorBy:f,colorScale:te.colorScale,color:F,themeCategorical:oe,colorScheme:y,categoryIndexMap:ie,userPieceStyle:void 0,stroke:E,strokeWidth:D,opacity:j,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),ne=Pr(()=>dr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=n({componentName:"RidgelinePlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return Lr(_t,{componentName:"RidgelinePlot",message:se,width:V,height:G});const ae={chartType:"ridgeline",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,bins:m,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:U,rLabel:J,rFormat:p,...z&&{oFormat:z},showGrid:q,showCategoryTicks:W,oSort:!1,amplitude:g,...te.legendBehaviorProps,...B({title:X,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:ne}),...O({linkedHover:S,selection:k,onObservation:C,onClick:_,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return Lr(Pt,{componentName:"RidgelinePlot",width:V,height:G,children:Lr(ci,{ref:s,...ae})})});Ir.displayName="RidgelinePlot";import{useMemo as Tr,forwardRef as Hr,useRef as Br}from"react";import{jsx as Or,jsxs as Fr}from"react/jsx-runtime";var Er=Hr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Br(null);r(t,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:m,colorScheme:g,orientation:p="horizontal",connectorOpacity:f=.3,showLabels:y=!0,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:C,chartId:_,loading:P,loadingContent:R,emptyContent:M,legendInteraction:L,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,categoryFormat:E}=e,N="vertical"===p,{width:D,height:j,enableHover:W,showLegend:z,title:V,description:G,summary:$,accessibleTable:q}=i,Y=N?{top:V?60:40,right:20,bottom:60,left:60}:{top:V?40:10,right:10,bottom:10,left:10},X=Tr(()=>Be(a),[a]),Q=m||d,K=!Q,Z=o({data:X,rawData:a,colorBy:Q,colorScheme:g,legendInteraction:L,legendPosition:I,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:C,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FunnelChart",chartId:_,showLegend:z,userMargin:l,marginDefaults:Y,loading:P,loadingContent:R,emptyContent:M,width:D,height:j,hasTitle:!!V,axisChrome:at({showAxes:N,projection:N?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Lt("FunnelChart",X,"stepAccessor",h),Lt("FunnelChart",X,"valueAccessor",u);const U=bt(),J=Tr(()=>new Map,[]),ee=Tr(()=>{if(K)return T||(U?.[0]?U[0]:Array.isArray(g)&&g[0]?g[0]:"#4e79a7")},[K,T,U,g]),te=xi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:U,colorScheme:g,categoryIndexMap:J,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=Tr(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,n=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,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 Fr("div",{className:"semiotic-tooltip",style:He,children:[o&&Or("div",{style:{fontWeight:"bold"},children:o+""}),a&&a!==o&&Or("div",{style:{marginTop:2,opacity:.8},children:a+""}),s&&Or("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Fr("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=n({componentName:"FunnelChart",data:a,accessors:{stepAccessor:h,valueAccessor:u}});if(ie)return Or(_t,{componentName:"FunnelChart",message:ie,width:D,height:j});const re={chartType:N?"bar-funnel":"funnel",...null!=a&&{data:X},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:N?"vertical":"horizontal",barPadding:N?40:0,pieceStyle:te,size:[D,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:N,showCategoryTicks:N,...E&&{oFormat:E},showGrid:N,...!N&&{connectorOpacity:f},showLabels:y,...Z.legendBehaviorProps,...V&&{title:V},...G&&{description:G},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===v?()=>null:!0===v||null==v?oe:Ze(v)||oe,...O({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:C,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 Or(Pt,{componentName:"FunnelChart",width:D,height:j,children:Or(ci,{ref:s,...re})})});Er.displayName="FunnelChart";import{useMemo as Nr,forwardRef as Dr,useRef as jr}from"react";import{jsx as Wr}from"react/jsx-runtime";var zr=Dr(function(t,i){const s=mt(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid??!0,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,categoryLabel:t.categoryLabel,valueLabel:t.valueLabel,showCategoryTicks:t.showCategoryTicks,orientation:t.orientation,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),a=jr(null);r(i,{variant:"xy",frameRef:a});const{data:l,margin:c,className:h,categoryAccessor:u="category",valueAccessor:d="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,sort:y="auto",dotRadius:v=5,categoryPadding:b=10,tooltip:x,annotations:w,regression:A,valueExtent:k,frameProps:S={},selection:C,linkedHover:_,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:F,legendPosition:D,color:j,stroke:W,strokeWidth:z,opacity:V,categoryFormat:G}=t,{width:$,height:q,enableHover:Y,showGrid:X,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=s,oe=Nr(()=>Be(l),[l]),ie=o({data:oe,rawData:l,colorBy:p,colorScheme:f,legendInteraction:F,legendPosition:D,selection:C,linkedHover:_,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:$,height:q,hasTitle:!!K,axisChrome:at({showAxes:s.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=vt(oe,y,d),ne=bt(),se=Nr(()=>new Map,[]),ae=xi({colorBy:p,colorScale:ie.colorScale,color:j,themeCategorical:ne,colorScheme:f,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:z,opacity:V,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:v,fillOpacity:.8}}),le=Nr(()=>E({categoryAccessor:u,valueAccessor:d,valueFormat:g}),[u,d,g]);if(ie.earlyReturn)return ie.earlyReturn;const ce=n({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ce)return Wr(_t,{componentName:"DotPlot",message:ce,width:$,height:q});const he=e(A),ue=he?[he,...w||[]]:w,de={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:ae,size:[$,q],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ie.margin,barPadding:b,enableHover:Y,...t.dataIdAccessor&&{dataIdAccessor:t.dataIdAccessor},showAxes:s.showAxes,oLabel:ee,rLabel:te,rFormat:g,...G&&{oFormat:G},showGrid:X,oSort:y,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:h,animate:t.animate,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:le}),...O({linkedHover:_,selection:C,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...ue&&ue.length>0&&{annotations:ue},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Wr(Pt,{componentName:"DotPlot",width:$,height:q,children:Wr(ci,{ref:a,...de})})});zr.displayName="DotPlot";import{useMemo as Vr,forwardRef as Gr,useRef as $r}from"react";import{jsx as qr}from"react/jsx-runtime";var Yr=Gr(function(e,t){const i=mt(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=$r(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,startAngle:m=0,cornerRadius:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:A,chartId:k,loading:S,loadingContent:C,emptyContent:_,legendInteraction:P,legendPosition:R,color:M,stroke:L,strokeWidth:I,opacity:T}=e,{width:H,height:F,enableHover:D,showLegend:j,title:W,description:z,summary:V,accessibleTable:G}=i,$=Vr(()=>Be(s),[s]),q=u||c,Y=o({data:$,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:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:j,userMargin:a,marginDefaults:i.marginDefaults,loading:S,loadingContent:C,emptyContent:_,width:H,height:F,hasTitle:!!W,axisChrome:{hasAxis:!1}}),X=bt(),Q=Vr(()=>new Map,[]),K=xi({colorBy:q,colorScale:Y.colorScale,color:M,themeCategorical:X,colorScheme:d,categoryIndexMap:Q,userPieceStyle:y?.pieceStyle,stroke:L,strokeWidth:I,opacity:T,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,cycleByCategory:!0}),Z=Vr(()=>E({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),U=n({componentName:"PieChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:J,effectiveMargin:ee}=vi({ref:t,frameRef:r,setup:Y});if(Y.earlyReturn)return Y.earlyReturn;const te={chartType:"pie",...null!=s&&{data:$},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:K,startAngle:m,...null!=g&&{cornerRadius:g},size:[H,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...B({title:W,description:z,summary:V,accessibleTable:G,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:p,defaultTooltipContent:Z}),...O({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return U?qr(_t,{componentName:"PieChart",message:U,width:H,height:F}):qr(Pt,{componentName:"PieChart",width:H,height:F,children:qr(ci,{ref:r,...te})})});Yr.displayName="PieChart";import{useMemo as Xr,forwardRef as Qr,useRef as Kr}from"react";import{jsx as Zr}from"react/jsx-runtime";var Ur=Qr(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),r=Kr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:m,colorScheme:g,startAngle:p=0,cornerRadius:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:A,onClick:k,hoverHighlight:S,chartId:C,loading:_,loadingContent:P,emptyContent:R,legendInteraction:M,legendPosition:L,color:I,stroke:T,strokeWidth:H,opacity:F}=e,{width:D,height:j,enableHover:W,showLegend:z,title:V,description:G,summary:$,accessibleTable:q}=i,Y=Xr(()=>Be(s),[s]),X=m||c,Q=o({data:Y,rawData:s,colorBy:X,colorScheme:g,legendInteraction:M,legendPosition:L,selection:x,linkedHover:w,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DonutChart",chartId:C,showLegend:z,userMargin:a,marginDefaults:i.marginDefaults,loading:_,loadingContent:P,emptyContent:R,width:D,height:j,hasTitle:!!V,axisChrome:{hasAxis:!1}}),K=u??Math.max(2,.15*Math.min(D,j)),Z=bt(),U=Xr(()=>new Map,[]),J=xi({colorBy:X,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:g,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:F,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=Xr(()=>E({categoryAccessor:c,valueAccessor:h,groupAccessor:m&&m!==c?m:void 0,groupLabel:"string"==typeof m?m:"group",pieData:!0}),[c,h,m]),te=n({componentName:"DonutChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:oe,effectiveMargin:ie}=vi({ref:t,frameRef:r,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const re={chartType:"donut",...null!=s&&{data:Y},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:J,innerRadius:K,startAngle:p,...null!=f&&{cornerRadius:f},centerContent:d,size:[D,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...B({title:V,description:G,summary:$,accessibleTable:q,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:y,defaultTooltipContent:ee}),...O({linkedHover:w,selection:x,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return te?Zr(_t,{componentName:"DonutChart",message:te,width:D,height:j}):Zr(Pt,{componentName:"DonutChart",width:D,height:j,children:Zr(ci,{ref:r,...re})})});Ur.displayName="DonutChart";import{useMemo as Jr,forwardRef as en,useRef as tn}from"react";function on(e=240){const t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function rn(e){return Math.max(0,Math.min(1,e))}function nn(e){const t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){const e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function sn(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 an(e,t,o){const i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:rn(e.offset),color:e.color??o,opacity:null==e.opacity?1:rn(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";const r=e=>{if(1===e.opacity)return e.color;const t=nn(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);const n=rn(t);if(i[0].offset>=n)return r(i[0]);if(n>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){const t=i[e],o=i[e+1];if(t.offset>n||n>o.offset)continue;const s=o.offset-t.offset,a=s>0?(n-t.offset)/s:0,l=nn(t.color),c=nn(o.color);if(!l||!c)return r(.5>a?t:o);const[h,u,d]=l,[m,g,p]=c,f=h+(m-h)*a,y=u+(g-u)*a,v=d+(p-d)*a,b=t.opacity+(o.opacity-t.opacity)*a;return 1===b?sn(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function ln(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as cn,jsxs as hn}from"react/jsx-runtime";var un=en(function(e,o){const i=mt(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),r=tn(null),n="context"===i.mode,{compactMode:s}=i,{value:a,min:l=0,max:c=100,thresholds:h,gradientFill:d,color:m,backgroundColor:g="var(--semiotic-grid, #e0e0e0)",arcWidth:p=.3,cornerRadius:f,showNeedle:y=!0,needleColor:v="var(--semiotic-text, #333)",centerContent:b,valueFormat:x,showScaleLabels:w=!s,sweep:A=240,fillZones:k=!0,tooltip:S,annotations:C,frameProps:_={},className:P,stroke:R,strokeWidth:M,opacity:L}=e,{width:I,height:T,title:H,description:B,summary:O,accessibleTable:F}=i,E=u(d),N=Math.max(l,Math.min(c,a)),D=c-l||1,j=(N-l)/D,{gaugeData:W,pieceStyle:z,gaugeAnnotations:V}=Jr(()=>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 m=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:n||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});const g=!!c&&c.stops.length>=2,p=[],f=new Map,y=[];if(g){const e=a?d:1,t=ln("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill: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(an(c.stops,e*(t+.5)/o,n||m[0]?.color||"#007bff"));const r=ln("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||s})}}else{let e=t;for(let o=0;m.length>o;o++){const i=m[o],r=(i.value-e)/u,n=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(a?Math.min(d,l):l)-n),h=a?Math.max(0,r-c):0;if(c>0){const e=ln("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){const e=ln("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill: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:m,backgroundColor:g,fillZones:k,showScaleLabels:w,gradientFill:E}),[a,l,c,h,m,g,w,k,E]),G=Jr(()=>t(z,{stroke:R,strokeWidth:M,opacity:L}),[z,R,M,L]),{sweepRad:$,startAngleDeg:q}=on(A),Y=function(e=240){const{sweepRad:t,offsetRad:o}=on(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||i.push([Math.cos(e),Math.sin(e)]);const r=i.map(e=>e[0]),n=i.map(e=>e[1]),[s,a]=kt(r),[l,c]=kt(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),X=Math.min(10,Math.max(1,Math.min(I,T)/12)),Q=Y.cx,K=Y.cy,Z=Math.max(4,Math.min((I-2*X)/Y.width,(T-2*X)/Y.height)-2),U=Math.max(0,Math.min(Z-1.5,Z*(1-p))),J=I/2-Q*Z,ee=T/2-K*Z,te=2*(Z+4),oe=Jr(()=>{if(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 hn("div",{style:{textAlign:"center",lineHeight:1.2},children:[cn("div",{style:{fontSize:Math.max(16,.3*Z),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),w&&hn("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[b,N,l,c,x,w,Z,s]),ie=Jr(()=>n&&null==b?{type:"gauge-value",text:x?x(N):Math.round(N)+""}:null,[n,b,N,x]),re=Jr(()=>{if(!y)return null;const e=-Math.PI/2+q*Math.PI/180+j*$,t=U>20?U-8:Z-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:v}},[y,q,j,$,U,Z,v]),ne=Jr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||I)/2,r=(o.height||T)/2,n=Math.max(1,Z-U),s=Math.max(1,Math.min(2.5,.4*n)),a=Math.max(1,Math.min(5,.6*n));return hn("g",{transform:`translate(${i},${r})`,children:[cn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:s,strokeLinecap:"round"}),cn("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*$,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,m=Z+10,g=Math.cos(i)*m,p=Math.sin(i)*m,f=((i+Math.PI/2)/(2*Math.PI)*12+12)%12;let y,v;return f>=11||1>f?(y="middle",v="auto"):f>=1&&5>f?(y="start",v="middle"):f>=5&&7>f?(y="middle",v="hanging"):(y="end",v="middle"),hn("g",{transform:`translate(${r},${n})`,children:[cn("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),cn("text",{x:g,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?cn("text",{x:(o.width||I)/2,y:(o.height||T)/2-.2*U,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*Z)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[I,T,l,D,q,$,U,Z]),se=Jr(()=>{const e=[...V,...C||[]];return re&&e.push(re),ie&&e.push(ie),e},[V,C,re,ie]),ae=Jr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return hn("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[cn("div",{style:{fontWeight:600},children:o}),cn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(N):"Remaining"})]})},[N]);if(0===W.length)return cn(_t,{componentName:"GaugeChart",message:"No data to display",width:I,height:T});const le={chartType:"donut",data:W,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:G,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:Ze(S)||ae,svgAnnotationRules:ne,...se.length>0&&{annotations:se},...H&&{title:H},...B&&{description:B},...O&&{summary:O},...void 0!==F&&{accessibleTable:F},...P&&{className:P},...null!=e.animate&&{animate:e.animate},..._};return cn(Pt,{componentName:"GaugeChart",width:I,height:T,children:cn(ci,{ref:r,...le})})});un.displayName="GaugeChart";import{useMemo as dn,forwardRef as mn,useRef as gn}from"react";import{jsx as pn}from"react/jsx-runtime";var fn=mn(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=gn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:m="vertical",valueFormat:g,colorBy:p,colorScheme:f,sort:y=!1,barPadding:v=60,roundedTop:b,gradientFill:x,styleRules:w,baselinePadding:A=!1,tooltip:k,annotations:S,valueExtent:C,frameProps:_={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:F,emptyContent:D,legendInteraction:j,legendPosition:W,color:z,stroke:V,strokeWidth:G,opacity:$,categoryFormat:q}=e,{width:Y,height:X,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=i,re=dn(()=>Be(s),[s]),ne=p||h,ae=o({data:re,rawData:s,colorBy:ne,colorScheme:f,legendInteraction:j,legendPosition:W,selection:P,linkedHover:R,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:Z,userMargin:a,marginDefaults:i.marginDefaults,loading:H,loadingContent:F,emptyContent:D,width:Y,height:X,hasTitle:!!U,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!!oe,hasValueLabel:!!ie})}),le=bt(),ce=dn(()=>new Map,[]),he=dn(()=>se(u),[u]),ue=xi({colorBy:ne,colorScale:ae.colorScale,color:z,themeCategorical:le,colorScheme:f,categoryIndexMap:ce,userPieceStyle:_.pieceStyle,stroke:V,strokeWidth:G,opacity:$,styleRules:w,resolveRuleValue:he,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection}),de=dn(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),me=n({componentName:"GroupedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:ge,effectiveMargin:pe}=vi({ref:t,frameRef:r,setup:ae}),fe=dn(()=>d(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"===m?"horizontal":"vertical",pieceStyle:ue,size:[Y,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:v,...null!=b&&{roundedTop:b},...fe&&{gradientFill:fe},baselinePadding:A,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:oe,rLabel:ie,rFormat:g,...q&&{oFormat:q},showGrid:K,...ge,...B({title:U,description:J,summary:ee,accessibleTable:te,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:k,defaultTooltipContent:de}),...O({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},...C&&{rExtent:C},...Object.fromEntries(Object.entries(_).filter(([e])=>"pieceStyle"!==e))};return me?pn(_t,{componentName:"GroupedBarChart",message:me,width:Y,height:X}):pn(Pt,{componentName:"GroupedBarChart",width:Y,height:X,children:pn(ci,{ref:r,...ye})})});fn.displayName="GroupedBarChart";import{useMemo as yn,forwardRef as vn,useRef as bn}from"react";import{jsx as xn}from"react/jsx-runtime";var wn=vn(function(e,t){const i=mt(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=bn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:m="horizontal",valueFormat:g,colorBy:p,colorScheme:f,barPadding:y,tooltip:v,annotations:b,brush:x,onBrush:w,linkedBrush:A,frameProps:k={},selection:S,linkedHover:C,onObservation:_,onClick:P,hoverHighlight:R,chartId:M,loading:L,loadingContent:I,emptyContent:T,legendInteraction:H,legendPosition:F,color:D,stroke:j,strokeWidth:W,opacity:z,categoryFormat:V,rTickValues:G,tickLabelEdgeAlign:$,showCategoryTicks:q,gradientFill:Y,trackFill:X,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}=i,le=yn(()=>Be(s),[s]),ce=p||h,he=yn(()=>{if(null!=y)return y;if("sparkline"!==i.mode)return 40;const e=new Set(le.map(e=>"function"==typeof c?c(e):e[c])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===m?U:Z)-2*t)/(t-1))):1},[y,i.mode,le,c,m,Z,U]),ue=o({data:le,rawData:s,colorBy:ce,colorScheme:f,legendInteraction:H,legendPosition:F,selection:S,linkedHover:C,fallbackFields:ce?["string"==typeof ce?ce:""]:[],unwrapData:!0,onObservation:_,onClick:P,hoverHighlight:R,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"SwimlaneChart",chartId:M,showLegend:te,userMargin:a,marginDefaults:i.marginDefaults,loading:L,loadingContent:I,emptyContent:T,width:Z,height:U,hasTitle:!!oe,axisChrome:at({showAxes:i.showAxes,projection:"horizontal"===m?"horizontal":"vertical",hasCategoryLabel:!1!==q&&!!se,hasValueLabel:!!ae})}),de=rr({brushProp:x,onBrushProp:w,linkedBrush:A,valueAccessor:u}),me=bt(),ge=yn(()=>new Map,[]),pe=xi({colorBy:ce,colorScale:ue.colorScale,color:D,themeCategorical:me,colorScheme:f,categoryIndexMap:ge,userPieceStyle:k?.pieceStyle,stroke:j,strokeWidth:W,opacity:z,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,cycleByCategory:!0}),fe=yn(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ye=n({componentName:"SwimlaneChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ve,effectiveMargin:be}=vi({ref:t,frameRef:r,setup:ue}),xe=yn(()=>d(Y),[Y]);if(ue.earlyReturn)return ue.earlyReturn;const we={chartType:"swimlane",...null!=s&&{data:le},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===m?"horizontal":"vertical",pieceStyle:pe,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:he,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:i.showAxes,oLabel:!1===q?void 0:se,rLabel:ae,rFormat:g,...G&&{rTickValues:G},...null!=$&&{tickLabelEdgeAlign:$},...V&&{oFormat:V},...void 0!==q&&{showCategoryTicks:q},showGrid:ee,...ve,...B({title:oe,description:ie,summary:re,accessibleTable:ne,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:v,defaultTooltipContent:fe}),...O({linkedHover:C,selection:S,onObservation:_,onClick:P,hoverHighlight:R,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...b&&b.length>0&&{annotations:b},...xe&&{gradientFill:xe},...null!=X&&{trackFill:X},...null!=Q&&{roundedTop:Q},...K&&{rExtent:K},...de.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};return ye?xn(_t,{componentName:"SwimlaneChart",message:ye,width:Z,height:U}):xn(Pt,{componentName:"SwimlaneChart",width:Z,height:U,children:xn(ci,{ref:r,...we})})});wn.displayName="SwimlaneChart";export{ci as StreamOrdinalFrame_default,mi as OrdinalCustomChart,Ai as BarChart,Pi as StackedBarChart,Zi as LikertChart,sr as SwarmPlot,gr as BoxPlot,wr as Histogram,_r as ViolinPlot,Ir as RidgelinePlot,Er as FunnelChart,zr as DotPlot,Yr as PieChart,Ur as DonutChart,un as GaugeChart,fn as GroupedBarChart,wn as SwimlaneChart};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildLinearFillGradient as t,buildThresholdLineSegments as e,resolveCSSColor as l,resolveCanvasFill as o,resolveCurveFactory as n}from"./chunk-chunk-HCNDE26Q.module.min.js";import{line as a}from"d3-shape";function i(t,e,l,o,n,a){if(2>e.length)return;const i=[0];for(let t=1;e.length>t;t++){const l=e[t][0]-e[t-1][0],o=e[t][1]-e[t-1][1];i.push(i[t-1]+Math.sqrt(l*l+o*o))}const h=i[i.length-1];if(0===h)return;const s=Math.min(.2*h,40);t.strokeStyle=l,t.lineWidth=o,t.lineCap=a;for(let l=0;e.length-1>l;l++){const o=(i[l]+i[l+1])/2;let a=n;s>o&&(a*=o/s),s>h-o&&(a*=(h-o)/s),t.globalAlpha=Math.max(0,a),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}var h=(h,s,r,p)=>{const c=s.filter(t=>"line"===t.type);for(const s of c){if(2>s.path.length)continue;const r=s._introClipFraction;void 0!==r&&1>r&&(h.save(),h.beginPath(),h.rect(0,0,p.width*r,p.height),h.clip());const c=s.style.stroke||"#007bff",f=l(h,c)||c,y=s.style.strokeWidth||2,g=s.colorThresholds,u=s.rawValues;if(h.setLineDash(s.style.strokeDasharray?s.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=s.style.opacity&&(h.globalAlpha=s.style.opacity),h.lineWidth=y,h.lineCap=s.style.strokeLinecap||"butt",s.style._edgeFade){i(h,s.path,f,y,s.style.opacity??1,s.style.strokeLinecap||"butt"),h.globalAlpha=1,h.setLineDash([]),h.lineCap="butt";continue}const k=n(s.curve),b=g&&g.length>0&&u&&u.length===s.path.length,d=s._decayOpacities;if(d&&d.length===s.path.length&&!b){h.strokeStyle=f;const t=s.style.opacity??1;for(let e=0;s.path.length-1>e;e++)h.globalAlpha=.5*(d[e]+d[e+1])*t,h.beginPath(),h.moveTo(s.path[e][0],s.path[e][1]),h.lineTo(s.path[e+1][0],s.path[e+1][1]),h.stroke()}else if(b){const t=e(s.path,u,g,f);for(const e of t){h.beginPath(),h.strokeStyle=l(h,e.color)||e.color,h.moveTo(e.path[0][0],e.path[0][1]);for(let t=1;e.path.length>t;t++)h.lineTo(e.path[t][0],e.path[t][1]);h.stroke()}}else{h.beginPath();const e=s.strokeGradient&&s.path.length>=2?t(h,s.strokeGradient,f,s.path[0][0],0,s.path[s.path.length-1][0],0):null;if(h.strokeStyle=e||f,k)a().x(t=>t[0]).y(t=>t[1]).curve(k).context(h)(s.path);else{const[t,e]=s.path[0];h.moveTo(t,e);for(let t=1;s.path.length>t;t++)h.lineTo(s.path[t][0],s.path[t][1])}h.stroke()}if(s.style.fill&&s.style.fillOpacity&&s.style.fillOpacity>0){if(h.beginPath(),h.globalAlpha=s.style.fillOpacity,h.fillStyle=o(h,s.style.fill,s.style.fill),k&&!b)a().x(t=>t[0]).y(t=>t[1]).curve(k).context(h)(s.path);else{const[t,e]=s.path[0];h.moveTo(t,e);for(let t=1;s.path.length>t;t++)h.lineTo(s.path[t][0],s.path[t][1])}const t=s.path[0][0];h.lineTo(s.path[s.path.length-1][0],p.height),h.lineTo(t,p.height),h.closePath(),h.fill()}void 0!==r&&1>r&&h.restore(),h.globalAlpha=1,h.setLineDash([]),h.lineCap="butt"}};function s(t){if(!t)return null;if("heatcell"===t.type)return t.fill||null;if("candlestick"===t.type)return t.isUp?t.upColor:t.downColor;const{style:e}=t;if(!e)return null;const l="string"==typeof e.fill?e.fill:null;return"line"===t.type||"area"===t.type?e.stroke||l||null:l||e.stroke||null}export{h as lineCanvasRenderer,s as resolveNodeColor};