apexcharts 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/apexcharts.common.js +2 -2
  2. package/dist/apexcharts.core.js +1 -1
  3. package/dist/apexcharts.core.min.js +1 -1
  4. package/dist/apexcharts.esm.js +167 -2
  5. package/dist/apexcharts.js +167 -2
  6. package/dist/apexcharts.min.js +2 -2
  7. package/dist/apexcharts.ssr.common.js +2 -2
  8. package/dist/apexcharts.ssr.esm.js +167 -2
  9. package/dist/area.common.js +1 -1
  10. package/dist/area.esm.js +1 -1
  11. package/dist/bar.common.js +1 -1
  12. package/dist/bar.esm.js +1 -1
  13. package/dist/bar.js +1 -1
  14. package/dist/boxPlot.common.js +1 -1
  15. package/dist/boxPlot.esm.js +1 -1
  16. package/dist/bubble.common.js +1 -1
  17. package/dist/bubble.esm.js +1 -1
  18. package/dist/candlestick.common.js +1 -1
  19. package/dist/candlestick.esm.js +1 -1
  20. package/dist/candlestick.js +1 -1
  21. package/dist/column.common.js +1 -1
  22. package/dist/column.esm.js +1 -1
  23. package/dist/core.common.js +1 -1
  24. package/dist/core.esm.js +1 -1
  25. package/dist/donut.common.js +1 -1
  26. package/dist/donut.esm.js +1 -1
  27. package/dist/dumbbell.common.js +1 -1
  28. package/dist/dumbbell.esm.js +1 -1
  29. package/dist/features/all.common.js +2 -2
  30. package/dist/features/all.esm.js +167 -2
  31. package/dist/features/annotations.common.js +1 -1
  32. package/dist/features/annotations.esm.js +1 -1
  33. package/dist/features/annotations.js +1 -1
  34. package/dist/features/context-menu.common.js +1 -1
  35. package/dist/features/context-menu.esm.js +1 -1
  36. package/dist/features/context-menu.js +1 -1
  37. package/dist/features/drilldown.common.js +1 -1
  38. package/dist/features/drilldown.esm.js +1 -1
  39. package/dist/features/drilldown.js +1 -1
  40. package/dist/features/dumbbell.common.js +1 -1
  41. package/dist/features/dumbbell.esm.js +1 -1
  42. package/dist/features/dumbbell.js +1 -1
  43. package/dist/features/exports.common.js +1 -1
  44. package/dist/features/exports.esm.js +1 -1
  45. package/dist/features/exports.js +1 -1
  46. package/dist/features/facet.common.js +1 -1
  47. package/dist/features/facet.esm.js +1 -1
  48. package/dist/features/facet.js +1 -1
  49. package/dist/features/history.common.js +1 -1
  50. package/dist/features/history.esm.js +1 -1
  51. package/dist/features/history.js +1 -1
  52. package/dist/features/ink.common.js +1 -1
  53. package/dist/features/ink.esm.js +1 -1
  54. package/dist/features/ink.js +1 -1
  55. package/dist/features/keyboard.common.js +1 -1
  56. package/dist/features/keyboard.esm.js +1 -1
  57. package/dist/features/keyboard.js +1 -1
  58. package/dist/features/legend.common.js +1 -1
  59. package/dist/features/legend.esm.js +1 -1
  60. package/dist/features/legend.js +1 -1
  61. package/dist/features/link.common.js +1 -1
  62. package/dist/features/link.esm.js +1 -1
  63. package/dist/features/link.js +1 -1
  64. package/dist/features/marks.common.js +1 -1
  65. package/dist/features/marks.esm.js +1 -1
  66. package/dist/features/marks.js +1 -1
  67. package/dist/features/measure.common.js +1 -1
  68. package/dist/features/measure.esm.js +1 -1
  69. package/dist/features/measure.js +1 -1
  70. package/dist/features/morph.common.js +1 -1
  71. package/dist/features/morph.esm.js +1 -1
  72. package/dist/features/morph.js +1 -1
  73. package/dist/features/perspectives.common.js +1 -1
  74. package/dist/features/perspectives.esm.js +1 -1
  75. package/dist/features/perspectives.js +1 -1
  76. package/dist/features/raincloud.common.js +1 -1
  77. package/dist/features/raincloud.esm.js +1 -1
  78. package/dist/features/raincloud.js +1 -1
  79. package/dist/features/renderer-canvas.common.js +1 -1
  80. package/dist/features/renderer-canvas.esm.js +1 -1
  81. package/dist/features/renderer-canvas.js +1 -1
  82. package/dist/features/stats.common.js +1 -1
  83. package/dist/features/stats.esm.js +1 -1
  84. package/dist/features/stats.js +1 -1
  85. package/dist/features/storyboard.common.js +1 -1
  86. package/dist/features/storyboard.esm.js +1 -1
  87. package/dist/features/storyboard.js +1 -1
  88. package/dist/features/streamgraph.common.js +1 -1
  89. package/dist/features/streamgraph.esm.js +1 -1
  90. package/dist/features/streamgraph.js +1 -1
  91. package/dist/features/toolbar.common.js +1 -1
  92. package/dist/features/toolbar.esm.js +1 -1
  93. package/dist/features/toolbar.js +1 -1
  94. package/dist/features/trellis.common.js +1 -1
  95. package/dist/features/trellis.esm.js +1 -1
  96. package/dist/features/trellis.js +1 -1
  97. package/dist/features/waterfall.common.js +1 -1
  98. package/dist/features/waterfall.esm.js +1 -1
  99. package/dist/features/waterfall.js +1 -1
  100. package/dist/features/weave.common.js +2 -2
  101. package/dist/features/weave.esm.js +167 -2
  102. package/dist/features/weave.js +2 -2
  103. package/dist/heatmap.common.js +1 -1
  104. package/dist/heatmap.esm.js +1 -1
  105. package/dist/heatmap.js +1 -1
  106. package/dist/histogram.common.js +1 -1
  107. package/dist/histogram.esm.js +1 -1
  108. package/dist/line.common.js +1 -1
  109. package/dist/line.esm.js +1 -1
  110. package/dist/line.js +1 -1
  111. package/dist/pictograms.common.js +1 -1
  112. package/dist/pictograms.esm.js +1 -1
  113. package/dist/pictograms.js +1 -1
  114. package/dist/pie.common.js +1 -1
  115. package/dist/pie.esm.js +1 -1
  116. package/dist/pie.js +1 -1
  117. package/dist/polarArea.common.js +1 -1
  118. package/dist/polarArea.esm.js +1 -1
  119. package/dist/radar.common.js +1 -1
  120. package/dist/radar.esm.js +1 -1
  121. package/dist/radar.js +1 -1
  122. package/dist/radialBar.common.js +1 -1
  123. package/dist/radialBar.esm.js +1 -1
  124. package/dist/radialBar.js +1 -1
  125. package/dist/raincloud.common.js +1 -1
  126. package/dist/raincloud.esm.js +1 -1
  127. package/dist/rangeArea.common.js +1 -1
  128. package/dist/rangeArea.esm.js +1 -1
  129. package/dist/rangeBar.common.js +1 -1
  130. package/dist/rangeBar.esm.js +1 -1
  131. package/dist/scatter.common.js +1 -1
  132. package/dist/scatter.esm.js +1 -1
  133. package/dist/streamgraph.common.js +1 -1
  134. package/dist/streamgraph.esm.js +1 -1
  135. package/dist/sunburst.common.js +1 -1
  136. package/dist/sunburst.esm.js +1 -1
  137. package/dist/sunburst.js +1 -1
  138. package/dist/treemap.common.js +1 -1
  139. package/dist/treemap.esm.js +1 -1
  140. package/dist/treemap.js +1 -1
  141. package/dist/unit-shapes.common.js +1 -1
  142. package/dist/unit-shapes.esm.js +1 -1
  143. package/dist/unit-shapes.js +1 -1
  144. package/dist/unit.common.js +1 -1
  145. package/dist/unit.esm.js +1 -1
  146. package/dist/unit.js +1 -1
  147. package/dist/violin.common.js +1 -1
  148. package/dist/violin.esm.js +1 -1
  149. package/dist/violin.js +1 -1
  150. package/dist/waterfall.common.js +1 -1
  151. package/dist/waterfall.esm.js +1 -1
  152. package/package.json +1 -1
  153. package/src/modules/weave/PluginAPI.js +37 -1
  154. package/src/modules/weave/WeaveHost.js +148 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v7.2.0
