apexcharts 7.2.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 (172) 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 +1149 -801
  6. package/dist/apexcharts.js +684 -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 +684 -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 +364 -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 +180 -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 +57 -1
  168. package/src/modules/weave/WeaveHost.js +148 -0
  169. package/src/ssr/DOMShim.js +50 -0
  170. package/src/types/internal.d.ts +1 -1
  171. package/src/utils/Utils.js +6 -9
  172. package/types/apexcharts.d.ts +17 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.2.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const n in t)if("default"!==n){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),n=e.__apex_Utils,i=e.__apex_Options,a=["point","xaxis","yaxis"],s=[10,11,12,14,17,20],o=["circle","square","diamond","triangle"],r={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},l=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class c{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let n=t,i=1/0;for(let a=0;a<e.length;a++){const s=Math.abs(e[a]-t);s<i&&(i=s,n=e[a])}return n}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const n=this.w.globals.yAxisScale,i=n&&n[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const n="point"===t?"points":t;return Array.isArray(e[n])?e[n]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return a.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(a.forEach(n=>{this._annoList(n).forEach((i,a)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+n+"-"+a+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,n,a)),t.addEventListener("touchstart",t=>this._onDown(t,n,a)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(n,a,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,n){if(t.button&&0!==t.button)return;const i=this.w,a=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!a)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const s="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,r=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[n];let c="move",d=null,h=0,p=0;if("xaxis"===e&&null!=l.x2&&(d=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),d)){const t=d.getBoundingClientRect();Math.abs(s.clientX-t.left)<=8?c="resize-x1":Math.abs(s.clientX-t.right)<=8&&(c="resize-x2"),h=parseFloat(d.getAttribute("x"))||0,p=parseFloat(d.getAttribute("width"))||0}this._drag={type:e,index:n,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:d,origX:h,origW:p,startX:s.clientX,startY:s.clientY,scaleX:r&&r.a?r.a:1,scaleY:r&&r.d?r.d:1,dxPixel:0,dyPixel:0,moved:!1},a.addEventListener("mousemove",this._onMove),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const n="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(n.clientX-e.startX)/e.scaleX,e.dyPixel=(n.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,n;null==(n=null==(e=this.ctx.history)?void 0:e.snapshot)||n.call(e,t)}_applyDelta(t,e){const n=this.w,i=n.layout.gridWidth?t.dxPixel*(n.globals.xRange/n.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:a}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=a){const t=e.yAxisIndex||0,i=n.globals.seriesYAxisMap;e.y=this._snapY(a,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,a=n.globals.seriesYAxisMap,s=a&&a[i]?a[i][0]:0,o=n.globals.yRange?n.globals.yRange[s]:null;if(null==o||!n.layout.gridHeight)return;const r=-t.dyPixel*(o/n.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=r),e.y2+=r):"number"==typeof e.y&&(e.y=this._snapY(e.y+r,s))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const n=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!n:n)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,n){const i=this.w,a=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let s=t.x;!a&&"number"==typeof t.x&&i.layout.gridWidth&&(s=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const r=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,c=l&&l[r]?l[r][0]:0,d=i.globals.yRange?i.globals.yRange[c]:null,h=i.config.yaxis[r]&&i.config.yaxis[r].logarithmic;return"number"==typeof t.y&&null!=d&&!h&&i.layout.gridHeight&&(o=t.y-n*(d/i.layout.gridHeight)),{newX:s,newY:o}}_redrawAnno(t,e,n){const i=this.w.dom.baseEl,a=this.ctx.annotations;if(!i||!a)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const s=i.querySelector(".apexcharts-"+t+"-annotations");if(!s)return;"point"===t&&a.pointsAnnotations?a.pointsAnnotations.addPointAnnotation(e,s,n):"xaxis"===t&&a.xAxisAnnotations?a.xAxisAnnotations.addXaxisAnnotation(e,s,n):"yaxis"===t&&a.yAxisAnnotations&&a.yAxisAnnotations.addYaxisAnnotation(e,s,n);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&a.helpers&&e.label&&e.label.text){const t=a.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireAnnotationEvent(t,e){var n;const i=this.w.config.chart.events;"function"==typeof i[t]&&i[t](this.ctx,e),null==(n=this.ctx.events)||n.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,n){const i={type:t,id:e.id,index:n,x:e.x,y:e.y};null!=e.x2&&(i.x2=e.x2),null!=e.y2&&(i.y2=e.y2),this._fireAnnotationEvent("annotationDragged",i)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,a={}){const s=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+s.globals.chartID,r=n.extend((new i).pointAnnotation,{x:t,y:e,id:o,draggable:!0,label:{text:a.text||"Note"}});s.config.annotations||(s.config.annotations={}),Array.isArray(s.config.annotations.points)||(s.config.annotations.points=[]),s.config.annotations.points.push(r);const l=s.config.annotations.points.length-1;return this._redrawAnno("point",r,l),this._checkpoint("ink:create"),this._fireCreated("point",r,l),this._startEdit("point",l,{select:!0}),r}createLineAt(t,e,a={}){const s=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+s.globals.chartID,r="y"===t?"yaxis":"xaxis",l="yaxis"===r?(new i).yAxisAnnotation:(new i).xAxisAnnotation,c={id:o,draggable:!0,strokeDashArray:null!=a.strokeDashArray?a.strokeDashArray:4,label:{text:a.text||""}};a.color&&(c.borderColor=a.color,c.label.borderColor=a.color),"yaxis"===r?c.y=e:c.x=e;const d=n.extend(l,c);s.config.annotations||(s.config.annotations={}),Array.isArray(s.config.annotations[r])||(s.config.annotations[r]=[]),s.config.annotations[r].push(d);const h=s.config.annotations[r].length-1;return this._redrawAnno(r,d,h),this._checkpoint("ink:create"),this._fireCreated(r,d,h),!1!==a.select&&this._startEdit(r,h,{select:!0}),d}_pixelToData(t,e){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const s=(t-a.left)/a.width,o=(e-a.top)/a.height;let r=n.globals.minX+s*n.globals.xRange;const l=(n.globals.minYArr&&null!=n.globals.minYArr[0]?n.globals.minYArr[0]:n.globals.minY)+(1-o)*(n.globals.yRange&&null!=n.globals.yRange[0]?n.globals.yRange[0]:n.globals.maxY-n.globals.minY);return("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric&&(r=Math.round(r)),{x:r,y:l}}_fireCreated(t,e,n){const i={type:t,id:e.id,index:n};void 0!==e.x&&(i.x=e.x),void 0!==e.y&&(i.y=e.y),this._fireAnnotationEvent("annotationCreated",i)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,n=e.createElement("div");n.className="apexcharts-ink-palette";const i=n.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const a=e.createElement("button");a.type="button",a.className="apexcharts-ink-add",a.textContent="+ Note";const s=a.style;s.cursor="pointer",s.font="12px sans-serif",s.padding="4px 9px",s.borderRadius="5px",s.border="1px solid #6366f1",s.color="#4338ca",s.background="#fff",a.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),n.appendChild(a),t.appendChild(n),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:l}static _isLight(t){const e=String(t||"").replace("#",""),n=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(n,16);if(isNaN(i)||6!==n.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,n,i,a,s){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(a?" "+a:""),o.title=n,o.setAttribute("aria-label",n),s?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const n=t.createElement("span");return n.className="apexcharts-ink-cardlabel",n.textContent=e,n}_mkSwatch(t,e,n,i){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-swatch"+(i?" "+i:""),a.title=e,a.setAttribute("aria-label","Color "+e),a.dataset.color=e,a.style.background=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),n(e)}),a}_startEdit(t,e,n={}){const i=this.w,a=this._annoList(t)[e],s=i.dom.baseEl,o=i.dom.elWrap;if(!(a&&a.id&&s&&o))return;this._closeEditor(!1);const l=s.ownerDocument,c=l.createElement("div");c.className="apexcharts-ink-card",c.setAttribute("role","dialog"),c.setAttribute("aria-label","Edit note"),c.style.visibility="hidden";const d=l.createElement("div");d.className="apexcharts-ink-card-row";const h=l.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=a.label&&a.label.text||"",d.appendChild(h),d.appendChild(this._cardBtn(l,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),c.appendChild(d);const p=l.createElement("div");p.className="apexcharts-ink-card-row","point"!==t&&p.appendChild(this._cardLabel(l,"Label")),this._noteColors().forEach(t=>{p.appendChild(this._mkSwatch(l,t,t=>this._applyColor(t)))});const _=l.createElement("span");if(_.className="apexcharts-ink-sep",p.appendChild(_),p.appendChild(this._cardBtn(l,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),p.appendChild(this._cardBtn(l,"A-","Smaller text",()=>this._stepFont(-1))),p.appendChild(this._cardBtn(l,"A+","Larger text",()=>this._stepFont(1))),c.appendChild(p),"point"!==t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(l,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),c.appendChild(t)}if("point"===t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Marker")),t.appendChild(this._cardBtn(l,"-","Smaller marker",()=>this._stepMarker(-1)));const e=l.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(l,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(l,r.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),c.appendChild(t)}o.appendChild(c),this._editor={card:c,input:h,type:t,index:e},this._positionCard(),this._syncCard(),c.style.visibility="",h.focus(),n.select&&h.select(),c.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),l.addEventListener("mousedown",this._onDocDownEditor,!0),l.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,n=e.dom.baseEl,i=e.dom.elWrap,a=this._annoList(t.type)[t.index];if(!n||!i||!a)return;const s=n.querySelector(".apexcharts-"+t.type+"-annotation-label."+a.id)||n.querySelector("."+a.id);if(!s)return;const o=i.getBoundingClientRect(),r=s.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let d=Math.round(r.left-o.left),h=Math.round(r.bottom-o.top)+8;h+c>i.clientHeight-4&&(h=Math.round(r.top-o.top)-c-8),d+l>i.clientWidth-4&&(d=i.clientWidth-l-4),t.card.style.left=Math.max(4,d)+"px",t.card.style.top=Math.max(4,h)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const n=e.label&&e.label.style||{},i=String(n.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const a=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===a)});const s=t.card.querySelector(".apexcharts-ink-btn--bold");s&&s.classList.toggle("apexcharts-ink-btn--active",c._isBold(n));const o=e.marker||{},l=t.card.querySelector(".apexcharts-ink-marker-size");l&&(l.textContent=String("number"==typeof o.size?o.size:4));const d=t.card.querySelector(".apexcharts-ink-btn--shape");d&&(d.textContent=r[o.shape]||r.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const n=t.input.value;e.label||(e.label={}),e.label.text!==n&&(e.label.text=n,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const n=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;n&&(n.removeEventListener("mousedown",this._onDocDownEditor,!0),n.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const n=this._editor;if(!n)return;const i=this._annoList(n.type)[n.index];i&&(this._commitTextOf(n),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(n.type,i,n.index),this._checkpoint(t),this._fireStyled(n.type,i,n.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const n=c._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=n?"#334155":"#ffffff",i.label.borderColor=n?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=n?"#334155":t,i.marker.fillColor=n?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const n=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<s.length;t++)Math.abs(s[t]-n)<Math.abs(s[i]-n)&&(i=t);i=Math.min(s.length-1,Math.max(0,i+t)),e.label.style.fontSize=s[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=c._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const n="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,n+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=o.indexOf(t.marker.shape);t.marker.shape=o[(e+1)%o.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),n=e[t.index];if(this._closeEditor(!1),!n)return;const i=this.w.dom.baseEl;i&&n.id&&i.querySelectorAll("."+n.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let n=t.index;n<e.length;n++)this._redrawAnno(t.type,e[n],n);this._checkpoint("ink:delete"),this._fireDeleted(t.type,n,t.index)}_fireEdited(t,e,n){const i={type:t,id:e.id,index:n,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",i)}_fireStyled(t,e,n){const i={type:t,id:e.id,index:n,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",i)}_fireDeleted(t,e,n){const i={type:t,id:e.id,index:n};this._fireAnnotationEvent("annotationDeleted",i)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,n,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(n=this.ctx).removeEventListener)||i.call(n,"updated",this._onRerender),this._wired=!1)}}e.default.registerFeatures({ink:c}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.2.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.2.0
2
+ * ApexCharts v7.4.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
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).ApexInk={})}(this,function(t){"use strict";const e=globalThis.ApexCharts,n=globalThis.ApexCharts.__internals.__apex_Utils,i=globalThis.ApexCharts.__internals.__apex_Options,s=["point","xaxis","yaxis"],a=[10,11,12,14,17,20],o=["circle","square","diamond","triangle"],r={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},l=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class c{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let n=t,i=1/0;for(let s=0;s<e.length;s++){const a=Math.abs(e[s]-t);a<i&&(i=a,n=e[s])}return n}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const n=this.w.globals.yAxisScale,i=n&&n[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const n="point"===t?"points":t;return Array.isArray(e[n])?e[n]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return s.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(s.forEach(n=>{this._annoList(n).forEach((i,s)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+n+"-"+s+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,n,s)),t.addEventListener("touchstart",t=>this._onDown(t,n,s)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(n,s,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,n){if(t.button&&0!==t.button)return;const i=this.w,s=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!s)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const a="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,r=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[n];let c="move",d=null,h=0,p=0;if("xaxis"===e&&null!=l.x2&&(d=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),d)){const t=d.getBoundingClientRect();Math.abs(a.clientX-t.left)<=8?c="resize-x1":Math.abs(a.clientX-t.right)<=8&&(c="resize-x2"),h=parseFloat(d.getAttribute("x"))||0,p=parseFloat(d.getAttribute("width"))||0}this._drag={type:e,index:n,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:d,origX:h,origW:p,startX:a.clientX,startY:a.clientY,scaleX:r&&r.a?r.a:1,scaleY:r&&r.d?r.d:1,dxPixel:0,dyPixel:0,moved:!1},s.addEventListener("mousemove",this._onMove),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const n="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(n.clientX-e.startX)/e.scaleX,e.dyPixel=(n.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,n;null==(n=null==(e=this.ctx.history)?void 0:e.snapshot)||n.call(e,t)}_applyDelta(t,e){const n=this.w,i=n.layout.gridWidth?t.dxPixel*(n.globals.xRange/n.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:s}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=s){const t=e.yAxisIndex||0,i=n.globals.seriesYAxisMap;e.y=this._snapY(s,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,s=n.globals.seriesYAxisMap,a=s&&s[i]?s[i][0]:0,o=n.globals.yRange?n.globals.yRange[a]:null;if(null==o||!n.layout.gridHeight)return;const r=-t.dyPixel*(o/n.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=r),e.y2+=r):"number"==typeof e.y&&(e.y=this._snapY(e.y+r,a))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const n=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!n:n)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,n){const i=this.w,s=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let a=t.x;!s&&"number"==typeof t.x&&i.layout.gridWidth&&(a=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const r=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,c=l&&l[r]?l[r][0]:0,d=i.globals.yRange?i.globals.yRange[c]:null,h=i.config.yaxis[r]&&i.config.yaxis[r].logarithmic;return"number"==typeof t.y&&null!=d&&!h&&i.layout.gridHeight&&(o=t.y-n*(d/i.layout.gridHeight)),{newX:a,newY:o}}_redrawAnno(t,e,n){const i=this.w.dom.baseEl,s=this.ctx.annotations;if(!i||!s)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const a=i.querySelector(".apexcharts-"+t+"-annotations");if(!a)return;"point"===t&&s.pointsAnnotations?s.pointsAnnotations.addPointAnnotation(e,a,n):"xaxis"===t&&s.xAxisAnnotations?s.xAxisAnnotations.addXaxisAnnotation(e,a,n):"yaxis"===t&&s.yAxisAnnotations&&s.yAxisAnnotations.addYaxisAnnotation(e,a,n);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&s.helpers&&e.label&&e.label.text){const t=s.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireAnnotationEvent(t,e){var n;const i=this.w.config.chart.events;"function"==typeof i[t]&&i[t](this.ctx,e),null==(n=this.ctx.events)||n.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,n){const i={type:t,id:e.id,index:n,x:e.x,y:e.y};null!=e.x2&&(i.x2=e.x2),null!=e.y2&&(i.y2=e.y2),this._fireAnnotationEvent("annotationDragged",i)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,r=n.extend((new i).pointAnnotation,{x:t,y:e,id:o,draggable:!0,label:{text:s.text||"Note"}});a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations.points)||(a.config.annotations.points=[]),a.config.annotations.points.push(r);const l=a.config.annotations.points.length-1;return this._redrawAnno("point",r,l),this._checkpoint("ink:create"),this._fireCreated("point",r,l),this._startEdit("point",l,{select:!0}),r}createLineAt(t,e,s={}){const a=this.w;this._wire(),this._createSeq+=1;const o="apexcharts-ink-new-"+this._createSeq+"-"+a.globals.chartID,r="y"===t?"yaxis":"xaxis",l="yaxis"===r?(new i).yAxisAnnotation:(new i).xAxisAnnotation,c={id:o,draggable:!0,strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4,label:{text:s.text||""}};s.color&&(c.borderColor=s.color,c.label.borderColor=s.color),"yaxis"===r?c.y=e:c.x=e;const d=n.extend(l,c);a.config.annotations||(a.config.annotations={}),Array.isArray(a.config.annotations[r])||(a.config.annotations[r]=[]),a.config.annotations[r].push(d);const h=a.config.annotations[r].length-1;return this._redrawAnno(r,d,h),this._checkpoint("ink:create"),this._fireCreated(r,d,h),!1!==s.select&&this._startEdit(r,h,{select:!0}),d}_pixelToData(t,e){const n=this.w,i=n.dom.baseEl&&n.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const s=i.getBoundingClientRect();if(!s.width||!s.height)return null;const a=(t-s.left)/s.width,o=(e-s.top)/s.height;let r=n.globals.minX+a*n.globals.xRange;const l=(n.globals.minYArr&&null!=n.globals.minYArr[0]?n.globals.minYArr[0]:n.globals.minY)+(1-o)*(n.globals.yRange&&null!=n.globals.yRange[0]?n.globals.yRange[0]:n.globals.maxY-n.globals.minY);return("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric&&(r=Math.round(r)),{x:r,y:l}}_fireCreated(t,e,n){const i={type:t,id:e.id,index:n};void 0!==e.x&&(i.x=e.x),void 0!==e.y&&(i.y=e.y),this._fireAnnotationEvent("annotationCreated",i)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,n=e.createElement("div");n.className="apexcharts-ink-palette";const i=n.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const s=e.createElement("button");s.type="button",s.className="apexcharts-ink-add",s.textContent="+ Note";const a=s.style;a.cursor="pointer",a.font="12px sans-serif",a.padding="4px 9px",a.borderRadius="5px",a.border="1px solid #6366f1",a.color="#4338ca",a.background="#fff",s.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),n.appendChild(s),t.appendChild(n),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:l}static _isLight(t){const e=String(t||"").replace("#",""),n=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(n,16);if(isNaN(i)||6!==n.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,n,i,s,a){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(s?" "+s:""),o.title=n,o.setAttribute("aria-label",n),a?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const n=t.createElement("span");return n.className="apexcharts-ink-cardlabel",n.textContent=e,n}_mkSwatch(t,e,n,i){const s=t.createElement("button");return s.type="button",s.className="apexcharts-ink-swatch"+(i?" "+i:""),s.title=e,s.setAttribute("aria-label","Color "+e),s.dataset.color=e,s.style.background=e,s.addEventListener("mousedown",t=>t.preventDefault()),s.addEventListener("click",t=>{t.stopPropagation(),n(e)}),s}_startEdit(t,e,n={}){const i=this.w,s=this._annoList(t)[e],a=i.dom.baseEl,o=i.dom.elWrap;if(!(s&&s.id&&a&&o))return;this._closeEditor(!1);const l=a.ownerDocument,c=l.createElement("div");c.className="apexcharts-ink-card",c.setAttribute("role","dialog"),c.setAttribute("aria-label","Edit note"),c.style.visibility="hidden";const d=l.createElement("div");d.className="apexcharts-ink-card-row";const h=l.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=s.label&&s.label.text||"",d.appendChild(h),d.appendChild(this._cardBtn(l,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),c.appendChild(d);const p=l.createElement("div");p.className="apexcharts-ink-card-row","point"!==t&&p.appendChild(this._cardLabel(l,"Label")),this._noteColors().forEach(t=>{p.appendChild(this._mkSwatch(l,t,t=>this._applyColor(t)))});const _=l.createElement("span");if(_.className="apexcharts-ink-sep",p.appendChild(_),p.appendChild(this._cardBtn(l,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),p.appendChild(this._cardBtn(l,"A-","Smaller text",()=>this._stepFont(-1))),p.appendChild(this._cardBtn(l,"A+","Larger text",()=>this._stepFont(1))),c.appendChild(p),"point"!==t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(l,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),c.appendChild(t)}if("point"===t){const t=l.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(l,"Marker")),t.appendChild(this._cardBtn(l,"-","Smaller marker",()=>this._stepMarker(-1)));const e=l.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(l,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(l,r.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),c.appendChild(t)}o.appendChild(c),this._editor={card:c,input:h,type:t,index:e},this._positionCard(),this._syncCard(),c.style.visibility="",h.focus(),n.select&&h.select(),c.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),l.addEventListener("mousedown",this._onDocDownEditor,!0),l.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,n=e.dom.baseEl,i=e.dom.elWrap,s=this._annoList(t.type)[t.index];if(!n||!i||!s)return;const a=n.querySelector(".apexcharts-"+t.type+"-annotation-label."+s.id)||n.querySelector("."+s.id);if(!a)return;const o=i.getBoundingClientRect(),r=a.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let d=Math.round(r.left-o.left),h=Math.round(r.bottom-o.top)+8;h+c>i.clientHeight-4&&(h=Math.round(r.top-o.top)-c-8),d+l>i.clientWidth-4&&(d=i.clientWidth-l-4),t.card.style.left=Math.max(4,d)+"px",t.card.style.top=Math.max(4,h)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const n=e.label&&e.label.style||{},i=String(n.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const s=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===s)});const a=t.card.querySelector(".apexcharts-ink-btn--bold");a&&a.classList.toggle("apexcharts-ink-btn--active",c._isBold(n));const o=e.marker||{},l=t.card.querySelector(".apexcharts-ink-marker-size");l&&(l.textContent=String("number"==typeof o.size?o.size:4));const d=t.card.querySelector(".apexcharts-ink-btn--shape");d&&(d.textContent=r[o.shape]||r.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const n=t.input.value;e.label||(e.label={}),e.label.text!==n&&(e.label.text=n,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const n=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;n&&(n.removeEventListener("mousedown",this._onDocDownEditor,!0),n.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const n=this._editor;if(!n)return;const i=this._annoList(n.type)[n.index];i&&(this._commitTextOf(n),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(n.type,i,n.index),this._checkpoint(t),this._fireStyled(n.type,i,n.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const n=c._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=n?"#334155":"#ffffff",i.label.borderColor=n?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=n?"#334155":t,i.marker.fillColor=n?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const n=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<a.length;t++)Math.abs(a[t]-n)<Math.abs(a[i]-n)&&(i=t);i=Math.min(a.length-1,Math.max(0,i+t)),e.label.style.fontSize=a[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=c._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const n="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,n+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=o.indexOf(t.marker.shape);t.marker.shape=o[(e+1)%o.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),n=e[t.index];if(this._closeEditor(!1),!n)return;const i=this.w.dom.baseEl;i&&n.id&&i.querySelectorAll("."+n.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let n=t.index;n<e.length;n++)this._redrawAnno(t.type,e[n],n);this._checkpoint("ink:delete"),this._fireDeleted(t.type,n,t.index)}_fireEdited(t,e,n){const i={type:t,id:e.id,index:n,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",i)}_fireStyled(t,e,n){const i={type:t,id:e.id,index:n,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",i)}_fireDeleted(t,e,n){const i={type:t,id:e.id,index:n};this._fireAnnotationEvent("annotationDeleted",i)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,n,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(n=this.ctx).removeEventListener)||i.call(n,"updated",this._onRerender),this._wired=!1)}}e.registerFeatures({ink:c}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.2.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.2.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.2.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.2.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.2.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.2.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"}})});