semiotic 3.8.5 → 3.8.6

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 (176) hide show
  1. package/CLAUDE.md +5 -4
  2. package/README.md +42 -42
  3. package/ai/behaviorContracts.cjs +2 -2
  4. package/ai/componentMetadata.cjs +1 -1
  5. package/ai/dist/mcp-server.js +2 -0
  6. package/ai/examples.md +44 -2
  7. package/ai/schema.json +385 -14
  8. package/ai/surface-manifest.json +6 -4
  9. package/ai/system-prompt.md +1 -1
  10. package/dist/{chunk-chartContainerDataAudit-74TLKIP6.module.min.js → chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js} +1 -1
  11. package/dist/chunk-chunk-2CHN2TA3.module.min.js +1 -0
  12. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
  13. package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
  14. package/dist/chunk-chunk-3SHB24AG.module.min.js +1 -0
  15. package/dist/chunk-chunk-4MMOOYTX.module.min.js +2 -0
  16. package/dist/{chunk-chunk-KT2VAZMZ.module.min.js → chunk-chunk-75OTQSXS.module.min.js} +1 -1
  17. package/dist/chunk-chunk-A5GRQUOF.module.min.js +1 -0
  18. package/dist/chunk-chunk-AAF5LZAU.module.min.js +2 -0
  19. package/dist/{chunk-chunk-4AANPFOX.module.min.js → chunk-chunk-ARZGA4LJ.module.min.js} +1 -1
  20. package/dist/chunk-chunk-CAFLML4L.module.min.js +2 -0
  21. package/dist/chunk-chunk-FHBN7OEB.module.min.js +2 -0
  22. package/dist/{chunk-chunk-TMWIZL3K.module.min.js → chunk-chunk-GFTVACTO.module.min.js} +1 -1
  23. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  24. package/dist/chunk-chunk-ITDWLZXV.module.min.js +2 -0
  25. package/dist/chunk-chunk-LPSPATPC.module.min.js +1 -0
  26. package/dist/chunk-chunk-OM6NWS4H.module.min.js +2 -0
  27. package/dist/chunk-chunk-PX5YQGDP.module.min.js +2 -0
  28. package/dist/chunk-chunk-Q2BS46W2.module.min.js +2 -0
  29. package/dist/{chunk-chunk-LJLS6DY7.module.min.js → chunk-chunk-RA7JCG7D.module.min.js} +1 -1
  30. package/dist/chunk-chunk-RNUHEXZA.module.min.js +2 -0
  31. package/dist/chunk-chunk-ROZWKEUG.module.min.js +1 -0
  32. package/dist/chunk-chunk-SMVD3EQJ.module.min.js +2 -0
  33. package/dist/chunk-chunk-T2FKJD4O.module.min.js +2 -0
  34. package/dist/{chunk-chunk-K3DMEW22.module.min.js → chunk-chunk-UDREYOLV.module.min.js} +1 -1
  35. package/dist/chunk-chunk-VOWE3SAP.module.min.js +2 -0
  36. package/dist/chunk-chunk-VQPNBUSW.module.min.js +2 -0
  37. package/dist/{chunk-chunk-N5DDKCCF.module.min.js → chunk-chunk-WAWCIHFJ.module.min.js} +1 -1
  38. package/dist/{chunk-chunk-XXWSHGPL.module.min.js → chunk-chunk-WYARAXHR.module.min.js} +1 -1
  39. package/dist/{chunk-chunk-I36PJ4OC.module.min.js → chunk-chunk-XP3OHHFX.module.min.js} +1 -1
  40. package/dist/chunk-chunk-XV3KGYTR.module.min.js +2 -0
  41. package/dist/chunk-chunk-YC2IVEPX.module.min.js +1 -0
  42. package/dist/components/ai/chartCapabilities.d.ts +2 -1
  43. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  44. package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
  45. package/dist/components/charts/index.d.ts +3 -0
  46. package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
  47. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  48. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
  49. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
  50. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
  51. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -4
  52. package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
  53. package/dist/components/charts/shared/gradient.d.ts +35 -0
  54. package/dist/components/charts/shared/hatchFill.d.ts +3 -10
  55. package/dist/components/charts/shared/hooks.d.ts +2 -50
  56. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  57. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
  58. package/dist/components/charts/shared/useChartLegend.d.ts +58 -0
  59. package/dist/components/charts/shared/useChartSetup.d.ts +5 -0
  60. package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
  61. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
  62. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  63. package/dist/components/charts/xy/AreaChart.d.ts +25 -42
  64. package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
  65. package/dist/components/charts/xy/BumpChart.d.ts +161 -0
  66. package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
  67. package/dist/components/charts/xy/Heatmap.d.ts +3 -0
  68. package/dist/components/charts/xy/LineChart.d.ts +6 -8
  69. package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
  70. package/dist/components/legendLayout.d.ts +19 -1
  71. package/dist/components/semiotic-ai.d.ts +2 -1
  72. package/dist/components/semiotic-geo.d.ts +1 -0
  73. package/dist/components/semiotic-network.d.ts +1 -0
  74. package/dist/components/semiotic-ordinal.d.ts +2 -0
  75. package/dist/components/semiotic-physics.d.ts +1 -0
  76. package/dist/components/semiotic-realtime-core.d.ts +1 -0
  77. package/dist/components/semiotic-server-edge.d.ts +1 -1
  78. package/dist/components/semiotic-server.d.ts +1 -1
  79. package/dist/components/semiotic-xy.d.ts +4 -0
  80. package/dist/components/semiotic.d.ts +4 -4
  81. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  82. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  83. package/dist/components/server/staticLegend.d.ts +4 -2
  84. package/dist/components/server/staticSVGChrome.d.ts +4 -4
  85. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -10
  86. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
  87. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
  88. package/dist/components/stream/SVGOverlay.d.ts +2 -6
  89. package/dist/components/stream/StalenessBadge.d.ts +2 -6
  90. package/dist/components/stream/geoTypes.d.ts +3 -6
  91. package/dist/components/stream/legendRenderer.d.ts +2 -6
  92. package/dist/components/stream/ordinalTypes.d.ts +7 -31
  93. package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
  94. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
  95. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
  96. package/dist/components/stream/pipelineConfig.d.ts +7 -15
  97. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
  98. package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
  99. package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
  100. package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
  101. package/dist/components/stream/types.d.ts +32 -56
  102. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
  103. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
  104. package/dist/components/types/legendTypes.d.ts +15 -6
  105. package/dist/geo.min.js +1 -1
  106. package/dist/geo.module.min.js +1 -1
  107. package/dist/network.min.js +1 -1
  108. package/dist/network.module.min.js +1 -1
  109. package/dist/ordinal.min.js +1 -1
  110. package/dist/ordinal.module.min.js +1 -1
  111. package/dist/physics.min.js +1 -1
  112. package/dist/physics.module.min.js +1 -1
  113. package/dist/physicsWorker.js +1 -1
  114. package/dist/realtime.min.js +1 -1
  115. package/dist/realtime.module.min.js +1 -1
  116. package/dist/semiotic-ai-core.min.js +1 -1
  117. package/dist/semiotic-ai-core.module.min.js +1 -1
  118. package/dist/semiotic-ai.d.ts +2 -1
  119. package/dist/semiotic-ai.min.js +1 -1
  120. package/dist/semiotic-ai.module.min.js +1 -1
  121. package/dist/semiotic-experimental.min.js +1 -1
  122. package/dist/semiotic-experimental.module.min.js +1 -1
  123. package/dist/semiotic-geo.d.ts +1 -0
  124. package/dist/semiotic-network.d.ts +1 -0
  125. package/dist/semiotic-ordinal.d.ts +2 -0
  126. package/dist/semiotic-physics.d.ts +1 -0
  127. package/dist/semiotic-realtime-core.d.ts +1 -0
  128. package/dist/semiotic-realtime-core.min.js +1 -1
  129. package/dist/semiotic-realtime-core.module.min.js +1 -1
  130. package/dist/semiotic-recipes-core.module.min.js +1 -1
  131. package/dist/semiotic-recipes.module.min.js +1 -1
  132. package/dist/semiotic-server-edge.d.ts +1 -1
  133. package/dist/semiotic-server-edge.min.js +1 -1
  134. package/dist/semiotic-server-edge.module.min.js +1 -1
  135. package/dist/semiotic-server-node.min.js +1 -1
  136. package/dist/semiotic-server-node.module.min.js +1 -1
  137. package/dist/semiotic-server.d.ts +1 -1
  138. package/dist/semiotic-utils-core.min.js +1 -1
  139. package/dist/semiotic-utils-core.module.min.js +1 -1
  140. package/dist/semiotic-utils.min.js +1 -1
  141. package/dist/semiotic-utils.module.min.js +1 -1
  142. package/dist/semiotic-xy.d.ts +4 -0
  143. package/dist/semiotic.d.ts +4 -4
  144. package/dist/semiotic.min.js +1 -1
  145. package/dist/semiotic.module.min.js +1 -1
  146. package/dist/server.min.js +1 -1
  147. package/dist/server.module.min.js +1 -1
  148. package/dist/xy.min.js +1 -1
  149. package/dist/xy.module.min.js +1 -1
  150. package/package.json +1 -1
  151. package/dist/chunk-chunk-5I3UZV4Q.module.min.js +0 -2
  152. package/dist/chunk-chunk-74CCPVXB.module.min.js +0 -1
  153. package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
  154. package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
  155. package/dist/chunk-chunk-BANTPINB.module.min.js +0 -2
  156. package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
  157. package/dist/chunk-chunk-CKMD5NV3.module.min.js +0 -2
  158. package/dist/chunk-chunk-CWQ5YIHX.module.min.js +0 -2
  159. package/dist/chunk-chunk-E6TXX6MI.module.min.js +0 -1
  160. package/dist/chunk-chunk-L6EA5V3G.module.min.js +0 -2
  161. package/dist/chunk-chunk-LJPCLYSC.module.min.js +0 -2
  162. package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
  163. package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
  164. package/dist/chunk-chunk-NLO44TOS.module.min.js +0 -2
  165. package/dist/chunk-chunk-PZJ2SBLL.module.min.js +0 -2
  166. package/dist/chunk-chunk-QUJ6TTLY.module.min.js +0 -1
  167. package/dist/chunk-chunk-RBIDBUT4.module.min.js +0 -2
  168. package/dist/chunk-chunk-RFLAG356.module.min.js +0 -1
  169. package/dist/chunk-chunk-RPU4IZAV.module.min.js +0 -2
  170. package/dist/chunk-chunk-SKMBCFIL.module.min.js +0 -2
  171. package/dist/chunk-chunk-TAE7W424.module.min.js +0 -2
  172. package/dist/chunk-chunk-TUBMTZMU.module.min.js +0 -2
  173. package/dist/chunk-chunk-UFFEXJQY.module.min.js +0 -1
  174. package/dist/chunk-chunk-XSCHTS4D.module.min.js +0 -2
  175. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
  176. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{validateArrayData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,normalizePartialMargin as n,useChartSetup as i,useCustomChartSetup as r,useFrameImperativeHandle as a,useResolvedSelection as s}from"./chunk-chunk-VQPNBUSW.module.min.js";import{StreamXYFrame_default as l}from"./chunk-chunk-AAF5LZAU.module.min.js";import{normalizeColorGradient as c,normalizeGradient as h,normalizeSemanticGradient as d,reverseGradient as u}from"./chunk-chunk-XV3KGYTR.module.min.js";import{accessorName as m,bandTooltipFields as p,buildBaseMetadataProps as y,buildCustomBehaviorProps as f,buildDefaultTooltip as g,buildTooltipProps as b}from"./chunk-chunk-WYARAXHR.module.min.js";import{useCustomLayoutSelection as v}from"./chunk-chunk-5UKL5W76.module.min.js";import{makeXYRuleContext as x,resolveStyleRules as A}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as k,DEFAULT_COLOR as w,DEFAULT_COLORS as S,DEFAULT_SELECTION_OPACITY as C,LinkedCharts as L,MultiPointTooltip as _,composeLegendConfigs as H,defaultTooltipStyle as R,filterSparseArray as I,getColor as B,getCrosshairProps as F,getSequentialInterpolator as P,getSize as N,interpolateViridis as M,normalizeLinkedBrush as W,normalizeTooltip as O,resolveDefaultFill as D,resolveMobileInteraction as T,useBrushSelection as E,useChartLegendAndMargin as G,useChartMode as j,useChartSelection as z,useColorScale as V,useLegendInteraction as $,useSelection as X,useSelectionSelector as Q,useThemeCategorical as Y,useThemeSequential as U,wrapStyleWithSelection as q}from"./chunk-chunk-PX5YQGDP.module.min.js";import{getMax as J,getMinMax as K}from"./chunk-chunk-JJ2OOIET.module.min.js";import{useTheme as Z}from"./chunk-chunk-WCX6U47H.module.min.js";import{ChartError as ee,SafeRender as te,renderEmptyState as oe,renderLoadingState as ne,warnMissingField as ie}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as re from"react";import{useMemo as ae,useCallback as se,forwardRef as le,useRef as ce}from"react";import{useMemo as he}from"react";function de(e){const{colorBy:t,colorScale:n,color:i,pointRadius:r=5,radiusFn:a,fillOpacity:s=1,fallbackFill:l,baseStyleExtras:c,stroke:h,strokeWidth:d,opacity:u,effectiveSelectionHook:m,resolvedSelection:p,colorDatumAccessor:y,styleRules:f,ruleContext:g}=e,b=he(()=>e=>{const o="function"==typeof c?c(e):c,h=o?{...o}:{};if(void 0===h.fillOpacity&&(h.fillOpacity=s),void 0===h.fill)if(t){if(n){const o=y?y(e):e;h.fill=B(o,t,n)}}else h.fill=l?l(e):i||w;return void 0===h.r&&(h.r=a?a(e):r),f&&f.length>0&&Object.assign(h,A(e,f,g?g(e):{value:void 0})),h},[t,n,i,r,a,s,l,c,y,f,g]),v=he(()=>o(b,{stroke:h,strokeWidth:d,opacity:u}),[b,h,d,u]);return he(()=>q(v,m??null,p),[v,m,p])}import{useCallback as ue,useMemo as me,useRef as pe,useState as ye}from"react";function fe(e){const{accessor:t,data:o,isPushMode:n}=e,i=pe(null),[r,a]=ye(0),s=ue(e=>{if(!n||!t)return;let o=!1;for(const n of e){const e="function"==typeof t?t(n):n[t];if(null==e)continue;const r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(i.current?(i.current[0]>r&&(i.current[0]=r,o=!0),r>i.current[1]&&(i.current[1]=r,o=!0)):(i.current=[r,r],o=!0))}o&&a(e=>e+1)},[n,t]),l=ue(()=>{n&&(i.current=null,a(e=>e+1))},[n]);return{domain:me(()=>{if(n)return i.current??void 0;if(!t||0===o.length)return;const e="function"==typeof t?t:e=>e[t];let r=1/0,a=-1/0;for(const t of o){const o=e(t);if(null==o)continue;const n="number"==typeof o?o:Number(o);Number.isFinite(n)&&(r>n&&(r=n),n>a&&(a=n))}return Number.isFinite(r)&&Number.isFinite(a)?[r,a]:void 0},[o,t,n,r]),trackPushed:s,reset:l}}import{useEffect as ge,useMemo as be,useRef as ve,useState as xe}from"react";var Ae="__forecastSegment",ke=null;async function we(){return ke||(ke=await import("./chunk-statisticalOverlays-6MVAK5RW.module.min.js")),ke}var Se="__semiotic_resolvedX",Ce="__semiotic_resolvedY";function Le(e){const{data:t,xAccessor:o,yAccessor:n,forecast:i,anomaly:r,groupBy:a}=e,s="string"==typeof o?o:Se,l="string"==typeof n?n:Ce,c=be(()=>{if(!i&&!r)return t;const e="function"==typeof o,a="function"==typeof n;return e||a?t.map(t=>{const i={...t};return e&&(i[Se]=o(t)),a&&(i[Ce]=n(t)),i}):t},[t,i,r,o,n]),[h,d]=xe(null),[u,m]=xe([]),p=ve(i),y=ve(r);return ge(()=>{if(!i&&!r)return void((p.current||y.current)&&(d(null),m([]),p.current=i,y.current=r));let e=!1;const t=i!==p.current||r!==y.current;if(p.current=i,y.current=r,t&&(d(null),m([])),i){const t=a&&"string"==typeof a&&"object"==typeof i?{...i,_groupBy:a}:i;(async function(...e){return(await we()).buildForecast(...e)})(c,s,l,t,r).then(t=>{e||(d(t),m(t.annotations))}).catch(()=>{e||(d(null),m([]))})}else r&&async function(...e){return(await we()).buildAnomalyAnnotations(...e)}(r).then(t=>{e||(d(null),m(t))}).catch(()=>{e||m([])});return()=>{e=!0}},[c,i,r,s,l,a]),{effectiveData:h?h.processedData:t,statisticalAnnotations:u,hasForecast:!!h,xAccessorKey:s,yAccessorKey:l}}import{jsx as _e}from"react/jsx-runtime";var He=le(function(o,n){const r=ce(null),s=j(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:v="x",yAccessor:A="y",xScaleType:k,yScaleType:w,colorBy:S,colorScheme:C,styleRules:L,sizeBy:_,sizeRange:H=[3,15],symbolBy:R,symbolMap:B,pointRadius:F=5,pointOpacity:P=.8,tooltip:M,marginalGraphics:O,pointIdAccessor:D,annotations:T,regression:G,forecast:z,anomaly:V,xExtent:$,yExtent:X,frameProps:Q={},selection:Y,linkedHover:U,linkedBrush:q,onObservation:J,onClick:K,hoverHighlight:Z,chartId:oe,loading:ne,loadingContent:le,emptyContent:he,legendInteraction:ue,legendPosition:me,color:pe,stroke:ye,strokeWidth:ge,opacity:be}=o,{width:ve,height:xe,enableHover:Ae,showGrid:ke,showLegend:we,title:Se,description:Ce,summary:He,accessibleTable:Re,xLabel:Ie,yLabel:Be}=s,Fe=ae(()=>I(c),[c]),Pe=void 0===c,{domain:Ne,trackPushed:Me,reset:We}=fe({accessor:_,data:Fe,isPushMode:Pe}),Oe=se(e=>{Me([e]),r.current?.push(e)},[Me]),De=se(e=>{Me(e),r.current?.pushMany(e)},[Me]);a(n,{variant:"xy",frameRef:r,overrides:{push:Oe,pushMany:De,clear:()=>{We(),r.current?.clear()}}});const Te=i({data:Fe,rawData:c,colorBy:S,colorScheme:C,legendInteraction:ue,legendPosition:me,selection:Y,linkedHover:U,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:J,onClick:K,hoverHighlight:Z,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"Scatterplot",chartId:oe,showLegend:we,userMargin:h,marginDefaults:s.marginDefaults,loading:ne,loadingContent:le,emptyContent:he,width:ve,height:xe,hasTitle:!!Se}),Ee=W(q),Ge=E({name:Ee?.name||"__unused_brush__",xField:Ee?.xField||("string"==typeof v?v:void 0),yField:Ee?.yField||("string"==typeof A?A:void 0)}),je=Ee?"xyBrush"===Ge.brushInteraction.brush?"xy":"xBrush"===Ge.brushInteraction.brush?"x":"y":void 0,ze=re.useRef(Ge.brushInteraction);ze.current=Ge.brushInteraction;const Ve=se(e=>{const t=ze.current;t.end(e?"xyBrush"===t.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===t.brush?e.x:e.y:null)},[]);ie("Scatterplot",Fe,"xAccessor",v),ie("Scatterplot",Fe,"yAccessor",A);const $e=ae(()=>_?Ne??[0,1]:void 0,[_,Ne]),Xe=ae(()=>_?e=>N(e,_,H,$e):void 0,[_,H,$e]),Qe=ae(()=>x(v,A),[v,A]),Ye=de({colorBy:S,colorScale:Te.colorScale,color:pe,pointRadius:F,fillOpacity:P,radiusFn:Xe,stroke:ye,strokeWidth:ge,opacity:be,styleRules:L,ruleContext:Qe,effectiveSelectionHook:Te.effectiveSelectionHook,resolvedSelection:Te.resolvedSelection}),Ue=ae(()=>g([{label:Ie||m(v),accessor:v,role:"x",format:u},{label:Be||m(A),accessor:A,role:"y",format:p},...S?[{label:m(S),accessor:S,role:"color"}]:[],..._?[{label:m(_),accessor:_,role:"size"}]:[]]),[v,A,Ie,Be,S,_,u,p]),{effectiveData:qe,statisticalAnnotations:Je}=Le({data:Fe,xAccessor:v,yAccessor:A,forecast:z,anomaly:V}),Ke=ae(()=>{const t=e(G);return t||0!==Je.length?[...t?[t]:[],...T||[],...Je]:T},[G,T,Je]);if(Te.earlyReturn)return Te.earlyReturn;const Ze=t({componentName:"Scatterplot",data:c,accessors:{xAccessor:v,yAccessor:A}});if(Ze)return _e(ee,{componentName:"Scatterplot",message:Ze,width:ve,height:xe});const et={chartType:"scatter",...null!=c&&{data:qe},xAccessor:v,yAccessor:A,xScaleType:k,yScaleType:w,colorAccessor:S||void 0,sizeAccessor:_||void 0,...R&&{symbolAccessor:R},...B&&{symbolMap:B},sizeRange:H,pointStyle:Ye,colorScheme:C,size:[ve,xe],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:Te.margin,showAxes:s.showAxes,xLabel:Ie,yLabel:Be,xFormat:u,yFormat:p,enableHover:Ae,showGrid:ke,...Te.legendBehaviorProps,...y({title:Se,description:Ce,summary:He,accessibleTable:Re,className:d,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...b({tooltip:M,defaultTooltipContent:Ue}),...f({linkedHover:U,selection:Y,onObservation:J,onClick:K,hoverHighlight:Z,mobileInteraction:Te.mobileInteraction,customHoverBehavior:Te.customHoverBehavior,customClickBehavior:Te.customClickBehavior}),...O&&{marginalGraphics:O},...D&&{pointIdAccessor:D},...Ke&&Ke.length>0&&{annotations:Ke},...$&&{xExtent:$},...X&&{yExtent:X},...Ee&&{brush:{dimension:je},onBrush:Ve},...Te.crosshairProps,...Q};return _e(te,{componentName:"Scatterplot",width:ve,height:xe,children:_e(l,{ref:r,...et})})});He.displayName="Scatterplot";import{useMemo as Re,forwardRef as Ie,useRef as Be}from"react";import{Fragment as Fe,jsx as Pe}from"react/jsx-runtime";function Ne(e,t){return M(1===t?.5:e/(t-1))}var Me=Ie(function(o,n){const r=Be(null);a(n,{variant:"xy",frameRef:r});const s=j(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:v="x",yAccessor:A="y",orderAccessor:k,orderLabel:w,styleRules:S,pointRadius:L=4,tooltip:_,pointIdAccessor:H,annotations:R,regression:I,forecast:B,anomaly:F,xExtent:P,yExtent:N,frameProps:M={},selection:W,linkedHover:O,onObservation:D,onClick:T,hoverHighlight:E,chartId:G,loading:z,loadingContent:V,emptyContent:$,legendInteraction:X,stroke:Q,strokeWidth:Y,opacity:U}=o,{width:q,height:J,enableHover:K,showGrid:Z,title:oe,description:ne,summary:re,accessibleTable:ae,xLabel:se,yLabel:le}=s,{safeData:ce,orderMap:he}=Re(()=>{const e=c||[],t="function"==typeof v?v:e=>e[v],o="function"==typeof A?A:e=>e[A];let n=e;if(k&&e.length>0){const t="function"==typeof k?k:e=>e[k];n=[...e].sort((e,o)=>{const n=t(e),i=t(o);return(n instanceof Date?n.getTime():+n)-(i instanceof Date?i.getTime():+i)})}const i=new WeakMap;let r=0;for(const e of n){const n=t(e),i=o(e);null!=n&&null!=i&&isFinite(n)&&isFinite(i)&&r++}let a=0;for(const e of n){const n=t(e),s=o(e);null!=n&&null!=s&&isFinite(n)&&isFinite(s)&&i.set(e,{idx:a++,total:r})}return{safeData:n,orderMap:i}},[c,k,v,A]);ie("ConnectedScatterplot",ce,"xAccessor",v),ie("ConnectedScatterplot",ce,"yAccessor",A);const ue=i({data:ce,rawData:c,colorBy:void 0,colorScheme:void 0,legendInteraction:X,selection:W,linkedHover:O,fallbackFields:[],unwrapData:!1,onObservation:D,onClick:T,hoverHighlight:E,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"ConnectedScatterplot",chartId:G,showLegend:void 0,userMargin:h,marginDefaults:s.marginDefaults,loading:z,loadingContent:V,emptyContent:$,width:q,height:J,hasTitle:!!oe}),me=ue.resolvedSelection?.unselectedOpacity??C,pe=Re(()=>(e,t)=>{const o=t.filter(e=>"point"===e.type);if(2>o.length)return;const n=ue.effectiveSelectionHook?.isActive,i=ue.effectiveSelectionHook?.predicate,r=100>o.length,a=o.length;e.lineCap="round";for(let t=0;a-1>t;t++){const s=o[t],l=o[t+1],c=Ne(t,a),h=!n||!i||i(s.datum??s)||i(l.datum??l),d=n?h?1:me:1;r&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle="white",e.lineWidth=L+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(l.x,l.y),e.strokeStyle=c,e.lineWidth=L,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[L,ue.effectiveSelectionHook,me]),ye=Re(()=>[pe],[pe]),fe=Re(()=>(e,t,o)=>{const n=e.filter(e=>"point"===e.type);if(2>n.length)return null;const i=n.length,r=100>i,a=[];for(let e=0;i-1>e;e++){const t=n[e],o=n[e+1],s=Ne(e,i),l=Math.min("number"==typeof t.style?.opacity?t.style.opacity:1,"number"==typeof o.style?.opacity?o.style.opacity:1);r&&a.push(Pe("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:L+2,strokeLinecap:"round",opacity:.5*l},"halo-"+e)),a.push(Pe("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:s,strokeWidth:L,strokeLinecap:"round",opacity:l},"seg-"+e))}return Pe(Fe,{children:a})},[L]),ge=Re(()=>[fe],[fe]),be=de({colorScale:void 0,baseStyleExtras:Re(()=>e=>{const t=he.get(e),o=t?.idx??0,n=t?.total??1;return{fill:n>0?Ne(o,n):"#6366f1",stroke:"white",strokeWidth:1,r:L,fillOpacity:1}},[L,he]),stroke:Q,strokeWidth:Y,opacity:U,styleRules:S,ruleContext:Re(()=>x(v,A),[v,A]),effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection}),ve=w||("string"==typeof k?k:"Order"),xe=Re(()=>g([{label:se||m(v),accessor:v,role:"x",format:u},{label:le||m(A),accessor:A,role:"y",format:p},...k?[{label:ve,accessor:k,role:"group"}]:[]]),[v,A,se,le,k,ve,u,p]),Ae=t({componentName:"ConnectedScatterplot",data:c,accessors:{xAccessor:v,yAccessor:A}}),{effectiveData:ke,statisticalAnnotations:we}=Le({data:ce,xAccessor:v,yAccessor:A,forecast:B,anomaly:F});if(ue.earlyReturn)return ue.earlyReturn;const Se=e(I),Ce=Se||we.length>0?[...Se?[Se]:[],...R||[],...we]:R,_e={chartType:"scatter",...null!=c&&{data:ke},xAccessor:v,yAccessor:A,pointStyle:be,size:[q,J],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ue.margin,showAxes:s.showAxes,xLabel:se,yLabel:le,xFormat:u,yFormat:p,enableHover:K,showGrid:Z,...y({title:oe,description:ne,summary:re,accessibleTable:ae,className:d,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...b({tooltip:_,defaultTooltipContent:xe}),...f({linkedHover:O,selection:W,onObservation:D,onClick:T,hoverHighlight:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...H&&{pointIdAccessor:H},canvasPreRenderers:ye,svgPreRenderers:ge,...Ce&&Ce.length>0&&{annotations:Ce},...P&&{xExtent:P},...N&&{yExtent:N},...ue.crosshairProps,...M};return Ae?Pe(ee,{componentName:"ConnectedScatterplot",message:Ae,width:q,height:J}):Pe(te,{componentName:"ConnectedScatterplot",width:q,height:J,children:Pe(l,{ref:r,..._e})})});Me.displayName="ConnectedScatterplot";import{useMemo as We,useCallback as Oe,useState as De,useEffect as Te,forwardRef as Ee,useRef as Ge}from"react";import{useMemo as je}from"react";function ze(e){const{lineWidth:t=2,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:u,resolvedSelection:m,styleRules:p,ruleContext:y}=e,f=je(()=>function(e){const{lineWidth:t=2,colorBy:o,colorScale:n,color:i,resolveStroke:r,fillArea:a,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,h)=>{const d={strokeWidth:t},u=!0===a||Array.isArray(a)&&null!=h&&a.includes(h);let m;return r?m=r(e,h):o?n&&(m=B(e,o,n)):m=i||w,void 0!==m&&(d.stroke=m,u&&(d.fill=m,d.fillOpacity=s)),l?.length&&Object.assign(d,A(e,l,c?c(e,h):{value:void 0,category:h})),d}}({lineWidth:t,colorBy:n,colorScale:i,color:r,resolveStroke:a,fillArea:s,areaOpacity:l,styleRules:p,ruleContext:y}),[t,n,i,r,a,s,l,p,y]),g=je(()=>o(f,{stroke:c,strokeWidth:h,opacity:d}),[f,c,h,d]);return je(()=>q(g,u??null,m),[g,u,m])}import{jsx as Ve}from"react/jsx-runtime";var $e="__lineObjectSeries",Xe=Ee(function(e,o){const n=Ge(null);a(o,{variant:"xy",frameRef:n});const r=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:h,className:d,xFormat:u,yFormat:y,axisExtent:b,xAccessor:v="x",yAccessor:A="y",lineBy:k,lineDataAccessor:S="coordinates",colorBy:C,colorScheme:L,styleRules:R,curve:F="linear",showPoints:P=!1,pointRadius:N=3,fillArea:M=!1,areaOpacity:W=.3,lineWidth:D=2,lineGradient:T,tooltip:E,pointIdAccessor:G,annotations:z,directLabel:V,gapStrategy:$="break",anomaly:X,forecast:Q,band:Y,xExtent:U,yExtent:q,frameProps:J={},selection:K,linkedHover:Z,onObservation:oe,onClick:ne,hoverHighlight:re,hoverRadius:ae,chartId:se,loading:le,loadingContent:ce,emptyContent:he,legendInteraction:de,legendPosition:ue,legend:me,xScaleType:pe,yScaleType:ye,color:fe,stroke:ge,strokeWidth:be,opacity:ve}=e,{legend:xe,...ke}=J,Se=We(()=>H(xe,me),[xe,me]),{width:Ce,height:_e,enableHover:He,showGrid:Re,showLegend:Ie,title:Be,description:Fe,summary:Pe,accessibleTable:Ne,xLabel:Me,yLabel:Ee}=r,je=We(()=>I(s),[s]),Xe=Array.isArray(je[0]?.[S])?je[0][S]:je;ie("LineChart",Xe,"xAccessor",v),ie("LineChart",Xe,"yAccessor",A);const{effectiveData:Qe,statisticalAnnotations:Ye}=Le({data:je,xAccessor:v,yAccessor:A,forecast:Q,anomaly:X,groupBy:k}),Ue="__compoundGroup",qe=!(!Q||!k),Je=qe?Ue:Q?Ae:k,Ke=We(()=>{if(!qe)return Qe;const e="function"==typeof k?k:e=>e[k];return Qe.map(t=>{const o={...t};return o[Ue]=`${e(t)}__${t[Ae]||"observed"}`,o})},[Qe,qe,k]),Ze=qe?Ke:Qe,et=C||k,tt=We(()=>{if(!Q)return;const e=Q.upperBounds,t=Q.lowerBounds;if(!e&&!t)return;const o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,n="function"==typeof t?t:"string"==typeof t?e=>e[t]:null;let i=1/0,r=-1/0;const a=Qe;for(const e of a){const t="function"==typeof A?A(e):+e[A];if(isFinite(t)&&(i>t&&(i=t),t>r&&(r=t)),o){const t=o(e);null!=t&&isFinite(t)&&(t>r&&(r=t),i>t&&(i=t))}if(n){const t=n(e);null!=t&&isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}}return isFinite(i)&&isFinite(r)?[i,r]:void 0},[Q,Qe,A]),ot=Oe(e=>{const t="function"==typeof v?v(e):e[v],o="function"==typeof A?A(e):e[A];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[v,A]),nt=void 0!==Ze[0]?.[S],it=nt?$e:Je,rt=We(()=>{if(nt)return Ze.map((e,t)=>{const o="function"==typeof k?k(e):"string"==typeof k?e[k]:void 0,n=null==o?"line-"+t:o+"",i=Array.isArray(e[S])?e[S]:[];return{...e,[$e]:n,[S]:i.map(t=>({...t,[$e]:n,parentLine:e,..."string"==typeof k&&void 0!==e[k]?{[k]:e[k]}:{}}))}});if(Je){const e=Ze.reduce((e,t)=>{const o="function"==typeof Je?Je(t):t[Je];if(!e[o]){const n={[S]:[]};"string"==typeof Je&&(n[Je]=o),qe&&(n[Ae]=t[Ae],"string"==typeof k&&(n[k]=t[k])),e[o]=n}return e[o][S].push(t),e},{});return Object.values(e)}return[{[S]:Ze}]},[nt,Je,S,Ze,k,qe]),{gapProcessedLineData:at,hasGaps:st}=We(()=>{if("interpolate"===$){let e=!1;const t=[];for(const o of rt){const n=(o[S]||[]).filter(t=>!ot(t)||(e=!0,!1));n.length>0&&t.push({...o,[S]:n})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===$){let e=!1;const t=[];for(const o of rt){const n=o[S]||[];let i=[],r=0;const a=it&&"string"==typeof it?o[it]:void 0;for(const s of n)if(ot(s))e=!0,i.length>0&&(t.push({...o,[S]:i}),i=[],r++);else{const e=null!=a?`${a}__seg${r}`:"__seg"+r;i.push({...s,_gapSegment:e})}i.length>0&&t.push({...o,[S]:i})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===$){let e=!1;const t="string"==typeof A?A:"y",o=[];for(const n of rt){const i=n[S]||[],r=[];for(const o of i)ot(o)?(e=!0,r.push({...o,[t]:0})):r.push(o);o.push({...n,[S]:r})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:rt,hasGaps:!1}},[rt,$,S,ot,it,A]),lt="object"==typeof V?V:{},ct=lt.position||"end",ht=lt.fontSize||11,dt=We(()=>{if(!V||!et)return[];const e="function"==typeof et?et:e=>e[et],t=new Set;for(const o of at){const n=o[S]||[];if(0===n.length)continue;const i=e("end"===ct?n[n.length-1]:n[0])??e(o);if(null==i)continue;const r=i+"";""!==r&&t.add(r)}return Array.from(t)},[V,et,at,S,ct]),ut=We(()=>{if(!V)return r.marginDefaults;const e=dt.reduce((e,t)=>Math.max(e,t.length*(.6*ht)),0)+10,t="end"===ct?"right":"left";return{...r.marginDefaults,[t]:Math.max(r.marginDefaults[t]||0,e)}},[V,dt,ht,ct,r.marginDefaults]),mt=i({data:Qe,rawData:s,colorBy:et,colorScheme:L,legendInteraction:de,legendPosition:ue,selection:K,linkedHover:Z,fallbackFields:et?["string"==typeof et?et:""]:[],unwrapData:!1,onObservation:oe,onClick:ne,hoverHighlight:re,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"LineChart",chartId:se,showLegend:(!V||void 0!==Ie)&&Ie,legend:Se,userMargin:h,marginDefaults:ut,loading:le,loadingContent:ce,emptyContent:he,width:Ce,height:_e,hasTitle:!!Be}),pt=mt.colorScale,yt=mt.effectiveSelectionHook,ft=mt.resolvedSelection,gt=mt.customHoverBehavior,bt=mt.customClickBehavior,vt=mt.crosshairProps,xt=We(()=>{if(et)return nt?e=>{const t=e.parentLine||e;return"function"==typeof et?et(t):t[et]}:et},[et,nt]),At=We(()=>x(v,A),[v,A]),kt=ze({lineWidth:D,colorBy:xt,colorScale:pt,color:fe,fillArea:M,areaOpacity:W,stroke:ge,strokeWidth:be,opacity:ve,effectiveSelectionHook:yt,resolvedSelection:ft,styleRules:R,ruleContext:At}),[wt,St]=De(null);Te(()=>{if(!Q)return void St(null);let e=!1;return async function(...e){return(await we()).createSegmentLineStyle(...e)}(kt,Q).then(t=>{e||St(()=>t)}).catch(()=>{e||St(null)}),()=>{e=!0}},[kt,Q]);const Ct=wt||kt,Lt=We(()=>{if(P)return e=>{const t={r:N,fillOpacity:1};return et?pt&&(t.fill=B(e.parentLine||e,et,pt)):t.fill=fe||w,t}},[P,N,et,pt,fe]),_t=Array.isArray(M)?"mixed":M?"area":"line",Ht=We(()=>{if(!V||!et)return[];const e="function"==typeof v?v:e=>e[v],t="function"==typeof A?A:e=>e[A],o="function"==typeof et?et:e=>e[et],n=new Map;for(const e of at){const t=e[S]||[];if(0===t.length)continue;const i="end"===ct?t[t.length-1]:t[0],r=o(i)??o(e);if(null==r)continue;const a=r+"";""===a||n.has(a)||n.set(a,i)}const i=Array.from(n.entries()).map(([o,n])=>({type:"text",label:o,["string"==typeof v?v:"x"]:e(n),["string"==typeof A?A:"y"]:t(n),dx:"end"===ct?6:-6,dy:0,color:pt?pt(o):w,fontSize:ht}));i.sort((e,t)=>{const o="string"==typeof A?A:"y";return e[o]-t[o]});for(let e=1;i.length>e;e++){const t="string"==typeof A?A:"y",o=i[e-1],n=i[e];ht+2>Math.abs(n[t]+n.dy-(o[t]+o.dy))&&(n.dy+=ht+2)}return i},[V,et,pt,at,S,v,A,ct,ht]),Rt=mt.margin,It=k||C,Bt=We(()=>g([{label:Me||m(v),accessor:v,role:"x",format:u},{label:Ee||m(A),accessor:A,role:"y",format:y},...It?[{label:m(It),accessor:It,role:"group"}]:[],...p(Y,y)]),[v,A,Me,Ee,It,u,y,Y]),Ft=t({componentName:"LineChart",data:nt?Qe[0]?.[S]||[]:s,accessors:{xAccessor:v,yAccessor:A}}),Pt=We(()=>nt||it||st?at.flatMap(e=>{const t=e[S]||[];return it&&"string"==typeof it?t.map(t=>({...t,[it]:t[it]??e[it]})):t}):Ze,[at,S,nt,it,Ze,st]),Nt=c(T),Mt={chartType:_t,...Array.isArray(M)&&{areaGroups:M},...Nt&&{lineGradient:Nt},...null!=s&&{data:Pt},xAccessor:v,yAccessor:A,xScaleType:pe,yScaleType:ye,...U&&{xExtent:U},...!q||null==q[0]&&null==q[1]?tt?{yExtent:tt}:{}:{yExtent:q},groupAccessor:"break"===$&&st?"_gapSegment":it||void 0,...Y&&{band:Y},curve:F,lineStyle:Ct,...P&&{pointStyle:Lt},size:[Ce,_e],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Rt,showAxes:r.showAxes,xLabel:Me,yLabel:Ee,xFormat:u,yFormat:y,...void 0!==b&&{axisExtent:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:He,showGrid:Re,...mt.legendBehaviorProps,...Be&&{title:Be},...Fe&&{description:Fe},...Pe&&{summary:Pe},...void 0!==Ne&&{accessibleTable:Ne},...d&&{className:d},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===E?()=>null:"multi"===E?_():O(E)||Bt,..."multi"===E&&{tooltipMode:"multi"},...f({linkedHover:Z,selection:K,onObservation:oe,onClick:ne,hoverRadius:ae,hoverHighlight:re,mobileInteraction:mt.mobileInteraction,customHoverBehavior:gt,customClickBehavior:bt}),...G&&{pointIdAccessor:G},...(z?.length||Ye.length||Ht.length)&&{annotations:[...z||[],...Ye,...Ht]},...vt,...ke};return mt.earlyReturn?mt.earlyReturn:Ft?Ve(ee,{componentName:"LineChart",message:Ft,width:Ce,height:_e}):Ve(te,{componentName:"LineChart",width:Ce,height:_e,children:Ve(l,{ref:n,...Mt})})});Xe.displayName="LineChart";import{forwardRef as Qe,useMemo as Ye}from"react";import{jsx as Ue}from"react/jsx-runtime";var qe=Qe(function(e,t){const{data:o,layout:n,layoutConfig:i,onLayoutError:a,xExtent:s,yExtent:c,showAxes:h=!1,margin:d,className:u,annotations:m,onObservation:p,onClick:g,selection:b,linkedHover:v,hoverHighlight:x,chartId:A,loading:k,loadingContent:w,emptyContent:S,colorBy:C,colorScheme:L,legend:_,legendInteraction:R,legendPosition:I,frameProps:B={}}=e,{legend:F,...P}=B,N=Ye(()=>H(F,_),[F,_]),{frameRef:M,resolved:W,safeData:O,setup:D,earlyReturn:T}=r({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:C,colorScheme:L,legend:N,legendInteraction:R,legendPosition:I,selection:b,linkedHover:v,hoverHighlight:x,onObservation:p,onClick:g,chartId:A,loading:k,loadingContent:w,emptyContent:S,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),E=D.effectiveSelectionHook,G=Ye(()=>E?.isActive?{isActive:!0,predicate:E.predicate}:null,[E?.isActive,E?.predicate]);if(T)return T;const{width:j,height:z,enableHover:V,showGrid:$,title:X,description:Q,summary:Y,accessibleTable:U,xLabel:q,yLabel:J}=W,K={chartType:"custom",...null!=o&&{data:O},customLayout:n,layoutConfig:i,onLayoutError:a,...G&&{layoutSelection:G},xExtent:s,yExtent:c,colorAccessor:C,colorScheme:L,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:D.margin,showAxes:h,xLabel:q,yLabel:J,enableHover:V,showGrid:$,...D.legendBehaviorProps,...y({title:X,description:Q,summary:Y,accessibleTable:U,className:u,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...null!=e.tooltip&&{tooltipContent:e.tooltip},...f({linkedHover:v,selection:b,onObservation:p,onClick:g,hoverRadius:e.hoverRadius,hoverHighlight:x,mobileInteraction:D.mobileInteraction,customHoverBehavior:D.customHoverBehavior,customClickBehavior:D.customClickBehavior}),...m&&m.length>0&&{annotations:m},...D.crosshairProps,...P};return Ue(te,{componentName:"XYCustomChart",width:j,height:z,children:Ue(l,{ref:M,...K})})});qe.displayName="XYCustomChart";import{forwardRef as Je,useCallback as Ke,useMemo as Ze}from"react";function et(e,t,o,n,i){const r=1-i;return r*r*r*e+3*r*r*i*t+3*r*i*i*o+i*i*i*n}function tt(e,t,o,n,i){const r=1-i;return 3*r*r*(t-e)+6*r*i*(o-t)+3*i*i*(n-o)}function ot(e,t,o,n,i){const r=[],a=(e.x+t.x)/2;for(let s=0;i>=s;s++){const l=s/i;let c,h,d,u;"linear"===n?(c=e.x+(t.x-e.x)*l,h=e.y+(t.y-e.y)*l,d=t.x-e.x,u=t.y-e.y):(c=et(e.x,a,a,t.x,l),h=et(e.y,e.y,t.y,t.y,l),d=tt(e.x,a,a,t.x,l),u=tt(e.y,e.y,t.y,t.y,l)),r.push({x:c,y:h,dx:d,dy:u,radius:e.radius+(t.radius-e.radius)*l,datumIndex:.5>l?o:o+1})}return r}function nt(e,t={}){const o=[],n=[],i=[];if(2>e.length)return{topPath:o,bottomPath:n,datumIndices:i};const r=t.curve??"smooth",a=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;e.length-1>t;t++){const s=ot(e[t],e[t+1],t,r,a);for(let e=0===t?0:1;s.length>e;e++){const t=s[e],r=Math.hypot(t.dx,t.dy)||1,a=-t.dy/r,l=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+a*c,t.y+l*c]),n.push([t.x-a*c,t.y-l*c]),i.push(t.datumIndex)}}return{topPath:o,bottomPath:n,datumIndices:i}}import{jsx as it,jsxs as rt}from"react/jsx-runtime";function at(e,t,o){return"function"==typeof e?e(t,o):t[e]}function st(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}function lt(e,t={}){const o=t.xAccessor??"x",n=t.yAccessor??"y",i=t.lineBy??"series",r=t.rankDirection??"descending",a=[],s=new Map,l=new Map,c=[],h=new Map;let d=1/0,u=-1/0;e.forEach((e,t)=>{const r=at(o,e,t),m=st(r);let p=s.get(m);null==p&&(p=a.length,s.set(m,p),a.push(r),l.set(p,[]));const y=at(i,e,t)+"";h.has(y)||(h.set(y,c.length),c.push(y));const f=Number(at(n,e,t));Number.isFinite(f)&&(d=Math.min(d,f),u=Math.max(u,f),l.get(p)?.push({datum:e,inputIndex:t,series:y,value:f}))});const m=[],p=new Map,y=new Map;for(let e=0;a.length>e;e++){const t=l.get(e)??[];t.sort((e,t)=>("descending"===r?t.value-e.value:e.value-t.value)||(h.get(e.series)??0)-(h.get(t.series)??0)),t.forEach((t,o)=>{const n=o+1;m.push({datum:t.datum,xIndex:e,xValue:a[e],series:t.series,value:t.value,rank:n}),p.set(t.series,(p.get(t.series)??0)+n),y.set(t.series,(y.get(t.series)??0)+1)})}const f=c.length+1,g=[...c].sort((e,t)=>{const o=y.get(e)??0,n=y.get(t)??0;return((p.get(e)??0)+(a.length-o)*f)/Math.max(1,a.length)-((p.get(t)??0)+(a.length-n)*f)/Math.max(1,a.length)||(h.get(e)??0)-(h.get(t)??0)}),b=new Set(g.slice(0,null==t.highlightTop?g.length:Math.max(0,Math.floor(t.highlightTop))));return{data:m.map(e=>{const t=b.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:"Other",__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:a,seriesOrder:c,overallOrder:g,valueExtent:d===1/0?[0,0]:[d,u]}}function ct({datum:e,x:t,y:o,side:n,color:i,highlighted:r,labelStyle:a}){const s=v(),l=s.isActive&&!s.predicate(e),c="function"==typeof a?a(e.__bumpRaw):a;return it("text",{className:"semiotic-bump-label",x:t+("end"===n?8:-8),y:o,dy:"0.35em",textAnchor:"end"===n?"start":"end",fill:i,fillOpacity:l?.16:1,fontWeight:r?650:450,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 11px)",...c},children:e.__bumpSeries})}function ht(e,t,o){const[n,i]=t,[r,a]=o;return i===n?(r+a)/2:r+(a-r)*Math.max(0,Math.min(1,(e-n)/(i-n)))}function dt(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:void 0}function ut(e){return{value:e.__bumpValue,x:dt(e.__bumpXValue),y:e.__bumpValue,category:e.__bumpSeries}}function mt(e){const t=e.config,o=new Map;for(const t of e.data){const e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}const n=t.seriesOrder.filter(e=>o.has(e)).sort((e,n)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(n)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(n)),i=[],r=[];for(const a of n){const n=(o.get(a)??[]).sort((e,t)=>e.x-t.x);if(2>n.length)continue;const s=n[0].__bumpHighlighted,l=e.resolveColor(n[0].__bumpSeries,n[0]),c=t.color??(s?l:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??l),h=n.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?ht(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),d=nt(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),u=d.datumIndices.map(e=>n[e]),m={fill:c,fillOpacity:1,opacity:s?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(m,A(n[0].__bumpRaw,t.styleRules,ut(n[0]))),t.areaStyle&&Object.assign(m,t.areaStyle(n[0].__bumpRaw)??{}),void 0!==t.stroke&&(m.stroke=t.stroke),void 0!==t.strokeWidth&&(m.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(m.opacity=t.opacity),i.push({type:"area",topPath:d.topPath,bottomPath:d.bottomPath,style:m,datum:u,accessibleDatum:n.map(e=>e.__bumpRaw),accessibility:{label:a+" ranking trajectory",tableFields:n.map(e=>e.__bumpRaw)},group:a,interactive:!0}),t.showPoints&&n.forEach((e,o)=>{const n={fill:c,stroke:"none",opacity:s?1:.75};t.styleRules?.length&&Object.assign(n,A(e.__bumpRaw,t.styleRules,ut(e))),t.pointStyle&&Object.assign(n,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),i.push({type:"point",x:h[o].x,y:h[o].y,r:n.r??t.pointRadius,style:n,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${a}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${a}:${e.x}`})});const p=!0===t.showLabels?"end":t.showLabels,y=(e,o,n)=>{r.push(it(ct,{datum:e,x:h[o].x,y:h[o].y,side:n,color:"string"==typeof m.fill?m.fill:c,highlighted:s,labelStyle:t.labelStyle},`${a}-${n}`))};"start"!==p&&"both"!==p||y(n[0],0,"start"),"end"!==p&&"both"!==p||y(n.at(-1),n.length-1,"end")}return{nodes:i,overlays:r.length?it("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{const o=function(e){const t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}var pt=Je(function(e,t){const o=Y(),n=Z(),{data:i,xAccessor:r,yAccessor:a,lineBy:s,rankDirection:l="descending",ribbon:c=!1,curve:h="smooth",ribbonSizeRange:d=[4,28],samplesPerSegment:u=12,lineWidth:m=3,highlightTop:p,neutralColor:y,styleRules:f,labelStyle:g,colorScheme:b,ribbonOpacity:v=.82,lineOpacity:x=.9,showPoints:A=!1,pointRadius:k=3,showLabels:w=!0,showAxes:S=!0,showGrid:C=!0,showLegend:L=!1,enableHover:_=!0,hoverHighlight:H=!0,tooltip:I,frameProps:B={},xFormat:F,yFormat:P,onClick:N}=e,M=Ze(()=>lt(i,{xAccessor:r,yAccessor:a,lineBy:s,rankDirection:l,highlightTop:p}),[i,r,a,s,l,p]),{axes:W,areaStyle:T,pointStyle:E,...G}=B,j=Ze(()=>function(e){const{seriesOrder:t,overallOrder:o,highlightTop:n,color:i,colorScheme:r,neutralColor:a,themeCategorical:s,themeNeutral:l}=e;if(null==n&&null==i)return r;const c=new Set(o.slice(0,null==n?o.length:Math.max(0,Math.floor(n)))),h=new Map,d={};for(const e of t)d[e]=i??(c.has(e)?D(void 0,s,r,e,h):a??l??"#b8bec8");return d}({seriesOrder:M.seriesOrder,overallOrder:M.overallOrder,highlightTop:p,color:e.color,colorScheme:b,neutralColor:y,themeCategorical:o,themeNeutral:n.colors.textSecondary}),[M.seriesOrder,M.overallOrder,p,e.color,b,y,o,n.colors.textSecondary]),z=Ze(()=>({ribbon:c,curve:h,samplesPerSegment:u,ribbonSizeRange:d,valueExtent:M.valueExtent,seriesOrder:M.seriesOrder,lineWidth:m,ribbonOpacity:v,lineOpacity:x,neutralColor:y,color:e.color,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:f,areaStyle:T,pointStyle:E,labelStyle:g,showPoints:A,pointRadius:k,showLabels:w}),[c,h,u,d,M.valueExtent,M.seriesOrder,m,v,x,y,e.color,e.stroke,e.strokeWidth,e.opacity,f,T,E,g,A,k,w]),V=Ke((e,t)=>{if(0===M.xValues.length)return"";const o=M.xValues[Math.max(0,Math.min(M.xValues.length-1,Math.round(Number(e))))];return F?F(o,t):(o instanceof Date?o.toLocaleDateString():o)+""},[M.xValues,F]),$=Ke(e=>P?P(e):e.toLocaleString(),[P]),X=Ze(()=>"multi"===I?void 0:O(I),[I]),Q=Ke(e=>{const t=e?.data??e;return t?!1===I?null:X?X({...e,data:t.__bumpRaw,__semioticHoverData:!0}):rt("div",{className:"semiotic-tooltip",style:R,children:[it("div",{style:{fontWeight:700},children:t.__bumpSeries}),rt("div",{children:[V(t.x)," · Rank ",t.__bumpRank]}),rt("div",{children:["Value: ",$(t.__bumpValue)]})]}):null},[$,V,X,I]),U=Ze(()=>{if(N)return(e,t)=>{N(e.__bumpRaw??e,t)}},[N]),q=Math.max(1,M.seriesOrder.length),J=M.xValues.map((e,t)=>t),K=Array.from({length:q},(e,t)=>t+1),ee=W??[{orient:"left",tickValues:K,tickFormat:e=>e+"",label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:J,tickFormat:V,label:e.xLabel,tickAnchor:"edges"}],te=Ze(()=>function(e,t){if(!e?.length)return;const o=new Map(t.map((e,t)=>[st(e),t]));return e.map(e=>{const t={...e},n=n=>{if(!(n in e))return;const i=o.get(st(e[n]));void 0!==i&&(t[n]=i)};return n("x"),n("x0"),n("x1"),"string"!=typeof e.type||"x-threshold"!==e.type&&"x"!==e.type||n("value"),t})}(e.annotations,M.xValues),[e.annotations,M.xValues]);return it(qe,{ref:t,data:M.data,layout:mt,layoutConfig:z,xExtent:[0,Math.max(1,M.xValues.length-1)],yExtent:[q+.5,.5],showAxes:S,showGrid:C,showLegend:L,enableHover:_,hoverHighlight:H,colorBy:"__bumpSeries",colorScheme:j,tooltip:Q,onClick:U,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:e.margin??{top:20,right:w?110:24,bottom:48,left:48},className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:te,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:ee,axisExtent:"exact",...G}})});pt.displayName="BumpChart";import{useMemo as yt,forwardRef as ft,useRef as gt}from"react";import{useMemo as bt}from"react";function vt(e){const{safeData:t,data:n,areaBy:i,lineDataAccessor:r,colorBy:a,colorScale:s,color:l,stroke:c,strokeWidth:h,opacity:d,effectiveSelectionHook:u,resolvedSelection:y,areaOpacity:f,showLine:b,lineWidth:v,showPoints:x,pointRadius:k,xAccessor:S,yAccessor:C,xLabel:L,yLabel:_,xFormat:H,yFormat:R,groupField:I,styleRules:F,ruleContext:P}=e,N=bt(()=>function({data:e,safeData:t,areaBy:o,lineDataAccessor:n}){if(null==e)return[];const i=void 0!==t[0]?.[n];if(!i&&!o)return t;let r;if(i)r=t;else{const e=t.reduce((e,t)=>{const i="function"==typeof o?o(t):t[o],r=i+"";if(!e[r]){const t={[n]:[]};"string"==typeof o&&(t[o]=i),e[r]=t}return e[r][n].push(t),e},{});r=Object.values(e)}return r.flatMap(e=>{const t=Array.isArray(e[n])?e[n]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}({data:n,safeData:t,areaBy:i,lineDataAccessor:r}),[n,t,i,r]),M=bt(()=>e=>{const t={};if(a){if(s){const o=B(e,a,s);t.fill=o,b?(t.stroke=o,t.strokeWidth=v):t.stroke="none"}}else{const e=l||w;t.fill=e,b?(t.stroke=e,t.strokeWidth=v):t.stroke="none"}return t.fillOpacity=f,F&&F.length>0&&Object.assign(t,A(e,F,P?P(e):{value:void 0})),t},[a,s,l,f,b,v,F,P]),W=bt(()=>o(M,{stroke:c,strokeWidth:h,opacity:d}),[M,c,h,d]);return{flattenedData:N,lineStyle:bt(()=>q(W,u??null,y),[W,u,y]),pointStyle:bt(()=>{if(x)return e=>{const t={r:k,fillOpacity:1};return a?s&&(t.fill=B(e.parentLine||e,a,s)):t.fill=l||w,t}},[x,k,a,s,l]),defaultTooltipContent:bt(()=>g([{label:L||m(S),accessor:S,role:"x",format:H},{label:_||m(C),accessor:C,role:"y",format:R},...I?[{label:m(I),accessor:I,role:"group"}]:[],...p(e.band,R)]),[S,C,L,_,I,H,R,e.band])}}import{jsx as xt}from"react/jsx-runtime";var At=ft(function(e,o){const n=gt(null);a(o,{variant:"xy",frameRef:n});const r=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:m,className:p,xFormat:g,yFormat:v,xAccessor:A="x",yAccessor:k="y",areaBy:w,y0Accessor:S,gradientFill:C=!1,semanticGradient:L,semanticLine:H=!0,lineDataAccessor:R="coordinates",colorBy:B,colorScheme:F,styleRules:P,curve:N="monotoneX",areaOpacity:M=.7,lineGradient:W,showLine:O=!0,lineWidth:D=2,showPoints:T=!1,pointRadius:E=3,tooltip:G,annotations:z,forecast:V,anomaly:$,band:X,xExtent:Q,yExtent:Y,frameProps:U={},selection:q,linkedHover:J,onObservation:K,onClick:Z,hoverHighlight:oe,chartId:ne,loading:re,loadingContent:ae,emptyContent:se,legendInteraction:le,legendPosition:ce,color:he,stroke:de,strokeWidth:ue,opacity:me}=e,{width:pe,height:ye,enableHover:fe,showGrid:ge,showLegend:be,title:ve,description:xe,summary:Ae,accessibleTable:ke,xLabel:we,yLabel:Se}=r,Ce=yt(()=>I(s),[s]),_e=B||w,He=yt(()=>d(L),[L]),Re=yt(()=>He?.stops.length?u(He):h(C),[He,C]),Ie=yt(()=>c(W),[W]),Be=yt(()=>H&&He?.stops.length?He.stops.flatMap(({offset:e,color:t})=>t?[{offset:e,color:t}]:[]):void 0,[He,H]);ie("AreaChart",Ce,"xAccessor",A),ie("AreaChart",Ce,"yAccessor",k);const Fe=i({data:Ce,rawData:s,colorBy:_e,colorScheme:F,legendInteraction:le,legendPosition:ce,selection:q,linkedHover:J,fallbackFields:_e?["string"==typeof _e?_e:""]:[],unwrapData:!1,onObservation:K,onClick:Z,hoverHighlight:oe,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"AreaChart",chartId:ne,showLegend:be,userMargin:m,marginDefaults:r.marginDefaults,loading:re,loadingContent:ae,emptyContent:se,width:pe,height:ye,hasTitle:!!ve}),{effectiveData:Pe,statisticalAnnotations:Ne}=Le({data:Ce,xAccessor:A,yAccessor:k,forecast:V,anomaly:$,groupBy:w}),Me=yt(()=>x(A,k),[A,k]),{flattenedData:We,lineStyle:Oe,pointStyle:De,defaultTooltipContent:Te}=vt({safeData:Pe,data:s,areaBy:w,lineDataAccessor:R,colorBy:_e,colorScale:Fe.colorScale,color:he,stroke:de,strokeWidth:ue,opacity:me,effectiveSelectionHook:Fe.effectiveSelectionHook,resolvedSelection:Fe.resolvedSelection,areaOpacity:M,showLine:O,lineWidth:D,showPoints:T,pointRadius:E,xAccessor:A,yAccessor:k,xLabel:we,yLabel:Se,xFormat:g,yFormat:v,groupField:w||B,band:X,styleRules:P,ruleContext:Me}),Ee=t({componentName:"AreaChart",data:s,accessors:{xAccessor:A,yAccessor:k}}),Ge={chartType:"area",...null!=s&&{data:We},xAccessor:A,yAccessor:k,groupAccessor:w||void 0,...S&&{y0Accessor:S},...X&&{band:X},...Re&&{gradientFill:Re},...Ie&&{lineGradient:Ie},...Be&&{semanticLineStops:Be},curve:N,lineStyle:Oe,...T&&De&&{pointStyle:De},size:[pe,ye],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Fe.margin,showAxes:r.showAxes,xLabel:we,yLabel:Se,xFormat:g,yFormat:v,enableHover:fe,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:ge,...Fe.legendBehaviorProps,...y({title:ve,description:xe,summary:Ae,accessibleTable:ke,className:p,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===G?{tooltipContent:_(),tooltipMode:"multi"}:b({tooltip:G,defaultTooltipContent:Te}),...f({linkedHover:J,selection:q,onObservation:K,onClick:Z,hoverHighlight:oe,mobileInteraction:Fe.mobileInteraction,customHoverBehavior:Fe.customHoverBehavior,customClickBehavior:Fe.customClickBehavior}),...(z&&z.length>0||Ne.length>0)&&{annotations:[...z||[],...Ne]},...Q&&{xExtent:Q},...Y&&{yExtent:Y},...Fe.crosshairProps,...U};return Fe.earlyReturn?Fe.earlyReturn:Ee?xt(ee,{componentName:"AreaChart",message:Ee,width:pe,height:ye}):xt(te,{componentName:"AreaChart",width:pe,height:ye,children:xt(l,{ref:n,...Ge})})});At.displayName="AreaChart";import{useMemo as kt,forwardRef as wt,useRef as St,useState as Ct,useImperativeHandle as Lt,useCallback as _t}from"react";import{jsx as Ht,jsxs as Rt}from"react/jsx-runtime";function It(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;const t=+e;return Number.isFinite(t)?t:NaN}return NaN}var Bt=wt(function(e,t){const o=St(null),n=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:s,xFormat:c,yFormat:d,xAccessor:u="x",seriesAAccessor:m="a",seriesBAccessor:p="b",seriesALabel:g="A",seriesBLabel:b="B",seriesAColor:v="var(--semiotic-danger, #dc2626)",seriesBColor:x="var(--semiotic-info, #2563eb)",showLines:A=!0,lineWidth:k=1.5,showPoints:w=!1,pointRadius:S=3,curve:C="linear",areaOpacity:L=.6,gradientFill:_,tooltip:H,annotations:B,xExtent:F,yExtent:P,frameProps:N={},selection:M,linkedHover:W,onObservation:D,onClick:T,hoverHighlight:E,chartId:G,loading:z,loadingContent:V,emptyContent:$,legendInteraction:X,legendPosition:Q,pointIdAccessor:Y,windowSize:U}=e,{width:q,height:J,enableHover:K,showGrid:Z,showLegend:ee,title:oe,description:ne,summary:ie,accessibleTable:re,xLabel:ae,yLabel:se}=n,le=kt(()=>"function"==typeof u?e=>It(u(e)):e=>It(e[u]),[u]),ce=kt(()=>"function"==typeof m?e=>It(m(e)):e=>It(e[m]),[m]),he=kt(()=>"function"==typeof p?e=>It(p(e)):e=>It(e[p]),[p]),[de,ue]=Ct([]),me=St([]),pe=null==r,ye=kt(()=>I(pe?de:r),[pe,de,r]),fe=kt(()=>function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];let a=0,s=null,l=null,c=[];const h=(e,t)=>e>t?"A":t>e?"B":null,d=e=>`seg-${a}-${e}`,u=e=>r.push(e),m=(e,t)=>{u({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:d(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;i.length>e;e++){const r=i[e],p=t(r),y=o(r),f=n(r);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(f))continue;const g=h(y,f);if(null!==g)if(null!=s){if(l&&l.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{const o=y-l.a-(f-l.b);if(0!==o){const n=Math.max(0,Math.min(1,(l.b-l.a)/o));e=l.x+n*(p-l.x),t=l.a+n*(y-l.a)}else e=l.x,t=l.a}u({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t}),a++,s=g,u({__x:e,__y:t,__y0:t,__diffSegment:d(s),__diffWinner:s,__valA:t,__valB:t});for(let e=1;c.length>e;e++)m(c[e],s)}else for(const e of c)m(e,s);c=[],u({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:d(s),__diffWinner:s,__valA:y,__valB:f,__sourceDatum:r}),l={x:p,a:y,b:f,w:g}}else{s=g;for(const e of c)m(e,s);c=[],u({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:d(s),__diffWinner:s,__valA:y,__valB:f,__sourceDatum:r}),l={x:p,a:y,b:f,w:g}}else c.push({x:p,y:y,datum:r})}for(const e of c)m(e,s??"A");return r}(ye,le,ce,he),[ye,le,ce,he]),ge=kt(()=>A?function(e,t,o,n){if(!e.length)return[];const i=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(const e of i){const i=t(e),a=o(e),s=n(e);Number.isFinite(a)&&r.push({__x:i,__y:a,__diffSegment:"line-A"}),Number.isFinite(s)&&r.push({__x:i,__y:s,__diffSegment:"line-B"})}return r}(ye,le,ce,he):[],[A,ye,le,ce,he]),be=kt(()=>[...fe,...ge],[fe,ge]),ve=kt(()=>{const e=new Set;for(const t of fe)e.add(t.__diffSegment);return Array.from(e)},[fe]);Lt(t,()=>{const e=e=>{const t=U&&e.length>U?e.slice(e.length-U):e;me.current=t,ue(t)},t=Y?"function"==typeof Y?Y:e=>e[Y]:null;return{push:t=>e([...me.current,t]),pushMany:t=>e([...me.current,...t]),remove:o=>{if(!t)return[];const n=Array.isArray(o)?o:[o],i=[],r=[];for(const e of me.current)n.includes(t(e))?i.push(e):r.push(e);return e(r),i},update:(o,n)=>{if(!t)return[];const i=Array.isArray(o)?o:[o],r=[],a=me.current.map(e=>{if(i.includes(t(e))){const t=n(e);return r.push(t),t}return e});return e(a),r},clear:()=>e([]),getData:()=>pe?me.current:ye,getScales:()=>o.current?.getScales()??null}},[pe,ye,Y,U]);const xe=i({data:ye,rawData:r,colorBy:"__diffWinner",colorScheme:[v,x],legendInteraction:X,legendPosition:Q,selection:M,linkedHover:W,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:D,onClick:T,hoverHighlight:E,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DifferenceChart",chartId:G,showLegend:ee,userMargin:a,marginDefaults:n.marginDefaults,loading:z,loadingContent:V,emptyContent:$,width:q,height:J,hasTitle:!!oe}),Ae=kt(()=>{if(!1!==ee)return{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:g,color:v},{label:b,color:x}]}]}},[ee,g,b,v,x]),ke=_t(e=>{const t=e.__diffSegment;return{fill:"A"==(t?.endsWith("-A")?"A":"B")?v:x,stroke:"none",fillOpacity:L}},[v,x,L]),we=_t(e=>({stroke:"A"==("line-A"===e.__diffSegment?"A":"B")?v:x,strokeWidth:k,fill:"none"}),[v,x,k]),Se=_t(e=>({fill:"A"==("line-A"===e.__diffSegment?"A":"B")?v:x,r:S}),[v,x,S]),Ce=_t(e=>{const t=e.data,o=e.allSeries,n=e.xValue??t?.__x;let i=t?.__valA,r=t?.__valB;if(o&&o.length>0){const e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(i=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=n&&(null==i||null==r)){const e=ye.find(e=>le(e)===n);e&&(null==i&&(i=ce(e)),null==r&&(r=he(e)))}const a=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=c&&null!=n?c(n):null!=n?n+"":"";return Rt("div",{className:"semiotic-tooltip",style:R,children:[s&&Ht("div",{style:{fontWeight:600,marginBottom:4},children:s}),Rt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[Ht("span",{style:{width:10,height:10,background:v,display:"inline-block",borderRadius:2}}),Rt("span",{children:[g,": ",a(i)]})]}),Rt("div",{style:{display:"flex",alignItems:"center",gap:6},children:[Ht("span",{style:{width:10,height:10,background:x,display:"inline-block",borderRadius:2}}),Rt("span",{children:[b,": ",a(r)]})]}),null!=i&&null!=r&&Number.isFinite(i)&&Number.isFinite(r)&&Rt("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",a(i-r)]})]})},[ye,le,ce,he,c,v,x,g,b]),Le="multi"===H,_e=kt(()=>!1===H?()=>null:Le?Ce:O(H)||Ce,[H,Le,Ce]),He=kt(()=>h(_,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[_]);if(xe.earlyReturn)return xe.earlyReturn;const Re={chartType:"mixed",data:be,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ve,curve:C,areaStyle:ke,lineStyle:we,...w&&{pointStyle:Se},size:[q,J],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe.margin,showAxes:n.showAxes,xLabel:ae,yLabel:se,xFormat:c,yFormat:d,enableHover:K,showGrid:Z,...He&&{gradientFill:He},...Ae&&{legend:Ae,legendPosition:xe.legendPosition},...y({title:oe,description:ne,summary:ie,accessibleTable:re,className:s,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:_e,...Le&&{tooltipMode:"multi"},...f({linkedHover:W,selection:M,onObservation:D,onClick:T,hoverHighlight:E,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior}),...B&&B.length>0&&{annotations:B},...F&&{xExtent:F},...P&&{yExtent:P},...xe.crosshairProps,...N};return Ht(te,{componentName:"DifferenceChart",width:q,height:J,children:Ht(l,{ref:o,...Re})})});"function"==typeof Bt&&(Bt.displayName="DifferenceChart");import{useMemo as Ft,forwardRef as Pt,useRef as Nt}from"react";import{jsx as Mt}from"react/jsx-runtime";var Wt=Pt(function(e,o){const n=Nt(null),r=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:m="x",yAccessor:p="y",areaBy:g,lineDataAccessor:v="coordinates",colorBy:A,colorScheme:k,styleRules:w,curve:S="monotoneX",areaOpacity:C=.7,showLine:L=!0,lineWidth:H=2,showPoints:R=!1,pointRadius:B=3,normalize:F=!1,baseline:P="zero",stackOrder:N,tooltip:M,annotations:W,xExtent:O,yExtent:D,frameProps:T={},selection:E,linkedHover:G,onObservation:z,onClick:V,hoverHighlight:$,chartId:X,loading:Q,loadingContent:Y,emptyContent:U,legendInteraction:q,legendPosition:J,color:K,stroke:Z,strokeWidth:oe,opacity:ne}=e,{width:ie,height:re,enableHover:ae,showGrid:se,showLegend:le,title:ce,description:he,summary:de,accessibleTable:ue,xLabel:me,yLabel:pe}=r,ye=Ft(()=>I(s),[s]),fe=A||g;a(o,{variant:"xy",frameRef:n});const ge=i({data:ye,rawData:s,colorBy:fe,colorScheme:k,legendInteraction:q,legendPosition:J,selection:E,linkedHover:G,fallbackFields:fe?["string"==typeof fe?fe:""]:[],unwrapData:!1,onObservation:z,onClick:V,hoverHighlight:$,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"StackedAreaChart",chartId:X,showLegend:le,userMargin:c,marginDefaults:r.marginDefaults,loading:Q,loadingContent:Y,emptyContent:U,width:ie,height:re,hasTitle:!!ce}),be=Ft(()=>x(m,p),[m,p]),{flattenedData:ve,lineStyle:xe,pointStyle:Ae,defaultTooltipContent:ke}=vt({safeData:ye,data:s,areaBy:g,lineDataAccessor:v,colorBy:fe,colorScale:ge.colorScale,color:K,stroke:Z,strokeWidth:oe,opacity:ne,effectiveSelectionHook:ge.effectiveSelectionHook,resolvedSelection:ge.resolvedSelection,areaOpacity:C,showLine:L,lineWidth:H,showPoints:R,pointRadius:B,xAccessor:m,yAccessor:p,xLabel:me,yLabel:pe,xFormat:d,yFormat:u,groupField:g||A,styleRules:w,ruleContext:be}),we=t({componentName:"StackedAreaChart",data:s,accessors:{xAccessor:m,yAccessor:p}}),Se={chartType:"stackedarea",...null!=s&&{data:ve},xAccessor:m,yAccessor:p,groupAccessor:g||void 0,curve:S,normalize:F,baseline:F?"zero":P,stackOrder:N,lineStyle:xe,...R&&Ae&&{pointStyle:Ae},size:[ie,re],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge.margin,showAxes:r.showAxes,xLabel:me,yLabel:pe,xFormat:d,yFormat:u,enableHover:ae,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:se,...ge.legendBehaviorProps,...y({title:ce,description:he,summary:de,accessibleTable:ue,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),..."multi"===M?{tooltipContent:_(),tooltipMode:"multi"}:b({tooltip:M,defaultTooltipContent:ke}),...f({linkedHover:G,selection:E,onObservation:z,onClick:V,hoverHighlight:$,mobileInteraction:ge.mobileInteraction,customHoverBehavior:ge.customHoverBehavior,customClickBehavior:ge.customClickBehavior}),...W&&W.length>0&&{annotations:W},...O&&{xExtent:O},...D&&{yExtent:D},...ge.crosshairProps,...T};return ge.earlyReturn?ge.earlyReturn:we?Mt(ee,{componentName:"StackedAreaChart",message:we,width:ie,height:re}):Mt(te,{componentName:"StackedAreaChart",width:ie,height:re,children:Mt(l,{ref:n,...Se})})});Wt.displayName="StackedAreaChart";import{useMemo as Ot,forwardRef as Dt,useRef as Tt}from"react";import{scaleSequential as Et}from"d3-scale";import{jsx as Gt}from"react/jsx-runtime";var jt=Dt(function(e,o){const n=Tt(null);a(o,{variant:"xy",frameRef:n});const i=j(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:c,className:h,xAccessor:d="x",yAccessor:u="y",valueAccessor:p="value",xFormat:v,yFormat:x,colorScheme:A,customColorScale:k,showValues:w=!1,valueFormat:S,cellBorderColor:C="#fff",cellBorderWidth:L=1,tooltip:_,annotations:H,xExtent:R,yExtent:B,frameProps:N={},selection:M,linkedHover:W,onObservation:O,onClick:D,hoverHighlight:T,chartId:E,loading:V,loadingContent:X,emptyContent:Q,showLegend:Y,legendPosition:q,legend:J,legendInteraction:Z}=e,{width:ie,height:re,enableHover:ae,title:se,description:le,summary:ce,accessibleTable:he,xLabel:de,yLabel:ue}=i,me=ne(V,ie,re,X),pe=me?null:oe(r,ie,re,Q),ye=Ot(()=>I(r),[r]),fe=U(),ge=A??fe??"blues",be=Y??!1,ve=q??"right",{customHoverBehavior:xe,customClickBehavior:Ae,crosshairSourceId:ke}=z({selection:M,linkedHover:W,fallbackFields:[],onObservation:O,onClick:D,chartType:"Heatmap",chartId:E,hoverHighlight:T,colorByField:void 0,mobileInteraction:i.mobileInteraction});s(M);const we=F(W,ke);$(Z,void 0,[]);const Se=Ot(()=>"function"==typeof p?e=>p(e):e=>e[p],[p]),Ce=Ot(()=>{const e=ye.map(Se);return K(e)},[ye,Se]),Le=Ot(()=>{if("custom"===ge&&k)return k;const e=P(ge);return Et(e).domain(Ce)},[ge,k,Ce]),_e=Ot(()=>{const e=Number.isFinite(L)?Math.max(0,L):1;return()=>({stroke:C,strokeWidth:e})},[C,L]),He=Ot(()=>g([{label:de||m(d),accessor:d,role:"x",format:v},{label:ue||m(u),accessor:u,role:"y",format:x},{label:m(p),accessor:p,role:"value",format:S}]),[d,u,de,ue,p,v,x,S]),Re=t({componentName:"Heatmap",data:r,accessors:{xAccessor:d,yAccessor:u,valueAccessor:p}}),Ie=Ot(()=>{if(be)return{gradient:{colorFn:e=>Le(e),domain:Ce,label:"string"==typeof p?p:"value",format:S},legendDistance:J?.legendDistance}},[be,Le,Ce,p,S,J?.legendDistance]),{margin:Be}=G({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ve,userMargin:c,defaults:i.marginDefaults,additionalLegend:Ie,chartWidth:ie,legendLayout:N.legendLayout,hasTitle:!!se}),Fe={chartType:"heatmap",...null!=r&&{data:ye},xAccessor:d,yAccessor:u,valueAccessor:p,colorScheme:"custom"!==ge?ge:void 0,areaStyle:_e,showValues:w,heatmapValueFormat:S,size:[ie,re],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Be,showAxes:i.showAxes,xLabel:de,yLabel:ue,xFormat:v,yFormat:x,enableHover:ae,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Ie&&{legend:Ie,legendPosition:ve},...y({title:se,description:le,summary:ce,accessibleTable:he,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...b({tooltip:_,defaultTooltipContent:He}),...f({linkedHover:W,selection:M,onObservation:O,onClick:D,hoverHighlight:T,mobileInteraction:i.mobileInteraction,customHoverBehavior:xe,customClickBehavior:Ae}),...H&&H.length>0&&{annotations:H},...R&&{xExtent:R},...B&&{yExtent:B},...we,...N};return me||pe||(Re?Gt(ee,{componentName:"Heatmap",message:Re,width:ie,height:re}):Gt(te,{componentName:"Heatmap",width:ie,height:re,children:Gt(l,{ref:n,...Fe})}))});jt.displayName="Heatmap";import{useMemo as zt,useCallback as Vt,forwardRef as $t,useRef as Xt}from"react";import{jsx as Qt}from"react/jsx-runtime";var Yt=$t(function(o,n){const r=Xt(null),s=j(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:c,margin:h,className:d,xFormat:u,yFormat:p,xAccessor:v="x",yAccessor:A="y",sizeBy:k,sizeRange:w=[5,40],colorBy:S,colorScheme:C,styleRules:L,bubbleOpacity:_=.6,bubbleStrokeWidth:H=1,bubbleStrokeColor:R="white",tooltip:B,marginalGraphics:F,pointIdAccessor:P,annotations:M,regression:O,xExtent:D,yExtent:T,frameProps:G={},selection:z,linkedHover:V,linkedBrush:$,onObservation:X,onClick:Q,hoverHighlight:Y,chartId:U,loading:q,loadingContent:J,emptyContent:K,legendInteraction:Z,legendPosition:oe,color:ne,stroke:ie,strokeWidth:re,opacity:ae}=o,{width:se,height:le,enableHover:ce,showGrid:he,showLegend:ue,title:me,description:pe,summary:ye,accessibleTable:ge,xLabel:be,yLabel:ve}=s,xe=zt(()=>I(c),[c]),Ae=void 0===c,ke=i({data:xe,rawData:c,colorBy:S,colorScheme:C,legendInteraction:Z,legendPosition:oe,selection:z,linkedHover:V,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:X,onClick:Q,hoverHighlight:Y,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"BubbleChart",chartId:U,showLegend:ue,userMargin:h,marginDefaults:s.marginDefaults,loading:q,loadingContent:J,emptyContent:K,width:se,height:le,hasTitle:!!me}),{domain:we,trackPushed:Se,reset:Ce}=fe({accessor:k,data:xe,isPushMode:Ae}),Le=Vt(e=>{Se([e]),r.current?.push(e)},[Se]),_e=Vt(e=>{Se(e),r.current?.pushMany(e)},[Se]);a(n,{variant:"xy",frameRef:r,overrides:{push:Le,pushMany:_e,clear:()=>{Ce(),r.current?.clear()}}});const He=W($),Re=(E({name:He?.name||"__unused_brush__",xField:He?.xField||("string"==typeof v?v:void 0),yField:He?.yField||("string"==typeof A?A:void 0)}),zt(()=>({stroke:R,strokeWidth:H}),[R,H])),Ie=zt(()=>we??[0,1],[we]),Be=Vt(e=>N(e,k,w,Ie),[k,w,Ie]),Fe=zt(()=>x(v,A),[v,A]),Pe=de({colorBy:S,colorScale:ke.colorScale,color:ne,fillOpacity:_,radiusFn:Be,baseStyleExtras:Re,stroke:ie,strokeWidth:re,opacity:ae,styleRules:L,ruleContext:Fe,effectiveSelectionHook:ke.effectiveSelectionHook,resolvedSelection:ke.resolvedSelection}),Ne=zt(()=>g([{label:be||m(v),accessor:v,role:"x",format:u},{label:ve||m(A),accessor:A,role:"y",format:p},{label:m(k),accessor:k,role:"size"},...S?[{label:m(S),accessor:S,role:"color"}]:[]]),[v,A,be,ve,k,S,u,p]);if(ke.earlyReturn)return ke.earlyReturn;const Me=t({componentName:"BubbleChart",data:c,accessors:{xAccessor:v,yAccessor:A},requiredProps:{sizeBy:k}});if(Me)return Qt(ee,{componentName:"BubbleChart",message:Me,width:se,height:le});const We=e(O),Oe=We?[We,...M||[]]:M,De={chartType:"bubble",...null!=c&&{data:xe},xAccessor:v,yAccessor:A,colorAccessor:S||void 0,sizeAccessor:k,sizeRange:w,pointStyle:Pe,colorScheme:C,size:[se,le],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ke.margin,showAxes:s.showAxes,xLabel:be,yLabel:ve,xFormat:u,yFormat:p,enableHover:ce,showGrid:he,...ke.legendBehaviorProps,...y({title:me,description:pe,summary:ye,accessibleTable:ge,className:d,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...b({tooltip:B,defaultTooltipContent:Ne}),...f({linkedHover:V,selection:z,onObservation:X,onClick:Q,hoverHighlight:Y,mobileInteraction:ke.mobileInteraction,customHoverBehavior:ke.customHoverBehavior,customClickBehavior:ke.customClickBehavior}),...F&&{marginalGraphics:F},...P&&{pointIdAccessor:P},...Oe&&Oe.length>0&&{annotations:Oe},...D&&{xExtent:D},...T&&{yExtent:T},...ke.crosshairProps,...G};return Qt(te,{componentName:"BubbleChart",width:se,height:le,children:Qt(l,{ref:r,...De})})});Yt.displayName="BubbleChart";import*as Ut from"react";import{useMemo as qt,useCallback as Jt,useState as Kt,useRef as Zt}from"react";import*as eo from"react";import{jsx as to}from"react/jsx-runtime";var oo=null,no=null;function io(e){const[t,o]=eo.useState(()=>oo);return eo.useEffect(()=>{if(t)return;let e=!1;return(oo?Promise.resolve(oo):(no||(no=import("./chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js").then(e=>oo=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw no=null,e})),no)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?to(t,{...e}):null}import{jsx as ro,jsxs as ao}from"react/jsx-runtime";var so="__splomIdx",lo={top:4,bottom:4,left:4,right:4};function co({data:e,xField:t,yField:o,cellSize:n,pointRadius:i,pointOpacity:r,colorBy:a,colorScale:s,brushSelectionName:c,hoverSelectionName:h,unselectedOpacity:d,mobileInteraction:u,mode:m,onPointHover:p,onPointClick:y}){const g=Zt(null),b=X({name:c,clientId:`splom-${t}-${o}`,fields:[t,o]}),v=E({name:c,xField:t,yField:o}),x=X({name:h,clientId:"splom-hover-source",fields:[so]}),A=x.selectPoints,k=Jt(e=>{e?v.brushInteraction.during(e):v.brushInteraction.end(null)},[v.brushInteraction]),S=Jt(e=>{if(!e)return void p?.(null);const t=e.data,o=t?.[so];void 0!==o&&(A({[so]:[o]}),p?.(t,e.x+lo.left,e.y+lo.top))},[A,p]),C=Jt(e=>{if(!e)return void y?.(null);const t=e.data;t&&y?.(t,e.x+lo.left,e.y+lo.top)},[y]),L=Jt(e=>{const t={opacity:r,r:i};return t.fill=a?B(e,a,s):w,"hover"===m?x.isActive&&x.predicate(e)?(t.opacity=1,t.r=2.5*i,t.stroke="#333",t.strokeWidth=1.5):x.isActive&&(t.opacity=.6*r):b.isActive&&!b.predicate(e)&&(t.opacity=d),t},[r,i,a,m,s,x,b,d]);return ao("div",{style:{position:"relative",width:n,height:n},children:[ro(l,{ref:g,chartType:"scatter",data:e,size:[n,n],xAccessor:t,yAccessor:o,pointStyle:L,margin:lo,showAxes:!1,enableHover:"hover"===m,...f({forceHoverBehavior:"hover"===m,forceClickBehavior:!!y,mobileInteraction:u,customHoverBehavior:S,customClickBehavior:C}),tooltipContent:"hover"===m?()=>null:void 0}),"brush"===m&&ro(io,{frameRef:g,cellSize:n,onBrush:k})]})}function ho({data:e,field:t,label:o,cellSize:n,bins:i,colorBy:r,colorScale:a,brushSelectionName:s,hoverSelectionName:l,mode:c}){const h=X({name:s,clientId:"splom-diag-"+t,fields:[t]}),d=X({name:l,clientId:`splom-diag-${t}-hover`,fields:[so]}),u="hover"===c?d:h,m=u.isActive,p=u.predicate,y=qt(()=>{const o="string"==typeof r?r:null,a=[],s=new Set;for(const n of e){const e=n[t];if(null==e||isNaN(e)||a.push(Number(e)),o){const e=n[o];null!=e&&s.add(e+"")}}if(0===a.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};const[l,c]=K(a),h=(c-l)/i||1,d=Array.from(s),u=new Map(d.map((e,t)=>[e,t])),y=Array(i).fill(0),f=Array(i).fill(0),g=Array.from({length:i},()=>Array(d.length).fill(0)),b=Array.from({length:i},()=>Array(d.length).fill(0));for(const n of e){const e=n[t];if(null==e||isNaN(e))continue;const r=Math.min(Math.floor((e-l)/h),i-1);if(y[r]++,m&&!p(n)||f[r]++,o){const e=u.get(n[o]+"");void 0!==e&&(g[r][e]++,m&&!p(n)||b[r][e]++)}}const v=J(y,1),x=g.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{const a=e/v*(n-24),s={x:t/i*n,w:n/i-1,h:a,y0:o,category:d[r]};return o+=a,s})});return{bars:y.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),selectedBars:f.map((e,t)=>({x:t/i*n,w:n/i-1,h:e/v*(n-24),count:e})),categoryBars:x,selectedCategoryBars:A,max:v,categories:d}},[e,t,i,n,m,p,r]);return ao("svg",{width:n,height:n,style:{overflow:"hidden"},children:[ro("text",{x:n/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"#333",children:o}),y.categories.length>0?y.categoryBars.map((e,t)=>e.map((e,o)=>ro("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):w,opacity:m?.3:.6},`bg-${t}-${o}`))):y.bars.map((e,t)=>ro("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:w,opacity:m?.3:.6},"bg-"+t)),m&&(y.categories.length>0?y.selectedCategoryBars.map((e,t)=>e.map((e,o)=>ro("rect",{x:e.x,y:n-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:a?a(e.category):w,opacity:.7},`sel-${t}-${o}`))):y.selectedBars.map((e,t)=>ro("rect",{x:e.x,y:n-e.h,width:Math.max(e.w,1),height:e.h,fill:w,opacity:.7},"sel-"+t)))]})}function uo({label:e,cellSize:t}){return ro("svg",{width:t,height:t,children:ro("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"#333",children:e})})}function mo(e){const{data:t,fields:o,fieldLabels:n={},colorBy:i,colorScheme:r,cellSize:a=150,cellGap:s=4,pointRadius:l=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:d=20,brushMode:u="crossfilter",hoverMode:m=!0,unselectedOpacity:p=.1,showGrid:y=!1,tooltip:f,showLegend:g,idAccessor:b,width:v,className:x,onObservation:A,onClick:k,chartId:S}=e,C="splom",L="splom-hover",_=T(e.mobileInteraction,{mode:e.mode,width:v??o.length*a,mobileSemantics:e.mobileSemantics}),H=m?"hover":u?"brush":"hover",R=Q(e=>e.clearSelection),[I,B]=Kt(null),F=Jt(()=>{R(L),B(null)},[R,L]),P=qt(()=>(t||[]).map((e,t)=>void 0!==e[so]?e:{...e,[so]:t}),[t]),N=V(P,i,r),M=Jt((e,t,o,n)=>[40+e*(a+s)+(o??0),t*(a+s)+(n??0)],[40,a,s]),W=void 0!==g?g:!!i,O=qt(()=>{if(!W||!i)return null;const e="string"==typeof i?i:null;return e?Array.from(new Set(P.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:N?N(e+""):w})):null},[W,i,P,N]),D=qt(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>a+"px").join(" "),gridTemplateRows:o.map(()=>a+"px").join(" ")+" 40px",gap:s+"px",width:"fit-content"}),[o,a,s,40]);return ao("div",{className:x,style:{position:"relative"},children:[O&&ro("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:O.map(e=>ao("div",{style:{display:"flex",alignItems:"center",gap:4},children:[ro("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),ro("span",{style:{fontSize:11},children:e.label})]},e.label))}),ao("div",{style:D,onMouseLeave:"hover"===H?F:void 0,children:[o.map((e,t)=>ao(Ut.Fragment,{children:[ro("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e}),o.map((o,r)=>t===r?"label"===h?ro(uo,{label:n[e]||e,cellSize:a},"diag-"+e):ro(ho,{data:P,field:e,label:n[e]||e,cellSize:a,bins:d,colorBy:i,colorScale:N,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,mode:H},"diag-"+e):ro(co,{data:P,xField:o,yField:e,fieldLabels:n,cellSize:a,pointRadius:l,pointOpacity:c,colorBy:i,colorScale:N,brushSelectionName:C,hoverSelectionName:L,unselectedOpacity:p,showGrid:y,tooltip:f,mobileInteraction:_,mode:H,onPointHover:"hover"===H?(n,i,a)=>{if(n){if(B({datum:n,xField:o,yField:e,colIndex:r,rowIndex:t,px:i??0,py:a??0}),A){const[e,o]=M(r,t,i,a);A({type:"hover",datum:n,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}}else B(null),A&&A({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0,onPointClick:k||A?(e,o,n)=>{if(!e)return;const[i,a]=M(r,t,o,n);k&&k(e,{x:i,y:a}),A&&A({type:"click",datum:e,x:i,y:a,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:S})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),ro("div",{})," ",o.map(e=>ro("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:n[e]||e},"col-label-"+e))]}),I&&"hover"===H&&(()=>{const e=I.datum,t=n[I.xField]||I.xField,o=n[I.yField]||I.yField,r=i?"function"==typeof i?i(e):e[i]:null,l=b?"function"==typeof b?b(e):e[b]:"Row "+e[so];return ao("div",{style:{position:"absolute",left:40+I.colIndex*(a+s)+I.px,top:I.rowIndex*(a+s)+I.py-8,transform:"translate(-50%, -100%)",color:"#333",background:"rgba(255,255,255,0.95)",border:"1px solid #ddd",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[ro("div",{style:{fontWeight:"bold",marginBottom:2},children:l+""}),ao("div",{children:[t,": ",null!=e[I.xField]?Number(e[I.xField]).toFixed(1):"–"]}),ao("div",{children:[o,": ",null!=e[I.yField]?Number(e[I.yField]).toFixed(1):"–"]}),null!=r&&ao("div",{style:{opacity:.8},children:["string"==typeof i?i:"group",": ",r+""]})]})})()]})}function po(e){const{brushMode:t="crossfilter",hoverMode:o=!0}=e,n={};return!o&&t&&(n.splom={resolution:t}),o&&(n["splom-hover"]={resolution:"union"}),ro(L,{selections:n,children:ro(mo,{...e})})}po.displayName="ScatterplotMatrix";import{useState as yo,useRef as fo,useEffect as go,useMemo as bo,useCallback as vo}from"react";import*as xo from"react";import{jsx as Ao}from"react/jsx-runtime";var ko=null,wo=null;function So(e){const[t,o]=xo.useState(()=>ko);return xo.useEffect(()=>{if(t)return;let e=!1;return(ko?Promise.resolve(ko):(wo||(wo=import("./chunk-minimapBrushOverlay-JU57U7NM.module.min.js").then(e=>ko=e.MinimapBrushOverlay).catch(e=>{throw wo=null,e})),wo)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?Ao(t,{...e}):null}import{jsx as Co,jsxs as Lo}from"react/jsx-runtime";function _o(e){const{data:o,width:n=600,height:i=400,margin:r,className:a,title:s,description:c,summary:h,xLabel:d,yLabel:u,xFormat:p,yFormat:y,xAccessor:f="x",yAccessor:b="y",lineBy:v,lineDataAccessor:x="coordinates",colorBy:A,colorScheme:k,curve:S="linear",lineWidth:C=2,fillArea:L=!1,areaOpacity:_=.3,showPoints:H=!1,pointRadius:R=3,enableHover:F=!0,showGrid:P=!1,showLegend:N,legendPosition:M,tooltip:W,minimap:D={},renderBefore:T=!1,onBrush:E,brushExtent:j,yExtent:z,frameProps:$={},loading:X,loadingContent:Q,emptyContent:Y}=e,U=ne(X,n,i,Q),q=U?null:oe(o,n,i,Y),J=bo(()=>I(o),[o]),[K,Z]=yo(null),ie=j??K,re=vo(e=>{j||Z(e),E?.(e)},[j,E]),ae=fo(null),[se,le]=yo(null);go(()=>{let e=0,t=!1;const o=()=>{if(t)return;const n=ae.current?.getScales?.();n?le(n):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[o]);const ce=void 0!==J[0]?.[x],he=bo(()=>{if(ce)return J;if(v){const e=J.reduce((e,t)=>{const o="function"==typeof v?v(t):t[v];if(!e[o]){const t={[x]:[]};"string"==typeof v&&(t[v]=o),e[o]=t}return e[o][x].push(t),e},{});return Object.values(e)}return[{[x]:J}]},[J,v,x,ce]),de=bo(()=>ce||v?he.flatMap(e=>{const t=e[x]||[];return v&&"string"==typeof v?t.map(t=>({...t,[v]:e[v]})):t}):J,[he,x,ce,v,J]),ue=V(J,A,k),me=ze({lineWidth:C,colorBy:A,colorScale:ue,fillArea:L,areaOpacity:_}),pe=bo(()=>{if(D.lineStyle)return D.lineStyle},[D.lineStyle]),ye=ze({lineWidth:1,colorBy:A,colorScale:ue}),fe=pe??ye,ge=bo(()=>{if(H)return e=>{const t={r:R,fillOpacity:1};return t.fill=A?B(e.parentLine||e,A,ue):w,t}},[H,R,A,ue]),{legend:be,margin:ve,legendPosition:xe}=G({data:he,colorBy:A,colorScale:ue,showLegend:N,legendPosition:M,userMargin:r,chartWidth:n,hasTitle:!!s}),Ae=D.height||60,ke=bo(()=>({top:D.margin?.top??0,bottom:D.margin?.bottom??20,left:D.margin?.left??ve.left,right:D.margin?.right??ve.right}),[D.margin,ve]),we=D.brushDirection||"x",Se=bo(()=>g([{label:d||m(f),accessor:f,role:"x",format:p},{label:u||m(b),accessor:b,role:"y",format:y}]),[f,b,d,u,p,y]),Ce=t({componentName:"MinimapChart",data:o,accessors:{xAccessor:f,yAccessor:b}});if(Ce)return Co(ee,{componentName:"MinimapChart",message:Ce,width:n,height:i});const Le=L?"area":"line",_e={chartType:Le,data:de,xAccessor:f,yAccessor:b,groupAccessor:v||void 0,curve:S,lineStyle:me,...H&&{pointStyle:ge},size:[n,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,showAxes:!0,xLabel:d,yLabel:u,xFormat:p,yFormat:y,enableHover:F,showGrid:P,...be&&{legend:be,legendPosition:xe},...s&&{title:s},...c&&{description:c},...h&&{summary:h},tooltipContent:!1===W?()=>null:O(W)||Se,...ie&&{xExtent:ie},...z&&{yExtent:z},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...$},He={chartType:Le,data:de,xAccessor:f,yAccessor:b,groupAccessor:v||void 0,curve:S,lineStyle:fe,size:[n,Ae+ke.top+ke.bottom],margin:ke,showAxes:D.showAxes??!1,background:D.background,enableHover:!1,...z&&{yExtent:z}},Re=Lo("div",{style:{position:"relative",width:n,overflow:"hidden"},children:[Co(l,{ref:ae,...He}),Co(So,{width:n-ke.left-ke.right,height:Ae,margin:ke,scales:se,brushDirection:we,extent:ie,onBrush:re})]},"minimap"),Ie=Co("div",{style:{overflow:"hidden"},children:Co(l,{..._e})},"main");return U||q||Co(te,{componentName:"MinimapChart",width:n,height:i,children:Lo("div",{className:"minimap-chart"+(a?" "+a:""),children:[T?Re:Ie,T?Ie:Re]})})}_o.displayName="MinimapChart";import{useMemo as Ho,forwardRef as Ro,useRef as Io}from"react";var Bo={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as Fo,jsx as Po,jsxs as No}from"react/jsx-runtime";function Mo(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}var Wo=Ro(function(e,o){const n=Io(null);a(o,{variant:"xy",frameRef:n});const r=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:p="x",yAccessor:y="y",xCenter:b,yCenter:v,quadrants:A,centerlineStyle:k={},showQuadrantLabels:S=!0,quadrantLabelSize:C=12,colorBy:L,colorScheme:_,styleRules:H,sizeBy:R,sizeRange:B=[3,15],pointRadius:F=5,pointOpacity:P=.8,tooltip:M,pointIdAccessor:W,annotations:D,frameProps:T={},selection:E,linkedHover:G,onObservation:z,onClick:V,hoverHighlight:$,chartId:X,loading:Q,loadingContent:Y,emptyContent:U,legendInteraction:q,legendPosition:J,color:Z,stroke:oe,strokeWidth:ne,opacity:re}=e,{width:ae,height:se,enableHover:le,showGrid:ce,showLegend:he,title:ue,description:me,summary:pe,accessibleTable:ye,xLabel:fe,yLabel:ge}=r,be=Ho(()=>({topLeft:Mo(Bo.topLeft,A?.topLeft),topRight:Mo(Bo.topRight,A?.topRight),bottomLeft:Mo(Bo.bottomLeft,A?.bottomLeft),bottomRight:Mo(Bo.bottomRight,A?.bottomRight)}),[A]),ve=Ho(()=>I(s),[s]),xe=i({data:ve,rawData:s,colorBy:L,colorScheme:_,legendInteraction:q,legendPosition:J,selection:E,linkedHover:G,fallbackFields:"string"==typeof L?[L]:[],unwrapData:!1,onObservation:z,onClick:V,hoverHighlight:$,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"QuadrantChart",chartId:X,showLegend:he,userMargin:c,marginDefaults:r.marginDefaults,loading:Q,loadingContent:Y,emptyContent:U,width:ae,height:se,hasTitle:!!ue});ie("QuadrantChart",ve,"xAccessor",p),ie("QuadrantChart",ve,"yAccessor",y);const Ae=Ho(()=>{if(!ve.length)return;const e="function"==typeof p?p:e=>+e[p],t="function"==typeof y?y:e=>+e[y];let o=1/0,n=-1/0,i=1/0,r=-1/0;for(const a of ve){const s=e(a),l=t(a);isFinite(s)&&(o>s&&(o=s),s>n&&(n=s)),isFinite(l)&&(i>l&&(i=l),l>r&&(r=l))}if(null!=b&&isFinite(b)&&(o>b&&(o=b),b>n&&(n=b)),null!=v&&isFinite(v)&&(i>v&&(i=v),v>r&&(r=v)),o===1/0)return;const a=.1*(n-o)||1,s=.1*(r-i)||1;return{xExtent:[o-a,n+a],yExtent:[i-s,r+s]}},[ve,p,y,b,v]),ke=Ho(()=>{if(!R||0===ve.length)return;const e=ve.map(e=>"function"==typeof R?R(e):e[R]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?K(e):void 0},[ve,R]),we=Ho(()=>"function"==typeof p?p:e=>+e[p],[p]),Se=Ho(()=>"function"==typeof y?y:e=>+e[y],[y]),Ce=Ho(()=>e=>{const t=we(e),o=Se(e),n=null!=b?t>=b:void 0,i=null!=v?o>=v:void 0;return void 0===i||void 0===n?Z||w:i&&n?be.topRight.color:i&&!n?be.topLeft.color:!i&&n?be.bottomRight.color:be.bottomLeft.color},[we,Se,b,v,be,Z]),Le=Ho(()=>R?e=>N(e,R,B,ke):void 0,[R,B,ke]),_e=Ho(()=>x(p,y),[p,y]),He=de({colorBy:L,colorScale:xe.colorScale,color:Z,pointRadius:F,fillOpacity:P,radiusFn:Le,fallbackFill:Ce,stroke:oe,strokeWidth:ne,opacity:re,styleRules:H,ruleContext:_e,effectiveSelectionHook:xe.effectiveSelectionHook,resolvedSelection:xe.resolvedSelection}),Re=Ho(()=>{if(!ve.length)return;const e=new Set;"string"==typeof p&&e.add(p),"string"==typeof y&&e.add(y),"string"==typeof L&&e.add(L),"string"==typeof R&&e.add(R);const t=ve[0];for(const o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[ve,p,y,L,R]),Ie=Ho(()=>g([...Re?[{label:Re,accessor:Re,role:"title"}]:[],{label:fe||m(p),accessor:p,role:"x",format:d},{label:ge||m(y),accessor:y,role:"y",format:u},...L?[{label:m(L),accessor:L,role:"color"}]:[],...R?[{label:m(R),accessor:R,role:"size"}]:[]]),[Re,p,y,fe,ge,L,R,d,u]),Be=t({componentName:"QuadrantChart",data:s,accessors:{xAccessor:p,yAccessor:y}}),Fe=Ho(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray||[]};return[(t,o,n,i)=>{if(!n?.x||!n?.y)return;const r=i.width,a=i.height,s=null!=b?n.x(b):r/2,l=null!=v?n.y(v):a/2;if(null!=b&&!isFinite(s))return;if(null!=v&&!isFinite(l))return;const c=Math.max(0,Math.min(r,s)),h=Math.max(0,Math.min(a,l)),d=[{config:be.topLeft,x:0,y:0,w:c,h:h},{config:be.topRight,x:c,y:0,w:r-c,h:h},{config:be.bottomLeft,x:0,y:h,w:c,h:a-h},{config:be.bottomRight,x:c,y:h,w:r-c,h:a-h}];for(const e of d)e.w>0&&e.h>0&&(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,a),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[b,v,be,k]),Pe=Ho(()=>S?[...Fe,(e,t,o,n)=>{if(!o?.x||!o?.y)return;const i=n.width,r=n.height,a=null!=b?o.x(b):i/2,s=null!=v?o.y(v):r/2;(null==b||isFinite(a))&&(null==v||isFinite(s))&&(e.font=`600 ${C}px sans-serif`,e.globalAlpha=.5,e.fillStyle=be.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(be.topLeft.label,8,8),e.fillStyle=be.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(be.topRight.label,i-8,8),e.fillStyle=be.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(be.bottomLeft.label,8,r-8),e.fillStyle=be.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(be.bottomRight.label,i-8,r-8),e.globalAlpha=1)}]:Fe,[Fe,S,C,be,b,v]),Ne=Ho(()=>{const e=T.canvasPreRenderers||[];return[...Pe,...e]},[Pe,T.canvasPreRenderers]),Me=Ho(()=>{const e={stroke:k.stroke||"#999",strokeWidth:k.strokeWidth??1,dashArray:k.strokeDasharray?Array.isArray(k.strokeDasharray)?k.strokeDasharray.join(","):k.strokeDasharray:void 0};return[(t,o,n)=>{if(!o?.x||!o?.y)return null;const i=n.width,r=n.height,a=null!=b?o.x(b):i/2,s=null!=v?o.y(v):r/2;if(null!=b&&!isFinite(a))return null;if(null!=v&&!isFinite(s))return null;const l=Math.max(0,Math.min(i,a)),c=Math.max(0,Math.min(r,s));return No(Fo,{children:[[{config:be.topLeft,x:0,y:0,w:l,h:c},{config:be.topRight,x:l,y:0,w:i-l,h:c},{config:be.bottomLeft,x:0,y:c,w:l,h:r-c},{config:be.bottomRight,x:l,y:c,w:i-l,h:r-c}].map((e,t)=>e.w>0&&e.h>0?Po("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),Po("line",{x1:l,y1:0,x2:l,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),Po("line",{x1:0,y1:c,x2:i,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),S&&No(Fo,{children:[Po("text",{x:8,y:8+C,fill:be.topLeft.color,fontWeight:600,fontSize:C,opacity:.5,children:be.topLeft.label}),Po("text",{x:i-8,y:8+C,fill:be.topRight.color,fontWeight:600,fontSize:C,opacity:.5,textAnchor:"end",children:be.topRight.label}),Po("text",{x:8,y:r-8,fill:be.bottomLeft.color,fontWeight:600,fontSize:C,opacity:.5,children:be.bottomLeft.label}),Po("text",{x:i-8,y:r-8,fill:be.bottomRight.color,fontWeight:600,fontSize:C,opacity:.5,textAnchor:"end",children:be.bottomRight.label})]})]})}]},[b,v,be,k,S,C]);if(xe.earlyReturn)return xe.earlyReturn;const We={chartType:"scatter",...null!=s&&{data:ve},xAccessor:p,yAccessor:y,colorAccessor:L||void 0,sizeAccessor:R||void 0,sizeRange:B,pointStyle:He,colorScheme:_,size:[ae,se],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:xe.margin,showAxes:r.showAxes,xLabel:fe,yLabel:ge,xFormat:d,yFormat:u,enableHover:le,showGrid:ce,...Ae&&{xExtent:Ae.xExtent,yExtent:Ae.yExtent},...xe.legendBehaviorProps,...ue&&{title:ue},...me&&{description:me},...pe&&{summary:pe},...void 0!==ye&&{accessibleTable:ye},...h&&{className:h},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===M?()=>null:!0===M||void 0===M?Ie:O(M)||Ie,...f({linkedHover:G,selection:E,onObservation:z,onClick:V,hoverHighlight:$,mobileInteraction:xe.mobileInteraction,customHoverBehavior:xe.customHoverBehavior,customClickBehavior:xe.customClickBehavior}),...W&&{pointIdAccessor:W},...D&&D.length>0&&{annotations:D},canvasPreRenderers:Ne,...xe.crosshairProps,...T,...Ne.length>0&&{canvasPreRenderers:Ne},svgPreRenderers:Me};return Be?Po(ee,{componentName:"QuadrantChart",message:Be,width:ae,height:se}):Po(te,{componentName:"QuadrantChart",width:ae,height:se,children:Po(l,{ref:n,...We})})});Wo.displayName="QuadrantChart";import*as Oo from"react";import{useMemo as Do,useCallback as To,forwardRef as Eo,useRef as Go,useImperativeHandle as jo}from"react";import{jsx as zo}from"react/jsx-runtime";var Vo="__ma_unitized",$o="__ma_series";function Xo(e,t){const o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function Qo(e,t){return t[0]+e*(t[1]-t[0])}var Yo=Eo(function(e,o){const n=Go(null),r=Go([]),a=Go(e.series);a.current=e.series,jo(o,()=>{const e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!n.current)return;const o=e(),i=t;for(let e=0;o.length>e&&2>e;e++){const t=o[e],a=t.extent||r.current[e];if(!a)continue;const s=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(i);null!=s&&isFinite(s)&&n.current.push({...i,[Vo]:Xo(s,a),[$o]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!n.current)return;const o=e(),i=[];for(const e of t)for(let t=0;o.length>t&&2>t;t++){const n=o[t],a=n.extent||r.current[t];if(!a)continue;const s=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=s&&isFinite(s)&&i.push({...e,[Vo]:Xo(s,a),[$o]:n.label||"Series "+(t+1)})}n.current.pushMany(i)},remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],clear:()=>n.current?.clear(),getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}},[]);const s=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:c,margin:h,className:d,xFormat:u,xAccessor:m="x",series:p,colorScheme:y,curve:g="monotoneX",lineWidth:b=2,tooltip:v,annotations:x,frameProps:A={},selection:w,linkedHover:C,onObservation:L,onClick:_,hoverHighlight:H,chartId:R,loading:B,loadingContent:F,emptyContent:P,legendInteraction:N,legendPosition:M,stroke:W,strokeWidth:D,opacity:T}=e,{width:E,height:G,enableHover:z,showGrid:V,showLegend:$=!0,title:X,description:Q,summary:U,accessibleTable:q,xLabel:J}=s,K=Do(()=>I(c),[c]),Z=Do(()=>I(p),[p]),ie=Z,re=2===Z.length,ae=Do(()=>re?{...A.legendLayout,sideGutter:A.legendLayout?.sideGutter??70}:A.legendLayout,[A.legendLayout,re]);"undefined"==typeof process||"production"===process.env?.NODE_ENV||re||console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${Z.length}. Rendering as a standard multi-line chart.`);const se=ne(B,E,G,F),le=se?null:oe(c,E,G,P),ce=Y(),he=Do(()=>{let e;if(Array.isArray(y))e=y;else if(ce&&ce.length>0)e=ce;else{const t=k[y];e=Array.isArray(t)?t:S}return ie.map((t,o)=>t.color||e[o%e.length])},[ie,y,ce]),de=Do(()=>Z.map((e,t)=>e.label||"Series "+(t+1)),[Z]),{unitizedData:ue,extents:me}=Do(()=>{if(0===K.length){const e=Z.map(e=>e.extent||null).filter(Boolean);return e.length===Z.length&&(r.current=e),{unitizedData:[],extents:e.length===Z.length?e:[]}}const e=Z.map(e=>e.extent||function(e,t){let o=1/0,n=-1/0;const i="function"==typeof t?t:e=>e[t];for(const t of e){const e=i(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>n&&(n=e))}if(!isFinite(o)||!isFinite(n))return[0,1];if(o===n){const e=0===o?1:.1*Math.abs(o);return[o-e,n+e]}return[o,n]}(K,e.yAccessor));if(r.current=e,!re){const t=[];for(const e of K)for(let o=0;Z.length>o;o++){const n=Z[o],i=("function"==typeof n.yAccessor?n.yAccessor:e=>e[n.yAccessor])(e);null!=i&&t.push({...e,[Vo]:i,[$o]:de[o]})}return{unitizedData:t,extents:e}}const t=[];for(const o of K)for(let n=0;2>n;n++){const i=Z[n],r=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(o);null!=r&&t.push({...o,[Vo]:Xo(r,e[n]),[$o]:de[n]})}return{unitizedData:t,extents:e}},[K,Z,re,de]),pe=Do(()=>{if(re&&me.length>=2)return[{orient:"left",label:de[0],tickFormat:Z[0].format||(e=>{const t=Qo(e,me[0]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"right",label:de[1],tickFormat:Z[1].format||(e=>{const t=Qo(e,me[1]);return Number.isInteger(t)?t+"":t.toFixed(1)})},{orient:"bottom"}]},[re,me,Z,de]),ye=Do(()=>ue.length>0?ue:de.map(e=>({[$o]:e})),[ue,de]),fe=i({data:ye,rawData:c,colorBy:$o,colorScheme:he,legendInteraction:N,legendPosition:M,selection:w,linkedHover:C,fallbackFields:[$o],unwrapData:!1,onObservation:L,onClick:_,hoverHighlight:H,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"MultiAxisLineChart",chartId:R,showLegend:$,legendLayout:ae,userMargin:h,marginDefaults:re?{...s.marginDefaults,left:70,right:70}:s.marginDefaults,loading:B,loadingContent:F,emptyContent:P,width:E,height:G,hasTitle:!!X}),ge=Do(()=>{const e=new Map;return de.forEach((t,o)=>e.set(t,he[o])),e},[de,he]),be=ze({lineWidth:b,resolveStroke:To(e=>ge.get(e[$o])||he[0],[ge,he]),stroke:W,strokeWidth:D,opacity:T,effectiveSelectionHook:fe.effectiveSelectionHook,resolvedSelection:fe.resolvedSelection}),ve=Do(()=>{if(!1===v)return()=>null;return O(v)||(e=>{const t=e.data||e,o=t[$o],n=de.indexOf(o),i=t[Vo],r=re&&n>=0&&me[n]?Qo(i,me[n]):i,a=n>=0&&Z[n]?.format?Z[n].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),s="function"==typeof m?m(t):t[m];return Oo.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},Oo.createElement("div",{style:{fontWeight:600,marginBottom:4,color:he[n]||"inherit"}},o),Oo.createElement("div",null,`${"string"==typeof m?m:"x"}: ${s}`),Oo.createElement("div",null,`${o}: ${a(r)}`))})},[v,de,he,me,re,Z,m]);if(fe.earlyReturn)return fe.earlyReturn;const xe=t({componentName:"MultiAxisLineChart",data:c,accessors:{xAccessor:m}}),Ae=re?[0,1]:void 0,ke={chartType:"line",...null!=c&&{data:ue},xAccessor:m,yAccessor:Vo,groupAccessor:$o,lineStyle:be,colorScheme:he,size:[E,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe.margin,showAxes:s.showAxes,...pe&&{axes:pe},xLabel:J,...re?{}:{yLabel:de[0]},xFormat:u,...re&&Ae&&{yExtent:Ae},enableHover:z,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:V,curve:g,...fe.legendBehaviorProps,...X&&{title:X},...Q&&{description:Q},...U&&{summary:U},...void 0!==q&&{accessibleTable:q},...d&&{className:d},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:ve,...x&&{annotations:x},...f({linkedHover:C,selection:w,onObservation:L,onClick:_,hoverHighlight:H,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...fe.crosshairProps,...A,...ae&&{legendLayout:ae}};return se||le||(xe?zo(ee,{componentName:"MultiAxisLineChart",message:xe,width:E,height:G}):zo(te,{componentName:"MultiAxisLineChart",width:E,height:G,children:zo(l,{ref:n,...ke})}))});Yo.displayName="MultiAxisLineChart";import{useMemo as Uo,forwardRef as qo,useRef as Jo}from"react";import{jsx as Ko}from"react/jsx-runtime";var Zo=qo(function(e,o){const i=Jo(null);a(o,{variant:"xy",frameRef:i});const r=j(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:s,margin:c,className:h,xFormat:d,yFormat:u,xAccessor:p="x",highAccessor:v="high",lowAccessor:x="low",openAccessor:A,closeAccessor:k,candlestickStyle:w,tooltip:S,annotations:C,xExtent:L,yExtent:_,frameProps:H={},selection:R,linkedHover:B,onObservation:P,onClick:N,chartId:M,loading:W,loadingContent:O,emptyContent:D}=e,{width:T,height:E,enableHover:G,showGrid:V,title:$,description:X,summary:Q,accessibleTable:Y,xLabel:U,yLabel:q}=r,J=ne(W,T,E,O),K=J?null:oe(s,T,E,D),Z=Uo(()=>I(s),[s]),re=null==A||null==k;ie("CandlestickChart",Z,"xAccessor",p),ie("CandlestickChart",Z,"highAccessor",v),ie("CandlestickChart",Z,"lowAccessor",x),re||(ie("CandlestickChart",Z,"openAccessor",A),ie("CandlestickChart",Z,"closeAccessor",k));const{customHoverBehavior:ae,customClickBehavior:se,crosshairSourceId:le}=z({selection:R,linkedHover:B,onObservation:P,onClick:N,chartType:"CandlestickChart",chartId:M,mobileInteraction:r.mobileInteraction}),ce=F(B,le),he=Uo(()=>{const e=r.marginDefaults,t="sparkline"===r.mode?{...e,top:0,bottom:0}:e;return null==c?t:{...t,...n(c)}},[c,r.marginDefaults,r.mode]),de=Uo(()=>{const e=[{label:U||m(p),accessor:p,role:"x",format:d}];return re?(e.push({label:"High",accessor:v,role:"y",format:u}),e.push({label:"Low",accessor:x,format:u})):(e.push({label:"Open",accessor:A,format:u}),e.push({label:"High",accessor:v,format:u}),e.push({label:"Low",accessor:x,format:u}),e.push({label:"Close",accessor:k,format:u})),g(e)},[p,U,d,u,v,x,A,k,re]),ue=t({componentName:"CandlestickChart",data:s,accessors:{xAccessor:p,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:k}}}),me={chartType:"candlestick",...null!=s&&{data:Z},xAccessor:p,yAccessor:v,highAccessor:v,lowAccessor:x,...!re&&{openAccessor:A,closeAccessor:k},...w&&{candlestickStyle:w},scalePadding:Math.max(2,Math.min(12,Math.round(T/40))),extentPadding:T>200?.1:.02,size:[T,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:he,showAxes:r.showAxes,xLabel:U,yLabel:q,xFormat:d,yFormat:u,enableHover:G,showGrid:V,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...y({title:$,description:X,summary:Q,accessibleTable:Y,className:h,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...b({tooltip:S,defaultTooltipContent:de}),...f({linkedHover:B,selection:R,onObservation:P,onClick:N,mobileInteraction:r.mobileInteraction,customHoverBehavior:ae,customClickBehavior:se}),...C&&C.length>0&&{annotations:C},...L&&{xExtent:L},..._&&{yExtent:_},...ce,...H};return J||K||(ue?Ko(ee,{componentName:"CandlestickChart",message:ue,width:T,height:E}):Ko(te,{componentName:"CandlestickChart",width:T,height:E,children:Ko(l,{ref:i,...me})}))});Zo.displayName="CandlestickChart";export{He as Scatterplot,Me as ConnectedScatterplot,Xe as LineChart,qe as XYCustomChart,lt as rankBumpData,pt as BumpChart,At as AreaChart,Bt as DifferenceChart,Wt as StackedAreaChart,jt as Heatmap,Yt as BubbleChart,po as ScatterplotMatrix,_o as MinimapChart,Bo as DEFAULT_QUADRANTS,Wo as QuadrantChart,Yo as MultiAxisLineChart,Zo as CandlestickChart};