2
+ * ApexCharts v7.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&a(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_axes_AxesUtils,u=h.__apex_Data,g=h.__apex_Series,p=h.__apex_Utils,f=h.__apex_Environment_Environment,m=h.__apex_BrowserAPIs_BrowserAPIs,x=h.__apex_math_SVGNS;class y{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],r=document.createElementNS(x,"image");r.setAttribute("x",n.getAttribute("x")||"0"),r.setAttribute("y",n.getAttribute("y")||"0"),r.setAttribute("width",n.getAttribute("width")||"0"),r.setAttribute("height",n.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(r,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!f.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=m.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!f.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!f.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(x,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,r=i.globals.svgHeight*s,a=i.dom.elWrap.cloneNode(!0);a.style.width=n+"px",a.style.height=r+"px",this.inlineCanvasLayers(a),this.applyExportStyles(a);const o=(new XMLSerializer).serializeToString(a);let l=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${r}px;">\n ${o}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==s&&this.scaleSvgNode(c,s),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),e(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const r=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(r).catch(()=>this.getBase64FromUrl(n).then(r).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return f.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return f.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const r=this.resolveExportBackground(),a=n.getContext("2d");a&&(a.fillStyle=r,a.fillRect(0,0,n.width,n.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{a.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w;t||(t=n.config.series);let r=[];const a=[];let o="";const l=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>{if(null==t||p.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},h=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():p.isNumber(t)?t:c(t.split(i).join("")),f=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):c(t),m=Math.max(...t.map(t=>t.data?t.data.length:0)),x=new u(this.w),y=new d(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new g(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=y.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),p.isNumber(e)?e:e.split(i).join(""))},w=(e,s)=>{var o,c,d,u,g,p;if(r.length&&0===s&&a.push(r.join(i)),e.data){const y=e.data.length?e.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){r=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=t[s].data[m].x:x.isFormat2DArray()&&(y=t[s].data[m]?t[s].data[m][0]:"")),0===s){r.push(h(y));for(let e=0;e<n.seriesData.series.length;e++){const i=x.isFormatXY()?null==(o=t[e].data[m])?void 0:o.y:l[e][m];r.push(f(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(n.candleData.seriesCandleO[s][m]),r.push(n.candleData.seriesCandleH[s][m]),r.push(n.candleData.seriesCandleL[s][m]),r.push(n.candleData.seriesCandleC[s][m])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(n.candleData.seriesCandleO[s][m]),r.push(n.candleData.seriesCandleH[s][m]),r.push(n.candleData.seriesCandleM[s][m]),r.push(n.candleData.seriesCandleL[s][m]),r.push(n.candleData.seriesCandleC[s][m])),"rangeBar"===n.config.chart.type&&(r.pop(),r.push(n.rangeData.seriesRangeStart[s][m]),r.push(n.rangeData.seriesRangeEnd[s][m])),("violin"===n.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(c=n.violinData.seriesViolinMin[s])?void 0:c[m]),r.push(null==(d=n.violinData.seriesViolinMax[s])?void 0:d[m]),r.push(null!=(p=null==(g=null==(u=n.violinData.seriesViolinPoints[s])?void 0:u[m])?void 0:g.length)?p:0)),r.length&&a.push(r.join(i))}}}};r.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===n.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===n.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===n.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&r.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(r.push(n.config.chart.toolbar.export.csv.headerValue),a.push(r.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?w(t,e):(r=[],r.push(h(n.labelData.labels[e])),r.push(f(l[e])),a.push(r.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,n)=>{null==i||i.data.forEach(i=>{let r,a;if(x.isFormatXY())r=i.x,a=i.y;else{if(!x.isFormat2DArray())return;r=i[0],a=i[1]}s[r]||(s[r]=Array(t.length).fill("")),s[r][n]=f(a),e.add(r)})}),r.length&&a.push(r.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];a.push([h(t),...e].join(i))})})(),o+=a.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+o),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(f.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}h.default.registerFeatures({exports:y});const b=h.__apex_CoreUtils,w=h.__apex_dimensions_Dimensions,v=h.__apex_Graphics;let A=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(f.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,n;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let a=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(a=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!a)return;o=parseInt(null!=(s=a.getAttribute("data:realIndex"))?s:"",10)}else{if(a=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!a)return;o=parseInt(null!=(n=a.getAttribute("rel"))?n:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:a,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],a=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${a}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],a=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${a}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,n=s.globals,r=p.clone(s.config.series);if(n.axisCharts){const e=s.config.yaxis[n.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(n.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(t);const e=n.risingSeries.indexOf(t);n.risingSeries.splice(e,1)}}else if(n.collapsedSeriesIndices.indexOf(t)<0){const a=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:t,data:this._readSliceValue(a[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(n.seriesNames||[])[t]}),n.collapsedSeriesIndices.push(t)}const a=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===a,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),n=t.childNodes;for(let t=0;t<n.length;t++)n[t].classList.contains("apexcharts-series-markers-wrap")&&(n[t].classList.contains("apexcharts-hide")?n[t].classList.remove("apexcharts-hide"):n[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const a=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);a(),o&&"function"==typeof o.then&&o.then(a,a)}riseCollapsedSeries(t,e,i){const s=this.w;let n=p.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)n[i].data=t[r].data.slice(),n[i].hidden=!1;else{const e=this._nonAxisSliceContainer(n);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}n=this._getSeriesBasedOnCollapsedState(n),this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(t[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const _=["#cf4d3f","#8f9499","#26a75b"],S=(t,e,i)=>t+(e-t)*i;function C(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function E(t,e,i){const s=p.parseHex(k(t)),n=p.parseHex(k(e));return s&&n?"#"+C(S(s[0],n[0],i))+C(S(s[1],n[1],i))+C(S(s[2],n[2],i)):t}function k(t){if("string"!=typeof t)return"#000000";if(p.isColorHex(t))return t;return p.rgb2hex(t)||"#000000"}function M(t,e,i,s){var n,r,a;if(!e||"object"!=typeof e)return null;const o=null==(a=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function I(t){var e,i,s;const n=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const a=t.config.series||[];let o=1/0,l=-1/0,c=!1;for(let e=0;e<a.length;e++){const i=a[e]&&a[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=M(t,i[s],e,s);null!=n&&(c=!0,n<o&&(o=n),n>l&&(l=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,l=0);let h=Number.isFinite(Number(r.min))?Number(r.min):o,d=Number.isFinite(Number(r.max))?Number(r.max):l,u=null;if(null===r.midpoint?u=null:Number.isFinite(Number(r.midpoint))?u=Number(r.midpoint):h<0&&d>0&&(u=0),null!=u&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(h-u),Math.abs(d-u));h=u-t,d=u+t}d===h&&(h-=.5,d+=.5);const g=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:k(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:_).map(k),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:S(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)a.push({value:S(s,i,(e-t)/(r-1-t)),color:n[e]});return a}return n.map((t,s)=>({value:S(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(g.length<2)return null;const p=d-h,f=g.map(t=>({percent:0===p?0:(t.value-h)/p,color:t.color}));return{min:h,max:d,midpoint:u,stops:g,at:t=>{if(!Number.isFinite(t))return g[Math.floor(g.length/2)].color;if(t<=g[0].value)return g[0].color;const e=g[g.length-1];if(t>=e.value)return e.color;for(let e=1;e<g.length;e++){const i=g[e];if(t<=i.value){const s=g[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return E(s.color,i.color,r)}}return e.color},legendStops:f}}const L="http://www.w3.org/2000/svg";class P{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,n,r;const a=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return a&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[a])?void 0:r.colorScale)||null}static configFor(t){const e=P.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return P.configFor(this.w)||{}}static isEnabled(t){if(!P.supports(t))return!1;const e=P.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,n,r,a,o,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const d=this._cfg(),u=c.config.legend.position,g="left"===u||"right"===u,p=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=p+4,x=d.showLabels?28:4,y=d.showLabels?20:4,b=d.showLabels?44:0,w=this._resolveStripLength(g?d.height:d.width,g),v=d.thickness,A=g?Math.max(v+f+4,b):w+2*x,_=g?w+2*y:v+f+4,S=(A-(v+f))/2,C=g?"left"===u?S:S+f:x,E=g?y:"top"===u?f:4,k=m.createElementNS(L,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(A)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const M=m.createElementNS(L,"defs"),I=`apexcharts-heatmap-gradient-${c.globals.cuid}`,P=m.createElementNS(L,"linearGradient");P.setAttribute("id",I),g?(P.setAttribute("x1","0"),P.setAttribute("y1","1"),P.setAttribute("x2","0"),P.setAttribute("y2","0")):(P.setAttribute("x1","0"),P.setAttribute("y1","0"),P.setAttribute("x2","1"),P.setAttribute("y2","0"));const{min:D,max:F,stops:X,bands:R}=this._computeStops();this._min=D,this._max=F,X.forEach(t=>{const e=m.createElementNS(L,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),P.appendChild(e)}),M.appendChild(P),k.appendChild(M);const T=m.createElementNS(L,"rect");if(T.setAttribute("x",String(C)),T.setAttribute("y",String(E)),T.setAttribute("width",String(g?v:w)),T.setAttribute("height",String(g?w:v)),T.setAttribute("rx","2"),T.setAttribute("fill",`url(#${I})`),k.appendChild(T),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,e=(null==(n=d.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,a=this._getFormatter(),o=(s,n,r,a)=>{const o=m.createElementNS(L,"text");return o.setAttribute("x",String(n)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",a),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(g){const t=C+v/2;k.appendChild(o(a(D),t,E+w+10,"middle")),k.appendChild(o(a(F),t,E-10,"middle"))}else{const t=E+v/2;k.appendChild(o(a(D),C-6,t,"end")),k.appendChild(o(a(F),C+w+6,t,"start"))}}const $=(null==(a=d.arrow)?void 0:a.color)||c.config.chart.foreColor,B=this._buildArrow(p,$,u);if(k.appendChild(B),this.arrowEl=B,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&R.length>0&&R.forEach(t=>{const e=m.createElementNS(L,"rect");if(g){const i=E+w-t.p2*w,s=E+w-t.p1*w;e.setAttribute("x",String(C)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(C+t.p1*w)),e.setAttribute("y",String(E)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*w))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:u,stripX:C,stripY:E,stripLength:w,stripThickness:v,arrowSize:p,svgWidth:A,svgHeight:_},d.showHoverValue){const t=m.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily||"",t.style.color=c.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}h.classList.add("apexcharts-heatmap-gradient-legend-wrap"),h.classList.add("apx-legend-position-"+u),h.appendChild(k),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=k,t?(h.style.width=A+"px",h.style.height=_+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,g,A,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,n){const r=this.w,a=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,h=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=n+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-n-24;let r;r="start"===a?o:"end"===a?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+h+"px":l-s-o+h+"px"}else{const i=l-s-24;let r;r="start"===a?o:"end"===a?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?o+d+"px":c-n-o+d+"px"}}repositionToPlot(){var t,e;if(!f.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:a,svgWidth:o,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,p=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,y=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,b=i.layout.xAxisHeight||0,w=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){n.style.top=s.translateY+w(s.gridHeight,l)+p+"px";const t=(("left"===a?0:s.translateX+s.gridWidth)+("left"===a?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+g+"px"}else{n.style.left=s.translateX+w(s.gridWidth,o)+g+"px";const t=(("top"===a?y:s.translateY+s.gridHeight+b)+("top"===a?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+p+"px"}m.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect"),s=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&i&&s&&this._geom))return;const n=i.getBoundingClientRect(),r=s.getBoundingClientRect();if(!(n.width&&n.height&&r.width&&r.height))return;const{isVertical:a,position:o}=this._geom;if(a){const t="left"===o?r.left-n.right:n.left-r.right;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===o?-s:s)+"px"}}else{const t="top"===o?r.top-n.bottom:n.top-r.bottom;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===o?-s:s)+"px"}}}destroy(){var t,e,i,s,n,r,a;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(a=(r=this.ctx.events).removeEventListener)||a.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(f.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,n;const r=this.w,a=t.currentTarget,o=parseInt(null!=(e=a.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,o,r]),new g(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new g(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;f.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const n=this.w;if(!this.arrowEl)return;const r=t[t.length-1];if(!r||"object"!=typeof r)return;const a=r.seriesIndex,o=r.dataPointIndex;if("number"!=typeof a||"number"!=typeof o)return;if(!P.supports(n))return;let l;l=this._continuous?function(t,e,i){const s=t.config.series[e];return M(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(n,a,o):null==(s=null==(i=null==(e=n.seriesData)?void 0:e.series)?void 0:i[a])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:n,stripLength:r,stripThickness:a,arrowSize:o}=this._geom,l=this._min,c=this._max-l;let h;if(h=0===c?.5:(t-l)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,l;"left"===i?(e=s+a,l=e+o):(e=s,l=e-o);const c=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,l;"top"===i?(e=n+a,l=e+o):(e=n,l=e-o);const c=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+a+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+a+o+8}px`:n-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=m.createElementNS(L,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=P.colorScaleOf(i)||{},n=this._cfg(),r=I(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let a=1/0,c=-1/0;const h=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<h.length;t++){const e=h[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<a&&(a=i),i>c&&(c=i))}}Number.isFinite(a)||(a=0),Number.isFinite(c)||(c=0);let d=a,u=c;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<a?s.min:a),void 0!==s.max&&(u=s.max>c?s.max:c));const g=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;g.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new p,r=i.config.plotOptions[i.config.chart.type]||{},a=null!=(e=r.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,n.stops||16);for(let e=0;e<l;e++){const n=e/(l-1),c=d+n*(u-d),h=Math.abs(u)+Math.abs(d),p=0===h?0:100*c/h;let f;f=o?r.reverseNegativeShade?p<0?p/100*(1.25*a):1.25*a*(1-p/100):p<=0?1-(1+p/100)*a:(1-p/100)*a:1-p/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;g.push({percent:n,color:m})}}return{min:d,max:u,stops:g,bands:f}}}const D=h.__apex_Markers;h.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new A(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||P.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),P.isEnabled(t)?(this.heatmapGradientLegend=new P(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=m.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[t]);const a=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),h=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(a+d)+"px",u.width=2*(a+d)+"px",u.left=c+"px",u.top=h+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const n=new D(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:a}),c=(f.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),h=new v(this.w).drawMarker(0,0,l(o({},n),{pointFillColor:Array.isArray(e)?e[t]:n.pointFillColor,shape:r}));i.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(t=>{t.node.classList.contains("apexcharts-marker-triangle")?t.node.style.transform="translate(50%, 45%)":t.node.style.transform="translate(50%, 50%)"}),c.add(h)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,a=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),a=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{c[e]=m.createElement("div"),c[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:a});v.setAttrs(u,{rel:e+1,"data:collapsed":h||d}),(h||d)&&u.classList.add("apexcharts-inactive-legend");const g=m.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){g.setAttribute("role","button"),g.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||d,i=e?"hidden":"visible";g.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),g.setAttribute("aria-pressed",e?"true":"false")}const f=m.createElement("span");f.classList.add("apexcharts-legend-text"),f.innerHTML=Array.isArray(l)?l.join(" "):l;let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),f.style.color=x,f.style.fontSize=i.config.legend.fontSize,f.style.fontWeight=i.config.legend.fontWeight,f.style.fontFamily=n||i.config.chart.fontFamily,v.setAttrs(f,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),g.appendChild(u),g.appendChild(f);const y=new b(this.w);if(!i.config.legend.showForZeroSeries){0===y.getSeriesTotalByIndex(e)&&y.seriesHaveSameValues(e)&&!y.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||y.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-null-series"),c.length?i.labelData.seriesGroups.forEach((t,n)=>{var r,a;t.includes(null!=(a=null==(r=i.config.series[e])?void 0:r.name)?a:"")&&(s.appendChild(c[n]),c[n].appendChild(g))}):s.appendChild(g),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),g.classList.add("apexcharts-legend-series"),g.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",v.setAttrs(g,{rel:e+1,seriesName:p.escapeString(r[e]),"data:collapsed":h||d}),(h||d)&&g.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||g.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let r=0,a=0;if("bottom"===i.config.legend.position)a=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new w(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;a=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,a=a+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=a+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new w(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===t.config.legend.position&&(n=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,n=s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker");if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new g(this.ctx.w);"mousemove"===t.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&n.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&n){new g(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if((s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const n=s.getAttribute("rel");e.onLegendClick(t),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);t&&t.focus()})}}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&(s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const a=this.w.config.legend.markers.onClick;"function"==typeof a&&s.classList.contains("apexcharts-legend-marker")&&(a(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,n)}}}});class F{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){var t,e;const i=this.w,s=()=>m.createElementNS("http://www.w3.org/1999/xhtml","div"),n=()=>{const t=m.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},r=s();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=i.config.chart.toolbar.offsetY+"px",r.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(r),this.elZoom=n(),this.elZoomIn=n(),this.elZoomOut=n(),this.elPan=n(),this.elSelection=n(),this.elMeasure=n(),this.elZoomReset=n(),this.elMenuIcon=n(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(n());const a=[],o=(t,e,s)=>{const n=t.toLowerCase();this.t[n]&&i.config.chart.zoom.enabled&&a.push({el:e,icon:"string"==typeof this.t[n]?this.t[n]:s,title:this.localeValues[t],class:`apexcharts-${n}-icon`})};o("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),o("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const l=t=>{this.t[t]&&i.config.chart[t].enabled&&a.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};l("zoom"),l("selection"),this.t.pan&&i.config.chart.zoom.enabled&&a.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&i.config.chart.measure&&i.config.chart.measure.enabled&&a.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),o("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&a.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)a.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});a.forEach((t,e)=>{t.index&&p.moveIndexInArray(a,e,t.index)});for(let t=0;t<a.length;t++)v.setAttrs(a[t].el,{class:a[t].class,title:a[t].title,"aria-label":a[t].title}),a[t].el.innerHTML=a[t].icon,r.appendChild(a[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(r),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),v.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(m.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,v.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,r,a,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.globals[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;n||(e.w.globals[s]=!0,r.classList.add(i.selectedClass)),r.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,r=!n.interact.measureEnabled;this.toggleOtherControls(),r&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,n=(e+s)/2,r=(i+s)/2,a=this._getNewMinXMaxX(n,r);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),r=i-(s-i),a=this._getNewMinXMaxX(n,r);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const a=p.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new y(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(p.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class X{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/X.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*X.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),r=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(r||1)-t.layout.translateX}}const R=h.__apex_index_Box;h.default.registerFeatures({toolbar:F,zoomPanSelection:class extends F{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new v(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new R(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:n,max:r}=this._currentXWindow(),a=r-n,o=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let l=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));l<i&&(l=i),l>c.max-c.min&&(l=c.max-c.min)}let h=n+o*a-o*l,d=h+l;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-r)<u)return;if(isNaN(h)||isNaN(d))return;const g=this.getBeforeZoomRange({min:h,max:d},void 0);g&&g.xaxis&&(h=g.xaxis.min,d=g.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=X.dataXToPx(t,t.config.chart.selection.xaxis.min),s=X.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:r=0}){const a=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+r+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),v.setAttrs(o.node,c)),a.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),v.setAttrs(l.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),r=n(i),a=n(i+s);r===i&&a===i+s||(t.attr({x:r,width:a-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,n=this._gridRect();if(!n)return;const r=s.startX-1,a=s.startY;let c=!1,h=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-n.top;let g=d-r,p=u-a,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(g+r)>i.layout.gridWidth?g=i.layout.gridWidth-r:d<0&&(g=r),r>d&&(c=!0,g=Math.abs(g)),a>u&&(h=!0,p=Math.abs(p)),f="x"===e?{x:c?r-g:r,y:0,width:g,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?a-p:a,width:i.layout.gridWidth,height:p}:{x:c?r-g:r,y:h?a-p:a,width:g,height:p},f=l(o({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(f),s.selectionDragging("resizing"),f}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:r}=e.detail,a=this.constraints;let{x:o,y:l}=r;o<a.x&&(o=a.x),l<a.y&&(l=a.y),r.x2>a.x2&&(o=a.x2-r.w),r.y2>a.y2&&(l=a.y2-r.h),n.move(o,l);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const g=s.config.chart.link,p=!(!g||!g.enabled&&"function"!=typeof g.dimension);("function"==typeof s.config.chart.events.selection||p)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const n=this._gridRect();if(!n)return;const r=this.selectionRect.node.getBoundingClientRect(),a=this.xyRatios;let o,l,c,h;const d=this._screenXToPlotPx(r.left),u=this._screenXToPlotPx(r.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+d*a.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+u*a.invertedYRatio,c=0,h=1;else{if(!e.globals.xAxisScale)return;o=X.pxToDataX(e,d),l=X.pxToDataX(e,u),c=e.globals.yAxisScale[0].niceMin+(n.bottom-r.bottom)*a.yRatio[0],h=e.globals.yAxisScale[0].niceMax-(r.top-n.top)*a.yRatio[0]}const g={xaxis:{min:o,max:l},yaxis:{min:c,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,g),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,g),null==(t=this.ctx.linkedViews)||t.onSourceSelection(g.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,r=this.xyRatios,a=this.ctx.toolbar,o=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect(),l=n._gridRect();if(!l)return;const c=this._screenXToPlotPx(o.left),h=this._screenXToPlotPx(o.right),d=o.top-l.top,u=o.bottom-l.top;let g,f;s.axisFlags.isRangeBar?(g=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio,f=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio):(g=X.pxToDataX(s,c),f=X.pxToDataX(s,h));const m=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d,a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*u;m.push(n),x.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&g!==f)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=p.clone(s.globals.initialConfig.yaxis),i=p.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),f=Math.floor(f),g<1&&(g=1,f=s.globals.dataPoints),f-g<2&&(f=g+1)),"xy"!==e&&"x"!==e||(i={min:g,max:f}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=m[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t),n.ctx.updateHelpers._updateOptions(r,!1,n.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:g,max:f},"xy"===e||"y"===e){const e=p.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=m[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:r,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,r)}panScrolled(t,e){var i,s;const n=this.w,r=this.xyRatios;if(!n.globals.initialConfig)return;const a=p.clone(n.globals.initialConfig.yaxis);let o=r.xRatio,l=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=l+n.layout.gridWidth/15*o,e=c+n.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-n.layout.gridWidth/15*o,e=c-n.layout.gridWidth/15*o),!n.axisFlags.isRangeBar){const r=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<r||e>a)&&(t=l,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return X.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),r=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=p.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),r=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,ratio0:(n.max-n.min)/r},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],n=t.touches[1],r=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=(s.clientX+n.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:o,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:a,minX0:o,maxX0:l,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const n=t.touches[0],r=t.touches[1],a=Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)||1,o=(n.clientX+r.clientX)/2-s.left-e.globals.barPadForNumericAxis,l=i.maxX0-i.minX0,c=l*(i.d0/a);let h=i.minX0+i.cx0/i.gridWidth*l-o/i.gridWidth*c,d=h+c;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-h<i){const t=(h+d)/2;h=t-i/2,d=t+i/2}}this._applyXRange(h,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(n<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,a=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-a;if(a=t,r*=Math.pow(n,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),c=e.layout.gridWidth||1,h=(l.max-l.min)/c,d=r*s*h,u=this._applyXRange(l.min-d,l.max-d,!1),g=this._clampBounds();if(!u||g&&(d>0&&u.minX<=g.min+1e-6*(g.max-g.min)||d<0&&u.maxX>=g.max-1e-6*(g.max-g.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});const T=h.__apex_Animations_prefersReducedMotion,$=h.__apex_Animations_applyProgressiveReveal;class B{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const n=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,a=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==a){const e=a.getBBox();a.setAttribute("x",String(parseFloat(null!=(i=a.getAttribute("x"))?i:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;a.setAttribute("y",String(parseFloat(null!=(s=a.getAttribute("y"))?s:"0")+n));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(a);a.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const n=s.getBoundingClientRect(),r=s.getBBox(),a=n.width/r.width||1,o=t.getBoundingClientRect();let{left:l,right:c,top:h,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([h,d,l,c]=[l,c,h,d]);const u=n.left-r.x*a,g=n.top-r.y*a,p=(o.left-u)/a-l,f=(o.top-g)/a-h,m=this.annoCtx.graphics.drawRect(p,f,o.width/a+l+c,o.height/a+h+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&m.node.classList.add(e.id),m}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(n){const i=n.parentNode,s=this.addBackgroundToAnno(n,e);if(s){null==i||i.insertBefore(s.node,n);const r=n.getAttribute("x");null!==r&&$(s,parseFloat(r),t),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?p.isNumber(t.globals.minY)&&p.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:p.isNumber(t.globals.minX)&&p.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,n;const r=this.w,a="y1"===t?e.y:e.y2,o="string"==typeof a&&a.includes("px");let l,c=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(a);if(!o&&-1===s)return{yP:0,clipped:!0};const n=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=n?parseFloat(null!=(i=n.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l-=r.globals.barHeight/2*(r.seriesData.series.length-1)-r.globals.barHeight*e.seriesIndex)}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],h=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new b(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,a,i)/r.globals.yLogRatio[i]:(a-o)/(h/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),c=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(n=r.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(l=d)}return o&&(l=parseFloat(a)),{yP:l,clipped:c}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,a=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),c=null==s&&e.marker;if(!l&&!c&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(r-s)/(a/i.layout.gridWidth):(s-n)/(a/i.layout.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.axisFlags.dataFormatXNumeric||i.config.chart.sparkline.enabled||(h=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(h=parseFloat(s)),null==s&&e.marker&&(h=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=i.globals.barWidth/2*(i.seriesData.series.length-1)-i.globals.barWidth*e.seriesIndex),"number"!=typeof h&&(h=0,o=!0),parseFloat(h.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(h=i.layout.gridWidth,o=!0):h<0&&(h=0,o=!0),{x:h,clipped:o}}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return r&&(s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),s}}class N{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new B(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,n=this.helpers.getX1X2("x1",t);let r=n.x;const a=n.clipped;let o,l=!0;const c=t.label.text,h=t.strokeDashArray;if(p.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!a){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),$(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const n=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);n.node.classList.add("apexcharts-annotation-rect"),n.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(n.node),t.id&&n.node.classList.add(t.id),$(n,r+t.offsetX,s)}if(!a||!l){const n=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),a="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?n.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:a+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?n.width/2-12:-n.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),$(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class z{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,n=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),a=r.yP;const o=r.clipped;let l,c=!0,h=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){h=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,a+t.offsetY,this._getYAxisAnnotationWidth(t),a+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,c=r.clipped,l>a){const t=a;a=l,l=t}if(!o||!c){h=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),a-l,0,t.fillColor,t.opacity,1,t.borderColor,n);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:a)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class W{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),r=n.x,a=n.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,c=o.clipped;if(p.isNumber(r)&&!c&&!a){const n={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let a=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,n);e.appendChild(a.node);const o=[a.node];$(a,r,s);const c=t.label.text?t.label.text:"",h=this.getConstrainedLabelX(c,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:h,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),$(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;a=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(a.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&a.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&a.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&a.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,a;switch(i.textAnchor){case"start":r=e,a=e+n;break;case"end":r=e-n,a=e;break;default:r=e-n/2,a=e+n/2}const o=i.style.padding||{};return r-=o.left||0,a+=o.right||0,r<0?e-r:a>s.layout.gridWidth?e-(a-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const n=this.getPointTooltipEl();n.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${r}`),n.classList.add("apexcharts-active");const a=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=n.getBoundingClientRect(),c=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let d=o.left-a.left+o.width/2-l.width/2,u=o.top-a.top-l.height-10;d=Math.max(0,Math.min(d,a.width-l.width)),u<0&&(u=o.top-a.top+o.height+10),n.style.left=d+c+"px",n.style.top=u+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}const Y=h.__apex_Options;h.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new v(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new B(this),this.xAxisAnnotations=new N(this),this.yAxisAnnotations=new z(this),this.pointsAnnotations=new W(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,r=[e,i,s],a=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!n||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&a[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:a[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:n,foreColor:r,fontSize:a,fontFamily:o,fontWeight:l,cssClass:c,backgroundColor:h,borderWidth:d,strokeDashArray:u,borderRadius:g,borderColor:p,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:y=2,paddingTop:b=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:i,text:s,textAnchor:n||"start",fontSize:a||"12px",fontWeight:l||"regular",fontFamily:o||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:c}),A=w.dom.baseEl.querySelector(f);A&&A.appendChild(v.node);const _=v.bbox();if(s){const t=this.graphics.drawRect(_.x-m,_.y-b,_.width+m+x,_.height+y+b,g,h||"transparent",1,d,p,u);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:n=0,width:r=20,height:a=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,a).move(s,n);const c=e.dom.baseEl.querySelector(o);return c&&c.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:n}){const r=i,a=r.w,o=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),l=o.childNodes.length+1,c=new Y,h=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),d=p.extend(h,t);switch(s){case"xaxis":this.addXaxisAnnotation(d,o,l);break;case"yaxis":this.addYaxisAnnotation(d,o,l);break;case"point":this.addPointAnnotation(d,o,l)}const u=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${l}']`),g=this.helpers.addBackgroundToAnno(u,d);return g&&o.insertBefore(g.node,u),e&&a.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:p.randomId(),method:n,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec.map((t,s)=>{t.id===e&&i.globals.memory.methodsToExec.splice(s,1)}),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}handleKey(t){}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),n=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(n)||s===n)return;const r=.1*(n-s)*t;i.zoomUpdateOptions(s+r,n+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const n=this._getSeriesCount();let r=this.seriesIndex+t,a=0;for(;a<n&&(r<0&&(r=s?n-1:0),r>=n&&(r=s?0:n-1),i.globals.collapsedSeriesIndices.includes(r));)r+=t,a++;this.seriesIndex=r;const o=this._getDataPointCount(r);this.dataPointIndex>=o&&(this.dataPointIndex=o-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,n++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,n++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip();if(!r)return;const a=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:a.ttWidth||0,ttHeight:a.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===n||"donut"===n||"polarArea"===n?this._showTooltipNonAxis(t,e,i,r):"radialBar"===n?this._showTooltipRadialBar(t,e,i,r):"heatmap"===n||"treemap"===n?this._showTooltipHeatTree(t,e,i,r,n):"bar"===n||"candlestick"===n||"boxPlot"===n||"violin"===n||"rangeBar"===n?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,n=s.config.chart.type;let r=0,a=0;const o=this._getFocusableElement(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,a=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(n[0]||0),a=t.top+(n[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,a=e.top+e.height/2}}if(("line"===n||"area"===n||"rangeArea"===n||"scatter"===n||"bubble"===n||"radar"===n)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(n[0]||0),a=t.top+(n[1]||0)}}i.e={type:"mousemove",clientX:r,clientY:a}}_showTooltipBar(t,e,i){var s,n,r,a;const c=this.w,h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(a=null==(r=null==(n=null==(s=c.rangeData.seriesRange)?void 0:s[t])?void 0:n[e])?void 0:r.y)?void 0:a[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:h}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,g=c.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(g){this._leaveHoveredBar();new v(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const t=g&&g.node;if(t){const e=c.dom.elWrap.getBoundingClientRect(),s=t.getBoundingClientRect(),n=s.left-e.left,r=s.top-e.top,a=s.height,o=s.width,l=i.tooltipRect.ttWidth||0,h=r+a/2-(i.tooltipRect.ttHeight||0)/2;let d=n+o;n<(i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?i.xyRatios.baseLineInvertedY:e.width/2)&&(d=n-l);const u=i.getElTooltip();u&&(u.style.left=d+"px",u.style.top=h+"px")}}else i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,n=s.config.chart.type,r=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:r});const a="scatter"===n||"bubble"===n,o=s.globals.markers.largestSize>0&&!s.globals.markers.batched;a?this._showScatterBubblePoint(t,e,i):o?r?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):r?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const n=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!n)return;const r=n.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,i,s){const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=s.getBoundingClientRect(),a=r.width||i.tooltipRect.ttWidth||0,o=r.height||i.tooltipRect.ttHeight||0,l=n.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);c&&(s.style.left=c.x-a/2+"px",s.style.top=c.y-o-10+"px")}_showTooltipRadialBar(t,e,i,s){var n;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:a=0,ttHeight:o=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(n=l.getAttribute("data:angle"))?n:"")||0,i=(r.config.plotOptions.radialBar.startAngle||0)+e/2,c=r.layout.gridWidth/2,h=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,u=r.seriesData.series.length,g=d/Math.max(u,1),f=d-t*g,m=(f+(f-g))/2,x=p.polarToCartesian(c,h,m,i),y=x.x+(r.layout.translateX||0),b=x.y+(r.layout.translateY||0);s.style.left=y-a/2+"px",s.style.top=b-o-10+"px"}}_showTooltipHeatTree(t,e,i,s,n){var r,a;const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===n?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=o.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),n=e.left-t.left,l=e.top-t.top,d=e.width,g=e.height,p=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),f=parseFloat(null!=(a=u.getAttribute("width"))?a:"");i.tooltipPosition.moveXCrosshairs(p+f/2);let m=n+d+c/2;const x=l+g/2-h/2;n+d>o.layout.gridWidth/2&&(m=n-c/2),s.style.left=m+"px",s.style.top=x+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,n,r,a,o,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],g=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",n=Array.isArray(g)?g[e]:"";return t?`${t}: ${n}`:`${n}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(g)?g[t]:""}`}const p=u[t]||`Series ${t+1}`,f=(Array.isArray(g[t])?g[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(n=h.formatters)?void 0:n.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let y="";const b=null==(a=h.labelData)?void 0:a.categoryLabels,w=null==(l=null==(o=h.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])y=String(b[e]);else if(Array.isArray(w)&&null!=w[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{y=String(i(w[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){y=String(w[e])}else y=String(w[e])}return y?`${p}: ${m}, ${y}`:`${p}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new v(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,n=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return n.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return n.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const n=e.minX,r=e.maxX;if(void 0===n||void 0===r)return;const a=s[this.dataPointIndex];if(a>=n&&a<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=n&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,n=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!n||!n.length)return;const r=i.minX,a=i.maxX;if(void 0===r||void 0===a)return;const o=n.length;if(t>=0){for(let t=0;t<o;t++)if(n[t]>=r&&n[t]<=a)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(n[t]>=r&&n[t]<=a)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const n=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!n)return!0;const r=n[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}});const O=h.__apex_PathMorphing_parsePath;function H(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,n=i?t.height:t.width,r=n>0?s/n:e;let a=Math.max(1,Math.ceil(Math.sqrt(r*e)));a>e&&(a=e);const l=Math.floor(e/a);let c=e-l*a;const h=[],d=s/a;let u=0;for(let e=0;e<a;e++){const e=l+(c>0?1:0);c>0&&c--;const s=e>0?n/e:0;for(let n=0;n<e;n++)h.push(i?{x:t.x+u,y:t.y+n*s,width:d,height:s}:{x:t.x+n*s,y:t.y+u,width:s,height:d});u+=d}return h}function j(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,n=s?t.width:t.height,r=s?t.height:t.width,a=s?t.y:t.x,o=a+r,l=r>0?n/r:e;let c=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(n/16));c>=1||(c=1),c>e&&(c=e);const h=Math.floor(e/c);let d=e-h*c;const u=[],g=n/c;let p=s?t.x:t.y;for(let t=0;t<c;t++){const t=h+(d>0?1:0);d>0&&d--;const e=[],n=i(p,p+g,s);if(Array.isArray(n))for(let t=0;t<n.length;t++){const i=n[t];if(!i)continue;const s=Math.max(a,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([a,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),c=l.map(t=>Math.floor(t));let f=c.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)c[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=c[t];if(i<=0)continue;const n=e[t][0],r=(e[t][1]-n)/i;for(let t=0;t<i;t++)u.push(s?{x:p,y:n+t*r,width:g,height:r}:{x:n+t*r,y:p,width:r,height:g})}p+=g}return u}function q(t,e,i,s,n,r){let a=n===i?0:Math.round((t-i)/(n-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(a&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(a=t-1-a,o=t-1-o);const i=a;a=o,o=i}}return l}function V(t,e){let i=1/0,s=1/0,n=-1/0,r=-1/0;const a=t.map(t=>{const[a,o]=e(t);return a<i&&(i=a),a>n&&(n=a),o<s&&(s=o),o>r&&(r=o),[a,o]});return t.map((t,e)=>({item:t,d:q(a[e][0],a[e][1],i,s,n,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function Z(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function U(t,e){const i=Z(t),s=Z(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),n=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),a=i[3]+(s[3]-i[3])*t;return a>=1?`rgb(${e},${n},${r})`:`rgba(${e},${n},${r},${a})`}:null}function G(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}const K=new Set(["bar","funnel","pyramid","histogram"]),Q=new Set(["pie","donut","polarArea","radialBar","gauge"]),J=new Set(["unit","waffle"]),tt=new Set(["treemap","sunburst"]),et=new Set(["boxPlot","violin"]),it=1500;function st(t){return K.has(t)?"bar":Q.has(t)?"radial":J.has(t)?"unit":tt.has(t)?"partition":et.has(t)?"summary":null}h.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null}canMorphTypes(t,e){if(t===e)return!1;const i=st(t),s=st(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=st(t),n=st(e);return"unit"===n?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===n||("radial"===n?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===n||"summary"===n?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==n)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){if(this._snapshot=null,this._removeGhost(),this._cancelPieces(),!f.isBrowser())return!1;const s=this.w.config.chart.animations;if(!s||!1===s.enabled)return!1;if(s.chartTypeMorph&&!1===s.chartTypeMorph.enabled)return!1;if(s.respectReducedMotion&&T())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:n,branches:r,unitDots:a}=this._captureFromDOM(t);if(!n.length)return!1;const o=this._buildMapping(n,t,e,i,r);if(0===o.size)return!1;this._snapshot={fromType:t,toType:e,mapping:o,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}};const l=st(t),c=st(e),h=this._canProbePaths();if("unit"===c&&("bar"===l||"summary"===l||"radial"===l&&h)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=it}else if("unit"===l&&("bar"===c||"summary"===c||"radial"===c&&h)){let t=0;if(a.forEach(e=>{t+=e.length}),t>0&&t<=it){this._snapshot.pieceIn=!0,this._snapshot.sourceDots=a;const t=[];"radial"===c?(Array.isArray(i)?i:[]).forEach((e,i)=>{t.push(`${i}:0`)}):(Array.isArray(i)?i:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push(`${i}:${e}`)}),this._snapshot.keyOrder=t}}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===st(t)||"unit"===st(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const n=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];"function"==typeof n.querySelectorAll&&r.forEach(t=>{n.querySelectorAll(t).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}),"function"==typeof n.querySelectorAll&&n.querySelectorAll("[id]").forEach(t=>{t.removeAttribute("id")}),null==(e=n.removeAttribute)||e.call(n,"id"),this._ghost=n}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!f.isBrowser())return;const n=null==(t=this.w.dom)?void 0:t.elWrap;if(!n||"function"!=typeof n.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),n.appendChild(s);const a=this.getSpeed(),o=Math.max(120,Math.round(.55*a));m.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){const t=this._ghost;this._ghost=null,t&&t.parentNode&&t.parentNode.removeChild(t)}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const n=m.createElementNS("http://www.w3.org/2000/svg","g");if(!n)return null;n.setAttribute("class","apexcharts-morph-pieces"),n.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&n.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(n),this._pieceLayer=n,n}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")})}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,t&&t.parentNode&&t.parentNode.removeChild(t),this._revealPieceHidden()}_canProbePaths(){if(!f.isBrowser())return!1;const t=m.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const n=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!n||"function"!=typeof n.createSVGPoint)return i.removeChild(s),null;const r=n.createSVGPoint(),a=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const n=s?e.y:e.x,r=n+(s?e.height:e.width);if(!(r>n))return null;const l=(t,e)=>s?a(e,t):a(t,e),c=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],h=(t,e,i)=>{let s=e,n=t;for(let t=0;t<6;t++){const t=(s+n)/2;l(t,i)?n=t:s=t}return(s+n)/2},d=(r-n)/o,u=new Array(49).fill(null);let g=!1;for(const t of c)for(let e=0;e<=o;e++)null===u[e]&&l(n+e*d,t)&&(u[e]=t,g=!0);if(!g)return null;const p=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?n:h(n+f*d,n+(f-1)*d,i),a=e===o?r:h(n+e*d,n+(e+1)*d,u[e]);a>s&&p.push([s,a]),f=-1}}return p.length?p:null},dispose:()=>{s.parentNode&&s.parentNode.removeChild(s)}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=new Map;let n=0;if(i.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var e,i,r,a,o,l,c;const h=parseInt(null!=(e=t.getAttribute("i"))?e:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(i=t.getAttribute("cy"))?i:""),p=parseFloat(null!=(r=t.getAttribute("r"))?r:"3")||3;else{const e=parseFloat(null!=(a=t.getAttribute("width"))?a:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=s.get(h);f||(f=[],s.set(h,f)),f.push({el:t,x:u,y:g,r:p,fill:t.getAttribute("fill")}),n++}),0===n||n>it)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const a=[],o=r.ownerDocument,l=st(e.fromType),c="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const n=s.get(t),l=this.getInitialBBoxFor(t),h=e.mapping.get(`${t}:0`);if(!l||!h)return void n.forEach(t=>{t.el.removeAttribute("opacity"),t.el.removeAttribute("data-piece-hidden")});const d=h.fill&&0!==h.fill.indexOf("url(")?h.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||n[0].fill;let u=null;if(c){const e=this.getInitialPathFor(t,0);e&&(u=this._makeExtentProber(e,l,r))}const g=u?j(l,n.length,u.intervalsAt):H(l,n.length);u&&u.dispose();const p=V(g,t=>[t.x+t.width/2,t.y+t.height/2]),f=V(n,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=p[e],s=f[e],n=o.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("data-i",String(t)),n.setAttribute("x",String(i.x)),n.setAttribute("y",String(i.y)),n.setAttribute("width",String(i.width)),n.setAttribute("height",String(i.height)),n.setAttribute("rx","0"),n.setAttribute("fill",String(d)),r.appendChild(n),a.push({el:n,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:U(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!a.length)return this._cancelPieces();this._runPieces(a,t=>{const e=t.meta.dotEl;e.removeAttribute("opacity"),e.removeAttribute("data-piece-hidden"),t.el.parentNode&&t.el.parentNode.removeChild(t.el)})}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const n=this._collectTargetMarks(i.toType);if(!n.size)return this._revealPieceHidden();const r=i.oldLayout.translateX-(this.w.layout.translateX||0),a=i.oldLayout.translateY-(this.w.layout.translateY||0),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const c=l.ownerDocument,h=[],d=st(i.toType),u="summary"===d||"radial"===d;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),d=i.keyOrder[t],g=d?n.get(d):null;if(!g||!s||!s.length){g&&g.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")});continue}const p=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill;let f=null;if(u){const t=g.d||g.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ");t&&(f=this._makeExtentProber(t,g.bbox,l))}const m=f?j(g.bbox,s.length,f.intervalsAt):H(g.bbox,s.length);f&&f.dispose();const x=V(m,t=>[t.x+t.width/2,t.y+t.height/2]),y=V(s,t=>[t.x,t.y]),b={remaining:y.length,els:g.els,tiles:[]};for(let t=0;t<y.length;t++){const e=y[t],i=x[t],s=c.createElementNS("http://www.w3.org/2000/svg","rect"),n=e.x+r-e.r,o=e.y+a-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(n)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||p)),l.appendChild(s),b.tiles.push(s),h.push({el:s,from:{x:n,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:U(e.fill,p),fillEnd:String(p),delay:0,meta:{markState:b}})}}if(!h.length)return this._cancelPieces();this._runPieces(h,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")}),e.tiles.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}))})}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),n=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s}){let n=!1;const r=Date.now(),a=Math.max(1,e),o=(t,e)=>{const i=t.from,s=t.to,n=t.el;n.setAttribute("x",String(i.x+(s.x-i.x)*e)),n.setAttribute("y",String(i.y+(s.y-i.y)*e)),n.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),n.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),n.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?n.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&n.setAttribute("fill",t.fillEnd)},l=()=>{if(n)return;const e=Date.now()-r;let c=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n._done)continue;const r=(e-n.delay)/a;if(r<1&&(c=!0),r<=0)continue;const l=Math.min(1,r);o(n,G(l)),l>=1&&(n._done=!0,i&&i(n))}c?m.requestAnimationFrame(l):s&&s()};return m.requestAnimationFrame(l),()=>{n=!0}}({pieces:t,duration:n,onPieceDone:e,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const n=st(t);if("radial"===n)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");if(!i||!i.trim())return;const n=this._pathBBox(i);n&&s.set(`${e}:0`,{realIndex:e,j:0,d:i,bbox:{x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY},fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===n?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let n=0;t.querySelectorAll("path[pathTo]").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const a=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(a)?n++:a,l=this._pathBBox(r);if(!l)return;const c=`${i}:${o}`,h=s.get(c);h?(h.els.push(t),h.bbox={x:Math.min(h.bbox.x,l.minX),y:Math.min(h.bbox.y,l.minY),width:Math.max(h.bbox.x+h.bbox.width,l.maxX)-Math.min(h.bbox.x,l.minX),height:Math.max(h.bbox.y+h.bbox.height,l.maxY)-Math.min(h.bbox.y,l.minY)}):s.set(c,{realIndex:i,j:o,bbox:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY},fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],n=[],r=new Map,a=st(t);if("bar"===a){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const n=t.getAttribute("pathTo")||t.getAttribute("d");n&&s.push({realIndex:i,j:e,d:n,fill:t.getAttribute("fill")})})})}else if("summary"===a){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const n=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(n))return;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const a="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==a?void 0:a.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${n}`,c=e.get(l);c?c.d+=` ${r}`:e.set(l,{realIndex:o,j:n,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===a)if("treemap"===t){const t=t=>{var e,i,s,n;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),a=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(n=t.getAttribute("height"))?n:"");return[r,a,o,l].every(t=>isFinite(t))?`M ${r} ${a} L ${r+o} ${a} L ${r+o} ${a+l} L ${r} ${a+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,n;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(n=e.getAttribute("j"))?n:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&n.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&n.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===a){const t=i.querySelectorAll(".apexcharts-unit-area"),e=new Map;t.forEach(t=>{var i,s,n,a,o,l,c;const h=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(s=t.getAttribute("cy"))?s:""),p=parseFloat(null!=(n=t.getAttribute("r"))?n:"3")||3;else{const e=parseFloat(null!=(a=t.getAttribute("width"))?a:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=r.get(h);f||(f=[],r.set(h,f)),f.push({x:u,y:g,r:p,fill:t.getAttribute("fill")});const m=e.get(h);m?(u<m.minX&&(m.minX=u),u>m.maxX&&(m.maxX=u),g<m.minY&&(m.minY=g),g>m.maxY&&(m.maxY=g)):e.set(h,{minX:u,minY:g,maxX:u,maxY:g,fill:t.getAttribute("fill")})}),Array.from(e.keys()).sort((t,e)=>t-e).forEach(t=>{const i=e.get(t),n=i.minX-2,r=i.minY-2,a=i.maxX+2,o=i.maxY+2;s.push({realIndex:t,j:0,d:`M ${n} ${r} L ${a} ${r} L ${a} ${o} L ${n} ${o} Z`,fill:i.fill})})}else if("radial"===a)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>{var n;const r=i.parentElement,a=parseInt(null!=(n=null==r?void 0:r.getAttribute("data:realIndex"))?n:"0",10),o=i.getAttribute("d");if(!o)return;const l=parseFloat(i.getAttribute("stroke-width")||"0"),c=l>1&&this._radialArcToFilledSegment(o,l,t,e)||o;s.push({realIndex:a,j:0,d:c,fill:i.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:n,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const n=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!n)return null;const r=parseFloat(n[1]),a=parseFloat(n[2]),o=parseFloat(n[3]),l=parseInt(n[4],10),c=parseInt(n[5],10),h=parseFloat(n[6]),d=parseFloat(n[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,g=o+u,p=Math.max(0,o-u),f=(t,e,n)=>{const r=t-i,a=e-s,o=Math.sqrt(r*r+a*a);if(0===o)return{x:i,y:s};const l=n/o;return{x:i+r*l,y:s+a*l}},m=f(r,a,g),x=f(h,d,g),y=f(r,a,p),b=f(h,d,p),w=c?0:1;return`M ${m.x} ${m.y} A ${g} ${g} 0 ${l} ${c} ${x.x} ${x.y} L ${b.x} ${b.y} A ${p} ${p} 0 ${l} ${w} ${y.x} ${y.y} Z`}buildRingSegmentPath(t,e,i,s,n,r){const a=s/2,o=i+a,l=Math.max(0,i-a),c=(n-90)*Math.PI/180,h=(r-90)*Math.PI/180,d=t+o*Math.cos(c),u=e+o*Math.sin(c),g=t+o*Math.cos(h),p=e+o*Math.sin(h),f=t+l*Math.cos(c),m=e+l*Math.sin(c),x=t+l*Math.cos(h),y=e+l*Math.sin(h),b=r>n?1:0,w=Math.abs(r-n)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${w} ${b} ${g} ${p} L ${x} ${y} A ${l} ${l} 0 ${w} ${1-b} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,n){const r=new Map,a=st(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===a&&n&&n.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),n.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}if("radial"===a||"unit"===a||"partition"===a)return o.forEach((t,e)=>{r.set(`${e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===a||"summary"===a){const t=[];return(Array.isArray(s)?s:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push({realIndex:i,j:e})}),o.forEach((e,i)=>{const s=t[i];s&&r.set(`${s.realIndex}:${s.j}`,{d:e.d,fill:e.fill})}),r}return r}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===s&&0===n?i.d:this._translatePathD(i.d,s,n)}_translatePathD(t,e,i){if(0===e&&0===i)return t;return O(t).map(t=>{const s=t[0];return"Z"===s?"Z":"M"===s||"L"===s||"T"===s?`${s} ${t[1]+e} ${t[2]+i}`:"H"===s?`${s} ${t[1]+e}`:"V"===s?`${s} ${t[1]+i}`:"C"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i} ${t[5]+e} ${t[6]+i}`:"S"===s||"Q"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i}`:"A"===s?`${s} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+i}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const n=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:n,y:r};const a=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:n,y:s.y+s.height*(1-a)}:{x:s.x+s.width*a,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return{x:i.minX+s,y:i.minY+n,width:i.maxX-i.minX,height:i.maxY-i.minY}}_pathBBox(t){const e=O(t);let i=1/0,s=1/0,n=-1/0,r=-1/0,a=!1;return e.forEach(t=>{const e=t[0];if("Z"===e)return;let o=[];if("H"===e)o=[[t[1],(s+r)/2||t[1]]];else if("V"===e)o=[[(i+n)/2||t[1],t[1]]];else if("A"===e)o=[[t[6],t[7]]];else for(let e=1;e+1<t.length;e+=2)o.push([t[e],t[e+1]]);o.forEach(([t,e])=>{isFinite(t)&&isFinite(e)&&(a=!0,t<i&&(i=t),t>n&&(n=t),e<s&&(s=e),e>r&&(r=e))})}),a?{minX:i,minY:s,maxX:n,maxY:r}:null}getInitialFillFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);return i?i.fill:null}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!f.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed();[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text"].forEach(t=>{e.querySelectorAll(t).forEach(t=>{t.style&&(t.style.opacity="0",t.style.transition=`opacity ${i}ms ease-out`,m.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},i+80))})}),setTimeout(()=>this.cleanup(),i+100)}cleanup(){this._snapshot=null,this._removeGhost(),this._cancelPieces()}}});function nt(t,e,i,s){var n;const r=null==(n=null==e?void 0:e.dimensions)?void 0:n.dimHelpers,a=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const n=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!n.length)return i;const r=s.getBoundingClientRect().top,a=e.getBoundingClientRect();let o=i;for(let t=0;t<n.length;t++){const e=n[t].getBoundingClientRect();e.height&&(e.left>=a.right||e.right<=a.left||(o=Math.min(o,e.top-r)))}return o}(t,i);if(c-a>=o+1)return i.style.top=`${c-o-1+l}px`,!0;i.style.top=`${a+l}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const rt="http://www.w3.org/1999/xhtml";class at{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!f.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const s=i.querySelector(".apexcharts-breadcrumb");s&&s.parentNode&&s.parentNode.removeChild(s);const n=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!n||!1===n.show)return;if(0===this.drilldown.depth)return;const r=m.createElementNS(rt,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,n);const a=null!=n.separator?n.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=m.createElementNS(rt,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}const s=this._label(e,i);if(i===t.length-1){const t=m.createElementNS(rt,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=s,r.appendChild(t)}else{const t=m.createElementNS(rt,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=m.createElementNS(rt,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=m.createElementNS(rt,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=s,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&nt(this.w,this.ctx,r,n),this._avoidChromeOverlap(r)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const s=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),n=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!n)break;t.style.top=n.getBoundingClientRect().bottom-s+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let s;if(0===e)s=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);s=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(s,{index:e,depth:this.drilldown.depth}):s}_position(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const ot="http://www.w3.org/1999/xhtml",lt="apexcharts-drilldown-loading";class ct{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!f.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=m.createElementNS(ot,"div");i.setAttribute("class",lt),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const s=m.createElementNS(ot,"div");if(s.setAttribute("class",`${lt}-spinner`),s.setAttribute("aria-hidden","true"),i.appendChild(s),t.text){const e=m.createElementNS(ot,"span");e.setAttribute("class",`${lt}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${lt}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const ht="__apexDrilldownMarker";h.default.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new at(t,e,this),this.loading=new ct(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const s=this._resolveChild(t);return s?this._drillInto(s,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):Promise.resolve(this.ctx)}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],s=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const n=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(s),"up",{from:i,to:n})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const s=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:s,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_drillDownAsync(t,e,i){const s=this.w.config.drilldown.onDrillDown,n=this._cacheGet(t);if(n)return this._drillInto(n,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=s({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const a=()=>{this._pending=null,this.loading.hide()},c=Promise.resolve(r).then(s=>{if(a(),this._isDead())return this.ctx;if(!s||!s.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const n=null!=s.id?s:l(o({},s),{id:t});return this._cacheSet(t,n),this._drillInto(n,e,i)},e=>(a(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=c,c}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(p.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=p.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=p.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=p.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?p.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=p.clone(t.plotOptions)),e.has("fill")&&(i.fill=p.clone(t.fill)),e.has("legend")&&(i.legend=p.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,s=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!s.length)return t;const n=e.config.chart.type,r=("pie"===n||"donut"===n||"polarArea"===n)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of s){const s=e.index;i.axisCharts?t[s]&&(t[s].data=Array.isArray(e.data)?e.data.slice():e.data):r[s]&&"object"==typeof r[s]?r[s].y=e.data:void 0!==r[s]&&(r[s]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=l(o({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),a=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(a)}return r(n).then(a)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!f.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const s=e.getBoundingClientRect();let n=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(n=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),n&&"function"==typeof n.getBoundingClientRect){const t=n.getBoundingClientRect();return{x:t.left+t.width/2-s.left,y:t.top+t.height/2-s.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-s.left,y:r.top+r.height/2-s.top}}_zoomDrill(t,e,i){return s=this,n=null,r=function*(){const s=this._zoomDuration(),n="down"===e,r=Math.round(.55*s),a=n?"scale(1.03)":"scale(0.97)",o=n?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",l=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},c=this._markGroup();let h=null;if(c){l(c),h=c.animate([{transform:"scale(1)",opacity:1},{transform:a,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield h.finished}catch(t){}}yield i();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=o,h&&c===d&&h.cancel();const t=d.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:s,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(u=d).style.transform="",u.style.opacity="",u.style.transformOrigin="",u.style.transformBox="",t.cancel()}var u},new Promise((t,e)=>{var i=t=>{try{o(r.next(t))}catch(t){e(t)}},a=t=>{try{o(r.throw(t))}catch(t){e(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,a);o((r=r.apply(s,n)).next())});var s,n,r}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i)return;const s=this._pointAt(i.seriesIndex,i.dataPointIndex);return s&&"object"==typeof s&&null!=s.drilldown?this.drillDown(s.drilldown,s,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,s,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const s=i[t];return s&&Array.isArray(s.data)&&null!=s.data[e]?s.data[e]:null}_afterRender(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!f.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let s=0;i.forEach((t,i)=>{const n=t&&Array.isArray(t.data)?t.data:null;n&&n.forEach((t,n)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${n}"]`);r.length||s++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!f.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const s=t.target;if(!s||"function"!=typeof s.closest)return;if(s.closest(".apexcharts-drilldown-target"))return;if(s.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const n=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==n||null==r||n<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[n]))return;const a=this._pointAt(n,r);return a&&"object"==typeof a&&null!=a.drilldown?this.drillDown(a.drilldown,a,{seriesIndex:n,dataPointIndex:r}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,s=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[ht]):[],n=i&&i.marker||{};if(!1===n.show||!Array.isArray(t))return s;const r=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const s={seriesIndex:e,dataPointIndex:i,[ht]:!0};void 0!==n.size&&(s.size=n.size),void 0!==n.shape&&(s.shape=n.shape),void 0!==n.fillColor&&(s.fillColor=n.fillColor),void 0!==n.strokeColor&&(s.strokeColor=n.strokeColor),r.push(s)})}),s.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,s=Array.isArray(i)?i[t]:i;return!(Number(s)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});const dt="__apexcharts_plugins__";function ut(t){return function(){const t=globalThis;return t[dt]||(t[dt]={}),t[dt]}()[t]||null}const gt=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function pt(t){const e={};return gt.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}const ft=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=ut(t.name);if(!e)return;const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>3)return;const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=function(t,e){const i=t.ctx,s=t.w,n={name:e.def.name,version:3,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),n},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return n},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:pt(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null})})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),n),reserve:i=>(t._reserve(e.def.name,i),n),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}};return Object.freeze(n)}(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const n=e.handlers.get(t);if(!n||!n.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const r={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of n.slice())this._guard(e,t,()=>i(r))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const n=t.xRatio,r=t.yRatio||[],a=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,o=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,l=!e.axisFlags.isXNumeric&&!i.isBarHorizontal&&i.dataPoints>0,c=l?s.gridWidth/i.dataPoints:0;this._currentScales={x:l?t=>c*(t+.5):t=>(t-i.minX)/n,y:(t,e=0)=>(a(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:l?[-.5,i.dataPoints-.5]:[i.minX,i.maxX],domainY:(t=0)=>[o(t),a(t)],gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],n=Array.isArray(t.config.series)?t.config.series:[];return i.map((t,i)=>{const r=Array.isArray(t)?t:[t],a=s[i]||[],o=r.map((t,e)=>({x:null!=a[e]?a[e]:e,y:t})),l=n[i],c=l&&"object"==typeof l&&Array.isArray(l.data)?l.data:[];return{name:e.seriesNames?e.seriesNames[i]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(i),color:e.colors?e.colors[i]:void 0,points:o,raw:c}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],n=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:n,a=t.seriesData.series||[];let o=0;for(let t=0;t<a.length;t++){const e=a[t];Array.isArray(e)&&e.length>o&&(o=e.length)}o||(o=r.length);const l=[];for(let t=0;t<o;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_reserve(e,i){const s=t._normaliseBox(i),n=this._reserved?this._reserved.get(e):void 0;if(s){if(n&&n.left===s.left&&n.right===s.right&&n.top===s.top&&n.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!n||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;if(!t.isDestroyed){t.resized=!0,t.dataChanged=!1;try{this.ctx.update()}catch(t){}}},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w,i=(Array.isArray(e.config.series)?e.config.series:[]).filter(e=>!t.has(String(e&&e.name)));if(i.length)try{e.globals.initialSeries=i,e.globals.initialConfig&&Array.isArray(e.globals.initialConfig.series)&&(e.globals.initialConfig.series=i)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const n=this.w.dom.elGraphical.node;"behind"===e?n.insertBefore(s.node,n.firstChild):n.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e){const i=e=>(e&&t.add(e),e),s={get node(){return t.node},path(t={}){const{d:s="",stroke:n="#000",width:r=1,fill:a="none",opacity:o=1,dash:l=0,className:c=""}=t;return i(e.drawPath({d:s,stroke:n,strokeWidth:r,fill:a,fillOpacity:"none"===a?0:o,strokeOpacity:o,strokeDashArray:l,classes:c}))},line(t={}){const{x1:s,y1:n,x2:r,y2:a,stroke:o="#000",width:l=1,dash:c=0}=t;return i(e.drawLine(s,n,r,a,o,c,l))},rect(t={}){const{x:s=0,y:n=0,w:r=0,h:a=0,r:o=0,fill:l="#000",stroke:c=null,opacity:h=1}=t;return i(e.drawRect(s,n,r,a,o,l,h,null!=c?1:null,c))},circle(t={}){const{cx:s=0,cy:n=0,r:r=0,fill:a="#000",stroke:o=null}=t;return i(e.drawCircle(r,{cx:s,cy:n,fill:a,stroke:o||"none"}))},text(t={}){const{x:s=0,y:n=0,text:r="",color:a,size:o,anchor:l="start",weight:c}=t;return i(e.drawText({x:s,y:n,text:r,textAnchor:l,fontSize:o,foreColor:a,fontWeight:c}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return s}};return s}(s,this.ctx.graphics)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear()}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._reserve(i.def.name,null))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));this.active=[],this._derived=null,this._reserved=null,null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var mt,xt,yt;mt=ft,xt="NO_RESERVATION",yt=Object.freeze({left:0,right:0,top:0,bottom:0}),a(mt,"symbol"!=typeof xt?xt+"":xt,yt);let bt=ft;h.default.registerFeatures({weave:bt}),h.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(t,i,s){var n,r;const a=this.w,o=new v(a,this.ctx),l=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,o),c=o.group({class:"apexcharts-marks-series"});return t.forEach((t,i)=>{var n;const r=Array.isArray(s)?s[i]:i,h=o.group({class:"apexcharts-series",rel:r+1,seriesName:p.escapeString(a.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(a.seriesData.series[r]||[]).length),u=a.globals.colors[r],g=(null==(n=a.config.series[r])?void 0:n.data)||[],f=a.seriesData.seriesX[r]||[],m=a.seriesData.series[r]||[];a.globals.seriesXvalues[r]=[],a.globals.seriesYvalues[r]=[],void 0===a.globals.pointsArray[r]&&(a.globals.pointsArray[r]=[]);for(let t=0;t<m.length;t++){const i=m[t];if(null==i)continue;const s=f[t],n=d.xAt(t,s),o=d.y(i),c=this._api(l,h,r,t);try{e.renderItem({datum:g[t],x:n,y:o,scales:d,api:c,seriesIndex:r,dataPointIndex:t,color:u})}catch(t){this._warned||(this._warned=!0)}a.globals.seriesXvalues[r][t]=n,a.globals.seriesYvalues[r][t]=o,a.globals.pointsArray[r][t]=[n,o]}o.setupEventDelegation(h,".apexcharts-marks-mark"),c.add(h)}),null==(r=null==(n=this.ctx.animations)?void 0:n.animationCompleted)||r.call(n,c),c}_scales(t,e){var i,s,n,r;const a=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,c=this.xyRatios.yRatio,h=null!=(s=null==(i=a.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(c)?null!=(n=c[h])?n:c[0]:c,u=a.maxYArr,g=Array.isArray(u)&&u.length&&null!=(r=u[h])?r:a.maxY,p=a.gridWidth,f=a.gridHeight,m=!a.isXNumeric,x=e||a.dataPoints||1,y=x>0?p/x:p,b="on"===o.xaxis.tickPlacement,w=t=>l?(t-a.minX)/l:p/2,v=a.minXDiff||1;return{x:w,xAt:(t,e)=>m?b&&x>1?t/(x-1)*p:(t+.5)*y:w(e),y:t=>(g-t)/d,gridWidth:p,gridHeight:f,band:m?y:l?v/l:p}}_api(t,e,i,s){const n=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,a,o,l,c,h,d;return n(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(a=e.fill)?a:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(h=null!=(c=e.strokeOpacity)?c:e.opacity)?h:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,a;return n(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(a=null!=(r=e.width)?r:e.strokeWidth)?a:1))},rect:(e={})=>{var i,s,r,a,o,l,c,h;return n(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(a=e.h)?a:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(c=e.opacity)?c:1,null!=e.stroke?null!=(h=e.strokeWidth)?h:1:null,e.stroke))},circle:(e={})=>{var i,s,r,a,o;return n(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(a=e.fill)?a:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,a;return n(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(a=e.anchor)?a:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class wt{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!f.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=m.matchMedia("(prefers-color-scheme: dark)"),e=m.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};wt._add(t.dark,i),wt._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(wt._remove(t.dark,t.handler),wt._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}h.default.registerFeatures({osThemeWatcher:wt});const vt="__apexcharts_series_transforms__";function At(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[vt][t]=e)}globalThis[vt]||(globalThis[vt]={});const _t="__apexcharts_row_sources__";function St(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[_t][t]=e)}globalThis[_t]||(globalThis[_t]={});function Ct(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,n=Math.floor(s),r=Math.ceil(s);return n===r?t[n]:t[n]+(t[r]-t[n])*(s-n)}function Et(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}function kt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],n=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);isFinite(t)&&isFinite(e)&&e>t&&(s=t,n=e)}if(!(n>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const a=n-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=a/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,n=t=>e/Math.max(1,Math.ceil(t));switch(i){case"sqrt":return{width:n(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:n(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=Et(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"fd":{const e=Ct(t,.75)-Ct(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"auto":{const e=n(Math.log2(s)+1),i=Ct(t,.75)-Ct(t,.25);if(i<=0)return{width:e,rule:"sturges"};const r=2*i*Math.pow(s,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:n(Math.log2(s)+1),rule:"sturges"}}}(i,a,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!isFinite(o)||o<=0)&&(o=a);let c=Math.ceil(a/o);(!isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,o=a/c,h=!0),o=a/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*o;return d[c]=Math.max(d[c],n),{edges:d,binWidth:o,rule:l,capped:h}}function Mt(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let n=Math.floor((t-e[0])/s);return n<0&&(n=0),n>i-1&&(n=i-1),t<e[n]?n--:t>=e[n+1]&&n++,n<0||n>i-1?-1:n}let n=0,r=i-1;for(;n<=r;){const i=n+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;n=i+1}}return-1}function It(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const n=[];for(let t=0;t<s.length;t++){const e=p.parseNumber(s[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}function Lt(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let n=s;Array.isArray(s)?n=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(n=void 0!==s.y?s.y:s.x);const r=p.parseNumber(n);null!==r&&isFinite(r)&&e.push(r)}return e}const Pt=new WeakSet;function Dt(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,n=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const n=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&n(r)>e;)r++;let a=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return a+=e.length,e}),stride:r,total:i,kept:a}}(e.map(t=>t.rows),s);n.stride;const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:n.clusters[e].map((s,n)=>o({id:`${t.realIndex}:${e}:${n}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function Ft(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function Xt(t){return(e,i)=>{var s;const n=t(e);if(!Array.isArray(n)||!n.length)return null;const r=e.globals&&e.globals.collapsedSeriesIndices||[],a=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return n.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=a[e]?String(a[e]):`#${e+1}`;o.push({name:n.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?Dt(e,o,i):null}}const Rt=Xt(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Tt=Xt(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});At("histogram",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.histogramRawSeries||(n.histogramRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=n.histogramRawSeries,a=(null==(i=s.plotOptions)?void 0:i.histogram)||{},c=r.map(t=>Lt(null==t?void 0:t.data));let h=[];if(1===c.length)h=c[0];else for(const t of c)h=h.concat(t);const d=kt(h,{bins:a.bins,binWidth:a.binWidth,range:a.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:g}=d,p=c.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const n=Mt(t[s],e);n>=0&&i[n]++}return i}(t,u));e.histogramData={edges:u,binWidth:g,counts:p,rule:d.rule,capped:d.capped};const f=n.collapsedSeriesIndices||[];return r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(p[e],{normalize:a.normalize,cumulative:a.cumulative,binWidth:g}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),At("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Pt.has(t))return t;const i=It(t,!1);if(!i)return t;const s=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ct(i,.25),n=Ct(i,.5),r=Ct(i,.75),a=r-s;let o=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&a>0){const t=s-1.5*a,e=r+1.5*a;let n=0;for(;n<i.length&&i[n]<t;)n++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;n<=h&&(o=i[n],l=i[h],c=i.slice(0,n).concat(i.slice(h+1)))}return{summary:[o,s,n,r,l],outliers:c,iqr:a}}(i,{whiskers:n});if(!s)return t;e=!0;const r=l(o({},t),{y:s.summary,points:i});return Pt.add(r),r});return e?l(o({},t),{data:i}):t})}),At("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{var i;if(Array.isArray(null==(i=null==t?void 0:t.y)?void 0:i.density)&&t.y.density.length&&!Pt.has(t))return t;const s=It(t,!0);if(!s)return t;const r=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let n=e.bandwidth;if(!("number"==typeof n&&n>0)){const t=Et(i),e=Ct(i,.75)-Ct(i,.25);n=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(n)||n<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),a=i[0]-2*n,o=(i[s-1]+2*n-a)/(r-1),l=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=a+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/n;r+=Math.exp(-.5*s*s)}c.push([e,r*l])}return{density:c,bandwidth:n}}(s,{bandwidth:n.bandwidth,resolution:n.resolution});if(!r)return t;e=!0;const a=l(o({},t),{y:{density:r.density,points:s}});return Pt.add(a),a});return e?l(o({},t),{data:i}):t})}),St("histogram",function(t,e){const i=t.globals,s=t.histogramData,n=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(n)||!n.length)return null;const r=i&&i.collapsedSeriesIndices||[],a=s.edges,o=[];return n.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=function(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const n=Mt(t[i],e);n>=0&&s[n].push(t[i])}return s}(Lt(e&&e.data),a),c=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${Ft(a[e])}-${Ft(a[e+1])}`;o.push({name:n.length>1&&c?`${c} ${s}`:s,realIndex:i,rows:t})})}),o.length?Dt(t,o,e):null}),St("boxPlot",Rt),St("violin",Tt);function $t(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:s,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function Bt(t,e,i){if(t&&t.fillColor)return t.fillColor;const s=i[e];return"string"==typeof s&&s?s:void 0}function Nt(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,rest:t}:{x:s,y:t,rest:{}}}At("waterfall",function(t,e){var i,s,n;const r=e.config,a=e.globals;if(!Array.isArray(t))return t;a.waterfallRawSeries||(a.waterfallRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const c=a.waterfallRawSeries,h=(null==(s=null==(i=r.plotOptions)?void 0:i.waterfall)?void 0:s.colors)||{},d=null==(n=r.xaxis)?void 0:n.categories,u=a.collapsedSeriesIndices||[],g=[],f=[],m=[],x=c.map((t,e)=>{const i=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==u.indexOf(e))return g[e]=[],f[e]=[],m[e]=[],l(o({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(i))return g[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(!Array.isArray(e))return null;const i=p.parseNumber(e[0]),s=p.parseNumber(e[1]);return null===i||null===s?null:s-i}),f[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,i=Array.isArray(e)?p.parseNumber(e[1]):null;return null===i?0:i}),m[e]=i.map(()=>null),t;const s=function(t,e,i){const s=[],n=[],r=[],a=[];let c=0,h=0;for(let d=0;d<t.length;d++){const{x:u,y:g,isSubtotal:f,isTotal:m,rest:x}=$t(t[d],d,e);let y,b,w;if(m||f)y=m?0:h,b=c,w=m?"total":"subtotal",h=c;else{const t=p.parseNumber(g);if(null===t||!isFinite(t)){s.push(l(o({},x),{x:u,y:null})),n.push(null),r.push(c),a.push(null);continue}y=c,b=c+t,c=b,w=t<0?"negative":"positive"}const v=Bt(x,w,i);s.push(o(l(o({},x),{x:u,y:[y,b]}),v?{fillColor:v}:{})),n.push(b-y),r.push(c),a.push(w)}return{data:s,values:n,cumulative:r,kinds:a}}(i,d,h);return g[e]=s.values,f[e]=s.cumulative,m[e]=s.kinds,l(o({},t),{data:s.data})});return e.waterfallData={values:g,cumulative:f,kinds:m,geometry:[]},x}),h.default.registerFeatures({waterfall:class{constructor(t,e){this.w=t,this.ctx=e}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var t,e;const i=this.w;if(!this.isActive())return;const s=null==(e=null==(t=i.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!s||!1===s.show)return;const n=i.dom.elGraphical,r=i.waterfallData&&i.waterfallData.geometry;if(!n||!r)return;this.removeConnectors();const a=new v(i,this.ctx),o=a.group({class:"apexcharts-waterfall-connectors"}),l=s.color||i.config.grid.borderColor,c=null==s.strokeWidth?1:s.strokeWidth,h=null==s.strokeDashArray?3:s.strokeDashArray;let d=0;for(let t=0;t<r.length;t++){const e=r[t];if(Array.isArray(e))for(let t=0;t<e.length-1;t++){const i=e[t],s=e[t+1];if(!i||!s)continue;if(!(s.slotStart-i.slotEnd>.5))continue;const n=i.horizontal?a.drawLine(i.levelEnd,i.slotEnd,i.levelEnd,s.slotStart,l,h,c):a.drawLine(i.slotEnd,i.levelEnd,s.slotStart,i.levelEnd,l,h,c);n.node.classList.add("apexcharts-waterfall-connector"),o.add(n),d++}}if(!d)return;o.attr("clip-path",`url(#gridRectBarMask${i.globals.cuid})`);const u=n.node.querySelector(".apexcharts-xaxis");u?n.node.insertBefore(o.node,u):n.add(o),this.holdUntilBarsLand(o)}removeConnectors(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-waterfall-connectors");e&&e.parentNode&&e.parentNode.removeChild(e)}holdUntilBarsLand(t){const e=this.w;f.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),At("dumbbell",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.dumbbellRawSeries||(n.dumbbellRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=n.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},t;const a=null==(i=s.xaxis)?void 0:i.categories,c=n.collapsedSeriesIndices||[],{xs:h,rows:d,byX:u}=function(t,e){var i;const s=[],n=[],r=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(i=t[l])?void 0:i.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:i,y:a,rest:l}=Nt(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,s.length),s.push(i),n.push(o({},l)));const u=r.get(d);h.set(u,p.parseNumber(a))}a.push(h)}return{xs:s,rows:n,byX:a}}(r,a),g=[],f=[],m=[];for(let t=0;t<r.length;t++)-1===c.indexOf(t)&&m.push(t);const x=[];for(let t=0;t<h.length;t++){const e=[];for(let i=0;i<r.length;i++){const s=u[i].has(t)?u[i].get(t):null;e.push(null!=s&&isFinite(s)?s:null)}g.push(e);let i=null,s=null,n=-1,a=-1;for(let t=0;t<m.length;t++){const r=m[t],o=e[r];null!==o&&((null===i||o<i)&&(i=o,n=r),(null===s||o>s)&&(s=o,a=r))}null!==i&&null!==s?(f.push([n,a]),x.push(l(o({},d[t]),{x:h[t],y:[i,s]}))):(f.push(null),x.push(l(o({},d[t]),{x:h[t],y:null})))}e.dumbbellData={form:"series",names:r.map((t,e)=>{var i;return null!=(i=null==t?void 0:t.name)?i:`Series ${e+1}`}),values:g,order:f,carrier:m.length?m[0]:0,hidden:r.map((t,e)=>e).filter(t=>-1!==c.indexOf(t))};const y=e.dumbbellData.carrier;return r.map((t,e)=>l(o({},t),{data:e===y&&m.length?x:[]}))});const zt=["wiggle","silhouette","zero","expand"],Wt=["inside-out","inverse","none"];function Yt(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,rest:t}:{x:s,y:t,rest:{}}}At("streamgraph",function(t,e){var i,s;const n=e.config,r=e.globals;if(!Array.isArray(t))return t;r.streamgraphRawSeries||(r.streamgraphRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const a=r.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(i=n.plotOptions)?void 0:i.streamgraph)||{},h=-1!==zt.indexOf(c.offset)?c.offset:"wiggle",d=-1!==Wt.indexOf(c.order)?c.order:"inside-out",u=null==(s=n.xaxis)?void 0:s.categories,g=r.collapsedSeriesIndices||[],{xs:f,rows:m,grids:x}=function(t,e){var i;const s=[],n=[],r=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(i=t[l])?void 0:i.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:i,y:a,rest:l}=Yt(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,s.length),s.push(i),n.push(o({},l))),h.set(r.get(d),p.parseNumber(a))}a.push(h)}return{xs:s,rows:n,grids:a}}(a,u),y=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i]instanceof Date?t[i].getTime():t[i];if("number"!=typeof s||!isFinite(s))return null;e.push(i)}const i=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));i.sort((t,e)=>t.v-e.v);const s=i.map(t=>t.j);for(let t=0;t<s.length;t++)if(s[t]!==t)return s;return null}(f),b=y?y.map(t=>f[t]):f,w=y?y.map(t=>m[t]):m,v=b.length;let A=!1;const _=[];for(let t=0;t<a.length;t++){const e=new Array(v);for(let i=0;i<v;i++){const s=x[t].get(y?y[i]:i);let n=null==s?0:Number(s);isFinite(n)||(n=0),n<0&&(A=!0,n=0),e[i]=n}_.push(e)}A&&!r.streamgraphWarnedNegative&&(r.streamgraphWarnedNegative=!0);const S=[];for(let t=0;t<a.length;t++)-1===g.indexOf(t)&&S.push(t);let C=_;if("expand"===h){C=_.map(t=>t.slice());for(let t=0;t<v;t++){let e=0;for(let i=0;i<S.length;i++)e+=C[S[i]][t];if(e)for(let i=0;i<S.length;i++)C[S[i]][t]/=e}}const E=function(t,e,i){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const s={},n={};for(let t=0;t<e.length;t++){const r=e[t],a=i[r];let o=0,l=-1/0,c=0;for(let t=0;t<a.length;t++)o+=a[t],a[t]>l&&(l=a[t],c=t);s[r]=o,n[r]=c}const r=e.slice().sort((t,e)=>n[t]-n[e]||t-e);let a=0,o=0;const l=[],c=[];for(let t=0;t<r.length;t++){const e=r[t];a<o?(a+=s[e],l.push(e)):(o+=s[e],c.push(e))}return c.reverse().concat(l)}(d,S,C),k=function(t,e,i,s){const n=new Array(s).fill(0);if(0===s||0===e.length)return n;if("zero"===t||"expand"===t)return n;if("silhouette"===t){for(let t=0;t<s;t++){let s=0;for(let n=0;n<e.length;n++)s+=i[e[n]][t];n[t]=-s/2}return n}let r=0;for(let t=1;t<s;t++){let s=0,a=0;for(let n=0;n<e.length;n++){const r=i[e[n]],o=r[t];let l=(o-r[t-1])/2;for(let s=0;s<n;s++){const n=i[e[s]];l+=n[t]-n[t-1]}s+=o,a+=l*o}s&&(r-=a/s),n[t]=r}return n}(h,E,C,v),M=a.map(()=>null),I=a.map(()=>null);for(let t=0;t<E.length;t++)M[E[t]]=new Array(v),I[E[t]]=new Array(v);for(let t=0;t<v;t++){let e=k[t];for(let i=0;i<E.length;i++){const s=E[i],n=M[s],r=I[s];n[t]=e,e+=C[s][t],r[t]=e}}return e.streamgraphData={names:a.map((t,e)=>{var i;return null!=(i=null==t?void 0:t.name)?i:`Series ${e+1}`}),xs:b,values:_,lows:M,highs:I,order:E,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},a.map((t,e)=>{const i=M[e],s=I[e];if(!i||!s)return l(o({},t),{data:[]});const n=new Array(v);for(let t=0;t<v;t++)n[t]=l(o({},w[t]),{x:b[t],y:[i[t],s[t]]});return l(o({},t),{data:n})})}),h.default.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const i=this.w,s=i.globals,n=i.layout.gridHeight,r=s.maxY-s.minY;if(!r||!isFinite(r))return n/2;const a=(t-s.minY)/r;return(null==(e=i.config.yaxis[0])?void 0:e.reversed)?a*n:n-a*n}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,i,s,n,r,a;const o=this.w;if(!this.isActive())return;const l=null==(e=null==(t=o.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const c=o.dom.elGraphical,h=o.streamgraphData;if(!c||!h)return;this.removeLabels();const d=new v(o,this.ctx),u=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(i=l.style)?void 0:i.fontSize)||"auto",p=(null==(s=l.style)?void 0:s.fontFamily)||o.config.chart.fontFamily,f=(null==(n=l.style)?void 0:n.fontWeight)||600,m=null==l.minWidth?24:l.minWidth,x=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],i=this._placeLabel(e,{fontSize:g,fontFamily:p,fontWeight:f,minWidth:m,graphics:d});i&&x.push(i)}let y=0;for(const t of this._deconflict(x)){const e=t.k,i=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:p,fontWeight:f,foreColor:(null==(a=null==(r=l.style)?void 0:r.colors)?void 0:a[e])||t.color,cssClass:"apexcharts-streamgraph-label"});i.node.setAttribute("data:realIndex",String(e)),u.add(i),y++}if(!y)return;const b=c.node.querySelector(".apexcharts-xaxis");b?c.node.insertBefore(u.node,b):c.add(u),this.holdUntilBandsLand(u)}_placeLabel(t,{fontSize:e,fontFamily:i,fontWeight:s,minWidth:n,graphics:r}){const a=this.w,o=a.streamgraphData,l=o.lows[t],c=o.highs[t];if(!l||!c)return null;const h=a.globals.seriesXvalues[t],d=l.length;if(!Array.isArray(h)||h.length<d||0===d)return null;const u=new Array(d);let g=0;for(let t=0;t<d;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));u[t]=e,e>g&&(g=e)}if(g<=0)return null;const p=this._resolveFontSize(e,g),f=String(o.names[t]);let m=p,x=r.getTextRects(f,`${m}px`,i,"",!0,s);if(g<x.height+6)return null;const y=this._widestRun(u,h,x.height+6,d);if(!y)return null;if(x.width>y.width&&"auto"===e){const t=Math.floor(m*(y.width/x.width));if(t<this._autoBounds().min)return null;if(m=t,x=r.getTextRects(f,`${m}px`,i,"",!0,s),g<x.height+6)return null}const b=x.height+6,w=[];for(const e of this._runs(u,b,d)){const s=Number(h[e.l]),a=Number(h[e.r]);if(!isFinite(s)||!isFinite(a))continue;let o=a-s;if(o<=0&&d>1){const t=Math.abs(Number(h[Math.min(e.r+1,d-1)])-Number(h[Math.max(e.l-1,0)]));o=isFinite(t)?t:0}if(o<n||o<.35*x.width)continue;const u=x.width<=o?f:r.getTextBasedOnMaxWidth({text:f,maxWidth:o,fontSize:`${m}px`,fontFamily:i});if(!u||"..."===u)continue;const g=u===f?x.width:x.width*(u.length/f.length),p=[s+o/2];o>2.2*g&&p.push(s+g/2+2,a-g/2-2);for(const i of p){let s=e.l,n=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-i);e<n&&(n=e,s=t)}w.push({x:i,y:(this._yPx(l[s])+this._yPx(c[s]))/2,text:u,color:this._contrastOn(t),fontSize:`${m}px`,width:g,height:x.height})}if(w.length>=6)break}return w.length?{k:t,weight:g,candidates:w}:null}_runs(t,e,i){const s=[];let n=0;for(;n<i;){if(t[n]<e){n++;continue}let r=n,a=t[n];for(;r+1<i&&t[r+1]>=e;)r++,t[r]>a&&(a=t[r]);s.push({l:n,r:r,maxT:a}),n=r+1}return s.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,i,s){let n=-1;for(const r of this._runs(t,i,s)){const t=Number(e[r.r])-Number(e[r.l]);isFinite(t)&&t>n&&(n=t)}return n>=0?{width:n}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),i=[],s=t=>!i.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const n={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(s(n)){i.push(l(o({k:t.k},e),{box:n}));break}}return i}_autoBounds(){var t,e;const i=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==i.minFontSize?9:i.minFontSize,max:null==i.maxFontSize?30:i.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:i,max:s}=this._autoBounds();return Math.max(i,Math.min(s,Math.round(.36*e)))}_contrastOn(t){var e;const i=this.w,s=null==(e=i.globals.colors)?void 0:e[t],n="string"==typeof s?p.parseHex(s):null;return n?p.relativeLuminance(n)>.45?"#000000":"#ffffff":i.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!f.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,i=e.streamgraphData;if(!i||!i.order.length)return-1;const s=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!s)return-1;const n=s.getBoundingClientRect(),r=e.globals.svgWidth?n.width/e.globals.svgWidth:1,a=X.screenXToPlotPx(e,t.clientX),o=(t.clientY-n.top)/(r||1)-e.layout.translateY;if(a<0||a>e.layout.gridWidth)return-1;if(o<0||o>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[i.order[0]];if(!Array.isArray(l)||!l.length)return-1;const c=e.interact?e.interact.capturedDataPointIndex:-1;let h=-1;if(c>=0&&c<l.length)h=c;else{let t=1/0;for(let e=0;e<l.length;e++){const i=Math.abs(Number(l[e])-a);i<t&&(t=i,h=e)}}if(h<0)return-1;let d=-1,u=1/0;for(let t=0;t<i.order.length;t++){const e=i.order[t],s=this._yPx(i.highs[e][h]),n=this._yPx(i.lows[e][h]),r=Math.min(s,n),a=Math.max(s,n);if(o>=r&&o<=a)return e;const l=o<r?r-o:o-a;l<u&&(u=l,d=e)}return d}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const i=this._hoverCfg(),s=null==i.opacity?.35:i.opacity,n=e.dom.baseEl.querySelectorAll(".apexcharts-series"),r=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(e,i)=>t<0||i===t;for(let t=0;t<n.length;t++){const e=n[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(s)}for(let t=0;t<r.length;t++){const i=r[t];i.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(i.getAttribute("data:realIndex")))?this._restoreLabel(i):(i.getAttribute("data:fill")||i.setAttribute("data:fill",i.getAttribute("fill")||""),i.setAttribute("fill",e.config.chart.foreColor),i.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const i=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<i.length;t++)this._restoreLabel(i[t])}holdUntilBandsLand(t){const e=this.w;f.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&a(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));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 s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_axes_AxesUtils,u=h.__apex_Data,g=h.__apex_Series,p=h.__apex_Utils,f=h.__apex_Environment_Environment,m=h.__apex_BrowserAPIs_BrowserAPIs,x=h.__apex_math_SVGNS;class y{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],r=document.createElementNS(x,"image");r.setAttribute("x",n.getAttribute("x")||"0"),r.setAttribute("y",n.getAttribute("y")||"0"),r.setAttribute("width",n.getAttribute("width")||"0"),r.setAttribute("height",n.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(r,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!f.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=m.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!f.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!f.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(x,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,r=i.globals.svgHeight*s,a=i.dom.elWrap.cloneNode(!0);a.style.width=n+"px",a.style.height=r+"px",this.inlineCanvasLayers(a),this.applyExportStyles(a);const o=(new XMLSerializer).serializeToString(a);let l=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${r}px;">\n ${o}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(l);1!==s&&this.scaleSvgNode(c,s),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),e(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const r=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(r).catch(()=>this.getBase64FromUrl(n).then(r).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return f.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return f.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const r=this.resolveExportBackground(),a=n.getContext("2d");a&&(a.fillStyle=r,a.fillRect(0,0,n.width,n.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{a.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w;t||(t=n.config.series);let r=[];const a=[];let o="";const l=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>{if(null==t||p.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},h=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():p.isNumber(t)?t:c(t.split(i).join("")),f=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):c(t),m=Math.max(...t.map(t=>t.data?t.data.length:0)),x=new u(this.w),y=new d(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new g(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=y.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),p.isNumber(e)?e:e.split(i).join(""))},w=(e,s)=>{var o,c,d,u,g,p;if(r.length&&0===s&&a.push(r.join(i)),e.data){const y=e.data.length?e.data:[...Array(m)].map(()=>"");for(let m=0;m<y.length;m++){r=[];let y=b(m);if("nullvalue"!==y){if(y||(x.isFormatXY()?y=t[s].data[m].x:x.isFormat2DArray()&&(y=t[s].data[m]?t[s].data[m][0]:"")),0===s){r.push(h(y));for(let e=0;e<n.seriesData.series.length;e++){const i=x.isFormatXY()?null==(o=t[e].data[m])?void 0:o.y:l[e][m];r.push(f(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(n.candleData.seriesCandleO[s][m]),r.push(n.candleData.seriesCandleH[s][m]),r.push(n.candleData.seriesCandleL[s][m]),r.push(n.candleData.seriesCandleC[s][m])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(n.candleData.seriesCandleO[s][m]),r.push(n.candleData.seriesCandleH[s][m]),r.push(n.candleData.seriesCandleM[s][m]),r.push(n.candleData.seriesCandleL[s][m]),r.push(n.candleData.seriesCandleC[s][m])),"rangeBar"===n.config.chart.type&&(r.pop(),r.push(n.rangeData.seriesRangeStart[s][m]),r.push(n.rangeData.seriesRangeEnd[s][m])),("violin"===n.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(c=n.violinData.seriesViolinMin[s])?void 0:c[m]),r.push(null==(d=n.violinData.seriesViolinMax[s])?void 0:d[m]),r.push(null!=(p=null==(g=null==(u=n.violinData.seriesViolinPoints[s])?void 0:u[m])?void 0:g.length)?p:0)),r.length&&a.push(r.join(i))}}}};r.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===n.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===n.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===n.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&r.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(r.push(n.config.chart.toolbar.export.csv.headerValue),a.push(r.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?w(t,e):(r=[],r.push(h(n.labelData.labels[e])),r.push(f(l[e])),a.push(r.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,n)=>{null==i||i.data.forEach(i=>{let r,a;if(x.isFormatXY())r=i.x,a=i.y;else{if(!x.isFormat2DArray())return;r=i[0],a=i[1]}s[r]||(s[r]=Array(t.length).fill("")),s[r][n]=f(a),e.add(r)})}),r.length&&a.push(r.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];a.push([h(t),...e].join(i))})})(),o+=a.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+o),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(f.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}h.default.registerFeatures({exports:y});const b=h.__apex_CoreUtils,w=h.__apex_dimensions_Dimensions,v=h.__apex_Graphics;let A=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(f.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,n;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let a=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(a=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!a)return;o=parseInt(null!=(s=a.getAttribute("data:realIndex"))?s:"",10)}else{if(a=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!a)return;o=parseInt(null!=(n=a.getAttribute("rel"))?n:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:a,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],a=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${a}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],a=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${a}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,n=s.globals,r=p.clone(s.config.series);if(n.axisCharts){const e=s.config.yaxis[n.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(n.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(t);const e=n.risingSeries.indexOf(t);n.risingSeries.splice(e,1)}}else if(n.collapsedSeriesIndices.indexOf(t)<0){const a=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:t,data:this._readSliceValue(a[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(n.seriesNames||[])[t]}),n.collapsedSeriesIndices.push(t)}const a=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===a,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),n=t.childNodes;for(let t=0;t<n.length;t++)n[t].classList.contains("apexcharts-series-markers-wrap")&&(n[t].classList.contains("apexcharts-hide")?n[t].classList.remove("apexcharts-hide"):n[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const a=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);a(),o&&"function"==typeof o.then&&o.then(a,a)}riseCollapsedSeries(t,e,i){const s=this.w;let n=p.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)n[i].data=t[r].data.slice(),n[i].hidden=!1;else{const e=this._nonAxisSliceContainer(n);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}n=this._getSeriesBasedOnCollapsedState(n),this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(t[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const _=["#cf4d3f","#8f9499","#26a75b"],S=(t,e,i)=>t+(e-t)*i;function C(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function E(t,e,i){const s=p.parseHex(k(t)),n=p.parseHex(k(e));return s&&n?"#"+C(S(s[0],n[0],i))+C(S(s[1],n[1],i))+C(S(s[2],n[2],i)):t}function k(t){if("string"!=typeof t)return"#000000";if(p.isColorHex(t))return t;return p.rgb2hex(t)||"#000000"}function M(t,e,i,s){var n,r,a;if(!e||"object"!=typeof e)return null;const o=null==(a=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function I(t){var e,i,s;const n=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const a=t.config.series||[];let o=1/0,l=-1/0,c=!1;for(let e=0;e<a.length;e++){const i=a[e]&&a[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=M(t,i[s],e,s);null!=n&&(c=!0,n<o&&(o=n),n>l&&(l=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,l=0);let h=Number.isFinite(Number(r.min))?Number(r.min):o,d=Number.isFinite(Number(r.max))?Number(r.max):l,u=null;if(null===r.midpoint?u=null:Number.isFinite(Number(r.midpoint))?u=Number(r.midpoint):h<0&&d>0&&(u=0),null!=u&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(h-u),Math.abs(d-u));h=u-t,d=u+t}d===h&&(h-=.5,d+=.5);const g=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:k(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:_).map(k),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:S(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)a.push({value:S(s,i,(e-t)/(r-1-t)),color:n[e]});return a}return n.map((t,s)=>({value:S(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(g.length<2)return null;const p=d-h,f=g.map(t=>({percent:0===p?0:(t.value-h)/p,color:t.color}));return{min:h,max:d,midpoint:u,stops:g,at:t=>{if(!Number.isFinite(t))return g[Math.floor(g.length/2)].color;if(t<=g[0].value)return g[0].color;const e=g[g.length-1];if(t>=e.value)return e.color;for(let e=1;e<g.length;e++){const i=g[e];if(t<=i.value){const s=g[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return E(s.color,i.color,r)}}return e.color},legendStops:f}}const P="http://www.w3.org/2000/svg";class L{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,n,r;const a=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return a&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[a])?void 0:r.colorScale)||null}static configFor(t){const e=L.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return L.configFor(this.w)||{}}static isEnabled(t){if(!L.supports(t))return!1;const e=L.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,n,r,a,o,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const d=this._cfg(),u=c.config.legend.position,g="left"===u||"right"===u,p=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=p+4,x=d.showLabels?28:4,y=d.showLabels?20:4,b=d.showLabels?44:0,w=this._resolveStripLength(g?d.height:d.width,g),v=d.thickness,A=g?Math.max(v+f+4,b):w+2*x,_=g?w+2*y:v+f+4,S=(A-(v+f))/2,C=g?"left"===u?S:S+f:x,E=g?y:"top"===u?f:4,k=m.createElementNS(P,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(A)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const M=m.createElementNS(P,"defs"),I=`apexcharts-heatmap-gradient-${c.globals.cuid}`,L=m.createElementNS(P,"linearGradient");L.setAttribute("id",I),g?(L.setAttribute("x1","0"),L.setAttribute("y1","1"),L.setAttribute("x2","0"),L.setAttribute("y2","0")):(L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","1"),L.setAttribute("y2","0"));const{min:D,max:F,stops:X,bands:R}=this._computeStops();this._min=D,this._max=F,X.forEach(t=>{const e=m.createElementNS(P,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),L.appendChild(e)}),M.appendChild(L),k.appendChild(M);const T=m.createElementNS(P,"rect");if(T.setAttribute("x",String(C)),T.setAttribute("y",String(E)),T.setAttribute("width",String(g?v:w)),T.setAttribute("height",String(g?w:v)),T.setAttribute("rx","2"),T.setAttribute("fill",`url(#${I})`),k.appendChild(T),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,e=(null==(n=d.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,a=this._getFormatter(),o=(s,n,r,a)=>{const o=m.createElementNS(P,"text");return o.setAttribute("x",String(n)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",a),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(g){const t=C+v/2;k.appendChild(o(a(D),t,E+w+10,"middle")),k.appendChild(o(a(F),t,E-10,"middle"))}else{const t=E+v/2;k.appendChild(o(a(D),C-6,t,"end")),k.appendChild(o(a(F),C+w+6,t,"start"))}}const $=(null==(a=d.arrow)?void 0:a.color)||c.config.chart.foreColor,N=this._buildArrow(p,$,u);if(k.appendChild(N),this.arrowEl=N,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&R.length>0&&R.forEach(t=>{const e=m.createElementNS(P,"rect");if(g){const i=E+w-t.p2*w,s=E+w-t.p1*w;e.setAttribute("x",String(C)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(C+t.p1*w)),e.setAttribute("y",String(E)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*w))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:u,stripX:C,stripY:E,stripLength:w,stripThickness:v,arrowSize:p,svgWidth:A,svgHeight:_},d.showHoverValue){const t=m.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily||"",t.style.color=c.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}h.classList.add("apexcharts-heatmap-gradient-legend-wrap"),h.classList.add("apx-legend-position-"+u),h.appendChild(k),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=k,t?(h.style.width=A+"px",h.style.height=_+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,g,A,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,n){const r=this.w,a=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,h=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=n+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-n-24;let r;r="start"===a?o:"end"===a?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+h+"px":l-s-o+h+"px"}else{const i=l-s-24;let r;r="start"===a?o:"end"===a?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?o+d+"px":c-n-o+d+"px"}}repositionToPlot(){var t,e;if(!f.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:a,svgWidth:o,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,p=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,y=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,b=i.layout.xAxisHeight||0,w=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){n.style.top=s.translateY+w(s.gridHeight,l)+p+"px";const t=(("left"===a?0:s.translateX+s.gridWidth)+("left"===a?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+g+"px"}else{n.style.left=s.translateX+w(s.gridWidth,o)+g+"px";const t=(("top"===a?y:s.translateY+s.gridHeight+b)+("top"===a?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+p+"px"}m.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect"),s=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&i&&s&&this._geom))return;const n=i.getBoundingClientRect(),r=s.getBoundingClientRect();if(!(n.width&&n.height&&r.width&&r.height))return;const{isVertical:a,position:o}=this._geom;if(a){const t="left"===o?r.left-n.right:n.left-r.right;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===o?-s:s)+"px"}}else{const t="top"===o?r.top-n.bottom:n.top-r.bottom;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===o?-s:s)+"px"}}}destroy(){var t,e,i,s,n,r,a;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(a=(r=this.ctx.events).removeEventListener)||a.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(f.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,n;const r=this.w,a=t.currentTarget,o=parseInt(null!=(e=a.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,o,r]),new g(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new g(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;f.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const n=this.w;if(!this.arrowEl)return;const r=t[t.length-1];if(!r||"object"!=typeof r)return;const a=r.seriesIndex,o=r.dataPointIndex;if("number"!=typeof a||"number"!=typeof o)return;if(!L.supports(n))return;let l;l=this._continuous?function(t,e,i){const s=t.config.series[e];return M(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(n,a,o):null==(s=null==(i=null==(e=n.seriesData)?void 0:e.series)?void 0:i[a])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:n,stripLength:r,stripThickness:a,arrowSize:o}=this._geom,l=this._min,c=this._max-l;let h;if(h=0===c?.5:(t-l)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,l;"left"===i?(e=s+a,l=e+o):(e=s,l=e-o);const c=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,l;"top"===i?(e=n+a,l=e+o):(e=n,l=e-o);const c=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+a+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+a+o+8}px`:n-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=m.createElementNS(P,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=L.colorScaleOf(i)||{},n=this._cfg(),r=I(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let a=1/0,c=-1/0;const h=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<h.length;t++){const e=h[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<a&&(a=i),i>c&&(c=i))}}Number.isFinite(a)||(a=0),Number.isFinite(c)||(c=0);let d=a,u=c;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<a?s.min:a),void 0!==s.max&&(u=s.max>c?s.max:c));const g=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;g.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new p,r=i.config.plotOptions[i.config.chart.type]||{},a=null!=(e=r.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,n.stops||16);for(let e=0;e<l;e++){const n=e/(l-1),c=d+n*(u-d),h=Math.abs(u)+Math.abs(d),p=0===h?0:100*c/h;let f;f=o?r.reverseNegativeShade?p<0?p/100*(1.25*a):1.25*a*(1-p/100):p<=0?1-(1+p/100)*a:(1-p/100)*a:1-p/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;g.push({percent:n,color:m})}}return{min:d,max:u,stops:g,bands:f}}}const D=h.__apex_Markers;h.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new A(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||L.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),L.isEnabled(t)?(this.heatmapGradientLegend=new L(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=m.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[t]);const a=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),h=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(a+d)+"px",u.width=2*(a+d)+"px",u.left=c+"px",u.top=h+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const n=new D(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:a}),c=(f.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),h=new v(this.w).drawMarker(0,0,l(o({},n),{pointFillColor:Array.isArray(e)?e[t]:n.pointFillColor,shape:r}));i.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(t=>{t.node.classList.contains("apexcharts-marker-triangle")?t.node.style.transform="translate(50%, 45%)":t.node.style.transform="translate(50%, 50%)"}),c.add(h)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,a=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),a=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{c[e]=m.createElement("div"),c[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:a});v.setAttrs(u,{rel:e+1,"data:collapsed":h||d}),(h||d)&&u.classList.add("apexcharts-inactive-legend");const g=m.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){g.setAttribute("role","button"),g.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||d,i=e?"hidden":"visible";g.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),g.setAttribute("aria-pressed",e?"true":"false")}const f=m.createElement("span");f.classList.add("apexcharts-legend-text"),f.innerHTML=Array.isArray(l)?l.join(" "):l;let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),f.style.color=x,f.style.fontSize=i.config.legend.fontSize,f.style.fontWeight=i.config.legend.fontWeight,f.style.fontFamily=n||i.config.chart.fontFamily,v.setAttrs(f,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),g.appendChild(u),g.appendChild(f);const y=new b(this.w);if(!i.config.legend.showForZeroSeries){0===y.getSeriesTotalByIndex(e)&&y.seriesHaveSameValues(e)&&!y.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||y.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-null-series"),c.length?i.labelData.seriesGroups.forEach((t,n)=>{var r,a;t.includes(null!=(a=null==(r=i.config.series[e])?void 0:r.name)?a:"")&&(s.appendChild(c[n]),c[n].appendChild(g))}):s.appendChild(g),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),g.classList.add("apexcharts-legend-series"),g.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",v.setAttrs(g,{rel:e+1,seriesName:p.escapeString(r[e]),"data:collapsed":h||d}),(h||d)&&g.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||g.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let r=0,a=0;if("bottom"===i.config.legend.position)a=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new w(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;a=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,a=a+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=a+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new w(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===t.config.legend.position&&(n=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,n=s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker");if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new g(this.ctx.w);"mousemove"===t.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&n.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&n){new g(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if((s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const n=s.getAttribute("rel");e.onLegendClick(t),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);t&&t.focus()})}}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&(s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const a=this.w.config.legend.markers.onClick;"function"==typeof a&&s.classList.contains("apexcharts-legend-marker")&&(a(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,n)}}}});class F{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){var t,e;const i=this.w,s=()=>m.createElementNS("http://www.w3.org/1999/xhtml","div"),n=()=>{const t=m.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},r=s();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=i.config.chart.toolbar.offsetY+"px",r.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(r),this.elZoom=n(),this.elZoomIn=n(),this.elZoomOut=n(),this.elPan=n(),this.elSelection=n(),this.elMeasure=n(),this.elZoomReset=n(),this.elMenuIcon=n(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(n());const a=[],o=(t,e,s)=>{const n=t.toLowerCase();this.t[n]&&i.config.chart.zoom.enabled&&a.push({el:e,icon:"string"==typeof this.t[n]?this.t[n]:s,title:this.localeValues[t],class:`apexcharts-${n}-icon`})};o("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),o("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const l=t=>{this.t[t]&&i.config.chart[t].enabled&&a.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};l("zoom"),l("selection"),this.t.pan&&i.config.chart.zoom.enabled&&a.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&i.config.chart.measure&&i.config.chart.measure.enabled&&a.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),o("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&a.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)a.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});a.forEach((t,e)=>{t.index&&p.moveIndexInArray(a,e,t.index)});for(let t=0;t<a.length;t++)v.setAttrs(a[t].el,{class:a[t].class,title:a[t].title,"aria-label":a[t].title}),a[t].el.innerHTML=a[t].icon,r.appendChild(a[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(r),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),v.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(m.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,v.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,r,a,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.globals[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;n||(e.w.globals[s]=!0,r.classList.add(i.selectedClass)),r.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,r=!n.interact.measureEnabled;this.toggleOtherControls(),r&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,n=(e+s)/2,r=(i+s)/2,a=this._getNewMinXMaxX(n,r);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),r=i-(s-i),a=this._getNewMinXMaxX(n,r);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const a=p.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new y(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(p.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class X{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/X.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*X.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),r=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(r||1)-t.layout.translateX}}const R=h.__apex_index_Box;h.default.registerFeatures({toolbar:F,zoomPanSelection:class extends F{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new v(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new R(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:n,max:r}=this._currentXWindow(),a=r-n,o=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let l=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));l<i&&(l=i),l>c.max-c.min&&(l=c.max-c.min)}let h=n+o*a-o*l,d=h+l;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-r)<u)return;if(isNaN(h)||isNaN(d))return;const g=this.getBeforeZoomRange({min:h,max:d},void 0);g&&g.xaxis&&(h=g.xaxis.min,d=g.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=X.dataXToPx(t,t.config.chart.selection.xaxis.min),s=X.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:r=0}){const a=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+r+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),v.setAttrs(o.node,c)),a.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),v.setAttrs(l.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),r=n(i),a=n(i+s);r===i&&a===i+s||(t.attr({x:r,width:a-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,n=this._gridRect();if(!n)return;const r=s.startX-1,a=s.startY;let c=!1,h=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-n.top;let g=d-r,p=u-a,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(g+r)>i.layout.gridWidth?g=i.layout.gridWidth-r:d<0&&(g=r),r>d&&(c=!0,g=Math.abs(g)),a>u&&(h=!0,p=Math.abs(p)),f="x"===e?{x:c?r-g:r,y:0,width:g,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?a-p:a,width:i.layout.gridWidth,height:p}:{x:c?r-g:r,y:h?a-p:a,width:g,height:p},f=l(o({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(f),s.selectionDragging("resizing"),f}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:r}=e.detail,a=this.constraints;let{x:o,y:l}=r;o<a.x&&(o=a.x),l<a.y&&(l=a.y),r.x2>a.x2&&(o=a.x2-r.w),r.y2>a.y2&&(l=a.y2-r.h),n.move(o,l);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const g=s.config.chart.link,p=!(!g||!g.enabled&&"function"!=typeof g.dimension);("function"==typeof s.config.chart.events.selection||p)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const n=this._gridRect();if(!n)return;const r=this.selectionRect.node.getBoundingClientRect(),a=this.xyRatios;let o,l,c,h;const d=this._screenXToPlotPx(r.left),u=this._screenXToPlotPx(r.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+d*a.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+u*a.invertedYRatio,c=0,h=1;else{if(!e.globals.xAxisScale)return;o=X.pxToDataX(e,d),l=X.pxToDataX(e,u),c=e.globals.yAxisScale[0].niceMin+(n.bottom-r.bottom)*a.yRatio[0],h=e.globals.yAxisScale[0].niceMax-(r.top-n.top)*a.yRatio[0]}const g={xaxis:{min:o,max:l},yaxis:{min:c,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,g),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,g),null==(t=this.ctx.linkedViews)||t.onSourceSelection(g.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,r=this.xyRatios,a=this.ctx.toolbar,o=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect(),l=n._gridRect();if(!l)return;const c=this._screenXToPlotPx(o.left),h=this._screenXToPlotPx(o.right),d=o.top-l.top,u=o.bottom-l.top;let g,f;s.axisFlags.isRangeBar?(g=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio,f=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio):(g=X.pxToDataX(s,c),f=X.pxToDataX(s,h));const m=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d,a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*u;m.push(n),x.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&g!==f)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=p.clone(s.globals.initialConfig.yaxis),i=p.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),f=Math.floor(f),g<1&&(g=1,f=s.globals.dataPoints),f-g<2&&(f=g+1)),"xy"!==e&&"x"!==e||(i={min:g,max:f}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=m[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t),n.ctx.updateHelpers._updateOptions(r,!1,n.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:g,max:f},"xy"===e||"y"===e){const e=p.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=m[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:r,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,r)}panScrolled(t,e){var i,s;const n=this.w,r=this.xyRatios;if(!n.globals.initialConfig)return;const a=p.clone(n.globals.initialConfig.yaxis);let o=r.xRatio,l=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=l+n.layout.gridWidth/15*o,e=c+n.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-n.layout.gridWidth/15*o,e=c-n.layout.gridWidth/15*o),!n.axisFlags.isRangeBar){const r=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<r||e>a)&&(t=l,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return X.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),r=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=p.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),r=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,ratio0:(n.max-n.min)/r},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],n=t.touches[1],r=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=(s.clientX+n.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:o,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:a,minX0:o,maxX0:l,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const n=t.touches[0],r=t.touches[1],a=Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)||1,o=(n.clientX+r.clientX)/2-s.left-e.globals.barPadForNumericAxis,l=i.maxX0-i.minX0,c=l*(i.d0/a);let h=i.minX0+i.cx0/i.gridWidth*l-o/i.gridWidth*c,d=h+c;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-h<i){const t=(h+d)/2;h=t-i/2,d=t+i/2}}this._applyXRange(h,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(n<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,a=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-a;if(a=t,r*=Math.pow(n,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),c=e.layout.gridWidth||1,h=(l.max-l.min)/c,d=r*s*h,u=this._applyXRange(l.min-d,l.max-d,!1),g=this._clampBounds();if(!u||g&&(d>0&&u.minX<=g.min+1e-6*(g.max-g.min)||d<0&&u.maxX>=g.max-1e-6*(g.max-g.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});const T=h.__apex_Animations_prefersReducedMotion,$=h.__apex_Animations_applyProgressiveReveal;class N{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const n=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,a=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==a){const e=a.getBBox();a.setAttribute("x",String(parseFloat(null!=(i=a.getAttribute("x"))?i:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;a.setAttribute("y",String(parseFloat(null!=(s=a.getAttribute("y"))?s:"0")+n));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(a);a.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const n=s.getBoundingClientRect(),r=s.getBBox(),a=n.width/r.width||1,o=t.getBoundingClientRect();let{left:l,right:c,top:h,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([h,d,l,c]=[l,c,h,d]);const u=n.left-r.x*a,g=n.top-r.y*a,p=(o.left-u)/a-l,f=(o.top-g)/a-h,m=this.annoCtx.graphics.drawRect(p,f,o.width/a+l+c,o.height/a+h+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&m.node.classList.add(e.id),m}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(n){const i=n.parentNode,s=this.addBackgroundToAnno(n,e);if(s){null==i||i.insertBefore(s.node,n);const r=n.getAttribute("x");null!==r&&$(s,parseFloat(r),t),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?p.isNumber(t.globals.minY)&&p.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:p.isNumber(t.globals.minX)&&p.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,n;const r=this.w,a="y1"===t?e.y:e.y2,o="string"==typeof a&&a.includes("px");let l,c=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(a);if(!o&&-1===s)return{yP:0,clipped:!0};const n=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=n?parseFloat(null!=(i=n.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l-=r.globals.barHeight/2*(r.seriesData.series.length-1)-r.globals.barHeight*e.seriesIndex)}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],h=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new b(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,a,i)/r.globals.yLogRatio[i]:(a-o)/(h/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),c=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(n=r.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(l=d)}return o&&(l=parseFloat(a)),{yP:l,clipped:c}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,a=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),c=null==s&&e.marker;if(!l&&!c&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(r-s)/(a/i.layout.gridWidth):(s-n)/(a/i.layout.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.axisFlags.dataFormatXNumeric||i.config.chart.sparkline.enabled||(h=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(h=parseFloat(s)),null==s&&e.marker&&(h=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=i.globals.barWidth/2*(i.seriesData.series.length-1)-i.globals.barWidth*e.seriesIndex),"number"!=typeof h&&(h=0,o=!0),parseFloat(h.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(h=i.layout.gridWidth,o=!0):h<0&&(h=0,o=!0),{x:h,clipped:o}}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return r&&(s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),s}}class B{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new N(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,n=this.helpers.getX1X2("x1",t);let r=n.x;const a=n.clipped;let o,l=!0;const c=t.label.text,h=t.strokeDashArray;if(p.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!a){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),$(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const n=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);n.node.classList.add("apexcharts-annotation-rect"),n.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(n.node),t.id&&n.node.classList.add(t.id),$(n,r+t.offsetX,s)}if(!a||!l){const n=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),a="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?n.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:a+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?n.width/2-12:-n.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),$(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class z{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new N(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,n=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),a=r.yP;const o=r.clipped;let l,c=!0,h=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){h=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,a+t.offsetY,this._getYAxisAnnotationWidth(t),a+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,c=r.clipped,l>a){const t=a;a=l,l=t}if(!o||!c){h=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),a-l,0,t.fillColor,t.opacity,1,t.borderColor,n);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:a)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class W{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new N(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),r=n.x,a=n.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,c=o.clipped;if(p.isNumber(r)&&!c&&!a){const n={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let a=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,n);e.appendChild(a.node);const o=[a.node];$(a,r,s);const c=t.label.text?t.label.text:"",h=this.getConstrainedLabelX(c,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:h,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),$(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;a=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(a.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&a.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&a.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&a.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,a;switch(i.textAnchor){case"start":r=e,a=e+n;break;case"end":r=e-n,a=e;break;default:r=e-n/2,a=e+n/2}const o=i.style.padding||{};return r-=o.left||0,a+=o.right||0,r<0?e-r:a>s.layout.gridWidth?e-(a-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const n=this.getPointTooltipEl();n.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${r}`),n.classList.add("apexcharts-active");const a=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=n.getBoundingClientRect(),c=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let d=o.left-a.left+o.width/2-l.width/2,u=o.top-a.top-l.height-10;d=Math.max(0,Math.min(d,a.width-l.width)),u<0&&(u=o.top-a.top+o.height+10),n.style.left=d+c+"px",n.style.top=u+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}const Y=h.__apex_Options;h.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new v(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new N(this),this.xAxisAnnotations=new B(this),this.yAxisAnnotations=new z(this),this.pointsAnnotations=new W(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,r=[e,i,s],a=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!n||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&a[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:a[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:n,foreColor:r,fontSize:a,fontFamily:o,fontWeight:l,cssClass:c,backgroundColor:h,borderWidth:d,strokeDashArray:u,borderRadius:g,borderColor:p,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:y=2,paddingTop:b=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:i,text:s,textAnchor:n||"start",fontSize:a||"12px",fontWeight:l||"regular",fontFamily:o||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:c}),A=w.dom.baseEl.querySelector(f);A&&A.appendChild(v.node);const _=v.bbox();if(s){const t=this.graphics.drawRect(_.x-m,_.y-b,_.width+m+x,_.height+y+b,g,h||"transparent",1,d,p,u);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:n=0,width:r=20,height:a=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,a).move(s,n);const c=e.dom.baseEl.querySelector(o);return c&&c.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:n}){const r=i,a=r.w,o=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),l=o.childNodes.length+1,c=new Y,h=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),d=p.extend(h,t);switch(s){case"xaxis":this.addXaxisAnnotation(d,o,l);break;case"yaxis":this.addYaxisAnnotation(d,o,l);break;case"point":this.addPointAnnotation(d,o,l)}const u=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${l}']`),g=this.helpers.addBackgroundToAnno(u,d);return g&&o.insertBefore(g.node,u),e&&a.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:p.randomId(),method:n,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec.map((t,s)=>{t.id===e&&i.globals.memory.methodsToExec.splice(s,1)}),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}handleKey(t){}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),n=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(n)||s===n)return;const r=.1*(n-s)*t;i.zoomUpdateOptions(s+r,n+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const n=this._getSeriesCount();let r=this.seriesIndex+t,a=0;for(;a<n&&(r<0&&(r=s?n-1:0),r>=n&&(r=s?0:n-1),i.globals.collapsedSeriesIndices.includes(r));)r+=t,a++;this.seriesIndex=r;const o=this._getDataPointCount(r);this.dataPointIndex>=o&&(this.dataPointIndex=o-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,n++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,n++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip();if(!r)return;const a=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:a.ttWidth||0,ttHeight:a.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===n||"donut"===n||"polarArea"===n?this._showTooltipNonAxis(t,e,i,r):"radialBar"===n?this._showTooltipRadialBar(t,e,i,r):"heatmap"===n||"treemap"===n?this._showTooltipHeatTree(t,e,i,r,n):"bar"===n||"candlestick"===n||"boxPlot"===n||"violin"===n||"rangeBar"===n?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,n=s.config.chart.type;let r=0,a=0;const o=this._getFocusableElement(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,a=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(n[0]||0),a=t.top+(n[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,a=e.top+e.height/2}}if(("line"===n||"area"===n||"rangeArea"===n||"scatter"===n||"bubble"===n||"radar"===n)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(n[0]||0),a=t.top+(n[1]||0)}}i.e={type:"mousemove",clientX:r,clientY:a}}_showTooltipBar(t,e,i){var s,n,r,a;const c=this.w,h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(a=null==(r=null==(n=null==(s=c.rangeData.seriesRange)?void 0:s[t])?void 0:n[e])?void 0:r.y)?void 0:a[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:h}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,g=c.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(g){this._leaveHoveredBar();new v(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const t=g&&g.node;if(t){const e=c.dom.elWrap.getBoundingClientRect(),s=t.getBoundingClientRect(),n=s.left-e.left,r=s.top-e.top,a=s.height,o=s.width,l=i.tooltipRect.ttWidth||0,h=r+a/2-(i.tooltipRect.ttHeight||0)/2;let d=n+o;n<(i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?i.xyRatios.baseLineInvertedY:e.width/2)&&(d=n-l);const u=i.getElTooltip();u&&(u.style.left=d+"px",u.style.top=h+"px")}}else i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,n=s.config.chart.type,r=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:r});const a="scatter"===n||"bubble"===n,o=s.globals.markers.largestSize>0&&!s.globals.markers.batched;a?this._showScatterBubblePoint(t,e,i):o?r?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):r?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const n=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!n)return;const r=n.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,i,s){const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=s.getBoundingClientRect(),a=r.width||i.tooltipRect.ttWidth||0,o=r.height||i.tooltipRect.ttHeight||0,l=n.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);c&&(s.style.left=c.x-a/2+"px",s.style.top=c.y-o-10+"px")}_showTooltipRadialBar(t,e,i,s){var n;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:a=0,ttHeight:o=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(n=l.getAttribute("data:angle"))?n:"")||0,i=(r.config.plotOptions.radialBar.startAngle||0)+e/2,c=r.layout.gridWidth/2,h=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,u=r.seriesData.series.length,g=d/Math.max(u,1),f=d-t*g,m=(f+(f-g))/2,x=p.polarToCartesian(c,h,m,i),y=x.x+(r.layout.translateX||0),b=x.y+(r.layout.translateY||0);s.style.left=y-a/2+"px",s.style.top=b-o-10+"px"}}_showTooltipHeatTree(t,e,i,s,n){var r,a;const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===n?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=o.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),n=e.left-t.left,l=e.top-t.top,d=e.width,g=e.height,p=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),f=parseFloat(null!=(a=u.getAttribute("width"))?a:"");i.tooltipPosition.moveXCrosshairs(p+f/2);let m=n+d+c/2;const x=l+g/2-h/2;n+d>o.layout.gridWidth/2&&(m=n-c/2),s.style.left=m+"px",s.style.top=x+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,n,r,a,o,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],g=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",n=Array.isArray(g)?g[e]:"";return t?`${t}: ${n}`:`${n}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(g)?g[t]:""}`}const p=u[t]||`Series ${t+1}`,f=(Array.isArray(g[t])?g[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(n=h.formatters)?void 0:n.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let y="";const b=null==(a=h.labelData)?void 0:a.categoryLabels,w=null==(l=null==(o=h.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])y=String(b[e]);else if(Array.isArray(w)&&null!=w[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{y=String(i(w[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){y=String(w[e])}else y=String(w[e])}return y?`${p}: ${m}, ${y}`:`${p}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new v(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,n=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return n.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return n.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const n=e.minX,r=e.maxX;if(void 0===n||void 0===r)return;const a=s[this.dataPointIndex];if(a>=n&&a<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=n&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,n=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!n||!n.length)return;const r=i.minX,a=i.maxX;if(void 0===r||void 0===a)return;const o=n.length;if(t>=0){for(let t=0;t<o;t++)if(n[t]>=r&&n[t]<=a)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(n[t]>=r&&n[t]<=a)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const n=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!n)return!0;const r=n[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}});const O=h.__apex_PathMorphing_parsePath;function H(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,n=i?t.height:t.width,r=n>0?s/n:e;let a=Math.max(1,Math.ceil(Math.sqrt(r*e)));a>e&&(a=e);const l=Math.floor(e/a);let c=e-l*a;const h=[],d=s/a;let u=0;for(let e=0;e<a;e++){const e=l+(c>0?1:0);c>0&&c--;const s=e>0?n/e:0;for(let n=0;n<e;n++)h.push(i?{x:t.x+u,y:t.y+n*s,width:d,height:s}:{x:t.x+n*s,y:t.y+u,width:s,height:d});u+=d}return h}function j(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,n=s?t.width:t.height,r=s?t.height:t.width,a=s?t.y:t.x,o=a+r,l=r>0?n/r:e;let c=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(n/16));c>=1||(c=1),c>e&&(c=e);const h=Math.floor(e/c);let d=e-h*c;const u=[],g=n/c;let p=s?t.x:t.y;for(let t=0;t<c;t++){const t=h+(d>0?1:0);d>0&&d--;const e=[],n=i(p,p+g,s);if(Array.isArray(n))for(let t=0;t<n.length;t++){const i=n[t];if(!i)continue;const s=Math.max(a,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([a,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),c=l.map(t=>Math.floor(t));let f=c.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)c[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=c[t];if(i<=0)continue;const n=e[t][0],r=(e[t][1]-n)/i;for(let t=0;t<i;t++)u.push(s?{x:p,y:n+t*r,width:g,height:r}:{x:n+t*r,y:p,width:r,height:g})}p+=g}return u}function q(t,e,i,s,n,r){let a=n===i?0:Math.round((t-i)/(n-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(a&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(a=t-1-a,o=t-1-o);const i=a;a=o,o=i}}return l}function V(t,e){let i=1/0,s=1/0,n=-1/0,r=-1/0;const a=t.map(t=>{const[a,o]=e(t);return a<i&&(i=a),a>n&&(n=a),o<s&&(s=o),o>r&&(r=o),[a,o]});return t.map((t,e)=>({item:t,d:q(a[e][0],a[e][1],i,s,n,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function Z(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function U(t,e){const i=Z(t),s=Z(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),n=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),a=i[3]+(s[3]-i[3])*t;return a>=1?`rgb(${e},${n},${r})`:`rgba(${e},${n},${r},${a})`}:null}function G(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}const K=new Set(["bar","funnel","pyramid","histogram"]),Q=new Set(["pie","donut","polarArea","radialBar","gauge"]),J=new Set(["unit","waffle"]),tt=new Set(["treemap","sunburst"]),et=new Set(["boxPlot","violin"]),it=1500;function st(t){return K.has(t)?"bar":Q.has(t)?"radial":J.has(t)?"unit":tt.has(t)?"partition":et.has(t)?"summary":null}h.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null}canMorphTypes(t,e){if(t===e)return!1;const i=st(t),s=st(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=st(t),n=st(e);return"unit"===n?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===n||("radial"===n?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===n||"summary"===n?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==n)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){if(this._snapshot=null,this._removeGhost(),this._cancelPieces(),!f.isBrowser())return!1;const s=this.w.config.chart.animations;if(!s||!1===s.enabled)return!1;if(s.chartTypeMorph&&!1===s.chartTypeMorph.enabled)return!1;if(s.respectReducedMotion&&T())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:n,branches:r,unitDots:a}=this._captureFromDOM(t);if(!n.length)return!1;const o=this._buildMapping(n,t,e,i,r);if(0===o.size)return!1;this._snapshot={fromType:t,toType:e,mapping:o,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}};const l=st(t),c=st(e),h=this._canProbePaths();if("unit"===c&&("bar"===l||"summary"===l||"radial"===l&&h)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=it}else if("unit"===l&&("bar"===c||"summary"===c||"radial"===c&&h)){let t=0;if(a.forEach(e=>{t+=e.length}),t>0&&t<=it){this._snapshot.pieceIn=!0,this._snapshot.sourceDots=a;const t=[];"radial"===c?(Array.isArray(i)?i:[]).forEach((e,i)=>{t.push(`${i}:0`)}):(Array.isArray(i)?i:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push(`${i}:${e}`)}),this._snapshot.keyOrder=t}}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===st(t)||"unit"===st(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const n=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];"function"==typeof n.querySelectorAll&&r.forEach(t=>{n.querySelectorAll(t).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}),"function"==typeof n.querySelectorAll&&n.querySelectorAll("[id]").forEach(t=>{t.removeAttribute("id")}),null==(e=n.removeAttribute)||e.call(n,"id"),this._ghost=n}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!f.isBrowser())return;const n=null==(t=this.w.dom)?void 0:t.elWrap;if(!n||"function"!=typeof n.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),n.appendChild(s);const a=this.getSpeed(),o=Math.max(120,Math.round(.55*a));m.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){const t=this._ghost;this._ghost=null,t&&t.parentNode&&t.parentNode.removeChild(t)}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const n=m.createElementNS("http://www.w3.org/2000/svg","g");if(!n)return null;n.setAttribute("class","apexcharts-morph-pieces"),n.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&n.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(n),this._pieceLayer=n,n}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")})}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,t&&t.parentNode&&t.parentNode.removeChild(t),this._revealPieceHidden()}_canProbePaths(){if(!f.isBrowser())return!1;const t=m.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const n=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!n||"function"!=typeof n.createSVGPoint)return i.removeChild(s),null;const r=n.createSVGPoint(),a=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const n=s?e.y:e.x,r=n+(s?e.height:e.width);if(!(r>n))return null;const l=(t,e)=>s?a(e,t):a(t,e),c=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],h=(t,e,i)=>{let s=e,n=t;for(let t=0;t<6;t++){const t=(s+n)/2;l(t,i)?n=t:s=t}return(s+n)/2},d=(r-n)/o,u=new Array(49).fill(null);let g=!1;for(const t of c)for(let e=0;e<=o;e++)null===u[e]&&l(n+e*d,t)&&(u[e]=t,g=!0);if(!g)return null;const p=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?n:h(n+f*d,n+(f-1)*d,i),a=e===o?r:h(n+e*d,n+(e+1)*d,u[e]);a>s&&p.push([s,a]),f=-1}}return p.length?p:null},dispose:()=>{s.parentNode&&s.parentNode.removeChild(s)}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=new Map;let n=0;if(i.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var e,i,r,a,o,l,c;const h=parseInt(null!=(e=t.getAttribute("i"))?e:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(i=t.getAttribute("cy"))?i:""),p=parseFloat(null!=(r=t.getAttribute("r"))?r:"3")||3;else{const e=parseFloat(null!=(a=t.getAttribute("width"))?a:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=s.get(h);f||(f=[],s.set(h,f)),f.push({el:t,x:u,y:g,r:p,fill:t.getAttribute("fill")}),n++}),0===n||n>it)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const a=[],o=r.ownerDocument,l=st(e.fromType),c="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const n=s.get(t),l=this.getInitialBBoxFor(t),h=e.mapping.get(`${t}:0`);if(!l||!h)return void n.forEach(t=>{t.el.removeAttribute("opacity"),t.el.removeAttribute("data-piece-hidden")});const d=h.fill&&0!==h.fill.indexOf("url(")?h.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||n[0].fill;let u=null;if(c){const e=this.getInitialPathFor(t,0);e&&(u=this._makeExtentProber(e,l,r))}const g=u?j(l,n.length,u.intervalsAt):H(l,n.length);u&&u.dispose();const p=V(g,t=>[t.x+t.width/2,t.y+t.height/2]),f=V(n,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=p[e],s=f[e],n=o.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("data-i",String(t)),n.setAttribute("x",String(i.x)),n.setAttribute("y",String(i.y)),n.setAttribute("width",String(i.width)),n.setAttribute("height",String(i.height)),n.setAttribute("rx","0"),n.setAttribute("fill",String(d)),r.appendChild(n),a.push({el:n,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:U(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!a.length)return this._cancelPieces();this._runPieces(a,t=>{const e=t.meta.dotEl;e.removeAttribute("opacity"),e.removeAttribute("data-piece-hidden"),t.el.parentNode&&t.el.parentNode.removeChild(t.el)})}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const n=this._collectTargetMarks(i.toType);if(!n.size)return this._revealPieceHidden();const r=i.oldLayout.translateX-(this.w.layout.translateX||0),a=i.oldLayout.translateY-(this.w.layout.translateY||0),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const c=l.ownerDocument,h=[],d=st(i.toType),u="summary"===d||"radial"===d;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),d=i.keyOrder[t],g=d?n.get(d):null;if(!g||!s||!s.length){g&&g.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")});continue}const p=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill;let f=null;if(u){const t=g.d||g.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ");t&&(f=this._makeExtentProber(t,g.bbox,l))}const m=f?j(g.bbox,s.length,f.intervalsAt):H(g.bbox,s.length);f&&f.dispose();const x=V(m,t=>[t.x+t.width/2,t.y+t.height/2]),y=V(s,t=>[t.x,t.y]),b={remaining:y.length,els:g.els,tiles:[]};for(let t=0;t<y.length;t++){const e=y[t],i=x[t],s=c.createElementNS("http://www.w3.org/2000/svg","rect"),n=e.x+r-e.r,o=e.y+a-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(n)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||p)),l.appendChild(s),b.tiles.push(s),h.push({el:s,from:{x:n,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:U(e.fill,p),fillEnd:String(p),delay:0,meta:{markState:b}})}}if(!h.length)return this._cancelPieces();this._runPieces(h,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")}),e.tiles.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}))})}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),n=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s}){let n=!1;const r=Date.now(),a=Math.max(1,e),o=(t,e)=>{const i=t.from,s=t.to,n=t.el;n.setAttribute("x",String(i.x+(s.x-i.x)*e)),n.setAttribute("y",String(i.y+(s.y-i.y)*e)),n.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),n.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),n.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?n.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&n.setAttribute("fill",t.fillEnd)},l=()=>{if(n)return;const e=Date.now()-r;let c=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n._done)continue;const r=(e-n.delay)/a;if(r<1&&(c=!0),r<=0)continue;const l=Math.min(1,r);o(n,G(l)),l>=1&&(n._done=!0,i&&i(n))}c?m.requestAnimationFrame(l):s&&s()};return m.requestAnimationFrame(l),()=>{n=!0}}({pieces:t,duration:n,onPieceDone:e,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const n=st(t);if("radial"===n)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");if(!i||!i.trim())return;const n=this._pathBBox(i);n&&s.set(`${e}:0`,{realIndex:e,j:0,d:i,bbox:{x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY},fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===n?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let n=0;t.querySelectorAll("path[pathTo]").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const a=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(a)?n++:a,l=this._pathBBox(r);if(!l)return;const c=`${i}:${o}`,h=s.get(c);h?(h.els.push(t),h.bbox={x:Math.min(h.bbox.x,l.minX),y:Math.min(h.bbox.y,l.minY),width:Math.max(h.bbox.x+h.bbox.width,l.maxX)-Math.min(h.bbox.x,l.minX),height:Math.max(h.bbox.y+h.bbox.height,l.maxY)-Math.min(h.bbox.y,l.minY)}):s.set(c,{realIndex:i,j:o,bbox:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY},fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],n=[],r=new Map,a=st(t);if("bar"===a){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const n=t.getAttribute("pathTo")||t.getAttribute("d");n&&s.push({realIndex:i,j:e,d:n,fill:t.getAttribute("fill")})})})}else if("summary"===a){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const n=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(n))return;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const a="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==a?void 0:a.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${n}`,c=e.get(l);c?c.d+=` ${r}`:e.set(l,{realIndex:o,j:n,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===a)if("treemap"===t){const t=t=>{var e,i,s,n;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),a=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(n=t.getAttribute("height"))?n:"");return[r,a,o,l].every(t=>isFinite(t))?`M ${r} ${a} L ${r+o} ${a} L ${r+o} ${a+l} L ${r} ${a+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,n;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(n=e.getAttribute("j"))?n:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&n.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&n.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===a){const t=i.querySelectorAll(".apexcharts-unit-area"),e=new Map;t.forEach(t=>{var i,s,n,a,o,l,c;const h=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(s=t.getAttribute("cy"))?s:""),p=parseFloat(null!=(n=t.getAttribute("r"))?n:"3")||3;else{const e=parseFloat(null!=(a=t.getAttribute("width"))?a:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=r.get(h);f||(f=[],r.set(h,f)),f.push({x:u,y:g,r:p,fill:t.getAttribute("fill")});const m=e.get(h);m?(u<m.minX&&(m.minX=u),u>m.maxX&&(m.maxX=u),g<m.minY&&(m.minY=g),g>m.maxY&&(m.maxY=g)):e.set(h,{minX:u,minY:g,maxX:u,maxY:g,fill:t.getAttribute("fill")})}),Array.from(e.keys()).sort((t,e)=>t-e).forEach(t=>{const i=e.get(t),n=i.minX-2,r=i.minY-2,a=i.maxX+2,o=i.maxY+2;s.push({realIndex:t,j:0,d:`M ${n} ${r} L ${a} ${r} L ${a} ${o} L ${n} ${o} Z`,fill:i.fill})})}else if("radial"===a)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>{var n;const r=i.parentElement,a=parseInt(null!=(n=null==r?void 0:r.getAttribute("data:realIndex"))?n:"0",10),o=i.getAttribute("d");if(!o)return;const l=parseFloat(i.getAttribute("stroke-width")||"0"),c=l>1&&this._radialArcToFilledSegment(o,l,t,e)||o;s.push({realIndex:a,j:0,d:c,fill:i.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:n,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const n=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!n)return null;const r=parseFloat(n[1]),a=parseFloat(n[2]),o=parseFloat(n[3]),l=parseInt(n[4],10),c=parseInt(n[5],10),h=parseFloat(n[6]),d=parseFloat(n[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,g=o+u,p=Math.max(0,o-u),f=(t,e,n)=>{const r=t-i,a=e-s,o=Math.sqrt(r*r+a*a);if(0===o)return{x:i,y:s};const l=n/o;return{x:i+r*l,y:s+a*l}},m=f(r,a,g),x=f(h,d,g),y=f(r,a,p),b=f(h,d,p),w=c?0:1;return`M ${m.x} ${m.y} A ${g} ${g} 0 ${l} ${c} ${x.x} ${x.y} L ${b.x} ${b.y} A ${p} ${p} 0 ${l} ${w} ${y.x} ${y.y} Z`}buildRingSegmentPath(t,e,i,s,n,r){const a=s/2,o=i+a,l=Math.max(0,i-a),c=(n-90)*Math.PI/180,h=(r-90)*Math.PI/180,d=t+o*Math.cos(c),u=e+o*Math.sin(c),g=t+o*Math.cos(h),p=e+o*Math.sin(h),f=t+l*Math.cos(c),m=e+l*Math.sin(c),x=t+l*Math.cos(h),y=e+l*Math.sin(h),b=r>n?1:0,w=Math.abs(r-n)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${w} ${b} ${g} ${p} L ${x} ${y} A ${l} ${l} 0 ${w} ${1-b} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,n){const r=new Map,a=st(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===a&&n&&n.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),n.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}if("radial"===a||"unit"===a||"partition"===a)return o.forEach((t,e)=>{r.set(`${e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===a||"summary"===a){const t=[];return(Array.isArray(s)?s:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push({realIndex:i,j:e})}),o.forEach((e,i)=>{const s=t[i];s&&r.set(`${s.realIndex}:${s.j}`,{d:e.d,fill:e.fill})}),r}return r}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===s&&0===n?i.d:this._translatePathD(i.d,s,n)}_translatePathD(t,e,i){if(0===e&&0===i)return t;return O(t).map(t=>{const s=t[0];return"Z"===s?"Z":"M"===s||"L"===s||"T"===s?`${s} ${t[1]+e} ${t[2]+i}`:"H"===s?`${s} ${t[1]+e}`:"V"===s?`${s} ${t[1]+i}`:"C"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i} ${t[5]+e} ${t[6]+i}`:"S"===s||"Q"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i}`:"A"===s?`${s} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+i}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const n=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:n,y:r};const a=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:n,y:s.y+s.height*(1-a)}:{x:s.x+s.width*a,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return{x:i.minX+s,y:i.minY+n,width:i.maxX-i.minX,height:i.maxY-i.minY}}_pathBBox(t){const e=O(t);let i=1/0,s=1/0,n=-1/0,r=-1/0,a=!1;return e.forEach(t=>{const e=t[0];if("Z"===e)return;let o=[];if("H"===e)o=[[t[1],(s+r)/2||t[1]]];else if("V"===e)o=[[(i+n)/2||t[1],t[1]]];else if("A"===e)o=[[t[6],t[7]]];else for(let e=1;e+1<t.length;e+=2)o.push([t[e],t[e+1]]);o.forEach(([t,e])=>{isFinite(t)&&isFinite(e)&&(a=!0,t<i&&(i=t),t>n&&(n=t),e<s&&(s=e),e>r&&(r=e))})}),a?{minX:i,minY:s,maxX:n,maxY:r}:null}getInitialFillFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);return i?i.fill:null}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!f.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed();[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text"].forEach(t=>{e.querySelectorAll(t).forEach(t=>{t.style&&(t.style.opacity="0",t.style.transition=`opacity ${i}ms ease-out`,m.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},i+80))})}),setTimeout(()=>this.cleanup(),i+100)}cleanup(){this._snapshot=null,this._removeGhost(),this._cancelPieces()}}});function nt(t,e,i,s){var n;const r=null==(n=null==e?void 0:e.dimensions)?void 0:n.dimHelpers,a=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const n=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!n.length)return i;const r=s.getBoundingClientRect().top,a=e.getBoundingClientRect();let o=i;for(let t=0;t<n.length;t++){const e=n[t].getBoundingClientRect();e.height&&(e.left>=a.right||e.right<=a.left||(o=Math.min(o,e.top-r)))}return o}(t,i);if(c-a>=o+1)return i.style.top=`${c-o-1+l}px`,!0;i.style.top=`${a+l}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const rt="http://www.w3.org/1999/xhtml";class at{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!f.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const s=i.querySelector(".apexcharts-breadcrumb");s&&s.parentNode&&s.parentNode.removeChild(s);const n=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!n||!1===n.show)return;if(0===this.drilldown.depth)return;const r=m.createElementNS(rt,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,n);const a=null!=n.separator?n.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=m.createElementNS(rt,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}const s=this._label(e,i);if(i===t.length-1){const t=m.createElementNS(rt,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=s,r.appendChild(t)}else{const t=m.createElementNS(rt,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=m.createElementNS(rt,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=m.createElementNS(rt,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=s,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&nt(this.w,this.ctx,r,n),this._avoidChromeOverlap(r)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const s=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),n=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!n)break;t.style.top=n.getBoundingClientRect().bottom-s+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let s;if(0===e)s=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);s=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(s,{index:e,depth:this.drilldown.depth}):s}_position(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const ot="http://www.w3.org/1999/xhtml",lt="apexcharts-drilldown-loading";class ct{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!f.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=m.createElementNS(ot,"div");i.setAttribute("class",lt),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const s=m.createElementNS(ot,"div");if(s.setAttribute("class",`${lt}-spinner`),s.setAttribute("aria-hidden","true"),i.appendChild(s),t.text){const e=m.createElementNS(ot,"span");e.setAttribute("class",`${lt}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${lt}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const ht="__apexDrilldownMarker";h.default.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new at(t,e,this),this.loading=new ct(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const s=this._resolveChild(t);return s?this._drillInto(s,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):Promise.resolve(this.ctx)}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],s=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const n=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(s),"up",{from:i,to:n})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const s=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:s,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_drillDownAsync(t,e,i){const s=this.w.config.drilldown.onDrillDown,n=this._cacheGet(t);if(n)return this._drillInto(n,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=s({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const a=()=>{this._pending=null,this.loading.hide()},c=Promise.resolve(r).then(s=>{if(a(),this._isDead())return this.ctx;if(!s||!s.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const n=null!=s.id?s:l(o({},s),{id:t});return this._cacheSet(t,n),this._drillInto(n,e,i)},e=>(a(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=c,c}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(p.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=p.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=p.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=p.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?p.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=p.clone(t.plotOptions)),e.has("fill")&&(i.fill=p.clone(t.fill)),e.has("legend")&&(i.legend=p.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,s=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!s.length)return t;const n=e.config.chart.type,r=("pie"===n||"donut"===n||"polarArea"===n)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of s){const s=e.index;i.axisCharts?t[s]&&(t[s].data=Array.isArray(e.data)?e.data.slice():e.data):r[s]&&"object"==typeof r[s]?r[s].y=e.data:void 0!==r[s]&&(r[s]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=l(o({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),a=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(a)}return r(n).then(a)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!f.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const s=e.getBoundingClientRect();let n=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(n=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),n&&"function"==typeof n.getBoundingClientRect){const t=n.getBoundingClientRect();return{x:t.left+t.width/2-s.left,y:t.top+t.height/2-s.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-s.left,y:r.top+r.height/2-s.top}}_zoomDrill(t,e,i){return s=this,n=null,r=function*(){const s=this._zoomDuration(),n="down"===e,r=Math.round(.55*s),a=n?"scale(1.03)":"scale(0.97)",o=n?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",l=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},c=this._markGroup();let h=null;if(c){l(c),h=c.animate([{transform:"scale(1)",opacity:1},{transform:a,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield h.finished}catch(t){}}yield i();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=o,h&&c===d&&h.cancel();const t=d.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:s,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(u=d).style.transform="",u.style.opacity="",u.style.transformOrigin="",u.style.transformBox="",t.cancel()}var u},new Promise((t,e)=>{var i=t=>{try{o(r.next(t))}catch(t){e(t)}},a=t=>{try{o(r.throw(t))}catch(t){e(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,a);o((r=r.apply(s,n)).next())});var s,n,r}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i)return;const s=this._pointAt(i.seriesIndex,i.dataPointIndex);return s&&"object"==typeof s&&null!=s.drilldown?this.drillDown(s.drilldown,s,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,s,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const s=i[t];return s&&Array.isArray(s.data)&&null!=s.data[e]?s.data[e]:null}_afterRender(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!f.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let s=0;i.forEach((t,i)=>{const n=t&&Array.isArray(t.data)?t.data:null;n&&n.forEach((t,n)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${n}"]`);r.length||s++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!f.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const s=t.target;if(!s||"function"!=typeof s.closest)return;if(s.closest(".apexcharts-drilldown-target"))return;if(s.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const n=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==n||null==r||n<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[n]))return;const a=this._pointAt(n,r);return a&&"object"==typeof a&&null!=a.drilldown?this.drillDown(a.drilldown,a,{seriesIndex:n,dataPointIndex:r}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,s=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[ht]):[],n=i&&i.marker||{};if(!1===n.show||!Array.isArray(t))return s;const r=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const s={seriesIndex:e,dataPointIndex:i,[ht]:!0};void 0!==n.size&&(s.size=n.size),void 0!==n.shape&&(s.shape=n.shape),void 0!==n.fillColor&&(s.fillColor=n.fillColor),void 0!==n.strokeColor&&(s.strokeColor=n.strokeColor),r.push(s)})}),s.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,s=Array.isArray(i)?i[t]:i;return!(Number(s)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});const dt="__apexcharts_plugins__";function ut(t){return function(){const t=globalThis;return t[dt]||(t[dt]={}),t[dt]}()[t]||null}const gt=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function pt(t){const e={};return gt.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}const ft=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._pointerSubs=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=ut(t.name);if(!e)return;const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>4)return;const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=function(t,e){const i=t.ctx,s=t.w,n={name:e.def.name,version:4,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),n},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return n},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:pt(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null})})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),n),reserve:i=>(t._reserve(e.def.name,i),n),pointer:i=>t._onPointer(e.def.name,i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}};return Object.freeze(n)}(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const n=e.handlers.get(t);if(!n||!n.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const r={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of n.slice())this._guard(e,t,()=>i(r))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const n=t.xRatio,r=t.yRatio||[],a=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,o=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,l=!e.axisFlags.isXNumeric&&!i.isBarHorizontal&&i.dataPoints>0,c=l?s.gridWidth/i.dataPoints:0;this._currentScales={x:l?t=>c*(t+.5):t=>(t-i.minX)/n,y:(t,e=0)=>(a(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:l?[-.5,i.dataPoints-.5]:[i.minX,i.maxX],domainY:(t=0)=>[o(t),a(t)],gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],n=Array.isArray(t.config.series)?t.config.series:[];return i.map((t,i)=>{const r=Array.isArray(t)?t:[t],a=s[i]||[],o=r.map((t,e)=>({x:null!=a[e]?a[e]:e,y:t})),l=n[i],c=l&&"object"==typeof l&&Array.isArray(l.data)?l.data:[];return{name:e.seriesNames?e.seriesNames[i]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(i),color:e.colors?e.colors[i]:void 0,points:o,raw:c}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],n=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:n,a=t.seriesData.series||[];let o=0;for(let t=0;t<a.length;t++){const e=a[t];Array.isArray(e)&&e.length>o&&(o=e.length)}o||(o=r.length);const l=[];for(let t=0;t<o;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_onPointer(t,e){if("function"!=typeof e)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const i=this._pointerSubs.get(t)||[];return i.push(e),this._pointerSubs.set(t,i),this._wirePointer(),()=>{const i=this._pointerSubs&&this._pointerSubs.get(t);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const t=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[e,i]of t){const t=(t,i,s)=>{this._emitPointer(e,s)};this.ctx.addEventListener(i,t),this._pointerWired.push([i,t])}}_emitPointer(e,i){if(!this._pointerSubs||!this._pointerSubs.size)return;const s=i&&"number"==typeof i.seriesIndex?i.seriesIndex:-1,n=i&&"number"==typeof i.dataPointIndex?i.dataPointIndex:-1,r=this._categories()||[],a=this.w,o=a&&a.config&&a.config.series||[],l={type:e,seriesIndex:s,dataPointIndex:n,category:n>-1?r[n]:void 0,seriesName:t._seriesName(o,s),selected:"select"===e?t._isSelected(i,s,n):void 0};for(const[t,e]of this._pointerSubs)for(const t of e.slice())try{t(l)}catch(t){}}static _seriesName(t,e){if(e<0)return;const i=t[e];return i&&"object"==typeof i&&"string"==typeof i.name?i.name:void 0}static _isSelected(t,e,i){const s=t&&t.selectedDataPoints;if(!Array.isArray(s)||e<0)return;const n=s[e];return!!Array.isArray(n)&&n.indexOf(i)>-1}_reserve(e,i){const s=t._normaliseBox(i),n=this._reserved?this._reserved.get(e):void 0;if(s){if(n&&n.left===s.left&&n.right===s.right&&n.top===s.top&&n.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!n||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;if(!t.isDestroyed){t.resized=!0,t.dataChanged=!1;try{this.ctx.update()}catch(t){}}},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w,i=(Array.isArray(e.config.series)?e.config.series:[]).filter(e=>!t.has(String(e&&e.name)));if(i.length)try{e.globals.initialSeries=i,e.globals.initialConfig&&Array.isArray(e.globals.initialConfig.series)&&(e.globals.initialConfig.series=i)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const n=this.w.dom.elGraphical.node;"behind"===e?n.insertBefore(s.node,n.firstChild):n.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e){const i=e=>(e&&t.add(e),e),s={get node(){return t.node},path(t={}){const{d:s="",stroke:n="#000",width:r=1,fill:a="none",opacity:o=1,dash:l=0,className:c=""}=t;return i(e.drawPath({d:s,stroke:n,strokeWidth:r,fill:a,fillOpacity:"none"===a?0:o,strokeOpacity:o,strokeDashArray:l,classes:c}))},line(t={}){const{x1:s,y1:n,x2:r,y2:a,stroke:o="#000",width:l=1,dash:c=0}=t;return i(e.drawLine(s,n,r,a,o,c,l))},rect(t={}){const{x:s=0,y:n=0,w:r=0,h:a=0,r:o=0,fill:l="#000",stroke:c=null,opacity:h=1}=t;return i(e.drawRect(s,n,r,a,o,l,h,null!=c?1:null,c))},circle(t={}){const{cx:s=0,cy:n=0,r:r=0,fill:a="#000",stroke:o=null}=t;return i(e.drawCircle(r,{cx:s,cy:n,fill:a,stroke:o||"none"}))},text(t={}){const{x:s=0,y:n=0,text:r="",color:a,size:o,anchor:l="start",weight:c}=t;return i(e.drawText({x:s,y:n,text:r,textAnchor:l,fontSize:o,foreColor:a,fontWeight:c}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return s}};return s}(s,this.ctx.graphics)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear()}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._reserve(i.def.name,null))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._pointerWired){for(const[t,e]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(t,e);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var mt,xt,yt;mt=ft,xt="NO_RESERVATION",yt=Object.freeze({left:0,right:0,top:0,bottom:0}),a(mt,"symbol"!=typeof xt?xt+"":xt,yt);let bt=ft;h.default.registerFeatures({weave:bt}),h.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(t,i,s){var n,r;const a=this.w,o=new v(a,this.ctx),l=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,o),c=o.group({class:"apexcharts-marks-series"});return t.forEach((t,i)=>{var n;const r=Array.isArray(s)?s[i]:i,h=o.group({class:"apexcharts-series",rel:r+1,seriesName:p.escapeString(a.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(a.seriesData.series[r]||[]).length),u=a.globals.colors[r],g=(null==(n=a.config.series[r])?void 0:n.data)||[],f=a.seriesData.seriesX[r]||[],m=a.seriesData.series[r]||[];a.globals.seriesXvalues[r]=[],a.globals.seriesYvalues[r]=[],void 0===a.globals.pointsArray[r]&&(a.globals.pointsArray[r]=[]);for(let t=0;t<m.length;t++){const i=m[t];if(null==i)continue;const s=f[t],n=d.xAt(t,s),o=d.y(i),c=this._api(l,h,r,t);try{e.renderItem({datum:g[t],x:n,y:o,scales:d,api:c,seriesIndex:r,dataPointIndex:t,color:u})}catch(t){this._warned||(this._warned=!0)}a.globals.seriesXvalues[r][t]=n,a.globals.seriesYvalues[r][t]=o,a.globals.pointsArray[r][t]=[n,o]}o.setupEventDelegation(h,".apexcharts-marks-mark"),c.add(h)}),null==(r=null==(n=this.ctx.animations)?void 0:n.animationCompleted)||r.call(n,c),c}_scales(t,e){var i,s,n,r;const a=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,c=this.xyRatios.yRatio,h=null!=(s=null==(i=a.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(c)?null!=(n=c[h])?n:c[0]:c,u=a.maxYArr,g=Array.isArray(u)&&u.length&&null!=(r=u[h])?r:a.maxY,p=a.gridWidth,f=a.gridHeight,m=!a.isXNumeric,x=e||a.dataPoints||1,y=x>0?p/x:p,b="on"===o.xaxis.tickPlacement,w=t=>l?(t-a.minX)/l:p/2,v=a.minXDiff||1;return{x:w,xAt:(t,e)=>m?b&&x>1?t/(x-1)*p:(t+.5)*y:w(e),y:t=>(g-t)/d,gridWidth:p,gridHeight:f,band:m?y:l?v/l:p}}_api(t,e,i,s){const n=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,a,o,l,c,h,d;return n(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(a=e.fill)?a:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(h=null!=(c=e.strokeOpacity)?c:e.opacity)?h:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,a;return n(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(a=null!=(r=e.width)?r:e.strokeWidth)?a:1))},rect:(e={})=>{var i,s,r,a,o,l,c,h;return n(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(a=e.h)?a:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(c=e.opacity)?c:1,null!=e.stroke?null!=(h=e.strokeWidth)?h:1:null,e.stroke))},circle:(e={})=>{var i,s,r,a,o;return n(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(a=e.fill)?a:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,a;return n(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(a=e.anchor)?a:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class wt{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!f.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=m.matchMedia("(prefers-color-scheme: dark)"),e=m.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};wt._add(t.dark,i),wt._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(wt._remove(t.dark,t.handler),wt._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}h.default.registerFeatures({osThemeWatcher:wt});const vt="__apexcharts_series_transforms__";function At(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[vt][t]=e)}globalThis[vt]||(globalThis[vt]={});const _t="__apexcharts_row_sources__";function St(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[_t][t]=e)}globalThis[_t]||(globalThis[_t]={});function Ct(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,n=Math.floor(s),r=Math.ceil(s);return n===r?t[n]:t[n]+(t[r]-t[n])*(s-n)}function Et(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}function kt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],n=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);isFinite(t)&&isFinite(e)&&e>t&&(s=t,n=e)}if(!(n>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const a=n-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=a/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,n=t=>e/Math.max(1,Math.ceil(t));switch(i){case"sqrt":return{width:n(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:n(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=Et(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"fd":{const e=Ct(t,.75)-Ct(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"auto":{const e=n(Math.log2(s)+1),i=Ct(t,.75)-Ct(t,.25);if(i<=0)return{width:e,rule:"sturges"};const r=2*i*Math.pow(s,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:n(Math.log2(s)+1),rule:"sturges"}}}(i,a,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!isFinite(o)||o<=0)&&(o=a);let c=Math.ceil(a/o);(!isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,o=a/c,h=!0),o=a/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*o;return d[c]=Math.max(d[c],n),{edges:d,binWidth:o,rule:l,capped:h}}function Mt(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let n=Math.floor((t-e[0])/s);return n<0&&(n=0),n>i-1&&(n=i-1),t<e[n]?n--:t>=e[n+1]&&n++,n<0||n>i-1?-1:n}let n=0,r=i-1;for(;n<=r;){const i=n+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;n=i+1}}return-1}function It(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const n=[];for(let t=0;t<s.length;t++){const e=p.parseNumber(s[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}function Pt(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let n=s;Array.isArray(s)?n=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(n=void 0!==s.y?s.y:s.x);const r=p.parseNumber(n);null!==r&&isFinite(r)&&e.push(r)}return e}const Lt=new WeakSet;function Dt(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,n=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const n=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&n(r)>e;)r++;let a=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return a+=e.length,e}),stride:r,total:i,kept:a}}(e.map(t=>t.rows),s);n.stride;const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:n.clusters[e].map((s,n)=>o({id:`${t.realIndex}:${e}:${n}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function Ft(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function Xt(t){return(e,i)=>{var s;const n=t(e);if(!Array.isArray(n)||!n.length)return null;const r=e.globals&&e.globals.collapsedSeriesIndices||[],a=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return n.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=a[e]?String(a[e]):`#${e+1}`;o.push({name:n.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?Dt(e,o,i):null}}const Rt=Xt(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Tt=Xt(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});At("histogram",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.histogramRawSeries||(n.histogramRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=n.histogramRawSeries,a=(null==(i=s.plotOptions)?void 0:i.histogram)||{},c=r.map(t=>Pt(null==t?void 0:t.data));let h=[];if(1===c.length)h=c[0];else for(const t of c)h=h.concat(t);const d=kt(h,{bins:a.bins,binWidth:a.binWidth,range:a.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:g}=d,p=c.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const n=Mt(t[s],e);n>=0&&i[n]++}return i}(t,u));e.histogramData={edges:u,binWidth:g,counts:p,rule:d.rule,capped:d.capped};const f=n.collapsedSeriesIndices||[];return r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(p[e],{normalize:a.normalize,cumulative:a.cumulative,binWidth:g}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),At("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Lt.has(t))return t;const i=It(t,!1);if(!i)return t;const s=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ct(i,.25),n=Ct(i,.5),r=Ct(i,.75),a=r-s;let o=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&a>0){const t=s-1.5*a,e=r+1.5*a;let n=0;for(;n<i.length&&i[n]<t;)n++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;n<=h&&(o=i[n],l=i[h],c=i.slice(0,n).concat(i.slice(h+1)))}return{summary:[o,s,n,r,l],outliers:c,iqr:a}}(i,{whiskers:n});if(!s)return t;e=!0;const r=l(o({},t),{y:s.summary,points:i});return Lt.add(r),r});return e?l(o({},t),{data:i}):t})}),At("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{var i;if(Array.isArray(null==(i=null==t?void 0:t.y)?void 0:i.density)&&t.y.density.length&&!Lt.has(t))return t;const s=It(t,!0);if(!s)return t;const r=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let n=e.bandwidth;if(!("number"==typeof n&&n>0)){const t=Et(i),e=Ct(i,.75)-Ct(i,.25);n=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(n)||n<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),a=i[0]-2*n,o=(i[s-1]+2*n-a)/(r-1),l=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=a+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/n;r+=Math.exp(-.5*s*s)}c.push([e,r*l])}return{density:c,bandwidth:n}}(s,{bandwidth:n.bandwidth,resolution:n.resolution});if(!r)return t;e=!0;const a=l(o({},t),{y:{density:r.density,points:s}});return Lt.add(a),a});return e?l(o({},t),{data:i}):t})}),St("histogram",function(t,e){const i=t.globals,s=t.histogramData,n=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(n)||!n.length)return null;const r=i&&i.collapsedSeriesIndices||[],a=s.edges,o=[];return n.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=function(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const n=Mt(t[i],e);n>=0&&s[n].push(t[i])}return s}(Pt(e&&e.data),a),c=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${Ft(a[e])}-${Ft(a[e+1])}`;o.push({name:n.length>1&&c?`${c} ${s}`:s,realIndex:i,rows:t})})}),o.length?Dt(t,o,e):null}),St("boxPlot",Rt),St("violin",Tt);function $t(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:s,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function Nt(t,e,i){if(t&&t.fillColor)return t.fillColor;const s=i[e];return"string"==typeof s&&s?s:void 0}function Bt(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,rest:t}:{x:s,y:t,rest:{}}}At("waterfall",function(t,e){var i,s,n;const r=e.config,a=e.globals;if(!Array.isArray(t))return t;a.waterfallRawSeries||(a.waterfallRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const c=a.waterfallRawSeries,h=(null==(s=null==(i=r.plotOptions)?void 0:i.waterfall)?void 0:s.colors)||{},d=null==(n=r.xaxis)?void 0:n.categories,u=a.collapsedSeriesIndices||[],g=[],f=[],m=[],x=c.map((t,e)=>{const i=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==u.indexOf(e))return g[e]=[],f[e]=[],m[e]=[],l(o({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(i))return g[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(!Array.isArray(e))return null;const i=p.parseNumber(e[0]),s=p.parseNumber(e[1]);return null===i||null===s?null:s-i}),f[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,i=Array.isArray(e)?p.parseNumber(e[1]):null;return null===i?0:i}),m[e]=i.map(()=>null),t;const s=function(t,e,i){const s=[],n=[],r=[],a=[];let c=0,h=0;for(let d=0;d<t.length;d++){const{x:u,y:g,isSubtotal:f,isTotal:m,rest:x}=$t(t[d],d,e);let y,b,w;if(m||f)y=m?0:h,b=c,w=m?"total":"subtotal",h=c;else{const t=p.parseNumber(g);if(null===t||!isFinite(t)){s.push(l(o({},x),{x:u,y:null})),n.push(null),r.push(c),a.push(null);continue}y=c,b=c+t,c=b,w=t<0?"negative":"positive"}const v=Nt(x,w,i);s.push(o(l(o({},x),{x:u,y:[y,b]}),v?{fillColor:v}:{})),n.push(b-y),r.push(c),a.push(w)}return{data:s,values:n,cumulative:r,kinds:a}}(i,d,h);return g[e]=s.values,f[e]=s.cumulative,m[e]=s.kinds,l(o({},t),{data:s.data})});return e.waterfallData={values:g,cumulative:f,kinds:m,geometry:[]},x}),h.default.registerFeatures({waterfall:class{constructor(t,e){this.w=t,this.ctx=e}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var t,e;const i=this.w;if(!this.isActive())return;const s=null==(e=null==(t=i.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!s||!1===s.show)return;const n=i.dom.elGraphical,r=i.waterfallData&&i.waterfallData.geometry;if(!n||!r)return;this.removeConnectors();const a=new v(i,this.ctx),o=a.group({class:"apexcharts-waterfall-connectors"}),l=s.color||i.config.grid.borderColor,c=null==s.strokeWidth?1:s.strokeWidth,h=null==s.strokeDashArray?3:s.strokeDashArray;let d=0;for(let t=0;t<r.length;t++){const e=r[t];if(Array.isArray(e))for(let t=0;t<e.length-1;t++){const i=e[t],s=e[t+1];if(!i||!s)continue;if(!(s.slotStart-i.slotEnd>.5))continue;const n=i.horizontal?a.drawLine(i.levelEnd,i.slotEnd,i.levelEnd,s.slotStart,l,h,c):a.drawLine(i.slotEnd,i.levelEnd,s.slotStart,i.levelEnd,l,h,c);n.node.classList.add("apexcharts-waterfall-connector"),o.add(n),d++}}if(!d)return;o.attr("clip-path",`url(#gridRectBarMask${i.globals.cuid})`);const u=n.node.querySelector(".apexcharts-xaxis");u?n.node.insertBefore(o.node,u):n.add(o),this.holdUntilBarsLand(o)}removeConnectors(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-waterfall-connectors");e&&e.parentNode&&e.parentNode.removeChild(e)}holdUntilBarsLand(t){const e=this.w;f.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),At("dumbbell",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.dumbbellRawSeries||(n.dumbbellRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=n.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},t;const a=null==(i=s.xaxis)?void 0:i.categories,c=n.collapsedSeriesIndices||[],{xs:h,rows:d,byX:u}=function(t,e){var i;const s=[],n=[],r=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(i=t[l])?void 0:i.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:i,y:a,rest:l}=Bt(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,s.length),s.push(i),n.push(o({},l)));const u=r.get(d);h.set(u,p.parseNumber(a))}a.push(h)}return{xs:s,rows:n,byX:a}}(r,a),g=[],f=[],m=[];for(let t=0;t<r.length;t++)-1===c.indexOf(t)&&m.push(t);const x=[];for(let t=0;t<h.length;t++){const e=[];for(let i=0;i<r.length;i++){const s=u[i].has(t)?u[i].get(t):null;e.push(null!=s&&isFinite(s)?s:null)}g.push(e);let i=null,s=null,n=-1,a=-1;for(let t=0;t<m.length;t++){const r=m[t],o=e[r];null!==o&&((null===i||o<i)&&(i=o,n=r),(null===s||o>s)&&(s=o,a=r))}null!==i&&null!==s?(f.push([n,a]),x.push(l(o({},d[t]),{x:h[t],y:[i,s]}))):(f.push(null),x.push(l(o({},d[t]),{x:h[t],y:null})))}e.dumbbellData={form:"series",names:r.map((t,e)=>{var i;return null!=(i=null==t?void 0:t.name)?i:`Series ${e+1}`}),values:g,order:f,carrier:m.length?m[0]:0,hidden:r.map((t,e)=>e).filter(t=>-1!==c.indexOf(t))};const y=e.dumbbellData.carrier;return r.map((t,e)=>l(o({},t),{data:e===y&&m.length?x:[]}))});const zt=["wiggle","silhouette","zero","expand"],Wt=["inside-out","inverse","none"];function Yt(t,e,i){const s=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:s,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:s,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:s,y:t.y,rest:t}:{x:s,y:t,rest:{}}}At("streamgraph",function(t,e){var i,s;const n=e.config,r=e.globals;if(!Array.isArray(t))return t;r.streamgraphRawSeries||(r.streamgraphRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const a=r.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],s=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(s)&&2===s.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(i=n.plotOptions)?void 0:i.streamgraph)||{},h=-1!==zt.indexOf(c.offset)?c.offset:"wiggle",d=-1!==Wt.indexOf(c.order)?c.order:"inside-out",u=null==(s=n.xaxis)?void 0:s.categories,g=r.collapsedSeriesIndices||[],{xs:f,rows:m,grids:x}=function(t,e){var i;const s=[],n=[],r=new Map,a=[];for(let l=0;l<t.length;l++){const c=Array.isArray(null==(i=t[l])?void 0:i.data)?t[l].data:[],h=new Map;for(let t=0;t<c.length;t++){const{x:i,y:a,rest:l}=Yt(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,s.length),s.push(i),n.push(o({},l))),h.set(r.get(d),p.parseNumber(a))}a.push(h)}return{xs:s,rows:n,grids:a}}(a,u),y=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i]instanceof Date?t[i].getTime():t[i];if("number"!=typeof s||!isFinite(s))return null;e.push(i)}const i=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));i.sort((t,e)=>t.v-e.v);const s=i.map(t=>t.j);for(let t=0;t<s.length;t++)if(s[t]!==t)return s;return null}(f),b=y?y.map(t=>f[t]):f,w=y?y.map(t=>m[t]):m,v=b.length;let A=!1;const _=[];for(let t=0;t<a.length;t++){const e=new Array(v);for(let i=0;i<v;i++){const s=x[t].get(y?y[i]:i);let n=null==s?0:Number(s);isFinite(n)||(n=0),n<0&&(A=!0,n=0),e[i]=n}_.push(e)}A&&!r.streamgraphWarnedNegative&&(r.streamgraphWarnedNegative=!0);const S=[];for(let t=0;t<a.length;t++)-1===g.indexOf(t)&&S.push(t);let C=_;if("expand"===h){C=_.map(t=>t.slice());for(let t=0;t<v;t++){let e=0;for(let i=0;i<S.length;i++)e+=C[S[i]][t];if(e)for(let i=0;i<S.length;i++)C[S[i]][t]/=e}}const E=function(t,e,i){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const s={},n={};for(let t=0;t<e.length;t++){const r=e[t],a=i[r];let o=0,l=-1/0,c=0;for(let t=0;t<a.length;t++)o+=a[t],a[t]>l&&(l=a[t],c=t);s[r]=o,n[r]=c}const r=e.slice().sort((t,e)=>n[t]-n[e]||t-e);let a=0,o=0;const l=[],c=[];for(let t=0;t<r.length;t++){const e=r[t];a<o?(a+=s[e],l.push(e)):(o+=s[e],c.push(e))}return c.reverse().concat(l)}(d,S,C),k=function(t,e,i,s){const n=new Array(s).fill(0);if(0===s||0===e.length)return n;if("zero"===t||"expand"===t)return n;if("silhouette"===t){for(let t=0;t<s;t++){let s=0;for(let n=0;n<e.length;n++)s+=i[e[n]][t];n[t]=-s/2}return n}let r=0;for(let t=1;t<s;t++){let s=0,a=0;for(let n=0;n<e.length;n++){const r=i[e[n]],o=r[t];let l=(o-r[t-1])/2;for(let s=0;s<n;s++){const n=i[e[s]];l+=n[t]-n[t-1]}s+=o,a+=l*o}s&&(r-=a/s),n[t]=r}return n}(h,E,C,v),M=a.map(()=>null),I=a.map(()=>null);for(let t=0;t<E.length;t++)M[E[t]]=new Array(v),I[E[t]]=new Array(v);for(let t=0;t<v;t++){let e=k[t];for(let i=0;i<E.length;i++){const s=E[i],n=M[s],r=I[s];n[t]=e,e+=C[s][t],r[t]=e}}return e.streamgraphData={names:a.map((t,e)=>{var i;return null!=(i=null==t?void 0:t.name)?i:`Series ${e+1}`}),xs:b,values:_,lows:M,highs:I,order:E,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},a.map((t,e)=>{const i=M[e],s=I[e];if(!i||!s)return l(o({},t),{data:[]});const n=new Array(v);for(let t=0;t<v;t++)n[t]=l(o({},w[t]),{x:b[t],y:[i[t],s[t]]});return l(o({},t),{data:n})})}),h.default.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const i=this.w,s=i.globals,n=i.layout.gridHeight,r=s.maxY-s.minY;if(!r||!isFinite(r))return n/2;const a=(t-s.minY)/r;return(null==(e=i.config.yaxis[0])?void 0:e.reversed)?a*n:n-a*n}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,i,s,n,r,a;const o=this.w;if(!this.isActive())return;const l=null==(e=null==(t=o.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const c=o.dom.elGraphical,h=o.streamgraphData;if(!c||!h)return;this.removeLabels();const d=new v(o,this.ctx),u=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(i=l.style)?void 0:i.fontSize)||"auto",p=(null==(s=l.style)?void 0:s.fontFamily)||o.config.chart.fontFamily,f=(null==(n=l.style)?void 0:n.fontWeight)||600,m=null==l.minWidth?24:l.minWidth,x=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],i=this._placeLabel(e,{fontSize:g,fontFamily:p,fontWeight:f,minWidth:m,graphics:d});i&&x.push(i)}let y=0;for(const t of this._deconflict(x)){const e=t.k,i=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:p,fontWeight:f,foreColor:(null==(a=null==(r=l.style)?void 0:r.colors)?void 0:a[e])||t.color,cssClass:"apexcharts-streamgraph-label"});i.node.setAttribute("data:realIndex",String(e)),u.add(i),y++}if(!y)return;const b=c.node.querySelector(".apexcharts-xaxis");b?c.node.insertBefore(u.node,b):c.add(u),this.holdUntilBandsLand(u)}_placeLabel(t,{fontSize:e,fontFamily:i,fontWeight:s,minWidth:n,graphics:r}){const a=this.w,o=a.streamgraphData,l=o.lows[t],c=o.highs[t];if(!l||!c)return null;const h=a.globals.seriesXvalues[t],d=l.length;if(!Array.isArray(h)||h.length<d||0===d)return null;const u=new Array(d);let g=0;for(let t=0;t<d;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));u[t]=e,e>g&&(g=e)}if(g<=0)return null;const p=this._resolveFontSize(e,g),f=String(o.names[t]);let m=p,x=r.getTextRects(f,`${m}px`,i,"",!0,s);if(g<x.height+6)return null;const y=this._widestRun(u,h,x.height+6,d);if(!y)return null;if(x.width>y.width&&"auto"===e){const t=Math.floor(m*(y.width/x.width));if(t<this._autoBounds().min)return null;if(m=t,x=r.getTextRects(f,`${m}px`,i,"",!0,s),g<x.height+6)return null}const b=x.height+6,w=[];for(const e of this._runs(u,b,d)){const s=Number(h[e.l]),a=Number(h[e.r]);if(!isFinite(s)||!isFinite(a))continue;let o=a-s;if(o<=0&&d>1){const t=Math.abs(Number(h[Math.min(e.r+1,d-1)])-Number(h[Math.max(e.l-1,0)]));o=isFinite(t)?t:0}if(o<n||o<.35*x.width)continue;const u=x.width<=o?f:r.getTextBasedOnMaxWidth({text:f,maxWidth:o,fontSize:`${m}px`,fontFamily:i});if(!u||"..."===u)continue;const g=u===f?x.width:x.width*(u.length/f.length),p=[s+o/2];o>2.2*g&&p.push(s+g/2+2,a-g/2-2);for(const i of p){let s=e.l,n=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-i);e<n&&(n=e,s=t)}w.push({x:i,y:(this._yPx(l[s])+this._yPx(c[s]))/2,text:u,color:this._contrastOn(t),fontSize:`${m}px`,width:g,height:x.height})}if(w.length>=6)break}return w.length?{k:t,weight:g,candidates:w}:null}_runs(t,e,i){const s=[];let n=0;for(;n<i;){if(t[n]<e){n++;continue}let r=n,a=t[n];for(;r+1<i&&t[r+1]>=e;)r++,t[r]>a&&(a=t[r]);s.push({l:n,r:r,maxT:a}),n=r+1}return s.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,i,s){let n=-1;for(const r of this._runs(t,i,s)){const t=Number(e[r.r])-Number(e[r.l]);isFinite(t)&&t>n&&(n=t)}return n>=0?{width:n}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),i=[],s=t=>!i.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const n={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(s(n)){i.push(l(o({k:t.k},e),{box:n}));break}}return i}_autoBounds(){var t,e;const i=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==i.minFontSize?9:i.minFontSize,max:null==i.maxFontSize?30:i.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:i,max:s}=this._autoBounds();return Math.max(i,Math.min(s,Math.round(.36*e)))}_contrastOn(t){var e;const i=this.w,s=null==(e=i.globals.colors)?void 0:e[t],n="string"==typeof s?p.parseHex(s):null;return n?p.relativeLuminance(n)>.45?"#000000":"#ffffff":i.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!f.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,i=e.streamgraphData;if(!i||!i.order.length)return-1;const s=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!s)return-1;const n=s.getBoundingClientRect(),r=e.globals.svgWidth?n.width/e.globals.svgWidth:1,a=X.screenXToPlotPx(e,t.clientX),o=(t.clientY-n.top)/(r||1)-e.layout.translateY;if(a<0||a>e.layout.gridWidth)return-1;if(o<0||o>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[i.order[0]];if(!Array.isArray(l)||!l.length)return-1;const c=e.interact?e.interact.capturedDataPointIndex:-1;let h=-1;if(c>=0&&c<l.length)h=c;else{let t=1/0;for(let e=0;e<l.length;e++){const i=Math.abs(Number(l[e])-a);i<t&&(t=i,h=e)}}if(h<0)return-1;let d=-1,u=1/0;for(let t=0;t<i.order.length;t++){const e=i.order[t],s=this._yPx(i.highs[e][h]),n=this._yPx(i.lows[e][h]),r=Math.min(s,n),a=Math.max(s,n);if(o>=r&&o<=a)return e;const l=o<r?r-o:o-a;l<u&&(u=l,d=e)}return d}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const i=this._hoverCfg(),s=null==i.opacity?.35:i.opacity,n=e.dom.baseEl.querySelectorAll(".apexcharts-series"),r=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(e,i)=>t<0||i===t;for(let t=0;t<n.length;t++){const e=n[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(s)}for(let t=0;t<r.length;t++){const i=r[t];i.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(i.getAttribute("data:realIndex")))?this._restoreLabel(i):(i.getAttribute("data:fill")||i.setAttribute("data:fill",i.getAttribute("fill")||""),i.setAttribute("fill",e.config.chart.foreColor),i.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const i=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<i.length;t++)this._restoreLabel(i[t])}holdUntilBandsLand(t){const e=this.w;f.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});