apexcharts 8.2.0 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
package/dist/violin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/violin.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/violin.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/violin.js",run:t,done:!1},n=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);n.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var o=n.indexOf(s);-1!==o&&n.splice(o,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/violin.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/violin.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/violin.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/violin.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";const e=globalThis.ApexCharts,i=globalThis.ApexCharts.__internals.__apex_CoreUtils,s=globalThis.ApexCharts.__internals;s.__apex_ChartFactory_register;const n=s.__apex_ChartFactory_getChartClass;s.__apex_ChartFactory_isCustom;const o=globalThis.ApexCharts.__internals.__apex_Fill,a=globalThis.ApexCharts.__internals.__apex_Graphics,r=globalThis.ApexCharts.__internals.__apex_Series,l=globalThis.ApexCharts.__internals.__apex_Utils,h=t=>{const e=function(t){const e=[];let i=t[0],s=t[1],n=e[0]=d(i,s),o=1;for(let a=t.length-1;o<a;o++)i=s,s=t[o+1],e[o]=.5*(n+(n=d(i,s)));return e[o]=n,e}(t),i=t.length-1,s=[];let n,o,a,r;for(let s=0;s<i;s++)a=d(t[s],t[s+1]),Math.abs(a)<1e-6?e[s]=e[s+1]=0:(n=e[s]/a,o=e[s+1]/a,r=n*n+o*o,r>9&&(r=3*a/Math.sqrt(r),e[s]=r*n,e[s+1]=r*o));for(let n=0;n<=i;n++)r=(t[Math.min(i,n+1)][0]-t[Math.max(0,n-1)][0])/(6*(1+e[n]*e[n])),s.push([r||0,e[n]*r||0]);return s},c={points(t){const e=h(t),i=t[1],s=t[0],n=[],o=e[1],a=e[0];n.push(s,[s[0]+a[0],s[1]+a[1],i[0]-o[0],i[1]-o[1],i[0],i[1]]);for(let i=2,s=e.length;i<s;i++){const s=t[i],o=e[i];n.push([s[0]-o[0],s[1]-o[1],s[0],s[1]])}return n},slice(t,e,i){const s=t.slice(e,i);if(e){if(i-e>1&&s[1].length<6){const t=s[0].length;s[1]=[2*s[0][t-2]-s[0][t-4],2*s[0][t-1]-s[0][t-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function d(t,e){return(e[1]-t[1])/(e[0]-t[0])}function u({graphics:t,w:e,elSeries:i,pointsByCat:s,options:n,distributed:o,realIndex:a,wrapClass:r,pointClass:l}){if(!n||!1===n.show||!s.length)return;const h=null!=n.opacity?n.opacity:.9,c=null!=n.strokeColor?n.strokeColor:"#fff",d=null!=n.strokeWidth?n.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,x=t.group({class:u?`${r} apexcharts-element-hidden`:r});u&&e.globals.delayedElements.push({el:x.node}),s.forEach(({groups:i,j:s})=>{const r=o?e.globals.colors[s]:e.globals.colors[a],u=n.fillColor,g="series"===u?r:"series-dark"===u?p(r,.45):u||p(r,.45);i.forEach(i=>{const n=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:g,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});n.attr("data:realIndex",a),n.attr("j",s),n.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),n.node.style.pointerEvents="none",x.add(n)})}),i.add(x)}function p(t,e){const i=l.parseHex(t);if(!i)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(i[0]*s)},${Math.round(i[1]*s)},${Math.round(i[2]*s)})`}function x(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(i),n=i-s,o=l.parseHex(t[s])||[0,0,0],a=l.parseHex(t[Math.min(s+1,t.length-1)])||o,r=(t,e)=>Math.round(t+(e-t)*n);return`rgb(${r(o[0],a[0])},${r(o[1],a[1])},${r(o[2],a[2])})`}function g(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function f(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function b(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const v=class{};class m extends v{constructor(t,e,i){!function(){const t=n("bar");Object.getPrototypeOf(m)!==t&&(Object.setPrototypeOf(m,t),Object.setPrototypeOf(m.prototype,t.prototype))}(),super(t,e,i)}draw(t,e,s){var n,h,c;const d=this.w,p=new a(this.w),x=new o(this.w);this.violinOptions=d.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.boxOptions=this.violinOptions.box||{},this.cloudSign=y(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:y(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?P(this.boxOptions.width,.15):0,this.rainFrac=P(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=d.config.plotOptions.bar.distributed,this.isHorizontal=d.config.plotOptions.bar.horizontal,this.coreUtils=new i(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const g=p.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let i,o;const a=[],f=[],b=d.globals.comboCharts?s[e]:e,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(b),m=p.group({class:"apexcharts-series",seriesName:l.escapeString(d.seriesData.seriesNames[b]),rel:e+1,"data:realIndex":b});r.addCollapsedClassToSeries(this.w,m,b),t[e].length>0&&(this.visibleI=this.visibleI+1);const w=this.setSeriesAxis(b),y=this.barHelpers.initialPositions(b),{y:P,barHeight:C,yDivision:S,zeroW:_,x:M,barWidth:F,xDivision:W,zeroH:O}=y;o=P,i=M,f.push(i+(null!=F?F:0)/2);const j=p.group({class:"apexcharts-datalabels","data:realIndex":b});this.seriesMaxWeight=0,"group"===this.normalize&&(d.violinData.seriesViolinDensity[b]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)});const H=[];for(let s=0;s<d.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,b),l=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:s,realIndex:b,translationsIndex:w},y:o,yDivision:S,barHeight:C,zeroW:_}):this.drawVerticalViolin({indexes:{i:e,j:s,realIndex:b,translationsIndex:w},x:i,xDivision:W,barWidth:F,zeroH:O});i=l.x,o=l.y,s>0&&f.push(l.center),a.push(l.alongRepresentative);const u=this.buildPointsSubPath({realIndex:b,j:s,center:l.center,halfExtent:l.halfExtent,alongFn:l.alongFn,density:l.density,maxWeight:l.maxWeight,cloudBase:l.cloudBase,cloudMaxPx:l.cloudMaxPx,rainCenter:l.rainCenter,rainHalfPx:l.rainHalfPx});u.length&&H.push({groups:u,j:s});const p=x.fillPath({seriesNumber:this.distributed?s:b,dataPointIndex:s,color:this.distributed?d.globals.colors[s]:void 0,value:t[e][s]});this.renderSeries({realIndex:b,pathFill:p,lineFill:d.globals.stroke.colors[b],j:s,i:e,pathFrom:l.pathFrom,pathTo:l.pathTo,strokeWidth:r,elSeries:m,x:i,y:o,series:t,columnGroupIndex:v,barHeight:C,barWidth:F,elDataLabelsWrap:j,visibleSeries:this.visibleI,type:"violin"});const g=m.node.querySelector(`path.apexcharts-violin-area[j='${s}']`);if(g&&isFinite(l.alongRepresentative)&&g.setAttribute(this.isHorizontal?"cx":"cy",`${l.alongRepresentative}`),g&&g.setAttribute("data:center",`${l.center}`),l.boxPaths){const a=null!=(n=this.boxOptions.strokeWidth)?n:1;l.boxPaths.forEach(n=>{this.renderSeries({realIndex:b,pathFill:n.filled?this.boxOptions.fillColor||p:"none",lineFill:d.globals.stroke.colors[b],j:s,i:e,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:a,elSeries:m,x:i,y:o,series:t,columnGroupIndex:v,barHeight:C,barWidth:F,elDataLabelsWrap:j,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box"})})}const y=!g&&(null==(c=null==(h=d.globals.barCanvasCoords)?void 0:h[b])?void 0:c[s]);y&&isFinite(l.alongRepresentative)&&(this.isHorizontal?y.cx=l.alongRepresentative:(y.bodyCx=y.cx,y.cx=l.center,y.cy=l.alongRepresentative))}u({graphics:p,w:d,elSeries:m,pointsByCat:H,options:this.pointsOptions,distributed:this.distributed,realIndex:b,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),d.globals.seriesXvalues[b]=f,d.globals.seriesYvalues[b]=a,g.add(m)}return g}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:n}){var o,a,r,l,h,c,d;const u=this.w,{realIndex:p,j:x,translationsIndex:g}=t,f=this.yRatio[g];u.axisFlags.isXNumeric&&(e=(u.seriesData.seriesX[p][x]-u.globals.minX)/this.xRatio-s/2);const b=e+s*this.visibleI+s/2,v=s/2,m=this.getDensity(p,x),w=this.effectiveMaxWeight(m),y=t=>n-this.logVal(t,p)/f,P=C({halfExtent:v,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(r=this.boxFrac)?r:0,rainFrac:null!=(l=this.rainFrac)?l:0}),S=b+P.cloudBaseOff,_=this.buildBodyPath({nodes:m.nodes,center:S,halfExtent:P.cloudMaxPx,maxWeight:w,vertical:!0,alongFn:y,collapsed:!1,sideSign:this.cloudSign});let M=null;const F=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(p,x);return F?M=F:u.globals.previousPaths.length>0&&(M=this.getPreviousPath(p,x,_)),null==M&&(M=this.buildBodyPath({nodes:m.nodes,center:S,halfExtent:P.cloudMaxPx,maxWeight:w,vertical:!0,alongFn:y,collapsed:!0,sideSign:this.cloudSign})),u.axisFlags.isXNumeric||(e+=i),{pathTo:_,pathFrom:M,x:e,y:n,center:b,halfExtent:v,alongFn:y,density:m,maxWeight:w,cloudBase:S,cloudMaxPx:P.cloudMaxPx,rainCenter:b+P.rainCenterOff,rainHalfPx:P.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:x,boxCenter:b+P.boxCenterOff,boxHalfPx:P.boxHalfPx,alongFn:y,vertical:!0}),alongRepresentative:y(null!=(d=this.series[t.i][x])?d:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:n}){var o,a,r,l,h,c,d;const u=this.w,{realIndex:p,j:x}=t,g=this.invertedYRatio,f=e+s*this.visibleI+s/2,b=s/2,v=this.getDensity(p,x),m=this.effectiveMaxWeight(v),w=t=>n+this.logVal(t,p)/g,y=C({halfExtent:b,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(r=this.boxFrac)?r:0,rainFrac:null!=(l=this.rainFrac)?l:0}),P=f+y.cloudBaseOff,S=this.buildBodyPath({nodes:v.nodes,center:P,halfExtent:y.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:w,collapsed:!1,sideSign:this.cloudSign});let _=null;const M=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(p,x);return M?_=M:u.globals.previousPaths.length>0&&(_=this.getPreviousPath(p,x,S)),null==_&&(_=this.buildBodyPath({nodes:v.nodes,center:P,halfExtent:y.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:w,collapsed:!0,sideSign:this.cloudSign})),{pathTo:S,pathFrom:_,x:n,y:e+=i,center:f,halfExtent:b,alongFn:w,maxWeight:m,density:v,cloudBase:P,cloudMaxPx:y.cloudMaxPx,rainCenter:f+y.rainCenterOff,rainHalfPx:y.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:x,boxCenter:f+y.boxCenterOff,boxHalfPx:y.boxHalfPx,alongFn:w,vertical:!1}),alongRepresentative:w(null!=(d=this.series[t.i][x])?d:0)}}getDensity(t,e){var i;const s=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!s||!s.values.length)return{nodes:[],maxWeight:0};const n=s.values.map((t,e)=>e);n.sort((t,e)=>s.values[t]-s.values[e]);const o=[];let a=null;for(const t of n){const e=s.values[t];null!==a&&e===a||(o.push({v:e,w:s.weights[t]}),a=e)}return{nodes:o,maxWeight:s.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:s,vertical:n,alongFn:o,collapsed:r,sideSign:l=0}){const h=new a(this.w);if(0===t.length){const t=o(0);return n?h.move(e,t)+h.line(e,t):h.move(t,e)+h.line(t,e)}const c=t=>{if(r||s<=0)return 0;const e=t/s*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},d=[],u=[];for(let i=0;i<t.length;i++){const s=o(t[i].v),a=c(t[i].w),r=0===l?e+a:e+l*a,h=0===l?e-a:e;n?(d.push([r,s]),u.push([h,s])):(d.push([s,r]),u.push([s,h]))}return u.reverse(),this.smoothSegment(d,n,!1)+this.smoothSegment(u,n,!0)+"z"}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:s,alongFn:n,vertical:o}){var r,l;const h=this.w;if(!this.boxShown||s<=0)return null;const c=null==(r=h.violinData.seriesViolinSummary[t])?void 0:r[e];if(!c)return null;const d=s*Math.min(1,Math.max(0,null!=(l=this.boxOptions.capWidth)?l:.5)),[u,p,x,g,f]=c.map(t=>n(t)),b=(t,e)=>{const s=new a(this.w),n=(t,e)=>o?[t,e]:[e,t],r=t=>t.map(([t,e],i)=>0===i?s.move(t,e):s.line(t,e)).join(""),l=i;return{whiskers:r([n(l,u),n(l,p)])+r([n(l,g),n(l,f)])+r([n(l-t,u),n(l+t,u)])+r([n(l-t,f),n(l+t,f)]),box:r([n(l-e,p),n(l+e,p),n(l+e,g),n(l-e,g)])+"z"+r([n(l-e,x),n(l+e,x)])}},v=b(d,s),m=b(0,0),w=(i,s)=>{let n=null;return h.globals.previousPaths.length>0&&(n=this.getPreviousPath(t,e,i)),null==n?s:n};return[{pathTo:v.whiskers,pathFrom:w(v.whiskers,m.whiskers),filled:!1},{pathTo:v.box,pathFrom:w(v.box,m.box),filled:!0}]}smoothSegment(t,e,i){const s=new a(this.w),n=t[0];let o=i?s.line(n[0],n[1]):s.move(n[0],n[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)o+=s.line(t[e][0],t[e][1]);return o}const r=t.map(([t,i])=>e?[i,t]:[t,i]),l=c.points(r);return o+=(t=>{let e="";for(let i=0;i<t.length;i++){const s=t[i],n=s.length;n>4?(e+=`C${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`,e+=`, ${s[4]}, ${s[5]}`):n>2&&(e+=`S${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`)}return e})(e?l.map(w):l),o}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:s,alongFn:n,density:o,maxWeight:a,cloudBase:r,cloudMaxPx:l,rainCenter:h,rainHalfPx:c}){var d;const u=0!==this.rainSign,p=u?h:0!==this.cloudSign?r:i,v=u?c:0!==this.cloudSign?l:s;return function({w:t,points:e,seedA:i,seedB:s,center:n,halfExtent:o,alongFn:a,isHorizontal:r,options:l,clampAt:h,sideSign:c}){const d=l;if(!d||!1===d.show)return[];if(!e||!e.length)return[];const u=d.maxPoints||3e3,p=e.length>u?Math.ceil(e.length/u):1,v=null!=d.size?d.size:2.5,m=o*(null!=d.jitter?d.jitter:.5),w=!1!==d.constrainToViolin&&"function"==typeof h,y="square"===d.shape,P=d.colorScale,C=P&&Array.isArray(P.colors)&&P.colors.length>0,S=C?Math.max(2,P.steps||24):1,_=C&&null!=P.min?P.min:t.globals.minY,M=(C&&null!=P.max?P.max:t.globals.maxY)-_||1,F=C?new Array(S).fill(""):[""];for(let t=0;t<e.length;t+=p){const o=e[t],l=a(o);let d=2*(g(7919*i+100003*s+t)-.5)*m;if(w){const t=h(o);d>t&&(d=t),d<-t&&(d=-t)}c&&(d=Math.abs(d)*c);const u=r?l:n+d,p=r?n+d:l,x=y?b(u,p,v):f(u,p,v);if(C){let t=(o-_)/M;t<0&&(t=0),t>1&&(t=1),F[Math.round(t*(S-1))]+=x}else F[0]+=x}if(!C)return F[0]?[{fill:null,d:F[0]}]:[];const W=[];for(let t=0;t<S;t++)F[t]&&W.push({fill:x(P.colors,t/(S-1)),d:F[t]});return W}({w:this.w,points:null==(d=this.w.violinData.seriesViolinPoints[t])?void 0:d[e],seedA:t,seedB:e,center:p,halfExtent:v,alongFn:n,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:u?null:t=>this.halfWidthAtValue(t,o,v,a),sideSign:u?0:this.cloudSign})}halfWidthAtValue(t,e,i,s){const{nodes:n}=e,o=null!=s?s:e.maxWeight;if(!n.length||o<=0)return 0;const a=t=>Math.min(i,t/o*i*this.bandwidthScale);if(t<=n[0].v)return a(n[0].w);if(t>=n[n.length-1].v)return a(n[n.length-1].w);for(let e=1;e<n.length;e++)if(t<=n[e].v){const i=n[e-1],s=n[e],o=s.v===i.v?0:(t-i.v)/(s.v-i.v);return a(i.w+(s.w-i.w)*o)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function w(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function y(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function P(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function C({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:s,rainFrac:n}){const o=s*t,a=0===i?t:n*t,r=0===i?0:i*(t-a);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:o,rainCenterOff:r,rainHalfPx:a};const l=0===i?0:n,h=2*Math.max(0,1-l-s)*t,c=e*(t-h);return{cloudBaseOff:c,cloudMaxPx:h,boxCenterOff:c-e*o,boxHalfPx:o,rainCenterOff:r,rainHalfPx:a}}e.use({violin:m}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexViolin={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/violin.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/violin.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var n={file:"dist/violin.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(n),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!n.done){var i=e.ApexCharts;if(i)if(i.__internals){n.done=!0;var a=s.indexOf(n);-1!==a&&s.splice(a,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/violin.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/violin.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/violin.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/violin.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";const e=globalThis.ApexCharts,i=globalThis.ApexCharts.__internals.__apex_CoreUtils,n=globalThis.ApexCharts.__internals;n.__apex_ChartFactory_register;const s=n.__apex_ChartFactory_getChartClass;n.__apex_ChartFactory_isCustom;const a=globalThis.ApexCharts.__internals.__apex_Fill,o=globalThis.ApexCharts.__internals.__apex_Graphics,r=globalThis.ApexCharts.__internals.__apex_Series,l=globalThis.ApexCharts.__internals;l.__apex_Animations,l.__apex_Animations_computeStagger,l.__apex_Animations_applyAnimationPolicy,l.__apex_Animations_prefersReducedMotion,l.__apex_Animations_applyProgressiveReveal,globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,globalThis.ApexCharts.__internals.__apex_Environment_Environment;const h=globalThis.ApexCharts.__internals;function c(t,e,i){var n,s,a,o;if(null==(n=t.axisFlags)?void 0:n.isXNumeric){const n=null==(a=null==(s=t.seriesData)?void 0:s.seriesX)?void 0:a[e];if(n&&n.length&&null!=n[i])return"x:"+n[i]}const r=null==(o=t.globals.labels)?void 0:o[i];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+i}h.__apex_Easing_easeInOutSine,h.__apex_Easing_DEFAULT_EASING_NAME,h.__apex_Easing_cubicBezier,h.__apex_Easing_registerEasing,h.__apex_Easing_resolveEasing;const d=globalThis.ApexCharts.__internals.__apex_Utils,u=t=>{const e=function(t){const e=[];let i=t[0],n=t[1],s=e[0]=x(i,n),a=1;for(let o=t.length-1;a<o;a++)i=n,n=t[a+1],e[a]=.5*(s+(s=x(i,n)));return e[a]=s,e}(t),i=t.length-1,n=[];let s,a,o,r;for(let n=0;n<i;n++)o=x(t[n],t[n+1]),Math.abs(o)<1e-6?e[n]=e[n+1]=0:(s=e[n]/o,a=e[n+1]/o,r=s*s+a*a,r>9&&(r=3*o/Math.sqrt(r),e[n]=r*s,e[n+1]=r*a));for(let s=0;s<=i;s++)r=(t[Math.min(i,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+e[s]*e[s])),n.push([r||0,e[s]*r||0]);return n},p={points(t){const e=u(t),i=t[1],n=t[0],s=[],a=e[1],o=e[0];s.push(n,[n[0]+o[0],n[1]+o[1],i[0]-a[0],i[1]-a[1],i[0],i[1]]);for(let i=2,n=e.length;i<n;i++){const n=t[i],a=e[i];s.push([n[0]-a[0],n[1]-a[1],n[0],n[1]])}return s},slice(t,e,i){const n=t.slice(e,i);if(e){if(i-e>1&&n[1].length<6){const t=n[0].length;n[1]=[2*n[0][t-2]-n[0][t-4],2*n[0][t-1]-n[0][t-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n}};function x(t,e){return(e[1]-t[1])/(e[0]-t[0])}function g({graphics:t,w:e,elSeries:i,pointsByCat:n,options:s,distributed:a,realIndex:o,wrapClass:r,pointClass:l}){if(!s||!1===s.show||!n.length)return;const h=null!=s.opacity?s.opacity:.9,c=null!=s.strokeColor?s.strokeColor:"#fff",d=null!=s.strokeWidth?s.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:u?`${r} apexcharts-element-hidden`:r});u&&e.globals.delayedElements.push({el:p.node}),n.forEach(({groups:i,j:n})=>{const r=a?e.globals.colors[n]:e.globals.colors[o],u=s.fillColor,x="series"===u?r:"series-dark"===u?f(r,.45):u||f(r,.45);i.forEach(i=>{const s=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:x,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});s.attr("data:realIndex",o),s.attr("j",n),s.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),s.node.style.pointerEvents="none",p.add(s)})}),i.add(p)}function f(t,e){const i=d.parseColor(t)||d.parseColor(d.resolveColor(t));if(!i)return t;const n=Math.max(0,1-e);return`rgb(${Math.round(i[0]*n)},${Math.round(i[1]*n)},${Math.round(i[2]*n)})`}function b(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),n=Math.floor(i),s=i-n,a=d.parseHex(t[n])||[0,0,0],o=d.parseHex(t[Math.min(n+1,t.length-1)])||a,r=(t,e)=>Math.round(t+(e-t)*s);return`rgb(${r(a[0],o[0])},${r(a[1],o[1])},${r(a[2],o[2])})`}function v(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function m(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function _(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const y=class{};class C extends y{constructor(t,e,i){!function(){const t=s("bar");Object.getPrototypeOf(C)!==t&&(Object.setPrototypeOf(C,t),Object.setPrototypeOf(C.prototype,t.prototype))}(),super(t,e,i)}draw(t,e,n){var s,l,h;const c=this.w,u=new o(this.w),p=new a(this.w);this.violinOptions=c.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.jx=function(t,e){let i=1/0,n=-1/0;return t.slice(0,e.seriesData.series.length).flat(2).forEach(t=>{t===+t&&(t<i&&(i=t),t>n&&(n=t))}),[i,n]}(c.violinData.seriesViolinPoints,c),this.boxOptions=this.violinOptions.box||{},this.cloudSign=P(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:P(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?S(this.boxOptions.width,.15):0,this.rainFrac=S(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=c.config.plotOptions.bar.distributed,this.isHorizontal=c.config.plotOptions.bar.horizontal,this.coreUtils=new i(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,n);const x=u.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let i,a;const o=[],f=[],b=c.globals.comboCharts?n[e]:e,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(b),m=u.group({class:"apexcharts-series",seriesName:d.escapeString(c.seriesData.seriesNames[b]),rel:e+1,"data:realIndex":b});r.addCollapsedClassToSeries(this.w,m,b),t[e].length>0&&(this.visibleI=this.visibleI+1);const _=this.setSeriesAxis(b),y=this.barHelpers.initialPositions(b),{y:C,barHeight:w,yDivision:P,zeroW:S,x:A,barWidth:M,xDivision:F,zeroH:W}=y;a=C,i=A,f.push(i+(null!=M?M:0)/2);const j=u.group({class:"apexcharts-datalabels","data:realIndex":b});this.seriesMaxWeight=0,"group"===this.normalize&&(c.violinData.seriesViolinDensity[b]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)});const O=[];for(let n=0;n<c.globals.dataPoints;n++){const r=this.barHelpers.getStrokeWidth(e,n,b),d=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:_},y:a,yDivision:P,barHeight:w,zeroW:S}):this.drawVerticalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:_},x:i,xDivision:F,barWidth:M,zeroH:W});i=d.x,a=d.y,n>0&&f.push(d.center),o.push(d.alongRepresentative);const u=this.buildPointsSubPath({realIndex:b,j:n,center:d.center,halfExtent:d.halfExtent,alongFn:d.alongFn,density:d.density,maxWeight:d.maxWeight,cloudBase:d.cloudBase,cloudMaxPx:d.cloudMaxPx,rainCenter:d.rainCenter,rainHalfPx:d.rainHalfPx});u.length&&O.push({groups:u,j:n});const x=p.fillPath({seriesNumber:this.distributed?n:b,dataPointIndex:n,color:this.distributed?c.globals.colors[n]:void 0,value:t[e][n]});this.renderSeries({realIndex:b,pathFill:x,lineFill:c.globals.stroke.colors[b],j:n,i:e,pathFrom:d.pathFrom,pathTo:d.pathTo,strokeWidth:r,elSeries:m,x:i,y:a,series:t,columnGroupIndex:v,barHeight:w,barWidth:M,elDataLabelsWrap:j,visibleSeries:this.visibleI,type:"violin"});const g=m.node.querySelector(`path.apexcharts-violin-area[j='${n}']`);if(g&&isFinite(d.alongRepresentative)&&g.setAttribute(this.isHorizontal?"cx":"cy",`${d.alongRepresentative}`),g&&g.setAttribute("data:center",`${d.center}`),d.boxPaths){const o=null!=(s=this.boxOptions.strokeWidth)?s:1;d.boxPaths.forEach(s=>{this.renderSeries({realIndex:b,pathFill:s.filled?this.boxOptions.fillColor||x:"none",lineFill:c.globals.stroke.colors[b],j:n,i:e,pathFrom:s.pathFrom,pathTo:s.pathTo,strokeWidth:o,elSeries:m,x:i,y:a,series:t,columnGroupIndex:v,barHeight:w,barWidth:M,elDataLabelsWrap:j,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box",noLabel:!0})})}const y=!g&&(null==(h=null==(l=c.globals.barCanvasCoords)?void 0:l[b])?void 0:h[n]);y&&isFinite(d.alongRepresentative)&&(this.isHorizontal?y.cx=d.alongRepresentative:(y.bodyCx=y.cx,y.cx=d.center,y.cy=d.alongRepresentative))}g({graphics:u,w:c,elSeries:m,pointsByCat:O,options:this.pointsOptions,distributed:this.distributed,realIndex:b,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),c.globals.seriesXvalues[b]=f,c.globals.seriesYvalues[b]=o,x.add(m)}return x}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:n,zeroH:s}){var a,o,r,l,h,c,d;const u=this.w,{realIndex:p,j:x,translationsIndex:g}=t,f=this.yRatio[g]*(this.isReversed?-1:1);let b=e+n*this.visibleI;u.axisFlags.isXNumeric&&({x:e,barXPosition:b}=this.getBarXForNumericXAxis({x:e,barWidth:n,realIndex:p,j:x}));const v=b+n/2,m=n/2,_=this.getDensity(p,x),y=this.effectiveMaxWeight(_),C=t=>s-this.logVal(t,p)/f,w=A({halfExtent:m,cloudSign:null!=(a=this.cloudSign)?a:0,rainSign:null!=(o=this.rainSign)?o:0,boxFrac:null!=(r=this.boxFrac)?r:0,rainFrac:null!=(l=this.rainFrac)?l:0}),P=v+w.cloudBaseOff,S=this.buildBodyPath({nodes:_.nodes,center:P,halfExtent:w.cloudMaxPx,maxWeight:y,vertical:!0,alongFn:C,collapsed:!1,sideSign:this.cloudSign});let M=null;const F=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(p,x);return F?M=F:u.globals.previousPaths.length>0&&(M=this._prevBody(p,x,S)),null==M&&(M=this.buildBodyPath({nodes:_.nodes,center:P,halfExtent:w.cloudMaxPx,maxWeight:y,vertical:!0,alongFn:C,collapsed:!0,sideSign:this.cloudSign})),u.axisFlags.isXNumeric||(e+=i),{pathTo:S,pathFrom:M,x:e,y:s,center:v,halfExtent:m,alongFn:C,density:_,maxWeight:y,cloudBase:P,cloudMaxPx:w.cloudMaxPx,rainCenter:v+w.rainCenterOff,rainHalfPx:w.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:x,boxCenter:v+w.boxCenterOff,boxHalfPx:w.boxHalfPx,alongFn:C,vertical:!0}),alongRepresentative:C(null!=(d=u.seriesData.series[p][x])?d:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:n,zeroW:s}){var a,o,r,l,h,c,d;const u=this.w,{realIndex:p,j:x}=t,g=this.invertedYRatio*(this.isReversed?-1:1),f=e+n*this.visibleI+n/2,b=n/2,v=this.getDensity(p,x),m=this.effectiveMaxWeight(v),_=t=>s+this.logVal(t,p)/g,y=A({halfExtent:b,cloudSign:null!=(a=this.cloudSign)?a:0,rainSign:null!=(o=this.rainSign)?o:0,boxFrac:null!=(r=this.boxFrac)?r:0,rainFrac:null!=(l=this.rainFrac)?l:0}),C=f+y.cloudBaseOff,w=this.buildBodyPath({nodes:v.nodes,center:C,halfExtent:y.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:_,collapsed:!1,sideSign:this.cloudSign});let P=null;const S=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(p,x);return S?P=S:u.globals.previousPaths.length>0&&(P=this._prevBody(p,x,w)),null==P&&(P=this.buildBodyPath({nodes:v.nodes,center:C,halfExtent:y.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:_,collapsed:!0,sideSign:this.cloudSign})),{pathTo:w,pathFrom:P,x:s,y:e+=i,center:f,halfExtent:b,alongFn:_,maxWeight:m,density:v,cloudBase:C,cloudMaxPx:y.cloudMaxPx,rainCenter:f+y.rainCenterOff,rainHalfPx:y.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:x,boxCenter:f+y.boxCenterOff,boxHalfPx:y.boxHalfPx,alongFn:_,vertical:!1}),alongRepresentative:_(null!=(d=u.seriesData.series[p][x])?d:0)}}getDensity(t,e){var i;const n=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!n||!n.values.length)return{nodes:[],maxWeight:0};const s=n.values.map((t,e)=>e);s.sort((t,e)=>n.values[t]-n.values[e]);const a=[];let o=null;for(const t of s){const e=n.values[t];null!==o&&e===o||(a.push({v:e,w:n.weights[t]}),o=e)}return{nodes:a,maxWeight:n.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:n,vertical:s,alongFn:a,collapsed:r,sideSign:l=0}){const h=new o(this.w);if(0===t.length){const t=a(0);return s?h.move(e,t)+h.line(e,t):h.move(t,e)+h.line(t,e)}const c=t=>{if(r||n<=0)return 0;const e=t/n*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},d=[],u=[];for(let i=0;i<t.length;i++){const n=a(t[i].v),o=c(t[i].w),r=0===l?e+o:e+l*o,h=0===l?e-o:e;s?(d.push([r,n]),u.push([h,n])):(d.push([n,r]),u.push([n,h]))}return u.reverse(),this.smoothSegment(d,s,!1)+this.smoothSegment(u,s,!0)+"z"}_prevBody(t,e,i){var n,s;const a=null==(s=null==(n=this._prevKeyedPaths(t))?void 0:n.get(c(this.w,t,e)))?void 0:s.d;return a&&C.pathCommandCount(a)===C.pathCommandCount(i)?a:null}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:n,alongFn:s,vertical:a}){var r,l,h;const d=this.w;if(!this.boxShown||n<=0)return null;const u=null==(r=d.violinData.seriesViolinSummary[t])?void 0:r[e];if(!u)return null;const p=n*Math.min(1,Math.max(0,null!=(l=this.boxOptions.capWidth)?l:.5)),[x,g,f,b,v]=u.map(t=>s(t)),m=(t,e)=>{const n=new o(this.w),s=(t,e)=>a?[t,e]:[e,t],r=t=>t.map(([t,e],i)=>0===i?n.move(t,e):n.line(t,e)).join(""),l=i;return{whiskers:r([s(l,x),s(l,g)])+r([s(l,b),s(l,v)])+r([s(l-t,x),s(l+t,x)])+r([s(l-t,v),s(l+t,v)]),box:r([s(l-e,g),s(l+e,g),s(l+e,b),s(l-e,b)])+"z"+r([s(l-e,f),s(l+e,f)])}},_=m(p,n),y=m(0,0),C=d.globals.previousPaths.length?this._prevKeyedPaths(t):null,w=(null==(h=null==C?void 0:C.get(c(d,t,e)))?void 0:h.box)||[];return[{pathTo:_.whiskers,pathFrom:w[0]||y.whiskers,filled:!1},{pathTo:_.box,pathFrom:w[1]||y.box,filled:!0}]}smoothSegment(t,e,i){const n=new o(this.w),s=t[0];let a=i?n.line(s[0],s[1]):n.move(s[0],s[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)a+=n.line(t[e][0],t[e][1]);return a}const r=t.map(([t,i])=>e?[i,t]:[t,i]),l=p.points(r);return a+=(t=>{let e="";for(let i=0;i<t.length;i++){const n=t[i],s=n.length;s>4?(e+=`C${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`,e+=`, ${n[4]}, ${n[5]}`):s>2&&(e+=`S${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`)}return e})(e?l.map(w):l),a}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:n,alongFn:s,density:a,maxWeight:o,cloudBase:r,cloudMaxPx:l,rainCenter:h,rainHalfPx:c}){var d;const u=0!==this.rainSign,p=u?h:0!==this.cloudSign?r:i,x=u?c:0!==this.cloudSign?l:n;return function({points:t,extent:e,seedA:i,seedB:n,center:s,halfExtent:a,alongFn:o,isHorizontal:r,options:l,clampAt:h,sideSign:c}){var d,u;const p=l;if(!p||!1===p.show)return[];if(!t||!t.length)return[];const x=p.maxPoints||3e3,g=t.length>x?Math.ceil(t.length/x):1,f=null!=p.size?p.size:2.5,y=a*(null!=p.jitter?p.jitter:.5),C=!1!==p.constrainToViolin&&"function"==typeof h,w="square"===p.shape,P=p.colorScale,S=P&&Array.isArray(P.colors)&&P.colors.length>0,A=S?Math.max(2,P.steps||24):1,M=null!=(d=null==P?void 0:P.min)?d:e[0],F=(null!=(u=null==P?void 0:P.max)?u:e[1])-M||1,W=S?new Array(A).fill(""):[""];for(let e=0;e<t.length;e+=g){const a=t[e],l=o(a);let d=2*(v(7919*i+100003*n+e)-.5)*y;if(C){const t=h(a);d>t&&(d=t),d<-t&&(d=-t)}c&&(d=Math.abs(d)*c);const u=r?l:s+d,p=r?s+d:l,x=w?_(u,p,f):m(u,p,f);if(S){let t=(a-M)/F;t<0&&(t=0),t>1&&(t=1),W[Math.round(t*(A-1))]+=x}else W[0]+=x}if(!S)return W[0]?[{fill:null,d:W[0]}]:[];const j=[];for(let t=0;t<A;t++)W[t]&&j.push({fill:b(P.colors,t/(A-1)),d:W[t]});return j}({points:null==(d=this.w.violinData.seriesViolinPoints[t])?void 0:d[e],extent:this.jx,seedA:t,seedB:e,center:p,halfExtent:x,alongFn:s,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:u?null:t=>this.halfWidthAtValue(t,a,x,o),sideSign:u?0:this.cloudSign})}halfWidthAtValue(t,e,i,n){const{nodes:s}=e,a=null!=n?n:e.maxWeight;if(!s.length||a<=0)return 0;const o=t=>Math.min(i,t/a*i*this.bandwidthScale);if(t<=s[0].v)return o(s[0].w);if(t>=s[s.length-1].v)return o(s[s.length-1].w);for(let e=1;e<s.length;e++)if(t<=s[e].v){const i=s[e-1],n=s[e],a=n.v===i.v?0:(t-i.v)/(n.v-i.v);return o(i.w+(n.w-i.w)*a)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function w(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function P(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function S(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function A({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:n,rainFrac:s}){const a=n*t,o=0===i?t:s*t,r=0===i?0:i*(t-o);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:a,rainCenterOff:r,rainHalfPx:o};const l=0===i?0:s,h=2*Math.max(0,1-l-n)*t,c=e*(t-h);return{cloudBaseOff:c,cloudMaxPx:h,boxCenterOff:c-e*a,boxHalfPx:a,rainCenterOff:r,rainHalfPx:o}}e.use({violin:C}),t.default=e,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexViolin={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,n=(t,e)=>{for(var a in e||(e={}))i.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))r.call(e,a)&&o(t,a,e[a]);return t},l=(t,s)=>e(t,a(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Graphics,b=d.__apex_Environment_Environment;const u=d.__apex_Utils;function g(t,e){const a=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var a={};for(var o in t)i.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(null!=t&&s)for(var o of s(t))e.indexOf(o)<0&&r.call(t,o)&&(a[o]=t[o]);return a})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=a.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return l(n({},d),{data:Array.isArray(c)?c.slice():c})})}function p(t,e,a){const s=a&&void 0!==a[e]?a[e]:e+1;return null==t?{x:s,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:s,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function x(t,e,a){if(t&&t.fillColor)return t.fillColor;const s=a[e];return"string"==typeof s&&s?s:void 0}const f="__apexcharts_series_transforms__";var y,v;globalThis[f]||(globalThis[f]={}),y="waterfall","function"==typeof(v=function(t,e){var a,s,i;const r=e.config,o=e.globals;if(!Array.isArray(t))return t;o.waterfallRawSeries||(o.waterfallRawSeries=g(t,o));const h=o.waterfallRawSeries,d=(null==(s=null==(a=r.plotOptions)?void 0:a.waterfall)?void 0:s.colors)||{},c=null==(i=r.xaxis)?void 0:i.categories,b=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(o),f=[],y=[],v=[],m=h.map((t,e)=>{const a=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==b.indexOf(e))return f[e]=[],y[e]=[],v[e]=[],l(n({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const a=t[e],s=Array.isArray(a)?a[1]:a&&"object"==typeof a?a.y:a;if(Array.isArray(s)&&2===s.length)return!0}return!1}(a))return f[e]=a.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(!Array.isArray(e))return null;const a=u.parseNumber(e[0]),s=u.parseNumber(e[1]);return null===a||null===s?null:s-a}),y[e]=a.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,a=Array.isArray(e)?u.parseNumber(e[1]):null;return null===a?0:a}),v[e]=a.map(()=>null),t;const s=function(t,e,a){const s=[],i=[],r=[],o=[];let h=0,d=0;for(let c=0;c<t.length;c++){const{x:b,y:g,isSubtotal:f,isTotal:y,rest:v}=p(t[c],c,e);let m,C,w;if(y||f)m=y?0:d,C=h,w=y?"total":"subtotal",d=h;else{const t=u.parseNumber(g);if(null===t||!isFinite(t)){s.push(l(n({},v),{x:b,y:null})),i.push(null),r.push(h),o.push(null);continue}m=h,C=h+t,h=C,w=t<0?"negative":"positive"}const I=x(v,w,a);s.push(n(l(n({},v),{x:b,y:[m,C]}),I?{fillColor:I}:{})),i.push(C-m),r.push(h),o.push(w)}return{data:s,values:i,cumulative:r,kinds:o}}(a,c,d);return f[e]=s.values,y[e]=s.cumulative,v[e]=s.kinds,l(n({},t),{data:s.data})});return e.waterfallData={values:f,cumulative:y,kinds:v,geometry:[]},m})?globalThis[f][y]=v:console.warn(`ApexCharts: registerSeriesTransform("${y}") expects a function (series, w) => series.`),d.default.registerFeatures({waterfall:class{constructor(t,e){this.w=t,this.ctx=e}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var t,e;const a=this.w;if(!this.isActive())return;const s=null==(e=null==(t=a.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!s||!1===s.show)return;const i=a.dom.elGraphical,r=a.waterfallData&&a.waterfallData.geometry;if(!i||!r)return;this.removeConnectors();const o=new c(a,this.ctx),n=o.group({class:"apexcharts-waterfall-connectors"}),l=s.color||a.config.grid.borderColor,h=null==s.strokeWidth?1:s.strokeWidth,d=null==s.strokeDashArray?3:s.strokeDashArray;let b=0;for(let t=0;t<r.length;t++){const e=r[t];if(Array.isArray(e))for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1];if(!a||!s)continue;if(!(s.slotStart-a.slotEnd>.5))continue;const i=a.horizontal?o.drawLine(a.levelEnd,a.slotEnd,a.levelEnd,s.slotStart,l,d,h):o.drawLine(a.slotEnd,a.levelEnd,s.slotStart,a.levelEnd,l,d,h);i.node.classList.add("apexcharts-waterfall-connector"),n.add(i),b++}}if(!b)return;n.attr("clip-path",`url(#gridRectBarMask${a.globals.cuid})`);const u=i.node.querySelector(".apexcharts-xaxis");u?i.node.insertBefore(n.node,u):i.add(n),this.holdUntilBarsLand(n)}removeConnectors(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-waterfall-connectors");e&&e.parentNode&&e.parentNode.removeChild(e)}holdUntilBarsLand(t){const e=this.w;b.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});const m=d.__apex_DataLabels,C=(t,e,a,s)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:a,dataPointIndex:s,w:e});return Number.isFinite(i)?i:0},w=d.__apex_Animations,I=d.__apex_Animations_computeStagger,S=d.__apex_BrowserAPIs_BrowserAPIs;function P(t){var e;const a=t.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const s=null!=(e=a.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(b.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function k(t,e,a){var s,i,r,o;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[a])return"x:"+s[a]}const n=null==(o=t.globals.labels)?void 0:o[a];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+a}function A(t){const e=new Map;return t.map(t=>{const a=e.get(t)||0;return e.set(t,a+1),0===a?t:`${t}#${a}`})}function L(t,e,a=!1,s=!1){var i,r;if(!P(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(i=o.seriesY)?void 0:i[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=A(n.map((t,a)=>function(t,e,a){var s,i;if(t.isXNumeric){const i=null==(s=t.seriesX)?void 0:s[e];if(i&&i.length&&null!=i[a])return"x:"+i[a]}const r=null==(i=t.labels)?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}(o,e,a))),d=A(l.map((a,s)=>k(t,e,s))),c=function(t,e){const a=new Map;t.forEach((t,e)=>{a.has(t)||a.set(t,e)});const s=new Array(e.length),i=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=a.has(t)&&!i.has(a.get(t))?a.get(t):-1;s[e]=l,-1!==l&&(i.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)i.has(e)||l.push(e);return{toOld:s,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||s)&&(c.changed||a)?{join:c,oldKeys:h,newKeys:d}:null}function H({w:t,elSeries:e,record:a,newKeys:s,isHorizontal:i,speed:r}){var o;if(!P(t))return;if(!a||!Array.isArray(a.paths)||!(null==e?void 0:e.node))return;const n=new Set(s),l=a.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new c(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(a.realIndex),10)];l.forEach(s=>{let o=s.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const n=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=n.node;l.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const a=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(a)&&isFinite(s)?{x:a,y:s}:null}(s.d);let b=i?"left center":"center bottom";try{const t=l.getBBox();c&&t&&(b=i?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const u=l.style;u.transformBox="fill-box",u.transformOrigin=b,l.setAttribute("data:ghostKey",`${a.realIndex}::${s.key}`);try{const t=l.getBBox(),e=i?b.startsWith("left")?t.x:t.x+t.width:b.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&l.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,r||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const a=Math.max(0,Math.min(1,(e-p)/g)),s=1-Math.pow(1-a,3),r=1-s;u.transform=i?`scaleX(${r})`:`scaleY(${r})`,u.opacity=String(1-s),a<1?S.requestAnimationFrame(x):l.parentNode.removeChild(l)};S.requestAnimationFrame(x)})}class W{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,a,s,i,r,o;const{x:h,y:d,y1:b,y2:u,i:g,j:p,realIndex:x,columnGroupIndex:f,barHeight:y,barWidth:v,barXPosition:m,barYPosition:w,visibleSeries:I,hl:S}=t,P=this.w,k=new c(this.barCtx.w);this.hlt=null==S?void 0:S.total;const A=P.waterfallData&&P.waterfallData.values,L=S&&null!=S.val?S.val:A&&A[x]&&null!=A[x][p]?A[x][p]:null,H=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[x]:this.barCtx.strokeWidth;let W,D;P.axisFlags.isXNumeric&&!P.globals.isBarHorizontal?(W=h+v*(I+1),D=d+y*(I+1)-H):(W=h+v*I,D=d+y*I);let R=null,X=null,F=h,O=d,T={};const j=P.config.dataLabels,Y=this.barCtx.barOptions.dataLabels,B=this.barCtx.barOptions.dataLabels.total;void 0!==w&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(D=w,O=w),void 0!==m&&this.barCtx.isVerticalGroupedRangeBar&&(W=m,F=m);const z=C(j.offsetX,P,x,p),_=C(j.offsetY,P,x,p),M=(null==S?void 0:S.hide)?void 0:null!==L?L:void 0!==u?[b,u]:"100%"===P.config.chart.stackType?P.globals.seriesPercent[x][p]:P.seriesData.series[x][p];let G,E={width:0,height:0};j.enabled&&(G=void 0===M?"":j.formatter(M,l(n({},P),{seriesIndex:x,dataPointIndex:p,w:P})),E=k.getTextRects(G,parseFloat(j.style.fontSize).toString(),j.style.fontFamily,void 0,!0,j.style.fontWeight));const N={x:null!=(e=null==S?void 0:S.x)?e:h,y:null!=(a=null==S?void 0:S.y)?a:d,neg:S&&null!=S.val?S.val<0:void 0,i:g,j:p,realIndex:x,columnGroupIndex:f,bcx:W,bcy:D,barHeight:null!=(s=null==S?void 0:S.barHeight)?s:y,barWidth:null!=(i=null==S?void 0:S.barWidth)?i:v,textRects:E,strokeWidth:H,dataLabelsX:F,dataLabelsY:O,dataLabelsConfig:j,barDataLabelsConfig:Y,barTotalDataLabelsConfig:B,offX:z,offY:_};if(T=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(N):this.calculateColumnsDataLabelsPosition(N),null!==L&&this.barCtx.isHorizontal&&"center"===Y.position){const t=null==(o=null==(r=P.waterfallData.geometry)?void 0:r[x])?void 0:o[p];t&&t.horizontal&&(T.dataLabelsX=(t.levelStart+t.levelEnd)/2+z)}return R=this.drawCalculatedDataLabels({x:T.dataLabelsX,y:T.dataLabelsY,neg:N.neg,val:M,text:G,i:x,j:p,barWidth:N.barWidth,barHeight:N.barHeight,textRects:E,dataLabelsConfig:j}),P.config.chart.stacked&&B.enabled&&!1!==this.hlt&&(X=this.drawTotalDataLabels({x:T.totalDataLabelsX,y:T.totalDataLabelsY,barWidth:v,barHeight:y,realIndex:x,j:p,textAnchor:T.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:x,j:p}),rawVal:this.getStackedTotalValue({realIndex:x,j:p}),dataLabelsConfig:j,barTotalDataLabelsConfig:B})),{dataLabelsPos:T,dataLabels:R,totalDataLabels:X}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,a=this.getTotalGroupContext(t);return a&&e&&e.length>a.groupIndex?e[a.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const a=this.w,s=this.xStackTop(t,e);if(s)return s[3];const i=this.getTotalGroupContext(t),r=a.seriesData.stackedSeriesTotalsByGroups;return i&&r&&r[i.groupIndex]?r[i.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var a,s;const i=this.w;return i.axisFlags.isXNumeric&&(null==(s=null==(a=this.barCtx.stacks)?void 0:a[i.labelData.seriesGroupIndex[t]])?void 0:s.tops.get(i.seriesData.seriesX[t][e]))}getStackedTotalDataLabel({realIndex:t,j:e}){const a=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,l(n({},a),{seriesIndex:t,dataPointIndex:e,w:a}))),s}calculateColumnsDataLabelsPosition(t){var e;const a=this.w;let s,i,{i:r,j:o,realIndex:n,y:l,bcx:h,barWidth:d,barHeight:b,textRects:u,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:x,barDataLabelsConfig:f,barTotalDataLabelsConfig:y,strokeWidth:v,offX:m,offY:C}=t;const w=h;b=Math.abs(b);const I="vertical"===a.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:S}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:o});h-=v/2;const P=a.layout.gridWidth/a.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=d/2:(g=a.axisFlags.isXNumeric?h-d/2+m:h-P+d/2+m,!a.config.chart.stacked&&S>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=d*S)),I){const t=2;g=g+u.height/2-v/2-t}const k=null!=(e=t.neg)?e:a.seriesData.series[r][o]<0;let A=l;switch(this.barCtx.isReversed&&(A=l+(k?b:-b)),f.position){case"center":p=I?k?A-b/2+C:A+b/2-C:k?A-b/2+u.height/2+C:A+b/2+u.height/2-C;break;case"bottom":p=I?k?A-b+C:A+b-C:k?A-b+u.height+v+C:A+b-u.height/2+v-C;break;case"top":p=I?k?A+C:A-C:k?A-u.height/2-C:A+u.height+C}let L=A;const H=this.getTotalGroupContext(n),W=this.xStackTop(n,o),D=W?[]:this.barCtx.stacks||[];if(W&&(L=k?Math.max(A,W[5]):Math.min(A,W[4])),D.forEach((t,e)=>{H&&e!==H.groupIndex||t.prevY.forEach(t=>{L=k?Math.max(t[o],L):Math.min(t[o],L)})}),this.hlt&&(L=this.hlt.edge),this.drawsStackedTotal(n)&&y.enabled){const t=18,e=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),x.fontSize);s=k?L-e.height/2-C-y.offsetY+t:L+e.height+C+y.offsetY-t;const r=P;i=w+(a.axisFlags.isXNumeric?-d/2:d/2-r)+y.offsetX}return a.config.chart.stacked||(p<0?p=0+v:p+u.height/3>a.layout.gridHeight&&(p=a.layout.gridHeight-v)),{bcx:h,bcy:l,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,a;const s=this.w;let{x:i,i:r,j:o,realIndex:n,bcy:l,barHeight:h,barWidth:d,textRects:b,dataLabelsX:u,strokeWidth:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,offX:y,offY:v}=t;const m=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:o});let w,I,S;if(d=Math.abs(d),this.barCtx.isPyramid){w=l+h/2+v-(null!=(e=b.centerOffset)?e:0)}else w=l-(this.barCtx.isRangeBar?0:m)+h/2+b.height/2+v-3;!s.config.chart.stacked&&C>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=h*C);let P="start";const k=null!=(a=t.neg)?a:s.seriesData.series[r][o]<0;let A=i;if(this.barCtx.isReversed&&(A=i+(k?-d:d),P=k?"start":"end"),this.barCtx.isPyramid)u=s.layout.gridWidth/2+y;else switch(x.position){case"center":u=k?A+d/2-y:Math.max(b.width/2,A-d/2)+y;break;case"bottom":u=k?A+d-g-y:A-d+g+y;break;case"top":u=k?A-g-y:A-g+y}let L=A;const H=this.getTotalGroupContext(n);if((this.barCtx.stacks||[]).forEach((t,e)=>{H&&e!==H.groupIndex||t.prevX.forEach(t=>{L=k?Math.min(t[o],L):Math.max(t[o],L)})}),this.hlt&&(L=this.hlt.edge),this.drawsStackedTotal(n)&&f.enabled){const t=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),p.fontSize);k?(I=L-g-y-f.offsetX,P="end"):I=L+y+f.offsetX+(this.barCtx.isReversed?-(d+g):g),S=w-b.height/2+t.height/2+f.offsetY+g,s.globals.barGroups.length>1&&!H&&(S-=s.globals.barGroups.length/2*(h/2))}if(!s.config.chart.stacked){const t=k&&"middle"!==p.textAnchor?"start"===p.textAnchor?"end":"start":p.textAnchor;let e;e="vertical"===x.orientation?b.height/2:"end"===t?b.width:"middle"===t?b.width/2:0;const a=("vertical"===x.orientation?b.height:b.width)-e;u+a>s.layout.gridWidth-g&&(u=s.layout.gridWidth-a-g),u-e<g&&(u=e+g)}return{bcx:i,bcy:l,dataLabelsX:u,dataLabelsY:w,totalDataLabelsX:I,totalDataLabelsY:S,totalDataLabelsAnchor:P}}drawCalculatedDataLabels({x:t,y:e,val:a,text:s,neg:i,i:r,j:o,textRects:h,barHeight:d,barWidth:b,dataLabelsConfig:u}){var g,p,x;const f=this.w;let y="rotate(0)";"vertical"===f.config.plotOptions.bar.dataLabels.orientation&&(y=`rotate(-90, ${t}, ${e})`);const v=new m(this.barCtx.w,this.barCtx.ctx),C=new c(this.barCtx.w),w=u.formatter;let I=null;const S=f.globals.collapsedSeriesIndices.indexOf(r)>-1,P=(f.globals.collapsingSeriesIndices||[]).indexOf(r)>-1;if(P){const t=null==(g=f.globals.prevDataLabels)?void 0:g.get(`${r}::${k(f,r,o)}`);t&&isFinite(t.val)&&(a=t.val,s=void 0)}if(u.enabled&&(!S||P)){I=C.group({class:"apexcharts-data-labels",transform:y});const c=f.config.dataLabels;((null==(p=c.animate)?void 0:p.enabled)||(null==(x=c.countUp)?void 0:x.enabled))&&(I.node.setAttribute("data:dlKey",`${r}::${k(f,r,o)}`),I.node.setAttribute("data:dlJ",String(o)),"number"==typeof a&&isFinite(a)&&I.node.setAttribute("data:dlVal",String(a))),void 0===a?s="":void 0===s&&(s=w(a,l(n({},f),{seriesIndex:r,dataPointIndex:o,w:f}))),!a&&f.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(s="");const g=null!=i?i:f.seriesData.series[r][o]<0,m=f.config.plotOptions.bar.dataLabels.position;if("vertical"===f.config.plotOptions.bar.dataLabels.orientation&&("top"===m&&(u.textAnchor=g?"end":"start"),"center"===m&&(u.textAnchor="middle"),"bottom"===m&&(u.textAnchor=g?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){b<C.getTextRects(s,parseFloat(u.style.fontSize).toString()).width&&(s="")}f.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!P&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(b)&&(s=""):h.height/1.6>Math.abs(d)&&(s=""));const S=n({},u);this.barCtx.isHorizontal&&a<0&&("start"===u.textAnchor?S.textAnchor="end":"end"===u.textAnchor&&(S.textAnchor="start")),v.plotDataLabelsText({x:t,y:e,text:s,i:r,j:o,parent:I,dataLabelsConfig:S,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return I}drawTotalDataLabels({x:t,y:e,val:a,rawVal:s,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new c(this.barCtx.w);let b;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){b=d.drawText({x:t,y:e,foreColor:n.style.color,text:a,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),b.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const c=this.w.config.dataLabels;if((null==(l=c.animate)?void 0:l.enabled)||(null==(h=c.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);b.node.setAttribute("data:dlTotalKey",`${t}::${k(this.w,i,r)}`),b.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof s&&isFinite(s)&&b.node.setAttribute("data:dlTotalVal",String(s))}}return b}}const D=d.__apex_Series,R=d.__apex_Fill;function X(t){var e,a,s,i,r,o,n;return"histogram"===(null==(a=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:a.requestedType)&&(!1!==(null==(i=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:i.overlap)&&(null!=(n=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?n:0)>1)}class F{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let a=0;a<t.length;a++)if(t[a].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[a].length),e.axisFlags.isXNumeric)for(let s=0;s<t[a].length;s++)e.seriesData.seriesX[a][s]>e.globals.minX&&e.seriesData.seriesX[a][s]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),u.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const a=t.globals.maxX-t.globals.minX;e=a>0?a/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const a=t.globals.minXDiff;e=a>0&&isFinite(a)&&.5!==a?a:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let a=0;a<t.length;a++){const s=t[a];Array.isArray(s)&&s.length>0&&e.push(s.some((t,e)=>t<s[e-1])?s.filter(t=>t===+t).sort((t,e)=>t-e):s)}if(!e.length)return 0;const a=new Array(e.length).fill(0);let s=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let s=0;s<e.length;s++){const i=e[s];for(;a[s]<i.length&&"number"!=typeof i[a[s]];)a[s]++;if(a[s]>=i.length)continue;const o=i[a[s]];o==o?o<t&&(t=o,r=s):(a[s]++,s--)}if(-1===r)break;if(a[r]++,s==s){const e=t-s;e>0&&e<i&&(i=e)}s=t}return isFinite(i)?i:0}initialPositions(t){const e=this.w;let a,s,i,r,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||X(e))&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),s=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),n=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(r=e/t),n=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){a=this.barCtx.getBarXForNumericXAxis({x:a,j:0,realIndex:t,barWidth:n}).x}else a=e.globals.padHorizontal+u.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:a,y:s,yDivision:i,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,a,s){var i;const r=this.w,o=new R(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?a:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][a]>=s.from&&t[e][a]<=s.to&&(n=s.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,a)||(null==(i=r.config.series[e].data[a])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(n=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:s,dataPointIndex:a,color:n,opacity:b,value:t[e][a],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const a=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=a.dumbbellData;if(!s||"series"!==s.form)return null;const i=a.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=s.order[e];if(!r)return null;const o=a.globals.colors[r[0]],n=a.globals.colors[r[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,a){let s=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[a]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,a=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!s||s.has(t);if(!a||a.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:a.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const a=this.w,s=!this.w.config.chart.stacked||a.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(s?"top":"none"));if(s)return o;const n="last"===a.config.plotOptions.bar.borderRadiusWhenStacked,l=n?"top":"both",h=n?"bottom":"both",d=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(i))for(let a=0;a<r;a++){const s=[],i=[];for(const r of e){const e=t[r][a];e>0?s.push(r):e<0&&i.push(r)}if(s.length>0&&0===i.length)if(1===s.length)o[s[0]][a]=l;else{const t=s[0],e=s[s.length-1];for(const i of s)o[i][a]=i===t?d:i===e?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)o[i[0]][a]=h;else{const t=Math.min(...i),e=Math.max(...i);for(const s of i)o[s][a]=s===t?c:s===e?"bottom":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const e of s)o[e][a]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][a]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:a,x2:s,y1:i,y2:r,elSeries:o}){const n=this.w,l=new c(this.barCtx.w),h=new D(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==a?a:0,void 0!==i?i:0,void 0!==s?s:n.layout.gridWidth,void 0!==r?r:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:a,v2:s,strokeWidth:i,realIndex:r,j:o,dir:n,horizontal:l}){const h=this.w,d=new c(h);(i=Array.isArray(i)?i[r]:i)||(i=0);const b=h.config.series[r].data[o],u=l?null==b?void 0:b.barHeightOffset:null==b?void 0:b.columnWidthOffset;u&&(t-=u/2,e+=u);const g=i/2,p=n*(this.barCtx.isReversed?-1:1),x="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[r][o]?" Z":" z";let f,y,v,m,C,w;l?(v=t+g,m=t+e-g,f=a+.001+g*p,y=s+.001-g*p,C=d.line(f,m),w=d.move(f,v)+d.line(y,v)+d.line(y,m)+C+x):(f=t+g,y=t+e-g,v=a+.001-g*p,m=s+.001+g*p,C=d.line(y,v),w=d.move(f,v)+d.line(f,m)+d.line(y,m)+C+x);return{x1:f,x2:y,y1:v,y2:m,sl:C,closing:x,squarePathTo:w,pathTo:"none"!==this.arrBorderRadius[r][o]?d.roundPathCorners(w,h.config.plotOptions.bar.borderRadius):w,base:d.move(f,v)+d.line(f,v)+C+C+C+C+C+d.line(f,v)+x,strokeWidth:i,strokeCenter:g,direction:p}}getColumnPaths({barWidth:t,barXPosition:e,y1:a,y2:s,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,c;const b=this.barRect({a:e,len:t,v1:a,v2:s,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1}),{pathTo:u,squarePathTo:g,strokeCenter:p,direction:x}=b;a=b.y1,s=b.y2;let f=null;const y=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(y?f=y:h.globals.previousPaths.length>0&&(f=this.barCtx.getPreviousPath(o,l,u,g)),null==f&&(f=b.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(s-p*x),t.yArrjF.push(Math.abs(a-s+b.strokeWidth*x)),t.yArrjVal.push(this.barCtx.series[n][l])}return{pathTo:u,pathFrom:f,drawnBox:{x1:b.x1,x2:b.x2,y1:a,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:a,i:s,j:i,realIndex:r,strokeWidth:o,w:n}){var l,h;const d=new c(this.barCtx.w),b=n.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,g=u(a[s][i]),p=i===a[s].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:g:u(a[s][i+1]);const y=o/2,v=t+y,m=t+e-y,C=b-g,w=b+g,I=b-f,S=b+f,P=d.move(C,v)+d.line(w,v)+d.line(S,m)+d.line(I,m)+" Z";let k=null;const A=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return A?k=A:n.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,P)),null==k&&(k=d.move(b,v)+d.line(b,v)+d.line(b,m)+d.line(b,m)+" Z"),{pathTo:P,pathFrom:k,x:w,x1:C,barXPosition:b}}computePyramidLayout(t){const e=this.w,a=e.layout.gridHeight,s=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||a<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=s/2;let n=0;const l=[];for(let t=0;t<i.length;t++){const e=n/r;n+=i[t];const s=n/r,h=e*a,d=s*a;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:s*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:a,bottomHalf:s,realIndex:i,j:r,strokeWidth:o,w:n}){var l,h;const d=new c(this.barCtx.w),b=n.layout.gridWidth/2,u=o/2,g=t+u,p=t+e-u,x=b-a,f=b+a,y=b-s,v=b+s,m=d.move(x,g)+d.line(f,g)+d.line(v,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:n.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(b,g)+d.line(b,g)+d.line(b,p)+d.line(b,p)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:b}}getBarpaths({barYPosition:t,barHeight:e,x1:a,x2:s,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,b;const u=new c(this.barCtx.w),g=this.barRect({a:t,len:e,v1:a,v2:s,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1,horizontal:!0}),{y1:p,y2:x,sl:f,closing:y,squarePathTo:v,pathTo:m,strokeCenter:C,direction:w}=g;a=g.x1,s=g.x2;const I=this.barCtx.isFunnel,S=I?(a+s)/2:a;let P=null;const k=null==(b=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:b.getInitialPathFor(o,l);if(k?P=k:h.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(o,l,m,v)),null==P){const t=I?u.line(S,x):f;P=u.move(S,p)+u.line(S,p)+t+t+t+t+t+u.line(S,p)+y}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(s+C*w),t.xArrjF.push(Math.abs(a-s-g.strokeWidth*w)),t.xArrjVal.push(this.barCtx.series[n][l])}return{pathTo:m,pathFrom:P,drawnBox:{x1:a,x2:s,y1:p,y2:x}}}getXForValue(t,e,a=!0){let s=a?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,a,s=!0){let i=s?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[a]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[a]:0)),i}getGoalValues(t,e,a,s,i,r){const o=this.w,h=[],d=(s,i)=>{h.push({[t]:"x"===t?this.getXForValue(s,e,!1):this.getYForValue(s,a,r,!1),attrs:i})};if(o.seriesData.seriesGoals[s]&&o.seriesData.seriesGoals[s][i]&&Array.isArray(o.seriesData.seriesGoals[s][i])&&o.seriesData.seriesGoals[s][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,i);if(e.length){const a={strokeHeight:"x"===t?0:o.globals.markers.size[s],strokeWidth:"x"===t?o.globals.markers.size[s]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},a),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,s,i,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===r&&r!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const a=this.w,s=[],i=a.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&s.push({value:r,color:a.globals.colors[e],index:e})}return s}if(!a.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:a.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:a.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:a.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,a,s){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:a,endpointIndex:s,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,a,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:a,goalY:s,barWidth:i,barHeight:r}){if(!(Array.isArray(a)&&a.length>0||Array.isArray(s)&&s.length>0))return null;const o=new c(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const a=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+a+r/2;l=o.drawLine(t.x,s-2*a,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-a,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const a=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,s=t+a+i/2;l=o.drawLine(s-2*a,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:s-a,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const a=this.w,s=new c(a),i=a.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return s.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:a,realIndex:s,j:i}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:b}=e,g=l+e.barHeight,p=new c(this.barCtx.w),x=new u,f=p.move(n,g)+p.line(o,g)+p.line(h,b)+p.line(d,b)+p.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][i]?" Z":" z");return p.drawPath({d:f,fill:x.shadeColor(.5,u.rgb2hex(a)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var a;const s=this.w;let i=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(a=s.globals.columnSeries)?void 0:a.i.map(t=>t))||[]).forEach(a=>{const o=s.globals.seriesPercent[a][e];o&&i++,a<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),a=this.barCtx.columnGroupIndices;let s=a.indexOf(e);return s<0&&(a.push(e),s=a.length-1),{groupIndex:e,columnGroupIndex:s}}}const O=d.__apex_CoreUtils,T=d.__apex_Filters;class j{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/j.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*j.xRatio(t)}static screenXToPlotPx(t,e){const a=t.dom.baseEl,s=a&&a.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const i=s.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class Y{constructor(t,e,a){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=a,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.invertedXRatio=a.invertedXRatio,this.invertedYRatio=a.invertedYRatio,this.baseLineY=a.baseLineY,this.baseLineInvertedY=a.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const s=new D(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=s.getBarSeriesIndices(),r=new O(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new F(this)}setSeriesAxis(t){return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.translationsIndex}draw(t,e){var a,s,i,r,o;const h=this.w,d=new c(this.w),b=new O(this.w);t=b.getLogSeries(t),this.series=t,this.yRatio=b.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const g=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),p=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let c=0,b=0;c<t.length;c++,b++){let x,f;const y=[],v=[],m=h.globals.comboCharts?e[c]:c,{columnGroupIndex:C}=this.barHelpers.getGroupIndex(m),w=d.group({class:"apexcharts-series",rel:c+1,seriesName:u.escapeString(h.seriesData.seriesNames[m]),"data:realIndex":m});D.addCollapsedClassToSeries(this.w,w,m),t[c].length>0&&(this.visibleI=this.visibleI+1);const I=this.setSeriesAxis(m);this.isReversed=h.config.yaxis[this.yaxisIndex]&&h.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[c]));const S=this.barHelpers.initialPositions(m),{y:P,yDivision:A,zeroW:L,x:W,xDivision:R,zeroH:X}=S;let F=S.barHeight,O=S.barWidth;f=P,x=W,this.isHorizontal||v.push(x+(null!=O?O:0)/2);const j=d.group({class:"apexcharts-datalabels","data:realIndex":m}),Y=h.config.dataLabels,B=!(null==(a=Y.animate)?void 0:a.enabled)&&this.isLengthTransition(m);h.globals.dataChanged&&!B&&!(!(null==(s=Y.animate)?void 0:s.enabled)&&!(null==(i=Y.countUp)?void 0:i.enabled))||(h.globals.delayedElements.push({el:j.node,holdUntilComplete:B}),j.node.classList.add("apexcharts-element-hidden"));const z=d.group({class:"apexcharts-bar-goals-markers"}),_=d.group({class:"apexcharts-bar-shadows"}),M=this.ctx,G=M._barShadows,E=M._barShadows=[],N=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==G?void 0:G.length)===t[c].length-1;N||(h.globals.delayedElements.push({el:_.node}),_.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[c].length;e++){const a=this.barHelpers.getStrokeWidth(c,e,m);let s=null;const i={indexes:{i:c,j:e,realIndex:m,translationsIndex:I,bc:b},x:x,y:f,strokeWidth:a,elSeries:w};this.isHorizontal?(s=this.drawBarPaths(l(n({},i),{barHeight:F,zeroW:L,yDivision:A})),O=this.series[c][e]/this.invertedYRatio):(s=this.drawColumnPaths(l(n({},i),{xDivision:R,barWidth:O,zeroH:X})),F=this.series[c][e]/this.yRatio[I]);const d=this.barHelpers.getPathFillColor(t,c,e,m);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:u.hexToRgba(h.globals.colors[c]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:s,realIndex:m,j:e});if(_.add(t),E.push(t),this._shadow=N&&[t,G[e-1].attr("d")],h.config.chart.dropShadow.enabled){new T(this.w).dropShadow(t,h.config.chart.dropShadow,m)}}this.pathArr.push(s);const g=this.barHelpers.drawGoalLine({barXPosition:s.barXPosition,barYPosition:s.barYPosition,goalX:s.goalX,goalY:s.goalY,barHeight:F,barWidth:O});g&&z.add(g),f=s.y,x=s.x,e>0&&v.push(x+(null!=O?O:0)/2),y.push(f),this.renderSeries(l(n({hl:null==p?void 0:p.bar(this,{i:c,j:e,realIndex:m,translationsIndex:I,paths:s,zeroH:X,zeroW:L}),realIndex:m,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:c,columnGroupIndex:C,pathFrom:s.pathFrom,pathTo:s.pathTo,strokeWidth:a,elSeries:w,x:x,y:f,series:t,barHeight:Math.abs(s.barHeight?s.barHeight:F),barWidth:Math.abs(s.barWidth?s.barWidth:O),elDataLabelsWrap:j,elGoalsMarkers:z,elBarShadows:_,visibleSeries:this.visibleI,type:"bar"}))}if(h.globals.seriesXvalues[m]=v,h.globals.seriesYvalues[m]=y,h.globals.previousPaths.length>0){const e=[];for(let a=0;a<t[c].length;a++)e.push(k(h,m,a));H({w:h,elSeries:w,record:this._prevRecord(m),newKeys:e,isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed})}g.add(w)}return g}renderSeries({hl:t,realIndex:e,pathFill:a,lineFill:s,j:i,i:r,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:b,elSeries:u,x:g,y:p,y1:x,y2:f,series:y,barHeight:v,barWidth:m,barXPosition:C,barYPosition:S,elDataLabelsWrap:P,elGoalsMarkers:A,elBarShadows:L,visibleSeries:H,type:D,classes:R,fadeReveal:X=!1}){var F,O,j,Y,B,z,_;const M=this.w,G=new c(this.w,this.ctx),E=function(t,e){const a=t&&t.renderer;return a&&a.kind&&"svg"!==a.kind?a:e}(this.ctx,G);let N=!1;const V=this._pathToInterp;if(this._pathToInterp=null,u._bindingsDelegated||(u._bindingsDelegated=!0,G.setupEventDelegation(u,`.apexcharts-${D}-area`)),!s){let t=function(t){const e=M.config.stroke.colors;let a;return Array.isArray(e)&&e.length>0&&(a=e[t],a||(a=""),"function"==typeof a)?a({value:M.seriesData.series[t][i],dataPointIndex:i,w:M}):a};const a="function"==typeof M.globals.stroke.colors[e]?t(e):M.globals.stroke.colors[e];s=this.barOptions.distributed?M.globals.stroke.colors[i]:a}const $=M.config.chart.animations,Z=$.animateGradually;let K=0,q=0;if(Z&&!1!==Z.enabled&&!(M.globals.dataChanged&&this.isLayoutShift(e))){const t=M.globals.dataPoints||1,e=Z.delay||0,a=Math.min(e,.5*$.speed/Math.max(1,t));q=I({style:"sequential",index:i,baseDelay:a}),M.config.chart.stacked&&!M.globals.dataChanged&&(q+=r*a*.5);K=q/(e||1)}const U=new W(this).handleBarDataLabels({x:g,y:p,y1:x,y2:f,i:r,j:i,series:y,realIndex:e,columnGroupIndex:o,barHeight:v,barWidth:m,barXPosition:C,barYPosition:S,visibleSeries:H,hl:null==t?void 0:t.label});if(q>0){const t=M.config.dataLabels;if((null==(F=t.animate)?void 0:F.enabled)||(null==(O=t.countUp)?void 0:O.enabled)){const t=String(Math.round(q));null==(Y=null==(j=U.dataLabels)?void 0:j.node)||Y.setAttribute("data:dlDelay",t),null==(z=null==(B=U.totalDataLabels)?void 0:B.node)||z.setAttribute("data:dlDelay",t)}}let J=!1;M.globals.isBarHorizontal||(U.dataLabelsPos.dataLabelsX+Math.max(m,M.globals.barPadForNumericAxis)<0||U.dataLabelsPos.dataLabelsX-Math.max(m,M.globals.barPadForNumericAxis)>M.layout.gridWidth)&&(this._wasOnScreen(e,i)?J=!0:N=!0),M.config.series[r].data[i]&&M.config.series[r].data[i].strokeColor&&(s=M.config.series[r].data[i].strokeColor);const Q=a;if(this.isNullValue&&-1===M.globals.collapsingSeriesIndices.indexOf(e)&&(a="none"),!N){const o=!0===(null==(_=this.ctx.morphTypeChange)?void 0:_.isActive()),c=o?this.ctx.morphTypeChange.getSpeed():M.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,i);g&&(h=d,K=0);const p=E.renderPaths({i:r,j:i,realIndex:e,pathFrom:h,pathTo:d,stroke:s,strokeWidth:b,strokeLineCap:M.config.stroke.lineCap,fill:a,pathToInterp:V,animationDelay:K,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:c,className:`apexcharts-${D}-area${R?` ${R}`:""}`,chartType:D,bindEventsOnPaths:!1,fadeReveal:X});p.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`),J&&p.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new w(M,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:c,delay:K})),g&&(p.node.setAttribute("opacity","0"),p.node.setAttribute("data-piece-hidden","1"));const C=M.config.forecastDataPoints;C.count>0&&i>=M.globals.dataPoints-C.count&&(p.node.setAttribute("stroke-dasharray",C.dashArray),p.node.setAttribute("stroke-width",C.strokeWidth),p.node.setAttribute("fill-opacity",C.fillOpacity)),void 0!==x&&void 0!==f&&(p.attr("data-range-y1",x),p.attr("data-range-y2",f));if(new T(this.w).setSelectionFilter(p,e,i),u.add(p),p.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:i,val:M.seriesData.series[r][i],barHeight:v,barWidth:m,"data:pathKey":k(M,e,i)}),null==t||t.paint(p,{delay:K,delayMs:q,speed:c,fill:Q,elSeries:u,elBarShadows:L,labels:U.dataLabels,pathFrom:h,pathTo:d}),"canvas"===E.kind){M.globals.barCanvasCoords||(M.globals.barCanvasCoords={}),M.globals.barCanvasCoords[e]||(M.globals.barCanvasCoords[e]={});const t=M.globals.barCanvasCoords[e][i];let a=(null==t?void 0:t.bounds)||null;const s=p.bbox();(s.width>0||s.height>0)&&(a={left:Math.min(a?a.left:1/0,s.x),top:Math.min(a?a.top:1/0,s.y),right:Math.max(a?a.right:-1/0,s.x+s.width),bottom:Math.max(a?a.bottom:-1/0,s.y+s.height)}),M.globals.barCanvasCoords[e][i]=l(n({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:m,type:D},void 0!==x&&void 0!==f&&{rangeY1:x,rangeY2:f}),{bounds:a})}null!==U.dataLabels&&P.add(U.dataLabels),U.totalDataLabels&&P.add(U.totalDataLabels),u.add(P),A&&u.add(A),L&&u.add(L)}return u}drawBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*a}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!u;if(u)c=u.y,e=u.height;else if(this.isFunnel&&!b){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=s?s:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:a,w:l}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:a,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(b||g)&&(s=p.x1,i=p.x),g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:s,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*a}else g=e+i*this.visibleI;a=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:a,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:l});return l.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:a,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:a,j:s}){const i=this.w;let r=a;return i.seriesData.seriesX[a].length||(r=i.globals.maxValsInArrayIndex),u.isNumber(i.seriesData.seriesX[r][s])&&(t=j.dataXToPx(i,i.seriesData.seriesX[r][s])-e*this.seriesLen/2),{barXPosition:t+(X(i)?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!P(this.w))return!1;const a=this._prevKeyedPaths(t);return!!a&&a.has(k(this.w,t,e))}_prevRecord(t){const e=this.w;let a=null;for(let s=0;s<e.globals.previousPaths.length;s++){const i=e.globals.previousPaths[s];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(a=i)}return a}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let a=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),a=t}return this._prevKeyed[t]=a,a}isLengthTransition(t){var e,a;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const s=this.w;let i=!1;if(P(s)&&s.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(a=null==(e=s.seriesData.series[t])?void 0:e.length)?a:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let a=0;a<o;a++)if(!e.has(k(s,t,a))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=L(this.w,t,!0,!0),a=!(!e||!e.join.changed);return this._layoutShiftCache[t]=a,a}getPreviousPath(t,e,a,s){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return P(i)?null:a;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const a=l.get(k(i,t,e));a?o=a.d:n=!0}else void 0!==r.paths[e]?o=r.paths[e].d:n=!0;return o?this.cornerMorph(o,a,s):n&&P(i)?null:a}cornerMorph(t,e,a){const s=Y.pathCommandCount(t),i=Y.pathCommandCount(e);if(s===i)return t;const r=new c(this.w),o=t=>{const e=Y.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=s<i?o(t)>1:o(e)>1;if(s<i){const e=r.roundPathCorners(t,0);if(Y.pathCommandCount(e)===i){if(n&&a){const t=r.roundPathCorners(a,0);Y.pathCommandCount(t)===i&&(this._pathToInterp=t)}return e}}else{const a=r.roundPathCorners(e,0);if(Y.pathCommandCount(a)===s){if(this._pathToInterp=a,n){const e=Y.squareLike(t),a=e?r.roundPathCorners(e,0):null;if(a&&Y.pathCommandCount(a)===s)return a}return t}}return e}static pathBox(t){if(!t)return null;const e=[],a=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=a.exec(t));){const t=s[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Y.pathBox(t);if(!e)return null;const{minX:a,maxX:s,minY:i,maxY:r,start:o,vertical:n}=e,l=(t,e,a)=>Math.abs(t-e)<=Math.abs(t-a)?[e,a]:[a,e];let h,d,c,b;n?(h=Math.abs(o[0]-a)<=Math.abs(o[0]-s)?a:s,d=h===a?s:a,[c,b]=l(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=l(o[0],a,s));const u=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${b} L ${d} ${b} L ${d} ${c}${u}`:`M ${h} ${c} L ${d} ${c} L ${d} ${b} L ${h} ${b}${u}`}getPreviousFlip(t,e){const a=this.w,s=this._prevRecord(t);if(!s)return null;const i=this._prevKeyedPaths(t),r=i?i.get(k(a,t,e)):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:Y,column:Y,barStacked:class extends Y{draw(t,e){const a=this.w;this.graphics=new c(this.w);const s=new O(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===a.config.chart.stackType&&(t=a.globals.comboCharts?e.map(t=>a.globals.seriesPercent[t]):a.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let o=0,h=0;const d=a.config.chart.animations,b=d.enabled&&d.dynamicAnimation.enabled&&a.globals.previousPaths.length>0;let g=!1;for(let s=0,d=0;s<t.length;s++,d++){const c=a.globals.comboCharts?e[s]:s,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(c);this.groupCtx=this.stacks[p];const f=[],y=[],v=this.setSeriesAxis(c);this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed;let m=this.graphics.group({class:"apexcharts-series",seriesName:u.escapeString(a.seriesData.seriesNames[c]),rel:s+1,"data:realIndex":c});D.addCollapsedClassToSeries(this.w,m,c);const C=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c});D.addCollapsedClassToSeries(this.w,C,c),(a.globals.collapsingSeriesIndices||[]).indexOf(c)>-1&&C.node.style.setProperty("--apexcharts-dl-exit",`${a.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),I=this.initialPositions(o,h,void 0,void 0,void 0,void 0,v),{xDivision:S,yDivision:P,zeroH:k,zeroW:A}=I;let L=I.barHeight,H=I.barWidth;h=I.y,o=I.x,a.globals.barHeight=L,a.globals.barWidth=H,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>k),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<a.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(s,e,c),u={indexes:{i:s,j:e,realIndex:c,translationsIndex:v,bc:d},strokeWidth:i,x:o,y:h,elSeries:m,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(l(n({},u),{zeroW:A,barHeight:L,yDivision:P})),H=this.series[s][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(l(n({},u),{xDivision:S,barWidth:H,zeroH:k})),L=this.series[s][e]/this.yRatio[v]);const I=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:L,barWidth:H});I&&w.add(I),h=p.y,o=p.x,f.push(o),y.push(h);const W=this.barHelpers.getPathFillColor(t,s,e,c);let D="";const R=a.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",X=this.cornerFlip(this.barHelpers.arrBorderRadius[c][e],a.seriesData.series[c][e]),F=b&&!X&&this.getPreviousFlip(c,e);(X||F)&&(D=R),F&&(D+=" apexcharts-flip-held",g=!0),m=this.renderSeries(l(n({hl:null==r?void 0:r.bar(this,{i:s,j:e,realIndex:c,translationsIndex:v,paths:p,zeroH:k,zeroW:A}),realIndex:c,pathFill:W.color},W.useRangeColor?{lineFill:W.color}:{}),{j:e,i:s,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:i,elSeries:m,x:o,y:h,series:t,barHeight:L,barWidth:H,elDataLabelsWrap:C,elGoalsMarkers:w,type:"bar",visibleSeries:x,classes:D}))}a.globals.seriesXvalues[c]=f,a.globals.seriesYvalues[c]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(m)}return g&&this.settleHeldMirrors(),i}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(){const t=this.w;if(!b.isBrowser())return;const e=t.config.chart.animations,a=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&u.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},a)}initialPositions(t,e,a,s,i,r,o){const n=this.w;let l,h;if(this.isHorizontal){s=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-l)/2}else{h=a=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,s=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;s>0?h=(a=s/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),i=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(a-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:a,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,columnGroupIndex:o,yDivision:n,elSeries:l}){var h,d,c,b,u;const g=this.w,p=r+o*e;let x;const f=t.i,y=t.j,v=t.realIndex,m=t.translationsIndex;let C=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)C+=this.groupCtx.prevXF[t][y];const w=this.groupCtx.prevX.length;if(w>0){let t=s;this.groupCtx.prevXVal[w-1][y]<0?t=(null==(h=this.series[f])?void 0:h[y])>=0?this.groupCtx.prevX[w-1][y]+C-2*(this.isReversed?C:0):this.groupCtx.prevX[w-1][y]:this.groupCtx.prevXVal[w-1][y]>=0&&(t=(null==(d=this.series[f])?void 0:d[y])>=0?this.groupCtx.prevX[w-1][y]:this.groupCtx.prevX[w-1][y]-C+2*(this.isReversed?C:0)),x=t}else x=s;i=null===(null==(c=this.series[f])?void 0:c[y])?x:x+(null==(b=this.series[f])?void 0:b[y])/this.invertedYRatio-2*(this.isReversed?(null==(u=this.series[f])?void 0:u[y])/this.invertedYRatio:0);const I=this.barHelpers.getBarpaths({barYPosition:p,barHeight:e,x1:x,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:f,j:y,w:g});return this.barHelpers.barBackground({j:y,i:f,y1:p,y2:e,elSeries:l}),r+=n,{pathTo:I.pathTo,pathFrom:I.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,v,y,m),barXPosition:x,barYPosition:p,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,columnGroupIndex:o,elSeries:n}){var l,h,d,c,b,u;const g=this.w,p=t.i,x=t.j,f=t.bc,y=t.realIndex,v=t.translationsIndex;if(g.axisFlags.isXNumeric){let t=g.seriesData.seriesX[y][x];t||(t=0),e=(t-g.globals.minX)/this.xRatio-i/2*g.globals.barGroups.length}const m=e+o*i;let C;const w=this.groupCtx,I=g.axisFlags.isXNumeric?g.seriesData.seriesX[y][x]:x,S=w.tops.get(I);if(S){const[t,e,a]=S;let s;e<0?s=(null==(l=this.series[p])?void 0:l[x])>=0?t-a+2*(this.isReversed?a:0):t:e>=0&&(s=(null==(h=this.series[p])?void 0:h[x])>=0?t:t+a-2*(this.isReversed?a:0)),void 0===s&&(s=g.layout.gridHeight),C=(null==(d=w.prevYF[0])?void 0:d.every(t=>0===t))&&w.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:s}else C=r;a=(null==(c=this.series[p])?void 0:c[x])?C-(null==(b=this.series[p])?void 0:b[x])/this.yRatio[v]+2*(this.isReversed?(null==(u=this.series[p])?void 0:u[x])/this.yRatio[v]:0):C;const P=this.barHelpers.getColumnPaths({barXPosition:m,barWidth:i,y1:C,y2:a,yRatio:this.yRatio[v],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:p,j:x,w:g}),k=w.yArrj[x];return isNaN(k)||w.tops.set(I,[k,w.yArrjVal[x],(S?S[2]:0)+w.yArrjF[x],(S?S[3]:0)+(g.seriesData.series[y][x]||0),S?Math.min(S[0],S[4]):1/0,S?Math.max(S[0],S[5]):-1/0]),this.barHelpers.barBackground({bc:f,j:x,i:p,x1:m,x2:i,elSeries:n}),{pathTo:P.pathTo,pathFrom:P.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,y,x,0),barXPosition:m,x:g.axisFlags.isXNumeric?e:e+s,y:a}}},rangeBar:class extends Y{draw(t,e){var a,s,i,r,o,l,h,d,b;const g=this.w,p=new c(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const x=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let c=0;c<t.length;c++){let f,y;const v=g.globals.comboCharts?e[c]:c,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(v),C=p.group({class:"apexcharts-series",seriesName:u.escapeString(g.seriesData.seriesNames[v]),rel:c+1,"data:realIndex":v});D.addCollapsedClassToSeries(this.w,C,v),t[c].length>0&&(this.visibleI=this.visibleI+1);const w=this.setSeriesAxis(v),I=this.barHelpers.initialPositions(v),{y:S,zeroW:P,x:A,zeroH:L}=I;let W=null!=(a=I.barWidth)?a:0,R=null!=(s=I.barHeight)?s:0;const X=null!=(i=I.yDivision)?i:0,F=null!=(r=I.xDivision)?r:0;y=S,f=A;const O=p.group({class:"apexcharts-datalabels","data:realIndex":v}),T=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(c,e,v),s=this.seriesRangeStart[c][e],i=this.seriesRangeEnd[c][e];let r=null,u=null,p=null;const x={x:f,y:y,strokeWidth:a,elSeries:C};let S=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(S=1),void 0===(null==(o=g.config.series[c].data)?void 0:o[e]))break;if(this.isHorizontal){p=y+R*this.visibleI;const t=(X-R*S)/2;if(null==(h=null==(l=g.config.series[c].data)?void 0:l[e])?void 0:h.x){const a=this.detectOverlappingBars({i:c,j:e,barYPosition:p,srty:t,barHeight:R,yDivision:X,initPositions:I});R=a.barHeight,p=a.barYPosition}r=this.drawRangeBarPaths(n({indexes:{i:c,j:e,realIndex:v},barHeight:R,barYPosition:p,zeroW:P,yDivision:X,y1:s,y2:i},x)),W=r.barWidth}else{g.axisFlags.isXNumeric&&(f=(g.seriesData.seriesX[c][e]-g.globals.minX)/this.xRatio-W/2),u=f+W*this.visibleI;const t=(F-W*S)/2;if(null==(b=null==(d=g.config.series[c].data)?void 0:d[e])?void 0:b.x){const a=this.detectOverlappingBars({i:c,j:e,barXPosition:u,srtx:t,barWidth:W,xDivision:F,initPositions:I});W=a.barWidth,u=a.barXPosition}r=this.drawRangeColumnPaths(n({indexes:{i:c,j:e,realIndex:v,translationsIndex:w},barWidth:W,barXPosition:u,zeroH:L,xDivision:F},x)),R=r.barHeight}const k=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:p,goalX:r.goalX,goalY:r.goalY,barHeight:R,barWidth:W});k&&T.add(k),y=r.y,f=r.x;const A=this.barHelpers.getPathFillColor(t,c,e,v);this.renderSeries({realIndex:v,pathFill:A.color,lineFill:A.useRangeColor?A.color:g.globals.stroke.colors[v],j:e,i:c,x:f,y:y,y1:s,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:a,elSeries:C,series:t,barHeight:R,barWidth:W,barXPosition:u,barYPosition:p,columnGroupIndex:m,elDataLabelsWrap:O,elGoalsMarkers:T,visibleSeries:this.visibleI,type:"rangebar"})}if(g.globals.previousPaths.length>0){const t=g.config.series[c].data||[],e=[];for(let a=0;a<t.length;a++)e.push(k(g,v,a));H({w:g,elSeries:C,record:this._prevRecord(v),newKeys:e,isHorizontal:this.isHorizontal,speed:g.config.chart.animations.dynamicAnimation.speed})}x.add(C)}return x}detectOverlappingBars({i:t,j:e,barYPosition:a,barXPosition:s,srty:i,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,b,u,g;const p=this.w;let x=[];const f=null==(b=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:b[e],y=null==(g=null==(u=p.config.series[t].data)?void 0:u[e])?void 0:g.x,v=Array.isArray(y)?y.join(" "):y,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(v),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===v&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(a=p.config.plotOptions.bar.rangeBarGroupRows?i+l*m:i+o*this.visibleI+l*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(o=d.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*m))):(m>-1&&!p.labelData.timescaleLabels.length&&(s=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:a,barXPosition:s,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:a,barWidth:s,barXPosition:i,zeroH:r}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:b}=t,u=this.yRatio[b],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=r-p/u,x=r-x/u):p=r;const y=Math.abs(x-p),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:s,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=v.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:s});e=t.x,i=t.barXPosition}else e+=a;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,c,d,b),barXPosition:i}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:a,y2:s,yDivision:i,barHeight:r,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(n+a/this.invertedYRatio),b=this.preventBarOverflow(n+s/this.invertedYRatio),u=this.getRangeValue(h,d),g=Math.abs(b-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:c,x2:b,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=u.start&&null!=u.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=i),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:u.start<0&&u.end<0?c:b,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,a){const s=this.w.waterfallData&&this.w.waterfallData.geometry;s&&isFinite(a.slotStart)&&isFinite(a.levelEnd)&&(s[t]||(s[t]=[]),s[t][e]=a)}getRangeValue(t,e){const a=this.w;return{start:a.rangeData.seriesRangeStart[t][e],end:a.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,l=(t,e)=>{for(var a in e||(e={}))i.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))r.call(e,a)&&o(t,a,e[a]);return t},n=(t,s)=>e(t,a(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Graphics,b=d.__apex_Environment_Environment;const u=d.__apex_Utils;function g(t,e){const a=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var a={};for(var o in t)i.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(null!=t&&s)for(var o of s(t))e.indexOf(o)<0&&r.call(t,o)&&(a[o]=t[o]);return a})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=a.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return n(l({},d),{data:Array.isArray(c)?c.slice():c})})}function p(t,e,a){const s=a&&void 0!==a[e]?a[e]:e+1;return null==t?{x:s,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:s,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function x(t,e,a){if(t&&t.fillColor)return t.fillColor;const s=a[e];return"string"==typeof s&&s?s:void 0}const f="__apexcharts_series_transforms__";var y,v;globalThis[f]||(globalThis[f]={}),y="waterfall","function"==typeof(v=function(t,e){var a,s,i;const r=e.config,o=e.globals;if(!Array.isArray(t))return t;o.waterfallRawSeries||(o.waterfallRawSeries=g(t,o));const h=o.waterfallRawSeries,d=(null==(s=null==(a=r.plotOptions)?void 0:a.waterfall)?void 0:s.colors)||{},c=null==(i=r.xaxis)?void 0:i.categories,b=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(o),f=[],y=[],v=[],m=h.map((t,e)=>{const a=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==b.indexOf(e))return f[e]=[],y[e]=[],v[e]=[],n(l({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const a=t[e],s=Array.isArray(a)?a[1]:a&&"object"==typeof a?a.y:a;if(Array.isArray(s)&&2===s.length)return!0}return!1}(a))return f[e]=a.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(!Array.isArray(e))return null;const a=u.parseNumber(e[0]),s=u.parseNumber(e[1]);return null===a||null===s?null:s-a}),y[e]=a.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,a=Array.isArray(e)?u.parseNumber(e[1]):null;return null===a?0:a}),v[e]=a.map(()=>null),t;const s=function(t,e,a){const s=[],i=[],r=[],o=[];let h=0,d=0;for(let c=0;c<t.length;c++){const{x:b,y:g,isSubtotal:f,isTotal:y,rest:v}=p(t[c],c,e);let m,C,w;if(y||f)m=y?0:d,C=h,w=y?"total":"subtotal",d=h;else{const t=u.parseNumber(g);if(null===t||!isFinite(t)){s.push(n(l({},v),{x:b,y:null})),i.push(null),r.push(h),o.push(null);continue}m=h,C=h+t,h=C,w=t<0?"negative":"positive"}const I=x(v,w,a);s.push(l(n(l({},v),{x:b,y:[m,C]}),I?{fillColor:I}:{})),i.push(C-m),r.push(h),o.push(w)}return{data:s,values:i,cumulative:r,kinds:o}}(a,c,d);return f[e]=s.values,y[e]=s.cumulative,v[e]=s.kinds,n(l({},t),{data:s.data})});return e.waterfallData={values:f,cumulative:y,kinds:v,geometry:[]},m})?globalThis[f][y]=v:console.warn(`ApexCharts: registerSeriesTransform("${y}") expects a function (series, w) => series.`),d.default.registerFeatures({waterfall:class{constructor(t,e){this.w=t,this.ctx=e}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var t,e;const a=this.w;if(!this.isActive())return;const s=null==(e=null==(t=a.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!s||!1===s.show)return;const i=a.dom.elGraphical,r=a.waterfallData&&a.waterfallData.geometry;if(!i||!r)return;this.removeConnectors();const o=new c(a,this.ctx),l=o.group({class:"apexcharts-waterfall-connectors"}),n=s.color||a.config.grid.borderColor,h=null==s.strokeWidth?1:s.strokeWidth,d=null==s.strokeDashArray?3:s.strokeDashArray;let b=0;for(let t=0;t<r.length;t++){const e=r[t];if(Array.isArray(e))for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1];if(!a||!s)continue;if(!(s.slotStart-a.slotEnd>.5))continue;const i=a.horizontal?o.drawLine(a.levelEnd,a.slotEnd,a.levelEnd,s.slotStart,n,d,h):o.drawLine(a.slotEnd,a.levelEnd,s.slotStart,a.levelEnd,n,d,h);i.node.classList.add("apexcharts-waterfall-connector"),l.add(i),b++}}if(!b)return;l.attr("clip-path",`url(#gridRectBarMask${a.globals.cuid})`);const u=i.node.querySelector(".apexcharts-xaxis");u?i.node.insertBefore(l.node,u):i.add(l),this.holdUntilBarsLand(l)}removeConnectors(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-waterfall-connectors");e&&e.parentNode&&e.parentNode.removeChild(e)}holdUntilBarsLand(t){const e=this.w;b.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});const m=d.__apex_DataLabels,C=(t,e,a,s)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:a,dataPointIndex:s,w:e});return Number.isFinite(i)?i:0};class w{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,a,s,i,r,o;const{x:h,y:d,y1:b,y2:u,i:g,j:p,realIndex:x,columnGroupIndex:f,barHeight:y,barWidth:v,barXPosition:m,barYPosition:w,visibleSeries:I,hl:S,noLabel:k}=t,P=this.w,A=new c(this.barCtx.w);this.hlt=null==S?void 0:S.total;const H=P.waterfallData&&P.waterfallData.values,L=S&&null!=S.val?S.val:H&&H[x]&&null!=H[x][p]?H[x][p]:null,R=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[x]:this.barCtx.strokeWidth;let W,D;P.axisFlags.isXNumeric&&!P.globals.isBarHorizontal?(W=h+v*(I+1),D=d+y*(I+1)-R):(W=h+v*I,D=d+y*I);let X=null,F=null,O=h,T=d,j={};const B=P.config.dataLabels,Y=this.barCtx.barOptions.dataLabels,_=this.barCtx.barOptions.dataLabels.total;void 0!==w&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(D=w,T=w),void 0!==m&&this.barCtx.isVerticalGroupedRangeBar&&(W=m,O=m);const z=C(B.offsetX,P,x,p),M=C(B.offsetY,P,x,p),G=(null==S?void 0:S.hide)?void 0:null!==L?L:void 0!==u?[b,u]:"100%"===P.config.chart.stackType?P.globals.seriesPercent[x][p]:P.seriesData.series[x][p];let N,E={width:0,height:0};B.enabled&&(N=void 0===G?"":B.formatter(G,n(l({},P),{seriesIndex:x,dataPointIndex:p,w:P})),E=A.getTextRects(N,parseFloat(B.style.fontSize).toString(),B.style.fontFamily,void 0,!0,B.style.fontWeight));const V={x:null!=(e=null==S?void 0:S.x)?e:h,y:null!=(a=null==S?void 0:S.y)?a:d,neg:S&&null!=S.val?S.val<0:void 0,i:g,j:p,realIndex:x,columnGroupIndex:f,bcx:W,bcy:D,barHeight:null!=(s=null==S?void 0:S.barHeight)?s:y,barWidth:null!=(i=null==S?void 0:S.barWidth)?i:v,textRects:E,strokeWidth:R,dataLabelsX:O,dataLabelsY:T,dataLabelsConfig:B,barDataLabelsConfig:Y,barTotalDataLabelsConfig:_,offX:z,offY:M};if(j=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(V):this.calculateColumnsDataLabelsPosition(V),null!==L&&this.barCtx.isHorizontal&&"center"===Y.position){const t=null==(o=null==(r=P.waterfallData.geometry)?void 0:r[x])?void 0:o[p];t&&t.horizontal&&(j.dataLabelsX=(t.levelStart+t.levelEnd)/2+z)}return X=k?null:this.drawCalculatedDataLabels({x:j.dataLabelsX,y:j.dataLabelsY,neg:V.neg,val:G,text:N,i:x,j:p,barWidth:V.barWidth,barHeight:V.barHeight,textRects:E,dataLabelsConfig:B}),P.config.chart.stacked&&_.enabled&&!1!==this.hlt&&(F=this.drawTotalDataLabels({x:j.totalDataLabelsX,y:j.totalDataLabelsY,barWidth:v,barHeight:y,realIndex:x,j:p,textAnchor:j.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:x,j:p}),rawVal:this.getStackedTotalValue({realIndex:x,j:p}),dataLabelsConfig:B,barTotalDataLabelsConfig:_})),{dataLabelsPos:j,dataLabels:X,totalDataLabels:F}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,a=this.getTotalGroupContext(t);return a&&e&&e.length>a.groupIndex?e[a.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const a=this.w,s=this.xStackTop(t,e);if(s)return s[3];const i=this.getTotalGroupContext(t),r=a.seriesData.stackedSeriesTotalsByGroups;return i&&r&&r[i.groupIndex]?r[i.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var a,s;const i=this.w;return i.axisFlags.isXNumeric&&(null==(s=null==(a=this.barCtx.stacks)?void 0:a[i.labelData.seriesGroupIndex[t]])?void 0:s.tops.get(i.seriesData.seriesX[t][e]))}totalRects(t,e){const a=this.barCtx.barOptions.dataLabels.total.style;return new c(this.w).getTextRects(this.getStackedTotalDataLabel({realIndex:t,j:e}),a.fontSize,a.fontFamily,void 0,!0,a.fontWeight)}getStackedTotalDataLabel({realIndex:t,j:e}){const a=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,n(l({},a),{seriesIndex:t,dataPointIndex:e,w:a}))),s}calculateColumnsDataLabelsPosition(t){var e;const a=this.w;let s,i,{j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:b,dataLabelsY:u,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,strokeWidth:x,offX:f,offY:y}=t;const v=n;d=Math.abs(d);const m="vertical"===a.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:r});n-=x/2;const w=a.layout.gridWidth/a.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=h/2:(b=a.axisFlags.isXNumeric?n-h/2+f:n-w+h/2+f,!a.config.chart.stacked&&C>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=h*C)),m){const t=2;b=b+c.height/2-x/2-t}const I=null!=(e=t.neg)?e:a.seriesData.series[o][r]<0;let S=l;switch(this.barCtx.isReversed&&(S=l+(I?d:-d)),g.position){case"center":u=m?I?S-d/2+y:S+d/2-y:I?S-d/2+c.height/2+y:S+d/2+c.height/2-y;break;case"bottom":u=m?I?S-d+y:S+d-y:I?S-d+c.height+x+y:S+d-c.height/2+x-y;break;case"top":u=m?I?S+y:S-y:I?S-c.height/2-y:S+c.height+y}let k=S;const P=this.getTotalGroupContext(o),A=this.xStackTop(o,r),H=A?[]:this.barCtx.stacks||[];if(A&&(k=I?Math.max(S,A[5]):Math.min(S,A[4])),H.forEach((t,e)=>{P&&e!==P.groupIndex||t.prevY.forEach(t=>{k=I?Math.max(t[r],k):Math.min(t[r],k)})}),this.hlt&&(k=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,r).height;s=I?k+.77*t-y-p.offsetY:k-.3*t+y+p.offsetY;const e=w;i=v+(a.axisFlags.isXNumeric?-h/2:h/2-e)+p.offsetX}return a.config.chart.stacked||(u<0?u=0+x:u+c.height/3>a.layout.gridHeight&&(u=a.layout.gridHeight-x)),{bcx:n,bcy:l,dataLabelsX:b,dataLabelsY:u,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,a;const s=this.w;let{x:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:b,dataLabelsConfig:u,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,offX:x,offY:f}=t;const y=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:r});let m,C,w;if(h=Math.abs(h),this.barCtx.isPyramid){m=l+n/2+f-(null!=(e=d.centerOffset)?e:0)}else m=l-(this.barCtx.isRangeBar?0:y)+n/2+d.height/2+f-3;!s.config.chart.stacked&&v>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(m-=n*v);let I="start";const S=null!=(a=t.neg)?a:s.seriesData.series[o][r]<0;let k=i;if(this.barCtx.isReversed&&(k=i+(S?-h:h),I=S?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+x;else switch(g.position){case"center":c=S?k+h/2-x:Math.max(d.width/2,k-h/2)+x;break;case"bottom":c=S?k+h-b-x:k-h+b+x;break;case"top":c=S?k-b-x:k-b+x}let P=k;const A=this.getTotalGroupContext(o),H=this.xStackTop(o,r),L=H?[]:this.barCtx.stacks||[];if(H&&(P=S?Math.min(k,H[4]):Math.max(k,H[5])),L.forEach((t,e)=>{A&&e!==A.groupIndex||t.prevX.forEach(t=>{P=S?Math.min(t[r],P):Math.max(t[r],P)})}),this.hlt&&(P=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,r);S?(C=P-b-x-p.offsetX,I="end"):C=P+x+p.offsetX+(this.barCtx.isReversed?-(h+b):b),w=m-d.height/2+t.height/2+p.offsetY+b,s.globals.barGroups.length>1&&!A&&(w-=s.globals.barGroups.length/2*(n/2))}if(!s.config.chart.stacked){const t=S&&"middle"!==u.textAnchor?"start"===u.textAnchor?"end":"start":u.textAnchor;let e;e="vertical"===g.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===g.orientation?d.height:d.width)-e;c+a>s.layout.gridWidth-b&&(c=s.layout.gridWidth-a-b),c-e<b&&(c=e+b)}return{bcx:i,bcy:l,dataLabelsX:c,dataLabelsY:m,totalDataLabelsX:C,totalDataLabelsY:w,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:a,text:s,neg:i,i:r,j:o,textRects:h,barHeight:d,barWidth:b,dataLabelsConfig:u}){var g,p,x;const f=this.w;let y="rotate(0)";"vertical"===f.config.plotOptions.bar.dataLabels.orientation&&(y=`rotate(-90, ${t}, ${e})`);const v=new m(this.barCtx.w,this.barCtx.ctx),C=new c(this.barCtx.w),w=u.formatter;let I=null;const S=f.globals.collapsedSeriesIndices.indexOf(r)>-1,k=(f.globals.collapsingSeriesIndices||[]).indexOf(r)>-1,P=`${r}::${this.barCtx._keys(r)[o]}`;if(k){const t=null==(g=f.globals.prevDataLabels)?void 0:g.get(P);t&&isFinite(t.val)&&(a=t.val,s=void 0)}if(u.enabled&&(!S||k)){I=C.group({class:"apexcharts-data-labels",transform:y});const c=f.config.dataLabels;((null==(p=c.animate)?void 0:p.enabled)||(null==(x=c.countUp)?void 0:x.enabled))&&(I.node.setAttribute("data:dlKey",P),I.node.setAttribute("data:dlJ",String(o)),"number"==typeof a&&isFinite(a)&&I.node.setAttribute("data:dlVal",String(a))),void 0===a?s="":void 0===s&&(s=w(a,n(l({},f),{seriesIndex:r,dataPointIndex:o,w:f}))),!a&&f.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(s="");let g=u.textAnchor;"vertical"===f.config.plotOptions.bar.dataLabels.orientation&&(g="center"===f.config.plotOptions.bar.dataLabels.position?"middle":(null!=i?i:f.seriesData.series[r][o]<0)?"end":"start"),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&b<h.width&&(s=""),f.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!k&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(b)&&(s=""):h.height/1.6>Math.abs(d)&&(s=""));const m=n(l({},u),{textAnchor:g});this.barCtx.isHorizontal&&a<0&&("start"===g?m.textAnchor="end":"end"===g&&(m.textAnchor="start")),v.plotDataLabelsText({x:t,y:e,text:s,i:r,j:o,parent:I,dataLabelsConfig:m,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return I}drawTotalDataLabels({x:t,y:e,val:a,rawVal:s,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:l}){var n,h;const d=new c(this.barCtx.w);let b;if(l.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){b=d.drawText({x:t,y:e,foreColor:l.style.color,text:a,textAnchor:o,fontFamily:l.style.fontFamily,fontSize:l.style.fontSize,fontWeight:l.style.fontWeight}),b.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const c=this.w.config.dataLabels;if((null==(n=c.animate)?void 0:n.enabled)||(null==(h=c.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);b.node.setAttribute("data:dlTotalKey",`${t}::${this.barCtx._keys(i)[r]}`),b.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof s&&isFinite(s)&&b.node.setAttribute("data:dlTotalVal",String(s))}}return b}}const I=d.__apex_Series,S=d.__apex_Fill,k=d.__apex_CoreUtils;function P(t){var e,a,s,i,r,o,l;return"histogram"===(null==(a=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:a.requestedType)&&(!1!==(null==(i=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:i.overlap)&&(null!=(l=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?l:0)>1)}class A{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t,e){const a=this.w;this.seriesIndex=e,this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let e=0;e<t.length;e++)if(t[e].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[e].length),a.axisFlags.isXNumeric)for(let s=0;s<t[e].length;s++)a.seriesData.seriesX[e][s]>a.globals.minX&&a.seriesData.seriesX[e][s]<a.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=a.globals.dataPoints;const s=a.labelData.labels;this.rows=a.globals.isBarHorizontal&&a.axisFlags.isXNumeric&&!this.barCtx.isRangeBar&&a.seriesData.seriesX.some(t=>null==t?void 0:t.some((t,e)=>t!==s[e]))?new Map(s.map((t,e)=>[t,e])):null,this.arrBorderRadius=this.createBorderRadiusArr(a.seriesData.series),u.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const a=t.globals.maxX-t.globals.minX;e=a>0?a/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const a=t.globals.minXDiff;e=a>0&&isFinite(a)&&.5!==a?a:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=this.seriesIndex,a=[];for(let s=0;s<t.length;s++){const i=t[s];e&&e.indexOf(s)<0||Array.isArray(i)&&i.length>0&&a.push(i.some((t,e)=>t<i[e-1])?i.filter(t=>t===+t).sort((t,e)=>t-e):i)}if(!a.length)return 0;const s=new Array(a.length).fill(0);let i=NaN,r=1/0;for(;;){let t=1/0,e=-1;for(let i=0;i<a.length;i++){const r=a[i];for(;s[i]<r.length&&"number"!=typeof r[s[i]];)s[i]++;if(s[i]>=r.length)continue;const o=r[s[i]];o==o?o<t&&(t=o,e=i):(s[i]++,i--)}if(-1===e)break;if(s[e]++,i==i){const e=t-i;e>0&&e<r&&(r=e)}i=t}return isFinite(r)?r:0}barRow(t,e){var a,s,i;return null!=(i=null==(s=this.rows)?void 0:s.get(null==(a=this.w.seriesData.seriesX[t])?void 0:a[e]))?i:e}initialPositions(t){const e=this.w;let a,s,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||P(e))&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),s=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(r=e/t),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){a=this.barCtx.getBarXForNumericXAxis({x:a,j:0,realIndex:t,barWidth:l}).x}else a=e.globals.padHorizontal+u.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:a,y:s,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,a,s){var i;const r=this.w,o=new S(this.barCtx.w);let l=null;const n=this.barCtx.barOptions.distributed?a:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][a]>=s.from&&t[e][a]<=s.to&&(l=s.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,a)||(null==(i=r.config.series[s].data[a])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(l=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?n:s,dataPointIndex:a,color:l,opacity:b,value:t[e][a],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const a=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=a.dumbbellData;if(!s||"series"!==s.form)return null;const i=a.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=s.order[e];if(!r)return null;const o=a.globals.colors[r[0]],l=a.globals.colors[r[1]];return o&&l?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:l,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,a){let s=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[a]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,a=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!s||s.has(t);if(!a||a.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:a.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}createBorderRadiusArr(t){const e=this.w,a=!this.w.config.chart.stacked||e.config.plotOptions.bar.borderRadius<=0,s=t.length,i=Math.max(0,...t.map(t=>0|(null==t?void 0:t.length))),r=Array.from({length:s},()=>Array(i).fill(a?"top":"none"));if(a)return r;const o="last"===e.config.plotOptions.bar.borderRadiusWhenStacked,l=o?"top":"both",n=o?"bottom":"both",h=o?"none":"bottom",d=o?"none":"top";for(const e of this.getStackedSeriesIndices(s))for(let a=0;a<i;a++){const s=[],i=[];for(const r of e){const e=t[r][a];e>0?s.push(r):e<0&&i.push(r)}if(s.length>0&&0===i.length)if(1===s.length)r[s[0]][a]=l;else{const t=s[0],e=s[s.length-1];for(const i of s)r[i][a]=i===t?h:i===e?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)r[i[0]][a]=n;else{const t=Math.min(...i),e=Math.max(...i);for(const s of i)r[s][a]=s===t?d:s===e?"bottom":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const e of s)r[e][a]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)r[t][a]=t===e?"bottom":"none"}}return r}barBackground({j:t,i:e,x1:a,x2:s,y1:i,y2:r,elSeries:o}){const l=this.w,n=new c(this.barCtx.w),h=new I(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=n.drawRect(void 0!==a?a:0,void 0!==i?i:0,void 0!==s?s:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:a,v2:s,strokeWidth:i,realIndex:r,j:o,dir:l,horizontal:n}){const h=this.w,d=new c(h);(i=Array.isArray(i)?i[r]:i)||(i=0);const b=h.config.series[r].data[o],u=n?null==b?void 0:b.barHeightOffset:null==b?void 0:b.columnWidthOffset;u&&(t-=u/2,e+=u);const g=i/2,p=l*(this.barCtx.isReversed?-1:1),x="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[r][o]?" Z":" z";let f,y,v,m,C,w;n?(v=t+g,m=t+e-g,f=a+.001+g*p,y=s+.001-g*p,C=d.line(f,m),w=d.move(f,v)+d.line(y,v)+d.line(y,m)+C+x):(f=t+g,y=t+e-g,v=a+.001-g*p,m=s+.001+g*p,C=d.line(y,v),w=d.move(f,v)+d.line(f,m)+d.line(y,m)+C+x);return{x1:f,x2:y,y1:v,y2:m,sl:C,closing:x,squarePathTo:w,pathTo:"none"!==this.arrBorderRadius[r][o]?d.roundPathCorners(w,h.config.plotOptions.bar.borderRadius):w,base:d.move(f,v)+d.line(f,v)+C+C+C+C+C+d.line(f,v)+x,strokeWidth:i,strokeCenter:g,direction:p}}getColumnPaths({barWidth:t,barXPosition:e,y1:a,y2:s,strokeWidth:i,series:r,realIndex:o,i:l,j:n,w:h}){var d,c,b;const u=this.barRect({a:e,len:t,v1:a,v2:s,strokeWidth:i,realIndex:o,j:n,dir:r[l][n]>=0?1:-1}),{pathTo:g,squarePathTo:p,strokeCenter:x,direction:f}=u;a=u.y1,s=u.y2;let y=null;const v=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,n);if(v?y=v:h.globals.previousPaths.length>0&&(y=this.barCtx.getPreviousPath(o,n,g,p)),null==y&&(y=u.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(s-x*f),t.yArrjF.push(Math.abs(a-s+u.strokeWidth*f)),t.yArrjVal.push(null!=(b=this.barCtx.series[l][n])?b:null)}return{pathTo:g,pathFrom:y,drawnBox:{x1:u.x1,x2:u.x2,y1:a,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:a,i:s,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new c(this.barCtx.w),b=l.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,g=u(a[s][i]),p=i===a[s].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:g:u(a[s][i+1]);const y=o/2,v=t+y,m=t+e-y,C=b-g,w=b+g,I=b-f,S=b+f,k=d.move(C,v)+d.line(w,v)+d.line(S,m)+d.line(I,m)+" Z";let P=null;const A=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return A?P=A:l.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(r,i,k)),null==P&&(P=d.move(b,v)+d.line(b,v)+d.line(b,m)+d.line(b,m)+" Z"),{pathTo:k,pathFrom:P,x:w,x1:C,barXPosition:b}}computePyramidLayout(t){const e=this.w,a=e.layout.gridHeight,s=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||a<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=s/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const s=l/r,h=e*a,d=s*a;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:s*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:a,bottomHalf:s,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new c(this.barCtx.w),b=l.layout.gridWidth/2,u=o/2,g=t+u,p=t+e-u,x=b-a,f=b+a,y=b-s,v=b+s,m=d.move(x,g)+d.line(f,g)+d.line(v,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(b,g)+d.line(b,g)+d.line(b,p)+d.line(b,p)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:b}}getBarpaths({barYPosition:t,barHeight:e,x1:a,x2:s,strokeWidth:i,series:r,realIndex:o,i:l,j:n,w:h}){var d,b,u;const g=new c(this.barCtx.w),p=this.barRect({a:t,len:e,v1:a,v2:s,strokeWidth:i,realIndex:o,j:n,dir:r[l][n]>=0?1:-1,horizontal:!0}),{y1:x,y2:f,sl:y,closing:v,squarePathTo:m,pathTo:C,strokeCenter:w,direction:I}=p;a=p.x1,s=p.x2;const S=this.barCtx.isFunnel,k=S?(a+s)/2:a;let P=null;const A=null==(b=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:b.getInitialPathFor(o,n);if(A?P=A:h.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(o,n,C,m)),null==P){const t=S?g.line(k,f):y;P=g.move(k,x)+g.line(k,x)+t+t+t+t+t+g.line(k,x)+v}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(s+w*I),t.xArrjF.push(Math.abs(a-s-p.strokeWidth*I)),t.xArrjVal.push(null!=(u=this.barCtx.series[l][n])?u:null)}return{pathTo:C,pathFrom:P,drawnBox:{x1:a,x2:s,y1:x,y2:f}}}getXForValue(t,e,a=!0){let s=a?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,a,s=!0){let i=s?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[a]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[a]:0)),i}getGoalValues(t,e,a,s,i,r){const o=this.w,h=[],d=(i,l)=>{o.globals.invalidLogScale||(i=new k(o).getLogValAtSeriesIndex(i,s)),h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,a,r,!1),attrs:l})};if(o.seriesData.seriesGoals[s]&&o.seriesData.seriesGoals[s][i]&&Array.isArray(o.seriesData.seriesGoals[s][i])&&o.seriesData.seriesGoals[s][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,i);if(e.length){const a={strokeHeight:"x"===t?0:o.globals.markers.size[s],strokeWidth:"x"===t?o.globals.markers.size[s]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=n(l({},a),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,s,i,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===r&&r!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const a=this.w,s=[],i=a.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&s.push({value:r,color:a.globals.colors[e],index:e})}return s}if(!a.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:a.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:a.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:a.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,a,s){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:a,endpointIndex:s,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,a,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:a,goalY:s,barWidth:i,barHeight:r}){if(!(Array.isArray(a)&&a.length>0||Array.isArray(s)&&s.length>0))return null;const o=new c(this.barCtx.w),l=o.group({class:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const a=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+a+r/2;n=o.drawLine(t.x,s-2*a,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n),t.attrs.label&&l.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-a,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const a=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,s=t+a+i/2;n=o.drawLine(s-2*a,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n),e.attrs.label&&l.add(this.drawDumbbellLabel(e.attrs,{x:s-a,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),l}drawDumbbellLabel(t,e){const a=this.w,s=new c(a),i=a.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return s.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:a,realIndex:s,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:b}=e,g=n+e.barHeight,p=new c(this.barCtx.w),x=new u,f=p.move(l,g)+p.line(o,g)+p.line(h,b)+p.line(d,b)+p.line(l,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][i]?" Z":" z");return p.drawPath({d:f,fill:x.shadeColor(.5,u.rgb2hex(a)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var a;const s=this.w;let i=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(a=s.globals.columnSeries)?void 0:a.i.map(t=>t))||[]).forEach(a=>{const o=s.seriesData.series[a][e];o&&i++,a<t&&!o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),a=this.barCtx.columnGroupIndices;let s=a.indexOf(e);return s<0&&(a.push(e),s=a.length-1),{groupIndex:e,columnGroupIndex:s}}}const H=d.__apex_Filters,L=d.__apex_Animations,R=d.__apex_Animations_computeStagger,W=d.__apex_BrowserAPIs_BrowserAPIs;function D(t){var e;const a=t.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const s=null!=(e=a.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(b.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function X(t){const e=new Map;return t.map(t=>{const a=e.get(t)||0;return e.set(t,a+1),0===a?t:`${t}#${a}`})}function F(t,e,a=0|(a=>null==(a=t.seriesData.series[e])?void 0:a.length)()){return X(Array.from({length:a},(a,s)=>function(t,e,a){var s,i,r,o;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[a])return"x:"+s[a]}const l=null==(o=t.globals.labels)?void 0:o[a];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+a}(t,e,s)))}function O(t,e,a=!1,s=!1){var i,r;if(!D(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const l=null==(i=o.seriesY)?void 0:i[e],n=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(l)||!Array.isArray(n))return null;if(!l.length||!n.length)return null;const h=X(l.map((t,a)=>function(t,e,a){var s,i;if(t.isXNumeric){const i=null==(s=t.seriesX)?void 0:s[e];if(i&&i.length&&null!=i[a])return"x:"+i[a]}const r=null==(i=t.labels)?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}(o,e,a))),d=F(t,e),c=function(t,e){const a=new Map;t.forEach((t,e)=>{a.has(t)||a.set(t,e)});const s=new Array(e.length),i=new Set;let r=-1,o=!0,l=t.length===e.length;e.forEach((t,e)=>{const n=a.has(t)&&!i.has(a.get(t))?a.get(t):-1;s[e]=n,-1!==n&&(i.add(n),n<r&&(o=!1),r=n),n!==e&&(l=!1)});const n=[];for(let e=0;e<t.length;e++)i.has(e)||n.push(e);return{toOld:s,exits:n,ordered:o,changed:!l}}(h,d);return(c.ordered||s)&&(c.changed||a)?{join:c,oldKeys:h,newKeys:d}:null}function T({w:t,elSeries:e,record:a,newKeys:s,isHorizontal:i,speed:r}){var o;if(!D(t))return;if(!a||!Array.isArray(a.paths)||!(null==e?void 0:e.node))return;const l=new Set(s),n=a.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new c(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(a.realIndex),10)];n.forEach(s=>{let o=s.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const l=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),n=l.node;n.setAttribute("pointer-events","none"),l.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const a=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(a)&&isFinite(s)?{x:a,y:s}:null}(s.d);let b=i?"left center":"center bottom";try{const t=n.getBBox();c&&t&&(b=i?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const u=n.style;u.transformBox="fill-box",u.transformOrigin=b,n.setAttribute("data:ghostKey",`${a.realIndex}::${s.key}`);try{const t=n.getBBox(),e=i?b.startsWith("left")?t.x:t.x+t.width:b.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&n.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,r||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const a=Math.max(0,Math.min(1,(e-p)/g)),s=1-Math.pow(1-a,3),r=1-s;u.transform=i?`scaleX(${r})`:`scaleY(${r})`,u.opacity=String(1-s),a<1?W.requestAnimationFrame(x):n.parentNode.removeChild(n)};W.requestAnimationFrame(x)})}class j{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/j.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*j.xRatio(t)}static plotRect(t){var e,a,s;const i=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(a=t.dom.baseEl)?void 0:a.querySelector(".apexcharts-svg")),r=(null==(s=i||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},o=(i&&t.globals.svgWidth?r.width/t.globals.svgWidth:1)||1;return{left:r.left+t.layout.translateX*o,top:r.top+t.layout.translateY*o,width:t.layout.gridWidth*o,height:t.layout.gridHeight*o,zoom:o}}static screenXToPlotPx(t,e,a=j.plotRect(t)){return(e-a.left)/a.zoom}}class B{constructor(t,e,a){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=a,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.invertedXRatio=a.invertedXRatio,this.invertedYRatio=a.invertedYRatio,this.baseLineY=a.baseLineY,this.baseLineInvertedY=a.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const s=new I(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=s.getBarSeriesIndices(),r=new k(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new A(this)}setSeriesAxis(t){var e;return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.isReversed=null==(e=this.w.config.yaxis[this.yaxisIndex])?void 0:e.reversed,this.translationsIndex}draw(t,e){var a,s,i,r,o;const h=this.w,d=new c(this.w),b=new k(this.w);t=b.getLogSeries(t),this.series=t,this.yRatio=b.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e);const g=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),p=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let c=0,b=0;c<t.length;c++,b++){let x,f;const y=[],v=[],m=h.globals.comboCharts?e[c]:c,{columnGroupIndex:C}=this.barHelpers.getGroupIndex(m),w=d.group({class:"apexcharts-series",rel:c+1,seriesName:u.escapeString(h.seriesData.seriesNames[m]),"data:realIndex":m});I.addCollapsedClassToSeries(this.w,w,m),t[c].length>0&&(this.visibleI=this.visibleI+1);const S=this.setSeriesAxis(m);this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[c]));const k=this.barHelpers.initialPositions(m),{y:P,yDivision:A,zeroW:L,x:R,xDivision:W,zeroH:D}=k;let X=k.barHeight,F=k.barWidth;f=P,x=R,this.isHorizontal||v.push(x+(null!=F?F:0)/2);const O=d.group({class:"apexcharts-datalabels","data:realIndex":m}),j=h.config.dataLabels,B=!(null==(a=j.animate)?void 0:a.enabled)&&this.isLengthTransition(m);h.globals.dataChanged&&!B&&!(!(null==(s=j.animate)?void 0:s.enabled)&&!(null==(i=j.countUp)?void 0:i.enabled))||(h.globals.delayedElements.push({el:O.node,holdUntilComplete:B}),O.node.classList.add("apexcharts-element-hidden"));const Y=d.group({class:"apexcharts-bar-goals-markers"}),_=d.group({class:"apexcharts-bar-shadows"}),z=this.ctx,M=z._barShadows,G=z._barShadows=[],N=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==M?void 0:M.length)===t[c].length-1;N||(h.globals.delayedElements.push({el:_.node}),_.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[c].length;e++){const a=this.barHelpers.getStrokeWidth(c,e,m);let s=null;const i={indexes:{i:c,j:e,realIndex:m,translationsIndex:S,bc:b},x:x,y:f,strokeWidth:a,elSeries:w};this.isHorizontal?(s=this.drawBarPaths(n(l(l({},i),this.barHelpers.rows&&{y:P+this.barHelpers.barRow(m,e)*A}),{barHeight:X,zeroW:L,yDivision:A})),F=this.series[c][e]/this.invertedYRatio):(s=this.drawColumnPaths(n(l({},i),{xDivision:W,barWidth:F,zeroH:D})),X=this.series[c][e]/this.yRatio[S]);const d=this.barHelpers.getPathFillColor(t,c,e,m);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:u.hexToRgba(h.globals.colors[c]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:s,realIndex:m,j:e});if(_.add(t),G.push(t),this._shadow=N&&[t,M[e-1].attr("d")],h.config.chart.dropShadow.enabled){new H(this.w).dropShadow(t,h.config.chart.dropShadow,m)}}this.pathArr.push(s);const g=this.barHelpers.drawGoalLine({barXPosition:s.barXPosition,barYPosition:s.barYPosition,goalX:s.goalX,goalY:s.goalY,barHeight:X,barWidth:F});g&&Y.add(g),f=s.y,x=s.x,e>0&&v.push(x+(null!=F?F:0)/2),y.push(f),this.renderSeries(n(l({hl:null==p?void 0:p.bar(this,{i:c,j:e,realIndex:m,translationsIndex:S,paths:s,zeroH:D,zeroW:L}),realIndex:m,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:c,columnGroupIndex:C,pathFrom:s.pathFrom,pathTo:s.pathTo,strokeWidth:a,elSeries:w,x:x,y:f,series:t,barHeight:Math.abs(s.barHeight?s.barHeight:X),barWidth:Math.abs(s.barWidth?s.barWidth:F),barXPosition:s.barXPosition,elDataLabelsWrap:O,elGoalsMarkers:Y,elBarShadows:_,visibleSeries:this.visibleI,type:"bar"}))}h.globals.seriesXvalues[m]=v,h.globals.seriesYvalues[m]=y,h.globals.previousPaths.length>0&&T({w:h,elSeries:w,record:this._prevRecord(m),newKeys:this._keys(m),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),g.add(w)}return g}renderSeries({hl:t,realIndex:e,pathFill:a,lineFill:s,j:i,i:r,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:b,elSeries:u,x:g,y:p,y1:x,y2:f,series:y,barHeight:v,barWidth:m,barXPosition:C,barYPosition:I,elDataLabelsWrap:S,elGoalsMarkers:k,elBarShadows:P,visibleSeries:A,type:W,classes:D,fadeReveal:X=!1,noLabel:F}){var O,T,j,B,Y,_,z;const M=this.w,G=new c(this.w,this.ctx),N=function(t,e){const a=t&&t.renderer;return a&&a.kind&&"svg"!==a.kind?a:e}(this.ctx,G);let E=!1;const V=this._pathToInterp;if(this._pathToInterp=null,u._bindingsDelegated||(u._bindingsDelegated=!0,G.setupEventDelegation(u,`.apexcharts-${W}-area`)),!s){let t=function(t){const e=M.config.stroke.colors;let a;return Array.isArray(e)&&e.length>0&&(a=e[t],a||(a=""),"function"==typeof a)?a({value:M.seriesData.series[t][i],dataPointIndex:i,w:M}):a};const a="function"==typeof M.globals.stroke.colors[e]?t(e):M.globals.stroke.colors[e];s=this.barOptions.distributed?M.globals.stroke.colors[i]:a}const $=M.config.chart.animations,Z=$.animateGradually;let K=0,q=0;if(Z&&!1!==Z.enabled&&!(M.globals.dataChanged&&this.isLayoutShift(e))){const t=M.globals.dataPoints||1,e=Z.delay||0,a=Math.min(e,.5*$.speed/Math.max(1,t));q=R({style:"sequential",index:i,baseDelay:a}),M.config.chart.stacked&&!M.globals.dataChanged&&(q+=r*a*.5);K=q/(e||1)}const U=new w(this).handleBarDataLabels({x:g,y:p,y1:x,y2:f,i:r,j:i,series:y,realIndex:e,columnGroupIndex:o,barHeight:v,barWidth:m,barXPosition:C,barYPosition:I,visibleSeries:A,hl:null==t?void 0:t.label,noLabel:F});if(q>0){const t=M.config.dataLabels;if((null==(O=t.animate)?void 0:O.enabled)||(null==(T=t.countUp)?void 0:T.enabled)){const t=String(Math.round(q));null==(B=null==(j=U.dataLabels)?void 0:j.node)||B.setAttribute("data:dlDelay",t),null==(_=null==(Y=U.totalDataLabels)?void 0:Y.node)||_.setAttribute("data:dlDelay",t)}}let J=!1;if(!M.globals.isBarHorizontal){const t=void 0===C?U.dataLabelsPos.dataLabelsX:C+m/2,a=Math.max(m,M.globals.barPadForNumericAxis);(t+a<0||t-a>M.layout.gridWidth)&&(this._wasOnScreen(e,i)?J=!0:E=!0)}const Q=M.config.series[e].data[i];Q&&Q.strokeColor&&(s=Q.strokeColor);const tt=a;if(this.isNullValue&&-1===M.globals.collapsingSeriesIndices.indexOf(e)&&(a="none"),!E){const o=!0===(null==(z=this.ctx.morphTypeChange)?void 0:z.isActive()),c=o?this.ctx.morphTypeChange.getSpeed():M.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,i);g&&(h=d,K=0);const p=N.renderPaths({i:r,j:i,realIndex:e,pathFrom:h,pathTo:d,stroke:s,strokeWidth:b,strokeLinecap:M.config.stroke.lineCap,fill:a,pathToInterp:V,animationDelay:K,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:c,className:`apexcharts-${W}-area${D?` ${D}`:""}`,chartType:W,bindEventsOnPaths:!1,fadeReveal:X});p.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`),J&&p.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new L(M,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:c,delay:K})),g&&(p.node.setAttribute("opacity","0"),p.node.setAttribute("data-piece-hidden","1"));const C=M.config.forecastDataPoints;C.count>0&&i>=M.globals.dataPoints-C.count&&(p.node.setAttribute("stroke-dasharray",C.dashArray),p.node.setAttribute("stroke-width",C.strokeWidth),p.node.setAttribute("fill-opacity",C.fillOpacity)),void 0!==x&&void 0!==f&&(p.attr("data-range-y1",x),p.attr("data-range-y2",f));if(new H(this.w).setSelectionFilter(p,e,i),u.add(p),p.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:i,val:M.seriesData.series[e][i],barHeight:v,barWidth:m,"data:pathKey":this._keys(e)[i]}),null==t||t.paint(p,{delay:K,delayMs:q,speed:c,fill:tt,elSeries:u,elBarShadows:P,labels:U.dataLabels,pathFrom:h,pathTo:d}),"canvas"===N.kind){M.globals.barCanvasCoords||(M.globals.barCanvasCoords={}),M.globals.barCanvasCoords[e]||(M.globals.barCanvasCoords[e]={});const t=M.globals.barCanvasCoords[e][i];let a=(null==t?void 0:t.bounds)||null;const s=p.bbox();(s.width>0||s.height>0)&&(a={left:Math.min(a?a.left:1/0,s.x),top:Math.min(a?a.top:1/0,s.y),right:Math.max(a?a.right:-1/0,s.x+s.width),bottom:Math.max(a?a.bottom:-1/0,s.y+s.height)}),M.globals.barCanvasCoords[e][i]=n(l({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:m,type:W},void 0!==x&&void 0!==f&&{rangeY1:x,rangeY2:f}),{bounds:a})}null!==U.dataLabels&&S.add(U.dataLabels),U.totalDataLabels&&S.add(U.totalDataLabels),u.add(S),k&&u.add(k),P&&u.add(P)}return u}drawBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:a,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:t.realIndex,j:d});a>0&&(e=this.seriesLen*e/a),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!u;if(u)c=u.y,e=u.height;else if(this.isFunnel&&!b){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=s?s:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:a,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:a,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||g)&&(s=p.x1,i=p.x),g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:s,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:h,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*a}else g=e+i*this.visibleI;a=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:a,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:a,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:a,j:s}){const i=this.w,r=P(i);let o=a;return i.seriesData.seriesX[a].length||(o=i.globals.maxValsInArrayIndex),u.isNumber(i.seriesData.seriesX[o][s])&&(t=j.dataXToPx(i,i.seriesData.seriesX[o][s])-e*(r?1:this.seriesLen)/2),{barXPosition:t+(r?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!D(this.w))return!1;const a=this._prevKeyedPaths(t);return!!a&&a.has(this._keys(t)[e])}_keys(t){const e=this._keyCache||(this._keyCache={});return e[t]||(e[t]=F(this.w,t))}_prevRecord(t){const e=this.w;let a=null;for(let s=0;s<e.globals.previousPaths.length;s++){const i=e.globals.previousPaths[s];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(a=i)}return a}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let a=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),a=t}return this._prevKeyed[t]=a,a}isLengthTransition(t){var e,a,s,i,r,o;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const l=this.w;let n=!1;if(D(l)&&l.globals.previousPaths.length>0){const h=this._prevRecord(t),d=null!=(a=null==(e=l.seriesData.series[t])?void 0:e.length)?a:0,c=h&&this._prevKeyedPaths(t);if(h)if(c){const e=new Set(this._keys(t));n=(null!=(o=null==(r=null==(i=null==(s=l.globals.prevStreamFrame)?void 0:s.seriesY)?void 0:i[t])?void 0:r.length)?o:d)!==d||[...c.keys()].some(t=>!e.has(t))}else n=h.paths.length!==d;else n=d>0}return this._ltCache[t]=n,n}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=O(this.w,t,!0,!0),a=!(!e||!e.join.changed);return this._layoutShiftCache[t]=a,a}getPreviousPath(t,e,a,s){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return D(i)?null:a;let o=null,l=!1;const n=this._prevKeyedPaths(t);if(n){const a=n.get(this._keys(t)[e]);a?o=a.d:l=!0}else void 0!==r.paths[e]?o=r.paths[e].d:l=!0;return o?this.cornerMorph(o,a,s):l&&D(i)?null:a}cornerMorph(t,e,a){const s=B.pathCommandCount(t),i=B.pathCommandCount(e);if(s===i)return t;const r=new c(this.w),o=t=>{const e=B.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=s<i?o(t)>1:o(e)>1;if(s<i){const e=r.roundPathCorners(t,0);if(B.pathCommandCount(e)===i){if(l&&a){const t=r.roundPathCorners(a,0);B.pathCommandCount(t)===i&&(this._pathToInterp=t)}return e}}else{const a=r.roundPathCorners(e,0);if(B.pathCommandCount(a)===s){if(this._pathToInterp=a,l){const e=B.squareLike(t),a=e?r.roundPathCorners(e,0):null;if(a&&B.pathCommandCount(a)===s)return a}return t}}return e}static pathBox(t){if(!t)return null;const e=[],a=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=a.exec(t));){const t=s[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=B.pathBox(t);if(!e)return null;const{minX:a,maxX:s,minY:i,maxY:r,start:o,vertical:l}=e,n=(t,e,a)=>Math.abs(t-e)<=Math.abs(t-a)?[e,a]:[a,e];let h,d,c,b;l?(h=Math.abs(o[0]-a)<=Math.abs(o[0]-s)?a:s,d=h===a?s:a,[c,b]=n(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=n(o[0],a,s));const u=t.trim().endsWith("Z")?" Z":" z";return l?`M ${h} ${c} L ${h} ${b} L ${d} ${b} L ${d} ${c}${u}`:`M ${h} ${c} L ${d} ${c} L ${d} ${b} L ${h} ${b}${u}`}getPreviousFlip(t,e){const a=this._prevRecord(t);if(!a)return null;const s=this._prevKeyedPaths(t),i=s?s.get(this._keys(t)[e]):a.paths[e];return i?!!i.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:B,column:B,barStacked:class extends B{draw(t,e){const a=this.w;this.graphics=new c(this.w);const s=new k(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e),"100%"===a.config.chart.stackType&&(t=a.globals.comboCharts?e.map(t=>a.globals.seriesPercent[t]):a.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let o=0,h=0;const d=a.config.chart.animations,b=d.enabled&&d.dynamicAnimation.enabled&&a.globals.previousPaths.length>0;let g=!1;for(let s=0,d=0;s<t.length;s++,d++){const c=a.globals.comboCharts?e[s]:s,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(c);this.groupCtx=this.stacks[p];const f=[],y=[],v=this.setSeriesAxis(c);let m=this.graphics.group({class:"apexcharts-series",seriesName:u.escapeString(a.seriesData.seriesNames[c]),rel:s+1,"data:realIndex":c});I.addCollapsedClassToSeries(this.w,m,c);const C=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c});I.addCollapsedClassToSeries(this.w,C,c),(a.globals.collapsingSeriesIndices||[]).indexOf(c)>-1&&C.node.style.setProperty("--apexcharts-dl-exit",`${a.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),S=this.initialPositions(o,h,void 0,void 0,void 0,void 0,v),{xDivision:k,yDivision:P,zeroH:A,zeroW:H}=S;let L=S.barHeight,R=S.barWidth;h=S.y,o=S.x,a.globals.barHeight=L,a.globals.barWidth=R,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>A),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<a.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(s,e,c),u={indexes:{i:s,j:e,realIndex:c,translationsIndex:v,bc:d},strokeWidth:i,x:o,y:h,elSeries:m,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(n(l(l({},u),this.barHelpers.rows&&{y:S.y+this.barHelpers.barRow(c,e)*P}),{zeroW:H,barHeight:L,yDivision:P})),R=this.series[s][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(n(l({},u),{xDivision:k,barWidth:R,zeroH:A})),L=this.series[s][e]/this.yRatio[v]);const I=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:L,barWidth:R});I&&w.add(I),h=p.y,o=p.x,f.push(o),y.push(h);const W=this.barHelpers.getPathFillColor(t,s,e,c);let D="";const X=a.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",F=this.cornerFlip(this.barHelpers.arrBorderRadius[c][e],a.seriesData.series[c][e]),O=b&&!F&&this.getPreviousFlip(c,e);(F||O)&&(D=X),O&&(D+=" apexcharts-flip-held",g=!0),m=this.renderSeries(n(l({hl:null==r?void 0:r.bar(this,{i:s,j:e,realIndex:c,translationsIndex:v,paths:p,zeroH:A,zeroW:H}),realIndex:c,pathFill:W.color},W.useRangeColor?{lineFill:W.color}:{}),{j:e,i:s,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:i,elSeries:m,x:o,y:h,series:t,barHeight:L,barWidth:R,barXPosition:p.barXPosition,elDataLabelsWrap:C,elGoalsMarkers:w,type:"bar",visibleSeries:x,classes:D}))}a.globals.seriesXvalues[c]=f,a.globals.seriesYvalues[c]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(m)}return g&&this.settleHeldMirrors(i),i}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(t){const e=this.w;if(!b.isBrowser())return;const a=e.config.chart.animations,s=(a.dynamicAnimation.speed||0)+(a.speed||0)+100,i=(t?t.node:e.dom.baseEl).querySelectorAll(".apexcharts-flip-held");setTimeout(()=>{i.forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,a,s,i,r,o){const l=this.w;let n,h;if(this.isHorizontal){s=l.layout.gridHeight/l.globals.dataPoints;const t=l.config.plotOptions.bar.barHeight;n=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=l.globals.padHorizontal+(this.isReversed?l.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-n)/2}else{h=a=l.layout.gridWidth/l.globals.dataPoints;const e=l.config.plotOptions.bar.columnWidth,s=l.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;s>0?h=(a=s/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),i=this.isReversed?this.baseLineY[o]:l.layout.gridHeight-this.baseLineY[o],t=l.globals.padHorizontal+(a-h)/2}const d=l.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:a,barHeight:(null!=n?n:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,columnGroupIndex:o,yDivision:l,elSeries:n}){var h,d;const c=this.w,b=r+o*e;let u;const g=t.i,p=t.j,x=t.realIndex,f=t.translationsIndex,y=null!=(d=null==(h=this.series[g])?void 0:h[p])?d:null,v=this.groupCtx,m=c.axisFlags.isXNumeric?c.seriesData.seriesX[x][p]:p,C=v.tops.get(m);if(C){const[t,e,a]=C,s=2*(this.isReversed?a:0);u=e<0?y>=0?t+a-s:t:y>=0?t:t-a+s}else u=s;i=u+y/this.invertedYRatio*(this.isReversed?-1:1);const w=this.barHelpers.getBarpaths({barYPosition:b,barHeight:e,x1:u,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:g,j:p,w:c});return this._setTop(m,C,v.xArrj[p],v.xArrjVal[p],v.xArrjF[p],x,p),this.barHelpers.barBackground({j:p,i:g,y1:b,y2:e,elSeries:n}),r+=l,{pathTo:w.pathTo,pathFrom:w.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,x,p,f),barXPosition:u,barYPosition:b,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,columnGroupIndex:o,elSeries:l}){var n,h,d;const c=this.w,b=t.i,u=t.j,g=t.bc,p=t.realIndex,x=t.translationsIndex,f=null!=(h=null==(n=this.series[b])?void 0:n[u])?h:null;if(c.axisFlags.isXNumeric){let t=c.seriesData.seriesX[p][u];t||(t=0),e=(t-c.globals.minX)/this.xRatio-i/2*c.globals.barGroups.length}const y=e+o*i;let v;const m=this.groupCtx,C=c.axisFlags.isXNumeric?c.seriesData.seriesX[p][u]:u,w=m.tops.get(C);if(w){const[t,e,a]=w;let s;e<0?s=f>=0?t-a+2*(this.isReversed?a:0):t:e>=0&&(s=f>=0?t:t+a-2*(this.isReversed?a:0)),void 0===s&&(s=c.layout.gridHeight),v=(null==(d=m.prevYF[0])?void 0:d.every(t=>0===t))&&m.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:s}else v=r;a=v-f/this.yRatio[x]*(this.isReversed?-1:1);const I=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:i,y1:v,y2:a,yRatio:this.yRatio[x],strokeWidth:c.config.stroke.show?this.strokeWidth:0,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:b,j:u,w:c});return this._setTop(C,w,m.yArrj[u],m.yArrjVal[u],m.yArrjF[u],p,u),this.barHelpers.barBackground({bc:g,j:u,i:b,x1:y,x2:i,elSeries:l}),{pathTo:I.pathTo,pathFrom:I.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,p,u,x),barXPosition:y,x:c.axisFlags.isXNumeric?e:e+s,y:a}}_setTop(t,e,a,s,i,r,o){isNaN(a)||this.groupCtx.tops.set(t,[a,s,(e?e[2]:0)+i,(e?e[3]:0)+(this.w.seriesData.series[r][o]||0),e?Math.min(e[0],e[4]):1/0,e?Math.max(e[0],e[5]):-1/0])}},rangeBar:class extends B{draw(t,e){var a,s,i,r,o,n;const h=this.w,d=new c(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=h.rangeData.seriesRangeStart,this.seriesRangeEnd=h.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t,e);const b=d.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let c=0;c<t.length;c++){let g,p;const x=h.globals.comboCharts?e[c]:c,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),y=d.group({class:"apexcharts-series",seriesName:u.escapeString(h.seriesData.seriesNames[x]),rel:c+1,"data:realIndex":x});I.addCollapsedClassToSeries(this.w,y,x),t[c].length>0&&(this.visibleI=this.visibleI+1);const v=this.setSeriesAxis(x);this.isHorizontal&&h.labelData.timescaleLabels.length&&(this.isReversed=!1);const m=this.barHelpers.initialPositions(x),{y:C,zeroW:w,x:S,zeroH:k}=m,P=null!=(a=m.yDivision)?a:0,A=null!=(s=m.xDivision)?s:0;p=C,g=S;const H=d.group({class:"apexcharts-datalabels","data:realIndex":x}),L=d.group({class:"apexcharts-rangebar-goals-markers"}),R=h.config.series[x].data;for(let e=0;e<h.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(c,e,x);let s=null!=(i=m.barWidth)?i:0,d=null!=(r=m.barHeight)?r:0;const b=this.seriesRangeStart[x][e],u=this.seriesRangeEnd[x][e];let C=null,I=null,S=null;const W={x:g,y:p,strokeWidth:a,elSeries:y};let D=this.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(D=1),void 0===(null==R?void 0:R[e]))break;if(this.isHorizontal){S=p+d*this.visibleI;const t=(P-d*D)/2;if(null!=(null==(o=R[e])?void 0:o.x)){const a=this.detectOverlappingBars({i:x,j:e,barYPosition:S,srty:t,barHeight:d,yDivision:P,initPositions:m});d=a.barHeight,S=a.barYPosition}C=this.drawRangeBarPaths(l({indexes:{i:c,j:e,realIndex:x},barHeight:d,barYPosition:S,zeroW:w,yDivision:P,y1:b,y2:u},W)),s=C.barWidth}else{h.axisFlags.isXNumeric&&(g=(h.seriesData.seriesX[x][e]-h.globals.minX)/this.xRatio-s/2),I=g+s*this.visibleI;const t=(A-s*D)/2;if(null!=(null==(n=R[e])?void 0:n.x)){const a=this.detectOverlappingBars({i:x,j:e,barXPosition:I,srtx:t,barWidth:s,xDivision:A,initPositions:m});s=a.barWidth,I=a.barXPosition}C=this.drawRangeColumnPaths(l({indexes:{i:c,j:e,realIndex:x,translationsIndex:v},barWidth:s,barXPosition:I,zeroH:k,xDivision:A},W)),d=C.barHeight,I=C.barXPosition}const X=this.barHelpers.drawGoalLine({barXPosition:I,barYPosition:S,goalX:C.goalX,goalY:C.goalY,barHeight:d,barWidth:s});X&&L.add(X),p=C.y,g=C.x;const F=this.barHelpers.getPathFillColor(t,c,e,x);this.renderSeries({realIndex:x,pathFill:F.color,lineFill:F.useRangeColor?F.color:h.globals.stroke.colors[x],j:e,i:c,x:g,y:p,y1:b,y2:u,pathFrom:C.pathFrom,pathTo:C.pathTo,strokeWidth:a,elSeries:y,series:t,barHeight:d,barWidth:s,barXPosition:I,barYPosition:S,columnGroupIndex:f,elDataLabelsWrap:H,elGoalsMarkers:L,visibleSeries:this.visibleI,type:"rangebar"})}h.globals.previousPaths.length>0&&T({w:h,elSeries:y,record:this._prevRecord(x),newKeys:this._keys(x),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),b.add(y)}return b}detectOverlappingBars({i:t,j:e,barYPosition:a,barXPosition:s,srty:i,srtx:r,barHeight:o,barWidth:l,yDivision:n,xDivision:h,initPositions:d}){var c,b,u,g;const p=this.w;let x=[];const f=null==(b=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:b[e],y=null==(g=null==(u=p.config.series[t].data)?void 0:u[e])?void 0:g.x,v=Array.isArray(y)?y.join(" "):y,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(v),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===v&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(a=p.config.plotOptions.bar.rangeBarGroupRows?i+n*m:i+o*this.visibleI+n*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a+=(o=d.barHeight/x.length)*x.indexOf(f)))):(m>-1&&!p.axisFlags.isXNumeric&&(s=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+l*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s+=(l=d.barWidth/x.length)*x.indexOf(f)))),{barYPosition:a,barXPosition:s,barHeight:o,barWidth:l}}drawRangeColumnPaths({indexes:t,x:e,xDivision:a,barWidth:s,barXPosition:i,zeroH:r}){var o,l;const n=this.w,{i:h,j:d,realIndex:c,translationsIndex:b}=t,u=this.yRatio[b]*(this.isReversed?-1:1),g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(l=this.series[h])?void 0:l[d]));f?(p=r-p/u,x=r-x/u):p=x=r;const y=Math.abs(x-p),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:s,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:n});if(f){const t=v.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:s});e=t.x,i=t.barXPosition}else e+=a;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,c,d,b),barXPosition:i}}_keys(t){const e=this._keyCache||(this._keyCache={}),a=this.w.config.series[t].data;return e[t]||(e[t]=X((a||[]).map((t,e)=>{var a;return"c:"+(null!=(a=null==t?void 0:t.x)?a:e)})))}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:a,y2:s,yDivision:i,barHeight:r,barYPosition:o,zeroW:l}){const n=this.w,{realIndex:h,j:d}=t,c=this.invertedYRatio*(this.isReversed?-1:1),b=this.preventBarOverflow(l+a/c),u=this.preventBarOverflow(l+s/c),g=this.getRangeValue(h,d),p=Math.abs(u-b),x=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:b,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:n});if(null!=g.start&&null!=g.end){const t=x.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return n.axisFlags.isXNumeric||(e+=i),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:p,x:g.start<0&&g.end<0?b:u,goalX:this.barHelpers.getGoalValues("x",l,null,h,d,0),y:e}}recordColumnGeometry(t,e,a){const s=this.w.waterfallData&&this.w.waterfallData.geometry;s&&isFinite(a.slotStart)&&isFinite(a.levelEnd)&&(s[t]||(s[t]=[]),s[t][e]=a)}getRangeValue(t,e){const a=this.w;return{start:a.rangeData.seriesRangeStart[t][e],end:a.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});