apexcharts 8.2.0 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(t){var e="undefined"!=typeof globalThis?globalThis:self,n=e.ApexCharts;if(n&&n.__internals)return t.call(e);if(n)throw new Error("ApexCharts: dist/features/ink.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/ink.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var i={file:"dist/features/ink.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var n=e.ApexCharts;if(n)if(n.__internals){i.done=!0;var a=s.indexOf(i);-1!==a&&s.splice(a,1);try{t.call(e),n.__drainsAddons||e.console.warn("ApexCharts: dist/features/ink.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/ink.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/ink.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/ink.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";const e=globalThis.ApexCharts,n=globalThis.ApexCharts.__internals.__apex_Utils,i=globalThis.ApexCharts.__internals.__apex_Options,s=globalThis.ApexCharts.__internals.__apex_tooltip_Utils,a=["point","xaxis","yaxis"],r=[10,11,12,14,17,20],o=["circle","square","diamond","triangle"],l={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},d=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class c{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let n=t,i=1/0;for(let s=0;s<e.length;s++){const a=Math.abs(e[s]-t);a<i&&(i=a,n=e[s])}return n}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const n=this.w.globals.yAxisScale,i=n&&n[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const n="point"===t?"points":t;return Array.isArray(e[n])?e[n]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return a.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(a.forEach(n=>{this._annoList(n).forEach((i,s)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+n+"-"+s+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,n,s)),t.addEventListener("touchstart",t=>this._onDown(t,n,s)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(n,s,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,n){if(t.button&&0!==t.button)return;const i=this.w,s=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!s)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const a="touchstart"===t.type?t.touches[0]:t,r=i.dom.Paper&&i.dom.Paper.node,o=r&&r.getScreenCTM?r.getScreenCTM():null,l=this._annoList(e)[n];let d="move",c=null,h=0,p=0;if("xaxis"===e&&null!=l.x2&&(c=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),c)){const t=c.getBoundingClientRect();Math.abs(a.clientX-t.left)<=8?d="resize-x1":Math.abs(a.clientX-t.right)<=8&&(d="resize-x2"),h=parseFloat(c.getAttribute("x"))||0,p=parseFloat(c.getAttribute("width"))||0}this._drag={type:e,index:n,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:d,rect:c,origX:h,origW:p,startX:a.clientX,startY:a.clientY,scaleX:o&&o.a?o.a:1,scaleY:o&&o.d?o.d:1,dxPixel:0,dyPixel:0,moved:!1},s.addEventListener("mousemove",this._onMove),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const n="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(n.clientX-e.startX)/e.scaleX,e.dyPixel=(n.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,n;null==(n=null==(e=this.ctx.history)?void 0:e.snapshot)||n.call(e,t)}_applyDelta(t,e){const n=this.w,i=n.layout.gridWidth?t.dxPixel*(n.globals.xRange/n.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:s}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=s){const t=e.yAxisIndex||0,i=n.globals.seriesYAxisMap;e.y=this._snapY(s,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,s=n.globals.seriesYAxisMap,a=s&&s[i]?s[i][0]:0,r=n.globals.yRange?n.globals.yRange[a]:null;if(null==r||!n.layout.gridHeight)return;const o=-t.dyPixel*(r/n.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=o),e.y2+=o):"number"==typeof e.y&&(e.y=this._snapY(e.y+o,a))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const n=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!n:n)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,n){const i=this.w,s=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let a=t.x;!s&&"number"==typeof t.x&&i.layout.gridWidth&&(a=t.x+e*(i.globals.xRange/i.layout.gridWidth));let r=t.y;const o=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,d=l&&l[o]?l[o][0]:0,c=i.globals.yRange?i.globals.yRange[d]:null,h=i.config.yaxis[o]&&i.config.yaxis[o].logarithmic;return"number"==typeof t.y&&null!=c&&!h&&i.layout.gridHeight&&(r=t.y-n*(c/i.layout.gridHeight)),{newX:a,newY:r}}_redrawAnno(t,e,n){const i=this.w.dom.baseEl,s=this.ctx.annotations;if(!i||!s)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const a=i.querySelector(".apexcharts-"+t+"-annotations");if(!a)return;"point"===t&&s.pointsAnnotations?s.pointsAnnotations.addPointAnnotation(e,a,n):"xaxis"===t&&s.xAxisAnnotations?s.xAxisAnnotations.addXaxisAnnotation(e,a,n):"yaxis"===t&&s.yAxisAnnotations&&s.yAxisAnnotations.addYaxisAnnotation(e,a,n);const r=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(r&&s.helpers&&e.label&&e.label.text){const t=s.helpers.addBackgroundToAnno(r,e);t&&r.parentNode&&r.parentNode.insertBefore(t.node,r)}this._attach()}_fireAnnotationEvent(t,e){var n;const i=this.w.config.chart.events;"function"==typeof i[t]&&i[t](this.ctx,e),null==(n=this.ctx.events)||n.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,n){const i={type:t,id:e.id,index:n,x:e.x,y:e.y};null!=e.x2&&(i.x2=e.x2),null!=e.y2&&(i.y2=e.y2),this._fireAnnotationEvent("annotationDragged",i)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const r="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,o=n.extend((new i).pointAnnotation,{x:t,y:e,id:r,owner:"ink",draggable:!0,label:{text:s.text||"Note"}});a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations.points)||(a.config.annotations.points=[]),a.config.annotations.points.push(o);const l=a.config.annotations.points.length-1;return this._redrawAnno("point",o,l),this._checkpoint("ink:create"),this._fireCreated("point",o,l),this._startEdit("point",l,{select:!0}),o}createLineAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const r="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,o="y"===t?"yaxis":"xaxis",l="yaxis"===o?(new i).yAxisAnnotation:(new i).xAxisAnnotation,d={id:r,owner:"ink",draggable:!0,strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4,label:{text:s.text||""}};s.color&&(d.borderColor=s.color,d.label.borderColor=s.color),"yaxis"===o?d.y=e:d.x=e;const c=n.extend(l,d);a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations[o])||(a.config.annotations[o]=[]),a.config.annotations[o].push(c);const h=a.config.annotations[o].length-1;return this._redrawAnno(o,c,h),this._checkpoint("ink:create"),this._fireCreated(o,c,h),!1!==s.select&&this._startEdit(o,h,{select:!0}),c}_pixelToData(t,e){const n=this.w;if(!n.globals.axisCharts||!n.dom.baseEl||!n.dom.baseEl.querySelector(".apexcharts-svg"))return null;const i=s.plotRect(n);if(!i.width||!i.height)return null;const a=(t-i.left)/i.width,r=(e-i.top)/i.height;let o=n.globals.minX+a*n.globals.xRange;const l=(n.globals.minYArr&&null!=n.globals.minYArr[0]?n.globals.minYArr[0]:n.globals.minY)+(1-r)*(n.globals.yRange&&null!=n.globals.yRange[0]?n.globals.yRange[0]:n.globals.maxY-n.globals.minY);return("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric&&(o=Math.round(o)),{x:o,y:l}}_fireCreated(t,e,n){const i={type:t,id:e.id,index:n};void 0!==e.x&&(i.x=e.x),void 0!==e.y&&(i.y=e.y),this._fireAnnotationEvent("annotationCreated",i)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,n=e.createElement("div");n.className="apexcharts-ink-palette";const i=n.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const s=e.createElement("button");s.type="button",s.className="apexcharts-ink-add",s.textContent="+ Note";const a=s.style;a.cursor="pointer",a.font="12px sans-serif",a.padding="4px 9px",a.borderRadius="5px",a.border="1px solid #6366f1",a.color="#4338ca",a.background="#fff",s.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),n.appendChild(s),t.appendChild(n),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:d}static _isLight(t){const e=String(t||"").replace("#",""),n=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(n,16);return!isNaN(i)&&6===n.length&&(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,n,i,s,a){const r=t.createElement("button");return r.type="button",r.className="apexcharts-ink-btn"+(s?" "+s:""),r.title=n,r.setAttribute("aria-label",n),a?r.innerHTML=e:r.textContent=e,r.addEventListener("mousedown",t=>t.preventDefault()),r.addEventListener("click",t=>{t.stopPropagation(),i()}),r}_cardLabel(t,e){const n=t.createElement("span");return n.className="apexcharts-ink-cardlabel",n.textContent=e,n}_mkSwatch(t,e,n,i){const s=t.createElement("button");return s.type="button",s.className="apexcharts-ink-swatch"+(i?" "+i:""),s.title=e,s.setAttribute("aria-label","Color "+e),s.dataset.color=e,s.style.background=e,s.addEventListener("mousedown",t=>t.preventDefault()),s.addEventListener("click",t=>{t.stopPropagation(),n(e)}),s}_startEdit(t,e,n={}){const i=this.w,s=this._annoList(t)[e],a=i.dom.baseEl,r=i.dom.elWrap;if(!(s&&s.id&&a&&r))return;this._closeEditor(!1);const o=a.ownerDocument,d=o.createElement("div");d.className="apexcharts-ink-card",d.setAttribute("role","dialog"),d.setAttribute("aria-label","Edit note"),d.style.visibility="hidden";const c=o.createElement("div");c.className="apexcharts-ink-card-row";const h=o.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=s.label&&s.label.text||"",c.appendChild(h),c.appendChild(this._cardBtn(o,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),d.appendChild(c);const p=o.createElement("div");p.className="apexcharts-ink-card-row","point"!==t&&p.appendChild(this._cardLabel(o,"Label")),this._noteColors().forEach(t=>{p.appendChild(this._mkSwatch(o,t,t=>this._applyColor(t)))});const x=o.createElement("span");if(x.className="apexcharts-ink-sep",p.appendChild(x),p.appendChild(this._cardBtn(o,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),p.appendChild(this._cardBtn(o,"A-","Smaller text",()=>this._stepFont(-1))),p.appendChild(this._cardBtn(o,"A+","Larger text",()=>this._stepFont(1))),d.appendChild(p),"point"!==t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(o,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),d.appendChild(t)}if("point"===t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Marker")),t.appendChild(this._cardBtn(o,"-","Smaller marker",()=>this._stepMarker(-1)));const e=o.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(o,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(o,l.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),d.appendChild(t)}r.appendChild(d),this._editor={card:d,input:h,type:t,index:e},this._positionCard(),this._syncCard(),d.style.visibility="",h.focus(),n.select&&h.select(),d.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),o.addEventListener("mousedown",this._onDocDownEditor,!0),o.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,n=e.dom.baseEl,i=e.dom.elWrap,s=this._annoList(t.type)[t.index];if(!n||!i||!s)return;const a=n.querySelector(".apexcharts-"+t.type+"-annotation-label."+s.id)||n.querySelector("."+s.id);if(!a)return;const r=i.getBoundingClientRect(),o=a.getBoundingClientRect(),l=t.card.offsetWidth,d=t.card.offsetHeight;let c=Math.round(o.left-r.left),h=Math.round(o.bottom-r.top)+8;h+d>i.clientHeight-4&&(h=Math.round(o.top-r.top)-d-8),c+l>i.clientWidth-4&&(c=i.clientWidth-l-4),t.card.style.left=Math.max(4,c)+"px",t.card.style.top=Math.max(4,h)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const n=e.label&&e.label.style||{},i=String(n.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const s=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===s)});const a=t.card.querySelector(".apexcharts-ink-btn--bold");a&&a.classList.toggle("apexcharts-ink-btn--active",c._isBold(n));const r=e.marker||{},o=t.card.querySelector(".apexcharts-ink-marker-size");o&&(o.textContent=String("number"==typeof r.size?r.size:4));const d=t.card.querySelector(".apexcharts-ink-btn--shape");d&&(d.textContent=l[r.shape]||l.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const n=t.input.value;e.label||(e.label={}),e.label.text!==n&&(e.label.text=n,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const n=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;n&&(n.removeEventListener("mousedown",this._onDocDownEditor,!0),n.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const n=this._editor;if(!n)return;const i=this._annoList(n.type)[n.index];i&&(this._commitTextOf(n),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(n.type,i,n.index),this._checkpoint(t),this._fireStyled(n.type,i,n.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const n=c._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=n?"#334155":"#ffffff",i.label.borderColor=n?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=n?"#334155":t,i.marker.fillColor=n?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const n=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<r.length;t++)Math.abs(r[t]-n)<Math.abs(r[i]-n)&&(i=t);i=Math.min(r.length-1,Math.max(0,i+t)),e.label.style.fontSize=r[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=c._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const n="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,n+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=o.indexOf(t.marker.shape);t.marker.shape=o[(e+1)%o.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),n=e[t.index];if(this._closeEditor(!1),!n)return;const i=this.w.dom.baseEl;i&&n.id&&i.querySelectorAll("."+n.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let n=t.index;n<e.length;n++)this._redrawAnno(t.type,e[n],n);this._checkpoint("ink:delete"),this._fireDeleted(t.type,n,t.index)}_fireEdited(t,e,n){const i={type:t,id:e.id,index:n,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",i)}_fireStyled(t,e,n){const i={type:t,id:e.id,index:n,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",i)}_fireDeleted(t,e,n){const i={type:t,id:e.id,index:n};this._fireAnnotationEvent("annotationDeleted",i)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,n,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(n=this.ctx).removeEventListener)||i.call(n,"updated",this._onRerender),this._wired=!1)}}e.registerFeatures({ink:c}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexInk={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,n=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&a(t,i,e[i]);if(o)for(var i of o(e))r.call(e,i)&&a(t,i,e[i]);return t},l=(t,o)=>e(t,i(o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_tooltip_Utils,p=h.__apex_Utils;h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,o;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(o=this.ctx.toolbar)||o.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,o=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==o?void 0:o.minX)<(null==o?void 0:o.maxX))}_canPan(){return this._canZoom()}_panBy(t){const e=this.ctx.toolbar;if(!e)return;const i=e._currentXRange(),o=Number(i.minX),s=Number(i.maxX);if(!isFinite(o)||!isFinite(s)||o===s)return;const r=.1*(s-o)*t;e.zoomUpdateOptions(o+r,s+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const o=this.w,s=o.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=o.config.chart.type;if(!("heatmap"===r||"treemap"===r)&&e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=o.config.yaxis[0])?void 0:i.reversed)||(t=-t);const a=this._getSeriesCount();let n=this.seriesIndex;for(let e=1;e<a;e++){let i=n+t*e;if(s)i=(i+a)%a;else if(i<0||i>=a)break;if(!o.globals.collapsedSeriesIndices.includes(i)){n=i;break}}this.seriesIndex=n;const l=this._getDataPointCount(n);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let o=this.dataPointIndex,s=0;if(Array.isArray(t.seriesData.series[e])){for(;s<i&&null===t.seriesData.series[e][o];)o=(o+1)%i,s++;this.dataPointIndex=o}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let o=this.dataPointIndex,s=0;if(Array.isArray(t.seriesData.series[e])){for(;s<i&&null===t.seriesData.series[e][o];)o=(o-1+i)%i,s++;this.dataPointIndex=o}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,o=i.globals.tooltip;o&&o.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,o))}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const o=i.getElTooltip();o&&(o.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&o.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=i.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const o=this.w,s=o.config.chart.type,r=i.getElTooltip();if(!r)return;const a=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:a.ttWidth||0,ttHeight:a.ttHeight||0},this._setSyntheticEvent(t,e,i),o.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),o.config.chart.accessibility.enabled&&o.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===s||"donut"===s||"polarArea"===s?this._showTooltipNonAxis(t,e,i,r):"radialBar"===s?this._showTooltipRadialBar(t,e,i,r):"heatmap"===s||"treemap"===s?this._showTooltipHeatTree(t,e,i,r,s):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,o=i.config.series[t],s=i.globals.comboCharts&&null!=(e=null==o?void 0:o.type)?e:i.config.chart.type;return u.isBarLikeType(s)}_setSyntheticEvent(t,e,i){const o=this.w,s=o.config.chart.type;let r=0,a=0;const n=this._getFocusableElement(t,e),l=n?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(n){const t=n.getBoundingClientRect();r=t.left+t.width/2,a=t.top+t.height/2}else if(l){const t=u.plotRect(o);r=t.left+(l.x+l.width/2)*t.zoom,a=t.top+(l.y+l.height/2)*t.zoom}else if(o.globals.pointsArray&&o.globals.pointsArray[t]&&o.globals.pointsArray[t][e]){const s=o.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=u.plotRect(o);r=t.left+(s[0]||0)*t.zoom,a=t.top+(s[1]||0)*t.zoom}}else{const t=o.dom.Paper&&o.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,a=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===s||"area"===s||"rangeArea"===s||"scatter"===s||"bubble"===s||"radar"===s)&&o.globals.pointsArray&&o.globals.pointsArray[t]&&o.globals.pointsArray[t][e]){const s=o.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=u.plotRect(o);r=t.left+(s[0]||0)*t.zoom,a=t.top+(s[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:a},i.clientX=r,i.clientY=a}_showTooltipBar(t,e,i){var o,s,r,a;const c=this.w;c.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),p=null==(a=null==(r=null==(s=null==(o=c.rangeData.seriesRange)?void 0:o[t])?void 0:s[e])?void 0:r.y)?void 0:a[0];i.tooltipLabels.drawSeriesTexts(l(n(n({ttItems:i.ttItems,i:t,j:e},void 0!==(null==p?void 0:p.y1)&&{y1:p.y1}),void 0!==(null==p?void 0:p.y2)&&{y2:p.y2}),{shared:h}));const f=`.apexcharts-series[data\\:realIndex='${t}']`,g=this._canvasMark(t,e)?null:c.dom.Paper.findOne(`${f} path[j='${e}'], ${f} circle[j='${e}'], ${f} rect[j='${e}']`);if(g){this._leaveHoveredBar();new d(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const o=i.fixedTooltip;if(!o&&!i.showOnIntersect&&!u.isFollowCursor(c)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const s=this._focusedBarInWrap(t,e,g,i),r=i.getElTooltip();if(s&&r&&!o){const o=i.tooltipRect.ttWidth||0,a=i.tooltipRect.ttHeight||0,n=u.plotInWrap(c),l={top:n.top,bottom:n.top+c.layout.gridHeight,left:n.left,right:n.left+c.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((s.left+s.right)/2,s.top,s.bottom);if(h)i.tooltipPosition.applyTooltipPosition(r,h);else if(c.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(s,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(s.left+s.right)/2<t?s.left-o:s.right;if(u.isFollowCursor(c)){const t=(s.left+s.right)/2-l.left+15;e=l.left+(t+o>c.layout.gridWidth?t-o:t)}const n=(s.top+s.bottom)/2-a/2;r.style.left=Math.max(Math.min(e,l.right-o),l.left)+"px",r.style.top=Math.max(Math.min(n,l.bottom-a),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,g,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,o){const s=this.w,r=this._canvasMark(t,e),a=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!a)return void o.tooltipPosition.moveStickyTooltipOverBars(e,t);const c=s.dom.Paper.node;o.intersect.handleBarTooltip({e:l(n({},o.e),{type:"mousemove",target:a||c,apexHoverTarget:a||c,apexPaintedHit:r}),opt:{paths:a||c,hoverArea:c,elGrid:o.getElGrid(),tooltipEl:o.getElTooltip(),ttItems:o.ttItems}})}_focusedBarInWrap(t,e,i,o){var s,r,a;const n=this.w,l=("violin"===n.config.chart.type||"violin"===(null==(s=n.config.series[t])?void 0:s.type))&&(null==(r=o.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(a=null==i?void 0:i.node)?void 0:a.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=n.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var o;const s=this.w,r=s.config.chart.type,a=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:a});const n="scatter"===r||"bubble"===r||"radar"===r,l=s.globals.markers.largestSize>0&&!s.globals.markers.batched&&"canvas"!==(null==(o=this.ctx.renderer)?void 0:o.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):n||l&&!a?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(n({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const o=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const s=o.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!s)return!1;const r=s.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,o){const s=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=o.getBoundingClientRect(),a=r.width||i.tooltipRect.ttWidth||0,n=r.height||i.tooltipRect.ttHeight||0,l=s.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);if(c){const t=i.tooltipPosition.placeOverAnchor(c.x,c.y,a,n,10);o.style.left=t.x+"px",o.style.top=t.y+"px"}}_showTooltipRadialBar(t,e,i,o){var s;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:a=0,ttHeight:n=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(s=l.getAttribute("data:angle"))?s:"")||0,c=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,d=r.layout.gridHeight/2,u=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,f=r.seriesData.series.length,g=u/Math.max(f,1),m=u-t*g,v=(m+(m-g))/2,_=p.polarToCartesian(h,d,v,c),b=_.x+(r.layout.translateX||0),x=_.y+(r.layout.translateY||0),y=i.tooltipPosition.placeOverAnchor(b,x,a,n,10);o.style.left=y.x+"px",o.style.top=y.y+"px"}}_showTooltipHeatTree(t,e,i,o,s){var r,a;const n=this.w;if(u.isFollowCursor(n)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=o.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===s?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",p=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),f=p?null:this._canvasCell(t,e);if(p||f){const t=n.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,g=0;if(p){const o=p.getBoundingClientRect();e=o.left-t.left,l=o.top-t.top,d=o.width,g=o.height;const s=parseFloat(null!=(r=p.getAttribute("cx"))?r:""),n=parseFloat(null!=(a=p.getAttribute("width"))?a:"");i.tooltipPosition.moveXCrosshairs(s+n/2)}else if(f){const t=u.plotInWrap(n);e=t.left+f.x,l=t.top+f.y,d=f.width,g=f.height,i.tooltipPosition.moveXCrosshairs(f.x+f.width/2)}let m=e+d+c/2;const v=l+g/2-h/2;e+d>n.layout.gridWidth/2&&(m=e-c/2);const _=i.tooltipPosition.shortPlotPlacement,b=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+g);if(b)return void i.tooltipPosition.applyTooltipPosition(o,b);if("heatmap"===s&&n.config.tooltip.arrow&&!u.isFollowCursor(n)){const{left:t,top:s}=u.plotInWrap(n);return void i.tooltipPosition.applyTooltipPosition(o,i.tooltipPosition.placeAroundCell({top:l,bottom:l+g,left:e,right:e+d},{top:s,bottom:s+n.layout.gridHeight,left:t,right:t+n.layout.gridWidth},{el:p,ttWidth:c,ttHeight:h}))}o.style.left=m+"px",o.style.top=v+"px",_&&delete o.dataset.placement}}_hoverFocusedCell(t,e,i){const o=this.w,s=o.config.chart.type,r=i.getElTooltip(),a=o.dom.baseEl.querySelector(`.apexcharts-${s}-rect[i='${t}'][j='${e}']`);if(!r||!a&&!this._canvasCell(t,e))return!1;const c=a||o.dom.Paper.node;o.interact.capturedSeriesIndex=-1,o.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:l(n({},i.e),{type:"mousemove",target:c,apexHoverTarget:c}),opt:{ttItems:i.ttItems},x:0,y:0,type:s}),d=!h.noHit&&o.interact.capturedSeriesIndex===t&&o.interact.capturedDataPointIndex===e;return o.interact.capturedSeriesIndex=t,o.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const o=u.plotRect(this.w),s=o.left+i.x*o.zoom,r=o.top+i.y*o.zoom;return{left:s,top:r,right:s+i.width*o.zoom,bottom:r+i.height*o.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const o=this._buildPointLabel(t,e);o&&i.setAttribute("aria-label",o),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const o=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!o)return null;const s=new d(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return s.node.classList.add("apexcharts-keyboard-focus-ring"),s.attr({i:t,j:e}),o.insertBefore(s.node,o.firstChild),s.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const o=this.w,s=Array.from(o.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!s)return null;const r=new d(o,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${o.globals.cuid})`),s.insertBefore(r.node,s.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const o=this.w,s=Array.from(o.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!s)return null;const r=new d(o,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${o.globals.cuid})`),s.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,o,s,r,a,n,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],p=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(o=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?o:"",s=Array.isArray(p)?p[e]:"";return t?`${t}: ${s}`:`${s}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const f=u[t]||`Series ${t+1}`,g=(Array.isArray(p[t])?p[t]:[])[e];let m=null==g?"":String(g);const v=null==(r=null==(s=h.formatters)?void 0:s.yLabelFormatters)?void 0:r[t];if("function"==typeof v)try{m=v(g,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let _="";const b=null==(a=h.labelData)?void 0:a.categoryLabels,x=null==(l=null==(n=h.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])_=String(b[e]);else if(Array.isArray(x)&&null!=x[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{_=String(i(x[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){_=String(x[e])}else _=String(x[e])}return _?`${f}: ${m}, ${_}`:`${f}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new d(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,o=i.config.chart.type,s=i.dom.baseEl;if("pie"===o||"donut"===o||"polarArea"===o)return s.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===o)return s.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===o)return s.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===o)return s.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(this._isBarLikeSeries(t))return this._canvasMark(t,e)?null:s.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return s.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const o=e.seriesData.series;return o[t]&&Array.isArray(o[t])?o[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const o=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!o||!o.length)return;const s=e.minX,r=e.maxX;if(void 0===s||void 0===r)return;const a=o[this.dataPointIndex];if(a>=s&&a<=r)return;const n=o.length;for(let t=0;t<n;t++)if(o[t]>=s&&o[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,o=this.seriesIndex,s=e.seriesData.seriesX&&e.seriesData.seriesX[o];if(!s||!s.length)return;const r=i.minX,a=i.maxX;if(void 0===r||void 0===a)return;const n=s.length;if(t>=0){for(let t=0;t<n;t++)if(s[t]>=r&&s[t]<=a)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(s[t]>=r&&s[t]<=a)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,o=i.globals;if(!i.interact.zoomed)return!0;const s=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!s)return!0;const r=s[e];return void 0===r||r>=o.minX&&r<=o.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const o=i.querySelector(".apexcharts-sr-status");o&&(o.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{o.textContent=t},0))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,o)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,a=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&n(t,i,e[i]);if(o)for(var i of o(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,o)=>e(t,i(o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_tooltip_Utils;h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w,e=t.dom.Paper.node;if(!e)return;e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("mousedown",this._onPointerDown,{capture:!0}),e.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick);const i=t.interact.keyNav,o=e.ownerDocument;t.interact.keyNav=null,!i||o.activeElement&&o.activeElement!==o.body||([this.seriesIndex,this.dataPointIndex,,this._tooltipDismissed]=i,i[2]||this.notePointerFocus(),e.focus({preventScroll:!0}))}destroy(t){var e;const i=this.w,o=i.dom.Paper&&i.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),o&&(t&&(null==(e=o.getRootNode)?void 0:e.call(o).activeElement)===o&&(i.interact.keyNav=[this.seriesIndex,this.dataPointIndex,this.active,this._tooltipDismissed]),o.removeEventListener("focus",this._onFocus),o.removeEventListener("blur",this._onBlur),o.removeEventListener("keydown",this._onKeyDown),o.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),o.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),o.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._tooltipDismissed||this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,o;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this._seek(0,1),this._showCurrentPoint();break;case"End":t.preventDefault(),this._seek(this._getDataPointCount(this.seriesIndex)-1,-1),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick(t);break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(o=this.ctx.toolbar)||o.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,o=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==o?void 0:o.minX)<(null==o?void 0:o.maxX))}_canPan(){return this._canZoom()&&this.w.interact.zoomed}_panBy(t){var e;null==(e=this.ctx.zoomPanSelection)||e.panBy(t/10),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const o=this.w,s=o.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=o.config.chart.type;if(!("heatmap"===r||"treemap"===r||"radialBar"===r)&&(null==e?void 0:e.ttItems)&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=o.config.yaxis[0])?void 0:i.reversed)||(t=-t);const n=this._getSeriesCount();let a=this.seriesIndex;for(let e=1;e<n;e++){let i=a+t*e;if(s)i=(i+n)%n;else if(i<0||i>=n)break;if(!o.globals.collapsedSeriesIndices.includes(i)){a=i;break}}this.seriesIndex=a;const l=this._getDataPointCount(a);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}0!==e&&(this._seek(this.dataPointIndex+e,e),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)),this._showCurrentPoint()}_seek(t,e){const i=this.w,o=i.seriesData.series[this.seriesIndex],s=this._getDataPointCount(this.seriesIndex);for(let r=0;r<s;r++,t+=e){if(i.config.chart.accessibility.keyboard.navigation.wrapAround)t=(t+s)%s;else if(t<0||t>=s)return;if(!Array.isArray(o)||null!==o[t])return void(this.dataPointIndex=t)}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,o=i.globals.tooltip;if(this._tooltipDismissed=!1,i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),!(null==o?void 0:o.ttItems))return this._announce(this._buildPointLabel(t,e));this._showTooltip(t,e,o)}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const o=i.getElTooltip();o&&(o.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&o.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=i.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const o=this.w,s=o.config.chart.type,r=i.getElTooltip();if(!r)return;const n=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:n.ttWidth||0,ttHeight:n.ttHeight||0},this._setSyntheticEvent(t,e,i),o.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),o.config.chart.accessibility.enabled&&o.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===s||"donut"===s||"polarArea"===s||"radialBar"===s?this._showTooltipNonAxis(t,e,i,r):"heatmap"===s||"treemap"===s?this._showTooltipHeatTree(t,e,i,r,s):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,o=i.config.series[t],s=i.globals.comboCharts&&null!=(e=null==o?void 0:o.type)?e:i.config.chart.type;return u.isBarLikeType(s)}_setSyntheticEvent(t,e,i){const o=this.w,s=o.config.chart.type;let r=0,n=0;const a=this._getFocusableElement(t,e),l=a?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(a){const t=a.getBoundingClientRect();r=t.left+t.width/2,n=t.top+t.height/2}else if(l){const t=u.plotRect(o);r=t.left+(l.x+l.width/2)*t.zoom,n=t.top+(l.y+l.height/2)*t.zoom}else if(o.globals.pointsArray&&o.globals.pointsArray[t]&&o.globals.pointsArray[t][e]){const s=o.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=u.plotRect(o);r=t.left+(s[0]||0)*t.zoom,n=t.top+(s[1]||0)*t.zoom}}else{const t=o.dom.Paper&&o.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===s||"area"===s||"rangeArea"===s||"scatter"===s||"bubble"===s||"radar"===s)&&o.globals.pointsArray&&o.globals.pointsArray[t]&&o.globals.pointsArray[t][e]){const s=o.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=u.plotRect(o);r=t.left+(s[0]||0)*t.zoom,n=t.top+(s[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:n},i.clientX=r,i.clientY=n}_showTooltipBar(t,e,i){var o,s,r,n;const c=this.w;c.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),p=null==(n=null==(r=null==(s=null==(o=c.rangeData.seriesRange)?void 0:o[t])?void 0:s[e])?void 0:r.y)?void 0:n[0];i.tooltipLabels.drawSeriesTexts(l(a(a({ttItems:i.ttItems,i:t,j:e},void 0!==(null==p?void 0:p.y1)&&{y1:p.y1}),void 0!==(null==p?void 0:p.y2)&&{y2:p.y2}),{shared:h}));const f=`.apexcharts-series[data\\:realIndex='${t}']`,v=this._canvasMark(t,e)?null:c.dom.Paper.findOne(`${f} path[j='${e}'], ${f} circle[j='${e}'], ${f} rect[j='${e}']`);if(v){this._leaveHoveredBar();new d(this.w,this.ctx).pathMouseEnter(v,null),this._hoveredBarEl=v}if(c.globals.isBarHorizontal){const o=i.fixedTooltip;if(!o&&!i.showOnIntersect&&!u.isFollowCursor(c)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const s=this._focusedBarInWrap(t,e,v,i),r=i.getElTooltip();if(s&&r&&!o){const o=i.tooltipRect.ttWidth||0,n=i.tooltipRect.ttHeight||0,a=u.plotInWrap(c),l={top:a.top,bottom:a.top+c.layout.gridHeight,left:a.left,right:a.left+c.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((s.left+s.right)/2,s.top,s.bottom);if(h)i.tooltipPosition.applyTooltipPosition(r,h);else if(c.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(s,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(s.left+s.right)/2<t?s.left-o:s.right;if(u.isFollowCursor(c)){const t=(s.left+s.right)/2-l.left+15;e=l.left+(t+o>c.layout.gridWidth?t-o:t)}const a=(s.top+s.bottom)/2-n/2;r.style.left=Math.max(Math.min(e,l.right-o),l.left)+"px",r.style.top=Math.max(Math.min(a,l.bottom-n),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,v,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,o){const s=this.w,r=this._canvasMark(t,e),n=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!n)return void o.tooltipPosition.moveStickyTooltipOverBars(e,t);const c=s.dom.Paper.node;o.intersect.handleBarTooltip({e:l(a({},o.e),{type:"mousemove",target:n||c,apexHoverTarget:n||c,apexPaintedHit:r}),opt:{paths:n||c,hoverArea:c,elGrid:o.getElGrid(),tooltipEl:o.getElTooltip(),ttItems:o.ttItems}})}_focusedBarInWrap(t,e,i,o){var s,r,n;const a=this.w,l=("violin"===a.config.chart.type||"violin"===(null==(s=a.config.series[t])?void 0:s.type))&&(null==(r=o.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(n=null==i?void 0:i.node)?void 0:n.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=a.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var o;const s=this.w,r=s.config.chart.type,n=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:n});const a="scatter"===r||"bubble"===r||"radar"===r,l=s.globals.markers.largestSize>0&&!s.globals.markers.batched&&"canvas"!==(null==(o=this.ctx.renderer)?void 0:o.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):a||l&&!n?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):n?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(a({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const o=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const s=o.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!s)return!1;const r=s.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,o){i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t+e,shared:!1});const s=o.getBoundingClientRect(),r=s.width||i.tooltipRect.ttWidth||0,n=s.height||i.tooltipRect.ttHeight||0,a=i.getSliceAnchor(this._getFocusableElement(t,e));if(a){const t=i.tooltipPosition.placeOverAnchor(a.x,a.y,r,n,10);o.style.left=t.x+"px",o.style.top=t.y+"px"}}_showTooltipHeatTree(t,e,i,o,s){var r,n;const a=this.w;if(u.isFollowCursor(a)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=o.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===s?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",p=a.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),f=p?null:this._canvasCell(t,e);if(p||f){const t=a.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,v=0;if(p){const o=p.getBoundingClientRect();e=o.left-t.left,l=o.top-t.top,d=o.width,v=o.height;const s=parseFloat(null!=(r=p.getAttribute("cx"))?r:""),a=parseFloat(null!=(n=p.getAttribute("width"))?n:"");i.tooltipPosition.moveXCrosshairs(s+a/2)}else if(f){const t=u.plotInWrap(a);e=t.left+f.x,l=t.top+f.y,d=f.width,v=f.height,i.tooltipPosition.moveXCrosshairs(f.x+f.width/2)}let g=e+d+c/2;const m=l+v/2-h/2;e+d>a.layout.gridWidth/2&&(g=e-c/2);const _=i.tooltipPosition.shortPlotPlacement,b=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+v);if(b)return void i.tooltipPosition.applyTooltipPosition(o,b);if("heatmap"===s&&a.config.tooltip.arrow&&!u.isFollowCursor(a)){const{left:t,top:s}=u.plotInWrap(a);return void i.tooltipPosition.applyTooltipPosition(o,i.tooltipPosition.placeAroundCell({top:l,bottom:l+v,left:e,right:e+d},{top:s,bottom:s+a.layout.gridHeight,left:t,right:t+a.layout.gridWidth},{el:p,ttWidth:c,ttHeight:h}))}o.style.left=g+"px",o.style.top=m+"px",_&&delete o.dataset.placement}}_hoverFocusedCell(t,e,i){const o=this.w,s=o.config.chart.type,r=i.getElTooltip(),n=o.dom.baseEl.querySelector(`.apexcharts-${s}-rect[i='${t}'][j='${e}']`);if(!r||!n&&!this._canvasCell(t,e))return!1;const c=n||o.dom.Paper.node;o.interact.capturedSeriesIndex=-1,o.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:l(a({},i.e),{type:"mousemove",target:c,apexHoverTarget:c}),opt:{ttItems:i.ttItems},x:0,y:0,type:s}),d=!h.noHit&&o.interact.capturedSeriesIndex===t&&o.interact.capturedDataPointIndex===e;return o.interact.capturedSeriesIndex=t,o.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const o=u.plotRect(this.w),s=o.left+i.x*o.zoom,r=o.top+i.y*o.zoom;return{left:s,top:r,right:s+i.width*o.zoom,bottom:r+i.height*o.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const o=this._buildPointLabel(t,e);o&&i.setAttribute("aria-label",o),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const o=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!o)return null;const s=new d(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return s.node.classList.add("apexcharts-keyboard-focus-ring"),s.attr({i:t,j:e}),o.insertBefore(s.node,o.firstChild),s.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const o=this.w,s=this._seriesGroup(t);if(!s)return null;const r=new d(o,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${o.globals.cuid})`),s.insertBefore(r.node,s.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const o=this.w,s=this._seriesGroup(t);if(!s)return null;const r=new d(o,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${o.globals.cuid})`),s.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,o,s,r,n,a,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],p=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(o=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?o:"",s=Array.isArray(p)?p[e]:"";return t?`${t}: ${s}`:`${s}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const f=u[t]||`Series ${t+1}`,v=(Array.isArray(p[t])?p[t]:[])[e];let g=null==v?"":String(v);const m=null==(r=null==(s=h.formatters)?void 0:s.yLabelFormatters)?void 0:r[t];if("function"==typeof m)try{g=m(v,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let _="";const b=null==(n=h.labelData)?void 0:n.categoryLabels,x=null==(l=null==(a=h.seriesData)?void 0:a.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])_=String(b[e]);else if(Array.isArray(x)&&null!=x[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{_=String(i(x[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){_=String(x[e])}else _=String(x[e])}return _?`${f}: ${g}, ${_}`:`${f}: ${g}`}_leaveHoveredBar(){if(this._hoveredBarEl){new d(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){var i,o;const s=this.w,r=s.config.chart.type,n=s.dom.baseEl;return"pie"===r||"donut"===r||"polarArea"===r?n.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===r?n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===r?n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===r?n.querySelector(`.apexcharts-radialbar-slice-${t}`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:null==(i=this._seriesGroup(t))?void 0:i.querySelector(`path[j='${e}']`):null==(o=this._seriesGroup(t))?void 0:o.querySelector(`.apexcharts-marker[rel='${e}']`)}_seriesGroup(t){return Array.from(this.w.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t))}_fireClick(t){var e,i;const o=null==(e=this._focusedEl)?void 0:e.instance,s=this.ctx.pie;o&&new d(this.w,this.ctx).pathMouseDown(o,t),s&&s.getExpandOffset()>0&&s.pieClicked(this.dataPointIndex),null==(i=this.w.globals.tooltip)||i.markerClick(t,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const o=e.seriesData.series[t];return Array.isArray(o)?o.length:1}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const o=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!o||!o.length)return;const s=e.minX,r=e.maxX;if(void 0===s||void 0===r)return;const n=o[this.dataPointIndex];if(n>=s&&n<=r)return;const a=o.length;for(let t=0;t<a;t++)if(o[t]>=s&&o[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,o=this.seriesIndex,s=e.seriesData.seriesX&&e.seriesData.seriesX[o];if(!s||!s.length)return;const r=i.minX,n=i.maxX;if(void 0===r||void 0===n)return;const a=s.length;if(t>=0){for(let t=0;t<a;t++)if(s[t]>=r&&s[t]<=n)return void(this.dataPointIndex=t)}else for(let t=a-1;t>=0;t--)if(s[t]>=r&&s[t]<=n)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,o=i.globals;if(!i.interact.zoomed)return!0;const s=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!s)return!0;const r=s[e];return void 0===r||r>=o.minX&&r<=o.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const o=i.querySelector(".apexcharts-sr-status");o&&(o.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{o.textContent=t},0))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * ApexCharts v8.2.0
21
+ * ApexCharts v8.3.1
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -26,7 +26,6 @@ import _core__default from "apexcharts/core";
26
26
  import { default as default2 } from "apexcharts/core";
27
27
  const Graphics = _core.__apex_Graphics;
28
28
  const TooltipUtils = _core.__apex_tooltip_Utils;
29
- const Utils = _core.__apex_Utils;
30
29
  class KeyboardNavigation {
31
30
  /**
32
31
  * @param {import('../../types/internal').ChartStateW} w
@@ -72,16 +71,35 @@ class KeyboardNavigation {
72
71
  });
73
72
  svgEl.addEventListener("keydown", this._onKeyDown, { passive: false });
74
73
  this.ctx.events.addEventListener("legendClick", this._onLegendClick);
74
+ const kept = w.interact.keyNav;
75
+ const doc = svgEl.ownerDocument;
76
+ w.interact.keyNav = null;
77
+ if (kept && (!doc.activeElement || doc.activeElement === doc.body)) {
78
+ [this.seriesIndex, this.dataPointIndex, , this._tooltipDismissed] = kept;
79
+ if (!kept[2]) this.notePointerFocus();
80
+ svgEl.focus({ preventScroll: true });
81
+ }
75
82
  }
76
83
  /**
77
- * Removes all event listeners. Called from chart.destroy().
84
+ * Removes all event listeners. Called from chart.destroy(), and with
85
+ * `updating` when an update is about to replace the SVG.
86
+ * @param {boolean} [updating]
78
87
  */
79
- destroy() {
88
+ destroy(updating) {
89
+ var _a;
80
90
  const w = this.w;
81
91
  const svgEl = w.dom.Paper && w.dom.Paper.node;
82
92
  this.ctx.events.removeEventListener("legendClick", this._onLegendClick);
83
93
  clearTimeout(this._announceTimer);
84
94
  if (!svgEl) return;
95
+ if (updating && ((_a = svgEl.getRootNode) == null ? void 0 : _a.call(svgEl).activeElement) === svgEl) {
96
+ w.interact.keyNav = [
97
+ this.seriesIndex,
98
+ this.dataPointIndex,
99
+ this.active,
100
+ this._tooltipDismissed
101
+ ];
102
+ }
85
103
  svgEl.removeEventListener("focus", this._onFocus);
86
104
  svgEl.removeEventListener("blur", this._onBlur);
87
105
  svgEl.removeEventListener("keydown", this._onKeyDown);
@@ -133,7 +151,7 @@ class KeyboardNavigation {
133
151
  this.active = true;
134
152
  this._clampCursor();
135
153
  this._snapToVisibleRange();
136
- this._showCurrentPoint();
154
+ if (!this._tooltipDismissed) this._showCurrentPoint();
137
155
  }
138
156
  _onBlur() {
139
157
  this.active = false;
@@ -179,20 +197,18 @@ class KeyboardNavigation {
179
197
  break;
180
198
  case "Home":
181
199
  e.preventDefault();
182
- this.dataPointIndex = 0;
183
- this._skipNullForward();
200
+ this._seek(0, 1);
184
201
  this._showCurrentPoint();
185
202
  break;
186
203
  case "End":
187
204
  e.preventDefault();
188
- this.dataPointIndex = this._getDataPointCount(this.seriesIndex) - 1;
189
- this._skipNullBackward();
205
+ this._seek(this._getDataPointCount(this.seriesIndex) - 1, -1);
190
206
  this._showCurrentPoint();
191
207
  break;
192
208
  case "Enter":
193
209
  case " ":
194
210
  e.preventDefault();
195
- this._fireClick();
211
+ this._fireClick(e);
196
212
  break;
197
213
  case "+":
198
214
  case "=":
@@ -240,22 +256,15 @@ class KeyboardNavigation {
240
256
  );
241
257
  }
242
258
  _canPan() {
243
- return this._canZoom();
259
+ return this._canZoom() && this.w.interact.zoomed;
244
260
  }
245
261
  /**
246
- * Shift the visible x-range by ~10% in the given direction.
262
+ * Shift the visible x-range by ~10% in the given direction, as a drag pan.
247
263
  * @param {number} direction +1 = right, -1 = left
248
264
  */
249
265
  _panBy(direction) {
250
- const toolbar = this.ctx.toolbar;
251
- if (!toolbar) return;
252
- const r = toolbar._currentXRange();
253
- const minX = Number(r.minX);
254
- const maxX = Number(r.maxX);
255
- if (!isFinite(minX) || !isFinite(maxX) || minX === maxX) return;
256
- const span = maxX - minX;
257
- const step = span * 0.1 * direction;
258
- toolbar.zoomUpdateOptions(minX + step, maxX + step);
266
+ var _a;
267
+ (_a = this.ctx.zoomPanSelection) == null ? void 0 : _a.panBy(direction / 10);
259
268
  this._announce(direction > 0 ? "Panned right" : "Panned left");
260
269
  }
261
270
  // ─── Navigation ───────────────────────────────────────────────────────────
@@ -270,8 +279,8 @@ class KeyboardNavigation {
270
279
  if (dSeries !== 0) {
271
280
  const ttCtx = this.w.globals.tooltip;
272
281
  const type = w.config.chart.type;
273
- const perCell = type === "heatmap" || type === "treemap";
274
- if (!perCell && ttCtx && ttCtx.tConfig && ttCtx.tConfig.shared) {
282
+ const perCell = type === "heatmap" || type === "treemap" || type === "radialBar";
283
+ if (!perCell && (ttCtx == null ? void 0 : ttCtx.ttItems) && ttCtx.tConfig.shared) {
275
284
  const j = this.dataPointIndex;
276
285
  const isActuallyShared = ttCtx.tooltipUtil && ttCtx.tooltipUtil.isXoverlap(j) && ttCtx.tooltipUtil.isInitialSeriesSameLen();
277
286
  if (isActuallyShared) return;
@@ -297,59 +306,43 @@ class KeyboardNavigation {
297
306
  }
298
307
  }
299
308
  if (dPoint !== 0) {
300
- const dpCount = this._getDataPointCount(this.seriesIndex);
301
- let di = this.dataPointIndex + dPoint;
302
- if (di < 0) di = wrapAround ? dpCount - 1 : 0;
303
- if (di >= dpCount) di = wrapAround ? 0 : dpCount - 1;
304
- this.dataPointIndex = di;
305
- if (dPoint > 0) {
306
- this._skipNullForward();
307
- } else {
308
- this._skipNullBackward();
309
- }
309
+ this._seek(this.dataPointIndex + dPoint, dPoint);
310
310
  if (!this._isDataPointVisible(this.seriesIndex, this.dataPointIndex)) {
311
311
  this._snapToVisibleRangeInDirection(dPoint);
312
312
  }
313
313
  }
314
314
  this._showCurrentPoint();
315
315
  }
316
- /** Advance dataPointIndex forward past any nulls */
317
- _skipNullForward() {
318
- const w = this.w;
319
- const si = this.seriesIndex;
320
- const dpCount = this._getDataPointCount(si);
321
- let di = this.dataPointIndex;
322
- let attempts = 0;
323
- if (!Array.isArray(w.seriesData.series[si])) return;
324
- while (attempts < dpCount && w.seriesData.series[si][di] === null) {
325
- di = (di + 1) % dpCount;
326
- attempts++;
327
- }
328
- this.dataPointIndex = di;
329
- }
330
- /** Retreat dataPointIndex backward past any nulls */
331
- _skipNullBackward() {
316
+ /**
317
+ * Land on the first non-null point from `di` going `dir`. Past an edge it
318
+ * wraps only with wrapAround; when no point lies ahead the cursor stays.
319
+ * @param {number} di
320
+ * @param {number} dir
321
+ */
322
+ _seek(di, dir) {
332
323
  const w = this.w;
333
- const si = this.seriesIndex;
334
- const dpCount = this._getDataPointCount(si);
335
- let di = this.dataPointIndex;
336
- let attempts = 0;
337
- if (!Array.isArray(w.seriesData.series[si])) return;
338
- while (attempts < dpCount && w.seriesData.series[si][di] === null) {
339
- di = (di - 1 + dpCount) % dpCount;
340
- attempts++;
324
+ const row = w.seriesData.series[this.seriesIndex];
325
+ const n = this._getDataPointCount(this.seriesIndex);
326
+ for (let k = 0; k < n; k++, di += dir) {
327
+ if (w.config.chart.accessibility.keyboard.navigation.wrapAround) {
328
+ di = (di + n) % n;
329
+ } else if (di < 0 || di >= n) return;
330
+ if (!Array.isArray(row) || row[di] !== null) {
331
+ this.dataPointIndex = di;
332
+ return;
333
+ }
341
334
  }
342
- this.dataPointIndex = di;
343
335
  }
344
336
  // ─── Display ──────────────────────────────────────────────────────────────
345
337
  _showCurrentPoint() {
346
338
  const { seriesIndex: i, dataPointIndex: j } = this;
347
339
  const w = this.w;
348
340
  const ttCtx = w.globals.tooltip;
349
- if (!ttCtx || !ttCtx.ttItems) return;
341
+ this._tooltipDismissed = false;
350
342
  w.interact.capturedSeriesIndex = i;
351
343
  w.interact.capturedDataPointIndex = j;
352
344
  this._applyFocusClass(i, j);
345
+ if (!(ttCtx == null ? void 0 : ttCtx.ttItems)) return this._announce(this._buildPointLabel(i, j));
353
346
  this._showTooltip(
354
347
  i,
355
348
  j,
@@ -407,10 +400,8 @@ class KeyboardNavigation {
407
400
  if (w.config.chart.accessibility.enabled && w.config.chart.accessibility.announcements.enabled) {
408
401
  tooltipEl.removeAttribute("aria-hidden");
409
402
  }
410
- if (type === "pie" || type === "donut" || type === "polarArea") {
403
+ if (type === "pie" || type === "donut" || type === "polarArea" || type === "radialBar") {
411
404
  this._showTooltipNonAxis(i, j, ttCtx, tooltipEl);
412
- } else if (type === "radialBar") {
413
- this._showTooltipRadialBar(i, j, ttCtx, tooltipEl);
414
405
  } else if (type === "heatmap" || type === "treemap") {
415
406
  this._showTooltipHeatTree(i, j, ttCtx, tooltipEl, type);
416
407
  } else if (this._isBarLikeSeries(i)) {
@@ -765,24 +756,23 @@ class KeyboardNavigation {
765
756
  return true;
766
757
  }
767
758
  /**
768
- * pie / donut / polarArea
759
+ * pie / donut / polarArea (a slice per point, i is 0) and radialBar (a ring
760
+ * per series, j is 0)
769
761
  * @param {number} i
770
762
  * @param {number} j
771
763
  * @param {import('../tooltip/Tooltip').default} ttCtx
772
764
  * @param {HTMLElement} tooltipEl
773
765
  */
774
766
  _showTooltipNonAxis(i, j, ttCtx, tooltipEl) {
775
- const w = this.w;
776
767
  ttCtx.tooltipLabels.drawSeriesTexts({
777
768
  ttItems: ttCtx.ttItems,
778
- i: j,
769
+ i: i + j,
779
770
  shared: false
780
771
  });
781
772
  const tooltipBound = tooltipEl.getBoundingClientRect();
782
773
  const ttWidth = tooltipBound.width || ttCtx.tooltipRect.ttWidth || 0;
783
774
  const ttHeight = tooltipBound.height || ttCtx.tooltipRect.ttHeight || 0;
784
- const sliceEl = w.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${j}']`);
785
- const anchor = ttCtx.getSliceAnchor(sliceEl);
775
+ const anchor = ttCtx.getSliceAnchor(this._getFocusableElement(i, j));
786
776
  if (anchor) {
787
777
  const pos = ttCtx.tooltipPosition.placeOverAnchor(
788
778
  anchor.x,
@@ -795,56 +785,6 @@ class KeyboardNavigation {
795
785
  tooltipEl.style.top = pos.y + "px";
796
786
  }
797
787
  }
798
- /**
799
- * radialBar — one ring per series, single value each
800
- * @param {number} i
801
- * @param {any} _j
802
- * @param {import('../tooltip/Tooltip').default} ttCtx
803
- * @param {HTMLElement} tooltipEl
804
- */
805
- _showTooltipRadialBar(i, _j, ttCtx, tooltipEl) {
806
- var _a;
807
- const w = this.w;
808
- ttCtx.tooltipLabels.drawSeriesTexts({
809
- ttItems: ttCtx.ttItems,
810
- i,
811
- shared: false
812
- });
813
- const { ttWidth = 0, ttHeight = 0 } = ttCtx.getCachedDimensions();
814
- const arcEl = w.dom.baseEl.querySelector(
815
- `.apexcharts-radialbar-series[data\\:realIndex='${i}'] path`
816
- );
817
- if (arcEl) {
818
- const angle = parseFloat((_a = arcEl.getAttribute("data:angle")) != null ? _a : "") || 0;
819
- const initialAngle = w.config.plotOptions.radialBar.startAngle || 0;
820
- const midAngle = initialAngle + angle / 2;
821
- const centerX = w.layout.gridWidth / 2;
822
- const centerY = w.layout.gridHeight / 2;
823
- const radialSize = w.globals.radialSize || Math.min(w.layout.gridWidth, w.layout.gridHeight) / 2;
824
- const seriesCount = w.seriesData.series.length;
825
- const trackSize = radialSize / Math.max(seriesCount, 1);
826
- const outerRadius = radialSize - i * trackSize;
827
- const innerRadius = outerRadius - trackSize;
828
- const ringRadius = (outerRadius + innerRadius) / 2;
829
- const centroid = Utils.polarToCartesian(
830
- centerX,
831
- centerY,
832
- ringRadius,
833
- midAngle
834
- );
835
- const x = centroid.x + (w.layout.translateX || 0);
836
- const y = centroid.y + (w.layout.translateY || 0);
837
- const pos = ttCtx.tooltipPosition.placeOverAnchor(
838
- x,
839
- y,
840
- ttWidth,
841
- ttHeight,
842
- 10
843
- );
844
- tooltipEl.style.left = pos.x + "px";
845
- tooltipEl.style.top = pos.y + "px";
846
- }
847
- }
848
788
  /**
849
789
  * heatmap / treemap — position tooltip using element bounding rect
850
790
  * @param {number} i
@@ -1104,9 +1044,7 @@ class KeyboardNavigation {
1104
1044
  const mark = this._canvasMark(i, j);
1105
1045
  if (!mark) return this._drawCanvasMarkerFocusRing(i, j);
1106
1046
  const w = this.w;
1107
- const host = Array.from(
1108
- w.dom.baseEl.querySelectorAll(".apexcharts-series")
1109
- ).find((g) => g.getAttribute("data:realIndex") === String(i));
1047
+ const host = this._seriesGroup(i);
1110
1048
  if (!host) return null;
1111
1049
  const ring = new Graphics(w, this.ctx).drawPath({
1112
1050
  d: mark.d,
@@ -1130,9 +1068,7 @@ class KeyboardNavigation {
1130
1068
  const marker = this._canvasMarker(i, j);
1131
1069
  if (!marker) return null;
1132
1070
  const w = this.w;
1133
- const host = Array.from(
1134
- w.dom.baseEl.querySelectorAll(".apexcharts-series")
1135
- ).find((g) => g.getAttribute("data:realIndex") === String(i));
1071
+ const host = this._seriesGroup(i);
1136
1072
  if (!host) return null;
1137
1073
  const ring = new Graphics(w, this.ctx).drawPath({
1138
1074
  d: marker.d,
@@ -1226,6 +1162,7 @@ class KeyboardNavigation {
1226
1162
  * @param {number} j
1227
1163
  */
1228
1164
  _getFocusableElement(i, j) {
1165
+ var _a, _b;
1229
1166
  const w = this.w;
1230
1167
  const type = w.config.chart.type;
1231
1168
  const baseEl = w.dom.baseEl;
@@ -1243,32 +1180,47 @@ class KeyboardNavigation {
1243
1180
  );
1244
1181
  }
1245
1182
  if (type === "radialBar") {
1246
- return baseEl.querySelector(
1247
- `.apexcharts-radialbar-series[data\\:realIndex='${i}'] path`
1248
- );
1183
+ return baseEl.querySelector(`.apexcharts-radialbar-slice-${i}`);
1249
1184
  }
1250
1185
  if (this._isBarLikeSeries(i)) {
1251
1186
  if (this._canvasMark(i, j)) return null;
1252
- return baseEl.querySelector(
1253
- `.apexcharts-series[data\\:realIndex='${i}'] path[j='${j}']`
1254
- );
1187
+ return (_a = this._seriesGroup(i)) == null ? void 0 : _a.querySelector(`path[j='${j}']`);
1255
1188
  }
1256
- const marker = baseEl.querySelector(
1257
- `.apexcharts-series[data\\:realIndex='${i}'] .apexcharts-marker[rel='${j}']`
1258
- );
1259
- return marker || null;
1189
+ return (_b = this._seriesGroup(i)) == null ? void 0 : _b.querySelector(`.apexcharts-marker[rel='${j}']`);
1190
+ }
1191
+ /**
1192
+ * The series' own group, by realIndex (`rel` counts within a type's groups,
1193
+ * which a combo has several of). Matched in script: not every selector
1194
+ * engine takes the escaped `data\:realIndex` attribute.
1195
+ * @param {number} i
1196
+ * @returns {Element | undefined}
1197
+ */
1198
+ _seriesGroup(i) {
1199
+ return Array.from(
1200
+ this.w.dom.baseEl.querySelectorAll(".apexcharts-series")
1201
+ ).find((g) => g.getAttribute("data:realIndex") === String(i));
1260
1202
  }
1261
1203
  // ─── Click / Enter ────────────────────────────────────────────────────────
1262
- _fireClick() {
1263
- const w = this.w;
1264
- const ttCtx = w.globals.tooltip;
1265
- if (!ttCtx) return;
1266
- const syntheticEvent = {
1267
- type: "mouseup",
1268
- clientX: 0,
1269
- clientY: 0
1270
- };
1271
- ttCtx.markerClick(syntheticEvent, this.seriesIndex, this.dataPointIndex);
1204
+ /**
1205
+ * What a click on the focused mark does: its mousedown selects it
1206
+ * (dataPointSelection), its mouseup slides a pie slice out and fires
1207
+ * markerClick.
1208
+ * @param {KeyboardEvent} e
1209
+ */
1210
+ _fireClick(e) {
1211
+ var _a, _b;
1212
+ const el = (
1213
+ /** @type {any} */
1214
+ (_a = this._focusedEl) == null ? void 0 : _a.instance
1215
+ );
1216
+ const pie = this.ctx.pie;
1217
+ if (el) new Graphics(this.w, this.ctx).pathMouseDown(el, e);
1218
+ if (pie && pie.getExpandOffset() > 0) pie.pieClicked(this.dataPointIndex);
1219
+ (_b = this.w.globals.tooltip) == null ? void 0 : _b.markerClick(
1220
+ e,
1221
+ this.seriesIndex,
1222
+ this.dataPointIndex
1223
+ );
1272
1224
  }
1273
1225
  // ─── Helpers ──────────────────────────────────────────────────────────────
1274
1226
  _isNavEnabled() {
@@ -1292,8 +1244,8 @@ class KeyboardNavigation {
1292
1244
  if (type === "pie" || type === "donut" || type === "polarArea") {
1293
1245
  return w.seriesData.series.length;
1294
1246
  }
1295
- const series = w.seriesData.series;
1296
- return series[si] && Array.isArray(series[si]) ? series[si].length : 0;
1247
+ const s = w.seriesData.series[si];
1248
+ return Array.isArray(s) ? s.length : 1;
1297
1249
  }
1298
1250
  _clampCursor() {
1299
1251
  const seriesCount = this._getSeriesCount();