apexcharts 7.3.0 → 7.4.0

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 (171) hide show
  1. package/LICENSE +30 -11
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +545 -463
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +984 -801
  6. package/dist/apexcharts.js +519 -254
  7. package/dist/apexcharts.min.js +2 -2
  8. package/dist/apexcharts.ssr.common.js +2 -2
  9. package/dist/apexcharts.ssr.esm.js +519 -254
  10. package/dist/area.common.js +1 -1
  11. package/dist/area.esm.js +1 -1
  12. package/dist/bar.common.js +2 -2
  13. package/dist/bar.esm.js +20 -10
  14. package/dist/bar.js +2 -2
  15. package/dist/boxPlot.common.js +2 -2
  16. package/dist/boxPlot.esm.js +20 -10
  17. package/dist/bubble.common.js +1 -1
  18. package/dist/bubble.esm.js +1 -1
  19. package/dist/candlestick.common.js +2 -2
  20. package/dist/candlestick.esm.js +20 -10
  21. package/dist/candlestick.js +2 -2
  22. package/dist/column.common.js +2 -2
  23. package/dist/column.esm.js +20 -10
  24. package/dist/core.common.js +2 -2
  25. package/dist/core.esm.js +545 -463
  26. package/dist/donut.common.js +1 -1
  27. package/dist/donut.esm.js +1 -1
  28. package/dist/dumbbell.common.js +2 -2
  29. package/dist/dumbbell.esm.js +20 -10
  30. package/dist/features/all.common.js +2 -2
  31. package/dist/features/all.esm.js +199 -26
  32. package/dist/features/annotations.common.js +1 -1
  33. package/dist/features/annotations.esm.js +1 -1
  34. package/dist/features/annotations.js +1 -1
  35. package/dist/features/context-menu.common.js +1 -1
  36. package/dist/features/context-menu.esm.js +1 -1
  37. package/dist/features/context-menu.js +1 -1
  38. package/dist/features/drilldown.common.js +1 -1
  39. package/dist/features/drilldown.esm.js +1 -1
  40. package/dist/features/drilldown.js +1 -1
  41. package/dist/features/dumbbell.common.js +1 -1
  42. package/dist/features/dumbbell.esm.js +1 -1
  43. package/dist/features/dumbbell.js +1 -1
  44. package/dist/features/exports.common.js +2 -2
  45. package/dist/features/exports.esm.js +12 -14
  46. package/dist/features/exports.js +2 -2
  47. package/dist/features/facet.common.js +1 -1
  48. package/dist/features/facet.esm.js +1 -1
  49. package/dist/features/facet.js +1 -1
  50. package/dist/features/history.common.js +1 -1
  51. package/dist/features/history.esm.js +1 -1
  52. package/dist/features/history.js +1 -1
  53. package/dist/features/ink.common.js +1 -1
  54. package/dist/features/ink.esm.js +1 -1
  55. package/dist/features/ink.js +1 -1
  56. package/dist/features/keyboard.common.js +2 -2
  57. package/dist/features/keyboard.esm.js +14 -1
  58. package/dist/features/keyboard.js +2 -2
  59. package/dist/features/legend.common.js +1 -1
  60. package/dist/features/legend.esm.js +1 -1
  61. package/dist/features/legend.js +1 -1
  62. package/dist/features/link.common.js +1 -1
  63. package/dist/features/link.esm.js +38 -38
  64. package/dist/features/link.js +1 -1
  65. package/dist/features/marks.common.js +1 -1
  66. package/dist/features/marks.esm.js +1 -1
  67. package/dist/features/marks.js +1 -1
  68. package/dist/features/measure.common.js +1 -1
  69. package/dist/features/measure.esm.js +1 -1
  70. package/dist/features/measure.js +1 -1
  71. package/dist/features/morph.common.js +1 -1
  72. package/dist/features/morph.esm.js +1 -1
  73. package/dist/features/morph.js +1 -1
  74. package/dist/features/perspectives.common.js +1 -1
  75. package/dist/features/perspectives.esm.js +11 -11
  76. package/dist/features/perspectives.js +1 -1
  77. package/dist/features/raincloud.common.js +1 -1
  78. package/dist/features/raincloud.esm.js +1 -1
  79. package/dist/features/raincloud.js +1 -1
  80. package/dist/features/renderer-canvas.common.js +1 -1
  81. package/dist/features/renderer-canvas.esm.js +1 -1
  82. package/dist/features/renderer-canvas.js +1 -1
  83. package/dist/features/stats.common.js +1 -1
  84. package/dist/features/stats.esm.js +1 -1
  85. package/dist/features/stats.js +1 -1
  86. package/dist/features/storyboard.common.js +1 -1
  87. package/dist/features/storyboard.esm.js +11 -11
  88. package/dist/features/storyboard.js +1 -1
  89. package/dist/features/streamgraph.common.js +1 -1
  90. package/dist/features/streamgraph.esm.js +1 -1
  91. package/dist/features/streamgraph.js +1 -1
  92. package/dist/features/toolbar.common.js +2 -2
  93. package/dist/features/toolbar.esm.js +172 -25
  94. package/dist/features/toolbar.js +2 -2
  95. package/dist/features/trellis.common.js +1 -1
  96. package/dist/features/trellis.esm.js +1 -1
  97. package/dist/features/trellis.js +1 -1
  98. package/dist/features/waterfall.common.js +1 -1
  99. package/dist/features/waterfall.esm.js +1 -1
  100. package/dist/features/waterfall.js +1 -1
  101. package/dist/features/weave.common.js +2 -2
  102. package/dist/features/weave.esm.js +15 -2
  103. package/dist/features/weave.js +2 -2
  104. package/dist/heatmap.common.js +1 -1
  105. package/dist/heatmap.esm.js +1 -1
  106. package/dist/heatmap.js +1 -1
  107. package/dist/histogram.common.js +2 -2
  108. package/dist/histogram.esm.js +20 -10
  109. package/dist/line.common.js +1 -1
  110. package/dist/line.esm.js +1 -1
  111. package/dist/line.js +1 -1
  112. package/dist/pictograms.common.js +1 -1
  113. package/dist/pictograms.esm.js +1 -1
  114. package/dist/pictograms.js +1 -1
  115. package/dist/pie.common.js +1 -1
  116. package/dist/pie.esm.js +1 -1
  117. package/dist/pie.js +1 -1
  118. package/dist/polarArea.common.js +1 -1
  119. package/dist/polarArea.esm.js +1 -1
  120. package/dist/radar.common.js +1 -1
  121. package/dist/radar.esm.js +1 -1
  122. package/dist/radar.js +1 -1
  123. package/dist/radialBar.common.js +1 -1
  124. package/dist/radialBar.esm.js +1 -1
  125. package/dist/radialBar.js +1 -1
  126. package/dist/raincloud.common.js +2 -2
  127. package/dist/raincloud.esm.js +20 -10
  128. package/dist/rangeArea.common.js +1 -1
  129. package/dist/rangeArea.esm.js +1 -1
  130. package/dist/rangeBar.common.js +2 -2
  131. package/dist/rangeBar.esm.js +20 -10
  132. package/dist/scatter.common.js +1 -1
  133. package/dist/scatter.esm.js +1 -1
  134. package/dist/streamgraph.common.js +1 -1
  135. package/dist/streamgraph.esm.js +1 -1
  136. package/dist/sunburst.common.js +1 -1
  137. package/dist/sunburst.esm.js +1 -1
  138. package/dist/sunburst.js +1 -1
  139. package/dist/treemap.common.js +1 -1
  140. package/dist/treemap.esm.js +1 -1
  141. package/dist/treemap.js +1 -1
  142. package/dist/unit-shapes.common.js +1 -1
  143. package/dist/unit-shapes.esm.js +1 -1
  144. package/dist/unit-shapes.js +1 -1
  145. package/dist/unit.common.js +1 -1
  146. package/dist/unit.esm.js +79 -79
  147. package/dist/unit.js +1 -1
  148. package/dist/violin.common.js +2 -2
  149. package/dist/violin.esm.js +20 -10
  150. package/dist/violin.js +2 -2
  151. package/dist/waterfall.common.js +2 -2
  152. package/dist/waterfall.esm.js +20 -10
  153. package/package.json +2 -2
  154. package/src/apexcharts.js +39 -15
  155. package/src/charts/common/bar/Helpers.js +31 -12
  156. package/src/modules/Data.js +8 -2
  157. package/src/modules/Exports.js +14 -12
  158. package/src/modules/Formatters.js +24 -1
  159. package/src/modules/Range.js +28 -1
  160. package/src/modules/Toolbar.js +112 -2
  161. package/src/modules/ZoomPanSelection.js +85 -7
  162. package/src/modules/accessibility/KeyboardNavigation.js +14 -0
  163. package/src/modules/axes/YAxis.js +12 -15
  164. package/src/modules/helpers/UpdateHelpers.js +25 -8
  165. package/src/modules/settings/Globals.js +5 -10
  166. package/src/modules/settings/Options.js +15 -0
  167. package/src/modules/weave/PluginAPI.js +21 -1
  168. package/src/ssr/DOMShim.js +50 -0
  169. package/src/types/internal.d.ts +1 -1
  170. package/src/utils/Utils.js +6 -9
  171. package/types/apexcharts.d.ts +17 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,n=(t,e)=>{for(var i in e||(e={}))o.call(e,i)&&r(t,i,e[i]);if(s)for(var i of s(e))a.call(e,i)&&r(t,i,e[i]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function l(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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const c=l(require("apexcharts/core")),h=c.__apex_Graphics,d=c.__apex_Utils;c.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._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),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()}handleKey(t){}_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,s;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==(s=this.ctx.toolbar)||s.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(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),o=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(o)||s===o)return;const a=.1*(o-s)*t;i.zoomUpdateOptions(s+a,o+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const o=this._getSeriesCount();let a=this.seriesIndex+t,r=0;for(;r<o&&(a<0&&(a=s?o-1:0),a>=o&&(a=s?0:o-1),i.globals.collapsedSeriesIndices.includes(a));)a+=t,r++;this.seriesIndex=a;const n=this._getDataPointCount(a);this.dataPointIndex>=n&&(this.dataPointIndex=n-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 s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,o++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,o++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o?this._showTooltipNonAxis(t,e,i,a):"radialBar"===o?this._showTooltipRadialBar(t,e,i,a):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,a,o):"bar"===o||"candlestick"===o||"boxPlot"===o||"violin"===o||"rangeBar"===o?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let a=0,r=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}i.e={type:"mousemove",clientX:a,clientY:r}}_showTooltipBar(t,s,o){var a,r,l,c;const d=this.w,u=o.tConfig.shared&&(o.tooltipUtil.isXoverlap(s)||d.globals.isBarHorizontal)&&o.tooltipUtil.isInitialSeriesSameLen(),p=null==(c=null==(l=null==(r=null==(a=d.rangeData.seriesRange)?void 0:a[t])?void 0:r[s])?void 0:l.y)?void 0:c[0];var g;o.tooltipLabels.drawSeriesTexts((g=n(n({ttItems:o.ttItems,i:t,j:s},void 0!==(null==p?void 0:p.y1)&&{y1:p.y1}),void 0!==(null==p?void 0:p.y2)&&{y2:p.y2}),e(g,i({shared:u}))));const b=`.apexcharts-series[data\\:realIndex='${t}']`,_=d.dom.Paper.findOne(`${b} path[j='${s}'], ${b} circle[j='${s}'], ${b} rect[j='${s}']`);if(_){this._leaveHoveredBar();new h(this.w,this.ctx).pathMouseEnter(_,null),this._hoveredBarEl=_}if(d.globals.isBarHorizontal){const t=_&&_.node;if(t){const e=d.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),s=i.left-e.left,a=i.top-e.top,r=i.height,n=i.width,l=o.tooltipRect.ttWidth||0,c=a+r/2-(o.tooltipRect.ttHeight||0)/2;let h=s+n;s<(o.xyRatios&&null!=o.xyRatios.baseLineInvertedY?o.xyRatios.baseLineInvertedY:e.width/2)&&(h=s-l);const u=o.getElTooltip();u&&(u.style.left=h+"px",u.style.top=c+"px")}}else o.tooltipPosition.moveStickyTooltipOverBars(s,t)}_showTooltipAxisLine(t,e,i){const s=this.w,o=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 r="scatter"===o||"bubble"===o,n=s.globals.markers.largestSize>0&&!s.globals.markers.batched;r?this._showScatterBubblePoint(t,e,i):n?a?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return;const a=o.querySelector(`.apexcharts-marker[rel='${e}']`);a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a)}_showTooltipNonAxis(t,e,i,s){const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,l=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);c&&(s.style.left=c.x-r/2+"px",s.style.top=c.y-n-10+"px")}_showTooltipRadialBar(t,e,i,s){var o;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(o=l.getAttribute("data:angle"))?o:"")||0,i=(a.config.plotOptions.radialBar.startAngle||0)+e/2,c=a.layout.gridWidth/2,h=a.layout.gridHeight/2,u=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,p=a.seriesData.series.length,g=u/Math.max(p,1),b=u-t*g,_=(b+(b-g))/2,f=d.polarToCartesian(c,h,_,i),m=f.x+(a.layout.translateX||0),v=f.y+(a.layout.translateY||0);s.style.left=m-r/2+"px",s.style.top=v-n-10+"px"}}_showTooltipHeatTree(t,e,i,s,o){var a,r;const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=n.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),o=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,g=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),b=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(g+b/2);let _=o+d+c/2;const f=l+p/2-h/2;o+d>n.layout.gridWidth/2&&(_=o-c/2),s.style.left=_+"px",s.style.top=f+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),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}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,a,r,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!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",o=Array.isArray(p)?p[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,b=(Array.isArray(p[t])?p[t]:[])[e];let _=null==b?"":String(b);const f=null==(a=null==(o=h.formatters)?void 0:o.yLabelFormatters)?void 0:a[t];if("function"==typeof f)try{_=f(b,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let m="";const v=null==(r=h.labelData)?void 0:r.categoryLabels,y=null==(l=null==(n=h.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(v)&&null!=v[e])m=String(v[e]);else if(Array.isArray(y)&&null!=y[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{m=String(i(y[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){m=String(y[e])}else m=String(y[e])}return m?`${g}: ${_}, ${m}`:`${g}: ${_}`}_leaveHoveredBar(){if(this._hoveredBarEl){new h(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,o=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return o.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return o.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return o.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 s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[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 s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,a=e.maxX;if(void 0===o||void 0===a)return;const r=s[this.dataPointIndex];if(r>=o&&r<=a)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const a=o[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,n=(t,e)=>{for(var i in e||(e={}))o.call(e,i)&&r(t,i,e[i]);if(s)for(var i of s(e))a.call(e,i)&&r(t,i,e[i]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function l(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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const c=l(require("apexcharts/core")),h=c.__apex_Graphics,d=c.__apex_Utils;c.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._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),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()}handleKey(t){}_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,s;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==(s=this.ctx.toolbar)||s.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(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),o=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(o)||s===o)return;const a=.1*(o-s)*t;i.zoomUpdateOptions(s+a,o+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const o=this._getSeriesCount();let a=this.seriesIndex+t,r=0;for(;r<o&&(a<0&&(a=s?o-1:0),a>=o&&(a=s?0:o-1),i.globals.collapsedSeriesIndices.includes(a));)a+=t,r++;this.seriesIndex=a;const n=this._getDataPointCount(a);this.dataPointIndex>=n&&(this.dataPointIndex=n-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 s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,o++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,o++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o?this._showTooltipNonAxis(t,e,i,a):"radialBar"===o?this._showTooltipRadialBar(t,e,i,a):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,a,o):"bar"===o||"candlestick"===o||"boxPlot"===o||"violin"===o||"rangeBar"===o?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let a=0,r=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}i.e={type:"mousemove",clientX:a,clientY:r}}_showTooltipBar(t,s,o){var a,r,l,c;const d=this.w,u=o.tConfig.shared&&(o.tooltipUtil.isXoverlap(s)||d.globals.isBarHorizontal)&&o.tooltipUtil.isInitialSeriesSameLen(),p=null==(c=null==(l=null==(r=null==(a=d.rangeData.seriesRange)?void 0:a[t])?void 0:r[s])?void 0:l.y)?void 0:c[0];var g;o.tooltipLabels.drawSeriesTexts((g=n(n({ttItems:o.ttItems,i:t,j:s},void 0!==(null==p?void 0:p.y1)&&{y1:p.y1}),void 0!==(null==p?void 0:p.y2)&&{y2:p.y2}),e(g,i({shared:u}))));const b=`.apexcharts-series[data\\:realIndex='${t}']`,_=d.dom.Paper.findOne(`${b} path[j='${s}'], ${b} circle[j='${s}'], ${b} rect[j='${s}']`);if(_){this._leaveHoveredBar();new h(this.w,this.ctx).pathMouseEnter(_,null),this._hoveredBarEl=_}if(d.globals.isBarHorizontal){const t=_&&_.node;if(t){const e=d.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),s=i.left-e.left,a=i.top-e.top,r=i.height,n=i.width,l=o.tooltipRect.ttWidth||0,c=a+r/2-(o.tooltipRect.ttHeight||0)/2;let h=s+n;s<(o.xyRatios&&null!=o.xyRatios.baseLineInvertedY?o.xyRatios.baseLineInvertedY:e.width/2)&&(h=s-l);const u=o.getElTooltip();u&&(u.style.left=h+"px",u.style.top=c+"px")}}else o.tooltipPosition.moveStickyTooltipOverBars(s,t)}_showTooltipAxisLine(t,e,i){const s=this.w,o=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 r="scatter"===o||"bubble"===o,n=s.globals.markers.largestSize>0&&!s.globals.markers.batched;r?this._showScatterBubblePoint(t,e,i):n?a?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return;const a=o.querySelector(`.apexcharts-marker[rel='${e}']`);a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a)}_showTooltipNonAxis(t,e,i,s){const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,l=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);c&&(s.style.left=c.x-r/2+"px",s.style.top=c.y-n-10+"px")}_showTooltipRadialBar(t,e,i,s){var o;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(o=l.getAttribute("data:angle"))?o:"")||0,i=(a.config.plotOptions.radialBar.startAngle||0)+e/2,c=a.layout.gridWidth/2,h=a.layout.gridHeight/2,u=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,p=a.seriesData.series.length,g=u/Math.max(p,1),b=u-t*g,_=(b+(b-g))/2,f=d.polarToCartesian(c,h,_,i),m=f.x+(a.layout.translateX||0),v=f.y+(a.layout.translateY||0);s.style.left=m-r/2+"px",s.style.top=v-n-10+"px"}}_showTooltipHeatTree(t,e,i,s,o){var a,r;const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=n.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),o=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,g=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),b=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(g+b/2);let _=o+d+c/2;const f=l+p/2-h/2;o+d>n.layout.gridWidth/2&&(_=o-c/2),s.style.left=_+"px",s.style.top=f+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),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}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,a,r,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!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",o=Array.isArray(p)?p[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,b=(Array.isArray(p[t])?p[t]:[])[e];let _=null==b?"":String(b);const f=null==(a=null==(o=h.formatters)?void 0:o.yLabelFormatters)?void 0:a[t];if("function"==typeof f)try{_=f(b,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let m="";const v=null==(r=h.labelData)?void 0:r.categoryLabels,y=null==(l=null==(n=h.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(v)&&null!=v[e])m=String(v[e]);else if(Array.isArray(y)&&null!=y[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{m=String(i(y[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){m=String(y[e])}else m=String(y[e])}return m?`${g}: ${_}, ${m}`:`${g}: ${_}`}_leaveHoveredBar(){if(this._hoveredBarEl){new h(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,o=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return o.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return o.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return o.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 s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[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 s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,a=e.maxX;if(void 0===o||void 0===a)return;const r=s[this.dataPointIndex];if(r>=o&&r<=a)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const a=o[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.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 v7.3.0
21
+ * ApexCharts v7.4.0
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -108,6 +108,19 @@ class KeyboardNavigation {
108
108
  _onPointerDown() {
109
109
  this._lastPointerDownAt = Date.now();
110
110
  }
111
+ /**
112
+ * Note that a pointer gesture is about to move focus into the chart.
113
+ *
114
+ * The 100 ms window above catches the browser's own click-to-focus, which
115
+ * lands immediately. A drag-zoom moves focus deliberately, and only once its
116
+ * re-render is done (ZoomPanSelection#_focusForKeyboard), which is far
117
+ * outside that window. Without this it reads as a viewer asking to navigate
118
+ * by keyboard, which activates nav and flashes a tooltip at the first visible
119
+ * point after every zoom.
120
+ */
121
+ notePointerFocus() {
122
+ this._lastPointerDownAt = Date.now();
123
+ }
111
124
  /**
112
125
  * Called from Events.js keydown handler. Navigation keys are already handled
113
126
  * by the direct SVG listener (which can call preventDefault). This entry
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexKeyboard={})}(this,function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,l=(t,e)=>{for(var i in e||(e={}))a.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};const h=globalThis.ApexCharts,c=globalThis.ApexCharts.__internals.__apex_Graphics,d=globalThis.ApexCharts.__internals.__apex_Utils;h.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._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),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()}handleKey(t){}_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,s;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==(s=this.ctx.toolbar)||s.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(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),o=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(o)||s===o)return;const a=.1*(o-s)*t;i.zoomUpdateOptions(s+a,o+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const o=this._getSeriesCount();let a=this.seriesIndex+t,r=0;for(;r<o&&(a<0&&(a=s?o-1:0),a>=o&&(a=s?0:o-1),i.globals.collapsedSeriesIndices.includes(a));)a+=t,r++;this.seriesIndex=a;const n=this._getDataPointCount(a);this.dataPointIndex>=n&&(this.dataPointIndex=n-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 s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,o++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,o++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o?this._showTooltipNonAxis(t,e,i,a):"radialBar"===o?this._showTooltipRadialBar(t,e,i,a):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,a,o):"bar"===o||"candlestick"===o||"boxPlot"===o||"violin"===o||"rangeBar"===o?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let a=0,r=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}i.e={type:"mousemove",clientX:a,clientY:r}}_showTooltipBar(t,e,o){var a,r,n,h;const d=this.w,u=o.tConfig.shared&&(o.tooltipUtil.isXoverlap(e)||d.globals.isBarHorizontal)&&o.tooltipUtil.isInitialSeriesSameLen(),p=null==(h=null==(n=null==(r=null==(a=d.rangeData.seriesRange)?void 0:a[t])?void 0:r[e])?void 0:n.y)?void 0:h[0];var g;o.tooltipLabels.drawSeriesTexts((g=l(l({ttItems:o.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}),i(g,s({shared:u}))));const b=`.apexcharts-series[data\\:realIndex='${t}']`,_=d.dom.Paper.findOne(`${b} path[j='${e}'], ${b} circle[j='${e}'], ${b} rect[j='${e}']`);if(_){this._leaveHoveredBar();new c(this.w,this.ctx).pathMouseEnter(_,null),this._hoveredBarEl=_}if(d.globals.isBarHorizontal){const t=_&&_.node;if(t){const e=d.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),s=i.left-e.left,a=i.top-e.top,r=i.height,n=i.width,l=o.tooltipRect.ttWidth||0,h=a+r/2-(o.tooltipRect.ttHeight||0)/2;let c=s+n;s<(o.xyRatios&&null!=o.xyRatios.baseLineInvertedY?o.xyRatios.baseLineInvertedY:e.width/2)&&(c=s-l);const u=o.getElTooltip();u&&(u.style.left=c+"px",u.style.top=h+"px")}}else o.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,o=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 r="scatter"===o||"bubble"===o,n=s.globals.markers.largestSize>0&&!s.globals.markers.batched;r?this._showScatterBubblePoint(t,e,i):n?a?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return;const a=o.querySelector(`.apexcharts-marker[rel='${e}']`);a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a)}_showTooltipNonAxis(t,e,i,s){const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,l=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),h=i.getSliceAnchor(l);h&&(s.style.left=h.x-r/2+"px",s.style.top=h.y-n-10+"px")}_showTooltipRadialBar(t,e,i,s){var o;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(o=l.getAttribute("data:angle"))?o:"")||0,i=(a.config.plotOptions.radialBar.startAngle||0)+e/2,h=a.layout.gridWidth/2,c=a.layout.gridHeight/2,u=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,p=a.seriesData.series.length,g=u/Math.max(p,1),b=u-t*g,_=(b+(b-g))/2,f=d.polarToCartesian(h,c,_,i),m=f.x+(a.layout.translateX||0),v=f.y+(a.layout.translateY||0);s.style.left=m-r/2+"px",s.style.top=v-n-10+"px"}}_showTooltipHeatTree(t,e,i,s,o){var a,r;const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=n.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),o=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,g=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),b=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(g+b/2);let _=o+d+h/2;const f=l+p/2-c/2;o+d>n.layout.gridWidth/2&&(_=o-h/2),s.style.left=_+"px",s.style.top=f+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),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}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,a,r,n,l,h;const c=this.w,d=c.config.chart.type,u=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",o=Array.isArray(p)?p[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,b=(Array.isArray(p[t])?p[t]:[])[e];let _=null==b?"":String(b);const f=null==(a=null==(o=c.formatters)?void 0:o.yLabelFormatters)?void 0:a[t];if("function"==typeof f)try{_=f(b,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let m="";const v=null==(r=c.labelData)?void 0:r.categoryLabels,x=null==(l=null==(n=c.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(v)&&null!=v[e])m=String(v[e]);else if(Array.isArray(x)&&null!=x[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{m=String(i(x[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){m=String(x[e])}else m=String(x[e])}return m?`${g}: ${_}, ${m}`:`${g}: ${_}`}_leaveHoveredBar(){if(this._hoveredBarEl){new c(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,o=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return o.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return o.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return o.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 s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[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 s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,a=e.maxX;if(void 0===o||void 0===a)return;const r=s[this.dataPointIndex];if(r>=o&&r<=a)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const a=o[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
5
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexKeyboard={})}(this,function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,l=(t,e)=>{for(var i in e||(e={}))a.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};const h=globalThis.ApexCharts,c=globalThis.ApexCharts.__internals.__apex_Graphics,d=globalThis.ApexCharts.__internals.__apex_Utils;h.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._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),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()}handleKey(t){}_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,s;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==(s=this.ctx.toolbar)||s.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(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),o=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(o)||s===o)return;const a=.1*(o-s)*t;i.zoomUpdateOptions(s+a,o+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const o=this._getSeriesCount();let a=this.seriesIndex+t,r=0;for(;r<o&&(a<0&&(a=s?o-1:0),a>=o&&(a=s?0:o-1),i.globals.collapsedSeriesIndices.includes(a));)a+=t,r++;this.seriesIndex=a;const n=this._getDataPointCount(a);this.dataPointIndex>=n&&(this.dataPointIndex=n-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 s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,o++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,o=0;if(Array.isArray(t.seriesData.series[e])){for(;o<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,o++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,o=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===o||"donut"===o||"polarArea"===o?this._showTooltipNonAxis(t,e,i,a):"radialBar"===o?this._showTooltipRadialBar(t,e,i,a):"heatmap"===o||"treemap"===o?this._showTooltipHeatTree(t,e,i,a,o):"bar"===o||"candlestick"===o||"boxPlot"===o||"violin"===o||"rangeBar"===o?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,o=s.config.chart.type;let a=0,r=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(("line"===o||"area"===o||"rangeArea"===o||"scatter"===o||"bubble"===o||"radar"===o)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const o=s.globals.pointsArray[t][e],n=i.getElGrid&&i.getElGrid();if(n){const t=n.getBoundingClientRect();a=t.left+(o[0]||0),r=t.top+(o[1]||0)}}i.e={type:"mousemove",clientX:a,clientY:r}}_showTooltipBar(t,e,o){var a,r,n,h;const d=this.w,u=o.tConfig.shared&&(o.tooltipUtil.isXoverlap(e)||d.globals.isBarHorizontal)&&o.tooltipUtil.isInitialSeriesSameLen(),p=null==(h=null==(n=null==(r=null==(a=d.rangeData.seriesRange)?void 0:a[t])?void 0:r[e])?void 0:n.y)?void 0:h[0];var g;o.tooltipLabels.drawSeriesTexts((g=l(l({ttItems:o.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}),i(g,s({shared:u}))));const b=`.apexcharts-series[data\\:realIndex='${t}']`,_=d.dom.Paper.findOne(`${b} path[j='${e}'], ${b} circle[j='${e}'], ${b} rect[j='${e}']`);if(_){this._leaveHoveredBar();new c(this.w,this.ctx).pathMouseEnter(_,null),this._hoveredBarEl=_}if(d.globals.isBarHorizontal){const t=_&&_.node;if(t){const e=d.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),s=i.left-e.left,a=i.top-e.top,r=i.height,n=i.width,l=o.tooltipRect.ttWidth||0,h=a+r/2-(o.tooltipRect.ttHeight||0)/2;let c=s+n;s<(o.xyRatios&&null!=o.xyRatios.baseLineInvertedY?o.xyRatios.baseLineInvertedY:e.width/2)&&(c=s-l);const u=o.getElTooltip();u&&(u.style.left=c+"px",u.style.top=h+"px")}}else o.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,o=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 r="scatter"===o||"bubble"===o,n=s.globals.markers.largestSize>0&&!s.globals.markers.batched;r?this._showScatterBubblePoint(t,e,i):n?a?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const o=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!o)return;const a=o.querySelector(`.apexcharts-marker[rel='${e}']`);a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a)}_showTooltipNonAxis(t,e,i,s){const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,l=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),h=i.getSliceAnchor(l);h&&(s.style.left=h.x-r/2+"px",s.style.top=h.y-n-10+"px")}_showTooltipRadialBar(t,e,i,s){var o;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(o=l.getAttribute("data:angle"))?o:"")||0,i=(a.config.plotOptions.radialBar.startAngle||0)+e/2,h=a.layout.gridWidth/2,c=a.layout.gridHeight/2,u=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,p=a.seriesData.series.length,g=u/Math.max(p,1),b=u-t*g,_=(b+(b-g))/2,f=d.polarToCartesian(h,c,_,i),m=f.x+(a.layout.translateX||0),v=f.y+(a.layout.translateY||0);s.style.left=m-r/2+"px",s.style.top=v-n-10+"px"}}_showTooltipHeatTree(t,e,i,s,o){var a,r;const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===o?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=n.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),o=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,g=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),b=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(g+b/2);let _=o+d+h/2;const f=l+p/2-c/2;o+d>n.layout.gridWidth/2&&(_=o-h/2),s.style.left=_+"px",s.style.top=f+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),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}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,o,a,r,n,l,h;const c=this.w,d=c.config.chart.type,u=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",o=Array.isArray(p)?p[e]:"";return t?`${t}: ${o}`:`${o}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,b=(Array.isArray(p[t])?p[t]:[])[e];let _=null==b?"":String(b);const f=null==(a=null==(o=c.formatters)?void 0:o.yLabelFormatters)?void 0:a[t];if("function"==typeof f)try{_=f(b,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let m="";const v=null==(r=c.labelData)?void 0:r.categoryLabels,x=null==(l=null==(n=c.seriesData)?void 0:n.seriesX)?void 0:l[t];if(Array.isArray(v)&&null!=v[e])m=String(v[e]);else if(Array.isArray(x)&&null!=x[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{m=String(i(x[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){m=String(x[e])}else m=String(x[e])}return m?`${g}: ${_}, ${m}`:`${g}: ${_}`}_leaveHoveredBar(){if(this._hoveredBarEl){new c(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,o=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return o.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return o.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return o.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return o.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 s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[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 s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const o=e.minX,a=e.maxX;if(void 0===o||void 0===a)return;const r=s[this.dataPointIndex];if(r>=o&&r<=a)return;const n=s.length;for(let t=0;t<n;t++)if(s[t]>=o&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,o=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!o||!o.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const n=o.length;if(t>=0){for(let t=0;t<n;t++)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(o[t]>=a&&o[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const o=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!o)return!0;const a=o[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,l=(t,s,i)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i,a=(e,t)=>{for(var s in t||(t={}))n.call(t,s)&&l(e,s,t[s]);if(i)for(var s of i(t))r.call(t,s)&&l(e,s,t[s]);return e},o=(e,i)=>t(e,s(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const d=c(require("apexcharts/core")),g=d.__apex_CoreUtils,h=d.__apex_dimensions_Dimensions,p=d.__apex_Graphics,u=d.__apex_Series,f=d.__apex_Utils,m=d.__apex_Environment_Environment;class x{constructor(e){this.w=e.w,this.lgCtx=e}getLegendStyles(){if(m.isSSR())return null;const e=document.createElement("style");e.setAttribute("type","text/css");const t=this.w.config.chart.nonce;t&&e.setAttribute("nonce",t);const s=document.createTextNode(".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ");return e.appendChild(s),e}getLegendDimensions(){const e=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!e)return{clwh:0,clww:0};const{width:t,height:s}=e.getBoundingClientRect();return{clwh:s,clww:t}}appendToForeignObject(){var e;const t=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&t&&(null==(e=this.w.dom.elLegendForeign)||e.appendChild(t))}toggleDataSeries(e,t){var s,i,n;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let l=null,a=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(l=null!=(s=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),t=>t.getAttribute("data:realIndex")===String(e)))?s:null,!l)return;a=parseInt(null!=(i=l.getAttribute("data:realIndex"))?i:"",10)}else{if(l=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${e+1}']`),!l)return;a=parseInt(null!=(n=l.getAttribute("rel"))?n:"",10)-1}if(t){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(e=>{const t=e.cs,s=e.csi;this.riseCollapsedSeries(t,s,a)})}else this.hideSeries({seriesEl:l,realIndex:a});if(r.config.chart.accessibility.enabled){const t=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=r.globals.collapsedSeriesIndices.includes(a)||r.globals.ancillaryCollapsedSeriesIndices.includes(a);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:r.seriesData.seriesNames[e],l=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${l}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],t)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,e);else{const t=this.getSeriesAfterCollapsing({realIndex:e});this.lgCtx.updateSeries(t,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const t=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=r.globals.collapsedSeriesIndices.includes(e);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:r.seriesData.seriesNames[e],l=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${l}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(e){const t=this.w.config.chart.type;return("pie"===t||"donut"===t||"polarArea"===t||"sunburst"===t)&&1===e.length&&e[0]&&"object"==typeof e[0]&&Array.isArray(e[0].data)?e[0].data:e}_readSliceValue(e){return"unit"===this.w.config.chart.type&&e&&Array.isArray(e.data)?e.data:e&&"object"==typeof e?e.y:e}_writeSliceValue(e,t,s){const i=e[t];"unit"===this.w.config.chart.type&&i&&Array.isArray(i.data)?i.data=Array.isArray(s)?s:[]:i&&"object"==typeof i?i.y=s:e[t]=s}getSeriesAfterCollapsing({realIndex:e}){var t,s;const i=this.w,n=i.globals,r=f.clone(i.config.series);if(n.axisCharts){const t=i.config.yaxis[n.seriesYAxisReverseMap[e]],s={index:e,data:r[e].data.slice(),type:r[e].type||i.config.chart.type,name:(n.seriesNames||[])[e]};if(t&&t.show&&t.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(e)<0&&(n.ancillaryCollapsedSeries.push(s),n.ancillaryCollapsedSeriesIndices.push(e));else if(n.collapsedSeriesIndices.indexOf(e)<0){n.collapsedSeries.push(s),n.collapsedSeriesIndices.push(e);const t=n.risingSeries.indexOf(e);n.risingSeries.splice(t,1)}}else if(n.collapsedSeriesIndices.indexOf(e)<0){const l=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:e,data:this._readSliceValue(l[e]),type:null!=(s=null==(t=i.config.series[e])?void 0:t.type)?s:"line",name:(n.seriesNames||[])[e]}),n.collapsedSeriesIndices.push(e)}const l=n.axisCharts?i.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===l,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:e,realIndex:t}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:t}),n=e.childNodes;for(let e=0;e<n.length;e++)n[e].classList.contains("apexcharts-series-markers-wrap")&&(n[e].classList.contains("apexcharts-hide")?n[e].classList.remove("apexcharts-hide"):n[e].classList.add("apexcharts-hide"));const r=s.config.chart.animations.dynamicAnimation.enabled;r&&(s.globals.collapsingSeriesIndices=[t]);const l=()=>{s.globals.collapsingSeriesIndices=[]},a=this.lgCtx.updateSeries(i,r);l(),a&&"function"==typeof a.then&&a.then(l,l)}riseCollapsedSeries(e,t,s){const i=this.w;let n=f.clone(i.config.series);if(e.length>0){for(let r=0;r<e.length;r++)if(e[r].index===s){if(i.globals.axisCharts)n[s].data=e[r].data.slice(),n[s].hidden=!1;else{const t=this._nonAxisSliceContainer(n);this._writeSliceValue(t,s,e[r].data)}e.splice(r,1),t.splice(r,1),i.globals.risingSeries.push(s),r--}n=this._getSeriesBasedOnCollapsedState(n),this.lgCtx.updateSeries(n,i.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(e){const t=this.w;let s=0;if(t.globals.axisCharts)e.forEach((i,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(e[n].data=[],s++)});else{const i=this._nonAxisSliceContainer(e);i.forEach((e,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(i,n,0),s++)})}const i=t.globals.axisCharts?e.length:this._nonAxisSliceContainer(e).length;return t.globals.allSeriesCollapsed=s===i,e}}const b=d.__apex_BrowserAPIs_BrowserAPIs,y=["#cf4d3f","#8f9499","#26a75b"],v=(e,t,s)=>e+(t-e)*s;function S(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function w(e,t,s){const i=f.parseHex(A(e)),n=f.parseHex(A(t));return i&&n?"#"+S(v(i[0],n[0],s))+S(v(i[1],n[1],s))+S(v(i[2],n[2],s)):e}function A(e){if("string"!=typeof e)return"#000000";if(f.isColorHex(e))return e;return f.rgb2hex(e)||"#000000"}function _(e,t,s,i){var n,r,l;if(!t||"object"!=typeof t)return null;const a=null==(l=null==(r=null==(n=e.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:l.colorValue;let o;if(o="function"==typeof a?a(t,{seriesIndex:s,dataPointIndex:i,w:e}):"string"==typeof a?t[a]:t.colorValue,null==o)return null;const c=Number(o);return Number.isFinite(c)?c:null}function L(e){var t,s,i;const n=null==(i=null==(s=null==(t=e.config)?void 0:t.plotOptions)?void 0:s.treemap)?void 0:i.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const l=e.config.series||[];let a=1/0,o=-1/0,c=!1;for(let t=0;t<l.length;t++){const s=l[t]&&l[t].data;if(Array.isArray(s))for(let i=0;i<s.length;i++){const n=_(e,s[i],t,i);null!=n&&(c=!0,n<a&&(a=n),n>o&&(o=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(a)||(a=0,o=0);let d=Number.isFinite(Number(r.min))?Number(r.min):a,g=Number.isFinite(Number(r.max))?Number(r.max):o,h=null;if(null===r.midpoint?h=null:Number.isFinite(Number(r.midpoint))?h=Number(r.midpoint):d<0&&g>0&&(h=0),null!=h&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const e=Math.max(Math.abs(d-h),Math.abs(g-h));d=h-e,g=h+e}g===d&&(d-=.5,g+=.5);const p=function(e,t,s,i){if(Array.isArray(e.stops)&&e.stops.length>=2)return e.stops.filter(e=>e&&Number.isFinite(Number(e.value))).map(e=>({value:Number(e.value),color:A(e.color)})).sort((e,t)=>e.value-t.value);const n=(Array.isArray(e.colors)&&e.colors.length>=2?e.colors:y).map(A),r=n.length;if(null!=i&&r>=3){const e=Math.floor((r-1)/2),l=[];for(let s=0;s<=e;s++)l.push({value:v(t,i,s/e),color:n[s]});for(let t=e+1;t<r;t++)l.push({value:v(i,s,(t-e)/(r-1-e)),color:n[t]});return l}return n.map((e,i)=>({value:v(t,s,i/(r-1)),color:e}))}(r,d,g,h);if(p.length<2)return null;const u=g-d,f=p.map(e=>({percent:0===u?0:(e.value-d)/u,color:e.color}));return{min:d,max:g,midpoint:h,stops:p,at:e=>{if(!Number.isFinite(e))return p[Math.floor(p.length/2)].color;if(e<=p[0].value)return p[0].color;const t=p[p.length-1];if(e>=t.value)return t.color;for(let t=1;t<p.length;t++){const s=p[t];if(e<=s.value){const i=p[t-1],n=s.value-i.value,r=0===n?0:(e-i.value)/n;return w(i.color,s.color,r)}}return t.color},legendStops:f}}const C="http://www.w3.org/2000/svg";class E{constructor(e,t){this.w=e,this.ctx=t,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const e=this._cfg();return"function"==typeof e.formatter?e.formatter:e=>{if(!Number.isFinite(e))return String(e);const t=Math.abs(e);return t>=1e3?e.toFixed(0):t>=10?e.toFixed(1):e.toFixed(2)}}static colorScaleOf(e){var t,s,i,n,r;const l=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return l&&(null==(r=null==(n=null==(i=null==e?void 0:e.config)?void 0:i.plotOptions)?void 0:n[l])?void 0:r.colorScale)||null}static configFor(e){const t=E.colorScaleOf(e);return t&&t.gradientLegend||null}_cfg(){return E.configFor(this.w)||{}}static isEnabled(e){if(!E.supports(e))return!1;const t=E.configFor(e);return!(!t||!t.enabled)}static supports(e){var t,s;const i=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return"heatmap"===i||"treemap"===i}draw(e=null){var t,s,i,n,r,l,a,o;const c=this.w;this._targetEl=e;const d=e||c.dom.elLegendWrap;if(!d)return;const g=this._cfg(),h=c.config.legend.position,p="left"===h||"right"===h,u=null!=(s=null==(t=g.arrow)?void 0:t.size)?s:8,f=u+4,m=g.showLabels?28:4,x=g.showLabels?20:4,y=g.showLabels?44:0,v=this._resolveStripLength(p?g.height:g.width,p),S=g.thickness,w=p?Math.max(S+f+4,y):v+2*m,A=p?v+2*x:S+f+4,_=(w-(S+f))/2,L=p?"left"===h?_:_+f:m,E=p?x:"top"===h?f:4,k=b.createElementNS(C,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const I=b.createElementNS(C,"defs"),F=`apexcharts-heatmap-gradient-${c.globals.cuid}`,H=b.createElementNS(C,"linearGradient");H.setAttribute("id",F),p?(H.setAttribute("x1","0"),H.setAttribute("y1","1"),H.setAttribute("x2","0"),H.setAttribute("y2","0")):(H.setAttribute("x1","0"),H.setAttribute("y1","0"),H.setAttribute("x2","1"),H.setAttribute("y2","0"));const{min:N,max:M,stops:O,bands:B}=this._computeStops();this._min=N,this._max=M,O.forEach(e=>{const t=b.createElementNS(C,"stop");t.setAttribute("offset",`${(100*e.percent).toFixed(2)}%`),t.setAttribute("stop-color",e.color),H.appendChild(t)}),I.appendChild(H),k.appendChild(I);const V=b.createElementNS(C,"rect");if(V.setAttribute("x",String(L)),V.setAttribute("y",String(E)),V.setAttribute("width",String(p?S:v)),V.setAttribute("height",String(p?v:S)),V.setAttribute("rx","2"),V.setAttribute("fill",`url(#${F})`),k.appendChild(V),g.showLabels){const e=(null==(i=g.labelStyle)?void 0:i.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,t=(null==(n=g.labelStyle)?void 0:n.fontSize)||"11px",s=(null==(r=g.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,l=this._getFormatter(),a=(i,n,r,l)=>{const a=b.createElementNS(C,"text");return a.setAttribute("x",String(n)),a.setAttribute("y",String(r)),a.setAttribute("text-anchor",l),a.setAttribute("dominant-baseline","middle"),a.setAttribute("fill",e),a.setAttribute("font-size",t),s&&a.setAttribute("font-family",s),a.textContent=String(i),a};if(p){const e=L+S/2;k.appendChild(a(l(N),e,E+v+10,"middle")),k.appendChild(a(l(M),e,E-10,"middle"))}else{const e=E+S/2;k.appendChild(a(l(N),L-6,e,"end")),k.appendChild(a(l(M),L+v+6,e,"start"))}}const $=(null==(l=g.arrow)?void 0:l.color)||c.config.chart.foreColor,D=this._buildArrow(u,$,h);if(k.appendChild(D),this.arrowEl=D,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&B.length>0&&B.forEach(e=>{const t=b.createElementNS(C,"rect");if(p){const s=E+v-e.p2*v,i=E+v-e.p1*v;t.setAttribute("x",String(L)),t.setAttribute("y",String(s)),t.setAttribute("width",String(S)),t.setAttribute("height",String(Math.max(0,i-s)))}else t.setAttribute("x",String(L+e.p1*v)),t.setAttribute("y",String(E)),t.setAttribute("width",String(Math.max(0,(e.p2-e.p1)*v))),t.setAttribute("height",String(S));t.setAttribute("fill","transparent"),t.setAttribute("class","apexcharts-heatmap-gradient-band"),t.setAttribute("data:range-index",String(e.index)),t.style.cursor="pointer",k.appendChild(t),this._bandHitEls.push(t)}),this._geom={isVertical:p,position:h,stripX:L,stripY:E,stripLength:v,stripThickness:S,arrowSize:u,svgWidth:w,svgHeight:A},g.showHoverValue){const e=b.createElement("div");e.classList.add("apexcharts-heatmap-gradient-legend-value"),e.style.position="absolute",e.style.fontSize=(null==(a=g.labelStyle)?void 0:a.fontSize)||"11px",e.style.fontFamily=(null==(o=g.labelStyle)?void 0:o.fontFamily)||c.config.chart.fontFamily||"",e.style.color=c.config.chart.foreColor,e.style.background="rgba(0,0,0,0.65)",e.style.color="#fff",e.style.padding="2px 6px",e.style.borderRadius="3px",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.opacity="0",e.style.transition="opacity 120ms ease",this.hoverValueEl=e}d.classList.add("apexcharts-heatmap-gradient-legend-wrap"),d.classList.add("apx-legend-position-"+h),d.appendChild(k),this.hoverValueEl&&d.appendChild(this.hoverValueEl),this.svgEl=k,e?(d.style.width=w+"px",d.style.height=A+"px",d.style.position="relative",d.style.overflow="visible"):this._applyWrapAlignment(d,h,p,w,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(e,t){const s=this.w,i=t?s.globals.svgHeight||s.config.chart.height||300:s.globals.svgWidth||s.config.chart.width||600;if("string"==typeof e){const t=e.trim();if(t.endsWith("%")){const e=parseFloat(t)||0;return Math.max(20,i*e/100)}const s=parseFloat(t);return Number.isFinite(s)?s:200}return"number"==typeof e&&Number.isFinite(e)?e:200}_applyWrapAlignment(e,t,s,i,n){const r=this.w,l=this._cfg().align||"center",a=12,o=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,d=r.config.legend.offsetX||0,g=r.config.legend.offsetY||0;if(e.style.position="absolute",e.style.display="block",e.style.overflow="visible",e.style.padding="0",e.style.width=i+"px",e.style.height=n+"px",e.style.right="auto",e.style.bottom="auto",s){const s=c-n-24;let r;r="start"===l?a:"end"===l?a+Math.max(0,s):a+Math.max(0,s)/2,e.style.top=r+g+"px",e.style.left="left"===t?a+d+"px":o-i-a+d+"px"}else{const s=o-i-24;let r;r="start"===l?a:"end"===l?a+Math.max(0,s):a+Math.max(0,s)/2,e.style.left=r+d+"px",e.style.top="top"===t?a+g+"px":c-n-a+g+"px"}}repositionToPlot(){var e,t;if(!m.isBrowser())return;if(this._targetEl)return;const s=this.w,i=s.globals,n=s.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(i.gridWidth)||!Number.isFinite(i.gridHeight))return;const{isVertical:r,position:l,svgWidth:a,svgHeight:o,stripX:c,stripY:d,stripThickness:g}=this._geom,h=this._cfg().align||"center",p=s.config.legend.offsetX||0,u=s.config.legend.offsetY||0,f=null==(t=null==(e=this.ctx)?void 0:e.dimensions)?void 0:t.dimHelpers,x=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=s.layout.xAxisHeight||0,v=(e,t)=>{const s=Math.max(0,e-t);return"start"===h?0:"end"===h?s:s/2};if(r){n.style.top=i.translateY+v(i.gridHeight,o)+u+"px";const e=(("left"===l?0:i.translateX+i.gridWidth)+("left"===l?i.translateX:i.svgWidth))/2;n.style.left=e-c-g/2+p+"px"}else{n.style.left=i.translateX+v(i.gridWidth,a)+p+"px";const e=(("top"===l?x:i.translateY+i.gridHeight+y)+("top"===l?i.translateY:i.svgHeight))/2;n.style.top=e-d-g/2+u+"px"}b.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const e=this.w,t=e.dom.elLegendWrap,s=this.svgEl&&this.svgEl.querySelector("rect"),i=e.dom.baseEl.querySelector(".apexcharts-grid");if(!(t&&s&&i&&this._geom))return;const n=s.getBoundingClientRect(),r=i.getBoundingClientRect();if(!(n.width&&n.height&&r.width&&r.height))return;const{isVertical:l,position:a}=this._geom;if(l){const e="left"===a?r.left-n.right:n.left-r.right;if(e<16){const s=parseFloat(t.style.left)||0,i=16-e;t.style.left=s+("left"===a?-i:i)+"px"}}else{const e="top"===a?r.top-n.bottom:n.top-r.bottom;if(e<16){const s=parseFloat(t.style.top)||0,i=16-e;t.style.top=s+("top"===a?-i:i)+"px"}}}destroy(){var e,t,s,i,n,r,l;for(let s=0;s<this._bandHitEls.length;s++){const i=this._bandHitEls[s];null==(e=i.removeEventListener)||e.call(i,"mousemove",this._onBandEnter),null==(t=i.removeEventListener)||t.call(i,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(s=this.ctx)?void 0:s.events)try{null==(n=(i=this.ctx.events).removeEventListener)||n.call(i,"dataPointMouseEnter",this._onCellEnter),null==(l=(r=this.ctx.events).removeEventListener)||l.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(e){}}_attachBandHoverListeners(){if(m.isBrowser())for(let e=0;e<this._bandHitEls.length;e++){const t=this._bandHitEls[e];t.addEventListener("mousemove",this._onBandEnter),t.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(e){var t,s,i,n;const r=this.w,l=e.currentTarget,a=parseInt(null!=(t=l.getAttribute("data:range-index"))?t:"-1",10);a<0||a===this._activeBandIndex||(this._activeBandIndex=a,null==(n=null==(i=null==(s=this.ctx)?void 0:s.events)?void 0:i.fireEvent)||n.call(i,"legendHover",[this.ctx,a,r]),new u(r).highlightRangeInSeries(a,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const e=this._activeBandIndex;this._activeBandIndex=-1,new u(this.w).highlightRangeInSeries(e,"reset")}_attachHoverListeners(){var e,t;m.isBrowser()&&(null==(t=null==(e=this.ctx)?void 0:e.events)?void 0:t.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...e){var t,s,i;const n=this.w;if(!this.arrowEl)return;const r=e[e.length-1];if(!r||"object"!=typeof r)return;const l=r.seriesIndex,a=r.dataPointIndex;if("number"!=typeof l||"number"!=typeof a)return;if(!E.supports(n))return;let o;o=this._continuous?function(e,t,s){const i=e.config.series[t];return _(e,i&&Array.isArray(i.data)?i.data[s]:null,t,s)}(n,l,a):null==(i=null==(s=null==(t=n.seriesData)?void 0:t.series)?void 0:s[l])?void 0:i[a],null==o||Number.isNaN(o)||this._positionArrow(o)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(e){if(!this.arrowEl||!this._geom)return;const{isVertical:t,position:s,stripX:i,stripY:n,stripLength:r,stripThickness:l,arrowSize:a}=this._geom,o=this._min,c=this._max-o;let d;if(d=0===c?.5:(e-o)/c,d<0&&(d=0),d>1&&(d=1),t){const e=n+r-d*r;let t,o;"left"===s?(t=i+l,o=t+a):(t=i,o=t-a);const c=[`${t},${e}`,`${o},${e-a/2}`,`${o},${e+a/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const e=i+d*r;let t,o;"top"===s?(t=n+l,o=t+a):(t=n,o=t-a);const c=[`${e},${t}`,`${e-a/2},${o}`,`${e+a/2},${o}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const o=this._getFormatter();if(this.hoverValueEl.textContent=o(e),t){const e=n+r-d*r;"left"===s?this.hoverValueEl.style.left=`${i+l+a+8}px`:(this.hoverValueEl.style.left=i-a-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=e-9+"px"}else{const e=i+d*r;this.hoverValueEl.style.left=`${e}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===s?`${n+l+a+8}px`:n-a-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(e,t,s){const i=b.createElementNS(C,"polygon");return i.setAttribute("fill",t),i.setAttribute("opacity","0"),i.setAttribute("class","apexcharts-heatmap-gradient-arrow"),i.setAttribute("points","0,0 0,0 0,0"),i.setAttribute("pointer-events","none"),i}_computeStops(){var e,t;const s=this.w,i=E.colorScaleOf(s)||{},n=this._cfg(),r=L(s);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let l=1/0,c=-1/0;const d=(null==(e=s.seriesData)?void 0:e.series)||[];for(let e=0;e<d.length;e++){const t=d[e];if(t)for(let e=0;e<t.length;e++){const s=t[e];null==s||Number.isNaN(s)||(s<l&&(l=s),s>c&&(c=s))}}Number.isFinite(l)||(l=0),Number.isFinite(c)||(c=0);let g=l,h=c;void 0!==i.min&&void 0!==i.max&&i.max>i.min?(g=i.min,h=i.max):(void 0!==i.min&&(g=i.min<l?i.min:l),void 0!==i.max&&(h=i.max>c?i.max:c));const p=[],u=[];if(i.ranges&&i.ranges.length>0){const e=i.ranges.map((e,t)=>o(a({},e),{_originalIndex:t})).sort((e,t)=>e.from-t.from),t=e[0].from,s=e[e.length-1].to;g=t,h=s;const n=s-t||1;e.forEach(e=>{const s=(e.from-t)/n,i=(e.to-t)/n;p.push({percent:(s+i)/2,color:e.color}),u.push({index:e._originalIndex,p1:s,p2:i})})}else{const e=s.globals.colors[0]||"#008FFB",i=new f,r=s.config.plotOptions[s.config.chart.type]||{},l=null!=(t=r.shadeIntensity)?t:.5,a=s.globals.hasNegs,o=Math.max(2,n.stops||16);for(let t=0;t<o;t++){const n=t/(o-1),c=g+n*(h-g),d=Math.abs(h)+Math.abs(g),u=0===d?0:100*c/d;let f;f=a?r.reverseNegativeShade?u<0?u/100*(1.25*l):1.25*l*(1-u/100):u<=0?1-(1+u/100)*l:(1-u/100)*l:1-u/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?i.shadeColor("dark"===s.config.theme.mode?-1*f:f,e):e;p.push({percent:n,color:m})}}return{min:g,max:h,stops:p,bands:u}}}const k=d.__apex_Markers;d.default.registerFeatures({legend:class{constructor(e,t){this.w=e,this.ctx=t,this.updateSeries=(...e)=>t.updateHelpers._updateSeries(...e),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new x(this)}init(){const e=this.w,t=e.globals,s=e.config;this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||E.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!t.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),E.isEnabled(e)?(this.heatmapGradientLegend=new E(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:e,fillcolor:t}){const s=this.w,i=b.createElement("span");i.classList.add("apexcharts-legend-marker");const n=s.config.legend.markers.shape||s.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[e]);const l=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[e]):parseFloat(s.config.legend.markers.size),c=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[e]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[e]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[e]):parseFloat(s.config.legend.markers.strokeWidth),h=i.style;if(h.height=2*(l+g)+"px",h.width=2*(l+g)+"px",h.left=c+"px",h.top=d+"px",s.config.legend.markers.customHTML)h.background="transparent",h.color=t[e],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[e]&&(i.innerHTML=s.config.legend.markers.customHTML[e]()):i.innerHTML=s.config.legend.markers.customHTML();else{const n=new k(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:e,strokeWidth:g,size:l}),c=(m.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),d=new p(this.w).drawMarker(0,0,o(a({},n),{pointFillColor:Array.isArray(t)?t[e]:n.pointFillColor,shape:r}));s.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(e=>{e.node.classList.contains("apexcharts-marker-triangle")?e.node.style.transform="translate(50%, 45%)":e.node.style.transform="translate(50%, 50%)"}),c.add(d)}return i}drawLegends(){var e;const t=this,s=this.w,i=s.dom.elLegendWrap,n=s.config.legend.fontFamily;let r=s.seriesData.seriesNames,l=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const e=s.config.plotOptions.heatmap.colorScale.ranges;r=e.map(e=>e.name?e.name:e.from+" - "+e.to),l=e.map(e=>e.color)}else this.isBarsDistributed&&(r=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(r=s.config.legend.customLegendItems);const a=s.formatters.legendFormatter,o=s.config.legend.inverseOrder,c=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((e,t)=>{c[t]=b.createElement("div"),c[t].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${t}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")});for(let t=o?r.length-1:0;o?t>=0:t<=r.length-1;o?t--:t++){const o=a(r[t],{seriesIndex:t,w:s});let d=!1,h=!1;if(s.globals.collapsedSeries.length>0)for(let e=0;e<s.globals.collapsedSeries.length;e++)s.globals.collapsedSeries[e].index===t&&(d=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let e=0;e<s.globals.ancillaryCollapsedSeriesIndices.length;e++)s.globals.ancillaryCollapsedSeriesIndices[e]===t&&(h=!0);const u=this.createLegendMarker({i:t,fillcolor:l});p.setAttrs(u,{rel:t+1,"data:collapsed":d||h}),(d||h)&&u.classList.add("apexcharts-inactive-legend");const m=b.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){m.setAttribute("role","button"),m.setAttribute("tabindex","0");const e=Array.isArray(o)?o.join(" "):o,t=d||h,s=t?"hidden":"visible";m.setAttribute("aria-label",`${e}, ${s}. Press Enter or Space to toggle.`),m.setAttribute("aria-pressed",t?"true":"false")}const x=b.createElement("span");x.classList.add("apexcharts-legend-text"),x.innerHTML=Array.isArray(o)?o.join(" "):o;let y=s.config.legend.labels.useSeriesColors?s.globals.colors[t]:Array.isArray(s.config.legend.labels.colors)?null==(e=s.config.legend.labels.colors)?void 0:e[t]:s.config.legend.labels.colors;y||(y=s.config.chart.foreColor),x.style.color=y,x.style.fontSize=s.config.legend.fontSize,x.style.fontWeight=s.config.legend.fontWeight,x.style.fontFamily=n||s.config.chart.fontFamily,p.setAttrs(x,{rel:t+1,i:t,"data:default-text":encodeURIComponent(o),"data:collapsed":d||h}),m.appendChild(u),m.appendChild(x);const v=new g(this.w);if(!s.config.legend.showForZeroSeries){0===v.getSeriesTotalByIndex(t)&&v.seriesHaveSameValues(t)&&!v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-null-series"),c.length?s.labelData.seriesGroups.forEach((e,n)=>{var r,l;e.includes(null!=(l=null==(r=s.config.series[t])?void 0:r.name)?l:"")&&(i.appendChild(c[n]),c[n].appendChild(m))}):i.appendChild(m),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),m.classList.add("apexcharts-legend-series"),m.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",p.setAttrs(m,{rel:t+1,seriesName:f.escapeString(r[t]),"data:collapsed":d||h}),(d||h)&&m.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||m.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",t.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",t.onLegendKeyDown.bind(t),!0)}setLegendWrapXY(e,t){const s=this.w,i=s.dom.elLegendWrap,n=i.clientHeight;let r=0,l=0;if("bottom"===s.config.legend.position)l=s.globals.svgHeight-Math.min(n,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const e=new h(this.w,this.ctx),t=e.dimHelpers.getTitleSubtitleCoords("title").height,s=e.dimHelpers.getTitleSubtitleCoords("subtitle").height;l=(t>0?t-10:0)+(s>0?s-10:0)}i.style.position="absolute",r=r+e+s.config.legend.offsetX,l=l+t+s.config.legend.offsetY,i.style.left=r+"px",i.style.top=l+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(e=>{i&&i.style[e]&&(i.style[e]=parseInt(String(s.config.legend[e]),10)+"px")})}legendAlignHorizontal(){const e=this.w;e.dom.elLegendWrap.style.right="0";const t=new h(this.w,this.ctx),s=t.dimHelpers.getTitleSubtitleCoords("title"),i=t.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===e.config.legend.position&&(n=s.height+i.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){const e=this.w,t=this.legendHelpers.getLegendDimensions();let s=0;"left"===e.config.legend.position&&(s=20),"right"===e.config.legend.position&&(s=e.globals.svgWidth-t.clww-10),this.setLegendWrapXY(s,20)}onLegendHovered(e){var t;const s=this.w,i=e.target,n=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(n){const s=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);const n=new u(this.ctx.w);"mousemove"===e.type?n.highlightRangeInSeries(s,"highlight"):"mouseout"===e.type&&n.highlightRangeInSeries(s,"reset")}}else if(!i.classList.contains("apexcharts-inactive-legend")&&n){new u(this.ctx.w).toggleSeriesOnHover(e,i)}}onLegendKeyDown(e){const t=this,s=this.w,i=e.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&("Enter"===e.key||" "===e.key)){e.preventDefault();const n=i.getAttribute("rel");t.onLegendClick(e),null!==n&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const e=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);e&&e.focus()})}}onLegendClick(e){var t;const s=this.w,i=e.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){const e=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1,n="true"===i.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]);const l=this.w.config.legend.markers.onClick;"function"==typeof l&&i.classList.contains("apexcharts-legend-marker")&&(l(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(e,n)}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.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 v7.3.0
21
+ * ApexCharts v7.4.0
22
22
  * (c) 2018-2026 ApexCharts
23
23
  */
24
24
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexLegend={})}(this,function(e){"use strict";var t=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,o=(e,t)=>{for(var s in t||(t={}))l.call(t,s)&&a(e,s,t[s]);if(n)for(var s of n(t))r.call(t,s)&&a(e,s,t[s]);return e},c=(e,t)=>s(e,i(t));const d=globalThis.ApexCharts,g=globalThis.ApexCharts.__internals.__apex_CoreUtils,h=globalThis.ApexCharts.__internals.__apex_dimensions_Dimensions,p=globalThis.ApexCharts.__internals.__apex_Graphics,u=globalThis.ApexCharts.__internals.__apex_Series,f=globalThis.ApexCharts.__internals.__apex_Utils,m=globalThis.ApexCharts.__internals.__apex_Environment_Environment;class x{constructor(e){this.w=e.w,this.lgCtx=e}getLegendStyles(){if(m.isSSR())return null;const e=document.createElement("style");e.setAttribute("type","text/css");const t=this.w.config.chart.nonce;t&&e.setAttribute("nonce",t);const s=document.createTextNode(".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ");return e.appendChild(s),e}getLegendDimensions(){const e=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!e)return{clwh:0,clww:0};const{width:t,height:s}=e.getBoundingClientRect();return{clwh:s,clww:t}}appendToForeignObject(){var e;const t=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&t&&(null==(e=this.w.dom.elLegendForeign)||e.appendChild(t))}toggleDataSeries(e,t){var s,i,n;const l=this.w;if(l.globals.axisCharts||"radialBar"===l.config.chart.type){l.globals.resized=!0;let r=null,a=null;if(l.globals.risingSeries=[],l.globals.axisCharts){if(r=null!=(s=Array.prototype.find.call(l.dom.baseEl.querySelectorAll(".apexcharts-series"),t=>t.getAttribute("data:realIndex")===String(e)))?s:null,!r)return;a=parseInt(null!=(i=r.getAttribute("data:realIndex"))?i:"",10)}else{if(r=l.dom.baseEl.querySelector(`.apexcharts-series[rel='${e+1}']`),!r)return;a=parseInt(null!=(n=r.getAttribute("rel"))?n:"",10)-1}if(t){[{cs:l.globals.collapsedSeries,csi:l.globals.collapsedSeriesIndices},{cs:l.globals.ancillaryCollapsedSeries,csi:l.globals.ancillaryCollapsedSeriesIndices}].forEach(e=>{const t=e.cs,s=e.csi;this.riseCollapsedSeries(t,s,a)})}else this.hideSeries({seriesEl:r,realIndex:a});if(l.config.chart.accessibility.enabled){const t=l.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=l.globals.collapsedSeriesIndices.includes(a)||l.globals.ancillaryCollapsedSeriesIndices.includes(a);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:l.seriesData.seriesNames[e],r=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}else{if(l.globals.resized=!0,l.globals.risingSeries=[],t)this.riseCollapsedSeries(l.globals.collapsedSeries,l.globals.collapsedSeriesIndices,e);else{const t=this.getSeriesAfterCollapsing({realIndex:e});this.lgCtx.updateSeries(t,l.config.chart.animations.dynamicAnimation.enabled)}if(l.config.chart.accessibility.enabled){const t=l.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${e+1}"]`);if(t){const s=l.globals.collapsedSeriesIndices.includes(e);t.setAttribute("aria-pressed",s?"true":"false");const i=t.querySelector(".apexcharts-legend-text"),n=i?i.textContent:l.seriesData.seriesNames[e],r=s?"hidden":"visible";t.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(e){const t=this.w.config.chart.type;return("pie"===t||"donut"===t||"polarArea"===t||"sunburst"===t)&&1===e.length&&e[0]&&"object"==typeof e[0]&&Array.isArray(e[0].data)?e[0].data:e}_readSliceValue(e){return"unit"===this.w.config.chart.type&&e&&Array.isArray(e.data)?e.data:e&&"object"==typeof e?e.y:e}_writeSliceValue(e,t,s){const i=e[t];"unit"===this.w.config.chart.type&&i&&Array.isArray(i.data)?i.data=Array.isArray(s)?s:[]:i&&"object"==typeof i?i.y=s:e[t]=s}getSeriesAfterCollapsing({realIndex:e}){var t,s;const i=this.w,n=i.globals,l=f.clone(i.config.series);if(n.axisCharts){const t=i.config.yaxis[n.seriesYAxisReverseMap[e]],s={index:e,data:l[e].data.slice(),type:l[e].type||i.config.chart.type,name:(n.seriesNames||[])[e]};if(t&&t.show&&t.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(e)<0&&(n.ancillaryCollapsedSeries.push(s),n.ancillaryCollapsedSeriesIndices.push(e));else if(n.collapsedSeriesIndices.indexOf(e)<0){n.collapsedSeries.push(s),n.collapsedSeriesIndices.push(e);const t=n.risingSeries.indexOf(e);n.risingSeries.splice(t,1)}}else if(n.collapsedSeriesIndices.indexOf(e)<0){const r=this._nonAxisSliceContainer(l);n.collapsedSeries.push({index:e,data:this._readSliceValue(r[e]),type:null!=(s=null==(t=i.config.series[e])?void 0:t.type)?s:"line",name:(n.seriesNames||[])[e]}),n.collapsedSeriesIndices.push(e)}const r=n.axisCharts?i.config.series.length:this._nonAxisSliceContainer(l).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===r,this._getSeriesBasedOnCollapsedState(l)}hideSeries({seriesEl:e,realIndex:t}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:t}),n=e.childNodes;for(let e=0;e<n.length;e++)n[e].classList.contains("apexcharts-series-markers-wrap")&&(n[e].classList.contains("apexcharts-hide")?n[e].classList.remove("apexcharts-hide"):n[e].classList.add("apexcharts-hide"));const l=s.config.chart.animations.dynamicAnimation.enabled;l&&(s.globals.collapsingSeriesIndices=[t]);const r=()=>{s.globals.collapsingSeriesIndices=[]},a=this.lgCtx.updateSeries(i,l);r(),a&&"function"==typeof a.then&&a.then(r,r)}riseCollapsedSeries(e,t,s){const i=this.w;let n=f.clone(i.config.series);if(e.length>0){for(let l=0;l<e.length;l++)if(e[l].index===s){if(i.globals.axisCharts)n[s].data=e[l].data.slice(),n[s].hidden=!1;else{const t=this._nonAxisSliceContainer(n);this._writeSliceValue(t,s,e[l].data)}e.splice(l,1),t.splice(l,1),i.globals.risingSeries.push(s),l--}n=this._getSeriesBasedOnCollapsedState(n),this.lgCtx.updateSeries(n,i.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(e){const t=this.w;let s=0;if(t.globals.axisCharts)e.forEach((i,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(e[n].data=[],s++)});else{const i=this._nonAxisSliceContainer(e);i.forEach((e,n)=>{t.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(i,n,0),s++)})}const i=t.globals.axisCharts?e.length:this._nonAxisSliceContainer(e).length;return t.globals.allSeriesCollapsed=s===i,e}}const b=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,y=["#cf4d3f","#8f9499","#26a75b"],v=(e,t,s)=>e+(t-e)*s;function S(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function w(e,t,s){const i=f.parseHex(A(e)),n=f.parseHex(A(t));return i&&n?"#"+S(v(i[0],n[0],s))+S(v(i[1],n[1],s))+S(v(i[2],n[2],s)):e}function A(e){if("string"!=typeof e)return"#000000";if(f.isColorHex(e))return e;return f.rgb2hex(e)||"#000000"}function _(e,t,s,i){var n,l,r;if(!t||"object"!=typeof t)return null;const a=null==(r=null==(l=null==(n=e.config.plotOptions)?void 0:n.treemap)?void 0:l.colorScale)?void 0:r.colorValue;let o;if(o="function"==typeof a?a(t,{seriesIndex:s,dataPointIndex:i,w:e}):"string"==typeof a?t[a]:t.colorValue,null==o)return null;const c=Number(o);return Number.isFinite(c)?c:null}function C(e){var t,s,i;const n=null==(i=null==(s=null==(t=e.config)?void 0:t.plotOptions)?void 0:s.treemap)?void 0:i.colorScale,l=n&&n.gradient;if(!l)return null;if(!1===l.enabled)return null;const r=e.config.series||[];let a=1/0,o=-1/0,c=!1;for(let t=0;t<r.length;t++){const s=r[t]&&r[t].data;if(Array.isArray(s))for(let i=0;i<s.length;i++){const n=_(e,s[i],t,i);null!=n&&(c=!0,n<a&&(a=n),n>o&&(o=n))}}if(!c&&!0!==l.enabled)return null;Number.isFinite(a)||(a=0,o=0);let d=Number.isFinite(Number(l.min))?Number(l.min):a,g=Number.isFinite(Number(l.max))?Number(l.max):o,h=null;if(null===l.midpoint?h=null:Number.isFinite(Number(l.midpoint))?h=Number(l.midpoint):d<0&&g>0&&(h=0),null!=h&&!1!==l.symmetric&&!Number.isFinite(Number(l.min))&&!Number.isFinite(Number(l.max))){const e=Math.max(Math.abs(d-h),Math.abs(g-h));d=h-e,g=h+e}g===d&&(d-=.5,g+=.5);const p=function(e,t,s,i){if(Array.isArray(e.stops)&&e.stops.length>=2)return e.stops.filter(e=>e&&Number.isFinite(Number(e.value))).map(e=>({value:Number(e.value),color:A(e.color)})).sort((e,t)=>e.value-t.value);const n=(Array.isArray(e.colors)&&e.colors.length>=2?e.colors:y).map(A),l=n.length;if(null!=i&&l>=3){const e=Math.floor((l-1)/2),r=[];for(let s=0;s<=e;s++)r.push({value:v(t,i,s/e),color:n[s]});for(let t=e+1;t<l;t++)r.push({value:v(i,s,(t-e)/(l-1-e)),color:n[t]});return r}return n.map((e,i)=>({value:v(t,s,i/(l-1)),color:e}))}(l,d,g,h);if(p.length<2)return null;const u=g-d,f=p.map(e=>({percent:0===u?0:(e.value-d)/u,color:e.color}));return{min:d,max:g,midpoint:h,stops:p,at:e=>{if(!Number.isFinite(e))return p[Math.floor(p.length/2)].color;if(e<=p[0].value)return p[0].color;const t=p[p.length-1];if(e>=t.value)return t.color;for(let t=1;t<p.length;t++){const s=p[t];if(e<=s.value){const i=p[t-1],n=s.value-i.value,l=0===n?0:(e-i.value)/n;return w(i.color,s.color,l)}}return t.color},legendStops:f}}const L="http://www.w3.org/2000/svg";class E{constructor(e,t){this.w=e,this.ctx=t,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const e=this._cfg();return"function"==typeof e.formatter?e.formatter:e=>{if(!Number.isFinite(e))return String(e);const t=Math.abs(e);return t>=1e3?e.toFixed(0):t>=10?e.toFixed(1):e.toFixed(2)}}static colorScaleOf(e){var t,s,i,n,l;const r=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return r&&(null==(l=null==(n=null==(i=null==e?void 0:e.config)?void 0:i.plotOptions)?void 0:n[r])?void 0:l.colorScale)||null}static configFor(e){const t=E.colorScaleOf(e);return t&&t.gradientLegend||null}_cfg(){return E.configFor(this.w)||{}}static isEnabled(e){if(!E.supports(e))return!1;const t=E.configFor(e);return!(!t||!t.enabled)}static supports(e){var t,s;const i=null==(s=null==(t=null==e?void 0:e.config)?void 0:t.chart)?void 0:s.type;return"heatmap"===i||"treemap"===i}draw(e=null){var t,s,i,n,l,r,a,o;const c=this.w;this._targetEl=e;const d=e||c.dom.elLegendWrap;if(!d)return;const g=this._cfg(),h=c.config.legend.position,p="left"===h||"right"===h,u=null!=(s=null==(t=g.arrow)?void 0:t.size)?s:8,f=u+4,m=g.showLabels?28:4,x=g.showLabels?20:4,y=g.showLabels?44:0,v=this._resolveStripLength(p?g.height:g.width,p),S=g.thickness,w=p?Math.max(S+f+4,y):v+2*m,A=p?v+2*x:S+f+4,_=(w-(S+f))/2,C=p?"left"===h?_:_+f:m,E=p?x:"top"===h?f:4,k=b.createElementNS(L,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const I=b.createElementNS(L,"defs"),F=`apexcharts-heatmap-gradient-${c.globals.cuid}`,H=b.createElementNS(L,"linearGradient");H.setAttribute("id",F),p?(H.setAttribute("x1","0"),H.setAttribute("y1","1"),H.setAttribute("x2","0"),H.setAttribute("y2","0")):(H.setAttribute("x1","0"),H.setAttribute("y1","0"),H.setAttribute("x2","1"),H.setAttribute("y2","0"));const{min:N,max:M,stops:B,bands:O}=this._computeStops();this._min=N,this._max=M,B.forEach(e=>{const t=b.createElementNS(L,"stop");t.setAttribute("offset",`${(100*e.percent).toFixed(2)}%`),t.setAttribute("stop-color",e.color),H.appendChild(t)}),I.appendChild(H),k.appendChild(I);const T=b.createElementNS(L,"rect");if(T.setAttribute("x",String(C)),T.setAttribute("y",String(E)),T.setAttribute("width",String(p?S:v)),T.setAttribute("height",String(p?v:S)),T.setAttribute("rx","2"),T.setAttribute("fill",`url(#${F})`),k.appendChild(T),g.showLabels){const e=(null==(i=g.labelStyle)?void 0:i.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,t=(null==(n=g.labelStyle)?void 0:n.fontSize)||"11px",s=(null==(l=g.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily,r=this._getFormatter(),a=(i,n,l,r)=>{const a=b.createElementNS(L,"text");return a.setAttribute("x",String(n)),a.setAttribute("y",String(l)),a.setAttribute("text-anchor",r),a.setAttribute("dominant-baseline","middle"),a.setAttribute("fill",e),a.setAttribute("font-size",t),s&&a.setAttribute("font-family",s),a.textContent=String(i),a};if(p){const e=C+S/2;k.appendChild(a(r(N),e,E+v+10,"middle")),k.appendChild(a(r(M),e,E-10,"middle"))}else{const e=E+S/2;k.appendChild(a(r(N),C-6,e,"end")),k.appendChild(a(r(M),C+v+6,e,"start"))}}const V=(null==(r=g.arrow)?void 0:r.color)||c.config.chart.foreColor,$=this._buildArrow(u,V,h);if(k.appendChild($),this.arrowEl=$,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&O.length>0&&O.forEach(e=>{const t=b.createElementNS(L,"rect");if(p){const s=E+v-e.p2*v,i=E+v-e.p1*v;t.setAttribute("x",String(C)),t.setAttribute("y",String(s)),t.setAttribute("width",String(S)),t.setAttribute("height",String(Math.max(0,i-s)))}else t.setAttribute("x",String(C+e.p1*v)),t.setAttribute("y",String(E)),t.setAttribute("width",String(Math.max(0,(e.p2-e.p1)*v))),t.setAttribute("height",String(S));t.setAttribute("fill","transparent"),t.setAttribute("class","apexcharts-heatmap-gradient-band"),t.setAttribute("data:range-index",String(e.index)),t.style.cursor="pointer",k.appendChild(t),this._bandHitEls.push(t)}),this._geom={isVertical:p,position:h,stripX:C,stripY:E,stripLength:v,stripThickness:S,arrowSize:u,svgWidth:w,svgHeight:A},g.showHoverValue){const e=b.createElement("div");e.classList.add("apexcharts-heatmap-gradient-legend-value"),e.style.position="absolute",e.style.fontSize=(null==(a=g.labelStyle)?void 0:a.fontSize)||"11px",e.style.fontFamily=(null==(o=g.labelStyle)?void 0:o.fontFamily)||c.config.chart.fontFamily||"",e.style.color=c.config.chart.foreColor,e.style.background="rgba(0,0,0,0.65)",e.style.color="#fff",e.style.padding="2px 6px",e.style.borderRadius="3px",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.opacity="0",e.style.transition="opacity 120ms ease",this.hoverValueEl=e}d.classList.add("apexcharts-heatmap-gradient-legend-wrap"),d.classList.add("apx-legend-position-"+h),d.appendChild(k),this.hoverValueEl&&d.appendChild(this.hoverValueEl),this.svgEl=k,e?(d.style.width=w+"px",d.style.height=A+"px",d.style.position="relative",d.style.overflow="visible"):this._applyWrapAlignment(d,h,p,w,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(e,t){const s=this.w,i=t?s.globals.svgHeight||s.config.chart.height||300:s.globals.svgWidth||s.config.chart.width||600;if("string"==typeof e){const t=e.trim();if(t.endsWith("%")){const e=parseFloat(t)||0;return Math.max(20,i*e/100)}const s=parseFloat(t);return Number.isFinite(s)?s:200}return"number"==typeof e&&Number.isFinite(e)?e:200}_applyWrapAlignment(e,t,s,i,n){const l=this.w,r=this._cfg().align||"center",a=12,o=l.globals.svgWidth||l.config.chart.width||600,c=l.globals.svgHeight||l.config.chart.height||300,d=l.config.legend.offsetX||0,g=l.config.legend.offsetY||0;if(e.style.position="absolute",e.style.display="block",e.style.overflow="visible",e.style.padding="0",e.style.width=i+"px",e.style.height=n+"px",e.style.right="auto",e.style.bottom="auto",s){const s=c-n-24;let l;l="start"===r?a:"end"===r?a+Math.max(0,s):a+Math.max(0,s)/2,e.style.top=l+g+"px",e.style.left="left"===t?a+d+"px":o-i-a+d+"px"}else{const s=o-i-24;let l;l="start"===r?a:"end"===r?a+Math.max(0,s):a+Math.max(0,s)/2,e.style.left=l+d+"px",e.style.top="top"===t?a+g+"px":c-n-a+g+"px"}}repositionToPlot(){var e,t;if(!m.isBrowser())return;if(this._targetEl)return;const s=this.w,i=s.globals,n=s.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(i.gridWidth)||!Number.isFinite(i.gridHeight))return;const{isVertical:l,position:r,svgWidth:a,svgHeight:o,stripX:c,stripY:d,stripThickness:g}=this._geom,h=this._cfg().align||"center",p=s.config.legend.offsetX||0,u=s.config.legend.offsetY||0,f=null==(t=null==(e=this.ctx)?void 0:e.dimensions)?void 0:t.dimHelpers,x=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=s.layout.xAxisHeight||0,v=(e,t)=>{const s=Math.max(0,e-t);return"start"===h?0:"end"===h?s:s/2};if(l){n.style.top=i.translateY+v(i.gridHeight,o)+u+"px";const e=(("left"===r?0:i.translateX+i.gridWidth)+("left"===r?i.translateX:i.svgWidth))/2;n.style.left=e-c-g/2+p+"px"}else{n.style.left=i.translateX+v(i.gridWidth,a)+p+"px";const e=(("top"===r?x:i.translateY+i.gridHeight+y)+("top"===r?i.translateY:i.svgHeight))/2;n.style.top=e-d-g/2+u+"px"}b.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const e=this.w,t=e.dom.elLegendWrap,s=this.svgEl&&this.svgEl.querySelector("rect"),i=e.dom.baseEl.querySelector(".apexcharts-grid");if(!(t&&s&&i&&this._geom))return;const n=s.getBoundingClientRect(),l=i.getBoundingClientRect();if(!(n.width&&n.height&&l.width&&l.height))return;const{isVertical:r,position:a}=this._geom;if(r){const e="left"===a?l.left-n.right:n.left-l.right;if(e<16){const s=parseFloat(t.style.left)||0,i=16-e;t.style.left=s+("left"===a?-i:i)+"px"}}else{const e="top"===a?l.top-n.bottom:n.top-l.bottom;if(e<16){const s=parseFloat(t.style.top)||0,i=16-e;t.style.top=s+("top"===a?-i:i)+"px"}}}destroy(){var e,t,s,i,n,l,r;for(let s=0;s<this._bandHitEls.length;s++){const i=this._bandHitEls[s];null==(e=i.removeEventListener)||e.call(i,"mousemove",this._onBandEnter),null==(t=i.removeEventListener)||t.call(i,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(s=this.ctx)?void 0:s.events)try{null==(n=(i=this.ctx.events).removeEventListener)||n.call(i,"dataPointMouseEnter",this._onCellEnter),null==(r=(l=this.ctx.events).removeEventListener)||r.call(l,"dataPointMouseLeave",this._onCellLeave)}catch(e){}}_attachBandHoverListeners(){if(m.isBrowser())for(let e=0;e<this._bandHitEls.length;e++){const t=this._bandHitEls[e];t.addEventListener("mousemove",this._onBandEnter),t.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(e){var t,s,i,n;const l=this.w,r=e.currentTarget,a=parseInt(null!=(t=r.getAttribute("data:range-index"))?t:"-1",10);a<0||a===this._activeBandIndex||(this._activeBandIndex=a,null==(n=null==(i=null==(s=this.ctx)?void 0:s.events)?void 0:i.fireEvent)||n.call(i,"legendHover",[this.ctx,a,l]),new u(l).highlightRangeInSeries(a,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const e=this._activeBandIndex;this._activeBandIndex=-1,new u(this.w).highlightRangeInSeries(e,"reset")}_attachHoverListeners(){var e,t;m.isBrowser()&&(null==(t=null==(e=this.ctx)?void 0:e.events)?void 0:t.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...e){var t,s,i;const n=this.w;if(!this.arrowEl)return;const l=e[e.length-1];if(!l||"object"!=typeof l)return;const r=l.seriesIndex,a=l.dataPointIndex;if("number"!=typeof r||"number"!=typeof a)return;if(!E.supports(n))return;let o;o=this._continuous?function(e,t,s){const i=e.config.series[t];return _(e,i&&Array.isArray(i.data)?i.data[s]:null,t,s)}(n,r,a):null==(i=null==(s=null==(t=n.seriesData)?void 0:t.series)?void 0:s[r])?void 0:i[a],null==o||Number.isNaN(o)||this._positionArrow(o)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(e){if(!this.arrowEl||!this._geom)return;const{isVertical:t,position:s,stripX:i,stripY:n,stripLength:l,stripThickness:r,arrowSize:a}=this._geom,o=this._min,c=this._max-o;let d;if(d=0===c?.5:(e-o)/c,d<0&&(d=0),d>1&&(d=1),t){const e=n+l-d*l;let t,o;"left"===s?(t=i+r,o=t+a):(t=i,o=t-a);const c=[`${t},${e}`,`${o},${e-a/2}`,`${o},${e+a/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const e=i+d*l;let t,o;"top"===s?(t=n+r,o=t+a):(t=n,o=t-a);const c=[`${e},${t}`,`${e-a/2},${o}`,`${e+a/2},${o}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const o=this._getFormatter();if(this.hoverValueEl.textContent=o(e),t){const e=n+l-d*l;"left"===s?this.hoverValueEl.style.left=`${i+r+a+8}px`:(this.hoverValueEl.style.left=i-a-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=e-9+"px"}else{const e=i+d*l;this.hoverValueEl.style.left=`${e}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===s?`${n+r+a+8}px`:n-a-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(e,t,s){const i=b.createElementNS(L,"polygon");return i.setAttribute("fill",t),i.setAttribute("opacity","0"),i.setAttribute("class","apexcharts-heatmap-gradient-arrow"),i.setAttribute("points","0,0 0,0 0,0"),i.setAttribute("pointer-events","none"),i}_computeStops(){var e,t;const s=this.w,i=E.colorScaleOf(s)||{},n=this._cfg(),l=C(s);if(l)return this._continuous=!0,{min:l.min,max:l.max,stops:l.legendStops,bands:[]};this._continuous=!1;let r=1/0,a=-1/0;const d=(null==(e=s.seriesData)?void 0:e.series)||[];for(let e=0;e<d.length;e++){const t=d[e];if(t)for(let e=0;e<t.length;e++){const s=t[e];null==s||Number.isNaN(s)||(s<r&&(r=s),s>a&&(a=s))}}Number.isFinite(r)||(r=0),Number.isFinite(a)||(a=0);let g=r,h=a;void 0!==i.min&&void 0!==i.max&&i.max>i.min?(g=i.min,h=i.max):(void 0!==i.min&&(g=i.min<r?i.min:r),void 0!==i.max&&(h=i.max>a?i.max:a));const p=[],u=[];if(i.ranges&&i.ranges.length>0){const e=i.ranges.map((e,t)=>c(o({},e),{_originalIndex:t})).sort((e,t)=>e.from-t.from),t=e[0].from,s=e[e.length-1].to;g=t,h=s;const n=s-t||1;e.forEach(e=>{const s=(e.from-t)/n,i=(e.to-t)/n;p.push({percent:(s+i)/2,color:e.color}),u.push({index:e._originalIndex,p1:s,p2:i})})}else{const e=s.globals.colors[0]||"#008FFB",i=new f,l=s.config.plotOptions[s.config.chart.type]||{},r=null!=(t=l.shadeIntensity)?t:.5,a=s.globals.hasNegs,o=Math.max(2,n.stops||16);for(let t=0;t<o;t++){const n=t/(o-1),c=g+n*(h-g),d=Math.abs(h)+Math.abs(g),u=0===d?0:100*c/d;let f;f=a?l.reverseNegativeShade?u<0?u/100*(1.25*r):1.25*r*(1-u/100):u<=0?1-(1+u/100)*r:(1-u/100)*r:1-u/100,f>1&&(f=1),f<-1&&(f=-1);const m=l.enableShades?i.shadeColor("dark"===s.config.theme.mode?-1*f:f,e):e;p.push({percent:n,color:m})}}return{min:g,max:h,stops:p,bands:u}}}const k=globalThis.ApexCharts.__internals.__apex_Markers;d.registerFeatures({legend:class{constructor(e,t){this.w=e,this.ctx=t,this.updateSeries=(...e)=>t.updateHelpers._updateSeries(...e),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new x(this)}init(){const e=this.w,t=e.globals,s=e.config;this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||E.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!t.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),E.isEnabled(e)?(this.heatmapGradientLegend=new E(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:e,fillcolor:t}){const s=this.w,i=b.createElement("span");i.classList.add("apexcharts-legend-marker");const n=s.config.legend.markers.shape||s.config.markers.shape;let l=n;Array.isArray(n)&&(l=n[e]);const r=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[e]):parseFloat(s.config.legend.markers.size),a=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[e]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[e]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[e]):parseFloat(s.config.legend.markers.strokeWidth),h=i.style;if(h.height=2*(r+g)+"px",h.width=2*(r+g)+"px",h.left=a+"px",h.top=d+"px",s.config.legend.markers.customHTML)h.background="transparent",h.color=t[e],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[e]&&(i.innerHTML=s.config.legend.markers.customHTML[e]()):i.innerHTML=s.config.legend.markers.customHTML();else{const n=new k(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${l}`,seriesIndex:e,strokeWidth:g,size:r}),a=(m.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),d=new p(this.w).drawMarker(0,0,c(o({},n),{pointFillColor:Array.isArray(t)?t[e]:n.pointFillColor,shape:l}));s.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(e=>{e.node.classList.contains("apexcharts-marker-triangle")?e.node.style.transform="translate(50%, 45%)":e.node.style.transform="translate(50%, 50%)"}),a.add(d)}return i}drawLegends(){var e;const t=this,s=this.w,i=s.dom.elLegendWrap,n=s.config.legend.fontFamily;let l=s.seriesData.seriesNames,r=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const e=s.config.plotOptions.heatmap.colorScale.ranges;l=e.map(e=>e.name?e.name:e.from+" - "+e.to),r=e.map(e=>e.color)}else this.isBarsDistributed&&(l=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(l=s.config.legend.customLegendItems);const a=s.formatters.legendFormatter,o=s.config.legend.inverseOrder,c=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((e,t)=>{c[t]=b.createElement("div"),c[t].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${t}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")});for(let t=o?l.length-1:0;o?t>=0:t<=l.length-1;o?t--:t++){const o=a(l[t],{seriesIndex:t,w:s});let d=!1,h=!1;if(s.globals.collapsedSeries.length>0)for(let e=0;e<s.globals.collapsedSeries.length;e++)s.globals.collapsedSeries[e].index===t&&(d=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let e=0;e<s.globals.ancillaryCollapsedSeriesIndices.length;e++)s.globals.ancillaryCollapsedSeriesIndices[e]===t&&(h=!0);const u=this.createLegendMarker({i:t,fillcolor:r});p.setAttrs(u,{rel:t+1,"data:collapsed":d||h}),(d||h)&&u.classList.add("apexcharts-inactive-legend");const m=b.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){m.setAttribute("role","button"),m.setAttribute("tabindex","0");const e=Array.isArray(o)?o.join(" "):o,t=d||h,s=t?"hidden":"visible";m.setAttribute("aria-label",`${e}, ${s}. Press Enter or Space to toggle.`),m.setAttribute("aria-pressed",t?"true":"false")}const x=b.createElement("span");x.classList.add("apexcharts-legend-text"),x.innerHTML=Array.isArray(o)?o.join(" "):o;let y=s.config.legend.labels.useSeriesColors?s.globals.colors[t]:Array.isArray(s.config.legend.labels.colors)?null==(e=s.config.legend.labels.colors)?void 0:e[t]:s.config.legend.labels.colors;y||(y=s.config.chart.foreColor),x.style.color=y,x.style.fontSize=s.config.legend.fontSize,x.style.fontWeight=s.config.legend.fontWeight,x.style.fontFamily=n||s.config.chart.fontFamily,p.setAttrs(x,{rel:t+1,i:t,"data:default-text":encodeURIComponent(o),"data:collapsed":d||h}),m.appendChild(u),m.appendChild(x);const v=new g(this.w);if(!s.config.legend.showForZeroSeries){0===v.getSeriesTotalByIndex(t)&&v.seriesHaveSameValues(t)&&!v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||v.isSeriesNull(t)&&-1===s.globals.collapsedSeriesIndices.indexOf(t)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(t)&&m.classList.add("apexcharts-hidden-null-series"),c.length?s.labelData.seriesGroups.forEach((e,n)=>{var l,r;e.includes(null!=(r=null==(l=s.config.series[t])?void 0:l.name)?r:"")&&(i.appendChild(c[n]),c[n].appendChild(m))}):i.appendChild(m),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),m.classList.add("apexcharts-legend-series"),m.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",p.setAttrs(m,{rel:t+1,seriesName:f.escapeString(l[t]),"data:collapsed":d||h}),(d||h)&&m.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||m.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",t.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",t.onLegendKeyDown.bind(t),!0)}setLegendWrapXY(e,t){const s=this.w,i=s.dom.elLegendWrap,n=i.clientHeight;let l=0,r=0;if("bottom"===s.config.legend.position)r=s.globals.svgHeight-Math.min(n,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const e=new h(this.w,this.ctx),t=e.dimHelpers.getTitleSubtitleCoords("title").height,s=e.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(t>0?t-10:0)+(s>0?s-10:0)}i.style.position="absolute",l=l+e+s.config.legend.offsetX,r=r+t+s.config.legend.offsetY,i.style.left=l+"px",i.style.top=r+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(e=>{i&&i.style[e]&&(i.style[e]=parseInt(String(s.config.legend[e]),10)+"px")})}legendAlignHorizontal(){const e=this.w;e.dom.elLegendWrap.style.right="0";const t=new h(this.w,this.ctx),s=t.dimHelpers.getTitleSubtitleCoords("title"),i=t.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===e.config.legend.position&&(n=s.height+i.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){const e=this.w,t=this.legendHelpers.getLegendDimensions();let s=0;"left"===e.config.legend.position&&(s=20),"right"===e.config.legend.position&&(s=e.globals.svgWidth-t.clww-10),this.setLegendWrapXY(s,20)}onLegendHovered(e){var t;const s=this.w,i=e.target,n=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(n){const s=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);const n=new u(this.ctx.w);"mousemove"===e.type?n.highlightRangeInSeries(s,"highlight"):"mouseout"===e.type&&n.highlightRangeInSeries(s,"reset")}}else if(!i.classList.contains("apexcharts-inactive-legend")&&n){new u(this.ctx.w).toggleSeriesOnHover(e,i)}}onLegendKeyDown(e){const t=this,s=this.w,i=e.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&("Enter"===e.key||" "===e.key)){e.preventDefault();const n=i.getAttribute("rel");t.onLegendClick(e),null!==n&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const e=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);e&&e.focus()})}}onLegendClick(e){var t;const s=this.w,i=e.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){const e=parseInt(null!=(t=i.getAttribute("rel"))?t:"0",10)-1,n="true"===i.getAttribute("data:collapsed"),l=this.w.config.chart.events.legendClick;"function"==typeof l&&l(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]);const r=this.w.config.legend.markers.onClick;"function"==typeof r&&i.classList.contains("apexcharts-legend-marker")&&(r(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(e,n)}}}}),e.default=d,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.3.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,r,s)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=(e=>e&&e.__esModule?e:{default:e})(require("apexcharts/core")),l=globalThis.console;const c="__apexcharts_crossfilters__";function h(e){if(!Number.isFinite(e))return e;const t=Number(e.toPrecision(12));return Object.is(t,-0)?0:t}function f(e){return"number"==typeof e&&Number.isFinite(e)}function u(e){if("function"==typeof e)return e;if(e&&"object"==typeof e){if("string"==typeof e.sum){const t=e.sum;return e=>e.reduce((e,r)=>e+(Number(r[t])||0),0)}if("string"==typeof e.avg){const t=e.avg;return e=>e.length?e.reduce((e,r)=>e+(Number(r[t])||0),0)/e.length:0}if("string"==typeof e.min){const t=e.min;return e=>e.length?Math.min(...e.map(e=>Number(e[t])||0)):0}if("string"==typeof e.max){const t=e.max;return e=>e.length?Math.max(...e.map(e=>Number(e[t])||0)):0}}return e=>e.length}function d(e,t){return"function"==typeof t?e.slice().sort(t):"asc"===t?e.slice().sort((e,t)=>e>t?1:e<t?-1:0):"desc"===t?e.slice().sort((e,t)=>e<t?1:e>t?-1:0):e}function g(e,t){if(!f(e))return-1;const r=t.length-1;if(e<t[0]||e>t[r])return-1;if(e===t[r])return r-1;for(let s=0;s<r;s++)if(e>=t[s]&&e<t[s+1])return s;return-1}function m(e){const t=[];for(let r=0;r<e.length-1;r++)t.push(h((e[r]+e[r+1])/2));return t}class p{constructor(e,t){this.dims=new Map,this.listeners=new Map,this.id=e,this.records=Array.isArray(t)?t:[]}static store(){const e=globalThis;return e[c]||(e[c]=new Map),e[c]}static getOrCreate(e){if(!e||"string"!=typeof e.id)throw new Error("Crossfilter.getOrCreate requires an { id } string.");const t=p.store(),r=t.get(e.id);if(r)return e.records&&r.setRecords(e.records),r;const s=new p(e.id,e.records);return t.set(e.id,s),s}static get(e){return p.store().get(e)||null}setRecords(e){return this.records=Array.isArray(e)?e:[],this.dims.forEach(e=>this.recomputeDomain(e)),this.emit("records",this.state()),this.emit("change",this.state()),this}registerDimension(e,t){if(!t||"function"!=typeof t.dimension)throw new Error(`crossfilter.registerDimension("${e}") needs a dimension function.`);const r=t.type||(t.bins?"range":"category"),s={accessor:t.dimension,reducer:u(t.reduce),type:r,bins:t.bins,order:t.order,filter:null,labels:[],edges:null,xLabels:[],yLabels:[]};return this.dims.set(e,s),this.recomputeDomain(s),null!=t.filter&&this.setFilterOn(s,t.filter),this}hasDimension(e){return this.dims.has(e)}removeDimension(e){const t=this.dims.get(e),r=!!t&&this.hasFilter(t);return this.dims.delete(e),r&&this.emit("change",this.state()),this}recomputeDomain(e){if("matrix"===e.type){const t=function(e,t,r){const s=new Set,i=new Set,n=[],a=[];for(let r=0;r<e.length;r++){const o=t(e[r]);if(!o)continue;const l=o[0],c=o[1];null==l||s.has(l)||(s.add(l),n.push(l)),null==c||i.has(c)||(i.add(c),a.push(c))}return{xLabels:d(n,r),yLabels:d(a,r)}}(this.records,e.accessor,e.order);return e.xLabels=t.xLabels,e.yLabels=t.yLabels,void(e.edges=null)}if("range"===e.type)return e.edges=function(e,t,r){if(r&&Array.isArray(r.thresholds)&&r.thresholds.length>=2){const e=Array.from(new Set(r.thresholds.filter(f))).sort((e,t)=>e-t);return e.length>=2?e.map(h):[0,1]}let s=1/0,i=-1/0;for(let r=0;r<e.length;r++){const n=t(e[r]);f(n)&&(n<s&&(s=n),n>i&&(i=n))}if(s===1/0)return[0,1];if(s===i){const e=Math.abs(s)>0?Math.abs(s):1;return[h(s),h(s+e)]}if(r&&f(r.width)&&r.width>0){const e=r.width,t=Math.floor(s/e)*e;let n=Math.ceil(i/e)*e;n<=t&&(n=t+e);const a=Math.max(1,Math.round((n-t)/e)),o=new Array(a+1);for(let r=0;r<=a;r++)o[r]=h(t+r*e);return o}const n=r&&f(r.count)&&r.count>=1?Math.floor(r.count):30,a=(i-s)/n,o=new Array(n+1);for(let e=0;e<=n;e++)o[e]=h(s+e*a);return o[n]=h(i),o}(this.records,e.accessor,e.bins),void(e.labels=m(e.edges));if(e.labels=function(e,t,r){const s=new Set,i=[];for(let r=0;r<e.length;r++){const n=t(e[r]);null!=n&&(s.has(n)||(s.add(n),i.push(n)))}return d(i,r)}(this.records,e.accessor,e.order),e.edges=null,e.filter instanceof Set){const t=new Set(e.labels);Array.from(e.filter).forEach(r=>{t.has(r)||e.filter.delete(r)})}}filter(e,t){const r=this.dims.get(e);return r?(this.setFilterOn(r,t),this.emit("change",this.state()),this):this}toggleKey(e,t){const r=this.dims.get(e);if(!r||"category"!==r.type)return this;r.filter instanceof Set||(r.filter=new Set);const s=r.filter;return s.has(t)?s.delete(t):s.add(t),0===s.size&&(r.filter=null),this.emit("change",this.state()),this}setFilterOn(e,t){if(null==t)return void(e.filter=null);if("range"===e.type){if(Array.isArray(t)&&2===t.length&&t.every(f)){const[r,s]=t;e.filter=[Math.min(r,s),Math.max(r,s)]}else e.filter=null;return}const r=new Set(t);e.filter=r.size?r:null}clear(e){const t=this.dims.get(e);return t&&(t.filter=null),this.emit("change",this.state()),this}reset(){return this.dims.forEach(e=>{e.filter=null}),this.emit("change",this.state()),this}hasFilter(e){return null!=e.filter&&(!(e.filter instanceof Set)||e.filter.size>0)}passes(e,t){if(!this.hasFilter(e))return!0;const r=e.accessor(t);if(e.filter instanceof Set)return e.filter.has(r);if(!f(r))return!1;const[s,i]=e.filter;return r>=s&&r<=i}filteredRecords(e){const t=[];return this.dims.forEach((r,s)=>{s!==e&&this.hasFilter(r)&&t.push(r)}),0===t.length?this.records:this.records.filter(e=>t.every(t=>this.passes(t,e)))}filteredRows(){return this.filteredRecords(null)}aggregateFor(e){const t=this.dims.get(e);if(!t)return{type:"category",labels:[],values:[],keys:[]};const r=this.filteredRecords(e);if("matrix"===t.type){const e=new Map(t.xLabels.map((e,t)=>[e,t])),s=new Map(t.yLabels.map((e,t)=>[e,t])),i=t.yLabels.map(()=>t.xLabels.map(()=>[]));for(let n=0;n<r.length;n++){const a=t.accessor(r[n]);if(!a)continue;const o=e.get(a[0]),l=s.get(a[1]);null!=o&&null!=l&&i[l][o].push(r[n])}return{type:"matrix",xLabels:t.xLabels.slice(),yLabels:t.yLabels.slice(),matrix:i.map(e=>e.map(e=>t.reducer(e)))}}if("range"===t.type){const e=t.edges||[0,1],s=e.length-1,i=Array.from({length:s},()=>[]);for(let s=0;s<r.length;s++){const n=g(t.accessor(r[s]),e);n>=0&&i[n].push(r[s])}return{type:"range",labels:m(e),values:i.map(e=>t.reducer(e)),keys:i.map((t,r)=>[e[r],e[r+1]]),edges:e}}const s=new Map;t.labels.forEach(e=>s.set(e,[]));for(let e=0;e<r.length;e++){const i=s.get(t.accessor(r[e]));i&&i.push(r[e])}return{type:"category",labels:t.labels.slice(),values:t.labels.map(e=>t.reducer(s.get(e)||[])),keys:t.labels.slice()}}aggregateAll(){const e={};return this.dims.forEach((t,r)=>{e[r]=this.aggregateFor(r)}),e}state(){const e={};return this.dims.forEach((t,r)=>{this.hasFilter(t)&&(e[r]=t.filter instanceof Set?Array.from(t.filter):t.filter.slice())}),{filters:e,filteredCount:this.filteredRows().length,total:this.records.length}}filterOf(e){const t=this.dims.get(e);return t&&this.hasFilter(t)?t.filter instanceof Set?new Set(t.filter):t.filter.slice():null}on(e,t){let r=this.listeners.get(e);return r||(r=new Set,this.listeners.set(e,r)),r.add(t),()=>this.off(e,t)}off(e,t){var r;return null==(r=this.listeners.get(e))||r.delete(t),this}emit(e,t){var r;null==(r=this.listeners.get(e))||r.forEach(r=>{try{r(t)}catch(t){!function(e,...t){l.error(e,...t)}(`[Apex] a crossfilter ${e} listener threw`,t)}})}static esc(e){return String(null==e?"":e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}resolveColumns(e){if(Array.isArray(e)&&e.length)return e.map(e=>"string"==typeof e?{field:e,label:e}:{field:e.field,label:e.label||e.field,format:e.format});const t=this.records[0];return(t?Object.keys(t):[]).map(e=>({field:e,label:e}))}tableHTML(e,t,r){const s="<thead><tr>"+e.map(e=>`<th>${p.esc(e.label)}</th>`).join("")+"</tr></thead>",i="<tbody>"+t.map(t=>"<tr>"+e.map(e=>{const r=t[e.field],s=e.format?e.format(r,t):r;return`<td>${p.esc(s)}</td>`}).join("")+"</tr>").join("")+"</tbody>";return`<table class="apexcharts-cf-table"><caption>${t.length} of ${r} rows</caption>${s}${i}</table>`}dataTable(e,t){if(!e)return{refresh(){},destroy(){}};const r=t||{},s=this.resolveColumns(r.columns),i=r.pageSize||0,n=r.page||0,a=()=>{const t=this.filteredRows(),r=i?t.slice(n*i,n*i+i):t;e.innerHTML=this.tableHTML(s,r,t.length)};a();const o=this.on("change",a);return{refresh:a,destroy:()=>{o(),e.innerHTML=""}}}destroy(){p.store().delete(this.id),this.dims.clear(),this.listeners.clear(),this.records=[]}}const y=[".apexcharts-bar-area",".apexcharts-candlestick-area",".apexcharts-boxPlot-area",".apexcharts-rangebar-area",".apexcharts-marker"].join(", "),_=[".apexcharts-pie-area",".apexcharts-bar-area"].join(", "),b="apexcharts-crossfilter-dimmed",x=["pie","donut","polarArea","radialBar"];o.default.registerFeatures({linkedViews:class{constructor(e,t){this.w=e,this.ctx=t,this._dimmed=!1,this._wired=!1,this._pending=!1,this._lastValues=null,this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onChange=this._onChange.bind(this),"filter"===this._mode()&&this._initEngine()}_mode(){const e=this.w.config.chart.link;return e&&"function"==typeof e.dimension?"filter":e&&e.enabled?"highlight":"off"}_enabled(){const e=this.w.config.chart.link;return!(!e||!e.enabled)}onSourceSelection(e){var t;const r=this._mode();if("off"===r)return;if(!e||null==e.min||null==e.max)return;let s=Math.min(e.min,e.max),i=Math.max(e.min,e.max);const n=this.w.globals.minX,a=this.w.globals.maxX;if(isFinite(n)&&isFinite(a)&&a>n){const e=1e-6*(a-n);s-n<=e&&(s=n),a-i<=e&&(i=a)}if("filter"===r){const e=this._cf();if(!e)return;return e.filter(this._chartId(),[s,i]),void this._fireFilterChange(e,[s,i])}this._group().forEach(e=>{var t;null==(t=null==e?void 0:e.linkedViews)||t.applyDim(s,i)});const o={xaxis:{min:s,max:i},sourceChartID:this.w.globals.chartID};"function"==typeof this.w.config.chart.events.crossFilter&&this.w.config.chart.events.crossFilter(this.ctx,o),null==(t=this.ctx.events)||t.fireEvent("crossFilter",[this.ctx,o])}_group(){const e="function"==typeof this.ctx.getGroupedCharts?this.ctx.getGroupedCharts():[];return[this.ctx,...e]}applyDim(e,t){if(!this._enabled())return;const r=this.w,s=r.dom.baseEl;if(!s)return;const i=r.config.chart.link.dimOpacity;r.dom.elWrap&&"number"==typeof i&&r.dom.elWrap.style.setProperty("--apx-cf-dim",String(i));const n=r.globals.seriesX||[];s.querySelectorAll(y).forEach(r=>{const s=r.getAttribute("j");if(null===s)return;const i=parseInt(s,10),a=r.getAttribute("index"),o=null===a?0:parseInt(a,10),l=n[o]||n[0];if(!l)return;const c=l[i];null!=c&&r.classList.toggle(b,c<e||c>t)}),this._dimmed=!0}clear(){const e=this.w.dom.baseEl;e&&(e.querySelectorAll("."+b).forEach(e=>e.classList.remove(b)),this._dimmed=!1)}clearGroup(){if("filter"===this._mode()){const e=this._cf();return void(e&&e.reset())}this._group().forEach(e=>{var t;return null==(t=null==e?void 0:e.linkedViews)?void 0:t.clear()})}_chartId(){return this.w.globals.chartID}_cf(){const e=this.w.config.chart.link,t=e&&(e.id||this.w.config.chart.group);return t?p.get(t):null}_isPie(){return-1!==x.indexOf(this.w.config.chart.type)}_isHeatmap(){return"heatmap"===this.w.config.chart.type}_initEngine(){const e=this._cf(),t=this.w.config.chart.link;if(!e){t&&t.id||this.w.config.chart.group;return}const r=this._chartId();e.hasDimension(r)||e.registerDimension(r,{dimension:t.dimension,reduce:t.reduce,type:t.type||(this._isHeatmap()?"matrix":void 0),bins:t.bins,order:t.order}),this._injectSeries(e.aggregateFor(r)),this._wire(e)}_seriesFromAgg(e){if("matrix"===e.type)return e.yLabels.map((t,r)=>({name:String(t),data:e.xLabels.map((t,s)=>({x:String(t),y:e.matrix[r][s]}))}));if(this._isPie())return e.values.slice();const t=this.w.config.chart.link.seriesName||"Count";return"range"===e.type?[{name:t,data:e.labels.map((t,r)=>[t,e.values[r]])}]:[{name:t,data:e.values.slice()}]}_sigOf(e){return JSON.stringify(e.matrix||e.values)}_injectSeries(e){const t=this.w;this._lastValues=this._sigOf(e),t.config.series=this._seriesFromAgg(e),"matrix"!==e.type&&(this._isPie()?t.config.labels=e.labels.map(String):"category"===e.type?(t.config.xaxis||(t.config.xaxis={}),t.config.xaxis.categories=e.labels.map(String)):"range"===e.type&&this._pinRangeDomain(e.edges))}_pinRangeDomain(e){if(!Array.isArray(e)||e.length<2)return;const t=this.w;t.config.xaxis||(t.config.xaxis={}),null==t.config.xaxis.min&&(t.config.xaxis.min=e[0]),null==t.config.xaxis.max&&(t.config.xaxis.max=e[e.length-1])}_wire(e){this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),e.on("change",this._onChange))}_onPointSelect(e,t,r){if("filter"!==this._mode()||!r||null==r.dataPointIndex)return;const s=this._cf();if(!s)return;const i=this._chartId(),n=s.aggregateFor(i);if("matrix"===n.type)return;const a=n.keys[r.dataPointIndex];null!=a&&(s.toggleKey(i,a),this._fireFilterChange(s,a))}_onChange(){"filter"!==this._mode()||this._pending||(this._pending=!0,Promise.resolve().then(()=>{this._pending=!1,this.w.globals.isDestroyed||this._applyAggregation()}))}_applyAggregation(){if("filter"!==this._mode())return;const e=this._cf();if(!e)return;const t=e.aggregateFor(this._chartId()),r=this._sigOf(t);r!==this._lastValues?(this._lastValues=r,this.ctx.updateSeries(this._seriesFromAgg(t),!0)):this._applySelfDim()}_afterRender(){if("filter"!==this._mode())return;const e=this.w.config.series;e&&0!==e.length?this._applySelfDim():this._reassertSeries()}_reassertSeries(){this._pending||(this._pending=!0,Promise.resolve().then(()=>{if(this._pending=!1,this.w.globals.isDestroyed)return;const e=this._cf();if(!e)return;const t=e.aggregateFor(this._chartId()),r=this._seriesFromAgg(t);r.length&&(this._lastValues=this._sigOf(t),this.ctx.updateSeries(r,!0))}))}_applySelfDim(){const e=this._cf();if(!e)return;const t=this.w,r=t.dom.baseEl;if(!r)return;const s=this._chartId(),i=e.filterOf(s),n=t.config.chart.link.dimOpacity;t.dom.elWrap&&"number"==typeof n&&t.dom.elWrap.style.setProperty("--apx-cf-dim",String(n));const a=i instanceof Set,o=Array.isArray(i),l=e.aggregateFor(s);if("matrix"===l.type)return;const c=l.keys;r.querySelectorAll(_).forEach(e=>{const t=e.getAttribute("j");if(null===t)return;const r=c[parseInt(t,10)];let s=!1;a?s=!i.has(r):o&&Array.isArray(r)&&(s=r[1]<=i[0]||r[0]>=i[1]),e.classList.toggle(b,s)}),this._dimmed=!!i}_fireFilterChange(e,o){var l;const c=(h=((e,t)=>{for(var r in t||(t={}))i.call(t,r)&&a(e,r,t[r]);if(s)for(var r of s(t))n.call(t,r)&&a(e,r,t[r]);return e})({},e.state()),f={sourceChartID:this._chartId(),key:o},t(h,r(f)));var h,f;const u=this.w.config.chart.events;"function"==typeof u.filterChange&&u.filterChange(this.ctx,c),null==(l=this.ctx.events)||l.fireEvent("filterChange",[this.ctx,c])}teardown(){var e,t,r,s,i,n;if(this.clear(),this._wired){null==(t=(e=this.ctx).removeEventListener)||t.call(e,"dataPointSelection",this._onPointSelect),null==(s=(r=this.ctx).removeEventListener)||s.call(r,"mounted",this._afterRender),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._afterRender);const a=this._cf();a&&(a.off("change",this._onChange),a.removeDimension(this._chartId())),this._wired=!1}}}});const w=o.default;w._crossfilterFactory=e=>p.getOrCreate(e),w._crossfilterGet=e=>p.get(e),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>o.default});