apexcharts 8.2.0 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(e,i,a)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,o=(t,e)=>{for(var i in e||(e={}))r.call(e,i)&&n(t,i,e[i]);if(a)for(var i of a(e))s.call(e,i)&&n(t,i,e[i]);return t},l=(t,a)=>e(t,i(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const a=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const u=c(require("apexcharts/core")),h=1/45;function d(t,e,i,a){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function m(t,e){if(e<=0)return f(t);let i=e;for(;i>0;){const e=Math.min(i,h),a=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=a*e,t.value+=t.velocity*e,i-=e}return!!f(t)&&(t.value=t.target,t.velocity=0,!0)}function p(t,e){t.target=e}function f(t){var e,i;const a=null!=(e=t.restVelocity)?e:.05,r=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<a&&Math.abs(t.value-t.target)<r}const x={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const g=u.__apex_Graphics,y="__apexcharts_unit_layouts__";function b(t){return t&&globalThis[y][t]||null}globalThis[y]||(globalThis[y]={});const M="__apexcharts_unit_marks__";function _(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function A(t){return t&&globalThis[M][t]||null}globalThis[M]||(globalThis[M]={});const w=u.__apex_Utils,S=u.__apex_Environment_Environment,R=u.__apex_BrowserAPIs_BrowserAPIs,k=u.__apex_Animations_prefersReducedMotion;const v=Math.PI*(3-Math.sqrt(5));function F(t){return 1-Math.pow(1-t,3)}function E(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function D(t,e){const[i,a]=null!=(s=x[null!=(r=t)?r:"crisp"])?s:x.crisp;var r,s;const n=800/Math.max(1,e);return[i*n*n,a*n]}u.default.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new g(e,this.ctx),a=i.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return a;const r=e.config.plotOptions.unit,s="packed"===r.layout?"packed":"columns"===r.layout?"columns":"grid"===r.layout?"grid":"scatter"===r.layout?"scatter":"arc"===r.layout?"arc":"custom"===r.layout?"custom":"grouped",n=r.transition,c="flow"===n,u="identity"===n,h=r.unitValue>0?r.unitValue:1;let d=t.map(t=>{const e=Math.abs(w.parseNumber(t))/h;return e>0?Math.max(1,Math.round(e)):0});d=this._applyMaxUnits(d,r.maxUnits);const m=d.reduce((t,e)=>t+e,0),p="packed"===s?this._layoutPacked(d,r):"columns"===s?this._layoutColumns(d,r):"grid"===s?this._layoutGrid(d,r):"scatter"===s?this._layoutScatter(r):"arc"===s?this._layoutArc(d,r):"custom"===s?this._layoutCustom(d,r):this._layoutGrouped(d,r),f="grid"===s&&!(!r.grid||!r.grid.split);f&&this._drawGridTrack(a,i,r),"scatter"===s&&this._drawScatterAxes(a,i);const x=this._lastDotR,y=this._shouldAnimate(),b=this.ctx&&this.ctx.morphTypeChange,M=y&&!!b&&"function"==typeof b.isActive&&b.isActive()&&"function"==typeof b.getInitialSlotFor,_=M&&"function"==typeof b.usesPieceTakeover&&b.usesPieceTakeover(),A=y&&!M&&this.ctx?this.ctx._unitPrevDots:null,S=this.ctx&&this.ctx._unitPieces;S&&(this.ctx._unitPieces=null,A&&S.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),i=A.get(e),a=e=>+t.getAttribute(e);i&&A.set(e,l(o({},i),{x:a("x")+a("width")/2,y:a("y")+a("height")/2,r:Math.min(a("width"),a("height"))/2,fill:t.getAttribute("fill")}))}));const R=new Map,k=[],v=e.seriesData.unitData||[],F=this._bubbleStats(v,r,x);let E=0;if(p.forEach(t=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",o=i.group({class:"apexcharts-series",seriesName:w.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),l=t.dots.length,h=v[t.i];if(t.dots.forEach((e,a)=>{const s=null!=e.j?e.j:a,d=h?h[s]:void 0,m=d&&"object"==typeof d&&d.fillColor?d.fillColor:n,p=null!=e.r?e.r:F?this._radiusForValue(this._unitValueOf(d),F):x,g=this._markSpecFor(r,d,t.i,p),w=this._drawDot(i,r,p,m,t.i,s,g);let S;if(o.add(w),u){const t=d&&"object"==typeof d?null!=d.id?d.id:d.name:void 0;S=null!=t?`id:${t}`:`g:${E}`}else S=c?String(E):null!=e.slot?`slot:${e.slot}`:`${t.i}:${s}`;if(E++,R.set(S,{x:e.x,y:e.y,fill:m,r:p,spec:g}),_)this._place(w.node,g,e.x,e.y),w.node.setAttribute("opacity","0"),w.node.setAttribute("data-piece-hidden","1"),w.node.setAttribute("data-key",S);else if(y){const i=A&&A.get(S),a=i||(M?b.getInitialSlotFor(t.i,s,l):null),n=r.gather&&r.gather.enter||"burst",o=f||"fade"===n||"rise"===n,c=a?a.x:o?e.x:t.cx,u=a?a.y:"rise"!==n||f?o?e.y:t.cy:e.y+14;w.node.style.opacity=a?"1":"0",this._place(w.node,g,c,u),k.push({node:w.node,spec:g,x:e.x,y:e.y,cx0:c,cy0:u,key:S,r0:i&&null!=i.r?i.r:p,r1:p,fill0:i?i.fill:m,fill1:m,delay:0,isEnter:!a})}else this._place(w.node,g,e.x,e.y)}),("grouped"===s||"columns"===s||f)&&r.clusterLabels&&r.clusterLabels.show&&d[t.i]>0){const e=f?this._gridDenom:m;this._drawClusterLabel(o,t,d[t.i],e,r,n)}a.add(o)}),this._outerLabelsOn(r)&&this._drawOuterLabels(a,p,d,m,r,y&&!A),A){const t=this._collectExits(A,R,r);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});a.add(e),this._runExits(e,t,r)}}return this.ctx&&(this.ctx._unitPrevDots=R),!this.ctx||y&&!M||(this.ctx._unitSprings=null),y&&k.length?this._runGather(k):e.globals.animationEnded=!0,a}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const a=e/i;return console.warn(`[ApexCharts] unit chart: ${i} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`),t.map(t=>t>0?Math.max(1,Math.round(t*a)):0)}_layoutCustom(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,a-2*o),height:r},c=Math.sqrt(l.width*l.height/Math.PI),u=this._resolveStep(e,c,s);this._lastDotR=this._dotRadiusFromStep(u,e);const h=this._lastDotR,d=this._layoutObjects(t,h);let m;try{m=n(d,l)}catch(i){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",i),this._layoutGrouped(t,e)}if(!Array.isArray(m))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const p=new Map;m.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&p.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const f=t.map((t,e)=>({i:e,cx:a/2,cy:r/2,outerR:h,dots:[]}));return d.forEach(t=>{const e=p.get(t.id);e&&f[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),f.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let a=0;t.dots.forEach(e=>{a=Math.max(a,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=a+h}),f}_layoutObjects(t,e){const i=this.w,a=i.seriesData.unitData||[],r=i.seriesData.seriesNames||[],s=[];let n=0;return t.forEach((t,i)=>{var o;const l=a[i];for(let a=0;a<t;a++){const t=l?l[a]:void 0,c=!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${a}`:String(null!=t.id?t.id:t.name);s.push({id:c,index:n,seriesIndex:i,dataPointIndex:a,label:r[i],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),n++}}),s}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=b(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const c=a/o,u=r-s,h=Math.max(1,...t),d=.08*Math.min(c,u),m=Math.max(4,Math.min(c,u)/2-d),p=this._resolveStep(e,m,h);this._lastDotR=this._dotRadiusFromStep(p,e);const f=this._lastDotR,x=s+u/2,g=t.map(t=>p*Math.sqrt(Math.max(1,t))+f);let y=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):a/2)(e));const b=n.map(t=>g[t]);let M=!1;for(let t=1;t<o;t++)if(y[n[t]]-y[n[t-1]]<b[t]+b[t-1]){M=!0;break}if(M){const e=Math.max(2*f,8),i=b.reduce((t,e)=>t+2*e,0)+e*(o-1);let r;if(i<=a){let t=(a-i)/2;r=b.map(i=>{const a=t+i;return t+=2*i+e,a})}else if(1===o)r=[a/2];else{const t=b[0],e=a-b[o-1];r=b.map((i,a)=>t+(e-t)*a/(o-1))}y=t.map((t,e)=>l[e]>=0?r[l[e]]:a/2)}return t.map((t,e)=>({i:e,cx:y[e],cy:x,outerR:g[e],dots:this._spiral(y[e],x,t,p,0)}))}_layoutPacked(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(a,r-6)/2-.06*Math.min(a,r)),o=this._resolveStep(e,n,s);this._lastDotR=this._dotRadiusFromStep(o,e);const l=a/2,c=6+(r-6)/2,u=t.map((t,e)=>e);!1!==e.sortByGroup&&u.sort((e,i)=>t[e]-t[i]);const h=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(s)+this._lastDotR,dots:[]}));let d=0;return u.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(d+.5),i=d*v;h[e].dots.push({x:l+t*Math.cos(i),y:c+t*Math.sin(i),slot:d}),d++}}),h}_layoutArc(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,c=o*Math.PI/180,u=l*Math.PI/180,h=u-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),m=t=>Math.sin(t),p=t=>-Math.cos(t),f=this._arcBounds(c,u),x=.04*Math.min(a,r),g=Math.max(1e-6,f.maxX-f.minX),y=Math.max(1e-6,f.maxY-f.minY),b=Math.max(4,Math.min((a-2*x)/g,(r-2*x)/y)),M=b*d,_=a/2-(f.minX+f.maxX)/2*b,A=r/2-(f.minY+f.maxY)/2*b,w=this._arcAllocate(s,M,b,h,e);this._lastDotR=w.dotR;const S=[];for(let t=0;t<w.R;t++){const e=w.radii[t],i=w.seatsPerRow[t];for(let t=0;t<i;t++){const a=1===i?(c+u)/2:c+h*(t+.5)/i;S.push({a:a,x:_+e*m(a),y:A+e*p(a)})}}S.sort((t,e)=>t.a-e.a);const R=t.map((t,e)=>({i:e,cx:_,cy:A,outerR:b,dots:[]}));let k=0,v=0;return S.forEach((e,i)=>{for(;k<t.length&&v>=t[k];)k++,v=0;k>=t.length||(R[k].dots.push({x:e.x,y:e.y,slot:i}),v++)}),R}_arcBounds(t,e){const i=t=>Math.sin(t),a=t=>-Math.cos(t),r=Math.min(t,e),s=Math.max(t,e),n=[0,i(t),i(e)],o=[0,a(t),a(e)],l=Math.PI/2;for(let t=Math.ceil(r/l);t*l<=s;t++)n.push(i(t*l)),o.push(a(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,a,r){const s=r.spacing>0?r.spacing:1.05,n=Math.abs(a)||Math.PI,o=this._fixedRadius(r),l=a=>{a=Math.max(1,Math.round(a));const r=[];for(let t=0;t<a;t++)r.push(1===a?(e+i)/2:e+t/(a-1)*(i-e));const o=r.reduce((t,e)=>t+e,0)||1,l=r.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let u=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{u>0&&(c[t.idx]++,u--)});u>0;)c[a-1]++,u--;const h=1===a?i-e||i:(i-e)/(a-1);let d=1/0;for(let t=0;t<a;t++){const e=c[t];if(e<=0)continue;const i=r[t]*n/e;i<d&&(d=i)}const m=Math.min(h,d);return{R:a,radii:r,seatsPerRow:c,dotR:Math.max(1,m/(2*s))}},c=r.arc&&r.arc.rows;let u;if("number"==typeof c&&c>=1)u=l(c);else if(o){u=l((i-e)/(2*o*s)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));u=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>u.dotR&&(u=e)}}return o&&(u.dotR=o),u}_layoutColumns(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=!(!e.clusterLabels||!e.clusterLabels.show),n=s&&"bottom"===e.clusterLabels.position,o=s&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),u=new Array(t.length).fill(-1);l.forEach((t,e)=>u[t]=e);const h=a/c,d=.62*h,m=Math.max(8,.04*r)+(n?30:0),p=Math.max(4,r-o-m),f=Math.max(1,...t),x=e.spacing>0?e.spacing:1,g=e.columns?e.columns.size:void 0;let y;y="image"!==e.shape&&"auto"===g?null:"image"!==e.shape&&"number"==typeof g&&g>0?g:this._fixedRadius(e);let b=1,M=0;if(y){M=2*y*x,this._lastDotR=y;const t=Math.max(1,Math.floor(p/M)),e=Math.max(1,Math.floor(d/M));b=Math.max(1,Math.min(e,Math.ceil(f/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let i=1;i<=e;i++){const e=Math.ceil(f/i),a=Math.min(d/i,p/e);a>t&&(t=a,b=i)}M=t,this._lastDotR=Math.max(1,M/(2*x))}const _=this._lastDotR,A=Math.ceil(f/b),w=o+(p+Math.min(p,A*M))/2;return t.map((t,e)=>{const i=u[e]>=0?h*(u[e]+.5):a/2,r=Math.ceil(Math.max(1,t)/b)*M,s=i-b*M/2+M/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/b),i=e%b;n.push({x:s+i*M,y:w-_-t*M})}return{i:e,cx:i,cy:w-r/2,outerR:r/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=e.grid||{},n=Math.max(1,Math.round(s.columns>0?s.columns:10)),o="top"===s.fillFrom?"top":"bottom",l=s.total>0?this._largestRemainder(t,Math.round(s.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),u=Math.max(1,Math.ceil(Math.max(1,c)/n)),h=e.spacing>0?e.spacing:1,d=Math.max(4,a),m=Math.max(4,r-6),p=this._fixedRadius(e);let f=0;p?(f=2*p*h,this._lastDotR=p):(f=Math.min(d/n,m/u),this._lastDotR=Math.max(1,f/(2*h)));const x=n*f,g=u*f,y=(a-x)/2+f/2,b=6+(m-g)/2,M=t=>"bottom"===o?b+g-f/2-t*f:b+f/2+t*f,_=t.map((t,e)=>({i:e,cx:a/2,cy:6+m/2,outerR:Math.max(x,g)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%n,i=Math.floor(A/n);_[t].dots.push({x:y+e*f,y:M(i),slot:A}),A++}return _}_layoutGridSplit(t,e){const i=this.w,a=i.layout.gridWidth,r=i.layout.gridHeight,s=e.grid||{},n=Math.max(1,Math.round(s.columns>0?s.columns:10)),o="top"===s.fillFrom?"top":"bottom",l=Math.max(1,Math.round(s.total>0?s.total:100)),c=Math.max(1,Math.ceil(l/n)),u=t.map((t,e)=>e).filter(e=>t[e]>0),h=Math.max(1,u.length),d=s.max>0?s.max:Math.max(1,...t),m=Math.max(1,Math.round(s.tileColumns>0?s.tileColumns:Math.ceil(Math.sqrt(h)))),p=Math.max(1,Math.ceil(h/m)),f=!(e.clusterLabels&&!1===e.clusterLabels.show),x=f&&e.clusterLabels&&"bottom"===e.clusterLabels.position,g=f&&!x?22:4,y=f&&x?22:4,b=a/m,M=r/p,_=Math.max(4,.86*b),A=Math.max(4,M-g-y),w=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let R=0;S?(R=2*S*w,this._lastDotR=S):(R=Math.min(_/n,A/c),this._lastDotR=Math.max(1,R/(2*w)));const k=n*R,v=c*R,F=(t,e)=>"bottom"===o?t+v-R/2-e*R:t+R/2+e*R,E=[],D=[];return u.forEach((e,i)=>{const a=i%m,r=Math.floor(i/m),s=a*b,o=s+(b-k)/2+R/2,c=r*M+g+(A-v)/2,u=t=>({x:o+t%n*R,y:F(c,Math.floor(t/n))});for(let t=0;t<l;t++)E.push(u(t));const h=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),p=[];for(let t=0;t<h;t++){const e=u(t);p.push({x:e.x,y:e.y,slot:i*l+t})}D.push({i:e,cx:s+b/2,cy:c+v/2,outerR:v/2,flat:!0,split:!0,dots:p})}),this._gridDenom=d,this._gridTrack={cells:E},D}_drawGridTrack(t,e,i){const a=this._gridTrack;if(!a||!a.cells||!a.cells.length)return;const r=this._lastDotR,s=(i.grid||{}).trackColor||"rgba(128,128,128,0.14)",n=e.group({class:"apexcharts-unit-track"});a.cells.forEach(t=>{let a;if("square"===i.shape){const n=2*r;a=e.drawRect(0,0,n,n,i.borderRadius||0,s,1,0,"none"),a.node.setAttribute("fill",s),a.node.setAttribute("x",String(t.x-r)),a.node.setAttribute("y",String(t.y-r))}else a=e.drawCircle(r,{fill:s,"stroke-width":0,stroke:"none"}),a.node.setAttribute("fill",s),a.node.setAttribute("cx",String(t.x)),a.node.setAttribute("cy",String(t.y));a.node.classList.add("apexcharts-unit-track-cell"),n.add(a)}),t.add(n)}_layoutScatter(t){const e=this.w,i=t.scatter||{};if("value"===i.y)return this._layoutScatter2D(t);if("vertical"===i.orientation)return this._layoutScatterVertical(t);const a=e.layout.gridWidth,r=e.layout.gridHeight,s=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,s),c=s.map(t=>Array.isArray(t)?t.map(o):[]),u=t=>null!=t&&isFinite(t),h=c.map((t,e)=>e).filter(t=>c[t].some(u)),d=Math.max(1,h.length);let m=1/0,p=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>p&&(p=t))})),m===1/0&&(m=0,p=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,m,p,f),g=x.min,y=x.max,b=y-g||1,M=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):d>1?92:8,_=30+(i.xTitle?20:0),A=M,w=a-8,S=r-_,R=Math.max(4,w-A),k=Math.max(4,S-10),v=t=>A+(t-g)/b*R,F=k/d;let E=0;const D=this._fixedRadius(t);if(D)E=D;else{const t=Math.max(1,...h.map(t=>c[t].filter(u).length));E=Math.max(2,Math.min(6,.12*F,R/(2.5*Math.sqrt(t))))}this._lastDotR=E;const L=t.spacing>0?t.spacing:1,C=Math.max(.5,E*L),T="jitter"===i.spread,$=[],B=[],z=l?l.rMax:E;h.forEach((t,e)=>{const i=(t=>10+F*(t+.5))(e);B.push({i:t,cy:i,name:n[t]||`series-${t+1}`});const a=(s[t]||[]).map((t,e)=>{const a=o(t),r={j:e,px:v(u(a)?a:g),y:i};return l&&(r.r=this._scatterRadius(t,l,E)),r});if(T){const t=Math.max(z,F/2-z);a.forEach((e,a)=>{const r=(9301*a+49297)%233280/233280;e.y=i+(2*r-1)*t})}else this._beeswarm(a,i,E,C,z);$.push({i:t,cx:(A+w)/2,cy:i,outerR:F/2,dots:a.map(t=>({x:t.px,y:t.y,r:t.r}))})});const O=x.ticks;return this._scatterAxis={mode:"1d",plotL:A,plotR:w,plotT:10,plotB:S,xMin:g,xMax:y,plotX:v,ticks:O,lanes:B,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},$}_layoutScatterVertical(t){const e=this.w,i=t.scatter||{},a=e.layout.gridWidth,r=e.layout.gridHeight,s=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,s),c=s.map(t=>Array.isArray(t)?t.map(o):[]),u=t=>null!=t&&isFinite(t),h=c.map((t,e)=>e).filter(t=>c[t].some(u)),d=Math.max(1,h.length);let m=1/0,p=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>p&&(p=t))})),m===1/0&&(m=0,p=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,m,p,f),g=x.min,y=x.max,b=y-g||1,M=46+(i.xTitle?18:0),_=a-10,A=r-(d>1?26:10),w=Math.max(4,_-M),S=Math.max(4,A-10),R=t=>A-(t-g)/b*S,k=w/d;let v=0;const F=this._fixedRadius(t);if(F)v=F;else{const t=Math.max(1,...h.map(t=>c[t].filter(u).length));v=Math.max(2,Math.min(6,.12*k,S/(2.5*Math.sqrt(t))))}this._lastDotR=v;const E=t.spacing>0?t.spacing:1,D=Math.max(.5,v*E),L="jitter"===i.spread,C=[],T=[],$=l?l.rMax:v;h.forEach((t,e)=>{const i=(t=>M+k*(t+.5))(e);T.push({i:t,cx:i,name:n[t]||`series-${t+1}`});const a=(s[t]||[]).map((t,e)=>{const a=o(t),r={j:e,py:R(u(a)?a:g),x:i};return l&&(r.r=this._scatterRadius(t,l,v)),r});if(L){const t=Math.max($,k/2-$);a.forEach((e,a)=>{const r=(9301*a+49297)%233280/233280;e.x=i+(2*r-1)*t})}else this._beeswarm(a,i,v,D,$,!0);C.push({i:t,cx:i,cy:(10+A)/2,outerR:k/2,dots:a.map(t=>({x:t.x,y:t.py,r:t.r}))})});const B=x.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:M,plotR:_,plotT:10,plotB:A,vMin:g,vMax:y,plotY:R,ticks:B,lanes:T,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},C}_layoutScatter2D(t){const e=this.w,i=e.layout.gridWidth,a=e.layout.gridHeight,r=t.scatter||{},s=e.seriesData.unitData||[],n=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,c=s.map((t,e)=>e).filter(t=>(s[t]||[]).some(t=>n(o(t))&&n(l(t))));let u=1/0,h=-1/0,d=1/0,m=-1/0;s.forEach(t=>(t||[]).forEach(t=>{const e=o(t),i=l(t);n(e)&&n(i)&&(e<u&&(u=e),e>h&&(h=e),i<d&&(d=i),i>m&&(m=i))})),u===1/0&&(u=0,h=1,d=0,m=1);const p=Math.max(2,Math.round(r.tickAmount>0?r.tickAmount:5)),f=Math.max(2,Math.round(r.yTickAmount>0?r.yTickAmount:5)),x=this._niceScale(null!=r.xMin?r.xMin:u,null!=r.xMax?r.xMax:h,p),g=this._niceScale(null!=r.yMin?r.yMin:d,null!=r.yMax?r.yMax:m,f),y=null!=r.xMin?r.xMin:x.min,b=null!=r.xMax?r.xMax:x.max,M=null!=r.yMin?r.yMin:g.min,_=null!=r.yMax?r.yMax:g.max,A=b-y||1,w=_-M||1,S=46+(r.yTitle?18:0),R=30+(r.xTitle?20:0),k=S,v=i-12,F=a-R,E=Math.max(4,v-k),D=Math.max(4,F-10),L=t=>k+(t-y)/A*E,C=t=>F-(t-M)/w*D,T=this._scatterSizeStats(r,s),$=this._fixedRadius(t)||5;this._lastDotR=$;const B=[];c.forEach(t=>{const e=(s[t]||[]).map(t=>{const e=o(t),i=l(t);return{x:L(n(e)?e:y),y:C(n(i)?i:M),r:T?this._scatterRadius(t,T,$):void 0}});B.push({i:t,cx:(k+v)/2,cy:(10+F)/2,outerR:D/2,dots:e})});const z=(t,e,i,a,r,s)=>{const n=[];if(r)for(let e=0;e<s;e++)n.push(t+i*e/(s-1));else{const r=a||i/Math.max(1,s-1);for(let i=t;i<=e+.5*r;i+=r)n.push(Math.abs(i)<1e-9*r?0:i)}return n};return this._scatterAxis={mode:"2d",plotL:k,plotR:v,plotT:10,plotB:F,plotX:L,plotY:C,xTicks:z(y,b,A,x.spacing,null!=r.xMin||null!=r.xMax,p),yTicks:z(M,_,w,g.spacing,null!=r.yMin||null!=r.yMax,f),xTitle:r.xTitle,yTitle:r.yTitle,xFormatter:"function"==typeof r.xFormatter?r.xFormatter:null,yFormatter:"function"==typeof r.yFormatter?r.yFormatter:null,gridlines:!1!==r.gridlines},B}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const a=Math.max(.5,+i[0]),r=Math.max(a,+i[1]),s=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[s]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:a,rMax:r,field:s}}_scatterRadius(t,e,i){if(!e)return i;const a=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof a||!isFinite(a))return e.rMin;const r=e.zmax>e.zmin?(a-e.zmin)/(e.zmax-e.zmin):1,s=Math.max(0,Math.min(1,r)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+s*(o-n))}_beeswarm(t,e,i,a,r,s=!1){const n=s?"py":"px",o=s?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),c=[],u=null!=r?r:i;l.forEach(t=>{const r=null!=t.r?t.r:i;let s=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*a*(i%2?1:-1),l=e+o;let h=!0;for(let e=c.length-1;e>=0;e--){const i=c[e],a=t[n]-i.f;if(a>r+u)break;const s=r+i.r,o=l-i.s;if(a*a+o*o<s*s){h=!1;break}}if(h){s=o;break}}t[o]=e+s,c.push({f:t[n],s:t[o],r:r})})}_scatterValueDomain(t,e,i,a){const r=(t,e,i)=>{const a=[];for(let r=t;r<=e+.5*i;r+=i)a.push(Math.abs(r)<1e-9*i?0:r);return a};if(null!=t.xMin||null!=t.xMax){let s=null!=t.xMin?t.xMin:e,n=null!=t.xMax?t.xMax:i;n>s||(n=s+1);const o=(n-s)/Math.max(1,a-1);return e<s&&(s-=Math.ceil((s-e)/o)*o),i>n&&(n+=Math.ceil((i-n)/o)*o),{min:s,max:n,ticks:r(s,n,o)}}const s=this._niceScale(e,i,a),n=s.spacing||(s.max-s.min)/Math.max(1,a-1);return{min:s.min,max:s.max,ticks:r(s.min,s.max,n)}}_niceScale(t,e,i){const a=t;let r=e;r>a||(r=a+1);const s=this._niceNum(r-a,!1),n=this._niceNum(s/Math.max(1,i-1),!0);return{min:Math.floor(a/n)*n,max:Math.ceil(r/n)*n,spacing:n}}_niceNum(t,e){const i=t>0?t:1,a=Math.floor(Math.log(i)/Math.LN10),r=i/Math.pow(10,a);let s;return s=e?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10,s*Math.pow(10,a)}_drawScatterAxes(t,e){const i=this.w;if(!S.isBrowser())return;const a=this._scatterAxis;if(!a)return;const r="http://www.w3.org/2000/svg",s=e.group({class:"apexcharts-unit-axis"}),n=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,u=c||"rgba(120,130,140,0.9)",h=(t,e,i,a,n)=>{const o=R.createElementNS(r,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(a)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),s.node.appendChild(o)},d=(t,e,a,n,o,l,c,u)=>{const h=R.createElementNS(r,"text");h.setAttribute("class",u),h.setAttribute("x",String(e)),h.setAttribute("y",String(a)),h.setAttribute("text-anchor",n),h.setAttribute("dominant-baseline","middle"),h.setAttribute("font-size",`${l}px`),h.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),h.setAttribute("font-weight",String(c)),h.setAttribute("fill",o),h.textContent=t,s.node.appendChild(h)};if("2d"!==a.mode){if("vertical"===a.orientation){if(a.ticks.forEach(t=>{const e=a.plotY(t);a.gridlines&&h(a.plotL,e,a.plotR,e,n);const i=a.formatter?String(a.formatter(t)):this._formatTick(t);d(i,a.plotL-8,e,"end",u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotT,a.plotL,a.plotB,o),a.valueTitle){const t=R.createElementNS(r,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",u),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(a.valueTitle),s.node.appendChild(t)}return a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,t.cx,a.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(s)}a.ticks.forEach((t,e)=>{const i=a.plotX(t);a.gridlines&&h(i,a.plotT,i,a.plotB,n);const r=a.formatter?String(a.formatter(t)):this._formatTick(t),s=0===e?"start":e===a.ticks.length-1?"end":"middle";d(r,i,a.plotB+14,s,u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotB,a.plotR,a.plotB,o),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",u,12,600,"apexcharts-unit-axis-title"),a.plotL>12&&a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,a.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(s)}else{if(a.yTicks.forEach(t=>{const e=a.plotY(t);a.gridlines&&h(a.plotL,e,a.plotR,e,n);const i=a.yFormatter?String(a.yFormatter(t)):this._formatTick(t);d(i,a.plotL-8,e,"end",u,11,400,"apexcharts-unit-tick")}),a.xTicks.forEach(t=>{const e=a.plotX(t);a.gridlines&&h(e,a.plotT,e,a.plotB,n);const i=a.xFormatter?String(a.xFormatter(t)):this._formatTick(t);d(i,e,a.plotB+14,"middle",u,11,400,"apexcharts-unit-tick")}),h(a.plotL,a.plotB,a.plotR,a.plotB,o),h(a.plotL,a.plotT,a.plotL,a.plotB,o),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",u,12,600,"apexcharts-unit-axis-title"),a.yTitle){const t=R.createElementNS(r,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",u),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(a.yTitle),s.node.appendChild(t)}t.add(s)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const a=t.map(t=>t/i*e),r=a.map(t=>Math.floor(t)),s=r.reduce((t,e)=>t+e,0),n=Math.max(0,e-s),o=a.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=r.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,a,r){const s=[];for(let n=0;n<i;n++){const i=r+n,o=a*Math.sqrt(i+.5),l=i*v;s.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return s}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,a=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+a*(e.maxR-e.minR);const r=e.minR*e.minR,s=e.maxR*e.maxR;return Math.sqrt(r+a*(s-r))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let a=1/0,r=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<a&&(a=e),e>r&&(r=e))})}),a===1/0||r<a)return null;const s=e.sizeByValue,n=i,o=Math.max(1,Math.min(n,"number"==typeof s.minRadius?s.minRadius:.35*n));return{min:a,max:r,minR:o,maxR:n,scale:"linear"===s.scale?"linear":"area"}}_resolveStep(t,e,i){const a=t.spacing>0?t.spacing:1,r=this._fixedRadius(t);return r?2*r*a:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,a=this._fixedRadius(e);return a||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,a){const r=e;2===r.pk?t.setAttribute("transform","translate("+(i-r.ox)+","+(a-r.oy)+r.tail):1===r.pk?(t.setAttribute("x",String(i-r.hx)),t.setAttribute("y",String(a-r.hy))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(a)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:a,hy:r}=this._halfExtent(t,i);return{pk:1,hx:a,hy:r,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return _(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return _(e);const i=A(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,i){const a=Math.round(10*e)/10,r=t.name+"|"+t.path.length+"|"+a,s=this._specCache.get(r);if(s)return s;const n=t.viewBox||[0,0,100,100],o=2*a*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/n[2]:"height"===i.fit?o/n[3]:o/Math.max(n[2],n[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:a});return this._specCache.set(r,c),c}_markSpecFor(t,e,i,a){if("pictogram"!==t.shape)return this._baseSpec(t,a);const r=t.pictogram||{},s=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(r.mark)?r.mark[i%r.mark.length]:r.mark,c=this._resolveMark(null!=s?s:n);return c?this._glyphSpec(c,a,r):this._baseSpec(l(o({},t),{shape:"square"===r.fallback?"square":"circle"}),a)}_drawDot(t,e,i,a,r,s,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[r]||"none",u="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let h;if(n&&2===n.pk)h=o.dom.Paper.path(n.d),h.node.setAttribute("fill",a),"evenodd"===n.fillRule&&h.node.setAttribute("fill-rule","evenodd"),u<1&&h.node.setAttribute("fill-opacity",String(u)),h.node.setAttribute("data:r",String(n.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;h=o.dom.Paper.image(e.image.src),h.node.setAttribute("width",String(t)),h.node.setAttribute("height",String(i)),h.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&h.node.setAttribute("filter",`url(#${this._tintFilter(a)})`)}else if("square"===e.shape){const r=2*i;h=t.drawRect(0,0,r,r,e.borderRadius||0,a,1,l,c),h.node.setAttribute("fill",a),u<1&&h.node.setAttribute("fill-opacity",String(u))}else h=t.drawCircle(i,{fill:a,"stroke-width":l,stroke:c}),h.node.setAttribute("fill",a),u<1&&h.node.setAttribute("fill-opacity",String(u));return h.node.classList.add("apexcharts-unit-area"),h.node.setAttribute("i",String(r)),h.node.setAttribute("j",String(s)),h}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",a=String(t).replace(/[^a-zA-Z0-9]/g,""),r=`apexcharts-unit-tint-${e.globals.chartID}-${a}`,s=e.dom.Paper.node;if(s.querySelector(`#${r}`))return r;let n=s.querySelector("defs");n||(n=R.createElementNS(i,"defs"),s.insertBefore(n,s.firstChild));const o=R.createElementNS(i,"filter");o.setAttribute("id",r),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=R.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=R.createElementNS(i,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),n.appendChild(o),r}_placeDot(t,e,i,a,r){this._place(t,r||this._baseSpec(e),i,a)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!S.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!k()))))}_seedSprings(t,e,i){const[a,r]=D(e.spring,i),s=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=s&&!i.isEnter&&null!=i.key?s.get(i.key):null,l=o?o.x:d(i.cx0,a,r),c=o?o.y:d(i.cy0,a,r);o&&(l.stiffness=a,c.stiffness=a,l.damping=r,c.damping=r,i.cx0=l.value,i.cy0=c.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===c.velocity||(i.delay=0)),i.sx=l,i.sy=c,null!=i.key&&n.set(i.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=n)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,a=Math.max(1,e.config.chart.animations.speed||800),r=Math.min(.6*a,450),s=t.length;for(let e=0;e<s;e++)t[e].delay=s>1?e/(s-1)*r:0;const n=i.gather||{},o=n.motion||"auto";"spring"===o||"auto"===o&&(!n.easing||"outCubic"===n.easing)?this._seedSprings(t,n,a):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<s;e++){const i=t[e];0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r0))}for(let e=0;e<s;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===n.easing?(c="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===n.easing?E:F;var c;null!=this.w.globals.unitGatherRAF&&(R.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const u=performance.now();let h=u;const d=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const i=Math.min(.25,Math.max(0,(e-h)/1e3));h=e;let r=!0;for(let n=0;n<s;n++){const s=t[n],o=e-u-s.delay,c=Math.max(0,Math.min(1,o/a)),h=F(c);let d,f;if(s.sx&&s.sy){o>=0&&!s.released&&(p(s.sx,s.x),p(s.sy,s.y),s.released=!0);const t=m(s.sx,i),e=m(s.sy,i);s.released&&t&&e||(r=!1),d=s.sx.value,f=s.sy.value}else{const t=l(c);d=s.cx0+(s.x-s.cx0)*t,f=s.cy0+(s.y-s.cy0)*t}if(this._place(s.node,s.spec,d,f),s.isEnter&&(s.node.style.opacity=String(Math.min(1,2.5*c))),s._c0&&s._c1){const t=Math.round(s._c0[0]+(s._c1[0]-s._c0[0])*h),e=Math.round(s._c0[1]+(s._c1[1]-s._c0[1])*h),i=Math.round(s._c0[2]+(s._c1[2]-s._c0[2])*h);s.node.setAttribute("fill",`rgb(${t},${e},${i})`)}0===s.spec.pk&&null!=s.r0&&null!=s.r1&&s.r0!==s.r1&&s.node.setAttribute("r",String(s.r0+(s.r1-s.r0)*h)),c<1&&(r=!1)}if(r){for(let e=0;e<s;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)}_collectExits(t,e,i){const a=Math.max(0,i.maxUnits||5e3),r=[];for(const[i,s]of t)if(!e.has(i)&&(r.push(s),r.length>=a))break;return r}_runExits(t,e,i){const a=this.w,r=new g(a,this.ctx),s=this._lastDotR,n=a.layout.gridWidth/2,o=a.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,c=[];if(e.forEach(e=>{const a=null!=e.r?e.r:s,n=e.spec||this._baseSpec(i,a),o=this._drawDot(r,i,a,e.fill,0,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const u=Math.max(1,a.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(R.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const h=performance.now(),d=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-h)/u)),a=F(i);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(n-e.x0)*a*l,i=e.y0+(o-e.y0)*a*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-a)}i<1?this.w.globals.unitExitRAF=R.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=R.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,a){const r=this.w,s=r.seriesData.seriesNames[t]||`series-${t+1}`,n=i>0?e/i*100:0,o=a.clusterLabels,l="function"==typeof o.formatter?o.formatter(s,{seriesIndex:t,value:e,percent:n,w:r}):`${s}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,a=e.clusterLabels,r=a.external.connector||{},s=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,i)=>{t>0&&n.push(...this._outerLabelLines(i,t,s,e))}),!n.length)return 0;const o=function(t,e,i={}){const a=new g(t),r=i.fontSize||"12px",s=parseFloat(r)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=a.getTextRects(e,r,i.fontFamily,"",!0,i.fontWeight).width;n=Math.max(n,o>0?o:e.length*s*.58)}),n}(i,n,{fontSize:a.fontSize,fontFamily:a.fontFamily||i.config.chart.fontFamily}),l=o+(null!=r.gap?r.gap:8)+(null!=r.length?r.length:22)+8+Math.abs(parseFloat(a.external.offsetX)||0);return Math.min(l,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,a,r,s){const n=this.w;if(!S.isBrowser())return;const o=r.clusterLabels,l=o.external,c=l.connector||{},u=null!=c.gap?c.gap:8,h=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,m=parseFloat(l.offsetY)||0,p=n.layout.gridWidth,f=n.layout.gridHeight,x=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let b=0,M=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),M=Math.max(...e)-Math.min(...e)}const _=b>M,A=parseFloat(o.fontSize)||13,w=Math.round(1.35*A),R=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const s=this._outerLabelLines(t.i,i[t.i],a,r);if(!s.some(t=>""!==t))return;const n=_?t.cx>=p/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>c&&(c=i,l=e)});const f={x:l.x+o*(l.r||x),y:l.y},g={x:f.x+o*u,y:f.y};R.push({i:t.i,lines:s,anchor:f,elbow:g,labelX:g.x+o*h+d,idealY:f.y+m,labelY:f.y+m,side:n})}),!R.length)return;const k=R.reduce((t,e)=>Math.max(t,e.lines.length),1)*w,v=k/2;["left","right"].forEach(t=>{!function(t,e,i,a){const r=t.slice().sort((t,e)=>t.idealY-e.idealY);r.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<r.length;t++)r[t].labelY-r[t-1].labelY<e&&(r[t].labelY=r[t-1].labelY+e);const s=r[r.length-1],n=s?s.labelY-i:0;if(n>0)for(let t=r.length-1;t>=0;t--)r[t].labelY-=n,t<r.length-1&&r[t+1].labelY-r[t].labelY<e&&(r[t].labelY=r[t+1].labelY-e);if(null!=a&&r.length&&r[0].labelY<a){const t=a-r[0].labelY;for(let e=0;e<r.length;e++)r[e].labelY+=t}}(R.filter(e=>e.side===t),k+2,f-v,v)});const F=new g(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(s){const t=Math.max(1,n.config.chart.animations.speed||800);F.node.classList.add("apexcharts-unit-label-delay"),F.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}R.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";F.add(function(t,e){const{lines:i,lineHeight:a,anchor:r,elbow:s,labelX:n,labelY:o,side:l,connector:c,style:u,foreColor:h}=e,d=new g(t),m=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${r.x} ${r.y} L ${s.x} ${s.y} L ${n} ${o}`,i=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),m.add(i)}const p="right"===l?n+4:n-4,f=i.length,x=o-(f-1)*a/2,y=d.drawText({x:p,y:x,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:u.fontSize,fontFamily:u.fontFamily,fontWeight:u.fontWeight,foreColor:h,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${p}`),t[e].setAttribute("dy",0===e?"0":`${a}`)}return m.add(y),m}(n,{lines:t.lines,lineHeight:w,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(F)}_drawClusterLabel(t,e,i,a,r,s){const n=this.w;if(!S.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=a>0?i/a*100:0,u=r.clusterLabels,h=parseFloat(u.fontSize)||13;let d;d="function"==typeof u.formatter?u.formatter(l,{seriesIndex:e.i,value:i,percent:c,w:n}):`${l} (${c.toFixed(1)}%)`;const m="string"==typeof d?d:String(d),p=R.createElementNS(o,"text");p.setAttribute("class","apexcharts-unit-label"),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size",`${h}px`),p.setAttribute("font-family",u.fontFamily||n.config.chart.fontFamily||"inherit"),p.setAttribute("font-weight",String(u.fontWeight||600)),p.setAttribute("fill",u.color||s);const f="bottom"===u.position,x=e.outerR+.6*h+3+(u.offsetY||0),g=m.length*h*.55;if(!f&&!e.flat&&!1!==u.curved&&g<=Math.PI*x*.95){const i=e.cy,a=`M ${e.cx-x} ${i} A ${x} ${x} 0 0 1 ${e.cx+x} ${i}`,r=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,s=R.createElementNS(o,"path");s.setAttribute("id",r),s.setAttribute("d",a),s.setAttribute("fill","none"),s.setAttribute("stroke","none");const l=R.createElementNS(o,"textPath");l.setAttribute("href",`#${r}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${r}`),l.setAttribute("startOffset","50%"),l.textContent=m,p.appendChild(l),t.node.appendChild(s)}else{p.setAttribute("x",String(e.cx));const t=f?e.cy+e.outerR+h+6+(u.offsetY||0):e.cy-e.outerR-6-(u.offsetY||0);p.setAttribute("y",String(t)),p.textContent=m}t.node.appendChild(p)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>u.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,i,a)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,n=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(a)for(var i of a(e))r.call(e,i)&&o(t,i,e[i]);return t},l=(t,a)=>e(t,i(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const a=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),u=1/45;function d(t,e,i,a){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function p(t,e){if(e<=0)return f(t);let i=e;for(;i>0;){const e=Math.min(i,u),a=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=a*e,t.value+=t.velocity*e,i-=e}return!!f(t)&&(t.value=t.target,t.velocity=0,!0)}function m(t,e){t.target=e}function f(t){var e,i;const a=null!=(e=t.restVelocity)?e:.05,s=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<a&&Math.abs(t.value-t.target)<s}const x={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const g=h.__apex_Graphics,y="__apexcharts_unit_layouts__";function b(t){return t&&globalThis[y][t]||null}globalThis[y]||(globalThis[y]={});const M="__apexcharts_unit_marks__";function _(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(n({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function A(t){return t&&globalThis[M][t]||null}globalThis[M]||(globalThis[M]={});const w=h.__apex_Utils,S=h.__apex_Environment_Environment,R=h.__apex_BrowserAPIs_BrowserAPIs,k=h.__apex_Animations_prefersReducedMotion;function v(t,e,i={}){const a=new g(t),s=i.fontSize||"12px",r=parseFloat(s)||12;let o=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,n=a.getTextRects(e,s,i.fontFamily,"",!0,i.fontWeight).width;o=Math.max(o,n>0?n:e.length*r*.58)}),o}function F(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}const E=Math.PI*(3-Math.sqrt(5)),D=(t,e)=>{const i=(t.get(e)||0)+1;return t.set(e,i),i>1?e+"#"+i:e},L=t=>("string"==typeof t&&(t=parseFloat(t)),"number"==typeof t&&isFinite(t)?t:null);function C(t){return 1-Math.pow(1-t,3)}function T(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function $(t,e){const[i,a]=null!=(r=x[null!=(s=t)?s:"crisp"])?r:x.crisp;var s,r;const o=800/Math.max(1,e);return[i*o*o,a*o]}h.default.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new g(e,this.ctx),a=i.group({class:"apexcharts-unit"});if(R.cancelAnimationFrame(e.globals.unitGatherRAF||0),R.cancelAnimationFrame(e.globals.unitExitRAF||0),e.globals.unitGatherRAF=e.globals.unitExitRAF=null,e.globals.noData||!Array.isArray(t)||0===t.length)return a;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",o=s.transition,c="flow"===o,h="identity"===o,u=s.unitValue>0?s.unitValue:1,d="grid"===r&&!(!s.grid||!s.grid.split);let p=t.map(t=>{const e=Math.abs(w.parseNumber(t))/u;return d?e:e>0?Math.max(1,Math.round(e)):0});d||"scatter"===r||(p=this._applyMaxUnits(p,s.maxUnits));const m=p.reduce((t,e)=>t+e,0),f="packed"===r?this._layoutPacked(p,s):"columns"===r?this._layoutColumns(p,s):"grid"===r?this._layoutGrid(p,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(p,s):"custom"===r?this._layoutCustom(p,s):this._layoutGrouped(p,s);"scatter"===r&&this._drawScatterAxes(a,i);const x=this._lastDotR,y=this._shouldAnimate(),b=this.ctx&&this.ctx.morphTypeChange,M=y&&!!b&&"function"==typeof b.isActive&&b.isActive()&&"function"==typeof b.getInitialSlotFor,_=M&&"function"==typeof b.usesPieceTakeover&&b.usesPieceTakeover(),A=y&&!M&&this.ctx?this.ctx._unitPrevDots:null,S=this.ctx&&this.ctx._unitPieces;S&&(this.ctx._unitPieces=null,A&&S.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),i=A.get(e),a=e=>+t.getAttribute(e);i&&A.set(e,l(n({},i),{x:a("x")+a("width")/2,y:a("y")+a("height")/2,r:Math.min(a("width"),a("height"))/2,fill:t.getAttribute("fill")}))}));const k=new Map,v=[],F=e.seriesData.unitData||[],E=this._bubbleStats(F,s,x);let L=0;const C=new Map,T=d&&this._gridTrack&&this._gridTrack.cells||[],$=i.group({class:"apexcharts-unit-track"});T.length&&a.add($);const B=s.grid&&s.grid.trackColor||"rgba(128,128,128,0.14)",z=this._baseSpec({shape:"square"===s.shape&&"square"},x),j=T.length/Math.max(1,f.length),O=this.ctx&&this.ctx._unitSprings,P=(t,e,i,a,s,r,o,n)=>{const l=A&&A.get(s),c=O&&O.get(s),h=l&&l.x===i&&l.y===a&&l.r===r&&(!c||c.x.value===i&&c.y.value===a);if(k.set(s,{x:i,y:a,fill:B,r:r,spec:e}),A&&y&&!_&&!h){const c=l?l.x:i,h=l?l.y:a;t.style.opacity=l?"1":"0",this._place(t,e,c,h),v.splice(o,0,{node:t,spec:e,x:i,y:a,cx0:c,cy0:h,key:s,r0:l&&null!=l.r?l.r:r,r1:r,delay:0,isEnter:!l,pair:n})}else this._place(t,e,i,a)},Y=(t,e)=>{const a=this._drawDot(i,s,x,B,-1,0,z);a.node.classList.add("apexcharts-unit-track-cell"),$.add(a),P(a.node,z,T[t].x,T[t].y,"trk:"+t,x,v.length,e)};if(f.forEach((t,o)=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",l=i.group({class:"apexcharts-series",seriesName:w.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),u=t.dots.length,f=F[t.i],g=v.length;t.dots.forEach((e,a)=>{T.length&&Y(o*j+a,!0);const r=null!=e.j?e.j:a,p=f?f[r]:void 0,m=p&&"object"==typeof p&&p.fillColor?p.fillColor:n,g=null!=e.r?e.r:E?this._radiusForValue(this._unitValueOf(p),E):x,w=this._markSpecFor(s,p,t.i,g),S=this._drawDot(i,s,g,m,t.i,r,w);let R;if(l.add(S),h){const t=p&&"object"==typeof p?null!=p.id?p.id:p.name:void 0;R=null!=t?`id:${D(C,String(t))}`:`g:${L}`}else R=c?String(L):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(L++,k.set(R,{x:e.x,y:e.y,fill:m,r:g,spec:w}),_)this._place(S.node,w,e.x,e.y),S.node.setAttribute("opacity","0"),S.node.setAttribute("data-piece-hidden","1"),S.node.setAttribute("data-key",R);else if(y){const i=A&&A.get(R),a=i||(M?b.getInitialSlotFor(t.i,r,u):null),o=s.gather&&s.gather.enter||"burst",n=d||"fade"===o||"rise"===o,l=a||d&&A&&A.get("trk:"+e.slot),c=l?l.x:n?e.x:t.cx,h=l?l.y:"rise"!==o||d?n?e.y:t.cy:e.y+14;S.node.style.opacity=a?"1":"0",this._place(S.node,w,c,h),v.push({node:S.node,spec:w,x:e.x,y:e.y,cx0:c,cy0:h,key:R,r0:i&&null!=i.r?i.r:g,r1:g,fill0:i?i.fill:m,fill1:m,delay:0,isEnter:!a})}else this._place(S.node,w,e.x,e.y)});for(let e=t.dots.length;e<j;e++)Y(o*j+e,!1);if(("grouped"===r||"columns"===r||d)&&s.clusterLabels&&s.clusterLabels.show&&p[t.i]>0){const e=d?this._gridDenom:m,i=this._drawClusterLabel(l,t,p[t.i],e,s,n);if(i&&d){const e={pk:1,hx:0,hy:0,r:0},a=+(i.getAttribute("x")||0),s=+(i.getAttribute("y")||0);P(i,e,a,s,"lbl:"+t.i,0,g,v.length>g)}}a.add(l)}),this._outerLabelsOn(s)&&this._drawOuterLabels(a,f,p,m,s,y&&!A),A){const t=this._collectExits(A,k,s);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});a.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=k),!this.ctx||y&&!M||(this.ctx._unitSprings=null),y&&v.length?this._runGather(v):e.globals.animationEnded=!0,a}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const a=e/i,s=this.ctx||{};return s._unitCapWarned||(s._unitCapWarned=!0,console.warn(`[ApexCharts] unit chart: ${i} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`)),t.map(t=>t>0?Math.max(1,Math.round(t*a)):0)}_layoutCustom(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),o=this._resolveLayoutProvider(e);if(!o)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const n=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=n;const l={x:n,y:0,width:Math.max(1,a-2*n),height:s},c=Math.sqrt(l.width*l.height/Math.PI),h=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(h,e);const u=this._lastDotR,d=this._layoutObjects(t,u);let p;try{p=o(d,l)}catch(i){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",i),this._layoutGrouped(t,e)}if(!Array.isArray(p))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const m=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&m.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const f=t.map((t,e)=>({i:e,cx:a/2,cy:s/2,outerR:u,dots:[]}));return d.forEach(t=>{const e=m.get(t.id);e&&f[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),f.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let a=0;t.dots.forEach(e=>{a=Math.max(a,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=a+u}),f}_layoutObjects(t,e){const i=this.w,a=i.seriesData.unitData||[],s=i.seriesData.seriesNames||[],r=[],o=new Map;let n=0;return t.forEach((t,i)=>{var l;const c=a[i];for(let a=0;a<t;a++){const t=c?c[a]:void 0,h=D(o,!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${a}`:String(null!=t.id?t.id:t.name));r.push({id:h,index:n,seriesIndex:i,dataPointIndex:a,label:s[i],value:null!=(l=this._unitValueOf(t))?l:void 0,datum:t,r:e}),n++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=b(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,o=t.map((t,e)=>e).filter(e=>t[e]>0),n=Math.max(1,o.length),l=new Array(t.length).fill(-1);o.forEach((t,e)=>l[t]=e);const c=a/n,h=s-r,u=Math.max(1,...t),d=.08*Math.min(c,h),p=Math.max(4,Math.min(c,h)/2-d),m=this._resolveStep(e,p,u);this._lastDotR=this._dotRadiusFromStep(m,e);const f=this._lastDotR,x=r+h/2,g=t.map(t=>m*Math.sqrt(Math.max(1,t))+f);let y=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):a/2)(e));const b=o.map(t=>g[t]);let M=!1;for(let t=1;t<n;t++)if(y[o[t]]-y[o[t-1]]<b[t]+b[t-1]){M=!0;break}if(M){const e=Math.max(2*f,8),i=b.reduce((t,e)=>t+2*e,0)+e*(n-1);let s;if(i<=a){let t=(a-i)/2;s=b.map(i=>{const a=t+i;return t+=2*i+e,a})}else if(1===n)s=[a/2];else{const t=b[0],e=a-b[n-1];s=b.map((i,a)=>t+(e-t)*a/(n-1))}y=t.map((t,e)=>l[e]>=0?s[l[e]]:a/2)}return t.map((t,e)=>({i:e,cx:y[e],cy:x,outerR:g[e],dots:this._spiral(y[e],x,t,m,0)}))}_layoutPacked(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),o=Math.max(4,Math.min(a,s-6)/2-.06*Math.min(a,s)),n=this._resolveStep(e,o,r);this._lastDotR=this._dotRadiusFromStep(n,e);const l=a/2,c=6+(s-6)/2,h=t.map((t,e)=>e);!1!==e.sortByGroup&&h.sort((e,i)=>t[e]-t[i]);const u=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:n*Math.sqrt(r)+this._lastDotR,dots:[]}));let d=0;return h.forEach(e=>{for(let i=0;i<t[e];i++){const t=n*Math.sqrt(d+.5),i=d*E;u[e].dots.push({x:l+t*Math.cos(i),y:c+t*Math.sin(i),slot:d}),d++}}),u}_layoutArc(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),o=e.arc||{},n="number"==typeof o.startAngle?o.startAngle:-90,l="number"==typeof o.endAngle?o.endAngle:90,c=n*Math.PI/180,h=l*Math.PI/180,u=h-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof o.innerRadiusRatio?o.innerRadiusRatio:.4)),p=t=>Math.sin(t),m=t=>-Math.cos(t),f=this._arcBounds(c,h),x=.04*Math.min(a,s),g=Math.max(1e-6,f.maxX-f.minX),y=Math.max(1e-6,f.maxY-f.minY),b=t=>Math.max(4,Math.min((a-2*x-t)/g,(s-2*x-t)/y)),M=t=>b(2*this._arcAllocate(r,t*d,t,u,e).dotR);let _=b(0),A=M(_);for(let t=0;t<6;t++){const t=(A+_)/2;t<=M(t)?A=t:_=t}const w=a/2-(f.minX+f.maxX)/2*A,S=s/2-(f.minY+f.maxY)/2*A,R=this._arcAllocate(r,A*d,A,u,e);this._lastDotR=R.dotR;const k=[];for(let t=0;t<R.R;t++){const e=R.radii[t],i=R.seatsPerRow[t];for(let t=0;t<i;t++){const a=1===i?(c+h)/2:c+u*(t+.5)/i;k.push({a:a,x:w+e*p(a),y:S+e*m(a)})}}k.sort((t,e)=>t.a-e.a);const v=t.map((t,e)=>({i:e,cx:w,cy:S,outerR:A,dots:[]}));let F=0,E=0;return k.forEach((e,i)=>{for(;F<t.length&&E>=t[F];)F++,E=0;F>=t.length||(v[F].dots.push({x:e.x,y:e.y,slot:i}),E++)}),v}_arcBounds(t,e){const i=t=>Math.sin(t),a=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),o=[0,i(t),i(e)],n=[0,a(t),a(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)o.push(i(t*l)),n.push(a(t*l));return{minX:Math.min(...o),maxX:Math.max(...o),minY:Math.min(...n),maxY:Math.max(...n)}}_arcAllocate(t,e,i,a,s){const r=s.spacing>0?s.spacing:1.05,o=Math.abs(a)||Math.PI,n=this._fixedRadius(s),l=a=>{a=Math.max(1,Math.round(a));const s=[];for(let t=0;t<a;t++)s.push(1===a?(e+i)/2:e+t/(a-1)*(i-e));const n=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/n),c=l.map(t=>Math.floor(t));let h=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{h>0&&(c[t.idx]++,h--)});h>0;)c[a-1]++,h--;const u=1===a?i-e||i:(i-e)/(a-1);let d=1/0;for(let t=0;t<a;t++){const e=c[t];if(e<=0)continue;const i=s[t]*o/e;i<d&&(d=i)}const p=Math.min(u,d);return{R:a,radii:s,seatsPerRow:c,dotR:Math.max(1,p/(2*r))}},c=s.arc&&s.arc.rows;let h;if("number"==typeof c&&c>=1)h=l(c);else if(n){h=l((i-e)/(2*n*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));h=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>h.dotR&&(h=e)}}return n&&(h.dotR=n),h}_layoutColumns(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),o=r&&"bottom"===e.clusterLabels.position,n=r&&!o?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),h=new Array(t.length).fill(-1);l.forEach((t,e)=>h[t]=e);const u=a/c,d=.62*u,p=Math.max(8,.04*s)+(o?30:0),m=Math.max(4,s-n-p),f=Math.max(1,...t),x=e.spacing>0?e.spacing:1,g=e.columns?e.columns.size:void 0;let y;y="image"!==e.shape&&"auto"===g?null:"image"!==e.shape&&"number"==typeof g&&g>0?g:this._fixedRadius(e);let b=1,M=0;if(y){M=2*y*x,this._lastDotR=y;const t=Math.max(1,Math.floor(m/M)),e=Math.max(1,Math.floor(d/M));b=Math.max(1,Math.min(e,Math.ceil(f/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let i=1;i<=e;i++){const e=Math.ceil(f/i),a=Math.min(d/i,m/e);a>t&&(t=a,b=i)}M=t,this._lastDotR=Math.max(1,M/(2*x))}const _=this._lastDotR,A=Math.ceil(f/b),w=n+(m+Math.min(m,A*M))/2;return t.map((t,e)=>{const i=h[e]>=0?u*(h[e]+.5):a/2,s=Math.ceil(Math.max(1,t)/b)*M,r=i-b*M/2+M/2,o=[];for(let e=0;e<t;e++){const t=Math.floor(e/b),i=e%b;o.push({x:r+i*M,y:w-_-t*M})}return{i:e,cx:i,cy:w-s/2,outerR:s/2,flat:!0,dots:o}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},o=Math.max(1,Math.round(r.columns>0?r.columns:10)),n="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),h=Math.max(1,Math.ceil(Math.max(1,c)/o)),u=e.spacing>0?e.spacing:1,d=Math.max(4,a),p=Math.max(4,s-6),m=this._fixedRadius(e);let f=0;m?(f=2*m*u,this._lastDotR=m):(f=Math.min(d/o,p/h),this._lastDotR=Math.max(1,f/(2*u)));const x=o*f,g=h*f,y=(a-x)/2+f/2,b=6+(p-g)/2,M=t=>"bottom"===n?b+g-f/2-t*f:b+f/2+t*f,_=t.map((t,e)=>({i:e,cx:a/2,cy:6+p/2,outerR:Math.max(x,g)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%o,i=Math.floor(A/o);_[t].dots.push({x:y+e*f,y:M(i),slot:A}),A++}return _}_layoutGridSplit(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},o=Math.max(1,Math.round(r.columns>0?r.columns:10)),n="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/o)),h=t.map((t,e)=>e).filter(e=>t[e]>0),u=Math.max(1,h.length),d=r.max>0?r.max:Math.max(...t)||1,p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(u)))),m=Math.max(1,Math.ceil(u/p)),f=!(e.clusterLabels&&!1===e.clusterLabels.show),x=f&&e.clusterLabels&&"bottom"===e.clusterLabels.position,g=f&&!x?22:4,y=f&&x?22:4,b=a/p,M=s/m,_=Math.max(4,.86*b),A=Math.max(4,M-g-y),w=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let R=0;S?(R=2*S*w,this._lastDotR=S):(R=Math.min(_/o,A/c),this._lastDotR=Math.max(1,R/(2*w)));const k=o*R,v=c*R,F=(t,e)=>"bottom"===n?t+v-R/2-e*R:t+R/2+e*R,E=[],D=[];return h.forEach((e,i)=>{const a=i%p,s=Math.floor(i/p),r=a*b,n=r+(b-k)/2+R/2,c=s*M+g+(A-v)/2,h=t=>({x:n+t%o*R,y:F(c,Math.floor(t/o))});for(let t=0;t<l;t++)E.push(h(t));const u=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),m=[];for(let t=0;t<u;t++){const e=h(t);m.push({x:e.x,y:e.y,slot:i*l+t})}D.push({i:e,cx:r+b/2,cy:c+v/2,outerR:v/2,flat:!0,split:!0,dots:m})}),this._gridDenom=d,this._gridTrack={cells:E},D}_layoutScatter(t){const e=this.w,i=t.scatter||{},a=e.seriesData.unitData||[],s=a.map(t=>t?t.length:0),r=this._applyMaxUnits(s,t.maxUnits),o=(t,e)=>Math.floor((e+1)*r[t]/s[t])>Math.floor(e*r[t]/s[t]);if("value"===i.y)return this._layoutScatter2D(t,o);if("vertical"===i.orientation)return this._layoutScatterVertical(t,o);const n=e.layout.gridWidth,l=e.layout.gridHeight,c=e.seriesData.seriesNames||[],h=t=>this._unitValueOf(t),u=this._scatterSizeStats(i,a),d=a.map(t=>Array.isArray(t)?t.map(h):[]),p=t=>null!=t&&isFinite(t),m=d.map((t,e)=>e).filter(t=>d[t].some(p)),f=Math.max(1,m.length);let x=1/0,g=-1/0;d.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<x&&(x=t),t>g&&(g=t))})),x===1/0&&(x=0,g=1);const y=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),b=this._scatterValueDomain(i.xMin,i.xMax,x,g,y),M=b.min,_=b.max,A=_-M||1,w={fontFamily:e.config.chart.fontFamily,fontWeight:600},S=t=>c[t]||`series-${t+1}`,R=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):f>1?Math.min(n/3,v(e,m.map(S),w)+14):8,k=30+(i.xTitle?20:0),E=R,D=n-8,L=l-k,C=Math.max(4,D-E),T=Math.max(4,L-10),$=t=>E+(t-M)/A*C,B=T/f;let z=0;const j=this._fixedRadius(t);if(j)z=j;else{const t=Math.max(1,...m.map(t=>d[t].filter(p).length));z=Math.max(2,Math.min(6,.12*B,C/(2.5*Math.sqrt(t))))}this._lastDotR=z;const O=t.spacing>0?t.spacing:1,P=Math.max(.5,z*O),Y="jitter"===i.spread,W=[],N=[],q=u?u.rMax:z;m.forEach((t,i)=>{const s=(t=>10+B*(t+.5))(i);let r=S(t);const n=R>12?v(e,[r],w):0;n>R-14&&n&&(r=r.slice(0,Math.max(1,Math.floor(r.length*(R-14)/n)-1))+"\u2026"),N.push({i:t,cy:s,name:r});const l=[];if((a[t]||[]).forEach((e,i)=>{const a=h(e);if(!p(a)||!o(t,i))return;const r={j:i,px:$(a),y:s};u&&(r.r=this._scatterRadius(e,u,z)),l.push(r)}),Y){const e=Math.max(q,B/2-q);l.forEach(i=>{i.y=s+(2*F(7919*t+i.j)-1)*e})}else this._beeswarm(l,s,z,P,q);W.push({i:t,cx:(E+D)/2,cy:s,outerR:B/2,dots:l.map(t=>({x:t.px,y:t.y,r:t.r,j:t.j}))})});const I=b.ticks;return this._scatterAxis={mode:"1d",plotL:E,plotR:D,plotT:10,plotB:L,xMin:M,xMax:_,plotX:$,ticks:I,lanes:N,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},W}_layoutScatterVertical(t,e){const i=this.w,a=t.scatter||{},s=i.layout.gridWidth,r=i.layout.gridHeight,o=i.seriesData.unitData||[],n=i.seriesData.seriesNames||[],l=t=>this._unitValueOf(t),c=this._scatterSizeStats(a,o),h=o.map(t=>Array.isArray(t)?t.map(l):[]),u=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(u)),p=Math.max(1,d.length);let m=1/0,f=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>f&&(f=t))})),m===1/0&&(m=0,f=1);const x=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),g=this._scatterValueDomain(a.xMin,a.xMax,m,f,x),y=g.min,b=g.max,M=b-y||1,_=46+(a.xTitle?18:0),A=s-10,w=r-(p>1?26:10),S=Math.max(4,A-_),R=Math.max(4,w-10),k=t=>w-(t-y)/M*R,v=S/p;let E=0;const D=this._fixedRadius(t);if(D)E=D;else{const t=Math.max(1,...d.map(t=>h[t].filter(u).length));E=Math.max(2,Math.min(6,.12*v,R/(2.5*Math.sqrt(t))))}this._lastDotR=E;const L=t.spacing>0?t.spacing:1,C=Math.max(.5,E*L),T="jitter"===a.spread,$=[],B=[],z=c?c.rMax:E;d.forEach((t,i)=>{const a=(t=>_+v*(t+.5))(i);B.push({i:t,cx:a,name:n[t]||`series-${t+1}`});const s=[];if((o[t]||[]).forEach((i,r)=>{const o=l(i);if(!u(o)||!e(t,r))return;const n={j:r,py:k(o),x:a};c&&(n.r=this._scatterRadius(i,c,E)),s.push(n)}),T){const e=Math.max(z,v/2-z);s.forEach(i=>{i.x=a+(2*F(7919*t+i.j)-1)*e})}else this._beeswarm(s,a,E,C,z,!0);$.push({i:t,cx:a,cy:(10+w)/2,outerR:v/2,dots:s.map(t=>({x:t.x,y:t.py,r:t.r,j:t.j}))})});const j=g.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:_,plotR:A,plotT:10,plotB:w,vMin:y,vMax:b,plotY:k,ticks:j,lanes:B,valueTitle:a.xTitle,formatter:"function"==typeof a.xFormatter?a.xFormatter:null,gridlines:!1!==a.gridlines},$}_layoutScatter2D(t,e){const i=this.w,a=i.layout.gridWidth,s=i.layout.gridHeight,r=t.scatter||{},o=i.seriesData.unitData||[],n=t=>null!=t,l=t=>t&&"object"==typeof t?L(t.x):null,c=t=>t&&"object"==typeof t?L(null!=t.y?t.y:t.value):null,h=o.map((t,e)=>e).filter(t=>(o[t]||[]).some(t=>n(l(t))&&n(c(t))));let u=1/0,d=-1/0,p=1/0,m=-1/0;o.forEach(t=>(t||[]).forEach(t=>{const e=l(t),i=c(t);n(e)&&n(i)&&(e<u&&(u=e),e>d&&(d=e),i<p&&(p=i),i>m&&(m=i))})),u===1/0&&(u=0,d=1,p=0,m=1);const f=this._scatterValueDomain(r.xMin,r.xMax,u,d,Math.max(2,Math.round(r.tickAmount>0?r.tickAmount:5))),x=this._scatterValueDomain(r.yMin,r.yMax,p,m,Math.max(2,Math.round(r.yTickAmount>0?r.yTickAmount:5))),g=f.min,y=f.max,b=x.min,M=x.max,_=y-g||1,A=M-b||1,w=46+(r.yTitle?18:0),S=30+(r.xTitle?20:0),R=w,k=a-12,v=s-S,F=Math.max(4,k-R),E=Math.max(4,v-10),D=t=>R+(t-g)/_*F,C=t=>v-(t-b)/A*E,T=this._scatterSizeStats(r,o),$=this._fixedRadius(t)||5;this._lastDotR=$;const B=[];return h.forEach(t=>{const i=[];(o[t]||[]).forEach((a,s)=>{const r=l(a),o=c(a);null!=r&&null!=o&&e(t,s)&&i.push({x:D(r),y:C(o),r:T?this._scatterRadius(a,T,$):void 0,j:s})}),B.push({i:t,cx:(R+k)/2,cy:(10+v)/2,outerR:E/2,dots:i})}),this._scatterAxis={mode:"2d",plotL:R,plotR:k,plotT:10,plotB:v,plotX:D,plotY:C,xTicks:f.ticks,yTicks:x.ticks,xTitle:r.xTitle,yTitle:r.yTitle,xFormatter:"function"==typeof r.xFormatter?r.xFormatter:null,yFormatter:"function"==typeof r.yFormatter?r.yFormatter:null,gridlines:!1!==r.gridlines},B}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const a=Math.max(.5,+i[0]),s=Math.max(a,+i[1]),r=t.sizeField||"z";let o=1/0,n=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<o&&(o=e),e>n&&(n=e))})),o===1/0?null:{zmin:o,zmax:n,rMin:a,rMax:s,field:r}}_scatterRadius(t,e,i){if(!e)return i;const a=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof a||!isFinite(a))return e.rMin;const s=e.zmax>e.zmin?(a-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),o=e.rMin*e.rMin,n=e.rMax*e.rMax;return Math.sqrt(o+r*(n-o))}_beeswarm(t,e,i,a,s,r=!1){const o=r?"py":"px",n=r?"x":"y",l=t.slice().sort((t,e)=>t[o]-e[o]),c=[],h=null!=s?s:i;l.forEach(t=>{const s=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const n=0===i?0:Math.ceil(i/2)*a*(i%2?1:-1),l=e+n;let u=!0;for(let e=c.length-1;e>=0;e--){const i=c[e],a=t[o]-i.f;if(a>s+h)break;const r=s+i.r,n=l-i.s;if(a*a+n*n<r*r){u=!1;break}}if(u){r=n;break}}t[n]=e+r,c.push({f:t[o],s:t[n],r:s})})}_scatterValueDomain(t,e,i,a,s){const r=(t,e,i)=>{const a=[];for(let s=0,r=t;r<=e+.5*i;r=t+ ++s*i)a.push(Math.abs(r)<1e-9*i?0:r);return a};if(null!=t||null!=e){let o=null!=t?t:e,n=null!=e?e:t;const l=n>o?(n-o)/Math.max(1,s-1):this._niceScale(Math.min(o,i),Math.max(n,a),s).spacing;if(i<o&&(o-=Math.ceil((o-i)/l)*l),a>n&&(n+=Math.ceil((a-n)/l)*l),n>o||(n=o+l),(n-o)/l<=2*s)return{min:o,max:n,ticks:r(o,n,l)};i=o,a=n}const o=this._niceScale(i,a,s),n=o.spacing||(o.max-o.min)/Math.max(1,s-1);return{min:o.min,max:o.max,ticks:r(o.min,o.max,n)}}_niceScale(t,e,i){const a=t;let s=e;s>a||(s=a+1);const r=this._niceNum(s-a,!1),o=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(a/o)*o,max:Math.ceil(s/o)*o,spacing:o}}_niceNum(t,e){const i=t>0?t:1,a=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,a);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,a)}_drawScatterAxes(t,e){const i=this.w;if(!S.isBrowser())return;const a=this._scatterAxis;if(!a)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),o=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",n="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,h=c||"rgba(120,130,140,0.9)",u=(t,e,i,a,o)=>{const n=R.createElementNS(s,"line");n.setAttribute("x1",String(t)),n.setAttribute("y1",String(e)),n.setAttribute("x2",String(i)),n.setAttribute("y2",String(a)),n.setAttribute("stroke",o),n.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(n)},d=(t,e,a,o,n,l,c,h)=>{const u=R.createElementNS(s,"text");u.setAttribute("class",h),u.setAttribute("x",String(e)),u.setAttribute("y",String(a)),u.setAttribute("text-anchor",o),u.setAttribute("dominant-baseline","middle"),u.setAttribute("font-size",`${l}px`),u.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),u.setAttribute("font-weight",String(c)),u.setAttribute("fill",n),u.textContent=t,r.node.appendChild(u)};if("2d"!==a.mode){if("vertical"===a.orientation){if(a.ticks.forEach(t=>{const e=a.plotY(t);a.gridlines&&u(a.plotL,e,a.plotR,e,o);const i=a.formatter?String(a.formatter(t)):this._formatTick(t,a.ticks);d(i,a.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),u(a.plotL,a.plotT,a.plotL,a.plotB,n),a.valueTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,o=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(o)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${o})`),t.textContent=String(a.valueTitle),r.node.appendChild(t)}return a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,t.cx,a.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}a.ticks.forEach((t,e)=>{const i=a.plotX(t);a.gridlines&&u(i,a.plotT,i,a.plotB,o);const s=a.formatter?String(a.formatter(t)):this._formatTick(t,a.ticks),r=0===e?"start":e===a.ticks.length-1?"end":"middle";d(s,i,a.plotB+14,r,h,11,400,"apexcharts-unit-tick")}),u(a.plotL,a.plotB,a.plotR,a.plotB,n),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),a.plotL>12&&a.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,a.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(a.yTicks.forEach(t=>{const e=a.plotY(t);a.gridlines&&u(a.plotL,e,a.plotR,e,o);const i=a.yFormatter?String(a.yFormatter(t)):this._formatTick(t,a.yTicks);d(i,a.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),a.xTicks.forEach(t=>{const e=a.plotX(t);a.gridlines&&u(e,a.plotT,e,a.plotB,o);const i=a.xFormatter?String(a.xFormatter(t)):this._formatTick(t,a.xTicks);d(i,e,a.plotB+14,"middle",h,11,400,"apexcharts-unit-tick")}),u(a.plotL,a.plotB,a.plotR,a.plotB,n),u(a.plotL,a.plotT,a.plotL,a.plotB,n),a.xTitle&&d(String(a.xTitle),(a.plotL+a.plotR)/2,a.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),a.yTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,o=(a.plotT+a.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(o)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${o})`),t.textContent=String(a.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t,e){if(!isFinite(t))return"";const i=Math.abs(t);if(i>=1e6)return+(t/1e6).toFixed(1)+"M";if(i>=1e4)return+(t/1e3).toFixed(1)+"k";if(Number.isInteger(t))return String(t);const a=Math.abs(e[1]-e[0])||1;return String(+t.toFixed(Math.min(20,Math.max(2,1-Math.floor(Math.log10(a))))))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const a=t.map(t=>t/i*e),s=a.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),o=Math.max(0,e-r),n=a.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<o&&t<n.length;t++)l[n[t].i]++;return l}_spiral(t,e,i,a,s){const r=[];for(let o=0;o<i;o++){const i=s+o,n=a*Math.sqrt(i+.5),l=i*E;r.push({x:t+n*Math.cos(l),y:e+n*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){return L(t&&"object"==typeof t?null!=t.value?t.value:t.y:t)}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,a=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+a*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+a*(r-s))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let a=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<a&&(a=e),e>s&&(s=e))})}),a===1/0||s<a)return null;const r=e.sizeByValue,o=i,n=Math.max(1,Math.min(o,"number"==typeof r.minRadius?r.minRadius:.35*o));return{min:a,max:s,minR:n,maxR:o,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const a=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*a:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,a=this._fixedRadius(e);return a||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,a,s=1){const r=e;2===r.pk?t.setAttribute("transform","translate("+(i-r.ox*s)+","+(a-r.oy*s)+(1===s?r.tail:") scale("+r.s*s+")")):1===r.pk?(t.setAttribute("x",String(i-r.hx*s)),t.setAttribute("y",String(a-r.hy*s))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(a)))}_size(t,e,i){const a=e;0===a.pk?t.setAttribute("r",String(a.r*i)):1===a.pk&&(t.setAttribute("width",String(2*a.hx*i)),t.setAttribute("height",String(2*a.hy*i)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:a,hy:s}=this._halfExtent(t,i);return{pk:1,hx:a,hy:s,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return _(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return _(e);const i=A(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,i){const a=Math.round(10*e)/10,s=t.name+t.path+t.viewBox+t.fillRule+a,r=this._specCache.get(s);if(r)return r;const o=t.viewBox||[0,0,100,100],n=2*a*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?n/o[2]:"height"===i.fit?n/o[3]:n/Math.max(o[2],o[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(o[0]+o[2]/2)*l,oy:(o[1]+o[3]/2)*l,tail:") scale("+l+")",r:a});return this._specCache.set(s,c),c}_markSpecFor(t,e,i,a){if("pictogram"!==t.shape)return this._baseSpec(t,a);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,o=Array.isArray(s.mark)?s.mark[i%s.mark.length]:s.mark,c=this._resolveMark(null!=r?r:o);return c?this._glyphSpec(c,a,s):this._baseSpec(l(n({},t),{shape:"square"===s.fallback?"square":"circle"}),a)}_drawDot(t,e,i,a,s,r,o){const n=this.w,l=n.config.stroke.show?n.config.stroke.width:0,c=Array.isArray(n.globals.stroke.colors)&&n.globals.stroke.colors[s]||"none",h="number"==typeof n.config.fill.opacity?n.config.fill.opacity:1;let u;if(2===o.pk)u=n.dom.Paper.path(o.d),u.node.setAttribute("fill",a),"evenodd"===o.fillRule&&u.node.setAttribute("fill-rule","evenodd"),h<1&&u.node.setAttribute("fill-opacity",String(h)),u.node.setAttribute("data:r",String(o.r));else if(1===o.pk&&"image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;u=n.dom.Paper.image(e.image.src),u.node.setAttribute("width",String(t)),u.node.setAttribute("height",String(i)),u.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&u.node.setAttribute("filter",`url(#${this._tintFilter(a)})`)}else if(1===o.pk){const s=2*i;u=t.drawRect(0,0,s,s,e.borderRadius||0,a,1,l,c),u.node.setAttribute("fill",a),h<1&&u.node.setAttribute("fill-opacity",String(h))}else u=t.drawCircle(i,{fill:a,"stroke-width":l,stroke:c}),u.node.setAttribute("fill",a),h<1&&u.node.setAttribute("fill-opacity",String(h));return s>=0&&(u.node.classList.add("apexcharts-unit-area"),u.node.setAttribute("i",String(s)),u.node.setAttribute("j",String(r))),u}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",a=this._tints||(this._tints=new Map);let s=a.get(t);if(s)return s;s=`apexcharts-unit-tint-${e.globals.chartID}-${a.size}`,a.set(t,s);const r=e.dom.Paper.node;let o=r.querySelector("defs");o||(o=R.createElementNS(i,"defs"),r.insertBefore(o,r.firstChild));const n=R.createElementNS(i,"filter");n.setAttribute("id",s),n.setAttribute("x","0%"),n.setAttribute("y","0%"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const l=R.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=R.createElementNS(i,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),n.appendChild(l),n.appendChild(c),o.appendChild(n),s}_placeDot(t,e,i,a,s){this._place(t,s||this._baseSpec(e),i,a)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!S.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!k()))))}_seedSprings(t,e,i){const[a,s]=$(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,o=new Map;for(let e=0;e<t.length;e++){const i=t[e],n=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=n?n.x:d(i.cx0,a,s),c=n?n.y:d(i.cy0,a,s);n&&(l.stiffness=a,c.stiffness=a,l.damping=s,c.damping=s,i.cx0=l.value,i.cy0=c.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===c.velocity||(i.delay=0)),i.sx=l,i.sy=c,null!=i.key&&o.set(i.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=o)}_stale(t){const e=this.w.dom.Paper;return!!this.w.globals.isDestroyed||!e||!e.node.contains(t)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,a=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*a,450),r=t.length;for(let e=r;e--;)t[e].delay=t[e].pair?t[e+1].delay:r>1?e/(r-1)*s:0;const o=i.gather||{},n=o.motion||"auto";"spring"===n||"auto"===n&&(!o.easing||"outCubic"===o.easing)?this._seedSprings(t,o,a):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];i.r0!==i.r1&&(this._size(i.node,i.spec,i.r0/i.r1),this._place(i.node,i.spec,i.cx0,i.cy0,i.r0/i.r1))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===o.easing?(c="number"==typeof o.overshoot?o.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===o.easing?T:C;var c;const h=performance.now();let u=h;const d=e=>{if(this._stale(t[0].node))return void(this.w.globals.unitGatherRAF=null);const i=Math.min(.25,Math.max(0,(e-u)/1e3));u=e;let s=!0;for(let o=0;o<r;o++){const r=t[o],n=e-h-r.delay,c=Math.max(0,Math.min(1,n/a)),u=C(c);let d,f;if(r.sx&&r.sy){n>=0&&!r.released&&(m(r.sx,r.x),m(r.sy,r.y),r.released=!0);const t=p(r.sx,i),e=p(r.sy,i);r.released&&t&&e||(s=!1),d=r.sx.value,f=r.sy.value}else{const t=l(c);d=r.cx0+(r.x-r.cx0)*t,f=r.cy0+(r.y-r.cy0)*t}let x=1;if(r.r0!==r.r1&&(x=(r.r0+(r.r1-r.r0)*u)/r.r1,this._size(r.node,r.spec,x)),this._place(r.node,r.spec,d,f,x),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*u),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*u),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*u);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),i.r0!==i.r1&&(this._size(i.node,i.spec,1),this._place(i.node,i.spec,i.x,i.y))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)}_collectExits(t,e,i){const a=Math.max(0,i.maxUnits||5e3),s=[];for(const[i,r]of t)if(!e.has(i)&&"l"!==i[0]&&(s.push(r),s.length>=a))break;return s}_runExits(t,e,i){const a=this.w,s=new g(a,this.ctx),r=this._lastDotR,o=a.layout.gridWidth/2,n=a.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,c=[];if(e.forEach(e=>{const a=null!=e.r?e.r:r,o=e.spec||this._baseSpec(i,a),n=this._drawDot(s,i,a,e.fill,-1,0,o);n.node.classList.add("apexcharts-unit-exit"),this._place(n.node,o,e.x,e.y),t.add(n),c.push({node:n.node,x0:e.x,y0:e.y,spec:o})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const h=Math.max(1,a.config.chart.animations.speed||800),u=performance.now(),d=e=>{if(this._stale(t.node))return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-u)/h)),a=C(i);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(o-e.x0)*a*l,i=e.y0+(n-e.y0)*a*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-a)}i<1?this.w.globals.unitExitRAF=R.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=R.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,a){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,o=i>0?e/i*100:0,n=a.clusterLabels,l="function"==typeof n.formatter?n.formatter(r,{seriesIndex:t,value:e,percent:o,w:s}):`${r}\n${o.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,a=e.clusterLabels,s=a.external.connector||{},r=t.reduce((t,e)=>t+e,0),o=[];if(t.forEach((t,i)=>{t>0&&o.push(...this._outerLabelLines(i,t,r,e))}),!o.length)return 0;const n=v(i,o,{fontSize:a.fontSize,fontFamily:a.fontFamily||i.config.chart.fontFamily,fontWeight:a.fontWeight})+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(a.external.offsetX)||0);return Math.min(n,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,a,s,r){const o=this.w;if(!S.isBrowser())return;const n=s.clusterLabels,l=n.external,c=l.connector||{},h=null!=c.gap?c.gap:8,u=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,m=o.layout.gridWidth,f=o.layout.gridHeight,x=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let b=0,M=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),M=Math.max(...e)-Math.min(...e)}const _=b>M,A=parseFloat(n.fontSize)||13,w=Math.round(1.35*A),R=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],a,s);if(!r.some(t=>""!==t))return;const o=_?t.cx>=m/2?"right":"left":e%2==0?"right":"left",n="right"===o?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const i=n*e.x-.75*Math.abs(e.y-t.cy);i>c&&(c=i,l=e)});const f={x:l.x+n*(l.r||x),y:l.y},g={x:f.x+n*h,y:f.y};R.push({i:t.i,lines:r,anchor:f,elbow:g,labelX:g.x+n*u+d,idealY:f.y+p,labelY:f.y+p,side:o})}),!R.length)return;const k=R.reduce((t,e)=>Math.max(t,e.lines.length),1)*w,v=k/2;["left","right"].forEach(t=>{!function(t,e,i,a){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],o=r?r.labelY-i:0;if(o>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=o,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=a&&s.length&&s[0].labelY<a){const t=a-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(R.filter(e=>e.side===t),k+2,f-v,v)});const F=new g(o,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,o.config.chart.animations.speed||800);F.node.classList.add("apexcharts-unit-label-delay"),F.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}R.forEach(t=>{const e=o.globals.colors[t.i]||o.globals.colors[0]||"#008FFB";F.add(function(t,e){const{lines:i,lineHeight:a,anchor:s,elbow:r,labelX:o,labelY:n,side:l,connector:c,style:h,foreColor:u}=e,d=new g(t),p=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${o} ${n}`,i=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const m="right"===l?o+4:o-4,f=i.length,x=n-(f-1)*a/2,y=d.drawText({x:m,y:x,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:h.fontSize,fontFamily:h.fontFamily,fontWeight:h.fontWeight,foreColor:u,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${m}`),t[e].setAttribute("dy",0===e?"0":`${a}`)}return p.add(y),p}(o,{lines:t.lines,lineHeight:w,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:n.fontSize,fontFamily:n.fontFamily||o.config.chart.fontFamily,fontWeight:n.fontWeight},foreColor:n.color||o.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(F)}_drawClusterLabel(t,e,i,a,s,r){const o=this.w;if(!S.isBrowser())return;const n="http://www.w3.org/2000/svg",l=o.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=a>0?i/a*100:0,h=s.clusterLabels,u=parseFloat(h.fontSize)||13;let d;d="function"==typeof h.formatter?h.formatter(l,{seriesIndex:e.i,value:i,percent:c,w:o}):`${l} (${c.toFixed(1)}%)`;const p="string"==typeof d?d:String(d),m=R.createElementNS(n,"text");m.setAttribute("class","apexcharts-unit-label"),m.setAttribute("text-anchor","middle"),m.setAttribute("font-size",`${u}px`),m.setAttribute("font-family",h.fontFamily||o.config.chart.fontFamily||"inherit"),m.setAttribute("font-weight",String(h.fontWeight||600)),m.setAttribute("fill",h.color||r);const f="bottom"===h.position,x=e.outerR+.6*u+3+(h.offsetY||0),g=p.length*u*.55;if(!f&&!e.flat&&!1!==h.curved&&g<=Math.PI*x*.95){const i=e.cy,a=`M ${e.cx-x} ${i} A ${x} ${x} 0 0 1 ${e.cx+x} ${i}`,s=`apexcharts-unit-label-${o.globals.chartID}-${e.i}`,r=R.createElementNS(n,"path");r.setAttribute("id",s),r.setAttribute("d",a),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=R.createElementNS(n,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=p,m.appendChild(l),t.node.appendChild(r)}else{m.setAttribute("x",String(e.cx));const t=f?e.cy+e.outerR+u+6+(h.offsetY||0):e.cy-e.outerR-6-(h.offsetY||0);m.setAttribute("y",String(t)),m.textContent=p}return t.node.appendChild(m),m}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});