apexcharts 8.2.0 → 8.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.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +271 -173
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +35 -0
- package/dist/apexcharts.esm.js +1722 -1527
- package/dist/apexcharts.full.js +1459 -1075
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +994 -715
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +994 -715
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +433 -394
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +364 -322
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +364 -322
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +433 -394
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +271 -173
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +433 -394
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +250 -187
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +63 -43
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +3 -2
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +92 -2
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +83 -47
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +950 -795
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +433 -394
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +54 -38
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +72 -26
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +433 -394
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +93 -41
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +103 -93
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +105 -86
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +432 -393
- package/package.json +1 -1
- package/src/apexcharts.js +13 -6
- package/src/assets/apexcharts.css +35 -0
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +37 -37
- package/src/charts/Line.js +118 -42
- package/src/charts/Radar.js +5 -7
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +108 -66
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +8 -1
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Graphics.js +62 -49
- package/src/modules/Markers.js +3 -1
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +39 -18
- package/src/modules/Theme.js +1 -1
- package/src/modules/ZoomPanSelection.js +119 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +2 -0
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/settings/Options.js +7 -0
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Tooltip.js +20 -4
- package/src/modules/tooltip/Utils.js +8 -0
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/types/internal.d.ts +9 -3
- package/types/apexcharts.d.ts +31 -12
package/dist/full.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,o=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&a(t,i,e[i]);if(n)for(var i of n(e))r.call(e,i)&&a(t,i,e[i]);return t},l=(t,n)=>e(t,i(n)),c=(t,e)=>{var i={};for(var a in t)s.call(t,a)&&e.indexOf(a)<0&&(i[a]=t[a]);if(null!=t&&n)for(var a of n(t))e.indexOf(a)<0&&r.call(t,a)&&(i[a]=t[a]);return i},h=(t,e,i)=>new Promise((n,s)=>{var r=t=>{try{o(i.next(t))}catch(t){s(t)}},a=t=>{try{o(i.throw(t))}catch(t){s(t)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(r,a);o((i=i.apply(t,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("apexcharts"),d=require("apexcharts/core");function p(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 n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const f=(t=>t&&t.__esModule?t:{default:t})(u),g=p(d),m=g.__apex_CoreUtils,y=g.__apex_ChartFactory_getChartClass,x=g.__apex_Fill,_=g.__apex_Graphics,b=g.__apex_Series,v=g.__apex_Utils,w=t=>{const e=function(t){const e=[];let i=t[0],n=t[1],s=e[0]=M(i,n),r=1;for(let a=t.length-1;r<a;r++)i=n,n=t[r+1],e[r]=.5*(s+(s=M(i,n)));return e[r]=s,e}(t),i=t.length-1,n=[];let s,r,a,o;for(let n=0;n<i;n++)a=M(t[n],t[n+1]),Math.abs(a)<1e-6?e[n]=e[n+1]=0:(s=e[n]/a,r=e[n+1]/a,o=s*s+r*r,o>9&&(o=3*a/Math.sqrt(o),e[n]=o*s,e[n+1]=o*r));for(let s=0;s<=i;s++)o=(t[Math.min(i,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+e[s]*e[s])),n.push([o||0,e[s]*o||0]);return n},A={points(t){const e=w(t),i=t[1],n=t[0],s=[],r=e[1],a=e[0];s.push(n,[n[0]+a[0],n[1]+a[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,n=e.length;i<n;i++){const n=t[i],r=e[i];s.push([n[0]-r[0],n[1]-r[1],n[0],n[1]])}return s},slice(t,e,i){const n=t.slice(e,i);if(e){if(i-e>1&&n[1].length<6){const t=n[0].length;n[1]=[2*n[0][t-2]-n[0][t-4],2*n[0][t-1]-n[0][t-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n}};function M(t,e){return(e[1]-t[1])/(e[0]-t[0])}function k({graphics:t,w:e,elSeries:i,pointsByCat:n,options:s,distributed:r,realIndex:a,wrapClass:o,pointClass:l}){if(!s||!1===s.show||!n.length)return;const c=null!=s.opacity?s.opacity:.9,h=null!=s.strokeColor?s.strokeColor:"#fff",u=null!=s.strokeWidth?s.strokeWidth:1,d=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:d?`${o} apexcharts-element-hidden`:o});d&&e.globals.delayedElements.push({el:p.node}),n.forEach(({groups:i,j:n})=>{const o=r?e.globals.colors[n]:e.globals.colors[a],d=s.fillColor,f="series"===d?o:"series-dark"===d?L(o,.45):d||L(o,.45);i.forEach(i=>{const s=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:f,stroke:u>0?h:"none",strokeWidth:u,fillOpacity:c,classes:l});s.attr("data:realIndex",a),s.attr("j",n),s.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),s.node.style.pointerEvents="none",p.add(s)})}),i.add(p)}function L(t,e){const i=v.parseHex(t);if(!i)return t;const n=Math.max(0,1-e);return`rgb(${Math.round(i[0]*n)},${Math.round(i[1]*n)},${Math.round(i[2]*n)})`}function S(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),n=Math.floor(i),s=i-n,r=v.parseHex(t[n])||[0,0,0],a=v.parseHex(t[Math.min(n+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*s);return`rgb(${o(r[0],a[0])},${o(r[1],a[1])},${o(r[2],a[2])})`}function C(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function E(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function F(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const P=class{};class D extends P{constructor(t,e,i){!function(){const t=y("bar");if(Object.getPrototypeOf(D)===t)return;Object.setPrototypeOf(D,t),Object.setPrototypeOf(D.prototype,t.prototype)}(),super(t,e,i)}draw(t,e,i){var n,s,r;const a=this.w,o=new _(this.w),l=new x(this.w);this.violinOptions=a.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.boxOptions=this.violinOptions.box||{},this.cloudSign=T(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:T(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?N(this.boxOptions.width,.15):0,this.rainFrac=N(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=a.config.plotOptions.bar.distributed,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.coreUtils=new m(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=o.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let h,u;const d=[],p=[],f=a.globals.comboCharts?i[e]:e,{columnGroupIndex:g}=this.barHelpers.getGroupIndex(f),m=o.group({class:"apexcharts-series",seriesName:v.escapeString(a.seriesData.seriesNames[f]),rel:e+1,"data:realIndex":f});b.addCollapsedClassToSeries(this.w,m,f),t[e].length>0&&(this.visibleI=this.visibleI+1);const y=this.setSeriesAxis(f),x=this.barHelpers.initialPositions(f),{y:_,barHeight:w,yDivision:A,zeroW:M,x:L,barWidth:S,xDivision:C,zeroH:E}=x;u=_,h=L,p.push(h+(null!=S?S:0)/2);const F=o.group({class:"apexcharts-datalabels","data:realIndex":f});if(this.seriesMaxWeight=0,"group"===this.normalize){(a.violinData.seriesViolinDensity[f]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const P=[];for(let i=0;i<a.globals.dataPoints;i++){const o=this.barHelpers.getStrokeWidth(e,i,f),c=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:i,realIndex:f,translationsIndex:y},y:u,yDivision:A,barHeight:w,zeroW:M}):this.drawVerticalViolin({indexes:{i:e,j:i,realIndex:f,translationsIndex:y},x:h,xDivision:C,barWidth:S,zeroH:E});h=c.x,u=c.y,i>0&&p.push(c.center),d.push(c.alongRepresentative);const x=this.buildPointsSubPath({realIndex:f,j:i,center:c.center,halfExtent:c.halfExtent,alongFn:c.alongFn,density:c.density,maxWeight:c.maxWeight,cloudBase:c.cloudBase,cloudMaxPx:c.cloudMaxPx,rainCenter:c.rainCenter,rainHalfPx:c.rainHalfPx});x.length&&P.push({groups:x,j:i});const _=l.fillPath({seriesNumber:this.distributed?i:f,dataPointIndex:i,color:this.distributed?a.globals.colors[i]:void 0,value:t[e][i]});this.renderSeries({realIndex:f,pathFill:_,lineFill:a.globals.stroke.colors[f],j:i,i:e,pathFrom:c.pathFrom,pathTo:c.pathTo,strokeWidth:o,elSeries:m,x:h,y:u,series:t,columnGroupIndex:g,barHeight:w,barWidth:S,elDataLabelsWrap:F,visibleSeries:this.visibleI,type:"violin"});const b=m.node.querySelector(`path.apexcharts-violin-area[j='${i}']`);if(b&&isFinite(c.alongRepresentative)&&b.setAttribute(this.isHorizontal?"cx":"cy",`${c.alongRepresentative}`),b&&b.setAttribute("data:center",`${c.center}`),c.boxPaths){const s=null!=(n=this.boxOptions.strokeWidth)?n:1;c.boxPaths.forEach(n=>{this.renderSeries({realIndex:f,pathFill:n.filled?this.boxOptions.fillColor||_:"none",lineFill:a.globals.stroke.colors[f],j:i,i:e,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:s,elSeries:m,x:h,y:u,series:t,columnGroupIndex:g,barHeight:w,barWidth:S,elDataLabelsWrap:F,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box"})})}const v=!b&&(null==(r=null==(s=a.globals.barCanvasCoords)?void 0:s[f])?void 0:r[i]);v&&isFinite(c.alongRepresentative)&&(this.isHorizontal?v.cx=c.alongRepresentative:(v.bodyCx=v.cx,v.cx=c.center,v.cy=c.alongRepresentative))}k({graphics:o,w:a,elSeries:m,pointsByCat:P,options:this.pointsOptions,distributed:this.distributed,realIndex:f,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),a.globals.seriesXvalues[f]=p,a.globals.seriesYvalues[f]=d,c.add(m)}return c}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:n,zeroH:s}){var r,a,o,l,c,h,u;const d=this.w,{realIndex:p,j:f,translationsIndex:g}=t,m=this.yRatio[g];d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[p][f]-d.globals.minX)/this.xRatio-n/2);const y=e+n*this.visibleI+n/2,x=n/2,_=this.getDensity(p,f),b=this.effectiveMaxWeight(_),v=t=>s-this.logVal(t,p)/m,w=O({halfExtent:x,cloudSign:null!=(r=this.cloudSign)?r:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(o=this.boxFrac)?o:0,rainFrac:null!=(l=this.rainFrac)?l:0}),A=y+w.cloudBaseOff,M=this.buildBodyPath({nodes:_.nodes,center:A,halfExtent:w.cloudMaxPx,maxWeight:b,vertical:!0,alongFn:v,collapsed:!1,sideSign:this.cloudSign});let k=null;const L=null==(h=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:h.getInitialPathFor(p,f);return L?k=L:d.globals.previousPaths.length>0&&(k=this.getPreviousPath(p,f,M)),null==k&&(k=this.buildBodyPath({nodes:_.nodes,center:A,halfExtent:w.cloudMaxPx,maxWeight:b,vertical:!0,alongFn:v,collapsed:!0,sideSign:this.cloudSign})),d.axisFlags.isXNumeric||(e+=i),{pathTo:M,pathFrom:k,x:e,y:s,center:y,halfExtent:x,alongFn:v,density:_,maxWeight:b,cloudBase:A,cloudMaxPx:w.cloudMaxPx,rainCenter:y+w.rainCenterOff,rainHalfPx:w.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:f,boxCenter:y+w.boxCenterOff,boxHalfPx:w.boxHalfPx,alongFn:v,vertical:!0}),alongRepresentative:v(null!=(u=this.series[t.i][f])?u:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:n,zeroW:s}){var r,a,o,l,c,h,u;const d=this.w,{realIndex:p,j:f}=t,g=this.invertedYRatio,m=e+n*this.visibleI+n/2,y=n/2,x=this.getDensity(p,f),_=this.effectiveMaxWeight(x),b=t=>s+this.logVal(t,p)/g,v=O({halfExtent:y,cloudSign:null!=(r=this.cloudSign)?r:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(o=this.boxFrac)?o:0,rainFrac:null!=(l=this.rainFrac)?l:0}),w=m+v.cloudBaseOff,A=this.buildBodyPath({nodes:x.nodes,center:w,halfExtent:v.cloudMaxPx,maxWeight:_,vertical:!1,alongFn:b,collapsed:!1,sideSign:this.cloudSign});let M=null;const k=null==(h=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:h.getInitialPathFor(p,f);return k?M=k:d.globals.previousPaths.length>0&&(M=this.getPreviousPath(p,f,A)),null==M&&(M=this.buildBodyPath({nodes:x.nodes,center:w,halfExtent:v.cloudMaxPx,maxWeight:_,vertical:!1,alongFn:b,collapsed:!0,sideSign:this.cloudSign})),{pathTo:A,pathFrom:M,x:s,y:e+=i,center:m,halfExtent:y,alongFn:b,maxWeight:_,density:x,cloudBase:w,cloudMaxPx:v.cloudMaxPx,rainCenter:m+v.rainCenterOff,rainHalfPx:v.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:f,boxCenter:m+v.boxCenterOff,boxHalfPx:v.boxHalfPx,alongFn:b,vertical:!1}),alongRepresentative:b(null!=(u=this.series[t.i][f])?u:0)}}getDensity(t,e){var i;const n=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!n||!n.values.length)return{nodes:[],maxWeight:0};const s=n.values.map((t,e)=>e);s.sort((t,e)=>n.values[t]-n.values[e]);const r=[];let a=null;for(const t of s){const e=n.values[t];null!==a&&e===a||(r.push({v:e,w:n.weights[t]}),a=e)}return{nodes:r,maxWeight:n.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:n,vertical:s,alongFn:r,collapsed:a,sideSign:o=0}){const l=new _(this.w);if(0===t.length){const t=r(0);return s?l.move(e,t)+l.line(e,t):l.move(t,e)+l.line(t,e)}const c=t=>{if(a||n<=0)return 0;const e=t/n*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},h=[],u=[];for(let i=0;i<t.length;i++){const n=r(t[i].v),a=c(t[i].w),l=0===o?e+a:e+o*a,d=0===o?e-a:e;s?(h.push([l,n]),u.push([d,n])):(h.push([n,l]),u.push([n,d]))}return u.reverse(),this.smoothSegment(h,s,!1)+this.smoothSegment(u,s,!0)+"z"}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:n,alongFn:s,vertical:r}){var a,o;const l=this.w;if(!this.boxShown||n<=0)return null;const c=null==(a=l.violinData.seriesViolinSummary[t])?void 0:a[e];if(!c)return null;const h=n*Math.min(1,Math.max(0,null!=(o=this.boxOptions.capWidth)?o:.5)),[u,d,p,f,g]=c.map(t=>s(t)),m=(t,e)=>{const n=new _(this.w),s=(t,e)=>r?[t,e]:[e,t],a=t=>t.map(([t,e],i)=>0===i?n.move(t,e):n.line(t,e)).join(""),o=i;return{whiskers:a([s(o,u),s(o,d)])+a([s(o,f),s(o,g)])+a([s(o-t,u),s(o+t,u)])+a([s(o-t,g),s(o+t,g)]),box:a([s(o-e,d),s(o+e,d),s(o+e,f),s(o-e,f)])+"z"+a([s(o-e,p),s(o+e,p)])}},y=m(h,n),x=m(0,0),b=(i,n)=>{let s=null;return l.globals.previousPaths.length>0&&(s=this.getPreviousPath(t,e,i)),null==s?n:s};return[{pathTo:y.whiskers,pathFrom:b(y.whiskers,x.whiskers),filled:!1},{pathTo:y.box,pathFrom:b(y.box,x.box),filled:!0}]}smoothSegment(t,e,i){const n=new _(this.w),s=t[0];let r=i?n.line(s[0],s[1]):n.move(s[0],s[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=n.line(t[e][0],t[e][1]);return r}const a=t.map(([t,i])=>e?[i,t]:[t,i]),o=A.points(a);return r+=(t=>{let e="";for(let i=0;i<t.length;i++){const n=t[i],s=n.length;s>4?(e+=`C${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`,e+=`, ${n[4]}, ${n[5]}`):s>2&&(e+=`S${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`)}return e})(e?o.map(R):o),r}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:n,alongFn:s,density:r,maxWeight:a,cloudBase:o,cloudMaxPx:l,rainCenter:c,rainHalfPx:h}){var u;const d=0!==this.rainSign,p=d?c:0!==this.cloudSign?o:i,f=d?h:0!==this.cloudSign?l:n;return function({w:t,points:e,seedA:i,seedB:n,center:s,halfExtent:r,alongFn:a,isHorizontal:o,options:l,clampAt:c,sideSign:h}){const u=l;if(!u||!1===u.show)return[];if(!e||!e.length)return[];const d=u.maxPoints||3e3,p=e.length>d?Math.ceil(e.length/d):1,f=null!=u.size?u.size:2.5,g=r*(null!=u.jitter?u.jitter:.5),m=!1!==u.constrainToViolin&&"function"==typeof c,y="square"===u.shape,x=u.colorScale,_=x&&Array.isArray(x.colors)&&x.colors.length>0,b=_?Math.max(2,x.steps||24):1,v=_&&null!=x.min?x.min:t.globals.minY,w=(_&&null!=x.max?x.max:t.globals.maxY)-v||1,A=_?new Array(b).fill(""):[""];for(let t=0;t<e.length;t+=p){const r=e[t],l=a(r);let u=2*(C(7919*i+100003*n+t)-.5)*g;if(m){const t=c(r);u>t&&(u=t),u<-t&&(u=-t)}h&&(u=Math.abs(u)*h);const d=o?l:s+u,p=o?s+u:l,x=y?F(d,p,f):E(d,p,f);if(_){let t=(r-v)/w;t<0&&(t=0),t>1&&(t=1),A[Math.round(t*(b-1))]+=x}else A[0]+=x}if(!_)return A[0]?[{fill:null,d:A[0]}]:[];const M=[];for(let t=0;t<b;t++)A[t]&&M.push({fill:S(x.colors,t/(b-1)),d:A[t]});return M}({w:this.w,points:null==(u=this.w.violinData.seriesViolinPoints[t])?void 0:u[e],seedA:t,seedB:e,center:p,halfExtent:f,alongFn:s,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:d?null:t=>this.halfWidthAtValue(t,r,f,a),sideSign:d?0:this.cloudSign})}halfWidthAtValue(t,e,i,n){const{nodes:s}=e,r=null!=n?n:e.maxWeight;if(!s.length||r<=0)return 0;const a=t=>Math.min(i,t/r*i*this.bandwidthScale);if(t<=s[0].v)return a(s[0].w);if(t>=s[s.length-1].v)return a(s[s.length-1].w);for(let e=1;e<s.length;e++)if(t<=s[e].v){const i=s[e-1],n=s[e],r=n.v===i.v?0:(t-i.v)/(n.v-i.v);return a(i.w+(n.w-i.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function R(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function T(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function N(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function O({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:n,rainFrac:s}){const r=n*t,a=0===i?t:s*t,o=0===i?0:i*(t-a);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:r,rainCenterOff:o,rainHalfPx:a};const l=0===i?0:s,c=2*Math.max(0,1-l-n)*t,h=e*(t-c);return{cloudBaseOff:h,cloudMaxPx:c,boxCenterOff:h-e*r,boxHalfPx:r,rainCenterOff:o,rainHalfPx:a}}g.default.use({violin:D});const $=globalThis.console;function I(t,...e){$.error(t,...e)}function B(t){$.warn(t)}const z="APEX-",W=new Date("2027-07-31T00:00:00Z"),H="__apex_license_v1__";function j(){const t=globalThis;let e=t[H];return e||(e={key:null,listeners:new Set,result:null},t[H]=e),e}const Y=class{static get licenseKey(){return j().key}static set licenseKey(t){j().key=t}static get listeners(){return j().listeners}static get validationResult(){return j().result}static set validationResult(t){j().result=t}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(t){return!!t&&this.validateKey(t).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}static setLicense(t){var e,i;if(!t)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});const n=this.validateKey(t);n.valid||t===this.licenseKey||!(null==(i=this.validationResult)?void 0:i.valid)?(this.licenseKey=t,this.publish(n),n.valid||I(`[Apex] ${n.message}`)):B(`[Apex] Ignoring license key: ${null!=(e=n.message)?e:"it is not valid"} A valid license is already active on this page.`)}static validateKey(t){const e=this.parseKey(t),i=this.validateStructure(t,e);if(!i.valid||!(null==e?void 0:e.signature))return i;const n=this.verdicts.get(t);return!1===n?{data:e.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===n&&this.verifySignature(t,e,i),l(o({},i),{signatureVerified:!0===n}))}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnverifiable=!1,this.epoch++}static base64ToBytes(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(4*Math.ceil(e.length/4),"="),n=globalThis.atob;if("function"!=typeof n)throw new Error("no base64 decoder available");const s=n(i),r=new Uint8Array(s.length);for(let t=0;t<s.length;t++)r[t]=s.charCodeAt(t);return r}static canonicalPayload(t){const e=t.domains&&t.domains.length>0?t.domains.join(","):"";return`v1|${t.issueDate}|${t.expiryDate}|${t.plan}|${e}`}static notify(t){for(const e of this.listeners)try{e(t)}catch(t){}}static parseKey(t){if("string"!=typeof t||!t.startsWith(z))return null;const e=t.slice(5);if(!e)return null;try{const t=(new TextDecoder).decode(this.base64ToBytes(e)),i=JSON.parse(t);return i.issueDate&&i.expiryDate&&i.plan?{data:{domains:Array.isArray(i.domains)?i.domains:void 0,expiryDate:i.expiryDate,issueDate:i.issueDate,plan:i.plan,valid:!0},signature:"string"==typeof i.sig&&i.sig?i.sig:null}:null}catch(t){return null}}static publish(t){this.validationResult=t,this.notify(t)}static validateStructure(t,e){const i=t=>({expired:!1,message:t,signatureVerified:!1,valid:!1});if("string"!=typeof t||!t.startsWith(z))return i('Invalid license key format. License key must start with "APEX-".');if(!e)return i("Invalid license key. Unable to decode license data.");const{data:n,signature:s}=e;if(!s&&new Date>=W)return i("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(n.expiryDate)<new Date)return{data:n,expired:!0,message:`License expired on ${n.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(n.domains&&n.domains.length>0){const t="undefined"==typeof location?"":location.hostname;if(!n.domains.some(e=>t===e||t.endsWith(`.${e}`)))return{data:n,expired:!1,message:`License is not valid for this domain (${t}). Allowed domains: ${n.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:n,expired:!1,signatureVerified:!1,valid:!0}}static verifySignature(t,e,i){return h(this,null,function*(){var n;if(this.verifying.has(t)||this.verdicts.has(t))return;this.verifying.add(t);const s=this.epoch,r=null==(n=globalThis.crypto)?void 0:n.subtle;if(!r||0===this.publicKeysSpki.length)return this.verifying.delete(t),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,B(r?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.")));const a=(new TextEncoder).encode(this.canonicalPayload(e.data));let c=!1;for(const t of this.publicKeysSpki){try{const i=yield r.importKey("spki",this.base64ToBytes(t),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);c=yield r.verify({hash:"SHA-256",name:"ECDSA"},i,this.base64ToBytes(e.signature),a)}catch(t){c=!1}if(c)break}if(this.verifying.delete(t),this.epoch!==s)return;if(this.verdicts.set(t,c),c){const e=l(o({},i),{signatureVerified:!0});return void(this.licenseKey===t?this.publish(e):this.notify(e))}const h="Invalid license key. The license signature does not verify.",u={data:e.data,expired:!1,message:h,signatureVerified:!0,valid:!1};this.licenseKey===t?this.publish(u):this.notify(u),I(`[Apex] ${h}`)})}};Y.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],Y.verdicts=new Map,Y.verifying=new Set,Y.warnedUnverifiable=!1,Y.epoch=0;let q=Y;function X(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const n=(i-1)*e,s=Math.floor(n),r=Math.ceil(n);return s===r?t[s]:t[s]+(t[r]-t[s])*(n-s)}function G(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let n=i[0],s=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(n=t,s=e)}if(!(s>n)){const t=Math.abs(n)>0?.05*Math.abs(n):.5;return{edges:[n-t,n+t],binWidth:2*t,rule:"single",capped:!1}}const a=s-n;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 n=t.length,s=t=>e/Math.max(1,Math.ceil(t)),r=()=>s(Math.log2(n)+1);switch(i){case"sqrt":return{width:s(Math.sqrt(n)),rule:"sqrt"};case"rice":return{width:s(2*Math.cbrt(n)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let n=0;n<e;n++)i+=t[n];const n=i/e;let s=0;for(let i=0;i<e;i++){const e=t[i]-n;s+=e*e}return Math.sqrt(s/e)}(t);return e>0?{width:3.49*e*Math.pow(n,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=X(t,.75)-X(t,.25);return e>0?{width:2*e*Math.pow(n,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=X(t,.75)-X(t,.25);if(i<=0)return{width:e,rule:"sturges"};const s=2*i*Math.pow(n,-1/3);return s<e?{width:s,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,a,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!Number.isFinite(o)||o<=0)&&(o=a);let c=Math.ceil(a/o);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),o=a/c;const u=new Array(c+1);for(let t=0;t<=c;t++)u[t]=n+t*o;return u[c]=Math.max(u[c],s),{edges:u,binWidth:o,rule:l,capped:h}}function U(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const n=(e[i]-e[0])/i;if(n>0){let s=Math.floor((t-e[0])/n);return s<0&&(s=0),s>i-1&&(s=i-1),t<e[s]?s--:t>=e[s+1]&&s++,s<0||s>i-1?-1:s}let s=0,r=i-1;for(;s<=r;){const i=s+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;s=i+1}}return-1}const K=class{static applyStyles(t){Object.assign(t.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(t){return t?t.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(t,e){return t&&"undefined"!=typeof document?(this.setManaged(t,e),this.paint(t)):null}static exists(t){return!!this.node(t)}static remove(t,e){t&&(this.setManaged(t,e),this.erase(t))}static untrack(t){this.managed.delete(t)}static createWatermarkPattern(){const t=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text\n x="50%"\n y="50%"\n dominant-baseline="middle"\n text-anchor="middle"\n font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n font-size="18"\n font-weight="600"\n fill="rgba(134, 134, 134, 0.1)"\n transform="rotate(-35, 100, 60)"\n >${t}</text>\n </svg>\n `.trim())}")`}static erase(t){var e;null==(e=this.node(t))||e.remove()}static paint(t){let e=this.node(t);return e||(e=document.createElement("div"),e.setAttribute(this.WATERMARK_ATTR,""),t.appendChild(e)),this.applyStyles(e),"function"==typeof getComputedStyle&&"static"===getComputedStyle(t).position&&(t.style.position="relative"),e}static reconcile(){const t=q.isLicenseValid();for(const e of this.managed)e.isConnected?t?this.erase(e):this.paint(e):this.managed.delete(e)}static setManaged(t,e){!1!==(null==e?void 0:e.manage)?this.track(t):this.managed.delete(t)}static track(t){this.managed.add(t),this.subscribed||(this.subscribed=!0,q.onChange(()=>{this.reconcile()}))}};K.WATERMARK_ATTR="data-apexcharts-watermark",K.WATERMARK_TEXT="APEXCHARTS",K.ATTR="data-apexcharts-watermark",K.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},K.managed=new Set,K.subscribed=!1;let V=K;const Z=1/45;function Q(t,e,i,n){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function J(t,e){if(e<=0)return et(t);let i=e;for(;i>0;){const e=Math.min(i,Z),n=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=n*e,t.value+=t.velocity*e,i-=e}return!!et(t)&&(t.value=t.target,t.velocity=0,!0)}function tt(t,e){t.target=e}function et(t){var e,i;const n=null!=(e=t.restVelocity)?e:.05,s=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<n&&Math.abs(t.value-t.target)<s}const it={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const nt="__apexcharts_crossfilters__";function st(t){if(!Number.isFinite(t))return t;const e=Number(t.toPrecision(12));return Object.is(e,-0)?0:e}function rt(t){return"number"==typeof t&&Number.isFinite(t)}function at(t){if("function"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.sum){const e=t.sum;return t=>t.reduce((t,i)=>t+(Number(i[e])||0),0)}if("string"==typeof t.avg){const e=t.avg;return t=>t.length?t.reduce((t,i)=>t+(Number(i[e])||0),0)/t.length:0}if("string"==typeof t.min){const e=t.min;return t=>t.length?Math.min(...t.map(t=>Number(t[e])||0)):0}if("string"==typeof t.max){const e=t.max;return t=>t.length?Math.max(...t.map(t=>Number(t[e])||0)):0}}return t=>t.length}function ot(t,e){return"function"==typeof e?t.slice().sort(e):"asc"===e?t.slice().sort((t,e)=>t>e?1:t<e?-1:0):"desc"===e?t.slice().sort((t,e)=>t<e?1:t>e?-1:0):t}function lt(t,e){if(!rt(t))return-1;const i=e.length-1;if(t<e[0]||t>e[i])return-1;if(t===e[i])return i-1;for(let n=0;n<i;n++)if(t>=e[n]&&t<e[n+1])return n;return-1}function ct(t){const e=[];for(let i=0;i<t.length-1;i++)e.push(st((t[i]+t[i+1])/2));return e}class ht{constructor(t,e){this.dims=new Map,this.listeners=new Map,this.id=t,this.records=Array.isArray(e)?e:[]}static store(){const t=globalThis;return t[nt]||(t[nt]=new Map),t[nt]}static getOrCreate(t){if(!t||"string"!=typeof t.id)throw new Error("Crossfilter.getOrCreate requires an { id } string.");const e=ht.store(),i=e.get(t.id);if(i)return t.records&&i.setRecords(t.records),i;const n=new ht(t.id,t.records);return e.set(t.id,n),n}static get(t){return ht.store().get(t)||null}setRecords(t){return this.records=Array.isArray(t)?t:[],this.dims.forEach(t=>this.recomputeDomain(t)),this.emit("records",this.state()),this.emit("change",this.state()),this}registerDimension(t,e){if(!e||"function"!=typeof e.dimension)throw new Error(`crossfilter.registerDimension("${t}") needs a dimension function.`);const i=e.type||(e.bins?"range":"category"),n={accessor:e.dimension,reducer:at(e.reduce),type:i,bins:e.bins,order:e.order,filter:null,labels:[],edges:null,xLabels:[],yLabels:[]};return this.dims.set(t,n),this.recomputeDomain(n),null!=e.filter&&this.setFilterOn(n,e.filter),this}hasDimension(t){return this.dims.has(t)}removeDimension(t){const e=this.dims.get(t),i=!!e&&this.hasFilter(e);return this.dims.delete(t),i&&this.emit("change",this.state()),this}recomputeDomain(t){if("matrix"===t.type){const e=function(t,e,i){const n=new Set,s=new Set,r=[],a=[];for(let i=0;i<t.length;i++){const o=e(t[i]);if(!o)continue;const l=o[0],c=o[1];null==l||n.has(l)||(n.add(l),r.push(l)),null==c||s.has(c)||(s.add(c),a.push(c))}return{xLabels:ot(r,i),yLabels:ot(a,i)}}(this.records,t.accessor,t.order);return t.xLabels=e.xLabels,t.yLabels=e.yLabels,void(t.edges=null)}if("range"===t.type)return t.edges=function(t,e,i){if(i&&Array.isArray(i.thresholds)&&i.thresholds.length>=2){const t=Array.from(new Set(i.thresholds.filter(rt))).sort((t,e)=>t-e);return t.length>=2?t.map(st):[0,1]}let n=1/0,s=-1/0;for(let i=0;i<t.length;i++){const r=e(t[i]);rt(r)&&(r<n&&(n=r),r>s&&(s=r))}if(n===1/0)return[0,1];if(n===s){const t=Math.abs(n)>0?Math.abs(n):1;return[st(n),st(n+t)]}if(i&&rt(i.width)&&i.width>0){const t=i.width,e=Math.floor(n/t)*t;let r=Math.ceil(s/t)*t;r<=e&&(r=e+t);const a=Math.max(1,Math.round((r-e)/t)),o=new Array(a+1);for(let i=0;i<=a;i++)o[i]=st(e+i*t);return o}const r=i&&rt(i.count)&&i.count>=1?Math.floor(i.count):30,a=(s-n)/r,o=new Array(r+1);for(let t=0;t<=r;t++)o[t]=st(n+t*a);return o[r]=st(s),o}(this.records,t.accessor,t.bins),void(t.labels=ct(t.edges));if(t.labels=function(t,e,i){const n=new Set,s=[];for(let i=0;i<t.length;i++){const r=e(t[i]);null!=r&&(n.has(r)||(n.add(r),s.push(r)))}return ot(s,i)}(this.records,t.accessor,t.order),t.edges=null,t.filter instanceof Set){const e=new Set(t.labels);Array.from(t.filter).forEach(i=>{e.has(i)||t.filter.delete(i)})}}filter(t,e){const i=this.dims.get(t);return i?(this.setFilterOn(i,e),this.emit("change",this.state()),this):this}toggleKey(t,e){const i=this.dims.get(t);if(!i||"category"!==i.type)return this;i.filter instanceof Set||(i.filter=new Set);const n=i.filter;return n.has(e)?n.delete(e):n.add(e),0===n.size&&(i.filter=null),this.emit("change",this.state()),this}setFilterOn(t,e){if(null==e)return void(t.filter=null);if("range"===t.type){if(Array.isArray(e)&&2===e.length&&e.every(rt)){const[i,n]=e;t.filter=[Math.min(i,n),Math.max(i,n)]}else t.filter=null;return}const i=new Set(e);t.filter=i.size?i:null}clear(t){const e=this.dims.get(t);return e&&(e.filter=null),this.emit("change",this.state()),this}reset(){return this.dims.forEach(t=>{t.filter=null}),this.emit("change",this.state()),this}hasFilter(t){return null!=t.filter&&(!(t.filter instanceof Set)||t.filter.size>0)}passes(t,e){if(!this.hasFilter(t))return!0;const i=t.accessor(e);if(t.filter instanceof Set)return t.filter.has(i);if(!rt(i))return!1;const[n,s]=t.filter;return i>=n&&i<=s}filteredRecords(t){const e=[];return this.dims.forEach((i,n)=>{n!==t&&this.hasFilter(i)&&e.push(i)}),0===e.length?this.records:this.records.filter(t=>e.every(e=>this.passes(e,t)))}filteredRows(){return this.filteredRecords(null)}aggregateFor(t){const e=this.dims.get(t);if(!e)return{type:"category",labels:[],values:[],keys:[]};const i=this.filteredRecords(t);if("matrix"===e.type){const t=new Map(e.xLabels.map((t,e)=>[t,e])),n=new Map(e.yLabels.map((t,e)=>[t,e])),s=e.yLabels.map(()=>e.xLabels.map(()=>[]));for(let r=0;r<i.length;r++){const a=e.accessor(i[r]);if(!a)continue;const o=t.get(a[0]),l=n.get(a[1]);null!=o&&null!=l&&s[l][o].push(i[r])}return{type:"matrix",xLabels:e.xLabels.slice(),yLabels:e.yLabels.slice(),matrix:s.map(t=>t.map(t=>e.reducer(t)))}}if("range"===e.type){const t=e.edges||[0,1],n=t.length-1,s=Array.from({length:n},()=>[]);for(let n=0;n<i.length;n++){const r=lt(e.accessor(i[n]),t);r>=0&&s[r].push(i[n])}return{type:"range",labels:ct(t),values:s.map(t=>e.reducer(t)),keys:s.map((e,i)=>[t[i],t[i+1]]),edges:t}}const n=new Map;e.labels.forEach(t=>n.set(t,[]));for(let t=0;t<i.length;t++){const s=n.get(e.accessor(i[t]));s&&s.push(i[t])}return{type:"category",labels:e.labels.slice(),values:e.labels.map(t=>e.reducer(n.get(t)||[])),keys:e.labels.slice()}}aggregateAll(){const t={};return this.dims.forEach((e,i)=>{t[i]=this.aggregateFor(i)}),t}state(){const t={};return this.dims.forEach((e,i)=>{this.hasFilter(e)&&(t[i]=e.filter instanceof Set?Array.from(e.filter):e.filter.slice())}),{filters:t,filteredCount:this.filteredRows().length,total:this.records.length}}filterOf(t){const e=this.dims.get(t);return e&&this.hasFilter(e)?e.filter instanceof Set?new Set(e.filter):e.filter.slice():null}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>this.off(t,e)}off(t,e){var i;return null==(i=this.listeners.get(t))||i.delete(e),this}emit(t,e){var i;null==(i=this.listeners.get(t))||i.forEach(i=>{try{i(e)}catch(e){I(`[Apex] a crossfilter ${t} listener threw`,e)}})}static esc(t){return String(null==t?"":t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}resolveColumns(t){if(Array.isArray(t)&&t.length)return t.map(t=>"string"==typeof t?{field:t,label:t}:{field:t.field,label:t.label||t.field,format:t.format});const e=this.records[0];return(e?Object.keys(e):[]).map(t=>({field:t,label:t}))}tableHTML(t,e,i){const n="<thead><tr>"+t.map(t=>`<th>${ht.esc(t.label)}</th>`).join("")+"</tr></thead>",s="<tbody>"+e.map(e=>"<tr>"+t.map(t=>{const i=e[t.field],n=t.format?t.format(i,e):i;return`<td>${ht.esc(n)}</td>`}).join("")+"</tr>").join("")+"</tbody>";return`<table class="apexcharts-cf-table"><caption>${e.length} of ${i} rows</caption>${n}${s}</table>`}dataTable(t,e){if(!t)return{refresh(){},destroy(){}};const i=e||{},n=this.resolveColumns(i.columns),s=i.pageSize||0,r=i.page||0,a=()=>{const e=this.filteredRows(),i=s?e.slice(r*s,r*s+s):e;t.innerHTML=this.tableHTML(n,i,e.length)};a();const o=this.on("change",a);return{refresh:a,destroy:()=>{o(),t.innerHTML=""}}}destroy(){ht.store().delete(this.id),this.dims.clear(),this.listeners.clear(),this.records=[]}}const ut="__apexcharts_unit_layouts__";function dt(t){return t&&globalThis[ut][t]||null}globalThis[ut]||(globalThis[ut]={});const pt="__apexcharts_unit_marks__";function ft(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function gt(t){return t&&globalThis[pt][t]||null}globalThis[pt]||(globalThis[pt]={});const mt=g.__apex_Environment_Environment,yt=g.__apex_BrowserAPIs_BrowserAPIs,xt=g.__apex_Animations,_t=g.__apex_Animations_prefersReducedMotion;const bt=Math.PI*(3-Math.sqrt(5));function vt(t){return 1-Math.pow(1-t,3)}function wt(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function At(t,e){const[i,n]=null!=(r=it[null!=(s=t)?s:"crisp"])?r:it.crisp;var s,r;const a=800/Math.max(1,e);return[i*a*a,n*a]}g.default.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new _(e,this.ctx),n=i.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return n;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",a=s.transition,c="flow"===a,h="identity"===a,u=s.unitValue>0?s.unitValue:1;let d=t.map(t=>{const e=Math.abs(v.parseNumber(t))/u;return e>0?Math.max(1,Math.round(e)):0});d=this._applyMaxUnits(d,s.maxUnits);const p=d.reduce((t,e)=>t+e,0),f="packed"===r?this._layoutPacked(d,s):"columns"===r?this._layoutColumns(d,s):"grid"===r?this._layoutGrid(d,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(d,s):"custom"===r?this._layoutCustom(d,s):this._layoutGrouped(d,s),g="grid"===r&&!(!s.grid||!s.grid.split);g&&this._drawGridTrack(n,i,s),"scatter"===r&&this._drawScatterAxes(n,i);const m=this._lastDotR,y=this._shouldAnimate(),x=this.ctx&&this.ctx.morphTypeChange,b=y&&!!x&&"function"==typeof x.isActive&&x.isActive()&&"function"==typeof x.getInitialSlotFor,w=b&&"function"==typeof x.usesPieceTakeover&&x.usesPieceTakeover(),A=y&&!b&&this.ctx?this.ctx._unitPrevDots:null,M=this.ctx&&this.ctx._unitPieces;M&&(this.ctx._unitPieces=null,A&&M.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),i=A.get(e),n=e=>+t.getAttribute(e);i&&A.set(e,l(o({},i),{x:n("x")+n("width")/2,y:n("y")+n("height")/2,r:Math.min(n("width"),n("height"))/2,fill:t.getAttribute("fill")}))}));const k=new Map,L=[],S=e.seriesData.unitData||[],C=this._bubbleStats(S,s,m);let E=0;if(f.forEach(t=>{const a=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",o=i.group({class:"apexcharts-series",seriesName:v.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),l=t.dots.length,u=S[t.i];if(t.dots.forEach((e,n)=>{const r=null!=e.j?e.j:n,d=u?u[r]:void 0,p=d&&"object"==typeof d&&d.fillColor?d.fillColor:a,f=null!=e.r?e.r:C?this._radiusForValue(this._unitValueOf(d),C):m,_=this._markSpecFor(s,d,t.i,f),v=this._drawDot(i,s,f,p,t.i,r,_);let M;if(o.add(v),h){const t=d&&"object"==typeof d?null!=d.id?d.id:d.name:void 0;M=null!=t?`id:${t}`:`g:${E}`}else M=c?String(E):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(E++,k.set(M,{x:e.x,y:e.y,fill:p,r:f,spec:_}),w)this._place(v.node,_,e.x,e.y),v.node.setAttribute("opacity","0"),v.node.setAttribute("data-piece-hidden","1"),v.node.setAttribute("data-key",M);else if(y){const i=A&&A.get(M),n=i||(b?x.getInitialSlotFor(t.i,r,l):null),a=s.gather&&s.gather.enter||"burst",o=g||"fade"===a||"rise"===a,c=n?n.x:o?e.x:t.cx,h=n?n.y:"rise"!==a||g?o?e.y:t.cy:e.y+14;v.node.style.opacity=n?"1":"0",this._place(v.node,_,c,h),L.push({node:v.node,spec:_,x:e.x,y:e.y,cx0:c,cy0:h,key:M,r0:i&&null!=i.r?i.r:f,r1:f,fill0:i?i.fill:p,fill1:p,delay:0,isEnter:!n})}else this._place(v.node,_,e.x,e.y)}),("grouped"===r||"columns"===r||g)&&s.clusterLabels&&s.clusterLabels.show&&d[t.i]>0){const e=g?this._gridDenom:p;this._drawClusterLabel(o,t,d[t.i],e,s,a)}n.add(o)}),this._outerLabelsOn(s)&&this._drawOuterLabels(n,f,d,p,s,y&&!A),A){const t=this._collectExits(A,k,s);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});n.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=k),!this.ctx||y&&!b||(this.ctx._unitSprings=null),y&&L.length?this._runGather(L):e.globals.animationEnded=!0,n}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const n=e/i;return console.warn(`[ApexCharts] unit chart: ${i} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`),t.map(t=>t>0?Math.max(1,Math.round(t*n)):0)}_layoutCustom(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),a=this._resolveLayoutProvider(e);if(!a)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,n-2*o),height:s},c=Math.sqrt(l.width*l.height/Math.PI),h=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(h,e);const u=this._lastDotR,d=this._layoutObjects(t,u);let p;try{p=a(d,l)}catch(i){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",i),this._layoutGrouped(t,e)}if(!Array.isArray(p))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const f=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&f.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const g=t.map((t,e)=>({i:e,cx:n/2,cy:s/2,outerR:u,dots:[]}));return d.forEach(t=>{const e=f.get(t.id);e&&g[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),g.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let n=0;t.dots.forEach(e=>{n=Math.max(n,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=n+u}),g}_layoutObjects(t,e){const i=this.w,n=i.seriesData.unitData||[],s=i.seriesData.seriesNames||[],r=[];let a=0;return t.forEach((t,i)=>{var o;const l=n[i];for(let n=0;n<t;n++){const t=l?l[n]:void 0,c=!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${n}`:String(null!=t.id?t.id:t.name);r.push({id:c,index:a,seriesIndex:i,dataPointIndex:n,label:s[i],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),a++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=dt(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,a=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,a.length),l=new Array(t.length).fill(-1);a.forEach((t,e)=>l[t]=e);const c=n/o,h=s-r,u=Math.max(1,...t),d=.08*Math.min(c,h),p=Math.max(4,Math.min(c,h)/2-d),f=this._resolveStep(e,p,u);this._lastDotR=this._dotRadiusFromStep(f,e);const g=this._lastDotR,m=r+h/2,y=t.map(t=>f*Math.sqrt(Math.max(1,t))+g);let x=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):n/2)(e));const _=a.map(t=>y[t]);let b=!1;for(let t=1;t<o;t++)if(x[a[t]]-x[a[t-1]]<_[t]+_[t-1]){b=!0;break}if(b){const e=Math.max(2*g,8),i=_.reduce((t,e)=>t+2*e,0)+e*(o-1);let s;if(i<=n){let t=(n-i)/2;s=_.map(i=>{const n=t+i;return t+=2*i+e,n})}else if(1===o)s=[n/2];else{const t=_[0],e=n-_[o-1];s=_.map((i,n)=>t+(e-t)*n/(o-1))}x=t.map((t,e)=>l[e]>=0?s[l[e]]:n/2)}return t.map((t,e)=>({i:e,cx:x[e],cy:m,outerR:y[e],dots:this._spiral(x[e],m,t,f,0)}))}_layoutPacked(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),a=Math.max(4,Math.min(n,s-6)/2-.06*Math.min(n,s)),o=this._resolveStep(e,a,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=n/2,c=6+(s-6)/2,h=t.map((t,e)=>e);!1!==e.sortByGroup&&h.sort((e,i)=>t[e]-t[i]);const u=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let d=0;return h.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(d+.5),i=d*bt;u[e].dots.push({x:l+t*Math.cos(i),y:c+t*Math.sin(i),slot:d}),d++}}),u}_layoutArc(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),a=e.arc||{},o="number"==typeof a.startAngle?a.startAngle:-90,l="number"==typeof a.endAngle?a.endAngle:90,c=o*Math.PI/180,h=l*Math.PI/180,u=h-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof a.innerRadiusRatio?a.innerRadiusRatio:.4)),p=t=>Math.sin(t),f=t=>-Math.cos(t),g=this._arcBounds(c,h),m=.04*Math.min(n,s),y=Math.max(1e-6,g.maxX-g.minX),x=Math.max(1e-6,g.maxY-g.minY),_=Math.max(4,Math.min((n-2*m)/y,(s-2*m)/x)),b=_*d,v=n/2-(g.minX+g.maxX)/2*_,w=s/2-(g.minY+g.maxY)/2*_,A=this._arcAllocate(r,b,_,u,e);this._lastDotR=A.dotR;const M=[];for(let t=0;t<A.R;t++){const e=A.radii[t],i=A.seatsPerRow[t];for(let t=0;t<i;t++){const n=1===i?(c+h)/2:c+u*(t+.5)/i;M.push({a:n,x:v+e*p(n),y:w+e*f(n)})}}M.sort((t,e)=>t.a-e.a);const k=t.map((t,e)=>({i:e,cx:v,cy:w,outerR:_,dots:[]}));let L=0,S=0;return M.forEach((e,i)=>{for(;L<t.length&&S>=t[L];)L++,S=0;L>=t.length||(k[L].dots.push({x:e.x,y:e.y,slot:i}),S++)}),k}_arcBounds(t,e){const i=t=>Math.sin(t),n=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),a=[0,i(t),i(e)],o=[0,n(t),n(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)a.push(i(t*l)),o.push(n(t*l));return{minX:Math.min(...a),maxX:Math.max(...a),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,n,s){const r=s.spacing>0?s.spacing:1.05,a=Math.abs(n)||Math.PI,o=this._fixedRadius(s),l=n=>{n=Math.max(1,Math.round(n));const s=[];for(let t=0;t<n;t++)s.push(1===n?(e+i)/2:e+t/(n-1)*(i-e));const o=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let h=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{h>0&&(c[t.idx]++,h--)});h>0;)c[n-1]++,h--;const u=1===n?i-e||i:(i-e)/(n-1);let d=1/0;for(let t=0;t<n;t++){const e=c[t];if(e<=0)continue;const i=s[t]*a/e;i<d&&(d=i)}const p=Math.min(u,d);return{R:n,radii:s,seatsPerRow:c,dotR:Math.max(1,p/(2*r))}},c=s.arc&&s.arc.rows;let h;if("number"==typeof c&&c>=1)h=l(c);else if(o){h=l((i-e)/(2*o*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));h=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>h.dotR&&(h=e)}}return o&&(h.dotR=o),h}_layoutColumns(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),a=r&&"bottom"===e.clusterLabels.position,o=r&&!a?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),h=new Array(t.length).fill(-1);l.forEach((t,e)=>h[t]=e);const u=n/c,d=.62*u,p=Math.max(8,.04*s)+(a?30:0),f=Math.max(4,s-o-p),g=Math.max(1,...t),m=e.spacing>0?e.spacing:1,y=e.columns?e.columns.size:void 0;let x;x="image"!==e.shape&&"auto"===y?null:"image"!==e.shape&&"number"==typeof y&&y>0?y:this._fixedRadius(e);let _=1,b=0;if(x){b=2*x*m,this._lastDotR=x;const t=Math.max(1,Math.floor(f/b)),e=Math.max(1,Math.floor(d/b));_=Math.max(1,Math.min(e,Math.ceil(g/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let i=1;i<=e;i++){const e=Math.ceil(g/i),n=Math.min(d/i,f/e);n>t&&(t=n,_=i)}b=t,this._lastDotR=Math.max(1,b/(2*m))}const v=this._lastDotR,w=Math.ceil(g/_),A=o+(f+Math.min(f,w*b))/2;return t.map((t,e)=>{const i=h[e]>=0?u*(h[e]+.5):n/2,s=Math.ceil(Math.max(1,t)/_)*b,r=i-_*b/2+b/2,a=[];for(let e=0;e<t;e++){const t=Math.floor(e/_),i=e%_;a.push({x:r+i*b,y:A-v-t*b})}return{i:e,cx:i,cy:A-s/2,outerR:s/2,flat:!0,dots:a}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},a=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),h=Math.max(1,Math.ceil(Math.max(1,c)/a)),u=e.spacing>0?e.spacing:1,d=Math.max(4,n),p=Math.max(4,s-6),f=this._fixedRadius(e);let g=0;f?(g=2*f*u,this._lastDotR=f):(g=Math.min(d/a,p/h),this._lastDotR=Math.max(1,g/(2*u)));const m=a*g,y=h*g,x=(n-m)/2+g/2,_=6+(p-y)/2,b=t=>"bottom"===o?_+y-g/2-t*g:_+g/2+t*g,v=t.map((t,e)=>({i:e,cx:n/2,cy:6+p/2,outerR:Math.max(m,y)/2,dots:[]}));let w=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=w%a,i=Math.floor(w/a);v[t].dots.push({x:x+e*g,y:b(i),slot:w}),w++}return v}_layoutGridSplit(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},a=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/a)),h=t.map((t,e)=>e).filter(e=>t[e]>0),u=Math.max(1,h.length),d=r.max>0?r.max:Math.max(1,...t),p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(u)))),f=Math.max(1,Math.ceil(u/p)),g=!(e.clusterLabels&&!1===e.clusterLabels.show),m=g&&e.clusterLabels&&"bottom"===e.clusterLabels.position,y=g&&!m?22:4,x=g&&m?22:4,_=n/p,b=s/f,v=Math.max(4,.86*_),w=Math.max(4,b-y-x),A=e.spacing>0?e.spacing:1,M=this._fixedRadius(e);let k=0;M?(k=2*M*A,this._lastDotR=M):(k=Math.min(v/a,w/c),this._lastDotR=Math.max(1,k/(2*A)));const L=a*k,S=c*k,C=(t,e)=>"bottom"===o?t+S-k/2-e*k:t+k/2+e*k,E=[],F=[];return h.forEach((e,i)=>{const n=i%p,s=Math.floor(i/p),r=n*_,o=r+(_-L)/2+k/2,c=s*b+y+(w-S)/2,h=t=>({x:o+t%a*k,y:C(c,Math.floor(t/a))});for(let t=0;t<l;t++)E.push(h(t));const u=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),f=[];for(let t=0;t<u;t++){const e=h(t);f.push({x:e.x,y:e.y,slot:i*l+t})}F.push({i:e,cx:r+_/2,cy:c+S/2,outerR:S/2,flat:!0,split:!0,dots:f})}),this._gridDenom=d,this._gridTrack={cells:E},F}_drawGridTrack(t,e,i){const n=this._gridTrack;if(!n||!n.cells||!n.cells.length)return;const s=this._lastDotR,r=(i.grid||{}).trackColor||"rgba(128,128,128,0.14)",a=e.group({class:"apexcharts-unit-track"});n.cells.forEach(t=>{let n;if("square"===i.shape){const a=2*s;n=e.drawRect(0,0,a,a,i.borderRadius||0,r,1,0,"none"),n.node.setAttribute("fill",r),n.node.setAttribute("x",String(t.x-s)),n.node.setAttribute("y",String(t.y-s))}else n=e.drawCircle(s,{fill:r,"stroke-width":0,stroke:"none"}),n.node.setAttribute("fill",r),n.node.setAttribute("cx",String(t.x)),n.node.setAttribute("cy",String(t.y));n.node.classList.add("apexcharts-unit-track-cell"),a.add(n)}),t.add(a)}_layoutScatter(t){const e=this.w,i=t.scatter||{};if("value"===i.y)return this._layoutScatter2D(t);if("vertical"===i.orientation)return this._layoutScatterVertical(t);const n=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],a=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),h=t=>null!=t&&isFinite(t),u=c.map((t,e)=>e).filter(t=>c[t].some(h)),d=Math.max(1,u.length);let p=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>f&&(f=t))})),p===1/0&&(p=0,f=1);const g=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),m=this._scatterValueDomain(i,p,f,g),y=m.min,x=m.max,_=x-y||1,b=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):d>1?92:8,v=30+(i.xTitle?20:0),w=b,A=n-8,M=s-v,k=Math.max(4,A-w),L=Math.max(4,M-10),S=t=>w+(t-y)/_*k,C=L/d;let E=0;const F=this._fixedRadius(t);if(F)E=F;else{const t=Math.max(1,...u.map(t=>c[t].filter(h).length));E=Math.max(2,Math.min(6,.12*C,k/(2.5*Math.sqrt(t))))}this._lastDotR=E;const P=t.spacing>0?t.spacing:1,D=Math.max(.5,E*P),R="jitter"===i.spread,T=[],N=[],O=l?l.rMax:E;u.forEach((t,e)=>{const i=(t=>10+C*(t+.5))(e);N.push({i:t,cy:i,name:a[t]||`series-${t+1}`});const n=(r[t]||[]).map((t,e)=>{const n=o(t),s={j:e,px:S(h(n)?n:y),y:i};return l&&(s.r=this._scatterRadius(t,l,E)),s});if(R){const t=Math.max(O,C/2-O);n.forEach((e,n)=>{const s=(9301*n+49297)%233280/233280;e.y=i+(2*s-1)*t})}else this._beeswarm(n,i,E,D,O);T.push({i:t,cx:(w+A)/2,cy:i,outerR:C/2,dots:n.map(t=>({x:t.px,y:t.y,r:t.r}))})});const $=m.ticks;return this._scatterAxis={mode:"1d",plotL:w,plotR:A,plotT:10,plotB:M,xMin:y,xMax:x,plotX:S,ticks:$,lanes:N,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},T}_layoutScatterVertical(t){const e=this.w,i=t.scatter||{},n=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],a=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),h=t=>null!=t&&isFinite(t),u=c.map((t,e)=>e).filter(t=>c[t].some(h)),d=Math.max(1,u.length);let p=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>f&&(f=t))})),p===1/0&&(p=0,f=1);const g=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),m=this._scatterValueDomain(i,p,f,g),y=m.min,x=m.max,_=x-y||1,b=46+(i.xTitle?18:0),v=n-10,w=s-(d>1?26:10),A=Math.max(4,v-b),M=Math.max(4,w-10),k=t=>w-(t-y)/_*M,L=A/d;let S=0;const C=this._fixedRadius(t);if(C)S=C;else{const t=Math.max(1,...u.map(t=>c[t].filter(h).length));S=Math.max(2,Math.min(6,.12*L,M/(2.5*Math.sqrt(t))))}this._lastDotR=S;const E=t.spacing>0?t.spacing:1,F=Math.max(.5,S*E),P="jitter"===i.spread,D=[],R=[],T=l?l.rMax:S;u.forEach((t,e)=>{const i=(t=>b+L*(t+.5))(e);R.push({i:t,cx:i,name:a[t]||`series-${t+1}`});const n=(r[t]||[]).map((t,e)=>{const n=o(t),s={j:e,py:k(h(n)?n:y),x:i};return l&&(s.r=this._scatterRadius(t,l,S)),s});if(P){const t=Math.max(T,L/2-T);n.forEach((e,n)=>{const s=(9301*n+49297)%233280/233280;e.x=i+(2*s-1)*t})}else this._beeswarm(n,i,S,F,T,!0);D.push({i:t,cx:i,cy:(10+w)/2,outerR:L/2,dots:n.map(t=>({x:t.x,y:t.py,r:t.r}))})});const N=m.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:b,plotR:v,plotT:10,plotB:w,vMin:y,vMax:x,plotY:k,ticks:N,lanes:R,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},D}_layoutScatter2D(t){const e=this.w,i=e.layout.gridWidth,n=e.layout.gridHeight,s=t.scatter||{},r=e.seriesData.unitData||[],a=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,c=r.map((t,e)=>e).filter(t=>(r[t]||[]).some(t=>a(o(t))&&a(l(t))));let h=1/0,u=-1/0,d=1/0,p=-1/0;r.forEach(t=>(t||[]).forEach(t=>{const e=o(t),i=l(t);a(e)&&a(i)&&(e<h&&(h=e),e>u&&(u=e),i<d&&(d=i),i>p&&(p=i))})),h===1/0&&(h=0,u=1,d=0,p=1);const f=Math.max(2,Math.round(s.tickAmount>0?s.tickAmount:5)),g=Math.max(2,Math.round(s.yTickAmount>0?s.yTickAmount:5)),m=this._niceScale(null!=s.xMin?s.xMin:h,null!=s.xMax?s.xMax:u,f),y=this._niceScale(null!=s.yMin?s.yMin:d,null!=s.yMax?s.yMax:p,g),x=null!=s.xMin?s.xMin:m.min,_=null!=s.xMax?s.xMax:m.max,b=null!=s.yMin?s.yMin:y.min,v=null!=s.yMax?s.yMax:y.max,w=_-x||1,A=v-b||1,M=46+(s.yTitle?18:0),k=30+(s.xTitle?20:0),L=M,S=i-12,C=n-k,E=Math.max(4,S-L),F=Math.max(4,C-10),P=t=>L+(t-x)/w*E,D=t=>C-(t-b)/A*F,R=this._scatterSizeStats(s,r),T=this._fixedRadius(t)||5;this._lastDotR=T;const N=[];c.forEach(t=>{const e=(r[t]||[]).map(t=>{const e=o(t),i=l(t);return{x:P(a(e)?e:x),y:D(a(i)?i:b),r:R?this._scatterRadius(t,R,T):void 0}});N.push({i:t,cx:(L+S)/2,cy:(10+C)/2,outerR:F/2,dots:e})});const O=(t,e,i,n,s,r)=>{const a=[];if(s)for(let e=0;e<r;e++)a.push(t+i*e/(r-1));else{const s=n||i/Math.max(1,r-1);for(let i=t;i<=e+.5*s;i+=s)a.push(Math.abs(i)<1e-9*s?0:i)}return a};return this._scatterAxis={mode:"2d",plotL:L,plotR:S,plotT:10,plotB:C,plotX:P,plotY:D,xTicks:O(x,_,w,m.spacing,null!=s.xMin||null!=s.xMax,f),yTicks:O(b,v,A,y.spacing,null!=s.yMin||null!=s.yMax,g),xTitle:s.xTitle,yTitle:s.yTitle,xFormatter:"function"==typeof s.xFormatter?s.xFormatter:null,yFormatter:"function"==typeof s.yFormatter?s.yFormatter:null,gridlines:!1!==s.gridlines},N}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const n=Math.max(.5,+i[0]),s=Math.max(n,+i[1]),r=t.sizeField||"z";let a=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<a&&(a=e),e>o&&(o=e))})),a===1/0?null:{zmin:a,zmax:o,rMin:n,rMax:s,field:r}}_scatterRadius(t,e,i){if(!e)return i;const n=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof n||!isFinite(n))return e.rMin;const s=e.zmax>e.zmin?(n-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),a=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(a+r*(o-a))}_beeswarm(t,e,i,n,s,r=!1){const a=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[a]-e[a]),c=[],h=null!=s?s:i;l.forEach(t=>{const s=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*n*(i%2?1:-1),l=e+o;let u=!0;for(let e=c.length-1;e>=0;e--){const i=c[e],n=t[a]-i.f;if(n>s+h)break;const r=s+i.r,o=l-i.s;if(n*n+o*o<r*r){u=!1;break}}if(u){r=o;break}}t[o]=e+r,c.push({f:t[a],s:t[o],r:s})})}_scatterValueDomain(t,e,i,n){const s=(t,e,i)=>{const n=[];for(let s=t;s<=e+.5*i;s+=i)n.push(Math.abs(s)<1e-9*i?0:s);return n};if(null!=t.xMin||null!=t.xMax){let r=null!=t.xMin?t.xMin:e,a=null!=t.xMax?t.xMax:i;a>r||(a=r+1);const o=(a-r)/Math.max(1,n-1);return e<r&&(r-=Math.ceil((r-e)/o)*o),i>a&&(a+=Math.ceil((i-a)/o)*o),{min:r,max:a,ticks:s(r,a,o)}}const r=this._niceScale(e,i,n),a=r.spacing||(r.max-r.min)/Math.max(1,n-1);return{min:r.min,max:r.max,ticks:s(r.min,r.max,a)}}_niceScale(t,e,i){const n=t;let s=e;s>n||(s=n+1);const r=this._niceNum(s-n,!1),a=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(n/a)*a,max:Math.ceil(s/a)*a,spacing:a}}_niceNum(t,e){const i=t>0?t:1,n=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,n);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,n)}_drawScatterAxes(t,e){const i=this.w;if(!mt.isBrowser())return;const n=this._scatterAxis;if(!n)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),a=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,h=c||"rgba(120,130,140,0.9)",u=(t,e,i,n,a)=>{const o=yt.createElementNS(s,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(n)),o.setAttribute("stroke",a),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},d=(t,e,n,a,o,l,c,h)=>{const u=yt.createElementNS(s,"text");u.setAttribute("class",h),u.setAttribute("x",String(e)),u.setAttribute("y",String(n)),u.setAttribute("text-anchor",a),u.setAttribute("dominant-baseline","middle"),u.setAttribute("font-size",`${l}px`),u.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),u.setAttribute("font-weight",String(c)),u.setAttribute("fill",o),u.textContent=t,r.node.appendChild(u)};if("2d"!==n.mode){if("vertical"===n.orientation){if(n.ticks.forEach(t=>{const e=n.plotY(t);n.gridlines&&u(n.plotL,e,n.plotR,e,a);const i=n.formatter?String(n.formatter(t)):this._formatTick(t);d(i,n.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),u(n.plotL,n.plotT,n.plotL,n.plotB,o),n.valueTitle){const t=yt.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,a=(n.plotT+n.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(a)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${a})`),t.textContent=String(n.valueTitle),r.node.appendChild(t)}return n.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,t.cx,n.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}n.ticks.forEach((t,e)=>{const i=n.plotX(t);n.gridlines&&u(i,n.plotT,i,n.plotB,a);const s=n.formatter?String(n.formatter(t)):this._formatTick(t),r=0===e?"start":e===n.ticks.length-1?"end":"middle";d(s,i,n.plotB+14,r,h,11,400,"apexcharts-unit-tick")}),u(n.plotL,n.plotB,n.plotR,n.plotB,o),n.xTitle&&d(String(n.xTitle),(n.plotL+n.plotR)/2,n.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),n.plotL>12&&n.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";d(t.name,n.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(n.yTicks.forEach(t=>{const e=n.plotY(t);n.gridlines&&u(n.plotL,e,n.plotR,e,a);const i=n.yFormatter?String(n.yFormatter(t)):this._formatTick(t);d(i,n.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),n.xTicks.forEach(t=>{const e=n.plotX(t);n.gridlines&&u(e,n.plotT,e,n.plotB,a);const i=n.xFormatter?String(n.xFormatter(t)):this._formatTick(t);d(i,e,n.plotB+14,"middle",h,11,400,"apexcharts-unit-tick")}),u(n.plotL,n.plotB,n.plotR,n.plotB,o),u(n.plotL,n.plotT,n.plotL,n.plotB,o),n.xTitle&&d(String(n.xTitle),(n.plotL+n.plotR)/2,n.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),n.yTitle){const t=yt.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,a=(n.plotT+n.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(a)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${a})`),t.textContent=String(n.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const n=t.map(t=>t/i*e),s=n.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),a=Math.max(0,e-r),o=n.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<a&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,n,s){const r=[];for(let a=0;a<i;a++){const i=s+a,o=n*Math.sqrt(i+.5),l=i*bt;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,n=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+n*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+n*(r-s))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let n=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<n&&(n=e),e>s&&(s=e))})}),n===1/0||s<n)return null;const r=e.sizeByValue,a=i,o=Math.max(1,Math.min(a,"number"==typeof r.minRadius?r.minRadius:.35*a));return{min:n,max:s,minR:o,maxR:a,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const n=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*n:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,n=this._fixedRadius(e);return n||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,n){const s=e;2===s.pk?t.setAttribute("transform","translate("+(i-s.ox)+","+(n-s.oy)+s.tail):1===s.pk?(t.setAttribute("x",String(i-s.hx)),t.setAttribute("y",String(n-s.hy))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(n)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:n,hy:s}=this._halfExtent(t,i);return{pk:1,hx:n,hy:s,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return ft(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return ft(e);const i=gt(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,i){const n=Math.round(10*e)/10,s=t.name+"|"+t.path.length+"|"+n,r=this._specCache.get(s);if(r)return r;const a=t.viewBox||[0,0,100,100],o=2*n*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/a[2]:"height"===i.fit?o/a[3]:o/Math.max(a[2],a[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(a[0]+a[2]/2)*l,oy:(a[1]+a[3]/2)*l,tail:") scale("+l+")",r:n});return this._specCache.set(s,c),c}_markSpecFor(t,e,i,n){if("pictogram"!==t.shape)return this._baseSpec(t,n);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,a=Array.isArray(s.mark)?s.mark[i%s.mark.length]:s.mark,c=this._resolveMark(null!=r?r:a);return c?this._glyphSpec(c,n,s):this._baseSpec(l(o({},t),{shape:"square"===s.fallback?"square":"circle"}),n)}_drawDot(t,e,i,n,s,r,a){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[s]||"none",h="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let u;if(a&&2===a.pk)u=o.dom.Paper.path(a.d),u.node.setAttribute("fill",n),"evenodd"===a.fillRule&&u.node.setAttribute("fill-rule","evenodd"),h<1&&u.node.setAttribute("fill-opacity",String(h)),u.node.setAttribute("data:r",String(a.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;u=o.dom.Paper.image(e.image.src),u.node.setAttribute("width",String(t)),u.node.setAttribute("height",String(i)),u.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&u.node.setAttribute("filter",`url(#${this._tintFilter(n)})`)}else if("square"===e.shape){const s=2*i;u=t.drawRect(0,0,s,s,e.borderRadius||0,n,1,l,c),u.node.setAttribute("fill",n),h<1&&u.node.setAttribute("fill-opacity",String(h))}else u=t.drawCircle(i,{fill:n,"stroke-width":l,stroke:c}),u.node.setAttribute("fill",n),h<1&&u.node.setAttribute("fill-opacity",String(h));return u.node.classList.add("apexcharts-unit-area"),u.node.setAttribute("i",String(s)),u.node.setAttribute("j",String(r)),u}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",n=String(t).replace(/[^a-zA-Z0-9]/g,""),s=`apexcharts-unit-tint-${e.globals.chartID}-${n}`,r=e.dom.Paper.node;if(r.querySelector(`#${s}`))return s;let a=r.querySelector("defs");a||(a=yt.createElementNS(i,"defs"),r.insertBefore(a,r.firstChild));const o=yt.createElementNS(i,"filter");o.setAttribute("id",s),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=yt.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=yt.createElementNS(i,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),a.appendChild(o),s}_placeDot(t,e,i,n,s){this._place(t,s||this._baseSpec(e),i,n)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!mt.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!_t()))))}_seedSprings(t,e,i){const[n,s]=At(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,a=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=o?o.x:Q(i.cx0,n,s),c=o?o.y:Q(i.cy0,n,s);o&&(l.stiffness=n,c.stiffness=n,l.damping=s,c.damping=s,i.cx0=l.value,i.cy0=c.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===c.velocity||(i.delay=0)),i.sx=l,i.sy=c,null!=i.key&&a.set(i.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=a)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,n=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*n,450),r=t.length;for(let e=0;e<r;e++)t[e].delay=r>1?e/(r-1)*s:0;const a=i.gather||{},o=a.motion||"auto";"spring"===o||"auto"===o&&(!a.easing||"outCubic"===a.easing)?this._seedSprings(t,a,n):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r0))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===a.easing?(c="number"==typeof a.overshoot?a.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===a.easing?wt:vt;var c;null!=this.w.globals.unitGatherRAF&&(yt.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const h=performance.now();let u=h;const d=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const i=Math.min(.25,Math.max(0,(e-u)/1e3));u=e;let s=!0;for(let a=0;a<r;a++){const r=t[a],o=e-h-r.delay,c=Math.max(0,Math.min(1,o/n)),u=vt(c);let d,p;if(r.sx&&r.sy){o>=0&&!r.released&&(tt(r.sx,r.x),tt(r.sy,r.y),r.released=!0);const t=J(r.sx,i),e=J(r.sy,i);r.released&&t&&e||(s=!1),d=r.sx.value,p=r.sy.value}else{const t=l(c);d=r.cx0+(r.x-r.cx0)*t,p=r.cy0+(r.y-r.cy0)*t}if(this._place(r.node,r.spec,d,p),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*u),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*u),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*u);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}0===r.spec.pk&&null!=r.r0&&null!=r.r1&&r.r0!==r.r1&&r.node.setAttribute("r",String(r.r0+(r.r1-r.r0)*u)),c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=yt.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=yt.requestAnimationFrame(d)}_collectExits(t,e,i){const n=Math.max(0,i.maxUnits||5e3),s=[];for(const[i,r]of t)if(!e.has(i)&&(s.push(r),s.length>=n))break;return s}_runExits(t,e,i){const n=this.w,s=new _(n,this.ctx),r=this._lastDotR,a=n.layout.gridWidth/2,o=n.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,c=[];if(e.forEach(e=>{const n=null!=e.r?e.r:r,a=e.spec||this._baseSpec(i,n),o=this._drawDot(s,i,n,e.fill,0,0,a);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,a,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:a})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const h=Math.max(1,n.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(yt.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const u=performance.now(),d=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-u)/h)),n=vt(i);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(a-e.x0)*n*l,i=e.y0+(o-e.y0)*n*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-n)}i<1?this.w.globals.unitExitRAF=yt.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=yt.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,n){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,a=i>0?e/i*100:0,o=n.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:a,w:s}):`${r}\n${a.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,n=e.clusterLabels,s=n.external.connector||{},r=t.reduce((t,e)=>t+e,0),a=[];if(t.forEach((t,i)=>{t>0&&a.push(...this._outerLabelLines(i,t,r,e))}),!a.length)return 0;const o=function(t,e,i={}){const n=new _(t),s=i.fontSize||"12px",r=parseFloat(s)||12;let a=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=n.getTextRects(e,s,i.fontFamily,"",!0,i.fontWeight).width;a=Math.max(a,o>0?o:e.length*r*.58)}),a}(i,a,{fontSize:n.fontSize,fontFamily:n.fontFamily||i.config.chart.fontFamily}),l=o+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(n.external.offsetX)||0);return Math.min(l,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,n,s,r){const a=this.w;if(!mt.isBrowser())return;const o=s.clusterLabels,l=o.external,c=l.connector||{},h=null!=c.gap?c.gap:8,u=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,f=a.layout.gridWidth,g=a.layout.gridHeight,m=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let x=0,b=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);x=Math.max(...t)-Math.min(...t),b=Math.max(...e)-Math.min(...e)}const v=x>b,w=parseFloat(o.fontSize)||13,A=Math.round(1.35*w),M=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],n,s);if(!r.some(t=>""!==t))return;const a=v?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===a?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>c&&(c=i,l=e)});const g={x:l.x+o*(l.r||m),y:l.y},y={x:g.x+o*h,y:g.y};M.push({i:t.i,lines:r,anchor:g,elbow:y,labelX:y.x+o*u+d,idealY:g.y+p,labelY:g.y+p,side:a})}),!M.length)return;const k=M.reduce((t,e)=>Math.max(t,e.lines.length),1)*A,L=k/2;["left","right"].forEach(t=>{!function(t,e,i,n){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],a=r?r.labelY-i:0;if(a>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=a,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=n&&s.length&&s[0].labelY<n){const t=n-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(M.filter(e=>e.side===t),k+2,g-L,L)});const S=new _(a,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,a.config.chart.animations.speed||800);S.node.classList.add("apexcharts-unit-label-delay"),S.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}M.forEach(t=>{const e=a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";S.add(function(t,e){const{lines:i,lineHeight:n,anchor:s,elbow:r,labelX:a,labelY:o,side:l,connector:c,style:h,foreColor:u}=e,d=new _(t),p=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${a} ${o}`,i=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const f="right"===l?a+4:a-4,g=i.length,m=o-(g-1)*n/2,y=d.drawText({x:f,y:m,text:1===g?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:h.fontSize,fontFamily:h.fontFamily,fontWeight:h.fontWeight,foreColor:u,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(g>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${f}`),t[e].setAttribute("dy",0===e?"0":`${n}`)}return p.add(y),p}(a,{lines:t.lines,lineHeight:A,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||a.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||a.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(S)}_drawClusterLabel(t,e,i,n,s,r){const a=this.w;if(!mt.isBrowser())return;const o="http://www.w3.org/2000/svg",l=a.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=n>0?i/n*100:0,h=s.clusterLabels,u=parseFloat(h.fontSize)||13;let d;d="function"==typeof h.formatter?h.formatter(l,{seriesIndex:e.i,value:i,percent:c,w:a}):`${l} (${c.toFixed(1)}%)`;const p="string"==typeof d?d:String(d),f=yt.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${u}px`),f.setAttribute("font-family",h.fontFamily||a.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(h.fontWeight||600)),f.setAttribute("fill",h.color||r);const g="bottom"===h.position,m=e.outerR+.6*u+3+(h.offsetY||0),y=p.length*u*.55;if(!g&&!e.flat&&!1!==h.curved&&y<=Math.PI*m*.95){const i=e.cy,n=`M ${e.cx-m} ${i} A ${m} ${m} 0 0 1 ${e.cx+m} ${i}`,s=`apexcharts-unit-label-${a.globals.chartID}-${e.i}`,r=yt.createElementNS(o,"path");r.setAttribute("id",s),r.setAttribute("d",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=yt.createElementNS(o,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=p,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=g?e.cy+e.outerR+u+6+(h.offsetY||0):e.cy-e.outerR-6-(h.offsetY||0);f.setAttribute("y",String(t)),f.textContent=p}t.node.appendChild(f)}}});const Mt=Math.PI/180,kt=180/Math.PI;function Lt(t,e,i,n){return{x:t+i*Math.cos((n-90)*Mt),y:e+i*Math.sin((n-90)*Mt)}}const St=t=>`${t.x} ${t.y}`;function Ct(t,e,i,n,s,r=null,a={}){var o,l,c;const h=e&&"object"==typeof e,u=h&&null!=(l=null!=(o=e.x)?o:e.name)?l:"",d=Number(h?null!=(c=e.y)?c:e.value:e),p={name:String(u),value:isNaN(d)?null:d,color:h&&e.color?e.color:void 0,_key:`${s}/${i}:${u}`};if(n&&!p.color&&(p.color=n[i%n.length]),a.keepDatum&&(p._datum=e),h&&Array.isArray(e.children)&&e.children.length)p.children=e.children.map((e,i)=>Ct(t,e,i,null,p._key,r,a));else if(h&&null!=e.drilldown&&!1!==a.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const n=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(n&&Array.isArray(n.data)&&n.data.length){const s=new Set(i);s.add(e.drilldown);const r=Array.isArray(n.colors)?n.colors:null;p.children=n.data.map((e,i)=>Ct(t,e,i,r,p._key,s,a))}}}return p}function Et(t,e={}){const i=t.config.series,n=i&&i[0],s=n&&Array.isArray(n.data)?n.data:i;return Array.isArray(s)?s.map((i,n)=>Ct(t,i,n,null,"",null,e)):[]}function Ft(t){t.children&&t.children.length&&(t.children.forEach(t=>Ft(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function Pt(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}const Dt="http://www.w3.org/1999/xhtml";function Rt(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function Tt(t,e,i,n){var s;const r=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,a=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=n&&n.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,n=t.dom.elWrap;if(!n)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const r=n.getBoundingClientRect().top,a=e.getBoundingClientRect();let o=i;for(let t=0;t<s.length;t++){const e=s[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}function Nt(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function Ot(t,e,i,n,s,r){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=n,t._parent=s,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=r.cap&&e>=r.cap,e>r.maxDepth&&(r.maxDepth=e),t._leaf||t._clipped)return;const a=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let o=i;for(let s=0;s<t.children.length;s++){const l=t.children[s],c=(n-i)*Math.max(0,l.value)/a;Ot(l,e+1,o,o+c,t,r),o+=c}}function $t({roots:t,nodesAll:e,focus:i,t0:n,t1:s,cap:r}){for(let t=0;t<e.length;t++)e[t]._show=!1;const a={maxDepth:0,cap:r};if(i)return Ot(i,0,n,s,i._parent,a),a.maxDepth;const o=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=n;for(let e=0;e<t.length;e++){const i=(s-n)*Math.max(0,t[e].value)/o;Ot(t[e],0,l,l+i,null,a),l+=i}return a.maxDepth}function It({maxDepth:t,near:e,far:i,gap:n=0}){const s=t+1,r=(i-e)/s,a=s>1?n:0;return{near:t=>e+t*r+(t>0?a/2:0),far:t=>e+(t+1)*r-a/2}}function Bt(t,e,i,n,s){return t._leaf&&"extend"===n&&t._vDepth<i?s:e.far(t._vDepth)}function zt(t,{type:e,remedy:i}){let n=!1;const s=t=>{if(t.children&&t.children.length){const r=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!n&&null!=t.value&&Math.abs(r-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${r}). ${i}`),n=!0),t.children.forEach(s)}};t.forEach(s)}function Wt(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function Ht(t,e,i){let n=t===e?t._parent||null:t;return!n||n.children&&n.children.length||(n=n._parent||null),i&&1===i.length&&n===i[0]&&(n=null),n===e?{changed:!1,focus:e}:{changed:!0,focus:n}}function jt(t,e,i=0){if("number"==typeof t)return t;const n=String(t).trim();if(n.endsWith("%"))return parseFloat(n)/100*e;const s=parseFloat(n);return isNaN(s)?i*e:s}function Yt(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const n=parseInt(i,16);if(isNaN(n))return t;let s=n>>16&255,r=n>>8&255,a=255&n;return s=Math.round(s+(255-s)*e),r=Math.round(r+(255-r)*e),a=Math.round(a+(255-a)*e),"#"+((1<<24)+(s<<16)+(r<<8)+a).toString(16).slice(1)}function qt(t,e,i,n){if(t._color=t.color||e,n.push(t),t.children)for(let e=0;e<t.children.length;e++){const s=t.children[e];qt(s,s.color||Yt(t._color,i),i,n)}}class Xt{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&mt.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){const i=this._tip();if(!i)return;const n=this.w,s=(e.value/this.total*100).toFixed(1),r=e._parent?e._parent.value:this.total,a=r>0?(e.value/r*100).toFixed(1):s,o=n.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"";i.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${o}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${e.value} (${a}% of parent, ${s}% of total)</span></div></div></div>`,i.classList.add("apexcharts-active"),i.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),n=e.offsetWidth,s=e.offsetHeight;let r=t.clientX-i.left+12;r+n>i.width&&(r=t.clientX-i.left-n-12),r=Math.max(0,Math.min(r,i.width-n));let a=t.clientY-i.top+12;a+s>i.height&&(a=t.clientY-i.top-s-12),a=Math.max(0,Math.min(a,i.height-s)),e.style.left=r+"px",e.style.top=a+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const Gt=Math.PI/180,Ut=180/Math.PI,Kt="http://www.w3.org/2000/svg",Vt="http://www.w3.org/1999/xhtml",Zt=(t,e,i)=>t+(e-t)*i;g.default.use({sunburst:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.sunburst,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.startAngle=this.cfg.startAngle,this.endAngle=this.cfg.endAngle,this.maxDepth=0,this.centerX=0,this.centerY=0,this.maxRadius=0,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._innerR=()=>0,this._outerR=()=>0,this._tooltip=new Xt(t),this._lblSeq=0,this._morphLeafIndex=0,this._graphics=null,this._ringsG=null,this._labelsG=null}draw(t){const e=this.w,i=new _(this.w);this._graphics=i;const n=i.group({class:"apexcharts-sunburst"});if(e.globals.noData||!t||!t.length)return n;const s=e.layout.gridWidth,r=e.layout.gridHeight;if(this.centerX=s/2+(this.cfg.offsetX||0),this.centerY=r/2+(this.cfg.offsetY||0),this.maxRadius=Math.min(s,r)/2.05-this.strokeWidth-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.maxRadius<5)return n;if(this._roots=this._buildHierarchy(),!this._roots.length)return n;this._roots.forEach(t=>this._fillValues(t)),this._validateStrict(),this._nodesAll=[];const a=e.globals.colors||[];this._roots.forEach((t,e)=>{this._colorPass(t,t.color||a[e%a.length]||"#008FFB")}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._ringsG=i.group({class:"apexcharts-sunburst-rings"}),this._labelsG=i.group({class:"apexcharts-sunburst-labels"}),n.add(this._ringsG),n.add(this._labelsG),this._focus=null,this._relayout(this._focus);const o=e.config.chart.animations;let l="none";return o.enabled&&(e.globals.dataChanged?o.dynamicAnimation.enabled&&(l="update"):e.globals.resized||(l="intro")),this._applyLayout(l),this._renderBreadcrumb(),n}_buildHierarchy(){return Et(this.w)}_fillValues(t){Ft(t)}_validateStrict(){"strict"===this.cfg.partition&&zt(this._roots,{type:"sunburst",remedy:"Angles are normalized to fill the wedge."})}_colorPass(t,e){qt(t,e,this.cfg.tint,this._nodesAll)}_relayout(t){this._focusMaxDepth=$t({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:this.startAngle,t1:this.endAngle});const e=jt(this.cfg.innerSize,this.maxRadius,.15),i=It({maxDepth:this._focusMaxDepth,near:e,far:this.maxRadius,gap:1});this._innerR=i.near,this._outerR=i.far,this._nodesAll.forEach(t=>{t._show&&(t._iR=i.near(t._vDepth),t._oR=Bt(t,i,this._focusMaxDepth,this.cfg.leaf,this.maxRadius))})}_applyLayout(t){var e;const i=this.w.config.chart.animations,n=i.enabled?"none"===t?0:"update"===t?i.dynamicAnimation.speed||350:i.speed||500:0,s=++this._zoomGen,r=null==(e=this.ctx)?void 0:e.morphTypeChange,a=!!r&&"function"==typeof r.isActive&&r.isActive()&&"function"==typeof r.getInitialPathAt,o=a?r.getSpeed():0;this._morphLeafIndex=0;const l="update"===t?this.ctx._sunburstPrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i={a0:e._t0,a1:e._t1,iR:e._iR,oR:e._oR};e._el||(e._el=this._createArcEl(e));const r=a?this._morphSourceFor(e):null;if(r&&o>0)this._morphArcFrom(e,r,i,o,s);else if(("intro"===t||a)&&n>0)this._sweepArc(e,i,a?o:n,s);else{let t,r=!1;if(e._cur)t=e._cur;else if(l&&l.get(e._key))t=l.get(e._key);else{const e=(i.a0+i.a1)/2;t={a0:e,a1:e,iR:i.iR,oR:i.iR},r=!0}this._animateArc(e,t,i,n,!1,r,s)}}else if(e._el&&e._cur){const t=(e._cur.a0+e._cur.a1)/2,i={a0:t,a1:t,iR:e._cur.iR,oR:e._cur.iR};this._animateArc(e,e._cur,i,n,!0,!1,s)}});const c=new Map;this._nodesAll.forEach(t=>{t._show&&c.set(t._key,{a0:t._t0,a1:t._t1,iR:t._iR,oR:t._oR})}),this.ctx._sunburstPrevGeoms=c,this._renderLabels(n)}_morphSourceFor(t){const e=this.ctx,i=e&&e.morphTypeChange;return i?"function"==typeof i.hasKeyedMarks&&i.hasKeyedMarks()&&"function"==typeof i.getInitialPathForKey?i.getInitialPathForKey(Pt(t._key)):t.children&&t.children.length?null:i.getInitialPathAt(this._morphLeafIndex++):null}_morphArcFrom(t,e,i,n,s){const r=t._el,a=this._arcPath(i.iR,i.oR,i.a0,i.a1,this.cfg.borderRadius);r.node.style.display="",r.attr({d:e,opacity:1}),t._cur=i,this._zoomGen===s&&new xt(this.w,this.ctx).morphSVG(r,0,null,t._color,e,a,n,0)}_sweepArc(t,e,i,n){const s=t._el,r=this.cfg.borderRadius,a=this.startAngle,o=this.endAngle;s.node.style.display="",s.attr({d:"",opacity:1}),s.animate(i).during(i=>{if(this._zoomGen!==n)return;const l=a+(o-a)*i;if(l<=e.a0+.01)return void s.attr({d:""});const c=Math.min(e.a1,l);s.attr({d:this._arcPath(e.iR,e.oR,e.a0,c,r)}),t._cur={a0:e.a0,a1:c,iR:e.iR,oR:e.oR}}).after(()=>{this._zoomGen===n&&(t._cur=e)})}_createArcEl(t){const e=this._graphics.drawPath({d:"",fill:t._color,stroke:this.strokeColor,strokeWidth:this.strokeWidth,fillOpacity:1,classes:"apexcharts-sunburst-arc"}),i=e.node;return i.setAttribute("data:name",t.name),i.setAttribute("data:value",String(t.value)),i.setAttribute("data:key",Pt(t._key)),i.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(i,t),mt.isBrowser()&&(i.addEventListener("click",()=>this._zoomTo(t)),i.style.cursor="pointer"),this._ringsG.add(e),e}_animateArc(t,e,i,n,s,r,a){const o=t._el,l=this.cfg.borderRadius;if(o.attr({fill:t._color}),0===n)return o.attr({d:this._arcPath(i.iR,i.oR,i.a0,i.a1,l),opacity:s?0:1}),o.node.style.display=s?"none":"",void(t._cur=s?null:i);o.node.style.display="";const c=s?Number(o.attr("opacity"))||1:r?0:1,h=s?0:1;o.attr({opacity:c}),o.animate(n).during(n=>{if(this._zoomGen!==a)return;const s=Zt(e.a0,i.a0,n),r=Zt(e.a1,i.a1,n),u=Zt(e.iR,i.iR,n),d=Zt(e.oR,i.oR,n);o.attr({d:this._arcPath(u,d,s,r,l),opacity:Zt(c,h,n)}),t._cur={a0:s,a1:r,iR:u,oR:d}}).after(()=>{this._zoomGen===a&&(s?(o.node.style.display="none",t._cur=null):t._cur=i)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(t._t1-t._t0<this.cfg.dataLabels.minAngleToShow||this._renderCurvedLabel(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderCurvedLabel(t){if(!mt.isBrowser())return;const e=this.cfg.dataLabels.style,i=this.w,n=(t._iR+t._oR)/2,s=(t._t0+t._t1)/2,r=s>90&&s<270,a=Math.min(n>0?4/n*Ut:0,(t._t1-t._t0)/2),o=r?t._t1-a:t._t0+a,l=r?t._t0+a:t._t1-a,c=this._ptAt(n,o),h=this._ptAt(n,l),u=Math.abs(l-o)>180?1:0,d=r?0:1,p=`apx-sb-lbl-${i.globals.cuid}-${this._lblSeq++}`,f=yt.createElementNS(Kt,"path");f.setAttribute("id",p),f.setAttribute("d",`M ${c.x} ${c.y} A ${n} ${n} 0 ${u} ${d} ${h.x} ${h.y}`),f.setAttribute("fill","none"),f.setAttribute("stroke","none");const g=e.colors,m=(Array.isArray(g)?g[0]:g)||"#fff",y=yt.createElementNS(Kt,"text");y.setAttribute("font-size",e.fontSize||"12px"),e.fontFamily&&y.setAttribute("font-family",e.fontFamily),y.setAttribute("font-weight",String(e.fontWeight||400)),y.setAttribute("fill",m),y.setAttribute("dominant-baseline","central"),y.style.pointerEvents="none";const x=yt.createElementNS(Kt,"textPath");x.setAttribute("href","#"+p),x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+p),x.setAttribute("startOffset","50%"),x.setAttribute("text-anchor","middle"),x.textContent=this._truncate(t.name,n,t._t1-t._t0,e.fontSize),y.appendChild(x),this._labelsG.node.appendChild(f),this._labelsG.node.appendChild(y)}_truncate(t,e,i,n){const s=e*i*Gt-8,r=.58*(parseFloat(n)||12),a=Math.floor(s/r);return a>=t.length?t:a<=1?"":t.slice(0,Math.max(1,a-1))+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=Ht(t,this._focus);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_focusChain(){return Wt(this._focus)}_renderBreadcrumb(){if(!mt.isBrowser())return;const t=this.w.dom.elWrap;if(!t)return;const e=t.querySelector(".apexcharts-breadcrumb");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this._focus)return;const i=yt.createElementNS(Vt,"nav");i.setAttribute("class","apexcharts-breadcrumb"),i.setAttribute("aria-label","Sunburst breadcrumb"),i.style.position="absolute",i.style.top="0px",i.style.left="0px";const n=[{name:"All",node:null}].concat(this._focusChain().map(t=>({name:t.name,node:t})));n.forEach((t,e)=>{if(e>0){const t=yt.createElementNS(Vt,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.textContent=" / ",i.appendChild(t)}if(e===n.length-1){const e=yt.createElementNS(Vt,"span");e.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),e.textContent=t.name,i.appendChild(e)}else{const n=yt.createElementNS(Vt,"button");if(n.setAttribute("type","button"),n.setAttribute("class","apexcharts-breadcrumb-item"),0===e){const t=yt.createElementNS(Vt,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.textContent="\u2190",n.appendChild(t)}const s=yt.createElementNS(Vt,"span");s.setAttribute("class","apexcharts-breadcrumb-label"),s.textContent=t.name,n.appendChild(s),n.addEventListener("click",()=>{this._focus=t.node,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}),i.appendChild(n)}}),t.appendChild(i),this._avoidChromeOverlap(i)}_avoidChromeOverlap(t){!function(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const n=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),s=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!s)break;e.style.top=s.getBoundingClientRect().bottom-n+4+"px"}}(this.w,t)}_ptAt(t,e){return{x:this.centerX+t*Math.cos((e-90)*Gt),y:this.centerY+t*Math.sin((e-90)*Gt)}}_arcPath(t,e,i,n,s){if(e<=t+.01)return"";let r=n-i;const a=this.cfg.spacing;if(a>0&&r>0&&e>0){const t=a/e*Ut,s=Math.min(t/2,Math.max(0,r/2-.25));r=(n-=s)-(i+=s)}if(r<=0)return"";const o=r*Gt,l=this.centerX,c=this.centerY;let h=s;return h=Math.min(h,o*t/2,o*e/2,(e-t)/2),h>.5?function({cx:t,cy:e,rIn:i,rOut:n,a0:s,a1:r,r:a,spanDeg:o}){const l=(i,n)=>Lt(t,e,i,n),c=a/n*kt,h=a/i*kt,u=l(n,s+c),d=l(n,r-c),p=o-2*c>180?1:0,f=l(n,r),g=l(n-a,r),m=l(n,s),y=l(n-a,s),x=l(i,r-h),_=l(i,s+h),b=o-2*h>180?1:0,v=l(i,r),w=l(i+a,r),A=l(i,s),M=l(i+a,s);return["M",St(u),"A",n,n,0,p,1,St(d),"Q",St(f),St(g),"L",St(w),"Q",St(v),St(x),"A",i,i,0,b,0,St(_),"Q",St(A),St(M),"L",St(y),"Q",St(m),St(u),"Z"].join(" ")}({cx:l,cy:c,rIn:t,rOut:e,a0:i,a1:n,r:h,spanDeg:r}):function({cx:t,cy:e,rIn:i,rOut:n,a0:s,a1:r,spanDeg:a}){const o=(i,n)=>Lt(t,e,i,n),l=a>180?1:0,c=o(n,s),h=o(n,r),u=o(i,r),d=o(i,s);return["M",St(c),"A",n,n,0,l,1,St(h),"L",St(u),"A",i,i,0,l,0,St(d),"Z"].join(" ")}({cx:l,cy:c,rIn:t,rOut:e,a0:i,a1:n,spanDeg:r})}}});const Qt="http://www.w3.org/2000/svg",Jt=(t,e,i)=>t+(e-t)*i;g.default.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new Xt(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new _(this.w);this._graphics=i;const n=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return n;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return n;const s=this.cfg.direction;if(this._vertical="right"!==s&&"left"!==s,this._flip="up"===s||"left"===s,this._roots=Et(this.w),!this._roots.length)return n;this._roots.forEach(t=>Ft(t)),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),n=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&n(t[e].children)};n(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&zt(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this._nodesAll=[],this._colorNodes(),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),n.add(this._cellsG),n.add(this._labelsG),this._focus=null,this._relayout(this._focus);const r=e.config.chart.animations;let a="none";return r.enabled&&(e.globals.dataChanged?r.dynamicAnimation.enabled&&(a="update"):e.globals.resized||(a="intro")),this._applyLayout(a),this._renderBreadcrumb(),n}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const n=[];for(;1===i.length&&i[0].children&&i[0].children.length>1;)n.push(i[0]),i=i[0].children;const s=Yt(e,.62);n.forEach(t=>{t._color=t.color||s,this._nodesAll.push(t)}),i.forEach((i,n)=>{qt(i,i.color||t[n%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){const e=this._valueExtent(),i=this.cfg.maxDepth,n="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=Wt(t).length-1;this._focusMaxDepth=$t({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:n?n-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=$t({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:n?n-1:void 0});const s=this._depthExtent(),r=this._focusMaxDepth+1,a="equal"===this.cfg.levelSize?0:jt(this.cfg.levelSize,s,0),o=a>0?Math.min(s,a*r):s,l=It({maxDepth:this._focusMaxDepth,near:0,far:o,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=l.near(t._vDepth),t._d1=Bt(t,l,this._focusMaxDepth,this.cfg.leaf,o))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const n=e/i,s=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-s)*n,r=(t._t1-s)*n;r<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,r))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),n=t._d0,s=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-n-s:n,w:i,h:s}:{x:this._flip?this.width-n-s:n,y:e,w:s,h:i}}_applyLayout(t){const e=this.w.config.chart.animations,i=e.enabled?"none"===t?0:"update"===t||"zoom"===t?e.dynamicAnimation.speed||350:e.speed||500:0,n=++this._zoomGen,s="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const r=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),this._setCursor(e),"intro"===t&&i>0)return void this._wipeCell(e,r,i,n);let a,o=!1;e._cur?a=e._cur:s&&s.get(e._key)?a=s.get(e._key):(a={x:r.x+r.w/2,y:r.y+r.h/2,w:0,h:0},o=!0),this._animateCell(e,a,r,i,!1,o,n)}else if(e._el&&e._cur){const t=e._cur,s={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,s,i,!0,!1,n)}});const r=new Map;this._nodesAll.forEach(t=>{t._show&&r.set(t._key,this._box(t))}),this.ctx._iciclePrevGeoms=r,this._renderLabels(i)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const n=i.node;return n.setAttribute("data:name",t.name),n.setAttribute("data:value",String(t.value)),n.setAttribute("data:key",Pt(t._key)),n.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(n,t),mt.isBrowser()&&!1!==this.cfg.zoomOnClick&&n.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,n){const s=t._el,r=this._focusMaxDepth+1,a=r>1?t._vDepth/r*i*.6:0,o=i-a,l=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(s,l),s.attr({opacity:1}),s.node.style.display="",t._cur=l,s.animate(o,a).during(i=>{if(this._zoomGen!==n)return;const r={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(s,r),t._cur=r}).after(()=>{this._zoomGen===n&&(this._setBox(s,e),t._cur=e)})}_animateCell(t,e,i,n,s,r,a){const o=t._el;if(o.attr({fill:t._color}),0===n)return this._setBox(o,i),o.attr({opacity:s?0:1}),o.node.style.display=s?"none":"",void(t._cur=s?null:i);o.node.style.display="";const l=s?Number(o.attr("opacity"))||1:r?0:1,c=s?0:1;o.attr({opacity:l}),o.animate(n).during(n=>{if(this._zoomGen!==a)return;const s={x:Jt(e.x,i.x,n),y:Jt(e.y,i.y,n),w:Jt(e.w,i.w,n),h:Jt(e.h,i.h,n)};this._setBox(o,s),o.attr({opacity:Jt(l,c,n)}),t._cur=s}).after(()=>{this._zoomGen===a&&(s?(o.node.style.display="none",t._cur=null):(this._setBox(o,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,n=Math.min(i,Math.max(0,e.w-.5))/2,s=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+n,y:e.y+s,width:Math.max(0,e.w-2*n),height:Math.max(0,e.h-2*s)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderLabel(t){if(!mt.isBrowser())return;const e=this.cfg.dataLabels,i=e.style,n=this._box(t),s="always"===e.rotate||"never"!==e.rotate&&n.h>n.w,r=s?n.h:n.w,a=s?n.w:n.h,o=parseFloat(i.fontSize)||12;if(r<e.minSizeToShow)return;if(a<o+2)return;const l=r-8;let c=t.name;if(e.showValue){const e=`${t.name}: ${t.value}`;this._fits(e,l,o)&&(c=e)}const h=this._truncate(c,l,o);if(!h)return;const u=i.colors,d=(Array.isArray(u)?u[0]:u)||"#fff",p=yt.createElementNS(Qt,"text");p.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&p.setAttribute("font-family",i.fontFamily),p.setAttribute("font-weight",String(i.fontWeight||400)),p.setAttribute("fill",d),p.setAttribute("dominant-baseline","central"),p.style.pointerEvents="none",p.textContent=h;const f="center"===e.align?"middle":"right"===e.align?"end":"start",g=n.x+4,m=n.x+n.w-4,y=n.x+n.w/2;if(s){const t=n.x+n.w/2,e=n.y+n.h-4,i=n.y+4,s=n.y+n.h/2,r="middle"===f?s:"end"===f?i:e;p.setAttribute("text-anchor",f),p.setAttribute("x",String(t)),p.setAttribute("y",String(r)),p.setAttribute("transform",`rotate(-90 ${t} ${r})`)}else{const t="middle"===f?y:"end"===f?m:g;p.setAttribute("text-anchor",f),p.setAttribute("x",String(t)),p.setAttribute("y",String(n.y+n.h/2))}this._labelsG.node.appendChild(p)}_renderMoreMark(t){if(!mt.isBrowser())return;const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,n=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,s=yt.createElementNS(Qt,"g");s.setAttribute("class","apexcharts-icicle-more"),s.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=yt.createElementNS(Qt,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:n)),e.setAttribute("cy",String(this._vertical?n:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),s.appendChild(e)}this._labelsG.node.appendChild(s)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const n=.58*i,s=Math.floor(e/n);return s>=t.length?t:s<4?"":t.slice(0,s-1)+"\u2026"}_setCursor(t){mt.isBrowser()&&!1!==this.cfg.zoomOnClick&&(t._el.node.style.cursor=Ht(t,this._focus,this._roots).changed?"pointer":"default")}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=Ht(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!mt.isBrowser())return;if(!this._focus)return void Nt(this.w);const t=Rt(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(Wt(this._focus).map(t=>({label:t.name,data:t}))),n=function(t,e){if(!mt.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;Nt(t);const n=e.config||Rt(t);if(!1===n.show)return null;const s=e.crumbs||[];if(s.length<2)return null;const r=yt.createElementNS(Dt,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,n=e.offsetY||0;t.style.position="absolute",t.style.top=n+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,n),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const a=null!=n.separator?n.separator:" / ";return s.forEach((t,i)=>{var o;if(i>0){const t=yt.createElementNS(Dt,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}let l=0===i?null!=(o=n.rootLabel)?o:"All":t.label;if("function"==typeof n.formatter&&(l=n.formatter(l,{index:i,depth:s.length-1,data:t.data})),i===s.length-1){const t=yt.createElementNS(Dt,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const c=yt.createElementNS(Dt,"button");if(c.setAttribute("type","button"),c.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=yt.createElementNS(Dt,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",c.appendChild(t)}const h=yt.createElementNS(Dt,"span");h.setAttribute("class","apexcharts-breadcrumb-label"),h.textContent=String(l),c.appendChild(h),c.addEventListener("click",()=>e.onNavigate(i,t)),r.appendChild(c)}),i.appendChild(r),r}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});n&&Tt(this.w,this.ctx,n,t)}}});const te="__apexcharts_series_transforms__";function ee(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[te][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}function ie(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),n=i.length;let s=e.bandwidth;if(!("number"==typeof s&&s>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let n=0;n<e;n++)i+=t[n];const n=i/e;let s=0;for(let i=0;i<e;i++){const e=t[i]-n;s+=e*e}return Math.sqrt(s/e)}(i),e=X(i,.75)-X(i,.25);s=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(n,-.2)}if(!isFinite(s)||s<=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*s,o=(i[n-1]+2*s-a)/(r-1),l=1/(n*s*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<n;t++){const n=(e-i[t])/s;r+=Math.exp(-.5*n*n)}c.push([e,r*l])}return{density:c,bandwidth:s}}function ne(t,e){var i,n;const s=null!=(i=t.statsDerived)?i:t.statsDerived={};return null!=(n=s[e])?n:s[e]=new Map}function se(t,e,i){const n=t.get(e);if(!n||!Array.isArray(i)||n.length!==i.length)return!1;for(let t=0;t<i.length;t++){const e=n[t],s=i[t];if(e!==s&&(!Array.isArray(e)||!Array.isArray(s)||e[0]!==s[0]||e[1]!==s[1]))return!1}return!0}globalThis[te]||(globalThis[te]={}),ee("raincloud",function(t,e){var i,n;if(!Array.isArray(t))return t;const s=(null==(i=e.config.plotOptions)?void 0:i.violin)||{},r=s.kde||{},a=(null==(n=s.box)?void 0:n.whiskers)||"minmax",c=ne(e,"raincloudDensity"),h=ne(e,"raincloudSummary");return t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"raincloud"!==t.type&&"violin"!==t.type)return t;let i=!1;const n=t.data.map((t,n)=>{const s=e+":"+n,u=(null==t?void 0:t.y)&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{},d=!Array.isArray(u.density)||!u.density.length||se(c,s,u.density),p=!Array.isArray(u.summary)||5!==u.summary.length||se(h,s,u.summary);if(!d&&!p)return t;const f=function(t){var e;if(!t||"object"!=typeof t||Array.isArray(t))return null;let i=null;if(Array.isArray(t.points)?i=t.points:Array.isArray(null==(e=t.y)?void 0:e.points)?i=t.y.points:Array.isArray(t.y)&&"number"==typeof t.y[0]&&(i=t.y),!i)return null;const n=[];for(let t=0;t<i.length;t++){const e=v.parseNumber(i[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}(t);if(!f)return t;const g=o({},u);if(d){const e=ie(f,{bandwidth:r.bandwidth,resolution:r.resolution});if(!e)return t;g.density=e.density,g.points=f,c.set(s,e.density)}if(p){const t=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),n=X(i,.25),s=X(i,.5),r=X(i,.75),a=r-n;let o=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&a>0){const t=n-1.5*a,e=r+1.5*a;let s=0;for(;s<i.length&&i[s]<t;)s++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;s<=h&&(o=i[s],l=i[h],c=i.slice(0,s).concat(i.slice(h+1)))}return{summary:[o,n,s,r,l],outliers:c,iqr:a}}(f,{whiskers:a});t&&(g.summary=t.summary,h.set(s,t.summary))}return i=!0,l(o({},t),{y:g})});return i?l(o({},t),{data:n}):t})});const re="http://www.w3.org/1999/xhtml";class ae{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!mt.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const n=i.querySelector(".apexcharts-breadcrumb");n&&n.parentNode&&n.parentNode.removeChild(n);const s=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!s||!1===s.show)return;if(0===this.drilldown.depth)return;const r=yt.createElementNS(re,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,s);const a=null!=s.separator?s.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=yt.createElementNS(re,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}const n=this._label(e,i);if(i===t.length-1){const t=yt.createElementNS(re,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=n,r.appendChild(t)}else{const t=yt.createElementNS(re,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=yt.createElementNS(re,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=yt.createElementNS(re,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=n,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&Tt(this.w,this.ctx,r,s),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 n=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),s=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(!s)break;t.style.top=s.getBoundingClientRect().bottom-n+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let n;if(0===e)n=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);n=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(n,{index:e,depth:this.drilldown.depth}):n}_position(t,e){const i=e.offsetX||0,n=e.offsetY||0;t.style.position="absolute",t.style.top=n+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const oe="http://www.w3.org/1999/xhtml",le="apexcharts-drilldown-loading";class ce{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(!mt.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=yt.createElementNS(oe,"div");i.setAttribute("class",le),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const n=yt.createElementNS(oe,"div");if(n.setAttribute("class",`${le}-spinner`),n.setAttribute("aria-hidden","true"),i.appendChild(n),t.text){const e=yt.createElementNS(oe,"span");e.setAttribute("class",`${le}-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(`.${le}`);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 he="__apexDrilldownMarker";g.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 ae(t,e,this),this.loading=new ce(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 n=this._resolveChild(t);return n?this._drillInto(n,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),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],n=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(n),"up",{from:i,to:s})}_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 console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const n=this.path[this.path.length-1],s={id:t.id,name:t.name,restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:n,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const n=this.w.config.drilldown.onDrillDown,s=this._cacheGet(t);if(s)return this._drillInto(s,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=n({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(n=>{if(a(),this._isDead())return this.ctx;if(!n||!n.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 s=null!=n.id?n:l(o({},n),{id:t});return this._cacheSet(t,s),this._drillInto(s,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(v.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=v.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=v.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=v.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?v.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=v.clone(t.plotOptions)),e.has("fill")&&(i.fill=v.clone(t.fill)),e.has("legend")&&(i.legend=v.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,n=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!n.length)return t;const s=e.config.chart.type,r=("pie"===s||"donut"===s||"polarArea"===s)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of n){const n=e.index;i.axisCharts?t[n]&&(t[n].data=Array.isArray(e.data)?e.data.slice():e.data):r[n]&&"object"==typeof r[n]?r[n].y=e.data:void 0!==r[n]&&(r[n]=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){var n;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 r=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(n=this.ctx.highlightFilter)||n.drillView(t);const a=e=>this.ctx.updateOptions(t,!1,e,!1,!1),c=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(r&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>a(!1)).then(c)}return a(r).then(c)}_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(!mt.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const n=e.getBoundingClientRect();let s=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(s=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),s&&"function"==typeof s.getBoundingClientRect){const t=s.getBoundingClientRect();return{x:t.left+t.width/2-n.left,y:t.top+t.height/2-n.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-n.left,y:r.top+r.height/2-n.top}}_zoomDrill(t,e,i){return h(this,null,function*(){const n=this._zoomDuration(),s="down"===e,r=Math.round(.55*n),a=s?"scale(1.03)":"scale(0.97)",o=s?"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 u=this._markGroup();if(u){l(u),u.style.opacity="0",u.style.transform=o,h&&c===u&&h.cancel();const t=u.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:n,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(d=u).style.transform="",d.style.opacity="",d.style.transformOrigin="",d.style.transformBox="",t.cancel()}var d})}_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||this._retired())return;const n=this._pointAt(i.seriesIndex,i.dataPointIndex);return n&&"object"==typeof n&&null!=n.drilldown?this.drillDown(n.drilldown,n,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,n,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const n=i[t];return n&&Array.isArray(n.data)&&null!=n.data[e]?n.data[e]:null}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){const t=this.w;this._retired()||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(!mt.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let n=0;i.forEach((t,i)=>{const s=t&&Array.isArray(t.data)?t.data:null;s&&s.forEach((t,s)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${s}"]`);r.length||n++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),n&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${n} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!mt.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 n=t.target;if(!n||"function"!=typeof n.closest)return;if(n.closest(".apexcharts-drilldown-target"))return;if(n.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const s=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==s||null==r||s<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[s]))return;const a=this._pointAt(s,r);return a&&"object"==typeof a&&null!=a.drilldown?this.drillDown(a.drilldown,a,{seriesIndex:s,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,n=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[he]):[],s=i&&i.marker||{};if(!1===s.show||!Array.isArray(t))return n;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 n={seriesIndex:e,dataPointIndex:i,[he]:!0};void 0!==s.size&&(n.size=s.size),void 0!==s.shape&&(n.shape=s.shape),void 0!==s.fillColor&&(n.fillColor=s.fillColor),void 0!==s.strokeColor&&(n.strokeColor=s.strokeColor),r.push(n)})}),n.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,n=Array.isArray(i)?i[t]:i;return!(Number(n)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});function ue(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function de(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const n=t||{},{hidden:s}=n,r=c(n,["hidden"]);let a=r.data;if(Array.isArray(a)&&!a.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(a=t.data)}return l(o({},r),{data:Array.isArray(a)?a.slice():a})})}function pe(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:n,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function fe(t,e,i){if(t&&t.fillColor)return t.fillColor;const n=i[e];return"string"==typeof n&&n?n:void 0}function ge(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}ee("waterfall",function(t,e){var i,n,s;const r=e.config,a=e.globals;if(!Array.isArray(t))return t;a.waterfallRawSeries||(a.waterfallRawSeries=de(t,a));const c=a.waterfallRawSeries,h=(null==(n=null==(i=r.plotOptions)?void 0:i.waterfall)?void 0:n.colors)||{},u=null==(s=r.xaxis)?void 0:s.categories,d=ue(a),p=[],f=[],g=[],m=c.map((t,e)=>{const i=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==d.indexOf(e))return p[e]=[],f[e]=[],g[e]=[],l(o({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.length)return!0}return!1}(i))return p[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=v.parseNumber(e[0]),n=v.parseNumber(e[1]);return null===i||null===n?null:n-i}),f[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,i=Array.isArray(e)?v.parseNumber(e[1]):null;return null===i?0:i}),g[e]=i.map(()=>null),t;const n=function(t,e,i){const n=[],s=[],r=[],a=[];let c=0,h=0;for(let u=0;u<t.length;u++){const{x:d,y:p,isSubtotal:f,isTotal:g,rest:m}=pe(t[u],u,e);let y,x,_;if(g||f)y=g?0:h,x=c,_=g?"total":"subtotal",h=c;else{const t=v.parseNumber(p);if(null===t||!isFinite(t)){n.push(l(o({},m),{x:d,y:null})),s.push(null),r.push(c),a.push(null);continue}y=c,x=c+t,c=x,_=t<0?"negative":"positive"}const b=fe(m,_,i);n.push(o(l(o({},m),{x:d,y:[y,x]}),b?{fillColor:b}:{})),s.push(x-y),r.push(c),a.push(_)}return{data:n,values:s,cumulative:r,kinds:a}}(i,u,h);return p[e]=n.values,f[e]=n.cumulative,g[e]=n.kinds,l(o({},t),{data:n.data})});return e.waterfallData={values:p,cumulative:f,kinds:g,geometry:[]},m}),g.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 n=null==(e=null==(t=i.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!n||!1===n.show)return;const s=i.dom.elGraphical,r=i.waterfallData&&i.waterfallData.geometry;if(!s||!r)return;this.removeConnectors();const a=new _(i,this.ctx),o=a.group({class:"apexcharts-waterfall-connectors"}),l=n.color||i.config.grid.borderColor,c=null==n.strokeWidth?1:n.strokeWidth,h=null==n.strokeDashArray?3:n.strokeDashArray;let u=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],n=e[t+1];if(!i||!n)continue;if(!(n.slotStart-i.slotEnd>.5))continue;const s=i.horizontal?a.drawLine(i.levelEnd,i.slotEnd,i.levelEnd,n.slotStart,l,h,c):a.drawLine(i.slotEnd,i.levelEnd,n.slotStart,i.levelEnd,l,h,c);s.node.classList.add("apexcharts-waterfall-connector"),o.add(s),u++}}if(!u)return;o.attr("clip-path",`url(#gridRectBarMask${i.globals.cuid})`);const d=s.node.querySelector(".apexcharts-xaxis");d?s.node.insertBefore(o.node,d):s.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;mt.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),ee("dumbbell",function(t,e){var i;const n=e.config,s=e.globals;if(!Array.isArray(t))return t;s.dumbbellRawSeries||(s.dumbbellRawSeries=de(t,s));const r=s.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.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=n.xaxis)?void 0:i.categories,c=ue(s),{xs:h,rows:u,byX:d}=function(t,e){var i;const n=[],s=[],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}=ge(c[t],t,e),u=i instanceof Date?i.getTime():i;r.has(u)||(r.set(u,n.length),n.push(i),s.push(o({},l)));const d=r.get(u);h.set(d,v.parseNumber(a))}a.push(h)}return{xs:n,rows:s,byX:a}}(r,a),p=[],f=[],g=[];for(let t=0;t<r.length;t++)-1===c.indexOf(t)&&g.push(t);const m=[];for(let t=0;t<h.length;t++){const e=[];for(let i=0;i<r.length;i++){const n=d[i].has(t)?d[i].get(t):null;e.push(null!=n&&isFinite(n)?n:null)}p.push(e);let i=null,n=null,s=-1,a=-1;for(let t=0;t<g.length;t++){const r=g[t],o=e[r];null!==o&&((null===i||o<i)&&(i=o,s=r),(null===n||o>n)&&(n=o,a=r))}null!==i&&null!==n?(f.push([s,a]),m.push(l(o({},u[t]),{x:h[t],y:[i,n]}))):(f.push(null),m.push(l(o({},u[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:p,order:f,carrier:g.length?g[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&&g.length?m:[]}))});class me{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)/me.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*me.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,n=i&&i.querySelector(".apexcharts-svg");if(!n)return e-t.layout.translateX;const s=n.getBoundingClientRect(),r=t.globals.svgWidth?s.width/t.globals.svgWidth:1;return(e-s.left)/(r||1)-t.layout.translateX}}const ye=["wiggle","silhouette","zero","expand"],xe=["inside-out","inverse","none"];function _e(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}ee("streamgraph",function(t,e){var i,n;const s=e.config,r=e.globals;if(!Array.isArray(t))return t;r.streamgraphRawSeries||(r.streamgraphRawSeries=de(t,r));const a=r.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(i=s.plotOptions)?void 0:i.streamgraph)||{},h=-1!==ye.indexOf(c.offset)?c.offset:"wiggle",u=-1!==xe.indexOf(c.order)?c.order:"inside-out",d=null==(n=s.xaxis)?void 0:n.categories,p=ue(r),{xs:f,rows:g,grids:m}=function(t,e){var i;const n=[],s=[],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}=_e(c[t],t,e),u=i instanceof Date?i.getTime():i;r.has(u)||(r.set(u,n.length),n.push(i),s.push(o({},l))),h.set(r.get(u),v.parseNumber(a))}a.push(h)}return{xs:n,rows:s,grids:a}}(a,d),y=function(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i]instanceof Date?t[i].getTime():t[i];if("number"!=typeof n||!isFinite(n))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 n=i.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(f),x=y?y.map(t=>f[t]):f,_=y?y.map(t=>g[t]):g,b=x.length;let w=!1;const A=[];for(let t=0;t<a.length;t++){const e=new Array(b);for(let i=0;i<b;i++){const n=m[t].get(y?y[i]:i);let s=null==n?0:Number(n);isFinite(s)||(s=0),s<0&&(w=!0,s=0),e[i]=s}A.push(e)}w&&!r.streamgraphWarnedNegative&&(r.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const M=[];for(let t=0;t<a.length;t++)-1===p.indexOf(t)&&M.push(t);let k=A;if("expand"===h){k=A.map(t=>t.slice());for(let t=0;t<b;t++){let e=0;for(let i=0;i<M.length;i++)e+=k[M[i]][t];if(e)for(let i=0;i<M.length;i++)k[M[i]][t]/=e}}const L=function(t,e,i){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},s={};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);n[r]=o,s[r]=c}const r=e.slice().sort((t,e)=>s[t]-s[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+=n[e],l.push(e)):(o+=n[e],c.push(e))}return c.reverse().concat(l)}(u,M,k),S=function(t,e,i,n){const s=new Array(n).fill(0);if(0===n||0===e.length)return s;if("zero"===t||"expand"===t)return s;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let s=0;s<e.length;s++)n+=i[e[s]][t];s[t]=-n/2}return s}let r=0;for(let t=1;t<n;t++){let n=0,a=0;for(let s=0;s<e.length;s++){const r=i[e[s]],o=r[t];let l=(o-r[t-1])/2;for(let n=0;n<s;n++){const s=i[e[n]];l+=s[t]-s[t-1]}n+=o,a+=l*o}n&&(r-=a/n),s[t]=r}return s}(h,L,k,b),C=a.map(()=>null),E=a.map(()=>null);for(let t=0;t<L.length;t++)C[L[t]]=new Array(b),E[L[t]]=new Array(b);for(let t=0;t<b;t++){let e=S[t];for(let i=0;i<L.length;i++){const n=L[i],s=C[n],r=E[n];s[t]=e,e+=k[n][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:x,values:A,lows:C,highs:E,order:L,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==p.indexOf(t))},a.map((t,e)=>{const i=C[e],n=E[e];if(!i||!n)return l(o({},t),{data:[]});const s=new Array(b);for(let t=0;t<b;t++)s[t]=l(o({},_[t]),{x:x[t],y:[i[t],n[t]]});return l(o({},t),{data:s})})}),g.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,n=i.globals,s=i.layout.gridHeight,r=n.maxY-n.minY;if(!r||!isFinite(r))return s/2;const a=(t-n.minY)/r;return(null==(e=i.config.yaxis[0])?void 0:e.reversed)?a*s:s-a*s}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,i,n,s,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 u=new _(o,this.ctx),d=u.group({class:"apexcharts-streamgraph-labels"}),p=(null==(i=l.style)?void 0:i.fontSize)||"auto",f=(null==(n=l.style)?void 0:n.fontFamily)||o.config.chart.fontFamily,g=(null==(s=l.style)?void 0:s.fontWeight)||600,m=null==l.minWidth?24:l.minWidth,y=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],i=this._placeLabel(e,{fontSize:p,fontFamily:f,fontWeight:g,minWidth:m,graphics:u});i&&y.push(i)}let x=0;for(const t of this._deconflict(y)){const e=t.k,i=u.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:f,fontWeight:g,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)),d.add(i),x++}if(!x)return;const b=c.node.querySelector(".apexcharts-xaxis");b?c.node.insertBefore(d.node,b):c.add(d),this.holdUntilBandsLand(d)}_placeLabel(t,{fontSize:e,fontFamily:i,fontWeight:n,minWidth:s,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],u=l.length;if(!Array.isArray(h)||h.length<u||0===u)return null;const d=new Array(u);let p=0;for(let t=0;t<u;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));d[t]=e,e>p&&(p=e)}if(p<=0)return null;const f=this._resolveFontSize(e,p),g=String(o.names[t]);let m=f,y=r.getTextRects(g,`${m}px`,i,"",!0,n);if(p<y.height+6)return null;const x=this._widestRun(d,h,y.height+6,u);if(!x)return null;if(y.width>x.width&&"auto"===e){const t=Math.floor(m*(x.width/y.width));if(t<this._autoBounds().min)return null;if(m=t,y=r.getTextRects(g,`${m}px`,i,"",!0,n),p<y.height+6)return null}const _=y.height+6,b=[];for(const e of this._runs(d,_,u)){const n=Number(h[e.l]),a=Number(h[e.r]);if(!isFinite(n)||!isFinite(a))continue;let o=a-n;if(o<=0&&u>1){const t=Math.abs(Number(h[Math.min(e.r+1,u-1)])-Number(h[Math.max(e.l-1,0)]));o=isFinite(t)?t:0}if(o<s||o<.35*y.width)continue;const d=y.width<=o?g:r.getTextBasedOnMaxWidth({text:g,maxWidth:o,fontSize:`${m}px`,fontFamily:i});if(!d||"..."===d)continue;const p=d===g?y.width:y.width*(d.length/g.length),f=[n+o/2];o>2.2*p&&f.push(n+p/2+2,a-p/2-2);for(const i of f){let n=e.l,s=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-i);e<s&&(s=e,n=t)}b.push({x:i,y:(this._yPx(l[n])+this._yPx(c[n]))/2,text:d,color:this._contrastOn(t),fontSize:`${m}px`,width:p,height:y.height})}if(b.length>=6)break}return b.length?{k:t,weight:p,candidates:b}:null}_runs(t,e,i){const n=[];let s=0;for(;s<i;){if(t[s]<e){s++;continue}let r=s,a=t[s];for(;r+1<i&&t[r+1]>=e;)r++,t[r]>a&&(a=t[r]);n.push({l:s,r:r,maxT:a}),s=r+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,i,n){let s=-1;for(const r of this._runs(t,i,n)){const t=Number(e[r.r])-Number(e[r.l]);isFinite(t)&&t>s&&(s=t)}return s>=0?{width:s}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),i=[],n=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 s={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(n(s)){i.push(l(o({k:t.k},e),{box:s}));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:n}=this._autoBounds();return Math.max(i,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const i=this.w,n=null==(e=i.globals.colors)?void 0:e[t],s="string"==typeof n?v.parseHex(n):null;return s?v.relativeLuminance(s)>.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(!mt.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 n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const s=n.getBoundingClientRect(),r=e.globals.svgWidth?s.width/e.globals.svgWidth:1,a=me.screenXToPlotPx(e,t.clientX),o=(t.clientY-s.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 u=-1,d=1/0;for(let t=0;t<i.order.length;t++){const e=i.order[t],n=this._yPx(i.highs[e][h]),s=this._yPx(i.lows[e][h]),r=Math.min(n,s),a=Math.max(n,s);if(o>=r&&o<=a)return e;const l=o<r?r-o:o-a;l<d&&(d=l,u=e)}return u}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const i=this._hoverCfg(),n=null==i.opacity?.35:i.opacity,s=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<s.length;t++){const e=s[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}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;mt.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});const be=g.__apex_Resize_addResizeListener,ve=g.__apex_Resize_removeResizeListener;class we{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,i={}){return this.ctx.graphics.drawMarker(t,e,i)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const Ae=["none","lighten","darken"];function Me(t){const e=t.config.series||[],i=t.config.chart.type,n="scatter"===i||"bubble"===i,s=t.config.markers&&t.config.markers.size,r=Array.isArray(s)?s.some(t=>t>0):(s||0)>0,a=!(!t.config.dataLabels||!t.config.dataLabels.enabled),o="heatmap"===i;let l=0,c=0;e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>c&&(c=e),(n||r||o)&&(l+=e),a&&(l+=e)});return c>=5e4&&(l=Math.max(l,c)),l}function ke(t){var e,i,n,s;const r=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(r)?r.some(a):a(r))return!0;const o=null==(i=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:i.colors;if(o&&o.colorAboveThreshold&&o.colorBelowThreshold)return!0;if("heatmap"===t.config.chart.type&&"rect"!==((null==(s=null==(n=t.config.plotOptions)?void 0:n.heatmap)?void 0:s.shape)||"rect"))return!0;const l=t.config.states||{},c=l.hover&&l.hover.filter&&l.hover.filter.type,h=l.active&&l.active.filter&&l.active.filter.type;return!(!c||Ae.includes(c))||!(!h||Ae.includes(h))}const Le="__apexcharts_renderers__";function Se(){const t=globalThis;return t[Le]||(t[Le]=new Map),t[Le]}class Ce{static get _rendererRegistry(){return Se()}static registerRenderer(t,e){Se().set(t,e)}static unregisterRenderer(t){Se().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new we(t,e),this.active=this.svg,this._activeKind="svg",this._instances={},this.w.globals.activeRenderer=this.active}_activate(t,e){this.active=e,this._activeKind=t,this.ctx.renderer=e,this.w.globals.activeRenderer=e}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";if(!mt.isBrowser())return"svg";if("svg"===e)return"svg";if(ke(this.w))return"svg";if("canvas"===e)return"canvas";return Me(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const i=Se().get(e);if(i)return this._instances[e]||(this._instances[e]=i(this.w,this.ctx)),this._activate(e,this._instances[e]),this._activeKind;t===e&&function(t,e,i={}){const{module:n=`features/${e}`,entry:s,scripts:r=[`features/${e}.js`],tail:a}=i,o=r.map(t=>`<script src='.../dist/${t}'>`).join(" and ");globalThis.console.warn(`ApexCharts: ${t} requires the ${e} feature, which is not in this bundle. Bundler: import 'apexcharts/${n}'`+(s?` (or from 'apexcharts/${s}')`:"")+`. Script tag: add ${o} after the ApexCharts script, or load apexcharts.full.min.js instead.`+(a?` ${a}`:""))}(`\`chart.renderer: '${e}'\``,`renderer-${e}`,{tail:"Falling back to SVG."})}else"canvas"===t&&ke(this.w)&&console.warn('[apexcharts] renderer:"canvas" requested but this chart uses a feature the canvas renderer does not render yet (gradient/pattern/image fill or a state color-matrix filter); falling back to SVG.');return this._activate("svg",this.svg),this._activeKind}pendingKind(){const t=this._desiredKind();return"svg"===t||Se().has(t)?t:"svg"}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg",this.w.globals.activeRenderer=null}}const Ee=g.__apex_helpers_InitCtxVariables;function Fe(t){if(!Array.isArray(t)||0===t.length)return"empty";for(let e=0;e<t.length;e++){const i=t[e];if(null!=i)return Array.isArray(i)?"paired":"object"==typeof i?"object":"plain"}return"empty"}function Pe(t,e){if(null!=t){if("paired"===e){const e=t[0];return e instanceof Date?e.getTime():e}if("object"===e){const e=t.x;return e instanceof Date?e.getTime():e}}}function De(t,e){return"paired"===e?[t,null]:"object"===e?{x:t,y:null}:null}function Re(t,e,i){const n="function"==typeof i?i(t,e):t?t[i]:void 0;return null==n||""===n?null:String(n)}function Te(t,e){if(!e||"first-seen"===e)return t.slice();if("asc"===e||"desc"===e){const i=t.slice().sort((t,e)=>{const i=Number(t),n=Number(e);return isFinite(i)&&isFinite(n)?i-n:t<e?-1:t>e?1:0});return"desc"===e?i.reverse():i}if(Array.isArray(e)){const i=e.map(String).filter(e=>-1!==t.indexOf(e)),n=t.filter(t=>-1===i.indexOf(t));return i.concat(n)}return"function"==typeof e?t.slice().sort(e):t.slice()}function Ne(t,e){const i=[],n=new Set;let s=!1,r=!1,a=0,o="plain";t.forEach(t=>{const e=Fe(t&&t.data);if("empty"!==e){if("plain"===e)return r=!0,void(a=Math.max(a,t.data.length));s=!0,o=e,t.data.forEach(t=>{const s=Pe(t,e);if(void 0===s)return;const r=typeof s+":"+String(s);n.has(r)||(n.add(r),i.push(s))})}}),s&&r&&e.push("trellis: mixing x-keyed data ([x,y] / {x,y}) with plain value arrays; plain series are padded by position, not by x");const l=s&&i.every(t=>"number"==typeof t&&isFinite(t));return l&&i.sort((t,e)=>Number(t)-Number(e)),{unionX:i,sawKeyed:s,plainMaxLen:a,xForm:o,xIsNumeric:l}}const Oe=["scatter","bubble"];function $e(t,e,i=!0){const n=[],s=new Set;let r=0;return{align:a=>{const c=Fe(a&&a.data),h=a&&null!=a.name?String(a.name):`series-${r+1}`;r++,s.has(h)||(s.add(h),n.push(h));const u=l(o({},a),{name:h});if(!i)return u.data=Array.isArray(a.data)?a.data.slice():[],u;if("plain"===c||"empty"===c){const e=t.sawKeyed?t.unionX.length:t.plainMaxLen,i=Array.isArray(a.data)?a.data.slice(0,e):[];for(;i.length<e;)i.push(null);if(u.data=i,Array.isArray(a.highlightData)){const t=a.highlightData.slice(0,e);for(;t.length<e;)t.push(null);u.highlightData=t}return u}const d=new Map,p=new Map,f=Array.isArray(a.highlightData)?a.highlightData:null;return a.data.forEach((t,i)=>{const n=Pe(t,c);void 0===n||d.has(n)?void 0!==n&&d.has(n)&&e.push(`trellis: duplicate x "${String(n)}" in series "${h}"; keeping the first`):(d.set(n,t),f&&p.set(n,f[i]))}),u.data=t.unionX.map(t=>d.has(t)?d.get(t):De(t,c)),f&&(u.highlightData=t.unionX.map(t=>p.has(t)?p.get(t):null)),u},seriesNames:n}}function Ie(t,e={}){const i=t.xForm,n={bar:0,column:0,rangeBar:[0,0],candlestick:[0,0,0,0],boxPlot:[0,0,0,0,0]},s=e.chartType&&e.chartType in n?n[e.chartType]:null,r="plain"===i?t.unionX.map(()=>s):t.unionX.map(t=>{if(null===s)return De(t,i);const e=Array.isArray(s)?s.slice():s;return"object"===i?{x:t,y:e}:[t,e]});return{name:e.name||t.seriesNames[0]||"series-1",data:r}}function Be(t,e={},i={}){const n=[],s=Array.isArray(t)?t:[],r=(a=i.chartType,!Oe.includes(a||""));var a;if(e.row||e.column)return e.by&&n.push("trellis: `by` is ignored when `row`/`column` are set (they are mutually exclusive)"),function(t,e,i,n=!0){const s=e.row,r=e.column,a=new Map,o=new Map,l=new Map,c=[],h=[],u=[],d=(t,e)=>{-1===t.indexOf(e)&&t.push(e)};if(t.forEach((t,e)=>{var i,n;const p=s?Re(t,e,s):"",f=r?Re(t,e,r):"";if(null===p&&null===f)return void c.push(t);if(null===p)return d(u,f),l.has(f)||l.set(f,[]),void(null==(i=l.get(f))||i.push(t));if(null===f)return d(h,p),o.has(p)||o.set(p,[]),void(null==(n=o.get(p))||n.push(t));d(h,p),d(u,f);let g=a.get(p);g||(g=new Map,a.set(p,g));let m=g.get(f);m||(m=[],g.set(f,m)),m.push(t)}),!h.length&&!u.length)return ze(["trellis: no series carries the row/column facet keys; nothing to split"]);"number"==typeof e.limit&&e.limit>0&&i.push("trellis: `limit` is not applied to a 2-D grid; ignoring it");const p=Te(h.length?h:[""],e.order),f=Te(u.length?u:[""],e.order),g=Ne(t,i),{align:m,seriesNames:y}=$e(g,i,n),x=[];return p.forEach(t=>{f.forEach(e=>{var i;const n=((null==(i=a.get(t))?void 0:i.get(e))||[]).concat(o.get(t)||[]).concat(l.get(e)||[]).concat(c).map(m);x.push({key:[t,e].filter(t=>""!==t).join(" / ")||"all",rowKey:t,colKey:e,series:n,seriesNames:n.map(t=>t.name),empty:0===n.length})})}),{mode:"2d",panels:x,rowKeys:p,colKeys:f,seriesNames:y,xForm:g.sawKeyed?g.xForm:"plain",unionX:g.sawKeyed?g.unionX:Array.from({length:g.plainMaxLen},(t,e)=>e),xIsNumeric:g.xIsNumeric,dropped:0,warnings:i}}(s,e,n,r);const o=e.by||"facet",l=new Map,c=[];if(s.forEach((t,e)=>{const i=Re(t,e,o);if(null===i)c.push(t);else{l.has(i)||l.set(i,[]);const e=l.get(i);e&&e.push(t)}}),0===l.size)return ze(["trellis: no series carries the facet key; nothing to split"]);let h=Te(Array.from(l.keys()),e.order),u=0;"number"==typeof e.limit&&e.limit>0&&h.length>e.limit&&(u=h.length-e.limit,h=h.slice(0,e.limit));const d=Ne(h.reduce((t,e)=>t.concat(l.get(e)||[]),[]).concat(c),n),{align:p,seriesNames:f}=$e(d,n,r);return{mode:"1d",panels:h.map(t=>{const e=(l.get(t)||[]).map(p),i=c.map(p),n=e.concat(i);return{key:t,rowKey:null,colKey:null,series:n,seriesNames:n.map(t=>t.name),empty:0===n.length}}),rowKeys:null,colKeys:null,seriesNames:f,xForm:d.sawKeyed?d.xForm:"plain",unionX:d.sawKeyed?d.unionX:Array.from({length:d.plainMaxLen},(t,e)=>e),xIsNumeric:d.xIsNumeric,dropped:u,warnings:n}}function ze(t){return{mode:"1d",panels:[],rowKeys:null,colKeys:null,seriesNames:[],xForm:"plain",unionX:[],xIsNumeric:!1,dropped:0,warnings:t}}const We=["heatmap","pie","donut","polarArea","radialBar"],He=["pie","donut","polarArea"];function je(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const n=t[i];let s=n;Array.isArray(n)?s=1===n.length?n[0]:n[1]:n&&"object"==typeof n&&(s=void 0!==n.y?n.y:n.x);const r=Number(s);null!=s&&isFinite(r)&&e.push(r)}return e}function Ye(t,e,i,n){var s,r,a,o,l,c;const h={plotOptions:null,yExtentOverride:null,skipYaxisPush:We.includes(n),forceSharedY:!1,pieScaleOf:null,warnings:[]},u=t.panels,d=(null==i?void 0:i.plotOptions)||{};if("histogram"===n){const t=d.histogram||{};let i=[];const n=u.map(t=>t.series.map(t=>{const e=je(t.data);return i=i.concat(e),e})),r=G(i,{bins:t.bins,binWidth:t.binWidth,range:t.range});if(r&&r.edges.length>1){const i=r.edges;h.plotOptions={histogram:{range:[i[0],i[i.length-1]],binWidth:r.binWidth}};let a=0;n.forEach(e=>e.forEach(e=>{if(!e.length)return;(function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const n=t.reduce((t,e)=>t+e,0);if(n<=0)return i;if("relative"===e.normalize)return i.map(t=>t/n*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(n*t))}return i})(function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let n=0;n<t.length;n++){const s=U(t[n],e);s>=0&&i[s]++}return i}(e,i),{normalize:t.normalize,cumulative:t.cumulative,binWidth:r.binWidth}).forEach(t=>{isFinite(t)&&t>a&&(a=t)})})),a>0&&(h.yExtentOverride={min:0,max:a});const o=(null==(s=e.scales)?void 0:s.y)||"shared";"independent-row"!==o&&"independent-column"!==o||(h.forceSharedY=!0,h.warnings.push("histogram trellis: group y scales would re-derive counts per group; using scales.y 'shared' (use 'independent' for per-panel count scales)."))}}if("violin"===n){const t=(null==(r=d.violin)?void 0:r.kde)||{};if(!("number"==typeof t.bandwidth&&t.bandwidth>0)){let t=[];u.forEach(e=>e.series.forEach(e=>{t=t.concat(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{const i=t&&"object"==typeof t?t.y:null;Array.isArray(i)&&i.forEach(t=>{const i=Number(t);null!=t&&isFinite(i)&&e.push(i)})}),e):e}(e.data))}));const e=t.length?ie(t,{resolution:8}):null;e&&isFinite(e.bandwidth)&&e.bandwidth>0&&(h.plotOptions={violin:{kde:{bandwidth:e.bandwidth}}})}}if("heatmap"===n){"independent"===(null==(a=e.scales)?void 0:a.color)&&h.warnings.push("a heatmap trellis must share its color scale (the same color meaning different values per panel is a silent lie); ignoring scales.color 'independent'.");const t=null==(l=null==(o=d.heatmap)?void 0:o.colorScale)?void 0:l.ranges;if(!(Array.isArray(t)&&t.length>0)){let t=1/0,e=-1/0;u.forEach(i=>i.series.forEach(i=>{je(i.data).forEach(i=>{i<t&&(t=i),i>e&&(e=i)})})),isFinite(t)&&isFinite(e)&&(h.plotOptions={heatmap:{colorScale:{min:t,max:e}}})}}if("bubble"===n){"independent"===(null==(c=e.scales)?void 0:c.size)&&h.warnings.push("a bubble trellis must share its size scale; ignoring scales.size 'independent'.");let t=1/0,i=-1/0;u.forEach(e=>e.series.forEach(e=>{(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{let i=null;Array.isArray(t)&&t.length>2?i=t[2]:t&&"object"==typeof t&&(i=t.z);const n=Number(i);null!=i&&isFinite(n)&&e.push(n)}),e):e})(e.data).forEach(e=>{e<t&&(t=e),e>i&&(i=e)})})),isFinite(t)&&isFinite(i)&&(h.plotOptions={bubble:{minZ:t,maxZ:i}})}if(He.includes(n)&&e.radiusByTotal){const t=new Map;let e=0;u.forEach(i=>{let n=0;i.series.forEach(t=>{je(t.data).forEach(t=>{n+=Math.abs(t)})}),t.set(i.key,n),n>e&&(e=n)}),e>0&&(h.pieScaleOf=i=>{const n=t.get(i);return"number"!=typeof n||n<=0?null:Math.sqrt(n/e)})}return h}const qe=g.__apex_ThemePalettes_getThemePalettes;function Xe(t,e,i=3){if(!isFinite(t)||!isFinite(e))return{min:0,max:1,tickAmount:1};if(t===e){const i=0===t?1:.1*Math.abs(t);t-=i,e+=i}const n=Math.max(1,i),s=(e-t)/n,r=Math.pow(10,Math.floor(Math.log10(s)));let a={dist:1/0,ticks:0,min:0,max:1};return(r>=10?[1,2,2.5,5,10]:[1,2,5,10]).forEach(i=>{const s=i*r,o=Math.floor(t/s)*s,l=Math.ceil(e/s)*s,c=Math.max(1,Math.round((l-o)/s)),h=Math.abs(c-n);(h<a.dist||h===a.dist&&c<a.ticks)&&(a={dist:h,ticks:c,min:o,max:l})}),{min:a.min,max:a.max,tickAmount:a.ticks}}function Ge(t,e,i){if(null==t)return;let n=t;if("paired"===e?n=t[1]:"object"===e&&(n=t.y),null==n)return;if(Array.isArray(n)){for(let t=0;t<n.length;t++){const e=Number(n[t]);isFinite(e)&&(e<i.min&&(i.min=e),e>i.max&&(i.max=e))}return}const s=Number(n);isFinite(s)&&(s<i.min&&(i.min=s),s>i.max&&(i.max=s))}function Ue(t,e,i){const n=e&&"object"==typeof e&&!Array.isArray(e)&&"highlight"in e?e.highlight:Array.isArray(t.highlightData)?t.highlightData[i]:null;return"number"==typeof n&&isFinite(n)?n:null}function Ke(t){if("number"!=typeof t||!isFinite(t)||t%1==0)return 0;const e=String(t);return-1!==e.indexOf("e")||-1!==e.indexOf("E")?4:Math.min(4,(e.split(".")[1]||"").length)}function Ve(t,e,i={}){const n={min:1/0,max:-1/0},s=t=>{isFinite(t)&&(t<n.min&&(n.min=t),t>n.max&&(n.max=t))};return t.forEach(t=>{const r=new Map;t.series.forEach(t=>{var s;if(!Array.isArray(t.data))return;if(!function(t,e){if(!e.stackOnlyBar)return!0;const i=t&&t.type;return null==i||"bar"===i||"column"===i}(t,i))return void t.data.forEach(t=>Ge(t,e,n));const a=String(null!=(s=t.group)?s:""),o=t=>{const e=r.get(t)||{pos:[],neg:[]};return r.set(t,e),e},l=o(a),c=i.parts?o("~"+a):null;t.data.forEach((i,n)=>{[l,c].forEach((s,r)=>{if(!s)return;void 0===s.pos[n]&&(s.pos[n]=0,s.neg[n]=0);const a=r?Ue(t,i,n):(t=>{if(null==t)return null;const i="paired"===e?t[1]:"object"===e?t.y:t;if(null==i||Array.isArray(i))return null;const n=Number(i);return isFinite(n)?n:null})(i);null!==a&&(a>0?s.pos[n]+=a:s.neg[n]+=a)})})}),r.forEach(t=>{t.pos.forEach(s),t.neg.forEach(s)})}),isFinite(n.min)&&isFinite(n.max)?n:null}function Ze(t,e={},i={}){const n=e.scales||{},s=n.x||"shared",r=n.y||"shared";let a=null;if("shared"===s&&t.xIsNumeric&&t.unionX.length){const e=t.unionX;a={min:e[0],max:e[e.length-1]}}const o=["bar","column","histogram"].includes(i.chartType||""),l=t=>t?(o&&t.min>0&&(t.min=0),Xe(t.min,t.max,e.targetTicks||3)):null,c=!!i.stacked&&"100%"===i.stackType,h=!!i.stacked&&!c,u=e=>c?{min:0,max:100}:h?Ve(e,t.xForm,{stackOnlyBar:i.stackOnlyBar,parts:i.parts}):function(t,e,i=!1){const n={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((s,r)=>{Ge(s,e,n);const a=i?Ue(t,s,r):null;null!==a&&Ge(a,"plain",n)})})),isFinite(n.min)&&isFinite(n.max)?n:null}(e,t.xForm,i.parts);let d=null;"shared"===r&&(d=l(i.yExtentOverride||u(t.panels)));let p=null;if("independent-row"===r){p=new Map;const e=new Map;t.panels.forEach(t=>{var i;const n=null!=(i=t.rowKey)?i:"";e.has(n)||e.set(n,[]),e.get(n).push(t)}),e.forEach((t,e)=>{const i=l(u(t));i&&(null==p||p.set(e,i))})}let f=null;if("independent-column"===r){f=new Map;const e=new Map;t.panels.forEach(t=>{var i;const n=null!=(i=t.colKey)?i:"";e.has(n)||e.set(n,[]),e.get(n).push(t)}),e.forEach((t,e)=>{const i=l(u(t));i&&(null==f||f.set(e,i))})}const g=qe().palette1,m=Array.isArray(i.userColors)?i.userColors.filter(t=>"string"==typeof t):[],y=m.length?m:g,x=t.seriesNames;return{x:a,y:d,rowY:p,colY:f,colorOf:t=>{const e=x.indexOf(t);return y[(-1===e?0:e)%y.length]},palette:y}}function Qe({panelCount:t,containerWidth:e,cfg:i,hostHeight:n,chromeHeight:s}){var r,a;const o=null!=(r=i.gap)?r:12,l=function(t,e,i={}){var n,s;const r=null!=(n=i.gap)?n:12;if("number"==typeof i.columns&&i.columns>0)return Math.max(1,Math.min(Math.floor(i.columns),e));const a=null!=(s=i.minPanelWidth)?s:220,o=Math.floor((t+r)/(a+r));return Math.max(1,Math.min(o,e))}(e,t,i),c=Math.max(1,Math.ceil(t/l)),h=!i.header||!1!==i.header.show?22:0,u=Math.max(0,s||0),d=c*h+o*(c-1)+u,p="number"==typeof n&&n>0?n:0,f=Math.max(0,(e-o*(l-1))/l);let g;g="number"==typeof i.panelHeight&&i.panelHeight>0?i.panelHeight:p>0?(p-d)/c:f/(null!=(a=i.aspectRatio)?a:1.6);const m="number"==typeof i.minPanelHeight&&i.minPanelHeight>0?i.minPanelHeight:80;g=Math.max(m,Math.round(g));const y=c*(g+h)+o*(c-1),x=p>0?Math.max(0,y+u-p):0,_=i.axes&&i.axes.labels||"edges",b=i.scales||{},v=1===l,w=Array.from({length:t},(e,i)=>{const n=Math.floor(i/l),s=i%l;let r,a;return"none"===_?(r=!1,a=!1):"all"===_||v?(r=!0,a=!0):(r="independent"===b.x||n===function(t,e,i,n){return t<e-(n-1)*i?n-1:n-2}(s,t,l,c),a="independent"===b.y||"independent-column"===b.y||0===s),{i:i,r:n,c:s,showXLabels:r,showYLabels:a}});return{cols:l,rows:c,panelW:f,panelH:g,headerH:h,gap:o,cells:w,gridH:y,overflowH:x}}const Je=["#cf4d3f","#8f9499","#26a75b"],ti=(t,e,i)=>t+(e-t)*i;function ei(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function ii(t,e,i){const n=v.parseHex(ni(t)),s=v.parseHex(ni(e));return n&&s?"#"+ei(ti(n[0],s[0],i))+ei(ti(n[1],s[1],i))+ei(ti(n[2],s[2],i)):t}function ni(t){if("string"!=typeof t)return"#000000";if(v.isColorHex(t))return t;return v.rgb2hex(t)||"#000000"}function si(t,e,i,n){var s,r,a;if(!e||"object"!=typeof e)return null;const o=null==(a=null==(r=null==(s=t.config.plotOptions)?void 0:s.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:n,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function ri(t){var e,i,n;const s=null==(n=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:n.colorScale,r=s&&s.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 n=0;n<i.length;n++){const s=si(t,i[n],e,n);null!=s&&(c=!0,s<o&&(o=s),s>l&&(l=s))}}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,u=Number.isFinite(Number(r.max))?Number(r.max):l,d=null;if(null===r.midpoint?d=null:Number.isFinite(Number(r.midpoint))?d=Number(r.midpoint):h<0&&u>0&&(d=0),null!=d&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(h-d),Math.abs(u-d));h=d-t,u=d+t}u===h&&(h-=.5,u+=.5);const p=function(t,e,i,n){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:ni(t.color)})).sort((t,e)=>t.value-e.value);const s=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:Je).map(ni),r=s.length;if(null!=n&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:ti(e,n,i/t),color:s[i]});for(let e=t+1;e<r;e++)a.push({value:ti(n,i,(e-t)/(r-1-t)),color:s[e]});return a}return s.map((t,n)=>({value:ti(e,i,n/(r-1)),color:t}))}(r,h,u,d);if(p.length<2)return null;const f=u-h,g=p.map(t=>({percent:0===f?0:(t.value-h)/f,color:t.color}));return{min:h,max:u,midpoint:d,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const i=p[e];if(t<=i.value){const n=p[e-1],s=i.value-n.value,r=0===s?0:(t-n.value)/s;return ii(n.color,i.color,r)}}return e.color},legendStops:g}}const ai=g.__apex_tooltip_Utils,oi="http://www.w3.org/2000/svg";class li{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,n,s,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==(s=null==(n=null==t?void 0:t.config)?void 0:n.plotOptions)?void 0:s[a])?void 0:r.colorScale)||null}static configFor(t){const e=li.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return li.configFor(this.w)||{}}static isEnabled(t){if(!li.supports(t))return!1;const e=li.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===n||"treemap"===n}draw(t=null){var e,i,n,s,r,a,o,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const u=this._cfg(),d=c.config.legend.position,p="left"===d||"right"===d,f=null!=(i=null==(e=u.arrow)?void 0:e.size)?i:8,g=f+4,m=u.showLabels?28:4,y=u.showLabels?20:4,x=u.showLabels?44:0,_=this._resolveStripLength(p?u.height:u.width,p),b=u.thickness,v=p?Math.max(b+g+4,x):_+2*m,w=p?_+2*y:b+g+4,A=(v-(b+g))/2,M=p?"left"===d?A:A+g:m,k=p?y:"top"===d?g:4,L=yt.createElementNS(oi,"svg");L.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),L.setAttribute("width",String(v)),L.setAttribute("height",String(w)),L.setAttribute("overflow","visible");const S=yt.createElementNS(oi,"defs"),C=`apexcharts-heatmap-gradient-${c.globals.cuid}`,E=yt.createElementNS(oi,"linearGradient");E.setAttribute("id",C),p?(E.setAttribute("x1","0"),E.setAttribute("y1","1"),E.setAttribute("x2","0"),E.setAttribute("y2","0")):(E.setAttribute("x1","0"),E.setAttribute("y1","0"),E.setAttribute("x2","1"),E.setAttribute("y2","0"));const{min:F,max:P,stops:D,bands:R}=this._computeStops();this._min=F,this._max=P,D.forEach(t=>{const e=yt.createElementNS(oi,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),E.appendChild(e)}),S.appendChild(E),L.appendChild(S);const T=yt.createElementNS(oi,"rect");if(T.setAttribute("x",String(M)),T.setAttribute("y",String(k)),T.setAttribute("width",String(p?b:_)),T.setAttribute("height",String(p?_:b)),T.setAttribute("rx","2"),T.setAttribute("fill",`url(#${C})`),L.appendChild(T),u.showLabels){const t=(null==(n=u.labelStyle)?void 0:n.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==(s=u.labelStyle)?void 0:s.fontSize)||"11px",i=(null==(r=u.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,a=this._getFormatter(),o=(n,s,r,a)=>{const o=yt.createElementNS(oi,"text");return o.setAttribute("x",String(s)),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(n),o};if(p){const t=M+b/2;L.appendChild(o(a(F),t,k+_+10,"middle")),L.appendChild(o(a(P),t,k-10,"middle"))}else{const t=k+b/2;L.appendChild(o(a(F),M-6,t,"end")),L.appendChild(o(a(P),M+_+6,t,"start"))}}const N=(null==(a=u.arrow)?void 0:a.color)||c.config.chart.foreColor,O=this._buildArrow(f,N,d);if(L.appendChild(O),this.arrowEl=O,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&R.length>0&&R.forEach(t=>{const e=yt.createElementNS(oi,"rect");if(p){const i=k+_-t.p2*_,n=k+_-t.p1*_;e.setAttribute("x",String(M)),e.setAttribute("y",String(i)),e.setAttribute("width",String(b)),e.setAttribute("height",String(Math.max(0,n-i)))}else e.setAttribute("x",String(M+t.p1*_)),e.setAttribute("y",String(k)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*_))),e.setAttribute("height",String(b));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",L.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:d,stripX:M,stripY:k,stripLength:_,stripThickness:b,arrowSize:f,svgWidth:v,svgHeight:w},u.showHoverValue){const t=yt.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=u.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=u.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-"+d),h.appendChild(L),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=L,t?(h.style.width=v+"px",h.style.height=w+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,d,p,v,w),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,n=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,n*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,n,s){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,u=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=n+"px",t.style.height=s+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-s-24;let r;r="start"===a?o:"end"===a?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+u+"px",t.style.left="left"===e?o+h+"px":l-n-o+h+"px"}else{const i=l-n-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+u+"px":c-s-o+u+"px"}}repositionToPlot(){var t,e;if(!mt.isBrowser())return;if(this._targetEl)return;const i=this.w,n=i.globals,s=i.dom.elLegendWrap;if(!s||!this._geom)return;if(!Number.isFinite(n.gridWidth)||!Number.isFinite(n.gridHeight))return;const{isVertical:r,position:a,svgWidth:o,svgHeight:l,stripX:c,stripY:h,stripThickness:u}=this._geom,d=this._cfg().align||"center",p=i.config.legend.offsetX||0,f=i.config.legend.offsetY||0,g=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=g?g.getTitleSubtitleCoords("title").height+g.getTitleSubtitleCoords("subtitle").height:0,y=i.layout.xAxisHeight||0,x=(t,e)=>{const i=Math.max(0,t-e);return"start"===d?0:"end"===d?i:i/2};if(r){s.style.top=n.translateY+x(n.gridHeight,l)+f+"px";const t=(("left"===a?0:n.translateX+n.gridWidth)+("left"===a?n.translateX:n.svgWidth))/2;s.style.left=t-c-u/2+p+"px"}else{s.style.left=n.translateX+x(n.gridWidth,o)+p+"px";const t=(("top"===a?m:n.translateY+n.gridHeight+y)+("top"===a?n.translateY:n.svgHeight))/2;s.style.top=t-h-u/2+f+"px"}yt.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const n=i.getBoundingClientRect(),s=ai.plotRect(t);if(!(n.width&&n.height&&s.width&&s.height))return;const r=s.left,a=s.left+s.width,o=s.top,l=s.top+s.height,c=s.zoom,{isVertical:h,position:u}=this._geom;if(h){const t=("left"===u?r-n.right:n.left-a)/c;if(t<16){const i=parseFloat(e.style.left)||0,n=16-t;e.style.left=i+("left"===u?-n:n)+"px"}}else{const t=("top"===u?o-n.bottom:n.top-l)/c;if(t<16){const i=parseFloat(e.style.top)||0,n=16-t;e.style.top=i+("top"===u?-n:n)+"px"}}}destroy(){var t,e,i,n,s,r,a;for(let i=0;i<this._bandHitEls.length;i++){const n=this._bandHitEls[i];null==(t=n.removeEventListener)||t.call(n,"mousemove",this._onBandEnter),null==(e=n.removeEventListener)||e.call(n,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(s=(n=this.ctx.events).removeEventListener)||s.call(n,"dataPointMouseEnter",this._onCellEnter),null==(a=(r=this.ctx.events).removeEventListener)||a.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(mt.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,n,s;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==(s=null==(n=null==(i=this.ctx)?void 0:i.events)?void 0:n.fireEvent)||s.call(n,"legendHover",[this.ctx,o,r]),new b(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new b(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;mt.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,n;const s=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(!li.supports(s))return;let l;l=this._continuous?function(t,e,i){const n=t.config.series[e];return si(t,n&&Array.isArray(n.data)?n.data[i]:null,e,i)}(s,a,o):null==(n=null==(i=null==(e=s.seriesData)?void 0:e.series)?void 0:i[a])?void 0:n[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:n,stripY:s,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=s+r-h*r;let e,l;"left"===i?(e=n+a,l=e+o):(e=n,l=e-o);const c=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=n+h*r;let e,l;"top"===i?(e=s+a,l=e+o):(e=s,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=s+r-h*r;"left"===i?this.hoverValueEl.style.left=`${n+a+o+8}px`:(this.hoverValueEl.style.left=n-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=n+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${s+a+o+8}px`:s-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const n=yt.createElementNS(oi,"polygon");return n.setAttribute("fill",e),n.setAttribute("opacity","0"),n.setAttribute("class","apexcharts-heatmap-gradient-arrow"),n.setAttribute("points","0,0 0,0 0,0"),n.setAttribute("pointer-events","none"),n}_computeStops(){var t,e;const i=this.w,n=li.colorScaleOf(i)||{},s=this._cfg(),r=ri(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 u=a,d=c;void 0!==n.min&&void 0!==n.max&&n.max>n.min?(u=n.min,d=n.max):(void 0!==n.min&&(u=n.min<a?n.min:a),void 0!==n.max&&(d=n.max>c?n.max:c));const p=[],f=[];if(n.ranges&&n.ranges.length>0){const t=n.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;u=e,d=i;const s=i-e||1;t.forEach(t=>{const i=(t.from-e)/s,n=(t.to-e)/s;p.push({percent:(i+n)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:n})})}else{const t=i.globals.colors[0]||"#008FFB",n=new v,r=i.config.plotOptions[i.config.chart.type]||{},a=null!=(e=r.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,s.stops||16);for(let e=0;e<l;e++){const s=e/(l-1),c=u+s*(d-u),h=Math.abs(d)+Math.abs(u),f=0===h?0:100*c/h;let g;g=o?r.reverseNegativeShade?f<0?f/100*(1.25*a):1.25*a*(1-f/100):f<=0?1-(1+f/100)*a:(1-f/100)*a:1-f/100,g>1&&(g=1),g<-1&&(g=-1);const m=r.enableShades?n.shadeColor("dark"===i.config.theme.mode?-1*g:g,t):t;p.push({percent:s,color:m})}}return{min:u,max:d,stops:p,bands:f}}}const ci={zoom:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l5 5"/><path d="M8 10.5h5M10.5 8v5"/></svg>',pan:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 3v18M3 12h18"/><path d="M9 6l3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3"/></svg>',reset:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 10a8 8 0 1 1 2 6"/><path d="M4 4v6h6"/></svg>',download:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 4v11"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></svg>'};class hi{constructor(t){this.trellis=t,this.elLegend=null,this.elToolbar=null,this.elTitle=null,this.elBreadcrumb=null,this.gradientLegend=null,this._gradPending=null}buildHeader(t,e,i){const n=this.trellis,s=n.cfg.header||{};if(!1===s.show)return;const r=yt.createElement("div");r.className="apexcharts-trellis-header";let a=e;"function"==typeof s.formatter&&(a=s.formatter(e,{dimension:"string"==typeof n.cfg.by?n.cfg.by:void 0,index:i.index,count:i.count})),r.textContent=null==a?"":String(a);const o=s.style||{};if(o.fontSize&&(r.style.fontSize=o.fontSize),o.fontWeight&&(r.style.fontWeight=String(o.fontWeight)),o.color&&(r.style.color=o.color),!1!==n.cfg.promote){r.classList.add("apexcharts-trellis-header-clickable"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("title","Expand this panel");const t=()=>{n._promotedKey===e?n.restorePromotion():n.promote(e)};r.addEventListener("click",t),r.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}t.appendChild(r)}stripEl(t,e,i){const n=this.trellis.cfg.header||{},s=yt.createElement("div");s.className=`apexcharts-trellis-strip apexcharts-trellis-strip-${t}`;let r=e;"function"==typeof n.formatter&&(r=n.formatter(e,{dimension:t,index:i.index,count:i.count})),s.textContent=null==r?"":String(r);const a=n.style||{};return a.fontSize&&(s.style.fontSize=a.fontSize),a.fontWeight&&(s.style.fontWeight=String(a.fontWeight)),a.color&&(s.style.color=a.color),s}buildBreadcrumb(t,e,i){this.removeBreadcrumb();const n=yt.createElement("div");n.className="apexcharts-trellis-breadcrumb";const s=yt.createElement("button");s.setAttribute("type","button"),s.className="apexcharts-trellis-breadcrumb-back",s.textContent="All panels",s.addEventListener("click",i);const r=yt.createElement("span");r.className="apexcharts-trellis-breadcrumb-sep",r.textContent="/";const a=yt.createElement("span");a.className="apexcharts-trellis-breadcrumb-current",a.textContent=e,n.appendChild(s),n.appendChild(r),n.appendChild(a),t.appendChild(n),this.elBreadcrumb=n}removeBreadcrumb(){this.elBreadcrumb&&this.elBreadcrumb.parentNode&&this.elBreadcrumb.parentNode.removeChild(this.elBreadcrumb),this.elBreadcrumb=null}buildTitle(t){const e=this.trellis.w.config.title;if(!e||!e.text)return;const i=yt.createElement("div");i.className="apexcharts-trellis-title",i.textContent=e.text;const n=e.style||{};n.fontSize&&(i.style.fontSize=n.fontSize),n.color&&(i.style.color=n.color),t.appendChild(i),this.elTitle=i}buildLegend(t){const e=this.trellis;if("shared"!==(e.cfg.legend||"shared"))return;if("heatmap"===e.w.config.chart.type)return void this.buildGradientLegend(t);const i=e.split?e.split.seriesNames:[];if(i.length<2)return;const n=yt.createElement("div");n.className="apexcharts-trellis-legend apexcharts-legend",n.setAttribute("role","list"),i.forEach(t=>{const i=yt.createElement("div");i.className="apexcharts-legend-series apexcharts-trellis-legend-item",i.setAttribute("role","listitem"),i.setAttribute("tabindex","0"),i.setAttribute("data:collapsed","false");const s=yt.createElement("span");s.className="apexcharts-legend-marker",s.style.background=e.scales?e.scales.colorOf(t):"#008FFB";const r=yt.createElement("span");r.className="apexcharts-legend-text",r.textContent=t,i.appendChild(s),i.appendChild(r);const a=()=>{const n=e.sync.toggleSeries(t);i.classList.toggle("apexcharts-inactive-legend",n),i.setAttribute("data:collapsed",String(n))};i.addEventListener("click",a),i.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a())}),n.appendChild(i)}),t.appendChild(n),this.elLegend=n}refreshLegendColors(){const t=this.trellis,e=this.elLegend,i=t.scales;if(!e||!i)return;e.querySelectorAll(".apexcharts-trellis-legend-item").forEach(t=>{var e;const n=null==(e=t.querySelector(".apexcharts-legend-text"))?void 0:e.textContent,s=t.querySelector(".apexcharts-legend-marker");n&&s&&(s.style.background=i.colorOf(n))})}buildGradientLegend(t){const e=this.trellis,i=e.panels.find(t=>t.chart);if(!i){if(this._gradPending)return;const i=()=>{var n,s;this._gradPending=null,null==(s=(n=e.ctx.events).removeEventListener)||s.call(n,"panelMounted",i),this.buildGradientLegend(t)};return this._gradPending=i,void e.ctx.events.addEventListener("panelMounted",i)}const n=yt.createElement("div");n.className="apexcharts-trellis-legend apexcharts-trellis-gradient-legend",t.appendChild(n),this.elLegend=n;const s=i.chart,r=new li(s.w,s.ctx);r.draw(n),this.gradientLegend=r,e.panels.forEach(t=>{var e;if(!t.chart||t===i)return;const n=null==(e=t.chart.ctx)?void 0:e.events;(null==n?void 0:n.addEventListener)&&(n.addEventListener("dataPointMouseEnter",r._onCellEnter),n.addEventListener("dataPointMouseLeave",r._onCellLeave))})}destroyGradientLegend(){var t,e;const i=this.trellis;if(this._gradPending&&(null==(e=(t=i.ctx.events).removeEventListener)||e.call(t,"panelMounted",this._gradPending),this._gradPending=null),this.gradientLegend){try{this.gradientLegend.destroy()}catch(t){}this.gradientLegend=null}}buildToolbar(t){const e=this.trellis;if("shared"!==(e.cfg.toolbar||"shared"))return;const i=yt.createElement("div");i.className="apexcharts-trellis-toolbar";const n={},s=t=>{e.panels.forEach(e=>{if(!e.chart)return;const i=e.chart.w.interact;i.zoomEnabled="zoom"===t,i.panEnabled="pan"===t,i.selectionEnabled=!1}),n.zoom.classList.toggle("apexcharts-selected","zoom"===t),n.pan.classList.toggle("apexcharts-selected","pan"===t),n.zoom.setAttribute("aria-pressed",String("zoom"===t)),n.pan.setAttribute("aria-pressed",String("pan"===t))},r=(t,e,s)=>{const r=yt.createElement("button");return r.className=`apexcharts-trellis-tool apexcharts-trellis-tool-${t}`,r.setAttribute("type","button"),r.setAttribute("aria-label",e),r.setAttribute("title",e),r.innerHTML=ci[t],r.addEventListener("click",s),n[t]=r,i.appendChild(r),r};if(r("zoom","Selection zoom",()=>s("zoom")),r("pan","Pan",()=>s("pan")),r("reset","Reset zoom",()=>{e.sync.resetAll()}),e.ctx.exports){const t=yt.createElement("div");t.className="apexcharts-trellis-menu",[["png","Download PNG"],["svg","Download SVG"],["csv","Download CSV"]].forEach(([i,n])=>{const s=yt.createElement("button");s.setAttribute("type","button"),s.className="apexcharts-trellis-menu-item",s.textContent=n,s.addEventListener("click",()=>{t.classList.remove("apexcharts-trellis-menu-open"),e.exports.download(i)}),t.appendChild(s)}),r("download","Download",()=>{t.classList.toggle("apexcharts-trellis-menu-open")}),i.appendChild(t)}n.zoom.classList.add("apexcharts-selected"),n.zoom.setAttribute("aria-pressed","true"),n.pan.setAttribute("aria-pressed","false"),t.appendChild(i),this.elToolbar=i,t.classList.add("apexcharts-trellis-has-toolbar")}}function ui(t,e){const i=v.clone(t.w.config.yaxis);return(Array.isArray(i)?i:[i]).map(t=>v.extend(t,e))}class di{constructor(t){this.trellis=t,this._syncing=!1,this._hidden=new Set,this.currentWindow=null}_noteWindow(t,e){const i=t&&t.xaxis;i&&null!=i.min&&null!=i.max?this.currentWindow={x:{min:i.min,max:i.max},y:this.currentWindow&&this.currentWindow.y||null,zoomed:e||!(!this.currentWindow||!this.currentWindow.zoomed)}:e&&(this.currentWindow=null)}makeZoomedHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!0),this.onZoomed(i)}}makeScrolledHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!1)}}onZoomed(t){const e=this.trellis;if(this._syncing)return;const i=e.cfg;if(!i||"shared"!==(i.scales.y||"shared"))return;if(!e.autoScaleYaxis)return;const n=t&&t.xaxis;if(!n||null==n.min||null==n.max)return;if(!e.split||!e.split.xIsNumeric)return;const s=function(t,e,i,n,s=!1){const r={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((a,o)=>{if(null==a)return;const l="paired"===e?a[0]:"object"===e?a.x:null,c=l instanceof Date?l.getTime():Number(l);if(!isFinite(c)||c<i||c>n)return;Ge(a,e,r);const h=s?Ue(t,a,o):null;null!==h&&Ge(h,"plain",r)})})),isFinite(r.min)&&isFinite(r.max)?r:null}(e.split.panels,e.split.xForm,n.min,n.max,e._stackingHost().parts);if(!s)return;const r=Xe(s.min,s.max,i.targetTicks||3);this.currentWindow&&(this.currentWindow.y={min:r.min,max:r.max,tickAmount:r.tickAmount}),this._syncing=!0;const a=e.panels.map(t=>t.chart?t.chart.updateOptions({yaxis:ui(t.chart,{min:r.min,max:r.max,tickAmount:r.tickAmount})},!1,!1,!1).catch(()=>{}):Promise.resolve());Promise.all(a).finally(()=>{this._syncing=!1})}resetAll(){const t=this.trellis;this.currentWindow=null;const e=t.scales&&t.scales.x?{min:t.scales.x.min,max:t.scales.x.max}:{min:void 0,max:void 0};this._syncing=!0;const i=t.panels.map(i=>{if(!i.chart)return Promise.resolve();i.chart.w.interact.zoomed=!1;const n={xaxis:e},s=t.split?t._yBoundsFor(t.split.panels[i.index]):null;return s&&(n.yaxis=ui(i.chart,{min:s.min,max:s.max,tickAmount:s.tickAmount})),i.chart.updateOptions(n,!1,!1,!1).catch(()=>{})});return Promise.all(i).finally(()=>{this._syncing=!1})}toggleSeries(t){const e=!this._hidden.has(t);return e?this._hidden.add(t):this._hidden.delete(t),this.trellis.panels.forEach(i=>{const n=i.chart;if(!n)return;if(-1!==(n.w.seriesData.seriesNames||[]).indexOf(t))try{e?n.hideSeries(t):n.showSeries(t)}catch(t){}}),e}isHidden(t){return this._hidden.has(t)}applyHiddenTo(t){if(!this._hidden.size||!t)return;const e=t.w.seriesData&&t.w.seriesData.seriesNames||[];this._hidden.forEach(i=>{if(-1!==e.indexOf(i))try{t.hideSeries(i)}catch(t){}})}wireCrosshairs(t){let e=0,i=null;const n=()=>{const t=i&&i.closest?i.closest(".apexcharts-trellis-cell"):null,e=t?t.querySelector(".apexcharts-xcrosshairs"):null,n=e&&e.classList.contains("apexcharts-active");this.trellis.panels.forEach(i=>{if(!i.cellEl||i.cellEl===t)return;const s=i.cellEl.querySelector(".apexcharts-xcrosshairs");s&&(n?(s.setAttribute("x",e.getAttribute("x")||"0"),s.setAttribute("x1",e.getAttribute("x1")||"0"),s.setAttribute("x2",e.getAttribute("x2")||"0"),s.classList.add("apexcharts-active")):s.classList.remove("apexcharts-active"))})},s=()=>{n(),e=i?requestAnimationFrame(s):0};t.addEventListener("mousemove",t=>{i=t.target,e||(e=requestAnimationFrame(s))},{passive:!0}),t.addEventListener("mouseleave",()=>{i=null,e&&(cancelAnimationFrame(e),e=0),this.trellis.panels.forEach(t=>{const e=t.cellEl&&t.cellEl.querySelector(".apexcharts-xcrosshairs");e&&e.classList.remove("apexcharts-active")})},{passive:!0})}}function pi(t,e){const i=null!=t,n=null!=e;return i||n?{min:i?t:null,max:n?e:null}:null}function fi(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function gi(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function mi(t,e){const i=t.config.annotations?v.clone(t.config.annotations):null,n=[],s=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of s){if(!t||"addAnnotation"!==t.label)continue;const i=gi(t.method,e);i&&n.push({kind:i,params:v.clone(t.params)})}return{static:i,dynamic:n}}function yi(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}function xi(t,e){var i,n;const s=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>pi(t&&t.min,t&&t.max)),a=r.some(t=>null!==t),o=t.config.theme,l=e&&e.drilldown;return{v:1,window:{xaxis:pi(s.min,s.max),yaxis:a?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:fi(t.interact.selectedDataPoints),theme:o?{mode:null!=(i=o.mode)?i:null,palette:null!=(n=o.palette)?n:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:mi(t,e),drill:l&&l.depth>0?{path:l.path.slice()}:null,measure:yi(e)}}function _i(t,e){if(!t||!e)return;const i=t.w;i.interact.zoomed=!!e.zoomed,function(t,e,i){const n=t.w;if(null==e&&null==i)return;const s=n.globals.seriesNames||[],r=new Set([...e||[],...i||[]]),a=new Set([...n.globals.collapsedSeriesIndices||[],...n.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<s.length;e++){const i=s[e];if(null==i)continue;const n=r.has(e),o=a.has(e);n&&!o?t.hideSeries(i):!n&&o&&t.showSeries(i)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const i=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);i&&"function"==typeof t[i]&&t[i](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=fi(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==i.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}class bi{constructor(t){this.trellis=t,this.active=!1,this._io=null,this._byCell=new Map,this._dirty=new Set,this._raf=null,this._draining=!1,this._gutterFloor=0}static supported(){return"undefined"!=typeof IntersectionObserver}_rootMargin(){const t=this.trellis.layout,e=t?Math.max(0,Math.round(t.panelH+t.headerH+t.gap)):300;return`${e}px 0px ${e}px 0px`}start(){bi.supported()&&(this.active=!0,this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this.trellis.panels.forEach(t=>{var e;t.wantMounted=!1,t.cellEl&&(this._byCell.set(t.cellEl,t),null==(e=this._io)||e.observe(t.cellEl))}))}refresh(){this.active&&this._io&&(this._io.disconnect(),this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this._byCell.forEach((t,e)=>{var i;return null==(i=this._io)?void 0:i.observe(e)}))}_onEntries(t){if(this.active){for(const e of t){const t=this._byCell.get(e.target);t&&(t.wantMounted=e.isIntersecting,this._dirty.add(t))}this._schedule()}}_schedule(){var t;this._raf||this._draining||!this.active||(this._raf=(t=()=>{this._raf=null,this._drain()},"function"==typeof requestAnimationFrame?{kind:"raf",id:requestAnimationFrame(t)}:{kind:"timeout",id:setTimeout(()=>t(0),16)}))}_drain(){return h(this,null,function*(){if(!this._draining&&this.active){this._draining=!0;try{let t=0,e=0;for(;this.active&&this._dirty.size&&t<2&&e<6;){const i=this._dirty.values().next().value;this._dirty.delete(i);const n=!!i.wantMounted;n!==!!i.chart&&(e++,n?(t++,yield this._mount(i)):this._unmount(i))}}finally{this._draining=!1,this.active&&this._dirty.size?this._schedule():this.active&&(this.trellis.w.globals.animationEnded=!0)}}})}_liveWindow(t){const e=this.trellis.panels.find(e=>e!==t&&e.chart);if(!e||!e.chart)return null;const i=e.chart.w,n=i.config.xaxis||{},s=Array.isArray(i.config.yaxis)?i.config.yaxis[0]:i.config.yaxis;return{zoomed:!!i.interact.zoomed,x:null!=n.min||null!=n.max?{min:n.min,max:n.max}:null,y:!s||null==s.min&&null==s.max?null:{min:s.min,max:s.max,tickAmount:s.tickAmount}}}_patchYaxis(t,e){const i=Array.isArray(t.yaxis)?t.yaxis:t.yaxis?[t.yaxis]:[{}];i.forEach(t=>{Object.keys(e).forEach(i=>{"labels"===i?t.labels=o(o({},t.labels||{}),e.labels):t[i]=e[i]})}),t.yaxis=i}_mount(t){return h(this,null,function*(){var e,i,n,s,r,a,c,h;const u=this.trellis;if(!t.el||t.chart||t.noMount)return;const d=t.viewStash,p="shared"===u._yMode(),f=!p,g=u._assemblePanelOptions(t.index,{noAnimation:!!d}),m=d&&d.window;m&&m.xaxis&&(g.xaxis=l(o({},g.xaxis||{}),{min:null!=(e=m.xaxis.min)?e:void 0,max:null!=(i=m.xaxis.max)?i:void 0})),f&&m&&Array.isArray(m.yaxis)&&m.yaxis[0]&&this._patchYaxis(g,{min:null!=(n=m.yaxis[0].min)?n:void 0,max:null!=(s=m.yaxis[0].max)?s:void 0});const y=this._liveWindow(t);y&&y.x&&(g.xaxis=l(o({},g.xaxis||{}),{min:y.x.min,max:y.x.max})),y&&y.y&&p&&this._patchYaxis(g,o({min:y.y.min,max:y.y.max},null!=y.y.tickAmount?{tickAmount:y.y.tickAmount}:{}));const x=u.sync.currentWindow;x&&x.x&&(g.xaxis=l(o({},g.xaxis||{}),{min:x.x.min,max:x.x.max})),x&&x.y&&p&&this._patchYaxis(g,o({min:x.y.min,max:x.y.max},null!=x.y.tickAmount?{tickAmount:x.y.tickAmount}:{})),f&&this._gutterFloor>0&&this._patchYaxis(g,{labels:{minWidth:this._gutterFloor}}),t.el.classList.remove("apexcharts-trellis-skeleton");const _=new u._ApexCharts(t.el,g);t.chart=_;try{yield _.render()}catch(e){return t.chart=null,void t.el.classList.add("apexcharts-trellis-skeleton")}if(this.active){if(_.w.interact.zoomed=x?!!x.zoomed:y?y.zoomed:!(!d||!d.zoomed),u.sync.applyHiddenTo(_),d&&d.annotations&&Array.isArray(d.annotations.dynamic)){const t={xaxis:"addXaxisAnnotation",yaxis:"addYaxisAnnotation",point:"addPointAnnotation"},e=_;d.annotations.dynamic.forEach(i=>{const n=t[i.kind];n&&"function"==typeof e[n]&&e[n](i.params,!0)})}if(t.viewStash=null,f){const t=null==(h=null==(c=null==(a=null==(r=_.w)?void 0:r.globals)?void 0:a.yLabelsCoords)?void 0:c[0])?void 0:h.width;if("number"==typeof t&&isFinite(t)){const e=_.w.globals.isBarHorizontal?0:u._yLabelPad(),i=Math.max(0,t-e);i>this._gutterFloor+.5&&(this._gutterFloor=i,yield u._pushGutterFloor(this._gutterFloor))}}u._fire("panelMounted",{key:t.key,index:t.index,chart:_,remounted:!!d})}})}_unmount(t){if(t.chart){try{t.viewStash=xi(t.chart.w,t.chart)}catch(e){t.viewStash=null}try{t.chart.destroy()}catch(t){}if(t.chart=null,t.el){t.el.classList.add("apexcharts-trellis-skeleton");const e=this.trellis.layout;e&&(t.el.style.minHeight=`${e.panelH}px`)}}}stop(){var t;this.active=!1,this._io&&(this._io.disconnect(),this._io=null),this._byCell.clear(),this._dirty.clear(),(t=this._raf)&&("raf"===t.kind?cancelAnimationFrame(t.id):clearTimeout(t.id)),this._raf=null,this._gutterFloor=0}}const vi=["bar","column","rangeBar","candlestick","boxPlot","violin"];class wi{constructor(t){this.trellis=t,this.el=null,this._raf=0,this._lastEvent=null}wire(t,e){const i=yt.createElement("div");i.className="apexcharts-trellis-tooltip apexcharts-theme-light",i.setAttribute("role","status"),e.appendChild(i),this.el=i;const n=()=>{this._update(e),this._raf=this._lastEvent?requestAnimationFrame(n):0};t.addEventListener("mousemove",t=>{this._lastEvent=t,this._raf||(this._raf=requestAnimationFrame(n))},{passive:!0}),t.addEventListener("mouseleave",()=>{this._lastEvent=null,this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),i.classList.remove("apexcharts-trellis-tooltip-active")},{passive:!0})}_hoverIndex(t,e,i){const n=t.w,s=n.globals.dataPoints;if(!s||s<1)return-1;const r=n.layout.gridWidth;if(!r)return-1;const a=me.screenXToPlotPx(n,e),o=n.globals.barPadForNumericAxis||0;if(a<-o||a>r+o)return-1;const l=n.dom&&n.dom.baseEl;if(l&&l.querySelector(".apexcharts-svg")){const t=ai.plotRect(n);if(t.height&&(i<t.top||i>t.top+t.height))return-1}const c=(-1!==vi.indexOf(n.config.chart.type)||"between"===n.config.xaxis.tickPlacement)&&!n.config.xaxis.convertedCatToNumeric?Math.ceil(a/(r/s))-1:Math.round(a/(r/Math.max(1,s-1)));return Math.max(0,Math.min(s-1,c))}_valueAt(t,e,i,n){var s,r;const a=t.series.find(t=>t.name===e);if(!a||!Array.isArray(a.data))return null;const o=a.data[n];if(null==o)return null;let l=o;if(Array.isArray(o)?l=o[1]:"object"==typeof o&&(l=o.y),null==l)return null;const c=this.trellis.w.config,h=Array.isArray(null==(s=c.tooltip)?void 0:s.y)?c.tooltip.y[i]:null==(r=c.tooltip)?void 0:r.y,u=Array.isArray(c.yaxis)?c.yaxis[0]:c.yaxis,d=h&&"function"==typeof h.formatter&&h.formatter||u&&u.labels&&"function"==typeof u.labels.formatter&&u.labels.formatter||null,p=t=>{if(d)try{return String(d(t,{seriesIndex:i,dataPointIndex:n,w:null}))}catch(e){return String(t)}return String(t)};return Array.isArray(l)?l.map(p).join(" / "):p(l)}_update(t){const e=this.trellis,i=this.el,n=this._lastEvent;if(!i||!n||!e.split)return;const s=n.target&&n.target.closest?n.target.closest(".apexcharts-trellis-cell"):null,r=s?e.panels.find(t=>t.cellEl===s):void 0,a=r&&r.chart?this._hoverIndex(r.chart,n.clientX,n.clientY):-1;if(!r||-1===a)return void i.classList.remove("apexcharts-trellis-tooltip-active");const o=s?s.querySelector(".apexcharts-tooltip-title"):null,l=o&&o.textContent?o.textContent:"",c=e.split.seriesNames,h=e.scales,u=[];e.split.panels.forEach(t=>{const e=[];c.forEach((i,n)=>{const s=this._valueAt(t,i,n,a);if(null===s)return;const r=h?h.colorOf(i):"#008FFB";e.push(`<span class="apexcharts-trellis-tooltip-val"><span class="apexcharts-trellis-tooltip-marker" style="background:${Mi(r)}"></span>${Ai(s)}</span>`)});const i=t.key===r.key;u.push(`<div class="apexcharts-trellis-tooltip-row${i?" apexcharts-trellis-tooltip-row-active":""}" data-key="${Mi(t.key)}"><span class="apexcharts-trellis-tooltip-key">${Ai(t.key)}</span><span class="apexcharts-trellis-tooltip-vals">${e.join("")}</span></div>`)});let d="";l&&(d+=`<div class="apexcharts-tooltip-title">${Ai(l)}</div>`),d+=u.join(""),i.innerHTML=d,i.classList.add("apexcharts-trellis-tooltip-active");const p=t.getBoundingClientRect(),f=ai.plotRect(r.chart.w).zoom;let g=(n.clientX-p.left)/f+14,m=(n.clientY-p.top)/f+14;const y=i.offsetWidth,x=i.offsetHeight,_=p.width/f,b=p.height/f;g+y>_-4&&(g=Math.max(4,g-y-28)),m+x>b-4&&(m=Math.max(4,m-x-28)),i.style.left=`${Math.round(g)}px`,i.style.top=`${Math.round(m)}px`}destroy(){this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),this._lastEvent=null,this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null}}function Ai(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Mi(t){return String(t).replace(/"/g,""")}class ki{constructor(t){this.trellis=t}supported(){return!!this.trellis.ctx.exports}_rectIn(t){const e=this.trellis.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.left-e.left,y:i.top-e.top,w:i.width,h:i.height}}_size(){const t=this.trellis.elWrap.getBoundingClientRect();return{w:Math.ceil(t.width),h:Math.ceil(t.height)}}_background(){const t=this.trellis.panels.find(t=>t.chart),e=t&&t.chart.exports;if(e&&"function"==typeof e.resolveExportBackground){const t=e.resolveExportBackground();if(t&&"transparent"!==t)return t}return"#fff"}_chromeTexts(){const t=this.trellis,e=[],i=(t,i)=>{if(!t||!t.textContent)return;const n=this._rectIn(t),s=getComputedStyle(t);e.push({text:t.textContent,x:"center"===i?n.x+n.w/2:n.x,y:n.y+n.h/2,font:`${s.fontWeight} ${s.fontSize} ${s.fontFamily}`,fontSize:parseFloat(s.fontSize)||12,color:s.color||"#373d3f",align:i})};return i(t.chrome.elTitle,"left"),t.panels.forEach(t=>{t.cellEl&&i(t.cellEl.querySelector(".apexcharts-trellis-header"),"center")}),t.chrome.elLegend&&t.chrome.elLegend.querySelectorAll(".apexcharts-legend-text").forEach(t=>i(t,"left")),e}_legendMarkers(){const t=this.trellis.chrome.elLegend;return t?Array.from(t.querySelectorAll(".apexcharts-legend-marker"),t=>({rect:this._rectIn(t),color:t.style.background||t.style.backgroundColor||"#008FFB"})):[]}dataURI(){return h(this,arguments,function*(t={}){const e=this.trellis,i=t.scale||1,n=this._size(),s=document.createElement("canvas");s.width=n.w*i,s.height=n.h*i;const r=s.getContext("2d");if(!r)return{imgURI:""};const a=r;a.scale(i,i),a.fillStyle=this._background(),a.fillRect(0,0,n.w,n.h);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){a.fillStyle="rgba(120, 120, 120, 0.06)",a.fillRect(e.x,e.y,e.w,e.h);continue}const{imgURI:n}=yield t.chart.dataURI({scale:i});if(!n)continue;const s=yield Li(n);a.drawImage(s,e.x,e.y,e.w,e.h)}for(const t of this._chromeTexts())a.font=t.font,a.fillStyle=t.color,a.textAlign=t.align,a.textBaseline="middle",a.fillText(t.text,t.x,t.y);for(const t of this._legendMarkers())a.fillStyle=t.color,a.beginPath(),a.arc(t.rect.x+t.rect.w/2,t.rect.y+t.rect.h/2,Math.max(2,t.rect.w/2),0,2*Math.PI),a.fill();return{imgURI:s.toDataURL("image/png")}})}svgString(t=1){return h(this,null,function*(){const e=this.trellis,i=this._size(),n=[];n.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${i.w*t}" height="${i.h*t}" viewBox="0 0 ${i.w} ${i.h}">`),n.push(`<rect width="${i.w}" height="${i.h}" fill="${this._background()}"/>`);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){n.push(`<rect x="${e.x}" y="${e.y}" width="${e.w}" height="${e.h}" fill="rgba(120,120,120,0.06)" rx="4"/>`);continue}const i=yield t.chart.getSvgString();n.push(`<g transform="translate(${e.x}, ${e.y})">${i}</g>`)}for(const t of this._chromeTexts()){const e="center"===t.align?"middle":"start";n.push(`<text x="${t.x}" y="${t.y}" text-anchor="${e}" dominant-baseline="central" style="font:${Ei(t.font)};fill:${Ei(t.color)}">${Ci(t.text)}</text>`)}for(const t of this._legendMarkers())n.push(`<circle cx="${t.rect.x+t.rect.w/2}" cy="${t.rect.y+t.rect.h/2}" r="${Math.max(2,t.rect.w/2)}" fill="${Ei(t.color)}"/>`);return n.push("</svg>"),n.join("")})}csv(t={}){var e,i,n;const s=this.trellis,r=s.split;if(!r)return"";const a=s.w,o=t.columnDelimiter||(null==(n=null==(i=null==(e=a.config.chart.toolbar)?void 0:e.export)?void 0:i.csv)?void 0:n.columnDelimiter)||",",l=a.config.xaxis&&"datetime"===a.config.xaxis.type,c=t=>{if(null==t)return"";const e=String(t);return/[",\n]/.test(e)||-1!==e.indexOf(o)?`"${e.replace(/"/g,'""')}"`:e},h=t=>l&&"number"==typeof t?new Date(t).toISOString():t,u=r.seriesNames,d=[["x","facet",...u].map(c).join(o)];return r.panels.forEach(t=>{r.unionX.forEach((e,i)=>{const n=[h(e),t.key];u.forEach(e=>{const s=t.series.find(t=>t.name===e);if(!s||!Array.isArray(s.data))return void n.push("");const r=s.data[i];let a=r;Array.isArray(r)?a=r[1]:r&&"object"==typeof r&&(a=r.y),n.push(Array.isArray(a)?a.join("|"):a)}),d.push(n.map(c).join(o))})}),d.join(t.lineDelimiter||"\n")}download(t){return h(this,arguments,function*(t,e={}){var i;const n=this.trellis,s=(null==(i=n.w.config.chart.toolbar)?void 0:i.export)||{},r=String(n.w.globals.chartID||"trellis");if("png"===t){const{imgURI:t}=yield this.dataURI();Si(t,s.png&&s.png.filename||r,".png")}else if("svg"===t){const t=yield this.svgString();Si("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t),s.svg&&s.svg.filename||r,".svg")}else{Si("data:text/csv;charset=utf-8,"+encodeURIComponent("\ufeff"+this.csv(e)),e.fileName||s.csv&&s.csv.filename||r,".csv")}})}}function Li(t){return new Promise((e,i)=>{const n=new Image;n.onload=()=>e(n),n.onerror=i,n.src=t})}function Si(t,e,i){const n=document.createElement("a");n.href=t,n.download=e+i,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Ci(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Ei(t){return String(t).replace(/"/g,""")}const Fi=["annotations","colors","dataLabels","fill","forecastDataPoints","grid","markers","noData","states","stroke","tooltip"],Pi={treemap:"trellis does not support treemap: area encoding needs room a panel cannot give. Rendering a single chart.",sunburst:"trellis does not support sunburst: its labels are illegible at panel size. Rendering a single chart.",unit:"the unit type has its own small-multiples mode (plotOptions.unit.grid.split), which beats a trellis of unit charts. Rendering a single chart."};g.default.registerFeatures({trellis:class{constructor(t,e){this.w=t,this.ctx=e,this.panels=[],this._stripEls=[],this.split=null,this.scales=null,this.layout=null,this.cfg={},this.sync=new di(this),this.chrome=new hi(this),this.virtual=new bi(this),this.exports=new ki(this),this.gridTooltip=null,this._promotedKey=null,this._ApexCharts=g.default,this._virtualActive=!1,this._panelRenderer=null,this._yLabelDecimals=0,this.elWrap=null,this.elGrid=null,this._mounted=!1,this._rendering=!1,this._renderPromise=null,this._raf=0,this._lastWidth=0,this._lastHeight=0,this._chromeH=0,this._overflowWarned=!1,this._resizeHandler=this._onContainerResize.bind(this),this.autoScaleYaxis=!1,this._elChromeTop=null,this._vetoWarned=!1,this._noKeyWarned=!1,this._frames=null}isActive(){var t;const e=this.w.config.trellis;if(!e||!(e.by||e.row||e.column))return!1;const i=null==(t=this.w.config.chart)?void 0:t.type;if(i&&Pi[i])return this._vetoWarned||(this._vetoWarned=!0,console.warn(`ApexCharts: ${Pi[i]}`)),!1;if(e.by&&!e.row&&!e.column&&!Array.isArray(e.data)){if(!(this.w.config.series||[]).some((t,i)=>null!==Re(t,i,e.by))){if(!this._noKeyWarned){this._noKeyWarned=!0;const t="function"==typeof e.by?"the `trellis.by` function returned no key for any series":`no series carries the \`trellis.by\` key '${e.by}'`;console.warn(`ApexCharts: ${t}; there is nothing to split. Rendering as a single chart.`)}return!1}}return!0}_layoutCfg(){return this.split&&"2d"===this.split.mode&&this.split.colKeys?l(o({},this.cfg),{columns:this.split.colKeys.length}):this.cfg}_stackingHost(){var t,e;const i=this.w.config,n=i.chart||{},s=i.highlightFilter||{};return{stacked:!!n.stacked,stackType:n.stackType,stackOnlyBar:!!n.stackOnlyBar,parts:!!Ee._featureRegistry.get("highlightFilter")&&!1!==s.enabled&&"clamp"!==s.axis&&["bar","line","area"].includes(n.type)&&!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.isFunnel)}}_yMode(){var t;return this._frames&&this._frames.forceSharedY?"shared":(null==(t=this.cfg.scales)?void 0:t.y)||"shared"}_yBoundsFor(t){var e,i;const n=this.scales;if(!n)return null;if(this._frames&&this._frames.skipYaxisPush)return null;const s=this._yMode();return"shared"===s?n.y:"independent-row"===s&&n.rowY?n.rowY.get(null!=(e=t.rowKey)?e:"")||null:"independent-column"===s&&n.colY&&n.colY.get(null!=(i=t.colKey)?i:"")||null}_valueAxisIsX(){var t,e;const i=this.w.config;return["bar","boxPlot","violin"].includes(i.chart.type)&&!!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.horizontal)}_valueAxisXPatch(t){var e,i;const n={min:t.min,max:t.max};return"number"!=typeof(null==(i=null==(e=this.ctx.opts)?void 0:e.xaxis)?void 0:i.tickAmount)&&(n.tickAmount=t.tickAmount),n}_groupId(){return`${this.w.globals.chartID}-tg`}_fire(t,e){var i,n;const s=null==(n=null==(i=this.w.config.chart)?void 0:i.events)?void 0:n[t];"function"==typeof s&&s(this.ctx,e),this.ctx.events.fireEvent(t,[this.ctx,e])}render(){const t=this._render();return this._renderPromise=t,t}whenSettled(){return this._rendering&&this._renderPromise?this._renderPromise.catch(()=>{}):Promise.resolve()}_render(){return h(this,null,function*(){var t,e,i,n;const s=this.w;if(!this._mounted&&!this._rendering)if(mt.isBrowser()){this._rendering=!0;try{this.cfg=s.config.trellis||{},this.autoScaleYaxis=!!(null==(e=null==(t=s.config.chart)?void 0:t.zoom)?void 0:e.autoScaleYaxis);let r=s.config.series||[];if(Array.isArray(this.cfg.data)){const t=function(t,e={}){const i=[],n=e.by;if("string"!=typeof n||!n)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs a string `by` column name"]};const s=e.x,r=e.y;if(!s||!r)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs `x` and `y` column names"]};const a=Array.isArray(t)?t:[];if(!a.length)return{series:[],warnings:["trellis: trellis.data is empty"]};const o=e.seriesBy;let l=0,c=0;const h=new Map;a.forEach(t=>{if(!t||"object"!=typeof t)return void l++;const e=t[n],i=t[s];if(null==e||null==i)return void l++;const a=o&&void 0!==t[o]&&null!==t[o]?String(t[o]):String(r);let u=h.get(String(e));u||(u=new Map,h.set(String(e),u));let d=u.get(a);d||(d=new Map,u.set(a,d));const p=i instanceof Date?i.getTime():i;d.has(p)&&c++;const f=t[r];d.set(p,void 0===f?null:f)}),l&&i.push(`trellis: ${l} row(s) missing "${n}" or "${s}" were skipped`),c&&i.push(`trellis: ${c} duplicate (panel, series, x) row(s); kept the last. Aggregate the rows first if you want sums or means.`);const u=[];return h.forEach((t,e)=>{t.forEach((t,i)=>{u.push({name:i,[n]:e,data:Array.from(t,([t,e])=>({x:t,y:e}))})})}),{series:u,warnings:i}}(this.cfg.data,this.cfg);t.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),t.series.length&&(r.length&&console.warn("ApexCharts: trellis received both `series` and `trellis.data`; using trellis.data."),r=t.series)}const a=Be(r,this.cfg,{chartType:s.config.chart.type});if(this.split=a,a.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),!a.panels.length)return;a.dropped>0&&console.warn(`ApexCharts: trellis rendered ${a.panels.length} panels; ${a.dropped} more hidden by trellis.limit.`);const c=null!=(i=this.cfg.virtualize)?i:"auto";let h=!0===c||"auto"===c&&a.panels.length>64;h&&!bi.supported()&&(console.warn("ApexCharts: trellis virtualization needs IntersectionObserver; rendering eagerly."),h=!1),this._virtualActive=h,!h&&a.panels.length>64&&console.warn(`ApexCharts: trellis with ${a.panels.length} panels renders eagerly; set trellis.virtualize (or trellis.limit).`),a.panels.length>256&&console.warn(`ApexCharts: ${a.panels.length} trellis panels is a lot to read at once; consider trellis.limit.`);const u="histogram"===s.config.chart.requestedType?"histogram":s.config.chart.type;this._frames=Ye(a,this.cfg,s.config,u),this._frames.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),this._yLabelDecimals=this._frames.yExtentOverride?0:function(t){let e=0;const i=t=>{const i=Ke(t);i>e&&(e=i)};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach(t=>{if(null==t)return;let e=t;Array.isArray(t)?e=t[1]:"object"==typeof t&&(e=t.y),Array.isArray(e)?e.forEach(i):i(e)})})),e}(a.panels);const d=this._yMode()!==((null==(n=this.cfg.scales)?void 0:n.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Ze(a,d,o({chartType:s.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost())),this._panelRenderer=function(t,e,i,n){if(i&&i.chart&&i.chart.renderer)return null;if(!n)return null;const s={config:{series:t.panels.reduce((t,e)=>t.concat(e.series),[]),chart:{type:e.chart.type},markers:e.markers,dataLabels:e.dataLabels,fill:e.fill,plotOptions:e.plotOptions,states:e.states}};if(ke(s))return null;const r=e.chart.rendererThreshold||8e3;return Me(s)>=r?"canvas":null}(a,s.config,this.ctx.opts,Ce._rendererRegistry.has("canvas")),this._buildSkeleton();const p=this._containerWidth();this._lastWidth=p,this._lastHeight=this._hostHeight()||0,this._chromeH=0,this.layout=Qe({panelCount:a.panels.length,containerWidth:p,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._buildCells();const f="shared"!==this._yMode(),m=this.elWrap;if(h)this.virtual.start();else{f&&(m.style.visibility="hidden");for(let t=0;t<this.panels.length;t++){const e=this.panels[t];if(e.noMount)continue;const i=this._assemblePanelOptions(e.index),n=new g.default(e.el,i);e.chart=n,yield n.render(),this._fire("panelMounted",{key:e.key,index:e.index,chart:n})}f&&(yield this._alignGutters(),m.style.visibility="")}this.chrome.buildTitle(this._elChromeTop),this.chrome.buildToolbar(m),this.chrome.buildLegend(m),this.sync.wireCrosshairs(this.elGrid),"grid"===(this.cfg.tooltip||"panel")&&(this.gridTooltip=new wi(this),this.gridTooltip.wire(this.elGrid,m)),this._mounted=!0,this._refitForChrome(),be(this.ctx.el,this._resizeHandler),h||(s.globals.animationEnded=!0),this._fire("trellisMounted",{panels:this.getPanels()})}finally{this._rendering=!1}}else console.warn("ApexCharts: trellis rendering is browser-only in this version; SSR hosts render nothing.")})}_containerWidth(){const t=this.ctx.el;return t.getBoundingClientRect().width||t.clientWidth||800}_hostHeight(){var t;const e=this.w.config.chart&&this.w.config.chart.height;if(null==e||""===e||"auto"===e)return;const i=String(e).trim();if(i.endsWith("%")){const e=parseFloat(i);if(!isFinite(e)||e<=0)return;const n=null==(t=this.ctx.el)?void 0:t.parentNode;if(!n||"function"!=typeof n.getBoundingClientRect)return;const s=(n.getBoundingClientRect().height||n.clientHeight||0)*e/100;return s>0?s:void 0}const n=parseFloat(i);return isFinite(n)&&n>0?n:void 0}_chromeHeight(){const t=this.elWrap,e=this.elGrid;if(!t||!e||"function"!=typeof t.getBoundingClientRect)return 0;const i=t.getBoundingClientRect().height-e.getBoundingClientRect().height;return isFinite(i)&&i>0?i:0}_buildSkeleton(){var t;const e=this.ctx.el,i=yt.createElementNS("http://www.w3.org/1999/xhtml","div");i.className="apexcharts-trellis",this.split&&"2d"===this.split.mode&&i.classList.add("apexcharts-trellis-2d"),i.id=`apexcharts-trellis${this.w.globals.chartID}`,i.setAttribute("data-tooltip-mode",this.cfg.tooltip||"panel");const n=null==(t=this.w.config.chart)?void 0:t.foreColor;n&&i.style.setProperty("--apx-trellis-fore",n);const s=yt.createElement("div");s.className="apexcharts-trellis-chrome",i.appendChild(s),this._elChromeTop=s;const r=yt.createElement("div");r.className="apexcharts-trellis-grid",i.appendChild(r),e.appendChild(i),this.elWrap=i,this.elGrid=r,this.w.dom.baseEl=e,this.w.dom.elWrap=i}_applyGridStyle(){var t;const e=this.elGrid,i=this.layout;e.style.display="grid";const n=this.split&&"2d"===this.split.mode&&!1!==(null==(t=this.cfg.header)?void 0:t.show);e.style.gridTemplateColumns=n?`auto repeat(${i.cols}, minmax(0, 1fr))`:`repeat(${i.cols}, minmax(0, 1fr))`,e.style.gap=`${i.gap}px`}_buildCells(){var t;const e=this.elGrid,i=this.split,n=this.layout,s="2d"===i.mode,r=s&&!1!==(null==(t=this.cfg.header)?void 0:t.show);this._stripEls=[];const a=this.cfg.emptyPanels||"placeholder";if(r){const t=yt.createElement("div");t.className="apexcharts-trellis-corner",e.appendChild(t),this._stripEls.push(t),(i.colKeys||[]).forEach((t,n)=>{const s=this.chrome.stripEl("column",t,{index:n,count:(i.colKeys||[]).length});e.appendChild(s),this._stripEls.push(s)})}this.panels=[],i.panels.forEach((t,o)=>{var l;if(r&&o%n.cols===0){const t=Math.floor(o/n.cols),s=this.chrome.stripEl("row",null!=(l=(i.rowKeys||[])[t])?l:"",{index:t,count:(i.rowKeys||[]).length});e.appendChild(s),this._stripEls.push(s)}const c=yt.createElement("div");c.className="apexcharts-trellis-cell",c.setAttribute("data-key",t.key),this._applyCellMutes(c,n.cells[o]),s||this.chrome.buildHeader(c,t.key,{index:o,count:i.panels.length});const h=yt.createElement("div");h.className="apexcharts-trellis-panel",this._virtualActive&&(h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${n.panelH}px`),c.appendChild(h);const u=t.empty&&"placeholder"!==a;if(t.empty)if(c.classList.add("apexcharts-trellis-cell-empty"),"hide"===a)c.classList.add("apexcharts-trellis-cell-hidden");else if("skip"===a)h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${n.panelH}px`;else{const t=yt.createElement("div");t.className="apexcharts-trellis-empty-label",t.textContent=this.w.config.noData&&this.w.config.noData.text||"no data",c.appendChild(t)}e.appendChild(c),this.panels.push({key:t.key,index:o,el:h,cellEl:c,chart:null,empty:t.empty,noMount:u})})}_applyCellMutes(t,e){t.classList.toggle("apexcharts-trellis-mute-x",!e.showXLabels),t.classList.toggle("apexcharts-trellis-mute-y",!e.showYLabels)}_assemblePanelOptions(t,{noAnimation:e=!1}={}){var i,n,s,r,a,c,h,u,d,p,f,g,m,y;const x=this.w,_=this.split,b=this.scales,w=this.layout,A=_.panels[t],M=v.clone(this.ctx.opts||{});delete M.trellis,delete M.series,delete M.responsive,M.annotations&&(M.annotations=function(t,e){if(!t||"object"!=typeof t)return t;const i=o({},t);for(const t of["yaxis","xaxis","points","texts","images"]){const n=i[t];Array.isArray(n)&&(i[t]=n.filter(t=>!t||void 0===t.scope||null===t.scope||"trellis"===t.scope||(Array.isArray(t.scope)?-1!==t.scope.map(String).indexOf(e):String(t.scope)===e)).map(t=>{if(!t||void 0===t.scope)return t;const e=o({},t);return delete e.scope,e}))}return i}(M.annotations,A.key));const k=M.chart||{},L=k.events||{},S=x.globals.chartID,C=null==(s=null==(n=null==(i=this.ctx.opts)?void 0:i.chart)?void 0:n.animations)?void 0:s.enabled,E=e||_.panels.length>16&&void 0===C,F=A.empty&&"placeholder"===(this.cfg.emptyPanels||"placeholder");let P=F?[Ie(_,{chartType:x.config.chart.type})]:A.series;const D=["pie","donut","polarArea","radialBar"].includes(x.config.chart.type);D&&(P=P.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0));const R=o(o(l(o({chart:l(o(o({id:`${S}-tp${t}`,group:this._groupId(),height:w.panelH,width:"100%",redrawOnParentResize:!1,redrawOnWindowResize:!1,print:{enabled:!1},parentHeightOffset:0,toolbar:{show:!1},zoom:{enabled:"none"!==this.cfg.zoom}},E?{animations:{enabled:!1}}:{}),this._panelRenderer?{renderer:this._panelRenderer}:{}),{events:l(o({},L),{zoomed:this.sync.makeZoomedHandler(L.zoomed),scrolled:this.sync.makeScrolledHandler(L.scrolled)})}),series:P},D?{}:{colors:P.map(t=>b.colorOf(t.name))}),{title:{text:"",margin:0,floating:!0},subtitle:{text:"",margin:0,floating:!0},legend:{show:!1}}),F?{tooltip:{enabled:!1}}:{}),w.panelH<120&&"grid"!==this.cfg.tooltip&&"boolean"!=typeof(null==(a=null==(r=this.ctx.opts)?void 0:r.tooltip)?void 0:a.compact)?{tooltip:{compact:!0}}:{});if(!(null==(c=k.sparkline)?void 0:c.enabled)&&!["pie","donut","polarArea","radialBar","radar","treemap"].includes(x.config.chart.type)){const t=M.grid&&M.grid.padding||{},e="datetime"===(null==(u=null==(h=this.ctx.opts)?void 0:h.xaxis)?void 0:u.type)?2:7;R.grid={padding:{top:("number"==typeof t.top?t.top:0)-12,bottom:("number"==typeof t.bottom?t.bottom:0)-e}}}const T=this._valueAxisIsX();b.x&&!T&&(R.xaxis={min:b.x.min,max:b.x.max});const N=this._yBoundsFor(A);if(N){const t=Array.isArray(null==(d=this.ctx.opts)?void 0:d.yaxis)?this.ctx.opts.yaxis[0]:null==(p=this.ctx.opts)?void 0:p.yaxis,e=Array.isArray(M.yaxis)?M.yaxis[0]:M.yaxis;let i={};if("function"!=typeof(null==(f=null==t?void 0:t.labels)?void 0:f.formatter)){const t=(N.max-N.min)/Math.max(1,N.tickAmount),e=Math.max(this._yLabelDecimals,Ke(t));i={labels:{formatter:t=>"number"==typeof t&&isFinite(t)?t.toFixed(e):t}}}R.yaxis=v.extend(e||{},o({min:N.min,max:N.max,tickAmount:N.tickAmount},i)),delete M.yaxis,T&&(R.xaxis=v.extend(R.xaxis||{},this._valueAxisXPatch(N)))}const O=this._frames;if(O&&O.plotOptions&&(R.plotOptions=v.clone(O.plotOptions)),O&&O.pieScaleOf){const t=O.pieScaleOf(A.key);if(null!==t){const e=null==(y=null==(m=null==(g=this.ctx.opts)?void 0:g.plotOptions)?void 0:m.pie)?void 0:y.customScale;R.plotOptions=v.extend(R.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}let $=v.extend(M,R);if("function"==typeof this.cfg.panel){const e=this.cfg.panel(A.key,{index:t,seriesNames:A.seriesNames});e&&"object"==typeof e&&($=v.extend($,e))}return $}_alignGutters(){return h(this,null,function*(){var t,e,i,n;const s=this.panels.map(t=>{var e,i,n,s,r;return null==(r=null==(s=null==(n=null==(i=null==(e=t.chart)?void 0:e.w)?void 0:i.globals)?void 0:n.yLabelsCoords)?void 0:s[0])?void 0:r.width}).filter(t=>"number"==typeof t&&isFinite(t));if(!s.length)return;const r=!!(null==(n=null==(i=null==(e=null==(t=this.panels[0])?void 0:t.chart)?void 0:e.w)?void 0:i.globals)?void 0:n.isBarHorizontal)?0:10,a=Math.max(0,Math.max(...s)-r);yield this._pushGutterFloor(a)})}_yLabelPad(){return 10}_pushGutterFloor(t){return h(this,null,function*(){for(const e of this.panels)e.chart&&(yield e.chart.updateOptions({yaxis:ui(e.chart,{labels:{minWidth:t}})},!1,!1,!1).catch(()=>{}))})}_refitForChrome(){if(!this._hostHeight())return;const t=this._chromeHeight();t<=0||Math.round(t)===Math.round(this._chromeH)?this._warnIfOverflowing():(this._chromeH=t,this._relayout(this._containerWidth()))}_warnIfOverflowing(){const t=this.layout;t&&t.overflowH&&!this._overflowWarned&&(this._overflowWarned=!0,console.warn(`ApexCharts: trellis needs ${Math.round(t.gridH+this._chromeH)}px but its container gives ${Math.round(this._hostHeight()||0)}px; ${t.rows} rows cannot go below the ${t.panelH}px panel floor. Raise the container, use fewer panels (trellis.limit) or more columns (trellis.columns), or lower trellis.minPanelHeight.`))}_onContainerResize(){this._mounted&&(this._raf||(this._raf=requestAnimationFrame(()=>{this._raf=0;const t=this._containerWidth(),e=this._hostHeight()||0;if(Math.round(t)!==Math.round(this._lastWidth)||Math.round(e)!==Math.round(this._lastHeight)){if(this._lastWidth=t,this._lastHeight=e,this._promotedKey){const t=this.panels.find(t=>t.key===this._promotedKey);return void(t&&t.chart&&t.chart.updateOptions({},!1,!1,!1).catch(()=>{}))}this._relayout(t)}})))}promote(t){return h(this,null,function*(){var e;const i=this.panels.find(e=>e.key===String(t));if(!i||i.noMount||!this._mounted)return;if(this._promotedKey===i.key)return;this._promotedKey&&(yield this.restorePromotion()),this._promotedKey=i.key;const n=this.layout,s=this.elGrid?this.elGrid.getBoundingClientRect().height:0,r=Math.round(Math.max(280,Math.min(560,s||(n?2.4*n.panelH:420))));null==(e=this.elWrap)||e.classList.add("apexcharts-trellis-promoting"),this.panels.forEach(t=>{if(!t.cellEl)return;const e=t===i;t.cellEl.classList.toggle("apexcharts-trellis-cell-promoted",e),t.cellEl.classList.toggle("apexcharts-trellis-cell-parked",!e)}),this._stripEls.forEach(t=>t.classList.add("apexcharts-trellis-cell-parked")),this.chrome.buildBreadcrumb(this._elChromeTop,i.key,()=>this.restorePromotion()),!i.chart&&this._virtualActive&&(i.wantMounted=!0,this.virtual._dirty.add(i),this.virtual._schedule()),i.el&&(i.el.style.minHeight=`${r}px`),i.chart&&(yield i.chart.updateOptions({chart:{height:r}},!1,!1,!1).catch(()=>{})),this._fire("panelPromoted",{key:i.key,chart:i.chart})})}restorePromotion(){return h(this,null,function*(){var t;if(!this._promotedKey)return;const e=this.panels.find(t=>t.key===this._promotedKey);this._promotedKey=null,null==(t=this.elWrap)||t.classList.remove("apexcharts-trellis-promoting"),this.panels.forEach(t=>{t.cellEl&&(t.cellEl.classList.remove("apexcharts-trellis-cell-promoted"),t.cellEl.classList.remove("apexcharts-trellis-cell-parked"))}),this._stripEls.forEach(t=>t.classList.remove("apexcharts-trellis-cell-parked")),this.chrome.removeBreadcrumb();const i=this.layout;e&&e.el&&i&&(e.el.style.minHeight=`${i.panelH}px`),e&&e.chart&&i&&(yield e.chart.updateOptions({chart:{height:i.panelH}},!1,!1,!1).catch(()=>{})),this._lastWidth=0,this._relayout(this._containerWidth()),this._lastWidth=this._containerWidth(),this._fire("panelRestored",{key:e?e.key:null})})}_relayout(t){const e=this.split;if(!e)return;const i=this.layout?this.layout.panelH:0;this.layout=Qe({panelCount:e.panels.length,containerWidth:t,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._warnIfOverflowing();const n=this.layout;this.panels.forEach((t,e)=>{if(t.cellEl&&this._applyCellMutes(t.cellEl,n.cells[e]),t.el&&this._virtualActive&&(t.el.style.minHeight=`${n.panelH}px`),!t.chart)return;const s=n.panelH!==i?{chart:{height:n.panelH}}:{};t.chart.updateOptions(s,!1,!1,!1).catch(()=>{})}),this._virtualActive&&this.virtual.refresh()}canApplyInPlace(t){if(!this._mounted||this._promotedKey)return!1;if(!t||"object"!=typeof t)return!1;const e=Object.keys(t);return!!e.length&&e.every(t=>Fi.includes(t))}applyPanelOptions(t=!0){return h(this,null,function*(){var e,i,n;const s=this.split;if(!s)return;const r=this._yMode()!==((null==(e=this.cfg.scales)?void 0:e.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Ze(s,r,o({chartType:this.w.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames?this._frames.yExtentOverride:null},this._stackingHost())),yield Promise.all(this.panels.map(e=>{if(!e.chart)return Promise.resolve();const i=this._assemblePanelOptions(e.index);return delete i.series,i.chart&&delete i.chart.height,e.chart.updateOptions(i,!1,t,!1,!1).catch(()=>{})})),null==(n=(i=this.chrome).refreshLegendColors)||n.call(i)})}updateSeries(t,e=!0){return h(this,null,function*(){var i;const n=this.w;if(Array.isArray(this.cfg.data)&&this.cfg.data.length)return console.warn("ApexCharts: this trellis renders from trellis.data; update it via updateOptions({ trellis: { data } })."),Promise.resolve();if(n.config.series=t,this.ctx.opts&&(this.ctx.opts.series=t),!this._mounted)return this.ctx.render();const s=Be(t||[],this.cfg,{chartType:n.config.chart.type});if(!(s.panels.length===this.panels.length&&s.panels.every((t,e)=>t.key===this.panels[e].key)))return this.teardown(),this.ctx.render();this.split=s,this._frames=Ye(s,this.cfg,n.config,"histogram"===n.config.chart.requestedType?"histogram":n.config.chart.type);const r=this._yMode()!==((null==(i=this.cfg.scales)?void 0:i.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Ze(s,r,o({chartType:n.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost()));const a=this.scales,c=this._frames,h=["pie","donut","polarArea","radialBar"].includes(n.config.chart.type),u=this.panels.map((t,i)=>{var n,r,o;if(!t.chart)return Promise.resolve();const l={series:h?s.panels[i].series.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0):s.panels[i].series},u=this._valueAxisIsX();a.x&&!u&&(l.xaxis={min:a.x.min,max:a.x.max});const d=this._yBoundsFor(s.panels[i]);if(d&&(l.yaxis=ui(t.chart,{min:d.min,max:d.max,tickAmount:d.tickAmount}),u&&(l.xaxis=v.extend(l.xaxis||{},this._valueAxisXPatch(d)))),c.plotOptions&&(l.plotOptions=v.clone(c.plotOptions)),c.pieScaleOf){const t=c.pieScaleOf(s.panels[i].key);if(null!==t){const e=null==(o=null==(r=null==(n=this.ctx.opts)?void 0:n.plotOptions)?void 0:r.pie)?void 0:o.customScale;l.plotOptions=v.extend(l.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}return t.chart.updateOptions(l,!1,e,!1).catch(()=>{})});return Promise.all(u)})}getPanels(){return this.panels.map(t=>({key:t.key,index:t.index,chart:t.chart,el:t.cellEl}))}getPanel(t){const e=this.panels.find(e=>e.key===String(t));return e?e.chart:null}teardown(){this.virtual.stop(),this._virtualActive=!1,this._panelRenderer=null,this._promotedKey=null,this._frames=null,this.chrome.destroyGradientLegend(),this.gridTooltip&&(this.gridTooltip.destroy(),this.gridTooltip=null),this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),mt.isBrowser()&&this.ctx.el&&ve(this.ctx.el,this._resizeHandler),this.panels.forEach(t=>{if(t.chart)try{t.chart.destroy()}catch(t){}t.chart=null}),this.panels=[],this._stripEls=[],this.elWrap&&this.elWrap.parentNode&&this.elWrap.parentNode.removeChild(this.elWrap),this.elWrap=null,this.elGrid=null,this._mounted=!1,this.ctx._renderPromise=null}}});g.default.registerFeatures({measure:class{constructor(t,e){this.w=t,this.ctx=e,this.graphics=new _(t),this.pins=[],this.drag=null,this.armed=!1,this.persistent=!1,this.pane=null,this._seedActive=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onSeedDown=this._onSeedDown.bind(this),this._onSeedKey=this._onSeedKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender),this._bindKeys()}_cfg(){return this.w.config.chart.measure||{}}_enabled(){return this.w.globals.axisCharts&&!0===this._cfg().enabled}_mode(){return"free"===this._cfg().mode?"free":"span"}_snapToSeries(t){const e=(this.w.config.series||[])[0];if(!e)return null;const i=this._points(e.data||[]);if(!i.length)return null;let n=i[0],s=Math.abs(i[0].x-t);for(let e=1;e<i.length;e++){const r=Math.abs(i[e].x-t);r<s&&(s=r,n=i[e])}return n}_resolve(t){if("free"===this._mode())return t;const e=this._snapToSeries(t.x);if(!e)return t;const i=this._dataToGrid(e.x,e.y);return{x:e.x,y:e.y,gx:i.gx,gy:i.gy}}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_bindKeys(){if(this._keysBound)return;const t=this._doc();t&&(t.addEventListener("keydown",this._onKeyDown),t.addEventListener("keyup",this._onKeyUp),this._keysBound=!0)}_onKeyDown(t){if(!this._enabled()||this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()?this._arm():"Escape"===t.key&&this._cancelDrag()}_onKeyUp(t){if(this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()&&(this.drag||this._disarm())}startMeasure(){this._enabled()&&(this.persistent=!0,this._arm())}stopMeasure(){this.persistent=!1,this._cancelDrag(),this._disarm()}seedFromClient(t,e){if(!this._enabled())return;this._cancelDrag(),this._endSeed(!1);const i=this._project(t,e);this.drag={a:i,b:i},this._seedActive=!0;const n=this._doc();n&&(n.addEventListener("mousemove",this._onMove),n.addEventListener("touchmove",this._onMove,{passive:!1}),n.addEventListener("mousedown",this._onSeedDown,!0),n.addEventListener("touchstart",this._onSeedDown,!0),n.addEventListener("keydown",this._onSeedKey,!0)),this._renderLive()}_onSeedDown(t){if(!this._seedActive||!this.drag)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:i}=this._clientXY(t);this.drag.b=this._project(e,i),this._endSeed(!0)}_onSeedKey(t){"Escape"===t.key&&this._endSeed(!1)}_endSeed(t){var e,i;if(!this._seedActive)return;this._seedActive=!1;const n=this._doc();n&&(n.removeEventListener("mousemove",this._onMove),n.removeEventListener("touchmove",this._onMove),n.removeEventListener("mousedown",this._onSeedDown,!0),n.removeEventListener("touchstart",this._onSeedDown,!0),n.removeEventListener("keydown",this._onSeedKey,!0));const s=this.drag;if(this.drag=null,this._clearLive(),!t||!s)return;const r=this._resolve(s.a),a=this._resolve(s.b);if(Math.abs(r.gx-a.gx)<2&&Math.abs(r.gy-a.gy)<2)return;const o=this._mode();!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:r.x,ya:r.y,xb:a.x,yb:a.y,mode:o}),this._renderPins(),null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,"measure")),this._fireMeasured(r,a)}clearMeasures(){var t,e;this.pins=[],this._renderPins(),null==(e=null==(t=this.ctx.history)?void 0:t.snapshot)||e.call(t,"clear measures")}getPins(){return this.pins.map(t=>({xa:t.xa,ya:t.ya,xb:t.xb,yb:t.yb,mode:"free"===t.mode?"free":"span"}))}setPins(t){this.pins=Array.isArray(t)?t.filter(t=>t&&isFinite(t.xa)&&isFinite(t.ya)&&isFinite(t.xb)&&isFinite(t.yb)).map(t=>({xa:+t.xa,ya:+t.ya,xb:+t.xb,yb:+t.yb,mode:"free"===t.mode?"free":"span"})):[],this._renderPins()}_points(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i];let s,r;Array.isArray(n)?(s=+n[0],r=+n[1]):n&&"object"==typeof n?(s=+n.x,r=+n.y):(s=i,r=+n),isFinite(s)&&isFinite(r)&&e.push({x:s,y:r})}return e}_arm(){if(this.armed||!this._enabled())return;const t=this.w,e=t.dom.elGraphical;if(!e)return;this.armed=!0;const i=this.graphics.drawRect(0,0,t.layout.gridWidth,t.layout.gridHeight);i.node.setAttribute("class","apexcharts-measure-capture"),i.node.setAttribute("fill","transparent"),i.node.style.cursor="crosshair",i.node.style.pointerEvents="all",i.node.addEventListener("mousedown",this._onDown),i.node.addEventListener("touchstart",this._onDown,{passive:!1}),e.add(i),this.pane=i}_disarm(){if(this.armed=!1,this.pane){this.pane.node.removeEventListener("mousedown",this._onDown),this.pane.node.removeEventListener("touchstart",this._onDown);const t=this.pane.node;t.parentNode&&t.parentNode.removeChild(t),this.pane=null}}_clientXY(t){const e=t.touches&&t.touches[0]?t.touches[0]:t;return{cx:e.clientX,cy:e.clientY}}_plotRect(){const t=this.w;return t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg")?ai.plotRect(t):null}_yRange(){const t=this.w.globals,e=t.yAxisScale&&t.yAxisScale[0];return e&&isFinite(e.niceMin)&&isFinite(e.niceMax)&&e.niceMax!==e.niceMin?[e.niceMin,e.niceMax]:[t.minY,t.maxY]}_project(t,e){const i=this.w,n=this._plotRect(),s=i.layout.gridWidth,r=i.layout.gridHeight,a=t=>t<0?0:t>1?1:t,o=n&&n.width?a((t-n.left)/n.width):0,l=n&&n.height?a((e-n.top)/n.height):0,[c,h]=this._yRange();return{x:i.globals.minX+o*(i.globals.maxX-i.globals.minX),y:h-l*(h-c),gx:o*s,gy:l*r}}_dataToGrid(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=i.globals.maxX-i.globals.minX||1,[a,o]=this._yRange(),l=o-a||1;return{gx:(t-i.globals.minX)/r*n,gy:s-(e-a)/l*s}}_onDown(t){if(!this.armed)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:i}=this._clientXY(t),n=this._project(e,i);this.drag={a:n,b:n};const s=this._doc();s&&(s.addEventListener("mousemove",this._onMove),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("touchend",this._onUp)),this._renderLive()}_onMove(t){if(!this.drag)return;t.cancelable&&t.preventDefault();const{cx:e,cy:i}=this._clientXY(t);this.drag.b=this._project(e,i),this._renderLive()}_onUp(t){var e,i;const n=this._doc();if(n&&(n.removeEventListener("mousemove",this._onMove),n.removeEventListener("mouseup",this._onUp),n.removeEventListener("touchmove",this._onMove),n.removeEventListener("touchend",this._onUp)),!this.drag)return;const s=this.drag.a,r=this.drag.b;if(this.drag=null,this._clearLive(),Math.abs(s.gx-r.gx)<2&&Math.abs(s.gy-r.gy)<2)return void(this.persistent||this._disarm());const a=this._mode(),o=this._resolve(s),l=this._resolve(r);!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:o.x,ya:o.y,xb:l.x,yb:l.y,mode:a}),this._renderPins(),null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,"measure")),this._fireMeasured(o,l),this.persistent||this._disarm()}_cancelDrag(){const t=this._doc();t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("touchend",this._onUp)),this.drag=null,this._clearLive()}_stats(t,e){const i=e.x-t.x,n=e.y-t.y;return{dx:i,dy:n,pct:0!==t.y?n/Math.abs(t.y)*100:NaN,slope:0!==i?n/i:NaN}}_fmt(t){if(!isFinite(t))return"n/a";const e=Math.abs(t);return 0!==e&&(e<.01||e>=1e6)?t.toExponential(2):String(Math.round(100*t)/100)}_computedStyle(){if(!mt.isBrowser())return null;const t=this.w.dom.elGraphical&&this.w.dom.elGraphical.node;if(!t||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(t)}catch(t){return null}}_resolveColor(t,e,i,n){if(t)return t;const s=void 0!==n?n:this._computedStyle();return(s?s.getPropertyValue(e).trim():"")||i}_colors(){const t=this._cfg().colors||{},e=this._computedStyle();return{up:this._resolveColor(t.up,"--apx-measure-up","#16a34a",e),down:this._resolveColor(t.down,"--apx-measure-down","#dc2626",e),neutral:this._resolveColor(t.neutral,"--apx-measure-neutral","#64748b",e),guide:this._resolveColor(t.guide,"--apx-measure-guide","#94a3b8",e)}}_dirColor(t){const e=this._colors();return 0===t?e.neutral:t>0?e.up:e.down}_dirClass(t){return 0===t?"apexcharts-measure-flat":t>0?"apexcharts-measure-up":"apexcharts-measure-down"}_fmtPct(t){if(!isFinite(t))return"n/a";const e=this._cfg().format&&this._cfg().format.percent;if("function"==typeof e)try{const i=e(t);if(null!=i)return String(i)}catch(t){}return(t>=0?"+":"")+this._fmt(t)+"%"}_label(t,e,i,n){const s=this._cfg().label;if("function"==typeof s){const r=s({from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:i.dx,dy:i.dy,percentChange:i.pct,slope:i.slope,mode:n});return Array.isArray(r)?r.map(String):[String(r)]}if("span"===n){const n=0===i.dy?"":i.dy>0?" \u2191":" \u2193",s=isFinite(i.pct)?"("+this._fmtPct(i.pct)+")":"";return[this._fmtY(i.dy)+" "+s+n,this._fmtX(t.x)+" to "+this._fmtX(e.x)]}return["\u0394x "+this._fmtDx(i.dx),"\u0394y "+this._fmtY(i.dy),this._fmtPct(i.pct)]}_fmtDx(t){if("datetime"===this.w.config.xaxis.type){const e=t/864e5;return Math.round(10*e)/10+"d"}return this._fmt(t)}_fmtY(t){const e=this._cfg().format&&this._cfg().format.y;if("function"==typeof e)try{const i=e(t);if(null!=i)return String(i)}catch(t){}const i=this.w.globals.yLabelFormatters&&this.w.globals.yLabelFormatters[0];if("function"==typeof i)try{const e=i(t,{seriesIndex:0,dataPointIndex:-1,w:this.w});if(null!=e&&""!==e)return String(e)}catch(t){}return this._fmt(t)}_fmtX(t){const e=this.w,i=this._cfg().format&&this._cfg().format.x;if("function"==typeof i)try{const e=i(t);if(null!=e)return String(e)}catch(t){}if("datetime"===e.config.xaxis.type){return new Date(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}const n=e.globals.xLabelFormatter;if("function"==typeof n)try{const i=n(t,{w:e});if(null!=i&&""!==i)return String(i)}catch(t){}return this._fmt(t)}_liveGroup(){const t=this.w;if(this._live&&this._live.node&&this._live.node.parentNode)return this._live;const e=this.graphics.group({class:"apexcharts-measure-live"});return e.node.style.pointerEvents="none",t.dom.elGraphical&&t.dom.elGraphical.add(e),this._live=e,e}_clearLive(){if(this._live&&this._live.node){const t=this._live.node;t.parentNode&&t.parentNode.removeChild(t)}this._live=null}_renderLive(){if(!this.drag)return;const t=this._liveGroup();for(;t.node.firstChild;)t.node.removeChild(t.node.firstChild);const e=this._resolve(this.drag.a),i=this._resolve(this.drag.b);this._drawRuler(t,e,i,!1,this._mode())}_renderPins(){const t=this.w,e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-measure-pins");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this.pins.length||!t.dom.elGraphical)return;const i=this.graphics.group({class:"apexcharts-measure-pins"});i.node.style.pointerEvents="none",t.dom.elGraphical.add(i),this.pins.forEach(t=>{const e=l(o({},this._dataToGrid(t.xa,t.ya)),{x:t.xa,y:t.ya}),n=l(o({},this._dataToGrid(t.xb,t.yb)),{x:t.xb,y:t.yb});this._drawRuler(i,e,n,!0,t.mode||"span")})}_drawRuler(t,e,i,n,s){const r=this._stats(e,i),a=this.graphics.group({class:"apexcharts-measure-ruler "+this._dirClass(r.dy)+(n?" apexcharts-measure-pinned":"")});"free"===(s||this._mode())?this._drawFree(a,e,i,r):this._drawSpan(a,e,i,r),t.add(a)}_dot(t,e,i){if(!1===this._cfg().markers)return;const n=this.graphics.drawMarker(e.gx,e.gy,{pSize:4,shape:"circle",pointFillColor:i,pointFillOpacity:1,pointStrokeColor:"#fff",pointStrokeWidth:2,pointStrokeOpacity:1});t.add(n)}_readout(t,e,i,n,s,r,a){const o=this.graphics.drawRect(i,n,s,r,4);o.node.setAttribute("class","apexcharts-measure-label-bg"),o.attr({fill:"#ffffff","fill-opacity":.95,stroke:a,"stroke-width":1}),t.add(o);const l=this.graphics.drawText({x:i+9,y:n+15,text:e,textAnchor:"start",fontSize:"11px",foreColor:"#1e293b",cssClass:"apexcharts-measure-label"});t.add(l)}_drawSpan(t,e,i,n){const s=this.w,r=this._cfg(),a=s.layout.gridHeight,o=this._dirColor(n.dy),l=Math.min(e.gx,i.gx),c=Math.max(e.gx,i.gx);if(!1!==r.band){const e=this.graphics.drawRect(l,0,Math.max(0,c-l),a,0);e.node.setAttribute("class","apexcharts-measure-band"),e.attr({fill:o,"fill-opacity":.09,stroke:"none"}),t.add(e)}!1!==r.guides&&[e,i].forEach(e=>{const i=this.graphics.drawLine(e.gx,0,e.gx,a,this._colors().guide,4,1);i.node.setAttribute("class","apexcharts-measure-vline"),t.add(i)}),[e,i].forEach(e=>this._dot(t,e,o));const h=this._label(e,i,n,"span"),u=h.reduce((t,e)=>Math.max(t,e.length),0),d=Math.max(148,6.4*u),p=20+15*h.length;let f=(l+c)/2-d/2;f=Math.max(2,Math.min(f,s.layout.gridWidth-d-2)),this._readout(t,h,f,4,d,p,o)}_drawFree(t,e,i,n){const s=this._dirColor(n.dy),r=this.graphics.drawLine(e.gx,e.gy,i.gx,i.gy,s,0,2);r.node.setAttribute("class","apexcharts-measure-line"),t.add(r),[e,i].forEach(e=>this._dot(t,e,s));const a=this._label(e,i,n,"free"),o=a.reduce((t,e)=>Math.max(t,e.length),0),l=Math.max(72,6.2*o),c=16+15*a.length;let h=(e.gx+i.gx)/2+8,u=(e.gy+i.gy)/2-c/2;h=Math.max(2,Math.min(h,this.w.layout.gridWidth-l-2)),u=Math.max(2,Math.min(u,this.w.layout.gridHeight-c-2)),this._readout(t,a,h,u,l,c,s)}_fireMeasured(t,e){const i=this._stats(t,e),n={from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:i.dx,dy:i.dy,percentChange:i.pct,slope:i.slope},s=this.w.config.chart.events.measured;"function"==typeof s&&s(this.ctx,n),this.ctx.events.fireEvent("measured",[this.ctx,n])}_afterRender(){this._enabled()&&(this.w.interact.measureEnabled&&!this.persistent&&(this.persistent=!0),this.pins.length&&this._renderPins(),this.persistent&&!this.drag&&(this._disarm(),this._arm()))}teardown(){this._cancelDrag(),this._endSeed(!1),this._disarm();const t=this._doc();t&&this._keysBound&&(t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("keyup",this._onKeyUp)),this._keysBound=!1,this.pins=[]}}});const Di=[".apexcharts-bar-area",".apexcharts-candlestick-area",".apexcharts-boxPlot-area",".apexcharts-rangebar-area",".apexcharts-marker"].join(", "),Ri=[".apexcharts-pie-area",".apexcharts-bar-area"].join(", "),Ti="apexcharts-crossfilter-dimmed",Ni=["pie","donut","polarArea","radialBar"];g.default.registerFeatures({linkedViews:class{constructor(t,e){this.w=t,this.ctx=e,this._dimmed=!1,this._wired=!1,this._pending=!1,this._lastValues=null,this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onChange=this._onChange.bind(this),"filter"===this._mode()&&this._initEngine()}_mode(){const t=this.w.config.chart.link;return t&&"function"==typeof t.dimension?"filter":t&&t.enabled?"highlight":"off"}_enabled(){const t=this.w.config.chart.link;return!(!t||!t.enabled)}onSourceSelection(t){var e;const i=this._mode();if("off"===i)return;if(!t||null==t.min||null==t.max)return;let n=Math.min(t.min,t.max),s=Math.max(t.min,t.max);const r=this.w.globals.minX,a=this.w.globals.maxX;if(isFinite(r)&&isFinite(a)&&a>r){const t=1e-6*(a-r);n-r<=t&&(n=r),a-s<=t&&(s=a)}if("filter"===i){const t=this._cf();if(!t)return;return t.filter(this._chartId(),[n,s]),void this._fireFilterChange(t,[n,s])}this._group().forEach(t=>{var e;null==(e=null==t?void 0:t.linkedViews)||e.applyDim(n,s)});const o={xaxis:{min:n,max:s},sourceChartID:this.w.globals.chartID};"function"==typeof this.w.config.chart.events.crossFilter&&this.w.config.chart.events.crossFilter(this.ctx,o),null==(e=this.ctx.events)||e.fireEvent("crossFilter",[this.ctx,o])}_group(){const t="function"==typeof this.ctx.getGroupedCharts?this.ctx.getGroupedCharts():[];return[this.ctx,...t]}applyDim(t,e){if(!this._enabled())return;const i=this.w,n=i.dom.baseEl;if(!n)return;const s=i.config.chart.link.dimOpacity;i.dom.elWrap&&"number"==typeof s&&i.dom.elWrap.style.setProperty("--apx-cf-dim",String(s));const r=i.globals.seriesX||[];n.querySelectorAll(Di).forEach(i=>{const n=i.getAttribute("j");if(null===n)return;const s=parseInt(n,10),a=i.getAttribute("index"),o=null===a?0:parseInt(a,10),l=r[o]||r[0];if(!l)return;const c=l[s];null!=c&&i.classList.toggle(Ti,c<t||c>e)}),this._dimmed=!0}clear(){const t=this.w.dom.baseEl;t&&(t.querySelectorAll("."+Ti).forEach(t=>t.classList.remove(Ti)),this._dimmed=!1)}clearGroup(){if("filter"===this._mode()){const t=this._cf();return void(t&&t.reset())}this._group().forEach(t=>{var e;return null==(e=null==t?void 0:t.linkedViews)?void 0:e.clear()})}_chartId(){return this.w.globals.chartID}_cf(){const t=this.w.config.chart.link,e=t&&(t.id||this.w.config.chart.group);return e?ht.get(e):null}_isPie(){return-1!==Ni.indexOf(this.w.config.chart.type)}_isHeatmap(){return"heatmap"===this.w.config.chart.type}_initEngine(){const t=this._cf(),e=this.w.config.chart.link;if(!t){const t=e&&e.id||this.w.config.chart.group;return void console.warn(`[apexcharts] chart.link.dimension is set but no crossfilter coordinator "${t}" exists. Call ApexCharts.crossfilter({ id, records }) before creating the chart.`)}const i=this._chartId();t.hasDimension(i)||t.registerDimension(i,{dimension:e.dimension,reduce:e.reduce,type:e.type||(this._isHeatmap()?"matrix":void 0),bins:e.bins,order:e.order}),this._injectSeries(t.aggregateFor(i)),this._wire(t)}_seriesFromAgg(t){if("matrix"===t.type)return t.yLabels.map((e,i)=>({name:String(e),data:t.xLabels.map((e,n)=>({x:String(e),y:t.matrix[i][n]}))}));if(this._isPie())return t.values.slice();const e=this.w.config.chart.link.seriesName||"Count";return"range"===t.type?[{name:e,data:t.labels.map((e,i)=>[e,t.values[i]])}]:[{name:e,data:t.values.slice()}]}_sigOf(t){return JSON.stringify(t.matrix||t.values)}_injectSeries(t){const e=this.w;this._lastValues=this._sigOf(t),e.config.series=this._seriesFromAgg(t),"matrix"!==t.type&&(this._isPie()?e.config.labels=t.labels.map(String):"category"===t.type?(e.config.xaxis||(e.config.xaxis={}),e.config.xaxis.categories=t.labels.map(String)):"range"===t.type&&this._pinRangeDomain(t.edges))}_pinRangeDomain(t){if(!Array.isArray(t)||t.length<2)return;const e=this.w;e.config.xaxis||(e.config.xaxis={}),null==e.config.xaxis.min&&(e.config.xaxis.min=t[0]),null==e.config.xaxis.max&&(e.config.xaxis.max=t[t.length-1])}_wire(t){this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.on("change",this._onChange))}_onPointSelect(t,e,i){if("filter"!==this._mode()||!i||null==i.dataPointIndex)return;const n=this._cf();if(!n)return;const s=this._chartId(),r=n.aggregateFor(s);if("matrix"===r.type)return;const a=r.keys[i.dataPointIndex];null!=a&&(n.toggleKey(s,a),this._fireFilterChange(n,a))}_onChange(){"filter"!==this._mode()||this._pending||(this._pending=!0,Promise.resolve().then(()=>{this._pending=!1,this.w.globals.isDestroyed||this._applyAggregation()}))}_applyAggregation(){if("filter"!==this._mode())return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),i=this._sigOf(e);i!==this._lastValues?(this._lastValues=i,this.ctx.updateSeries(this._seriesFromAgg(e),!0)):this._applySelfDim()}_afterRender(){if("filter"!==this._mode())return;const t=this.w.config.series;t&&0!==t.length?this._applySelfDim():this._reassertSeries()}_reassertSeries(){this._pending||(this._pending=!0,Promise.resolve().then(()=>{if(this._pending=!1,this.w.globals.isDestroyed)return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),i=this._seriesFromAgg(e);i.length&&(this._lastValues=this._sigOf(e),this.ctx.updateSeries(i,!0))}))}_applySelfDim(){const t=this._cf();if(!t)return;const e=this.w,i=e.dom.baseEl;if(!i)return;const n=this._chartId(),s=t.filterOf(n),r=e.config.chart.link.dimOpacity;e.dom.elWrap&&"number"==typeof r&&e.dom.elWrap.style.setProperty("--apx-cf-dim",String(r));const a=s instanceof Set,o=Array.isArray(s),l=t.aggregateFor(n);if("matrix"===l.type)return;const c=l.keys;i.querySelectorAll(Ri).forEach(t=>{const e=t.getAttribute("j");if(null===e)return;const i=c[parseInt(e,10)];let n=!1;a?n=!s.has(i):o&&Array.isArray(i)&&(n=i[1]<=s[0]||i[0]>=s[1]),t.classList.toggle(Ti,n)}),this._dimmed=!!s}_fireFilterChange(t,e){var i;const n=l(o({},t.state()),{sourceChartID:this._chartId(),key:e}),s=this.w.config.chart.events;"function"==typeof s.filterChange&&s.filterChange(this.ctx,n),null==(i=this.ctx.events)||i.fireEvent("filterChange",[this.ctx,n])}teardown(){var t,e,i,n,s,r;if(this.clear(),this._wired){null==(e=(t=this.ctx).removeEventListener)||e.call(t,"dataPointSelection",this._onPointSelect),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"mounted",this._afterRender),null==(r=(s=this.ctx).removeEventListener)||r.call(s,"updated",this._afterRender);const a=this._cf();a&&(a.off("change",this._onChange),a.removeDimension(this._chartId())),this._wired=!1}}},crossfilter:ht});const Oi=g.__apex_Options,$i=["point","xaxis","yaxis"],Ii=[10,11,12,14,17,20],Bi=["circle","square","diamond","triangle"],zi={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},Wi=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class Hi{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let i=t,n=1/0;for(let s=0;s<e.length;s++){const r=Math.abs(e[s]-t);r<n&&(n=r,i=e[s])}return i}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const i=this.w.globals.yAxisScale,n=i&&i[e];return n&&Array.isArray(n.result)&&n.result.length?this._nearest(t,n.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const i="point"===t?"points":t;return Array.isArray(e[i])?e[i]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return $i.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&($i.forEach(i=>{this._annoList(i).forEach((n,s)=>{this._isDraggable(n)&&(n.id||(n.id="apexcharts-ink-"+i+"-"+s+"-"+t.globals.chartID),e.querySelectorAll("."+n.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,i,s)),t.addEventListener("touchstart",t=>this._onDown(t,i,s)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(i,s,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,i){if(t.button&&0!==t.button)return;const n=this.w,s=n.dom.baseEl&&n.dom.baseEl.ownerDocument;if(!s)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const r="touchstart"===t.type?t.touches[0]:t,a=n.dom.Paper&&n.dom.Paper.node,o=a&&a.getScreenCTM?a.getScreenCTM():null,l=this._annoList(e)[i];let c="move",h=null,u=0,d=0;if("xaxis"===e&&null!=l.x2&&(h=n.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),h)){const t=h.getBoundingClientRect();Math.abs(r.clientX-t.left)<=8?c="resize-x1":Math.abs(r.clientX-t.right)<=8&&(c="resize-x2"),u=parseFloat(h.getAttribute("x"))||0,d=parseFloat(h.getAttribute("width"))||0}this._drag={type:e,index:i,anno:l,els:Array.from(n.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:h,origX:u,origW:d,startX:r.clientX,startY:r.clientY,scaleX:o&&o.a?o.a:1,scaleY:o&&o.d?o.d:1,dxPixel:0,dyPixel:0,moved:!1},s.addEventListener("mousemove",this._onMove),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const i="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(i.clientX-e.startX)/e.scaleX,e.dyPixel=(i.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,i;null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,t)}_applyDelta(t,e){const i=this.w,n=i.layout.gridWidth?t.dxPixel*(i.globals.xRange/i.layout.gridWidth):0;if("point"===t.type){const{newX:n,newY:s}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(n),null!=s){const t=e.yAxisIndex||0,n=i.globals.seriesYAxisMap;e.y=this._snapY(s,n&&n[t]?n[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const n=e.yAxisIndex||0,s=i.globals.seriesYAxisMap,r=s&&s[n]?s[n][0]:0,a=i.globals.yRange?i.globals.yRange[r]:null;if(null==a||!i.layout.gridHeight)return;const o=-t.dyPixel*(a/i.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=o),e.y2+=o):"number"==typeof e.y&&(e.y=this._snapY(e.y+o,r))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=n,e.x2+=n):e.x=this._snapX(e.x+n);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const i=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!i:i)?e.x=this._snapX(e.x+n):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+n))}}}_invertPoint(t,e,i){const n=this.w,s=("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric;let r=t.x;!s&&"number"==typeof t.x&&n.layout.gridWidth&&(r=t.x+e*(n.globals.xRange/n.layout.gridWidth));let a=t.y;const o=t.yAxisIndex||0,l=n.globals.seriesYAxisMap,c=l&&l[o]?l[o][0]:0,h=n.globals.yRange?n.globals.yRange[c]:null,u=n.config.yaxis[o]&&n.config.yaxis[o].logarithmic;return"number"==typeof t.y&&null!=h&&!u&&n.layout.gridHeight&&(a=t.y-i*(h/n.layout.gridHeight)),{newX:r,newY:a}}_redrawAnno(t,e,i){const n=this.w.dom.baseEl,s=this.ctx.annotations;if(!n||!s)return;n.querySelectorAll("."+e.id).forEach(t=>t.remove());const r=n.querySelector(".apexcharts-"+t+"-annotations");if(!r)return;"point"===t&&s.pointsAnnotations?s.pointsAnnotations.addPointAnnotation(e,r,i):"xaxis"===t&&s.xAxisAnnotations?s.xAxisAnnotations.addXaxisAnnotation(e,r,i):"yaxis"===t&&s.yAxisAnnotations&&s.yAxisAnnotations.addYaxisAnnotation(e,r,i);const a=n.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(a&&s.helpers&&e.label&&e.label.text){const t=s.helpers.addBackgroundToAnno(a,e);t&&a.parentNode&&a.parentNode.insertBefore(t.node,a)}this._attach()}_fireAnnotationEvent(t,e){var i;const n=this.w.config.chart.events;"function"==typeof n[t]&&n[t](this.ctx,e),null==(i=this.ctx.events)||i.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,i){const n={type:t,id:e.id,index:i,x:e.x,y:e.y};null!=e.x2&&(n.x2=e.x2),null!=e.y2&&(n.y2=e.y2),this._fireAnnotationEvent("annotationDragged",n)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,i={}){const n=this.w;this._wire(),this._createSeq+=1;const s="apexcharts-ink-new-"+this._createSeq+"-"+n.globals.chartID,r=v.extend((new Oi).pointAnnotation,{x:t,y:e,id:s,owner:"ink",draggable:!0,label:{text:i.text||"Note"}});n.config.annotations||(n.config.annotations={}),Array.isArray(n.config.annotations.points)||(n.config.annotations.points=[]),n.config.annotations.points.push(r);const a=n.config.annotations.points.length-1;return this._redrawAnno("point",r,a),this._checkpoint("ink:create"),this._fireCreated("point",r,a),this._startEdit("point",a,{select:!0}),r}createLineAt(t,e,i={}){const n=this.w;this._wire(),this._createSeq+=1;const s="apexcharts-ink-new-"+this._createSeq+"-"+n.globals.chartID,r="y"===t?"yaxis":"xaxis",a="yaxis"===r?(new Oi).yAxisAnnotation:(new Oi).xAxisAnnotation,o={id:s,owner:"ink",draggable:!0,strokeDashArray:null!=i.strokeDashArray?i.strokeDashArray:4,label:{text:i.text||""}};i.color&&(o.borderColor=i.color,o.label.borderColor=i.color),"yaxis"===r?o.y=e:o.x=e;const l=v.extend(a,o);n.config.annotations||(n.config.annotations={}),Array.isArray(n.config.annotations[r])||(n.config.annotations[r]=[]),n.config.annotations[r].push(l);const c=n.config.annotations[r].length-1;return this._redrawAnno(r,l,c),this._checkpoint("ink:create"),this._fireCreated(r,l,c),!1!==i.select&&this._startEdit(r,c,{select:!0}),l}_pixelToData(t,e){const i=this.w;if(!i.globals.axisCharts||!i.dom.baseEl||!i.dom.baseEl.querySelector(".apexcharts-svg"))return null;const n=ai.plotRect(i);if(!n.width||!n.height)return null;const s=(t-n.left)/n.width,r=(e-n.top)/n.height;let a=i.globals.minX+s*i.globals.xRange;const o=(i.globals.minYArr&&null!=i.globals.minYArr[0]?i.globals.minYArr[0]:i.globals.minY)+(1-r)*(i.globals.yRange&&null!=i.globals.yRange[0]?i.globals.yRange[0]:i.globals.maxY-i.globals.minY);return("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric&&(a=Math.round(a)),{x:a,y:o}}_fireCreated(t,e,i){const n={type:t,id:e.id,index:i};void 0!==e.x&&(n.x=e.x),void 0!==e.y&&(n.y=e.y),this._fireAnnotationEvent("annotationCreated",n)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,i=e.createElement("div");i.className="apexcharts-ink-palette";const n=i.style;n.position="absolute",n.top="6px",n.left="6px",n.zIndex="15";const s=e.createElement("button");s.type="button",s.className="apexcharts-ink-add",s.textContent="+ Note";const r=s.style;r.cursor="pointer",r.font="12px sans-serif",r.padding="4px 9px",r.borderRadius="5px",r.border="1px solid #6366f1",r.color="#4338ca",r.background="#fff",s.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),i.appendChild(s),t.appendChild(i),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:Wi}static _isLight(t){const e=String(t||"").replace("#",""),i=3===e.length?e.split("").map(t=>t+t).join(""):e,n=parseInt(i,16);if(isNaN(n)||6!==i.length)return!1;return(.299*(n>>16&255)+.587*(n>>8&255)+.114*(255&n))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,i,n,s,r){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-btn"+(s?" "+s:""),a.title=i,a.setAttribute("aria-label",i),r?a.innerHTML=e:a.textContent=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),n()}),a}_cardLabel(t,e){const i=t.createElement("span");return i.className="apexcharts-ink-cardlabel",i.textContent=e,i}_mkSwatch(t,e,i,n){const s=t.createElement("button");return s.type="button",s.className="apexcharts-ink-swatch"+(n?" "+n:""),s.title=e,s.setAttribute("aria-label","Color "+e),s.dataset.color=e,s.style.background=e,s.addEventListener("mousedown",t=>t.preventDefault()),s.addEventListener("click",t=>{t.stopPropagation(),i(e)}),s}_startEdit(t,e,i={}){const n=this.w,s=this._annoList(t)[e],r=n.dom.baseEl,a=n.dom.elWrap;if(!(s&&s.id&&r&&a))return;this._closeEditor(!1);const o=r.ownerDocument,l=o.createElement("div");l.className="apexcharts-ink-card",l.setAttribute("role","dialog"),l.setAttribute("aria-label","Edit note"),l.style.visibility="hidden";const c=o.createElement("div");c.className="apexcharts-ink-card-row";const h=o.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=s.label&&s.label.text||"",c.appendChild(h),c.appendChild(this._cardBtn(o,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),l.appendChild(c);const u=o.createElement("div");u.className="apexcharts-ink-card-row","point"!==t&&u.appendChild(this._cardLabel(o,"Label")),this._noteColors().forEach(t=>{u.appendChild(this._mkSwatch(o,t,t=>this._applyColor(t)))});const d=o.createElement("span");if(d.className="apexcharts-ink-sep",u.appendChild(d),u.appendChild(this._cardBtn(o,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),u.appendChild(this._cardBtn(o,"A-","Smaller text",()=>this._stepFont(-1))),u.appendChild(this._cardBtn(o,"A+","Larger text",()=>this._stepFont(1))),l.appendChild(u),"point"!==t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(o,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),l.appendChild(t)}if("point"===t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Marker")),t.appendChild(this._cardBtn(o,"-","Smaller marker",()=>this._stepMarker(-1)));const e=o.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(o,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(o,zi.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),l.appendChild(t)}a.appendChild(l),this._editor={card:l,input:h,type:t,index:e},this._positionCard(),this._syncCard(),l.style.visibility="",h.focus(),i.select&&h.select(),l.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),o.addEventListener("mousedown",this._onDocDownEditor,!0),o.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,i=e.dom.baseEl,n=e.dom.elWrap,s=this._annoList(t.type)[t.index];if(!i||!n||!s)return;const r=i.querySelector(".apexcharts-"+t.type+"-annotation-label."+s.id)||i.querySelector("."+s.id);if(!r)return;const a=n.getBoundingClientRect(),o=r.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let h=Math.round(o.left-a.left),u=Math.round(o.bottom-a.top)+8;u+c>n.clientHeight-4&&(u=Math.round(o.top-a.top)-c-8),h+l>n.clientWidth-4&&(h=n.clientWidth-l-4),t.card.style.left=Math.max(4,h)+"px",t.card.style.top=Math.max(4,u)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const i=e.label&&e.label.style||{},n=String(i.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===n)});const s=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===s)});const r=t.card.querySelector(".apexcharts-ink-btn--bold");r&&r.classList.toggle("apexcharts-ink-btn--active",Hi._isBold(i));const a=e.marker||{},o=t.card.querySelector(".apexcharts-ink-marker-size");o&&(o.textContent=String("number"==typeof a.size?a.size:4));const l=t.card.querySelector(".apexcharts-ink-btn--shape");l&&(l.textContent=zi[a.shape]||zi.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const i=t.input.value;e.label||(e.label={}),e.label.text!==i&&(e.label.text=i,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const i=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;i&&(i.removeEventListener("mousedown",this._onDocDownEditor,!0),i.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const i=this._editor;if(!i)return;const n=this._annoList(i.type)[i.index];n&&(this._commitTextOf(i),n.label||(n.label={}),n.label.style||(n.label.style={}),e(n),this._redrawAnno(i.type,n,i.index),this._checkpoint(t),this._fireStyled(i.type,n,i.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const i=Hi._isLight(t);this._applyStyle("ink:style",n=>{n.label.style.background=t,n.label.style.color=i?"#334155":"#ffffff",n.label.borderColor=i?"#cbd5e1":t,"point"===e.type&&(n.marker||(n.marker={}),n.marker.strokeColor=i?"#334155":t,n.marker.fillColor=i?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const i=parseFloat(e.label.style.fontSize)||11;let n=0;for(let t=1;t<Ii.length;t++)Math.abs(Ii[t]-i)<Math.abs(Ii[n]-i)&&(n=t);n=Math.min(Ii.length-1,Math.max(0,n+t)),e.label.style.fontSize=Ii[n]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=Hi._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const i="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,i+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=Bi.indexOf(t.marker.shape);t.marker.shape=Bi[(e+1)%Bi.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),i=e[t.index];if(this._closeEditor(!1),!i)return;const n=this.w.dom.baseEl;n&&i.id&&n.querySelectorAll("."+i.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let i=t.index;i<e.length;i++)this._redrawAnno(t.type,e[i],i);this._checkpoint("ink:delete"),this._fireDeleted(t.type,i,t.index)}_fireEdited(t,e,i){const n={type:t,id:e.id,index:i,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",n)}_fireStyled(t,e,i){const n={type:t,id:e.id,index:i,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",n)}_fireDeleted(t,e,i){const n={type:t,id:e.id,index:i};this._fireAnnotationEvent("annotationDeleted",n)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,i,n;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onRerender),this._wired=!1)}}g.default.registerFeatures({ink:Hi});const ji="https://apexcharts.com/pricing",Yi="__apexcharts_license_enforcer_v1__";globalThis[Yi]||(globalThis[Yi]={perspectivesTokenDecoded:!1,enforced:new Set});const qi=globalThis[Yi],Xi=qi.enforced;function Gi(){qi.perspectivesTokenDecoded=!0,Qi()}const Ui=new Set(["premium","enterprise"]);function Ki(t,e){const i=V.add(e,{manage:!1});if(!i||"undefined"==typeof MutationObserver)return;if(t._wmNodeObserver&&t._wmObservedNode===i)return;t._wmNodeObserver&&t._wmNodeObserver.disconnect();const n=new MutationObserver(()=>{const t=V.node(e);t&&(n.disconnect(),V.applyStyles(t),n.takeRecords(),n.observe(t,{attributes:!0,attributeFilter:["style"]}))});n.observe(i,{attributes:!0,attributeFilter:["style"]}),t._wmNodeObserver=n,t._wmObservedNode=i}function Vi(t,e){t._wmWrapObserver&&(t._wmWrapObserver.disconnect(),t._wmWrapObserver=null),t._wmNodeObserver&&(t._wmNodeObserver.disconnect(),t._wmNodeObserver=null),t._wmObservedNode=null,t._wmObservedWrap=null;const i=e||t.w&&t.w.dom&&t.w.dom.elWrap;i&&V.remove(i,{manage:!1})}function Zi(t,e){try{if(!mt.isBrowser())return;if(t&&t.globals&&t.globals.isDestroyed)return void Xi.delete(e);const i=t&&t.dom&&t.dom.elWrap;if(!i)return;const n=function(t,e){var i;const n=t&&t.config&&t.config.chart||{},s=[];"unit"===n.type&&s.push("unit"),"raincloud"===n.requestedType&&s.push("raincloud"),e.trellis&&"function"==typeof e.trellis.isActive&&e.trellis.isActive()&&s.push("trellis"),e.storyboard&&e.storyboard._used&&s.push("storyboard");const r=n.link;return e.linkedViews&&r&&(!0===r.enabled||"function"==typeof r.dimension)&&s.push("link"),e.ink&&n.ink&&!0===n.ink.enabled&&s.push("ink"),e.measure&&n.measure&&!0===n.measure.enabled&&s.push("measure"),e.contextMenu&&n.contextMenu&&!0===n.contextMenu.enabled&&s.push("context-menu"),e.perspectives&&(e.perspectives._used||qi.perspectivesTokenDecoded)&&s.push("perspectives"),e.history&&n.history&&!0===n.history.enabled&&s.push("history"),(null==(i=e._highlightFilter)?void 0:i.isActive())&&s.push("highlight-filter"),s}(t,e);if(0===n.length)return Xi.delete(e),void Vi(e,i);Xi.add(e);const s=function(t){const e=t&&t.config&&t.config.chart&&t.config.chart.license;if(e)return e;const i=q.getKey();if(i)return i;const n=mt.getApex();return n&&n.license?n.license:null}(t);if(function(t){if(!t)return!1;const e=q.validateKey(t);if(!e.valid)return!1;const i=e.data&&e.data.plan;return"string"==typeof i&&Ui.has(i.toLowerCase())}(s))return void Vi(e,i);!function(t,e){if(Ki(t,e),"undefined"==typeof MutationObserver)return;if(t._wmWrapObserver&&t._wmObservedWrap===e)return;t._wmWrapObserver&&t._wmWrapObserver.disconnect();const i=new MutationObserver(()=>{V.node(e)||Ki(t,e)});i.observe(e,{childList:!0}),t._wmWrapObserver=i,t._wmObservedWrap=e}(e,i),function(t,e,i){if(t._premiumLicenseNotified)return;t._premiumLicenseNotified=!0;const n=i.length>1;if(!e)return void console.warn(`[ApexCharts] Premium feature${n?"s":""} in use (${i.join(", ")}) without a license. Running in trial mode with a watermark. Get a license: ${ji}`);const s=q.validateKey(e);if(s.valid){const t=s.data&&s.data.plan||"current";return void console.warn(`[ApexCharts] Premium feature${n?"s":""} in use (${i.join(", ")}) require a Premium or Enterprise license; the ${t} plan does not include ${n?"them":"it"}. Running in trial mode with a watermark. Upgrade: ${ji}`)}e!==q.getKey()&&console.error(`[Apex] ${s.message}`)}(e,s,n)}catch(t){}}function Qi(){if(!mt.isBrowser())return;const t=new Set,e=mt.getApex(),i=e&&e._chartInstances;Array.isArray(i)&&i.forEach(e=>{const i=e&&e.chart;i&&i.w&&!i.w.globals.isDestroyed&&(t.add(i),Zi(i.w,i))}),Array.from(Xi).forEach(e=>{const i=e&&e.w,n=i&&i.dom&&i.dom.elWrap;i&&!i.globals.isDestroyed&&n&&!1!==n.isConnected?t.has(e)||Zi(i,e):Xi.delete(e)})}q.onChange(Qi);const Ji="apex";function tn(t){return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf-8").toString("base64");const e=(new TextEncoder).encode(t);let i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return btoa(i)}(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function en(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf-8");const e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return(new TextDecoder).decode(i)}(e)}class nn{constructor(t,e){this.w=t,this.ctx=e,this._saved=[],this._counter=0,this._used=!1}capture(){const t={v:1,view:xi(this.w,this.ctx)},e=this._serializableDelta();return e&&Object.keys(e).length&&(t.options=e),t}_serializableDelta(){const t=this.w.config,e=t.chart&&t.chart.perspectives&&t.chart.perspectives.serializeOptions||["theme","xaxis","yaxis","title","subtitle"],i={};return e.forEach(e=>{if(void 0!==t[e]){const n=function(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return}}(t[e]);void 0!==n&&(i[e]=n)}}),i}encode(t){const e=t||this.capture();return tn(JSON.stringify(e))}decode(t){return nn.decode(t)}toURL(){if(!mt.isBrowser())return"";const t=this.encode(this.capture()),e=new URL(window.location.href);return e.hash=`${Ji}=${t}`,e.toString()}apply(t,e={}){const i="string"==typeof t?nn.decode(t):t;if(!i||!i.view)return;this._used=!0,Zi(this.w,this.ctx);const n=void 0===e.animate||e.animate,s=v.extend(i.options?v.clone(i.options):{},e.mergeOptions||{}),r=Object.keys(s).length?s:void 0;(this.w.config.chart.group?this.ctx.getSyncedCharts():[this.ctx]).forEach(t=>{!function(t,e,{animate:i=!0,mergeOptions:n}={}){var s,r;if(!t||!e)return;"number"==typeof e.v&&e.v>1&&console.warn(`[apexcharts] ViewState v${e.v} is newer than this build understands (v1); applying best-effort.`),t.clearAnnotations();const a=n?v.clone(n):{},o=e.window&&e.window.xaxis;a.xaxis=Object.assign({},a.xaxis,o?{min:null!=(s=o.min)?s:void 0,max:null!=(r=o.max)?r:void 0}:{min:void 0,max:void 0});const l=e.window&&e.window.yaxis;if(Array.isArray(l)&&(a.yaxis=l.map(t=>{var e,i;return t?{min:null!=(e=t.min)?e:void 0,max:null!=(i=t.max)?i:void 0}:{}})),e.theme){const t={};null!=e.theme.mode&&(t.mode=e.theme.mode),null!=e.theme.palette&&(t.palette=e.theme.palette),Object.keys(t).length&&(a.theme=Object.assign({},a.theme,t))}e.annotations&&e.annotations.static&&(a.annotations=v.clone(e.annotations.static)),t.updateOptions(a,!1,i,!1,!1),_i(t,e)}(t,i.view,{animate:n,mergeOptions:r})})}save(t){const e="perspective-"+ ++this._counter;return this._saved.push({id:e,name:t||e,token:this.capture()}),this._used=!0,Zi(this.w,this.ctx),e}list(){return this._saved.map(t=>({id:t.id,name:t.name,token:t.token}))}delete(t){const e=this._saved.findIndex(e=>e.id===t);e>-1&&this._saved.splice(e,1)}teardown(){this._saved=[],this._counter=0}static decode(t){if("string"!=typeof t||!t)return null;try{const e=JSON.parse(en(t));return e&&"object"==typeof e?1!==e.v?(console.warn(`apexcharts: unsupported perspective version ${e.v} (expected 1).`),null):e:null}catch(t){return console.warn("apexcharts: failed to decode perspective token.",t),null}}static fromURL(t){try{const e=t||(mt.isBrowser()?window.location.href:"");if(!e)return null;const i=new URL(e).hash.replace(/^#/,"");if(!i)return null;const n=i.split("&").map(t=>t.split("=")).find(t=>t[0]===Ji);return n&&null!=n[1]?nn.decode(decodeURIComponent(n[1])):null}catch(t){return null}}}g.default.registerFeatures({perspectives:nn,perspectivesStatics:{decode:t=>(Gi(),nn.decode(t)),fromURL:t=>(Gi(),nn.fromURL(t))}}),g.default.registerFeatures({storyboard:class{constructor(t,e){this.w=t,this.ctx=e,this._beats=[],this._observer=null,this._activeIndex=-1,this._animate=!0,this._warnedNoPerspectives=!1,this._used=!1}bind(t={}){var e;if(this.unbind(),!mt.isBrowser())return 0;const i=this.ctx.el&&this.ctx.el.ownerDocument;if(!i||"undefined"==typeof IntersectionObserver)return 0;let n=null;if(t.scroller&&(n="string"==typeof t.scroller?i.querySelector(t.scroller):t.scroller),this._beats=this._resolveBeats(i,n,t.beats),!this._beats.length)return 0;this._animate=!1!==t.animate;const s=Math.min(Math.max(null!=(e=t.offset)?e:.5,0),1),r=+(100*s).toFixed(3),a=+(100-100*s).toFixed(3);return this._observer=new IntersectionObserver(t=>this._onIntersect(t),{root:n,rootMargin:`-${r}% 0px -${a}%`,threshold:0}),this._beats.forEach(t=>{var e;return null==(e=this._observer)?void 0:e.observe(t.el)}),this._used=!0,Zi(this.w,this.ctx),this._beats.length}_resolveBeats(t,e,i){const n=[];if(Array.isArray(i))return i.forEach((e,i)=>{var s,r;if(!e)return;const a=e.el&&"object"==typeof e.el?e.el:e.selector?t.querySelector(e.selector):null;a?n.push({el:a,key:null!=(r=null!=(s=e.key)?s:a.getAttribute("data-apex-beat"))?r:String(i),view:e.view,options:e.options,announce:e.announce,onEnter:"function"==typeof e.onEnter?e.onEnter:void 0}):console.warn(`apexcharts: storyboard beat ${i} has no resolvable element; skipped.`)}),n;return(e||t).querySelectorAll("[data-apex-beat]").forEach((t,e)=>{n.push({el:t,key:t.getAttribute("data-apex-beat")||String(e),view:t.getAttribute("data-apex-view")||void 0,options:void 0,announce:t.getAttribute("data-apex-announce")||void 0,onEnter:void 0})}),n}_onIntersect(t){t.forEach(t=>{const e=this._beats.findIndex(e=>e.el===t.target);e<0||(t.isIntersecting?this._activate(e):e===this._activeIndex&&t.rootBounds&&t.boundingClientRect.top>=t.rootBounds.bottom&&e>0&&this._activate(e-1))})}_activate(t,e={}){var i,n;if(t===this._activeIndex)return;const s=this._beats[t];if(!s)return;const r=t>this._activeIndex?"down":"up";this._activeIndex=t;const a=(void 0!==e.animate?e.animate:this._animate)&&!_t();if(null!=s.view||s.options)if(this.ctx.perspectives){const t=null!=(i=s.view)?i:{},e="string"==typeof t||t.view?t:{view:this._normalizeView(t)};this.ctx.perspectives.apply(e,{animate:a,mergeOptions:s.options})}else this._warnedNoPerspectives||(this._warnedNoPerspectives=!0,console.warn('apexcharts: storyboard beats carry views but the perspectives feature is not bundled. import "apexcharts/features/storyboard" (which includes it) or drive beats via onEnter.'));const o={index:t,key:s.key,el:s.el,direction:r};s.onEnter&&s.onEnter(this.ctx,o),s.announce&&this._announce(s.announce),"function"==typeof this.w.config.chart.events.beatChange&&this.w.config.chart.events.beatChange(this.ctx,o),null==(n=this.ctx.events)||n.fireEvent("beatChange",[this.ctx,o])}_normalizeView(t){const e=t.annotations&&t.annotations.static||{};return l(o({},t),{annotations:{static:o({points:[],xaxis:[],yaxis:[],texts:[],images:[]},e),dynamic:t.annotations&&t.annotations.dynamic||[]}})}goTo(t,e={}){const i="number"==typeof t?t:this._beats.findIndex(e=>e.key===t);i>=0&&i<this._beats.length&&this._activate(i,e)}current(){if(this._activeIndex<0)return null;const t=this._beats[this._activeIndex];return{index:this._activeIndex,key:t?t.key:null}}unbind(){this._observer&&(this._observer.disconnect(),this._observer=null),this._beats=[],this._activeIndex=-1,this._used=!1,Zi(this.w,this.ctx)}teardown(){this.unbind()}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const n=i.querySelector(".apexcharts-sr-status");n&&(n.textContent="",setTimeout(()=>{n.textContent=t},0))}}});const sn={fill:"fill",stroke:"stroke","stroke-width":"strokeWidth","stroke-dasharray":"strokeDash","stroke-linecap":"lineCap","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","fill-rule":"fillRule"},rn=Symbol("never");const an={circle:0,square:1,rect:1,triangle:2,diamond:3,star:4,sparkle:5,cross:6,plus:7,line:8},on=["circle","square","triangle","diamond","star","sparkle","cross","plus","line"];function ln(t){return t.boxOf!==t.d&&(t.box=function(t){const e="string"==typeof t?t.match(/[a-df-z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi):null;if(!e)return null;let i=1/0,n=1/0,s=-1/0,r=-1/0,a=0,o=0,l=0,c=0,h="",u=0;const d=()=>Number(e[u++]),p=(t,e)=>{isFinite(t)&&isFinite(e)&&(i=Math.min(i,t),n=Math.min(n,e),s=Math.max(s,t),r=Math.max(r,e))},f=t=>{const e=h===h.toLowerCase();let i=a,n=o;for(let s=0;s<t;s++)i=d()+(e?a:0),n=d()+(e?o:0),p(i,n);a=i,o=n};for(;u<e.length;){if(/^[a-z]$/i.test(e[u])){h=e[u++],"Z"!==h&&"z"!==h||(a=l,o=c);continue}const t=h===h.toLowerCase();switch(h.toUpperCase()){case"M":f(1),l=a,c=o,h=t?"l":"L";break;case"L":case"T":f(1);break;case"H":a=d()+(t?a:0),p(a,o);break;case"V":o=d()+(t?o:0),p(a,o);break;case"S":case"Q":f(2);break;case"C":f(3);break;case"A":u+=5,f(1);break;default:u++}}return isFinite(i)?{x:i,y:n,width:s-i,height:r-n}:null}(t.d),t.boxOf=t.d),t.box}const cn={attr:()=>cn,plot:()=>cn,during:()=>cn,after:t=>("function"==typeof t&&t(),cn),animate:()=>cn,delay:()=>cn,loop:()=>cn,finish:()=>cn,stop:()=>cn},hn={nodeName:"path",style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},un={__isCanvasMark:!0,node:{nodeName:"g",instance:null,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},attr:()=>un,add:()=>un,addTo:()=>un,remove:()=>un,clear:()=>un,css:()=>un,hide:()=>un,show:()=>un,removeClass:()=>un,animate:()=>cn};class dn{constructor(t,e){this.__isCanvasMark=!0,this._g=t,this._i=e}get node(){return hn}attr(t,e){return"string"==typeof t?("fill"===t&&void 0!==e?this._g._setMarkerFill(this._i,e):"rel"===t&&void 0!==e&&(this._g._mdi[this._i]=e),void 0===e?null:this):(t&&void 0!==t.fill&&this._g._setMarkerFill(this._i,t.fill),t&&void 0!==t.rel&&(this._g._mdi[this._i]=t.rel),this)}add(t){return this}addTo(t){return this}remove(){return this}css(t){return this}fill(t){return void 0!==t&&this._g._setMarkerFill(this._i,t),this}stroke(t){return this}hide(){return this}show(){return this}removeClass(t){return this}animate(){return cn}}const pn={__isCanvasMark:!0,node:hn,attr:()=>pn,add:()=>pn,addTo:()=>pn,remove:()=>pn,css:()=>pn,animate:()=>cn};class fn{constructor(t){this.__isCanvasMark=!0,this._cmd=t;const e=this;this.node={nodeName:t?t.tag:"g",instance:this,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(t,i){e._applyAttr(t,i)},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>e.bbox()}}_applyAttr(t,e){const i=this._cmd;if(!i)return;if("clip-path"===t){const t=function(t){if(null==t||"none"===t)return null;const e=/^url\(#gridRect(Bar|Marker)?Mask/.exec(String(t));return e?"Bar"===e[1]?"bar":"Marker"===e[1]?"marker":"grid":void 0}(e);return void(void 0!==t&&(i.clip=t))}const n=sn[t];void 0!==n&&(i[n]=e)}attr(t,e){if("string"==typeof t)return void 0===e?null:(this._applyAttr(t,e),this);for(const e in t)void 0!==t[e]&&this._applyAttr(e,t[e]);return this}add(t){return this}addTo(t){return this}remove(){return this}clear(){return this}css(t){return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),this):this.attr("stroke",t)}plot(t){return"string"==typeof t&&this._cmd&&"path"===this._cmd.tag&&(this._cmd.d=t),this}hide(){return this}show(){return this}removeClass(t){return this}bbox(){const t=this._cmd,e=t&&"path"===t.tag?ln(t):null;return e?o({},e):{x:0,y:0,width:0,height:0}}animate(){return cn}}class gn{constructor(t){this.w=t,this._g=new _(t),this._list=[],this._mx=new Float64Array(16),this._my=new Float64Array(16),this._msize=new Float64Array(16),this._mshape=new Int16Array(16),this._mstyle=new Int32Array(16),this._msi=new Int32Array(16),this._mdi=new Int32Array(16),this._mn=0,this._mcap=16,this._crx=new Float64Array(16),this._cry=new Float64Array(16),this._crw=new Float64Array(16),this._crh=new Float64Array(16),this._crstyle=new Int32Array(16),this._crsi=new Int32Array(16),this._crdi=new Int32Array(16),this._crn=0,this._crcap=16,this._cellRadius=0,this._styles=[],this._styleMap=new Map,this._lf=rn,this._ls=rn,this._lsw=rn,this._ld=rn,this._lfo=rn,this._lso=rn,this._lid=-1,this._lofFill=rn,this._lofBase=-1,this._lofId=-1,this._rlf=rn,this._rls=rn,this._rlsw=rn,this._rlfo=rn,this._rlso=rn,this._rlid=-1}_resetStyleCache(){this._lf=rn,this._ls=rn,this._lsw=rn,this._ld=rn,this._lfo=rn,this._lso=rn,this._lid=-1,this._lofFill=rn,this._lofBase=-1,this._lofId=-1,this._rlf=rn,this._rls=rn,this._rlsw=rn,this._rlfo=rn,this._rlso=rn,this._rlid=-1}reset(){this._list=[],this._mn=0,this._styles=[],this._styleMap=new Map,this._resetStyleCache();const t=this.w.config.series||[];let e=16;for(let i=0;i<t.length;i++){const n=t[i]&&t[i].data;Array.isArray(n)&&(e+=n.length)}e=Math.ceil(1.15*e)+16,e>this._mcap&&this._allocMarkers(e),this._crn=0,this._cellRadius=0,e>this._crcap&&this._allocRects(e)}_allocRects(t){this._crcap=t,this._crx=new Float64Array(t),this._cry=new Float64Array(t),this._crw=new Float64Array(t),this._crh=new Float64Array(t),this._crstyle=new Int32Array(t),this._crsi=new Int32Array(t),this._crdi=new Int32Array(t)}_growRects(){const t=2*this._crcap,e=new Float64Array(t);e.set(this._crx),this._crx=e;const i=new Float64Array(t);i.set(this._cry),this._cry=i;const n=new Float64Array(t);n.set(this._crw),this._crw=n;const s=new Float64Array(t);s.set(this._crh),this._crh=s;const r=new Int32Array(t);r.set(this._crstyle),this._crstyle=r;const a=new Int32Array(t);a.set(this._crsi),this._crsi=a;const o=new Int32Array(t);o.set(this._crdi),this._crdi=o,this._crcap=t}_allocMarkers(t){this._mcap=t,this._mx=new Float64Array(t),this._my=new Float64Array(t),this._msize=new Float64Array(t),this._mshape=new Int16Array(t),this._mstyle=new Int32Array(t),this._msi=new Int32Array(t),this._mdi=new Int32Array(t)}_growMarkers(){const t=2*this._mcap,e=new Float64Array(t);e.set(this._mx),this._mx=e;const i=new Float64Array(t);i.set(this._my),this._my=i;const n=new Float64Array(t);n.set(this._msize),this._msize=n;const s=new Int16Array(t);s.set(this._mshape),this._mshape=s;const r=new Int32Array(t);r.set(this._mstyle),this._mstyle=r;const a=new Int32Array(t);a.set(this._msi),this._msi=a;const o=new Int32Array(t);o.set(this._mdi),this._mdi=o,this._mcap=t}displayList(){return this._list}markerCount(){return this._mn}_internStyle(t,e,i,n,s,r){const a=`${t}|${e}|${i}|${n}|${s}|${r}`,o=this._styleMap.get(a);if(void 0!==o)return o;const l=this._styles.length;return this._styles.push({fill:t,stroke:e,strokeWidth:i,strokeDash:n,fillOpacity:s,strokeOpacity:r}),this._styleMap.set(a,l),l}_setMarkerFill(t,e){const i=this._mstyle[t];if(e===this._lofFill&&i===this._lofBase)return void(this._mstyle[t]=this._lofId);const n=this._styles[i];if(!n||n.fill===e)return this._lofFill=e,this._lofBase=i,void(this._lofId=i);const s=this._internStyle(e,n.stroke,n.strokeWidth,n.strokeDash,n.fillOpacity,n.strokeOpacity);this._mstyle[t]=s,this._lofFill=e,this._lofBase=i,this._lofId=s}markerStyle(t){return this._styles[this._mstyle[t]]}markerSeries(t){return this._msi[t]}shapeName(t){return on[t]||"circle"}drawRectCell(t,e,i,n,s={}){const r=this._rectStyleId(s);this._crn>=this._crcap&&this._growRects();const a=this._crn++;return this._crx[a]=t||0,this._cry[a]=e||0,this._crw[a]=i>0?i:0,this._crh[a]=n>0?n:0,this._crstyle[a]=r,this._crsi[a]=null==s.seriesIndex?-1:s.seriesIndex,this._crdi[a]=null==s.dataPointIndex?-1:s.dataPointIndex,s.radius&&(this._cellRadius=s.radius),pn}_rectStyleId(t){const e=t.fill,i=t.stroke,n=t.strokeWidth,s=t.fillOpacity,r=t.strokeOpacity;if(e===this._rlf&&i===this._rls&&n===this._rlsw&&s===this._rlfo&&r===this._rlso)return this._rlid;const a=this._internStyle(e,i,n,0,s,r);return this._rlf=e,this._rls=i,this._rlsw=n,this._rlfo=s,this._rlso=r,this._rlid=a,a}rectCount(){return this._crn}rectStyle(t){return this._styles[this._crstyle[t]]}rectSeries(t){return this._crsi[t]}_cmd(t,e){const i={tag:t,z:e||0,fill:void 0,stroke:void 0,strokeWidth:void 0,strokeDash:void 0,lineCap:void 0,fillOpacity:void 0,strokeOpacity:void 0,fillRule:void 0,clip:null};return this._list.push(i),i}group(t){return un}drawMarker(t,e,i={}){var n;const s=this._markerStyleId(i);this._mn>=this._mcap&&this._growMarkers();const r=this._mn++;return this._mx[r]=t||0,this._my[r]="number"==typeof e?e:NaN,this._msize[r]=i.pSize||0,this._mshape[r]=null!=(n=an[i.shape||"circle"])?n:0,this._mstyle[r]=s,this._msi[r]=null==i.seriesIndex?-1:i.seriesIndex,this._mdi[r]=-1,new dn(this,r)}_markerStyleId(t){const e=t.shape||"circle",i="line"===e||"plus"===e||"cross"===e,n=i?"none":t.pointFillColor,s=i?t.pointFillColor:t.pointStrokeColor,r=t.pointStrokeWidth,a=t.pointStrokeDashArray,o=t.pointFillOpacity,l=i?t.pointFillOpacity:t.pointStrokeOpacity;if(n===this._lf&&s===this._ls&&r===this._lsw&&a===this._ld&&o===this._lfo&&l===this._lso)return this._lid;const c=this._internStyle(n,s,r,a,o,l);return this._lf=n,this._ls=s,this._lsw=r,this._ld=a,this._lfo=o,this._lso=l,this._lid=c,c}renderPaths(t){const e=this._cmd("path",t.realIndex);if(e.d=t.pathTo,t.pathToNumeric&&(e.nxs=t.pathToNumeric.xs,e.nys=t.pathToNumeric.ys,e.ncloseY=t.pathToNumeric.closeY),e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.lineCap=t.strokeLinecap,e.si=t.realIndex,"number"==typeof t.j&&(e.dj=t.j),!1!==t.shouldClipToGrid){const i=this.w.globals;e.clip="bar"===t.chartType&&!i.isBarHorizontal||i.comboCharts?"bar":"grid"}return this.w.globals.animationEnded=!0,new fn(e)}drawPath(t){const e=this._cmd("path",0);return e.d=t.d,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.strokeOpacity=t.strokeOpacity,e.lineCap=t.strokeLinecap,e.strokeDash=t.strokeDashArray,new fn(e)}drawLine(t,e,i,n,s="#a8a8a8",r=0,a=1){const o=this._cmd("line",0);return o.lx1=t,o.ly1=e,o.lx2=i,o.ly2=n,o.stroke=s,o.strokeDash=r,o.strokeWidth=a,new fn(o)}drawRect(t=0,e=0,i=0,n=0,s=0,r="#fefefe",a=1,o=null,l=null,c=0){const h=this._cmd("rect",0);return h.x1=t,h.y1=e,h.rw=i>0?i:0,h.rh=n>0?n:0,h.radius=s,h.fill=r,h.fillOpacity=a,null!=l&&(h.stroke=l,h.strokeWidth=null==o?1:o,h.strokeDash=c),new fn(h)}drawCircle(t,e=null){const i=this._cmd("circle",0);return i.r=t<0?0:t,e&&(i.cx=e.cx,i.cy=e.cy,void 0!==e.fill&&(i.fill=e.fill),void 0!==e.stroke&&(i.stroke=e.stroke)),new fn(i)}drawText(t){const e=this._cmd("text",0);return e.text=Array.isArray(t.text)?t.text.join(" "):t.text,e.tx=t.x,e.ty=t.y,e.textAnchor=t.textAnchor||"start",e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.foreColor,new fn(e)}markerPath(t,e,i,n){return this._g.getMarkerPath(t,e,on[i]||"circle",n)}}const mn=g.__apex_SVGElement,yn=g.__apex_math_SVGNS,xn=g.__apex_axes_Grid,_n=2*Math.PI;class bn{constructor(t){this.w=t,this._host=null,this._canvas=null,this._c2d=null,this._pad={left:0,top:0,right:0,bottom:0},this._clips=null,this._clipRect=null,this._dpr=1,this._dim=null,this._alpha=1,this._unitPaths=new Map,this._markerBatches=0}markerBatchCount(){return this._markerBatches}_seriesAlpha(t){const e=this._dim;return!e||null==e.active||e.active<0||null==t||t<0||t===e.active?1:null==e.opacity?.2:e.opacity}_plotDims(){var t;const e=Math.max(0,Math.ceil(this.w.layout.gridWidth||0)),i=Math.max(0,Math.ceil(this.w.layout.gridHeight||0)),n=(null==(t=this.w.globals.markers)?void 0:t.largestSize)||0,s=Math.ceil(n+8),r=xn.maskRects(this.w),a={left:s,top:s,right:s,bottom:s},o=t=>Number.isFinite(t)?Math.ceil(t):0;return Object.values(r).forEach(t=>{a.left=Math.max(a.left,o(-t.x)),a.top=Math.max(a.top,o(-t.y)),a.right=Math.max(a.right,o(t.x+t.width-e)),a.bottom=Math.max(a.bottom,o(t.y+t.height-i))}),{gw:e,gh:i,pad:a,clips:r}}createHost(){const t=yt.getWindow();this._dpr=Math.min(2,t&&t.devicePixelRatio||1);const{gw:e,gh:i,pad:n,clips:s}=this._plotDims();this._pad=n,this._clips=s;const r=e+n.left+n.right,a=i+n.top+n.bottom,o=yt.createElementNS(yn,"foreignObject");o.setAttribute("x",String(-n.left)),o.setAttribute("y",String(-n.top)),o.setAttribute("width",String(r)),o.setAttribute("height",String(a)),o.setAttribute("class","apexcharts-canvas-series"),o.style.overflow="visible";const l=yt.createElement("canvas");return l.setAttribute("class","apexcharts-series-canvas"),l.width=Math.max(1,Math.round(r*this._dpr)),l.height=Math.max(1,Math.round(a*this._dpr)),l.style.width=r+"px",l.style.height=a+"px",l.style.pointerEvents="none",o.appendChild(l),this._canvas=l,this._c2d=l.getContext("2d"),this._host=new mn(o),this._host}getHost(){return this._host}clipRect(t){const e=t&&this._clips?this._clips[t]:null;return e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.width)&&Number.isFinite(e.height)?e:null}_clipTo(t,e){const i=this.clipRect(e);if(i!==this._clipRect&&(this._clipRect&&t.restore(),this._clipRect=i,i)){const e=this._dpr,{left:n,top:s}=this._pad,r=Math.floor((n+i.x)*e),a=Math.floor((s+i.y)*e),o=Math.ceil((n+i.x+i.width)*e),l=Math.ceil((s+i.y+i.height)*e);t.save(),t.setTransform(1,0,0,1,0,0),t.beginPath(),t.rect(r,a,o-r,l-a),t.clip(),t.setTransform(e,0,0,e,n*e,s*e)}}clear(){this._c2d&&this._canvas&&(this._c2d.setTransform(1,0,0,1,0,0),this._c2d.clearRect(0,0,this._canvas.width,this._canvas.height))}_syncDpr(){if(!this._canvas)return;const t=yt.getWindow(),e=Math.min(2,t&&t.devicePixelRatio||1);if(e===this._dpr)return;this._dpr=e;const i=parseFloat(this._canvas.style.width)||0,n=parseFloat(this._canvas.style.height)||0;this._canvas.width=Math.max(1,Math.round(i*e)),this._canvas.height=Math.max(1,Math.round(n*e))}paint(t,e,i=null){const n=this._c2d;if(!n)return;this._dim=i||null,this._syncDpr(),this.clear();const s=this._dpr,{left:r,top:a}=this._pad;if(n.setTransform(s,0,0,s,r*s,a*s),this._clipRect=null,t.length){const e=t.length>1?t.map((t,e)=>[t,e]).sort((t,e)=>t[0].z===e[0].z?t[1]-e[1]:t[0].z-e[0].z).map(t=>t[0]):t;for(let t=0;t<e.length;t++){const i=e[t];this._alpha=this._dim?this._seriesAlpha(i.si):1,this._clipTo(n,i.clip),this._paintOne(n,i)}this._clipTo(n,null)}this._paintRects(n,e),this._clipTo(n,"marker"),this._paintMarkers(n,e),this._clipTo(n,null),this._alpha=1}_paintRects(t,e){const i=e.rectCount?e.rectCount():0;if(!i)return;const n=e._crx,s=e._cry,r=e._crw,a=e._crh,o=e._crstyle,l=e._cellRadius||0,c=t,h=l>0&&"function"==typeof c.roundRect,u=!!this._dim,d=Math.max(0,this.w.layout.gridWidth||0),p=Math.max(0,this.w.layout.gridHeight||0);t.save(),t.beginPath(),t.rect(0,0,d,p),t.clip();let f=0;for(;f<i;){const d=o[f],p=e.rectStyle(f);if(!p){f++;continue}const g=p.fill,m=g&&"none"!==g&&!("string"==typeof g&&0===g.indexOf("url(")),y=p.stroke,x=null==p.strokeWidth?0:Number(p.strokeWidth),_=y&&"none"!==y&&x>0&&!("string"==typeof y&&0===y.indexOf("url("));m&&(t.fillStyle=g),_&&(t.strokeStyle=y,t.lineWidth=x,t.setLineDash([]));const b=null==p.fillOpacity?1:Number(p.fillOpacity),v=null==p.strokeOpacity?1:Number(p.strokeOpacity);let w=f;for(;w<i&&o[w]===d;){const i=r[w],o=a[w];if(i>0&&o>0){const r=u?this._seriesAlpha(e.rectSeries(w)):1;h?(t.beginPath(),c.roundRect(n[w],s[w],i,o,l),m&&(t.globalAlpha=b*r,t.fill()),_&&(t.globalAlpha=v*r,t.stroke())):(m&&(t.globalAlpha=b*r,t.fillRect(n[w],s[w],i,o)),_&&(t.globalAlpha=v*r,t.strokeRect(n[w],s[w],i,o)))}w++}f=w}t.globalAlpha=1,t.restore()}_unitPath(t,e,i){const n=e+"|"+i;let s=this._unitPaths.get(n);if(void 0===s){try{s=new Path2D(t.markerPath(0,0,e,i))}catch(t){s=null}this._unitPaths.set(n,s)}return s}_paintMarkers(t,e){this._markerBatches=0;const i=e.markerCount();if(!i)return;const n=e._mx,s=e._my,r=e._msize,a=e._mshape,o=e._mstyle,l=!!this._dim;l||(this._alpha=1);let c=0;for(;c<i;){const h=o[c],u=a[c],d=e.markerStyle(c);if(!d){c++;continue}const p=this._applyFill(t,d),f=this._applyStroke(t,d);this._markerBatches++;const g=null==d.fillOpacity?1:Number(d.fillOpacity),m=null==d.strokeOpacity?1:Number(d.strokeOpacity);if(0===u){let u=c;for(;u<i&&0===a[u]&&o[u]===h;){const i=r[u]||0,a=s[u];if(i>0&&a==a)if(t.beginPath(),t.arc(n[u],a,i,0,_n),l){const i=this._seriesAlpha(e.markerSeries(u));p&&(t.globalAlpha=g*i,t.fill()),f&&(t.globalAlpha=m*i,t.stroke())}else p&&t.fill(),f&&t.stroke();u++}t.globalAlpha=1,c=u}else{const d=this._dpr,y=this._pad.left,x=this._pad.top;let _=c;for(;_<i&&a[_]===u&&o[_]===h;){const i=s[_],a=r[_];if(i==i&&a>0){const s=this._unitPath(e,u,a);if(s){t.setTransform(d,0,0,d,(y+n[_])*d,(x+i)*d);const r=l?this._seriesAlpha(e.markerSeries(_)):1;p&&(t.globalAlpha=g*r,t.fill(s)),f&&(t.globalAlpha=m*r,t.stroke(s))}}_++}t.setTransform(d,0,0,d,y*d,x*d),t.globalAlpha=1,c=_}}}_paintNumericPath(t,e){const i=e.nxs,n=e.nys,s=i.length;if(s){t.beginPath(),t.moveTo(i[0],n[0]);for(let e=1;e<s;e++)t.lineTo(i[e],n[e]);null!=e.ncloseY&&(t.lineTo(i[s-1],e.ncloseY),t.lineTo(i[0],e.ncloseY),t.closePath()),this._applyFill(t,e)&&t.fill("evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}}_paintOne(t,e){switch(e.tag){case"path":if(e.nxs){this._paintNumericPath(t,e);break}if(!e.d)return;if(!e.path2d)try{e.path2d=new Path2D(e.d)}catch(t){return}this._fillStrokePath(t,e,e.path2d);break;case"rect":{const i=new Path2D;e.radius&&"function"==typeof i.roundRect?i.roundRect(e.x1,e.y1,e.rw,e.rh,e.radius):i.rect(e.x1,e.y1,e.rw,e.rh),this._fillStrokePath(t,e,i);break}case"circle":if(!(e.r>0))return;t.beginPath(),t.arc(e.cx,e.cy,e.r,0,_n),this._fillStroke(t,e);break;case"line":t.beginPath(),t.moveTo(e.lx1,e.ly1),t.lineTo(e.lx2,e.ly2),this._strokeOnly(t,e);break;case"text":{if(null==e.text)return;t.save(),t.globalAlpha=this._alpha,t.fillStyle=e.fill||"#000";const i=e.fontSize||"11px";t.font=`${"number"==typeof i?i+"px":i} ${e.fontFamily||"Helvetica, Arial, sans-serif"}`,t.textAlign="middle"===e.textAnchor?"center":"end"===e.textAnchor?"right":"left",t.fillText(String(e.text),e.tx,e.ty),t.restore();break}}}_fillStrokePath(t,e,i){this._applyFill(t,e)&&t.fill(i,"evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(i),t.globalAlpha=1}_fillStroke(t,e){this._applyFill(t,e)&&t.fill(),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_strokeOnly(t,e){this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_applyFill(t,e){const i=e.fill;return!(!i||"none"===i)&&(("string"!=typeof i||0!==i.indexOf("url("))&&(t.globalAlpha=(null==e.fillOpacity?1:Number(e.fillOpacity))*this._alpha,t.fillStyle=i,!0))}_applyStroke(t,e){const i=e.stroke,n=null==e.strokeWidth?1:Number(e.strokeWidth);if(!(i&&"none"!==i&&n>0))return!1;if("string"==typeof i&&0===i.indexOf("url("))return!1;t.globalAlpha=(null==e.strokeOpacity?1:Number(e.strokeOpacity))*this._alpha,t.strokeStyle=i,t.lineWidth=n,t.lineCap=e.lineCap||"butt";const s=e.strokeDash;return s&&0!==s?t.setLineDash(Array.isArray(s)?s:[Number(s)]):t.setLineDash([]),!0}toDataURL(){return this._canvas?this._canvas.toDataURL():null}destroy(){this._host=null,this._canvas=null,this._c2d=null,this._clips=null,this._clipRect=null,this._unitPaths.clear()}}class vn{constructor(t,e){this.w=t,this.ctx=e,this.kind="canvas",this._g=new gn(t),this._compositor=new bn(t),this._hitCtx=void 0}beginSeries(){this._g.reset()}present(){const t=this._compositor.createHost();return this._compositor.paint(this._g.displayList(),this._g),t}clear(){this._compositor.clear()}canRepaintInPlace(){const t=this._compositor.getHost();return!!(t&&t.node&&t.node.isConnected)}repaintInPlace(){this._compositor.paint(this._g.displayList(),this._g)}group(t){return this._g.group(t)}drawPath(t){return this._g.drawPath(t)}drawLine(...t){return this._g.drawLine(...t)}drawRect(...t){return this._g.drawRect(...t)}drawRectCell(t,e,i,n,s){return this._g.drawRectCell(t,e,i,n,s)}drawCircle(t,e){return this._g.drawCircle(t,e)}drawMarker(t,e,i){return this._g.drawMarker(t,e,i)}renderPaths(t){return this._g.renderPaths(t)}drawText(t){return this._g.drawText(t)}supports(t){return"solidFill"===t||"dashArray"===t}hitTest(t,e){const i=this._g,n=i.rectCount?i.rectCount():0,s=i._crx,r=i._cry,a=i._crw,o=i._crh;for(let l=n-1;l>=0;l--){const n=a[l],c=o[l];if(!(n<=0||c<=0)&&(t>=s[l]&&t<s[l]+n&&e>=r[l]&&e<r[l]+c))return{seriesIndex:i._crsi[l],dataPointIndex:i._crdi[l],x:s[l],y:r[l],width:n,height:c}}return this._hitTestMarks(t,e)}_hitTestMarks(t,e){const i=this._g.displayList();for(let n=i.length-1;n>=0;n--){const s=i[n];if("path"!==s.tag||null==s.dj||!s.d)continue;const r=!!s.fill&&"none"!==s.fill,a=!!s.stroke&&"none"!==s.stroke&&s.strokeWidth>0;if(!r&&!a)continue;const l=this._compositor.clipRect(s.clip);if(l&&(t<l.x||t>l.x+l.width||e<l.y||e>l.y+l.height))continue;const c=ln(s);if(!c)continue;const h=a?5*s.strokeWidth:0;if(t<c.x-h||t>c.x+c.width+h||e<c.y-h||e>c.y+c.height+h)continue;const u=this._hitContext();if(!u)return null;if(!s.path2d)try{s.path2d=new Path2D(s.d)}catch(t){continue}const d="evenodd"===s.fillRule?"evenodd":"nonzero";let p=r&&u.isPointInPath(s.path2d,t,e,d);if(!p&&a&&(u.lineWidth=s.strokeWidth,u.lineCap=s.lineCap||"butt",p=u.isPointInStroke(s.path2d,t,e)),p)return o({seriesIndex:s.si,dataPointIndex:s.dj},c)}return null}hitTestMarker(t,e){const i=this._g,n=i.markerCount();if(!n)return null;const s=this._compositor.clipRect("marker");if(s&&(t<s.x||t>s.x+s.width||e<s.y||e>s.y+s.height))return null;for(let s=n-1;s>=0;s--){const n=i._msize[s],r=i._mx[s],a=i._my[s],o=i._mdi[s];if(!(n>0)||a!=a||o<0)continue;const l=i.markerStyle(s),c=!!(null==l?void 0:l.stroke)&&"none"!==l.stroke&&l.strokeWidth>0,h=c?l.strokeWidth/2:0,u=1.2*n+h,d=t-r,p=e-a;if(d<-u||d>u||p<-u||p>u)continue;let f;if(f=0===i._mshape[s]?d*d+p*p<=(n+h)*(n+h):this._hitsMarkerShape(s,d,p,n,l,c),f)return{seriesIndex:i._msi[s],dataPointIndex:o,x:r,y:a,size:n}}return null}_hitsMarkerShape(t,e,i,n,s,r){const a=this._hitContext();if(!a)return!1;let o;try{o=new Path2D(this._g.markerPath(0,0,this._g._mshape[t],n))}catch(t){return!1}return!(!(null==s?void 0:s.fill)||"none"===s.fill||!a.isPointInPath(o,e,i))||!!r&&(a.lineWidth=s.strokeWidth,a.lineCap="butt",a.isPointInStroke(o,e,i))}findMark(t,e){const i=this._g.displayList();for(let n=0;n<i.length;n++){const s=i[n];if("path"!==s.tag||!s.d)continue;if(s.si!==t||s.dj!==e)continue;const r=ln(s);if(r)return l(o({seriesIndex:t,dataPointIndex:e},r),{d:s.d})}return null}findMarker(t,e){const i=this._g;for(let n=i.markerCount()-1;n>=0;n--){if(i._msi[n]!==t||i._mdi[n]!==e)continue;const s=i._msize[n],r=i._my[n];if(!(s>0)||r!=r)continue;const a=i._mx[n];return{seriesIndex:t,dataPointIndex:e,x:a,y:r,size:s,d:i.markerPath(a,r,i._mshape[n],s)}}return null}findCell(t,e){const i=this._g,n=i.rectCount?i.rectCount():0,s=i._crsi,r=i._crdi;for(let a=n-1;a>=0;a--)if(s[a]===t&&r[a]===e)return{seriesIndex:t,dataPointIndex:e,x:i._crx[a],y:i._cry[a],width:i._crw[a],height:i._crh[a],radius:i._cellRadius||0};return null}_hitContext(){if(void 0===this._hitCtx){const t=yt.createElement("canvas");this._hitCtx=(null==t?void 0:t.getContext)&&t.getContext("2d")||null}return this._hitCtx}restyle(t){this._compositor.paint(this._g.displayList(),this._g,t||null)}toBitmap(){const t=this._compositor.toDataURL();if(!t)return null;const e=this.w.globals,i=this.w.config.chart,n=this._compositor._pad;return{dataURL:t,x:(e.translateX||0)+(i.offsetX||0)-n.left,y:(e.translateY||0)+(i.offsetY||0)-n.top,w:(this.w.layout.gridWidth||0)+n.left+n.right,h:(this.w.layout.gridHeight||0)+n.top+n.bottom}}destroy(){this._compositor.destroy(),this._hitCtx=void 0}}g.default.registerRenderer("canvas",(t,e)=>new vn(t,e));g.default.registerFeatures({contextMenu:class{constructor(t,e){this.w=t,this.ctx=e,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!mt.isBrowser())return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.addEventListener("contextmenu",this._onContext),this._trigger=t)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(t){this._enabled()&&(t.preventDefault(),this.open(t.clientX,t.clientY))}_clientToData(t,e){const i=this.w;if(!i.globals.axisCharts||!i.dom.baseEl||!i.dom.baseEl.querySelector(".apexcharts-svg"))return null;const n=ai.plotRect(i);if(!n.width||!n.height)return null;const s=t=>t<0?0:t>1?1:t,r=s((t-n.left)/n.width),a=s((e-n.top)/n.height),o=i.globals.minX+r*(i.globals.maxX-i.globals.minX),l=i.globals.yAxisScale&&i.globals.yAxisScale[0],c=l&&isFinite(l.niceMin)?l.niceMin:i.globals.minY,h=l&&isFinite(l.niceMax)?l.niceMax:i.globals.maxY;return{x:o,y:h-a*(h-c)}}_resolveItems(t){const e=this._cfg(),i=Array.isArray(e.items)&&e.items.length?e.items:["annotate","xline","yline","measure"],n=e.labels||{},s=[];return i.forEach(e=>{if("string"==typeof e){if("annotate"===e)s.push({id:"annotate",label:n.annotate||"Add note here",run:()=>this._annotate(t)});else if("xline"===e)s.push({id:"xline",label:n.xline||"Annotate here",run:()=>this._line(t,"x")});else if("yline"===e)s.push({id:"yline",label:n.yline||"Mark this level",run:()=>this._line(t,"y")});else if("measure"===e){const e=this.ctx.measure;e&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&s.push({id:"measure",label:n.measure||"Measure from here",run:()=>e.seedFromClient(t.clientX,t.clientY)})}}else e&&"object"==typeof e&&"function"==typeof e.onClick&&s.push({id:e.id||"custom",label:e.label||"Action",run:()=>e.onClick(this.ctx,t)})}),s}_annotate(t){if(null==t.x||null==t.y)return;const e=this._cfg(),i=this.ctx.ink;i&&"function"==typeof i.createAt?i.createAt(t.x,t.y,{text:e.noteText||"Note"}):this.ctx.addPointAnnotation({x:t.x,y:t.y,marker:{size:5},label:{text:e.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(t,e){const i=this._cfg().line||{},n="x"===e?t.x:t.y;if(null==n)return;const s=this.ctx.ink;if(s&&"function"==typeof s.createLineAt)return void s.createLineAt(e,n,{text:i.text,strokeDashArray:i.strokeDashArray,color:i.color});const r={strokeDashArray:null!=i.strokeDashArray?i.strokeDashArray:4};i.text&&(r.label={text:i.text}),i.color&&(r.borderColor=i.color,r.label=v.extend(r.label||{},{borderColor:i.color})),"x"===e?this.ctx.addXaxisAnnotation(v.extend(r,{x:n}),!0):this.ctx.addYaxisAnnotation(v.extend(r,{y:n}),!0)}open(t,e){this.close();const i=this.w,n=i.dom.elWrap,s=this._doc();if(!n||!s)return;const r=this._clientToData(t,e),a=i.globals,o={x:r?r.x:null,y:r?r.y:null,seriesIndex:a.capturedSeriesIndex>=0?a.capturedSeriesIndex:null,dataPointIndex:a.capturedDataPointIndex>=0?a.capturedDataPointIndex:null,clientX:t,clientY:e},l=this._resolveItems(o);if(!l.length)return;this._items=l;const c=s.createElement("div");c.className="apexcharts-context-menu",c.setAttribute("role","menu"),c.style.position="absolute",c.style.visibility="hidden",l.forEach((t,e)=>{const i=s.createElement("button");i.type="button",i.className="apexcharts-context-menu-item",i.setAttribute("role","menuitem"),i.tabIndex=-1,i.textContent=t.label,i.addEventListener("click",t=>{t.stopPropagation(),this._activate(e)}),i.addEventListener("mouseenter",()=>this._focus(e)),c.appendChild(i)}),n.appendChild(c),this.menu=c;const h=n.getBoundingClientRect(),u=ai.plotRect(i).zoom;let d=(t-h.left)/u,p=(e-h.top)/u;const f=c.offsetWidth,g=c.offsetHeight,m=Math.max(0,n.clientWidth-f),y=Math.max(0,n.clientHeight-g);d>m&&(d=m),p>y&&(p=y),c.style.left=Math.max(0,d)+"px",c.style.top=Math.max(0,p)+"px",c.style.visibility="visible",s.addEventListener("mousedown",this._onDocDown,!0),s.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(t){if(!this.menu)return;const e=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&e[this._focusIndex]&&e[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=t,e[t]&&(e[t].classList.add("apexcharts-context-menu-item--active"),"function"==typeof e[t].focus&&e[t].focus())}_activate(t){const e=this._items[t];this.close(),e&&e.run()}_onDocDown(t){this.menu&&this.menu.contains(t.target)||this.close()}_onKey(t){this.menu&&this._items.length&&("Escape"===t.key?(t.preventDefault(),this.close()):"ArrowDown"===t.key?(t.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===t.key?(t.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const t=this._doc();t&&(t.removeEventListener("mousedown",this._onDocDown,!0),t.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}});g.default.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;mt.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const i=this.ctx.el;if(!i)return;const n=i.ownerDocument,s=n&&n.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(s))return;if(!i.contains(s)&&!this._engaged)return;const r="y"===e||t.shiftKey;t.preventDefault(),r?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&mt.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const i=this._capture(t),n=this.stack[this.pointer];if(!n||n.sig!==i.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(i),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=xi(this.w,this.ctx),{config:i,seriesSig:n}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:i,seriesSig:n,label:t||"change",at:mt.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,i)}}_cloneConfigCOW(){const t=this.w,e=this.stack[this.pointer];let i=null;try{i=JSON.stringify(t.config.series)}catch(t){i=null}const n=this.ctx.responsive?this.ctx.responsive.withoutBreakpoints(t.config):t.config;let s;if(e&&null!==i&&e.seriesSig===i){const t=n,{series:i}=t,r=c(t,["series"]);s=v.clone(r),s.series=e.config.series}else s=v.clone(n);return{config:s,seriesSig:i}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let i;this.applying=!0;try{this.ctx.clearAnnotations(),i=this.ctx.updateOptions(v.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(i).then(()=>{this.w.globals.isDestroyed?this.applying=!1:(_i(this.ctx,t.view),this._refreshSettle(),this._emitChange())}).catch(()=>{this.applying=!1})}_refreshSettle(){mt.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const i=this.stack.findIndex(e=>e.id===t);-1!==i&&i!==this.pointer&&(this.pointer=i,this._restore(this.stack[i],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const i=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=i,i||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,i,n,s,r,a,o;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onUpdated),null==(r=(s=this.ctx).removeEventListener)||r.call(s,"scrolled",this._onUpdated),null==(o=(a=this.ctx).removeEventListener)||o.call(a,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}});const wn=g.__apex_DataLabels,An=g.__apex_Easing_resolveEasing,Mn=g.__apex_PathMorphing_parsePath,kn=g.__apex_PathMorphing_arrayToPath;function Ln(t,e,i){if(!t||"string"!=typeof t)return null;const n=Mn(t);if(!n.length||"M"!==n[0][0])return null;for(let t=1;t<n.length;t++)if("M"===n[t][0])return null;let s=n,r=null;if(i){if(n.length<5)return null;if(r=n.slice(-3),s=n.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===n[n.length-1][0])return null;if(s.length!==e||s.length<2)return null;const a=s[1][0];if("L"!==a&&"C"!==a)return null;for(let t=2;t<s.length;t++)if(s[t][0]!==a)return null;const o=s.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:s,closing:r,segType:a,anchors:o}}function Sn(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Cn(t,e,i){const n=t,s=[e[1],e[2]],r=[e[3],e[4]],a=[e[5],e[6]],o=Sn(n,s,i),l=Sn(s,r,i),c=Sn(r,a,i),h=Sn(o,l,i),u=Sn(l,c,i),d=Sn(h,u,i);return{first:["C",o[0],o[1],h[0],h[1],d[0],d[1]],second:["C",u[0],u[1],c[0],c[1],a[0],a[1]],mid:d}}function En(t,e,i){const n=[e[1],e[2]],s=Sn(t,n,i);return{first:["L",s[0],s[1]],second:["L",n[0],n[1]],mid:s}}function Fn(t,e){const{body:i,closing:n,segType:s,anchors:r}=t,a=r.length,o=e.length,l=t=>"C"===s?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],c=[["M",r[0][0],r[0][1]]];let h=0;for(;h<o&&0!==e[h];)h++;for(let t=1;t<=h;t++)c.push(l(r[0]));let u=h+1;for(let t=0;t<a-1;t++){let n=0;for(;u+n<o&&-1===e[u+n];)n++;const a=i[t+1];if(n){const e=n+1;let i=r[t],o=a;for(let t=0;t<n;t++){const n=1/(e-t),r="C"===s?Cn(i,o,n):En(i,o,n);c.push(r.first),i=r.mid,o=r.second}c.push(o)}else c.push(a.slice());u+=n+1}for(;u<o;)c.push(l(r[a-1])),u++;return n&&n.forEach(t=>c.push(t.slice())),c}function Pn(t,e,i,n,s,r){const a=Ln(t,n,r);if(!a)return null;const o=Ln(e,s,r);if(!o)return null;if(a.segType!==o.segType)return null;if((a.closing||o.closing)&&(!a.closing||!o.closing||a.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),c=i.map(t=>t.newJ);return{from:kn(Fn(a,l)),toInterp:kn(Fn(o,c))}}function Dn(t,e,i){var n,s,r,a;if(null==(n=t.axisFlags)?void 0:n.isXNumeric){const n=null==(r=null==(s=t.seriesData)?void 0:s.seriesX)?void 0:r[e];if(n&&n.length&&null!=n[i])return"x:"+n[i]}const o=null==(a=t.globals.labels)?void 0:a[i];return null!=o&&""!==String(o)?"c:"+(Array.isArray(o)?o.join(" "):String(o)):"j:"+i}function Rn(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function Tn(t,e,i=!1,n=!1){var s,r;if(!function(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const n=null!=(e=i.largeDatasetThreshold)?e:0;return!(n>0&&t.globals.dataPoints>n||!(mt.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate))}(t))return null;const a=t.globals.prevStreamFrame;if(!a)return null;const o=null==(s=a.seriesY)?void 0:s[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(o)||!Array.isArray(l))return null;if(!o.length||!l.length)return null;const c=Rn(o.map((t,i)=>function(t,e,i){var n,s;if(t.isXNumeric){const s=null==(n=t.seriesX)?void 0:n[e];if(s&&s.length&&null!=s[i])return"x:"+s[i]}const r=null==(s=t.labels)?void 0:s[i];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+i}(a,e,i))),h=Rn(l.map((i,n)=>Dn(t,e,n))),u=function(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const n=new Array(e.length),s=new Set;let r=-1,a=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!s.has(i.get(t))?i.get(t):-1;n[e]=l,-1!==l&&(s.add(l),l<r&&(a=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)s.has(e)||l.push(e);return{toOld:n,exits:l,ordered:a,changed:!o}}(c,h);return(u.ordered||n)&&(u.changed||i)?{join:u,oldKeys:c,newKeys:h}:null}function Nn(t,{type:e,realIndex:i,pathFromLine:n,pathFromArea:s,linePaths:r,areaPaths:a}){var o,l;const c=Tn(t,i);if(!c)return null;const{join:h,oldKeys:u,newKeys:d}=c,p=t.globals.prevStreamFrame;if(!p)return null;const f=null==(o=p.seriesY)?void 0:o[i],g=null==(l=t.seriesData.series)?void 0:l[i];if(f.length<2||g.length<2)return null;if(f.some(t=>null===t)||g.some(t=>null===t))return null;const m=function(t,e){const i=new Set(t.exits),n=[];let s=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;s<r;)i.has(s)&&n.push({oldJ:s,newJ:-1}),s++;n.push({oldJ:r,newJ:e}),s=r+1}else n.push({oldJ:-1,newJ:e})}for(;s<e;)i.has(s)&&n.push({oldJ:s,newJ:-1}),s++;return n}(h,u.length),y={};return Array.isArray(r)&&1===r.length&&n&&(y.line=Pn(n,r[0],m,u.length,d.length,!1)),"area"===e&&Array.isArray(a)&&1===a.length&&s&&(y.area=Pn(s,a[0],m,u.length,d.length,!0)),y.line||y.area?y:null}const On=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function $n(t,e){const{ax:i,bx:n,ay:s,by:r}=e,a=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(On)||[]).map(parseFloat);if("Z"===t){a.push("z");continue}if("H"===t){for(const t of e)a.push(`H ${i*t+n}`);continue}if("V"===t){for(const t of e)a.push(`V ${s*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)a.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+n} ${s*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+n} ${s*e[t+1]+r}`);o.length&&a.push(`${t} ${o.join(" ")}`)}return a.join(" ")}const In="apexcharts-highlight-part",Bn={f:1,o:0},zn={f:0,o:0},Wn=t=>({f:t,o:t<1?1:0}),Hn=t=>"number"==typeof t&&t==t&&t!==1/0&&t!==-1/0,jn=(t,e,i)=>i>=1?e:t+(e-t)*i,Yn=t=>t&&"object"==typeof t&&!Array.isArray(t),qn=(t,e="fill-opacity")=>{var i;const n=null==(i=t.instance)?void 0:i._cmd,s=parseFloat(n?n[e.replace("-o","O")]:t.getAttribute(e));return isFinite(s)?s:1};function Xn(t){const e="string"==typeof t?t.trim():"";let i,n=null;return(i=/^rgba\(([^,]+,[^,]+,[^,]+),([^)]+)\)$/i.exec(e))?n=[`rgb(${i[1]})`,parseFloat(i[2])]:(i=/^color-mix\(in srgb, (.+) ([\d.]+)%, transparent\)$/.exec(e))?n=[i[1],parseFloat(i[2])/100]:(i=/^(#[\da-f]{6})([\da-f]{2})$/i.exec(e))&&(n=[i[1],parseInt(i[2],16)/255]),n&&n[1]>0&&n[1]<1?n:[t,1]}function Gn(t,e){const i=null!=t&&e?t/e:null;return{value:null!=t?t:null,total:null!=e?e:null,share:i,overflow:null!=i&&(i<0?"sign":i>1)}}function Un(t){let e=parseFloat(t.getAttribute("x")),i=parseFloat(t.getAttribute("y"));return String(t.getAttribute("transform")||"").replace(/translate\(\s*([^\s,)]+)[\s,]*([^\s,)]*)\s*\)/g,(t,n,s)=>(e+=parseFloat(n)||0,i+=parseFloat(s)||0,"")),[e,i]}const Kn=["mousemove","mousedown","mouseup","mouseover","mouseout","click","touchstart","touchmove","touchend"];function Vn(t,e){const i=t._apxHits||(t._apxHits=new Set);if(!t._apxHitStop){t._apxHitStop=!0;const e=t=>{i.has(t.relatedTarget)&&t.stopImmediatePropagation()};["mouseout","mouseleave","mouseover","mouseenter"].forEach(i=>t.addEventListener(i,e,!0))}i.add(e),Kn.forEach(i=>e.addEventListener(i,e=>{e.stopPropagation();const n="mouseover"===i,s="mouseout"===i;(n||s)&&e.relatedTarget===t||(ts(t,i,e),n&&ts(t,"mouseenter",e),s&&ts(t,"mouseleave",e))},{passive:!0}))}function Zn(t,e){const i=()=>{const i=t.getAttribute("filter");i?e.setAttribute("filter",i):e.removeAttribute("filter")};i(),mt.isBrowser()&&"undefined"!=typeof MutationObserver&&new MutationObserver(i).observe(t,{attributes:!0,attributeFilter:["filter"]})}function Qn(t,e){const i=t.parentNode,n=Array.from(i.childNodes);i.insertBefore(e,n[n.indexOf(t)+1]||null)}const Jn=(t,e)=>t.setAttribute("class",`${t.getAttribute("class")||""} ${e}`.trim());function ts(t,e,i){try{const n=i.touches?{bubbles:!0,cancelable:!0,touches:Array.from(i.touches),targetTouches:Array.from(i.targetTouches),changedTouches:Array.from(i.changedTouches)}:"mouseenter"===e||"mouseleave"===e?{clientX:i.clientX,clientY:i.clientY,screenX:i.screenX,screenY:i.screenY,relatedTarget:i.relatedTarget,buttons:i.buttons}:i;t.dispatchEvent(new i.constructor(e,n))}catch(t){}}function es(t){if(!Yn(t))return t;const e=t,{highlightData:i,highlight:n}=e,s=c(e,["highlightData","highlight"]);return["data","children"].forEach(t=>{Array.isArray(s[t])&&(s[t]=s[t].map(ss))}),s}function is(t){const e=[];return(t||[]).forEach(t=>(Yn(t)&&Array.isArray(t.data)?t.data:[]).forEach(t=>{Yn(t)&&void 0!==t.x&&(void 0!==t.y||Array.isArray(t.children))&&e.push(t)})),e}const ns=t=>Yn(t)&&("highlight"in t||"highlightData"in t||[t.data,t.children].some(t=>Array.isArray(t)&&t.some(ns))),ss=t=>Yn(t)&&("highlight"in t||Array.isArray(t.children))?es(t):t;function rs(t,e){if("number"==typeof e)return e;const i=t.config&&t.config.series||[];for(let t=0;t<i.length;t++)if(i[t]&&i[t].name===e)return t;return-1}function as(t){return!!(t&&t.weaveHighlights&&t.weaveHighlights.records.length)}function os(t,e){if(!as(t))return null;let i=null;for(const n of t.weaveHighlights.records)for(const s of n.entries)rs(t,s.series)===e&&(i=s.values);return i}const ls="p:",cs=["pie","donut","polarArea"];function hs(t,e){var i;const n=t.w.highlightData;if(!n)return;if(t._render!==e&&t._beginRender(e,"p:"),!n.active&&!(null==(i=t._prev())?void 0:i.size))return;n.active&&"polarArea"===e.chartType&&"clamp"!==t.cfg.axis&&n.parts.forEach(t=>{Hn(t[0])&&(e.maxY=Math.max(e.maxY,t[0]))});const s=e.animatePaths,r=e.drawArcs,a=e.getSliceMovers,c=e.getHoverOutlinePath,h={arcs:[],movers:[],reach:[],ap:s};e.animatePaths=(t,i)=>{const n=o({},i);s.call(e,t,i),n.run=i.dur,h.arcs[i.i]={a:n,el:t}},e.drawArcs=(...i)=>{const n=r.apply(e,i);return function(t,e,i,n){var s,r,a,c,h,u,d,p,f,g;const m=t.w,y=m.globals,x=t.cfg,b=m.highlightData,w=b.active,A=t._prev(),M=e.chartType,k="polarArea"===M,L=y.radialSize,S="donut"===M?e.donutSize:0,C=w?null!=(s=x.fadeOpacity)?s:.2:1,E=!0===(null==(r=t.ctx.morphTypeChange)?void 0:r.isActive()),F=!y.dataChanged||!y.shouldAnimate,P="area"===(null==(a=x.pie)?void 0:a.encoding),D=m.seriesData.series,R="part"===(null!=(h=null==(c=x.dataLabels)?void 0:c.value)?h:"part"),T=e.strokeWidth>0&&(null!=(d=null==(u=x.outline)?void 0:u.width)?d:1)>0?{opacity:null!=(f=null==(p=x.outline)?void 0:p.opacity)?f:1}:null,N=null==(g=y.prevHighlightLabels)?void 0:g.get(-1),O=[],$=(t,e)=>{var i,n;return(null==(i=t.classList)?void 0:i.contains(e))||` ${null==(n=t.getAttribute)?void 0:n.call(t,"class")} `.indexOf(` ${e} `)>-1};Array.from(i.node.childNodes).filter(t=>$(t,"apexcharts-pie-series")).forEach(i=>{var s,r,a,c,h,u;const d=Array.from(i.childNodes).find(t=>$(t,"apexcharts-pie-area"));if(!d)return;const p=Number(d.getAttribute("j")),f=ls+p,g=F||null==A?void 0:A.get(f);if(!w&&!g)return;const M=n.arcs[p],I=D[p],B=w?null==(s=b.parts[p])?void 0:s[0]:null,z=e.sliceSizes[p],W=k?z:L,H=mt.isBrowser()&&!!M&&M.a.run>0&&!E,j=+(null==M?void 0:M.a.animBeginArr[p])||0,Y=null!=B&&I>0?B/I:null;let q=null,X=!1;if(null!=Y&&Y>0)if(X=Y>1,k)q=Math.min(L,z*Y);else{const t=Math.min(Y,1);q=P?Math.sqrt(S*S+t*(L*L-S*S)):S+(L-S)*t}const G=null!=(r=null==g?void 0:g.lr)?r:null==g?void 0:g.fr;let U=q;const K=null==q&&null!=G&&H;K&&(U=y.collapsedSeriesIndices.indexOf(p)>-1?G*L:w?S:W);const V=K&&!w;let Z=U,Q=!1;null!=U&&H&&!F&&(null!=G?Z=G*L:g||"baseline"===x.enter?Z=S:(Q=!0,Z=k?null!=(a=M.a.prevSize)?a:z:L),K||Math.abs(M.a.prevEndAngle-M.a.prevStartAngle)>.01||(Z=U,Q=!1));let J=null,tt=null;const et=t=>{const e=d.getAttribute("transform");e&&(t.setAttribute("transform",e),t.classList.add("apexcharts-slice-mover"),t.style.transition=d.style.transition),(n.movers[p]=n.movers[p]||[]).push(t)},it=(t,i,s,r)=>{if(M&&!E)n.ap.call(t,i,l(o({},M.a),{size:s,prevSize:F?void 0:r,isTrack:!0}));else{const n=Number(d.getAttribute("data:angle"));i.attr({d:t.getPiePath({me:t,startAngle:Number(d.getAttribute("data:startAngle")),angle:n>=e.fullAngle?e.fullAngle-.01:n,size:s}),"stroke-width":t.strokeWidth})}},nt=d.getAttribute("fill"),[st,rt]=Xn(nt),at=qn(d),ot=!!nt&&"none"!==nt&&!/^url\(/i.test(nt),lt=ot?rt*at:at,ct=ot?Q?lt:null!=G&&null!=(c=g.al)?c:1:at,ht=ot?V?lt:1:at;if(null!=U){const s=fs(e,W);J=new _(m).drawPath({d:"",fill:st,stroke:d.getAttribute("stroke"),strokeWidth:0,fillOpacity:ct,classes:`${In} apexcharts-pie-highlight-part`});const r=J.node;if(r.setAttribute("pointer-events","none"),null!=Y&&r.setAttribute("data:hl-share",String(Y)),i.appendChild(r),et(r),H&&!F&&r.setAttribute("d",s.getChangedPath(M.a.prevStartAngle,M.a.prevEndAngle,Z)),it(s,J,U,Z),X&&!K&&r.classList.add("apexcharts-highlight-overflow"),Zn(d,r),X&&!K||K&&(null==g?void 0:g.edge)){tt=new _(m).drawPath({d:"",fill:"none",stroke:"#fff",strokeWidth:1,strokeDashArray:3,classes:`${In} apexcharts-highlight-edge`}),tt.node.setAttribute("pointer-events","none"),tt.node.setAttribute("stroke-opacity","0"),i.appendChild(tt.node),et(tt.node);it(fs(e,W,{strokeWidth:{value:1}}),tt,k?z:L-2,k?null==M?void 0:M.a.prevSize:L-2)}if(k&&X&&!K&&(r.removeAttribute("pointer-events"),Vn(d,r),n.reach[p]=U),E){const e=[r,null==tt?void 0:tt.node].filter(Boolean),i=t=>e.forEach(e=>e.setAttribute("opacity",t));i(0),t._tween(t.ctx.morphTypeChange.getSpeed(),m.config.chart.animations.dynamicAnimation.speed,i,()=>e.forEach(t=>t.removeAttribute("opacity")))}}const ut={d:null,fr:null,f:C,edge:!1,c:!w,al:ht};t._targets.set(f,ut);const dt=X&&null!=q?.75:0,pt=F?dt:(null==g?void 0:g.edge)?.75:0,ft=null!=Z?Z:0,gt=null!=U?U:0;t._fade(d,F?Wn(C):Q?zn:g?{f:g.f,o:null!=(h=g.o)?h:Wn(g.f).o}:Bn,V?zn:Wn(C),{delayMs:j,speed:null==M?void 0:M.a.run,el:null==M?void 0:M.el},{anim:H,force:!!J&&(ft!==gt||pt!==dt||ct!==ht),outline:T&&l(o({},T),{color:y.colors[p]}),also:t=>{J&&(ut.lr=jn(ft,gt,t)/L,ut.la=jn(ct,ht,t),J.node.setAttribute("fill-opacity",String(ut.la))),null==tt||tt.node.setAttribute("stroke-opacity",String(jn(pt,dt,t)))},land:V?Bn:void 0,done:K?()=>{null==J||J.remove(),null==tt||tt.remove(),ut.lr=null}:void 0,rec:ut}),null!=q&&Object.assign(ut,{fr:q/L,edge:X,n:J.node});const yt=e.sliceLabelGroups[p],xt=yt&&Array.from(yt.childNodes).find(t=>$(t,"apexcharts-pie-label"));if(xt&&w){if(null==B&&R)return e.sliceLabels=e.sliceLabels.filter(t=>t.node!==yt),null==(u=yt.parentNode)||u.removeChild(yt),void delete e.sliceLabelGroups[p];!function(t,e,i,n,s,r,a,o,l){var c,h;const u=t.config.dataLabels.formatter;if(null!=r){const e=null!=(h=null==(c=t.globals.seriesPercent[s])?void 0:c[0])?h:0,i=a?e*r/a:0;n.textContent=String(u?u(i,{seriesIndex:s,dataPointIndex:s,series:t.seriesData.series,w:t,highlight:Gn(r,a)}):i+"%")}const d=parseFloat(n.getAttribute("font-size"))||12,p=Number(i.getAttribute("data:startAngle")),f=Number(i.getAttribute("data:angle"));if(null!=r&&null!=o&&o-l>=1.2*d){const i=t.config.plotOptions.pie.dataLabels.offset,s=v.polarToCartesian(e.centerX,e.centerY,"donut"===e.chartType?(l+o)/2+i:o/1.25+i,(p+f/2)%e.fullAngle);n.setAttribute("x",s.x),n.setAttribute("y",s.y)}const g=new _(t).getTextRects(n.textContent,n.getAttribute("font-size"),n.getAttribute("font-family"),void 0,!0,n.getAttribute("font-weight")),m=parseFloat(n.getAttribute("x")),y=parseFloat(n.getAttribute("y")),x=null!=o&&[[m-g.width/2,y-.75*g.height],[m+g.width/2,y-.75*g.height],[m-g.width/2,y+.25*g.height],[m+g.width/2,y+.25*g.height]].every(([t,i])=>{const n=t-e.centerX,s=i-e.centerY,r=Math.hypot(n,s),a=((180*Math.atan2(s,n)/Math.PI+90-p)%360+360)%360;return r>=l&&r<=o&&a<=f});x||(n.setAttribute("fill",t.config.chart.foreColor),n.removeAttribute("filter"))}(m,e,d,xt,p,R?B:null,I,q,S)}xt&&H&&!F&&N&&O.push({t:xt,src:N.get(p),el:M.el,delayMs:j,arc:M})}),O.length&&(t._ride=()=>function(t,e){e.forEach(({t:e,src:i,el:n,delayMs:s,arc:r})=>{if(!e.isConnected)return;const[a,o]=Un(e),l=i?i.x-a:0,c=i?i.y-o:0;i&&Math.abs(l)<.5&&Math.abs(c)<.5||t._tween(s,r.a.run,t=>{const n=1-t;n>0&&i?e.setAttribute("transform",`translate(${l*n} ${c*n})`):e.removeAttribute("transform"),i||(t<1?e.setAttribute("opacity",String(t)):e.removeAttribute("opacity"))},void 0,void 0,n)})}(t,O))}(t,e,n,h),n},e.getSliceMovers=t=>a.call(e,t).concat(h.movers[t]||[]),e.getHoverOutlinePath=t=>{const i=e.sliceSizes;if(!(h.reach[t]>i[t]))return c.call(e,t);e.sliceSizes=i.slice(),e.sliceSizes[t]=h.reach[t];try{return c.call(e,t)}finally{e.sliceSizes=i}},us(t,e)}function us(t,e){const i=e.renderInnerDataLabels,n=e.printInnerLabels;e.renderInnerDataLabels=(n,s,r)=>ds(t,()=>i.call(e,n,ps(t,s,0),r)),e.printInnerLabels=(i,s,r,a)=>ds(t,()=>n.call(e,ps(t,i,a?+a.parentNode.getAttribute("rel")-1:-1),s,r,a))}function ds(t,e){var i,n;const s=t.w.globals,r=t.w.highlightData;if(!(null==r?void 0:r.active)||"part"!==(null!=(n=null==(i=t.cfg.dataLabels)?void 0:i.total)?n:"part"))return e();const a=s.seriesTotals;s.seriesTotals=r.parts.map(t=>{var e;return null!=(e=t[0])?e:0});try{return e()}finally{s.seriesTotals=a}}function ps(t,e,i){var n,s;const r=t.w,a=r.highlightData;if(!(null==a?void 0:a.active))return e;const c=r.seriesData.series,h=a.parts.map(t=>t[0]),u=i>-1&&"part"===(null!=(s=null==(n=t.cfg.dataLabels)?void 0:n.value)?s:"part")?h[i]:null,d=t=>t.reduce((t,e)=>t+(Hn(e)?e:0),0),p=e.total.formatter,f=e.value.formatter;return l(o({},e),{total:l(o({},e.total),{formatter:p&&(t=>p(t,{highlight:Gn(d(h),d(c))}))}),value:l(o({},e.value),{formatter:(t,e)=>f(null!=u?u:t,e,{highlight:i>-1?Gn(h[i],c[i]):void 0})})})}const fs=(t,e,i)=>Object.create(t,o({getSliceExtent:{value:i=>t.getSliceExtent(l(o({},i),{size:e}))}},i));const gs="r:",ms="r:o",ys=["length","baseWidth","tipWidth","offsetY"],xs=.45,_s=`${In} apexcharts-radialbar-highlight-lane`;function bs(t,e){var i,n,s,r,a,l,c;const h=t.w,u=h.highlightData,d=null==(n=null==(i=t.ctx.lastUpdateOptions)?void 0:i.tooltip)?void 0:n.enabled;if(null!=d?t._tipUser=d:t._tipOn&&(h.config.tooltip.enabled=!1),t._tipOn=!1,!u)return;t._render!==e&&t._beginRender(e,gs),function(t){const e=t.ctx.morphTypeChange;if(!e||e._hfOut)return;e._hfOut=!0;const i=e.captureBeforeDestroy;e.captureBeforeDestroy=n=>{const s=function(t,e){var i,n,s,r,a;const o=t.w,l=o.globals,c=null==(i=o.dom.baseEl)?void 0:i.querySelector(".apexcharts-radialbar");if("radialBar"!==e&&"gauge"!==e||!c)return null;const h=t.ctx.morphTypeChange,u=null!=(s=null==(n=l.circleGeometry)?void 0:n.cx)?s:0,d=null!=(a=null==(r=l.circleGeometry)?void 0:r.cy)?a:0,p=new Map,f=new Set,g=new Set;c.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(e=>{var i,n,s,r;const a=e.parentNode,o=+a.getAttribute("data:realIndex"),l=gs+e.getAttribute("j"),c=null!=(n=t._targets.get(l))?n:null==(i=t._prev())?void 0:i.get(l),m=a.querySelector(".apexcharts-radialbar-highlight-part");if(!(m||(null==c?void 0:c.s)>0||(null!=(r=null!=(s=null==c?void 0:c.lf)?s:null==c?void 0:c.f)?r:1)<1))return;f.add(e);const y=null==m?void 0:m.getAttribute("d"),x=+(null==m?void 0:m.getAttribute("stroke-width"));let _=null;if(y&&x>0&&"0"!==m.getAttribute("opacity"))_=h._radialArcToFilledSegment(y,x,u,d)||y,g.add(m);else{const t=/M\s*(-?[\d.e]+)\s+(-?[\d.e]+)/.exec(e.getAttribute("d")||"");t&&(_=`M ${t[1]} ${t[2]} L ${t[1]} ${t[2]} Z`)}_&&p.set(o,_)});const m=[...c.getElementsByClassName(In)];return p.size||m.length?(m.forEach(t=>g.has(t)||t.closest(".apexcharts-tracks")||f.add(t)),{marks:p,ghost:()=>{const t="data-hf-ghost";f.forEach(e=>e.setAttribute(t,""));const e=o.dom.Paper.node.cloneNode(!0);f.forEach(e=>e.removeAttribute(t));const i=new Set(e.querySelectorAll(`[${t}]`)),n=new Set;i.forEach(i=>{i.removeAttribute(t);for(let t=i.parentNode;t&&t!==e;t=t.parentNode)n.add(t)});const s=t=>[...t.children].forEach(t=>{i.has(t)||(n.has(t)?s(t):"defs"!==t.tagName.toLowerCase()&&t.remove())});return s(e),e.removeAttribute("id"),[e,...e.querySelectorAll("*")].forEach(t=>{t.id&&(t.id+="-hf"),[...t.attributes].forEach(e=>{e.value.includes("url(#")&&t.setAttribute(e.name,e.value.replace(/url\(#([^)]+)\)/g,"url(#$1-hf)"))})}),e}}):null}(t,null==n?void 0:n.fromType);if(!s)return i.call(e,n);const r=e._captureFromDOM;let a;e._captureFromDOM=t=>{const i=r.call(e,t);return i.marks.forEach(t=>{var e;t.d=null!=(e=s.marks.get(t.realIndex))?e:t.d}),i};try{a=i.call(e,n)}finally{e._captureFromDOM=r}const o=e._snapshot;return!a||!o||e._ghost||o.pieceOut||o.pieceIn||(e._ghost=s.ghost()),a}}(t);const p=h.config.plotOptions.radialBar;if(t._ind=null!=(r=null==(s=t.cfg.radialBar)?void 0:s.indicator)?r:"needle"===p.shape?"needle":"arc","lanes"!==t._ind||"needle"!==p.shape||(null==(a=p.needle)?void 0:a.showValueArc)||(t._ind="needle"),!u.active&&!(null==(l=t._prev())?void 0:l.size))return;const f=h.config.tooltip;u.active&&!f.enabled&&null==t._tipUser&&mt.isBrowser()&&(f.enabled=!0,t._tipOn=!0),us(t,e),function(t,e){const i=e.renderInnerDataLabels,n=e.printInnerLabels;e.renderInnerDataLabels=(n,s,r)=>{const a=i(n||e.dataLabelsGroup,s,r);return As(t,e,s,-1,a),a},e.printInnerLabels=(i,s,r,a)=>{n(i,s,r,a),As(t,e,i,a?+a.parentNode.getAttribute("rel")-1:-1)}}(t,e);const g=e.drawNeedle;e.drawNeedle=i=>{const n=g.call(e,i);return function(t,e,i){var n,s;const r=t.w,a=r.globals,o=r.highlightData.active,l=!a.dataChanged||!a.shouldAnimate,c=l||null==(n=t._prev())?void 0:n.get(ms);if(!o&&!c)return;const h=o?null!=(s=t.cfg.fadeOpacity)?s:.2:1,u=l?h:c?c.f:1,d={d:null,f:h,c:!o};t._targets.set(ms,d);const p=t=>{d.lf=t,t<1?i.node.setAttribute("opacity",String(t)):i.node.removeAttribute("opacity")},f=t.ctx.morphTypeChange,g=(null==f?void 0:f.isActive())?{delay:f.getSpeed(),speed:r.config.chart.animations.dynamicAnimation.speed}:e.needleMotion();g&&u!==h?(d.run=!0,t._tween(g.delay||0,g.speed,t=>p(jn(u,h,t)),()=>d.run=!1,g.ease)):p(h);o&&mt.isBrowser()&&Promise.resolve().then(()=>{var t;const e=r.dom.baseEl,n=null==e?void 0:e.querySelector(".apexcharts-radialbar-slice-0");n&&i.node.isConnected&&(Vn(n,i.node),null==(t=e.querySelector(".apexcharts-radialbar-hollow"))||t.setAttribute("pointer-events","none"))})}(t,e,n),n};const m=e.animatePaths;e.animatePaths=(i,n)=>{const s=o({},n);m.call(e,i,n),n.isTrack||(s.run=n.dur,vs(t,e,i,s,m))},!0===(null==(c=t.ctx.morphTypeChange)?void 0:c.isActive())&&Promise.resolve().then(()=>{var i;t._render!==e||h.globals.isDestroyed||null==(i=h.dom.baseEl)||i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>vs(t,e,i.instance,null,m))})}function vs(t,e,i,n,s){var r,a,c,h,u,d;const p=t.w,f=p.globals,g=t.cfg,m=p.highlightData,y=m.active,x=i.node,b=n?n.i:Number(x.getAttribute("j")),w=gs+b,A=!n,M=!f.dataChanged||!f.shouldAnimate,k=t._prev(),L=M||null==k?void 0:k.get(w),S=p.config.plotOptions.radialBar,C=t._ind,E=x.getAttribute("stroke"),F=x.getAttribute("fill"),P=E&&"transparent"!==E?E:A&&F&&"none"!==F?F:null,D=0===b&&("needle"===C||!P),R=p.seriesData.series[b],T=y&&f.collapsedSeriesIndices.indexOf(b)<0&&null!=(a=null==(r=m.parts[b])?void 0:r[0])?a:null,N=e.startAngle,O=n?n.endAngle:e._arcEnd(R),$=n?n.run:0,I=mt.isBrowser()&&$>0,B=n&&+n.animBeginArr[b]||0,z=null!=(c=g.fadeOpacity)?c:.2,W=y&&!D&&!!P,H={f:z,o:0},j=n?n.size:Math.hypot(x.getAttribute("data:cx")-f.circleGeometry.cx,x.getAttribute("data:cy")-f.circleGeometry.cy);if("lanes"===C&&P)return function(t,e,i,n){var s,r,a,c,h,u,d;const{i:p,c:f,prev:g,mount:m,pv:y,whole:x,wholeEnd:b,run:v,anim:w,delayMs:A,size:M}=n,k=t.w,L=k.globals,S=t.cfg,C=k.config.plotOptions.radialBar,E=k.highlightData.active,F=i.node,P=!f,D=e.startAngle,R=E&&L.collapsedSeriesIndices.indexOf(p)<0?1:0,T=P?mt.isBrowser()&&!!R:w&&!m,N=!P&&w&&m,O=P?0:T?null!=(s=null==g?void 0:g.s)?s:0:R,$=P?{delayMs:t.ctx.morphTypeChange.getSpeed(),speed:k.config.chart.animations.dynamicAnimation.speed}:{delayMs:A,speed:v};0===p&&function(t,e){var i;const n=null==(i=t._render)?void 0:i._hfLine,s=null==n?void 0:n.rec;if(!s||s.run||s.lf===s.f)return;const r=s.lf,a=()=>{var t,e;if(s.run=!1,s.f)return;s.done=!0;const i=null==(t=n.node)?void 0:t.previousSibling;null!=s.hold&&i&&i.textContent===s.pv&&(i.textContent=s.vt=s.hold),null==(e=n.node)||e.remove(),n.node=null};if(!e)return s.lf=s.f,ks(n),void a();s.run=!0,t._tween(e.delayMs,e.speed,t=>{s.lf=jn(r,s.f,t),ks(n)},a,void 0,e.el)}(t,T?l(o({},$),{el:i}):null);if(!R&&!O)return;const I=null!=y?e._arcEnd(y):D,B=b,z=R?I:B;let W=B,H=z;P?H="baseline"===S.enter?D:B:T?(W=null!=(r=null==g?void 0:g.we)?r:Hn(f.prevEndAngle)?f.prevEndAngle:B,H=null!=(a=null==g?void 0:g.e)?a:"baseline"===S.enter?D:W):N&&(W=H=D);const j=R?null!=(u=null==(h=null==(c=S.radialBar)?void 0:c.lanes)?void 0:h.opacity)?u:xs:1,Y=P?1:T?g?g.f:1:j,q=P?e.getStrokeWidth({size:L.circleGeometry.r,series:k.seriesData.series}):Number(F.getAttribute("stroke-width")),X=F.getAttribute("stroke-opacity"),G=t=>{var e;const i=new _(k).drawPath({d:"",stroke:n.paint,strokeWidth:q,fill:"none",strokeOpacity:qn(F,"stroke-opacity"),strokeDashArray:null!=(e=F.getAttribute("stroke-dasharray"))?e:0,classes:`${_s} ${t}`});return i.node.setAttribute("aria-hidden","true"),Zn(F,i.node),i},U=G("apexcharts-radialbar-highlight-whole"),K=G("apexcharts-radialbar-highlight-part");Qn(F,U.node),Qn(U.node,K.node),U.node.setAttribute("pointer-events","none"),R&&I-B>.01?Vn(F,K.node):K.node.setAttribute("pointer-events","none");null!=y&&(y>(null!=x?x:0)||y>("number"==typeof C.max?C.max:100))&&Jn(K.node,"apexcharts-highlight-overflow");const V=k.seriesData.series.length,Z=function(t){var e,i;if(t._hfTracks)return t._hfTracks;const n=(t,e)=>{var i;return` ${null==(i=t.getAttribute)?void 0:i.call(t,"class")} `.includes(` ${e} `)},s=[...(null==(i=null==(e=t.w.dom.Paper)?void 0:e.node)?void 0:i.childNodes)||[]];let r=[];for(let t=s.length-1;t>=0&&!r.length;t--){const e=[...s[t].childNodes||[]].find(t=>n(t,"apexcharts-tracks"));e&&(r=[...e.childNodes].map(t=>[...t.childNodes].find(t=>n(t,"apexcharts-radialbar-area"))))}return t._hfTracks=r}(e)[C.inverseOrder?V-1-p:p],Q=Z&&[Z.getAttribute("d"),Z.getAttribute("stroke-width")],J=Q?(parseFloat(Q[1])||0)/(q||1):0;let tt=null;if(Z){tt=new _(k).drawPath({d:"",stroke:Z.getAttribute("stroke"),strokeWidth:0,fill:"none",strokeOpacity:null!=(d=Z.getAttribute("stroke-opacity"))?d:1,classes:`${In} apexcharts-radialbar-highlight-track`});const t=Z.getAttribute("filter");t&&tt.node.setAttribute("filter",t),tt.node.setAttribute("pointer-events","none"),tt.node.setAttribute("aria-hidden","true"),Qn(Z,tt.node)}const et=M-q/2,it=M+q/2,nt=V<2,st=nt?Math.max(2,.12*q):Math.max(1,Math.min(.08*q,e.margin/3)),rt=nt?0:Math.max(0,(3*st-e.margin)/2),at=Math.max(.5,(q-st)/2-rt),ot=(t,i)=>{const n=t-D;return n>.01?e.getPiePath({me:e,startAngle:D,angle:n===e.fullAngle?e.fullAngle-.01:n,size:i}):""},lt=t=>{const i=e.trackStartAngle;let n=e.trackEndAngle;Math.abs(n)+Math.abs(i)>=360&&(n=360-Math.abs(e.startAngle)-.1);const s=n<i?e.fullAngle+n-i:n-i;return e.getPiePath({me:e,startAngle:i,angle:s===e.fullAngle?s-.01:s,size:t})},ct=(t,e,i)=>{t.setAttribute("d",e),t.setAttribute("stroke-width",String(i))},ht={d:null,c:!E,f:j,cx:f?f.centerX:L.circleGeometry.cx,cy:f?f.centerY:L.circleGeometry.cy};t._targets.set(gs+p,ht);const ut=(t,e,i)=>{ht.s=t,ht.we=e,ht.e=i;const n=it-rt*t,s=et+t*(it-rt-at-et),r=et+rt*t,a=r+t*at;ht.mid=(s+a)/2,ct(U.node,ot(e,(s+n)/2),n-s),ct(K.node,a>r?ot(i,(r+a)/2):"",a-r),Z&&(t?(ct(Z,lt((s+n)/2),(n-s)*J),ct(tt.node,lt((r+a)/2),(a-r)*J)):(ct(Z,Q[0],Q[1]),ct(tt.node,"",0)))},dt=[U.node,K.node,null==tt?void 0:tt.node].filter(Boolean);let pt=!P;const ft=()=>{pt=!0,F.setAttribute("stroke-opacity","0"),dt.forEach(t=>t.removeAttribute("opacity"))};pt?ft():dt.forEach(t=>t.setAttribute("opacity","0"));ut(O,W,H);let gt=!1;(T||N)&&U.animate($.speed,$.delayMs).during(t=>{gt||(pt||ft(),ut(jn(O,R,t),jn(W,B,t),jn(H,z,t)))});if(t._fade(U.node,{f:Y,o:0},{f:j,o:0},l(o({},$),{el:U}),{attr:"stroke-opacity",anim:T,force:T,done:R?void 0:()=>{gt=!0,dt.forEach(t=>t.remove()),Z&&ct(Z,Q[0],Q[1]),null==X?F.removeAttribute("stroke-opacity"):F.setAttribute("stroke-opacity",X),ht.s=0},rec:ht}),mt.isBrowser()){const e=e=>{t._lane=[p,ws(F,e,ht)]};["mouseover","mousemove","mousedown","touchstart","touchmove"].forEach(t=>F.addEventListener(t,e,!0))}}(t,e,i,{i:b,c:n,prev:L,mount:M,pv:T,whole:R,wholeEnd:O,run:$,anim:I,delayMs:B,size:j,paint:P}),void(0===b&&Ss(t,e,i,!1,T,M,A,n));const Y=W&&null!=T?e._arcEnd(T):null,q=null!=Y&&Y-N>.01,X=null!=(h=null==L?void 0:L.e)?h:null,G=!q&&null!=X&&I,U=G&&!W,K=q?Y:G?U?O:N:null;let V=K,Z=!1;null!=K&&I&&!M&&(null!=X?V=X:L||"baseline"===g.enter?V=N:(Z=!0,V=Hn(n.prevEndAngle)?n.prevEndAngle:O));const Q=t=>{const i=t-N;return e.getPiePath({me:e,startAngle:N,angle:i===e.fullAngle?e.fullAngle-.01:i,size:j})};let J=null;if(null!=K&&P){J=new _(p).drawPath({d:"",stroke:P,strokeWidth:A?e.getStrokeWidth({size:f.circleGeometry.r,series:p.seriesData.series}):Number(x.getAttribute("stroke-width")),fill:"none",strokeOpacity:qn(x,"stroke-opacity"),strokeDashArray:null!=(u=x.getAttribute("stroke-dasharray"))?u:0,classes:`${In} apexcharts-radialbar-highlight-part`});const t=J.node;t.setAttribute("aria-hidden","true"),Qn(x,t),q&&T>("number"==typeof S.max?S.max:100)&&Jn(t,"apexcharts-highlight-overflow"),Zn(x,t),q&&Y-O>.01?Vn(x,t):t.setAttribute("pointer-events","none"),n&&I&&!M?(t.setAttribute("d",Q(V)),s.call(e,J,l(o({},n),{endAngle:K,prevStartAngle:N,prevEndAngle:V,isTrack:!0}))):n?s.call(e,J,l(o({},n),{endAngle:K,dur:$,isTrack:!0})):t.setAttribute("d",Q(K))}const tt=q&&Y-O>.01?.75:0,et=M?tt:null!=(d=null==L?void 0:L.tk)?d:0;let it=null;if(J&&(tt||et&&I)){const t=Number(J.node.getAttribute("stroke-width"))||0,e=n?n.centerX:f.circleGeometry.cx,i=n?n.centerY:f.circleGeometry.cy;it=new _(p).drawPath({d:"",fill:"none",stroke:"#fff",strokeWidth:1,strokeDashArray:3,classes:`${In} apexcharts-highlight-edge apexcharts-radialbar-highlight-edge`});const s=it.node;s.setAttribute("pointer-events","none"),s.setAttribute("aria-hidden","true"),s.setAttribute("stroke-opacity",String(et)),Qn(J.node,s);const r=n=>{const r=v.polarToCartesian(e,i,j-t/2,n),a=v.polarToCartesian(e,i,j+t/2,n);s.setAttribute("d",`M ${r.x} ${r.y} L ${a.x} ${a.y}`)},a=I?Hn(n.prevEndAngle)&&!M?n.prevEndAngle:N:O;r(a),a!==O&&it.animate($,B).during(t=>r(jn(a,O,t)))}const nt=[];J&&A&&nt.push(J.node),it&&A&&nt.push(it.node);const st={d:null,e:null,f:W?z:1,c:!y};if(P&&(y||L)){t._targets.set(w,st);const e=null!=V?V:0,s=null!=K?K:0;J&&(st.e=s),J&&n&&I&&!M&&e!==s&&(st.e=e,J.animate($,B).during(t=>null!=st.e&&(st.e=jn(e,s,t))));const r=p.config.chart.animations.dynamicAnimation.speed;t._fade(x,M&&!A?W?H:Bn:Z?zn:L?{f:L.f,o:0}:Bn,U?zn:W?H:Bn,A?{delayMs:t.ctx.morphTypeChange.getSpeed(),speed:r}:{delayMs:B,speed:$,el:i},{attr:"stroke-opacity",anim:A?mt.isBrowser():I,force:!!J&&(A||e!==s||et!==tt),also:t=>{it&&(st.tk=jn(et,tt,t),it.node.setAttribute("stroke-opacity",String(st.tk))),nt.forEach(e=>t<1?e.setAttribute("opacity",t):e.removeAttribute("opacity"))},land:U?Bn:void 0,done:G||it&&!tt?()=>{G&&(null==J||J.remove(),st.e=null),null==it||it.remove(),st.tk=0}:void 0,rec:st}),J&&(st.n=J.node)}0===b&&Ss(t,e,i,D,T,M,A,n)}function ws(t,e,i){var n,s;const r=(null==(n=e.touches)?void 0:n[0])||e,a=null==(s=t.getScreenCTM)?void 0:s.call(t);if(!(a&&i.s>0))return"part";const o=r.clientX-a.e,l=r.clientY-a.f,c=a.a*a.d-a.b*a.c||1,h=(a.d*o-a.c*l)/c,u=(a.a*l-a.b*o)/c;return Math.hypot(h-i.cx,u-i.cy)>i.mid?"whole":"part"}function As(t,e,i,n,s){var r,a,o;const l=t.w,c=l.globals;if("lanes"!==t._ind)return;const h=l.highlightData.active;let u=e._hfLine;if(!u){const n=!c.dataChanged||!c.shouldAnimate,s=n||null==(r=t._prev())?void 0:r.get("r:w"),o=h?Ls(t,i,-1):"",l=o?1:0,d=n||!mt.isBrowser()?l:null!=(a=null==s?void 0:s.f)?a:0;if(u=e._hfLine={node:null,rec:null},!l&&!d)return;u.rec={d:null,c:!h,t:o||(null==s?void 0:s.t)||"",f:l,lf:d,o0:d,pv:l?null:null==s?void 0:s.vt},t._targets.set("r:w",u.rec)}const d=u.rec;if(s){if(u.node=null,!d||!d.lf&&d.done)return;const e=s.node.childNodes,n=i.value.show?e[e.length-1]:null;if(!n)return;null==d.pv||d.done||(d.hold=n.textContent,n.textContent=d.pv),d.vt=n.textContent;const r=Ms(l,i,n,(h?Ls(t,i,-1):"")||d.t);s.add(r),u.node=r.node}else if(h){const e=Ls(t,i,n),s=null==(o=l.dom.baseEl)?void 0:o.querySelector(".apexcharts-datalabel-value");!u.node&&e&&n>-1&&s&&(u.node=Ms(l,i,s,e).node,s.parentNode.appendChild(u.node)),u.node&&(u.node.textContent=e),d&&s&&(d.vt=s.textContent)}ks(u)}function Ms(t,e,i,n){const s=parseFloat(e.value.fontSize)||14,r=Math.max(11,Math.round(s/2)),a=new _(t).drawText({x:+i.getAttribute("x"),y:+i.getAttribute("y")+s/4+4+.8*r,text:n,textAnchor:"middle",fontSize:r+"px",fontFamily:e.value.fontFamily,fontWeight:400,foreColor:i.getAttribute("fill"),cssClass:"apexcharts-datalabel-whole"});return a.node.setAttribute("aria-hidden","true"),a}function ks(t){var e,i,n;null==(n=t.node)||n.setAttribute("fill-opacity",String(.6*(null!=(i=null==(e=t.rec)?void 0:e.lf)?i:1)))}function Ls(t,e,i){var n,s;const r=t.w,a=t.cfg.dataLabels||{},c=r.seriesData.series,h=r.highlightData.parts.map(t=>t[0]),u=i>-1?i:c.length<2?0:-1,d=(t,e)=>{const i=String(t(e)),n=String(t(l(o({},e),{lane:"whole"})));return n!==i?n:"/ "+i};if(u>-1)return"part"===(null!=(n=a.value)?n:"part")&&Hn(h[u])?d(t=>e.value.formatter(c[u],r,t),{highlight:Gn(h[u],c[u])}):"";if(!e.total.show||"part"!==(null!=(s=a.total)?s:"part")||!e.total.formatter||!h.some(Hn))return"";const p=t=>t.reduce((t,e)=>t+(Hn(e)?e:0),0);return d(t=>e.total.formatter(r,t),{highlight:Gn(p(h),p(c))})}function Ss(t,e,i,n,s,r,a,o){var l,c,h;const u=t.w,d=u.globals,p=t.cfg,f=u.highlightData.active,g=r||null==(l=t._prev())?void 0:l.get("r:n"),m=n&&null!=s?e._angleAtValue(s):null;if(null==m&&!g)return;const y=u.config.plotOptions.radialBar,x=a?null:"needle"===y.shape?e.needleMotion():o&&o.run>0&&mt.isBrowser()?{speed:o.run,delay:+o.animBeginArr[0]||0}:null;let b,v=1,w=m,A=1;const M=null==m;if(M){if(!x)return;b=g.ang,v=g.op,w=f&&n?e.startAngle:e._angleAtValue(u.seriesData.series[0]),A=0}else x?r?b=e.startAngle:g?(b=g.ang,v=g.op):(b=e._angleAtValue(d.dataChanged?d.previousPaths[0]:u.seriesData.series[0]),v=0):b=w;const k=d.circleGeometry,L=(null==(c=p.radialBar)?void 0:c.needle)||{},S=y.needle||{},C={};ys.forEach(t=>{var e;return C[t]=null!=(e=L[t])?e:S[t]});const E=null!=(h=L.color)?h:d.colors[0],{path:F,cx:P,cy:D}=e.needlePath({size:k.r,centerX:k.cx,centerY:k.cy,series:u.seriesData.series},C),R=new _(u),T=R.group({class:"apexcharts-gauge-needle-highlight"});M||!mt.isBrowser()?T.node.setAttribute("pointer-events","none"):Vn(i.node,T.node),T.node.setAttribute("aria-hidden","true"),T.node.setAttribute("transform-origin",`${P} ${D}`),T.add(R.drawPath({d:F,stroke:E,strokeWidth:0,fill:E,classes:`${In} apexcharts-gauge-needle-highlight-shape`})),null!=s&&s>("number"==typeof y.max?y.max:100)&&Jn(T.node,"apexcharts-highlight-overflow");const N=i.node.parentNode.parentNode;N.insertBefore(T.node,N.childNodes[0]||null);const O=()=>{const t=[...N.childNodes].filter(t=>t!==T.node),e=t.findIndex(t=>{var e;return` ${null==(e=t.getAttribute)?void 0:e.call(t,"class")} `.includes(" apexcharts-radialbar-hollow ")});return!(e<0||T.node.parentNode!==N)&&(N.insertBefore(T.node,t[e+1]||null),!0)};O()||Promise.resolve().then(O);const $={d:null,ang:b,op:v,c:!f};t._targets.set("r:n",$);const I=(t,e)=>{$.ang=t,$.op=e,T.node.setAttribute("transform",`rotate(${t})`),e<1?T.node.setAttribute("opacity",String(e)):T.node.removeAttribute("opacity")},B=t=>I(b+(w-b)*t,jn(v,A,t)),z=()=>{$.run=!1,M?T.remove():I(w,A)};if(a)return I(w,0),void t._tween(t.ctx.morphTypeChange.getSpeed(),u.config.chart.animations.dynamicAnimation.speed,t=>I(w,t),z);if(!x||b===w&&v===A)return B(1),void z();$.run=!0,B(0);const W=x;if(W.ease){const i=performance.now(),n=s=>{if(d.isDestroyed||t._render!==e)return;const r=Math.max(0,Math.min(1,(s-i)/W.speed));B(W.ease(r)),r<1?yt.requestAnimationFrame(n):z()};yt.requestAnimationFrame(n)}else T.animate(W.speed,W.delay||0).during(t=>B(t)).after(z)}const Cs="apexcharts-highlight-tile",Es="apexcharts-highlight-overflow",Fs=/^url\(/i;function Ps(t,e){var i,n,s;const r=t.w,a=r.globals,l=r.highlightData;if(!l)return;t._beginRender(e,"t:"),t._tmDefs.forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)}),t._tmDefs=[];const c=t._tiles=new Map,h=l.active,u=r.seriesData.series;!function(t,e,i){const n=s=>{var r,a;const o=s.children;if(!o||!o.length){const t=null==(r=null==e?void 0:e[s._si])?void 0:r[s._di];return s.highlight=e?Gn(Hn(t)?t:null,null==(a=i[s._si])?void 0:a[s._di]):void 0,s.highlight}let l=null;if(o.forEach(t=>{const e=n(t);!e||null==e.value||e.value*(e.total||0)<0||(l=(l||0)+Math.abs(e.value))}),!e)return s.highlight=void 0;const c=t._subtreeArea(s),h=null!=l&&c?l/c:null;return s.highlight={value:l,total:c,share:h,overflow:null!=h&&h>1},s.highlight};(t.roots||[]).forEach(n)}(e,h?l.parts:null,u);const d=t._prev();if(!h&&!(null==d?void 0:d.size))return;const p=new Map;null==d||d.forEach(t=>p.set(t.ij,t)),null==(i=a.prevTreemapView)||i.querySelectorAll(`.${Cs}`).forEach(t=>{t.classList.remove(Cs,Es),t.removeAttribute("data:hl-share")});const f=t.cfg,g=h?null!=(n=f.fadeOpacity)?n:.2:1,m=!0===(null==(s=t.ctx.morphTypeChange)?void 0:s.isActive()),y=e.dynamicAnim,x=m||!!(a.dataChanged&&y.enabled&&a.shouldAnimate),b=m?t.ctx.morphTypeChange.getSpeed():y.speed,v=r.config.chart.foreColor;let w=!1;h&&function(t,e){const i=e._showParentTooltip;e._showParentTooltip=(n,s)=>{var r,a,o;i.call(e,n,s);const l=s.highlight,c=t.cfg.tooltip||{};if(null==(null==l?void 0:l.value)||!1===c.show||"function"==typeof(null==(a=null==(r=t.w.config.plotOptions.treemap.parents)?void 0:r.tooltip)?void 0:a.formatter))return;const h=null==(o=e._tip())?void 0:o.querySelector(".apexcharts-tooltip-text-y-value");if(!h)return;let u=`/ ${e._formatValue(l.total)}`;c.share&&l.total&&(u+=` \xb7 ${Math.round(100*l.share)}%`),h.innerHTML=`${e._formatValue(l.value)} <span class="apexcharts-highlight-total" style="font-weight: 400; opacity: 0.6">${u}</span>`}}(t,e);let A=null;const M=e.helpers.calculateDataLabels;e.helpers.calculateDataLabels=t=>{const i=M.call(e.helpers,t),n=A=c.get(t.i+"|"+t.j);if(i&&n){const t=function(t){const e=[];return function t(i){"text"===String(i.tagName||i.nodeName).toLowerCase()&&e.push(i),Array.from(i.childNodes||[]).forEach(t)}(t),e}(i.node);n.lb=t.filter(t=>/^(#fff|#ffffff|white)$/i.test(t.getAttribute("fill")||""));const e=t[0],[,s,,r]=n.r;if(e&&r>s){const t=parseFloat(e.getAttribute("font-size"))||12;n.need=(r-parseFloat(e.getAttribute("y"))+.9*t)/(r-s)}Ds(n,v)}return i};const k=e.rotateToFitLabel;return e.rotateToFitLabel=(...t)=>{k.apply(e,t);const i=A;if(A=null,(null==i?void 0:i.lb)&&/rotate/.test(t[0].node.getAttribute("transform")||"")){const e=new _(r).getTextRects(t[2],String(t[1])).width;i.need=.5+e/2/(t[6]-t[4]),i.tone=null,Ds(i,v)}},(e,i,n,s,y)=>{var _,A,M,k;const L="t:"+y._key,S=i+"|"+n,C=null==(_=u[i])?void 0:_[n],E=x?(null==d?void 0:d.get(L))||(C?void 0:p.get(S)):void 0;if(!h&&!E)return;if(Fs.test(s))return void(h&&!w&&(w=!0,t._warn("fill","treemap tiles with a gradient, pattern or image fill are drawn without their parts.")));const F=h?null==(A=l.parts[i])?void 0:A[n]:null;if(!C&&!E)return;const P=Hn(F)&&C?F/C:null;let D=h?{s:null==P||P<0?0:Math.min(P,1),f:g,c:s}:{s:1,f:0,c:s},R=D;if(E)R={s:E.s,f:E.f,c:E.col},!C&&h&&(D=o({},R));else if(x){const t=null==(M=a.previousPaths[i])?void 0:M[n];(m||(null==(k=null==t?void 0:t.rect)?void 0:k.width)>0)&&(R="baseline"===f.enter?{s:0,f:1,c:D.c}:{s:1,f:0,c:D.c},m||!t.fill||Fs.test(t.fill)||(R.c=t.fill))}const T=R.s!==D.s||R.f!==D.f||R.c!==D.c;if(!h&&!T)return;const N=r.dom.Paper.gradient("linear",t=>{for(let e=0;e<4;e++)t.stop(0,s,1)});N.from(0,1).to(0,0),t._tmDefs.push(N.node);const O=Array.from(N.node.childNodes),$=e.node;h&&($.setAttribute("class",`${$.getAttribute("class")||""} ${Cs}${null!=P&&P>1?" "+Es:""}`.trim()),$.setAttribute("data:hl-share",null==P?"":String(P)));const I={s:D.s,f:D.f,col:D.c,c:!h,ij:S,run:!1,base:s,r:y.rect,lb:null,need:.5,tone:null};t._targets.set(L,I),c.set(S,I);const B=function(t,e){const i=Rs(t),n=Rs(e);return t!==e&&i&&n?t=>t>=1?e:`rgba(${[0,1,2].map(e=>Math.round(jn(i[e],n[e],t))).join(",")},${+jn(i[3],n[3],t).toFixed(3)})`:i=>i>=1?e:t}(R.c,D.c),z=t=>{I.ls=t.s,I.lf=t.f,I.lc=t.c,O.forEach((e,i)=>{e.setAttribute("offset",String(0===i?0:3===i?1:t.s)),e.setAttribute("stop-color",t.c),e.setAttribute("stop-opacity",String(i<2?1:t.f))}),Ds(I,v)},W=()=>{var t;I.run=!1,z(D),!h&&$.isConnected&&($.setAttribute("fill",s),null==(t=N.node.parentNode)||t.removeChild(N.node))};if(x&&T){I.run=!0,z(R);let e=null,i=!1;const n={finish(){t._live.delete(n),h?z({s:I.ls,f:e=D.f,c:I.lc}):(i=!0,W())}};t._hold(n),N.animate(b,0).during(t=>i||z({s:jn(R.s,D.s,t),f:null!=e?e:jn(R.f,D.f,t),c:B(t)})).after(()=>{t._live.delete(n),i||W()})}else z(D);return N.url()}}function Ds(t,e){var i;const n=(null!=(i=t.ls)?i:t.s)>=t.need-1e-9;t.lb&&t.tone!==n&&(t.tone=n,t.lb.forEach(t=>{null==t._apxFill&&(t._apxFill=t.getAttribute("fill")),t.setAttribute("fill",n?t._apxFill:e)}))}function Rs(t){var e;const i=String(t).trim();let n=/^#([\da-f]+)$/i.exec(i);if(n){let t=n[1];return t.length<5&&(t=t.replace(/./g,"$&$&")),6!==t.length&&8!==t.length?null:[0,2,4,6].map(e=>e<t.length?parseInt(t.slice(e,e+2),16)/(6===e?255:1):1)}if(n=/^rgba?\(([^)]*)\)$/i.exec(i),!n)return null;const s=n[1].split(/[\s,/]+/).filter(Boolean).map(parseFloat);return s.length>=3&&s.every(isFinite)?[s[0],s[1],s[2],null!=(e=s[3])?e:1]:null}["prevHighlightParts","prevHighlightLabels"].forEach(t=>{-1===b.HELD.indexOf(t)&&b.HELD.push(t)});const Ts="apexcharts-flip-x",Ns="apexcharts-flip-y",Os="apexcharts-flip-held",$s="apexcharts-highlight-label-exit",Is="b:",Bs={f:1,o:0},zs={f:1,o:1},Ws={f:0,o:1};function Hs(t){if(!t)return!1;if(Array.isArray(t.highlightData))return!0;const e=t.data;if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++){const i=e[t];if(Yn(i)){if("highlight"in i)return!0}else if(null!=i)return!1}return!1}function js(t,e,i){return Yn(t)&&"highlight"in t?t.highlight:e?e[i]:null}function Ys(t,e){let i=1/0,n=-1/0;return String(t).replace(/([MLQCT])([^MLQCTZz]*)/g,(t,s,r)=>{const a=r.trim().split(/[\s,]+/).filter(Boolean).map(Number);for(let t=e;t<a.length;t+=2)a[t]<i&&(i=a[t]),a[t]>n&&(n=a[t]);return""}),[i,n]}function qs(t,e){let i=-1,n=1/0;return t.forEach((t,s)=>{null!=t&&Math.abs(t-e)<n&&(n=Math.abs(t-e),i=s)}),i}function Xs(t){const e=t.previousElementSibling;return e&&"rect"===e.tagName.toLowerCase()?[e,t]:[t]}function Gs(t,e){return null!=e&&0!==e&&t/e>1}function Us(t,e){const i=Yn(t)?t.y:Array.isArray(t)?t[1]:t;return"number"==typeof i?i:null!=e?e:null}function Ks(t,e,i){return t?t.replace(/([MLQCT])([^MLQCTZz]*)/g,(t,i,n)=>{const s=n.trim().split(/[\s,]+/).filter(Boolean).map(Number);for(let t=0;t+1<s.length;t+=2)s[t]=e(s[t]);return`${i} ${s.join(" ")} `}):t}g.default.registerFeatures({highlightFilter:class{constructor(t,e){var i,n,s,r;this.w=t,this.ctx=e,this._targets=new Map,this._render=null,this._seen=new Set,this._seriesEls=new Map,this._cu=null,this._stk=new Map,this._stkPrev=[],this._br=null,this._held=!1,this._warned=new Set,this._rows=[],this._level=null,this._live=new Set,this._sig="",this._drawnSig="",this._ride=null,this._tiles=null,this._tmDefs=[],this._tipUser=null==(n=null==(i=e.opts)?void 0:i.tooltip)?void 0:n.enabled,this._tipOn=!1,this._ind=void 0,this._lane=null,this._onRender=()=>this.afterRender(),null==(s=e.events)||s.addEventListener("mounted",this._onRender),null==(r=e.events)||r.addEventListener("updated",this._onRender)}get cfg(){return this.w.config.highlightFilter||{}}isActive(){var t;return!!(null==(t=this.w.highlightData)?void 0:t.active)}canDrawParts(){const t=this.w,e=t.config,i=e.chart.type;return t.globals.axisCharts?!(t.globals.comboCharts||"bar"!==i&&"line"!==i&&"area"!==i&&"treemap"!==i||t.rangeData.seriesRange.length||"histogram"===e.chart.requestedType):cs.indexOf(i)>-1||"radialBar"===i}callerCarriesParts(){const t=this.w;return t.globals.axisCharts?(t.config.series||[]).some(Hs):Array.isArray(this.cfg.data)||is(t.config.series||[]).some(t=>"highlight"in t)}valueAt(t,e){var i,n,s;const r=null==(s=null==(n=null==(i=this.w.highlightData)?void 0:i.parts)?void 0:n[t])?void 0:s[this.w.globals.axisCharts?e:0];return null==r?null:r}_warn(t,e){this._warned.has(t)||(this._warned.add(t),console.warn("ApexCharts highlightFilter: "+e))}parse(){var t,e,i;const n=this.w,s=n.config,r=this.cfg,a=s.series||[],o=n.seriesData.series||[];if(!n.globals.axisCharts)return this._parseCircle();const l=!!s.chart.stacked,c=s.chart.type,h="bar"===c,u=function(t,e){const i=t.w.globals;if("treemap"!==e||!i.treemapRoots)return!1;const n=i.treemapRawSeries||[];n.some(t=>Array.isArray(null==t?void 0:t.highlightData))&&t._warn("nested","on a nested treemap put the part on each leaf as { x, y, highlight }; highlightData is ignored.");const s=t=>Yn(t)&&Array.isArray(t.children)&&t.children.length>0&&("highlight"in t||t.children.some(s));return n.some(t=>((null==t?void 0:t.data)||[]).some(s))&&t._warn("parent","a parent's highlight is ignored: parents add up their leaves' parts."),!0}(this,c),d=as(n);let p=!1;for(let e=0;e<a.length;e++)if(u?ns({data:null==(t=a[e])?void 0:t.data}):Hs(a[e])||d&&os(n,e)){p=!0;break}let f=n.globals.axisCharts&&this.canDrawParts();p&&!f&&this._unsupported();const g=(n.globals.seriesYAxisMap||[]).map((t,e)=>t&&t.length?e:-1).filter(t=>t>-1);p&&f&&l&&(g.length>1||g.some(t=>{var e;return null==(e=s.yaxis[t])?void 0:e.logarithmic}))&&(f=!1,this._warn("stack","parts are not drawn on a stacked chart with more than one y axis or a logarithmic y axis."));const m=!(!1===r.enabled||!p||!f);if(!m)return void this._inactive(f);const y=[];let x=!1,_=!1;const b=n.globals;for(let t=0;t<o.length;t++){const e=a[t]||{},i=Array.isArray(e.data)?e.data:[],s=!u&&Array.isArray(e.highlightData),r=u?null:s?e.highlightData:d?os(n,t):null,l=b.collapsedSeriesIndices.indexOf(t)>-1||b.ancillaryCollapsedSeriesIndices.indexOf(t)>-1;r&&!l&&r.length!==i.length&&(s?x=!0:_=!0);const c=[],h=o[t]?o[t].length:0;for(let t=0;t<h;t++){const e=js(i[t],r,t);c.push(Hn(e)?l?0:e:null)}y.push(c)}m&&x&&this._warn("length","highlightData and data differ in length; the extra entries are ignored and the missing ones read as null."),m&&_&&this._warn("plugged-length","a plugin registered highlight parts that do not line up with the series data; the extra entries are ignored and the missing ones read as null.");const v=a.some(t=>Array.isArray(null==t?void 0:t.highlightData));v&&(null==(e=s.chart.dataReducer)?void 0:e.enabled)&&this._warn("reducer","highlightData cannot follow chart.dataReducer; put the part on each point as { x, y, highlight } instead."),v&&(null==(i=s.chart.streaming)?void 0:i.enabled)&&this._warn("stream","highlightData cannot follow chart.streaming; put the part on each point as { x, y, highlight } instead.");const w=m&&"clamp"!==r.axis&&"treemap"!==c&&!s.plotOptions.bar.isFunnel&&!(l&&"100%"===s.chart.stackType);let A=null;if(l&&h)A=(t,e)=>this._barKey(t,e);else if(l){const t=n.seriesData.seriesX;A=(e,i)=>{var s;return String(n.axisFlags.isXNumeric?null==(s=t[e])?void 0:s[i]:i)}}const M=w?this._runningExt(y,A,h):null;this._publish(y,M)}_unsupported(){const t=this.w.config.chart;this._warn("type",`parts are not drawn on this chart (type "${t.requestedType||t.type}"). Supported: column, bar, line and area (stacked too), funnel, pie, donut, polarArea, radialBar, gauge and treemap.`)}_inactive(t){t||(this._targets=new Map),this.w.highlightData={active:!1,parts:[],ext:null,capture:()=>this.capture()},this._sig="",this._rows=[]}_parseCircle(){const t=this.w,e=t.config,i=this.cfg,n=t.globals,s=(t.seriesData.series||[]).length,r=is(e.series);let a=r.some(t=>"highlight"in t);a&&r.length!==s&&(this._warn("points","per-point highlight values do not line up with the slices; use highlightFilter.data instead."),a=!1);let o=Array.isArray(i.data)?i.data:null;o&&o.length!==s&&(this._warn("length",`highlightFilter.data has ${o.length} values for ${s} slices; it is ignored until they match.`),o=null),o&&o.some(t=>Array.isArray(t))&&(o.some(t=>Array.isArray(t)&&1!==t.length)?(this._warn("rows","highlightFilter.data takes one value per slice (or ring); a row of several values is ignored."),o=null):o=o.map(t=>Array.isArray(t)?t[0]:t));const l=e.chart.type,c=cs.indexOf(l)>-1||"radialBar"===l,h=a||!!o;if(h&&!c&&this._unsupported(),!1===i.enabled||!h||!c)return void this._inactive(c);const u=[];for(let t=0;t<s;t++){const e=a?r[t]:null,i=e&&"highlight"in e?e.highlight:o?o[t]:null;u.push([Hn(i)?n.collapsedSeriesIndices.indexOf(t)>-1?0:i:null])}this._publish(u,null)}_publish(t,e){const i=this.w.globals;this.w.highlightData={active:!0,parts:t,ext:e,capture:()=>this.capture()};const n=this._rows,s=[];for(let e=0;e<t.length;e++){const r=i.collapsedSeriesIndices.indexOf(e)>-1||i.ancillaryCollapsedSeriesIndices.indexOf(e)>-1;s.push(r&&e<n.length?n[e]:t[e].join(","))}this._rows=s,this._sig="#"+s.join("|")}capture(){const t=this.w.globals,e=new Map;this._targets.forEach((t,i)=>{var n,s,r,a,c,h,u;if(t.c&&!t.run)return;const d=t.n,p=!!(null==d?void 0:d.isConnected);e.set(i,l(o({},t),{d:p&&d.getAttribute("d")||t.d,a:(null==(n=t.m)?void 0:n.isConnected)&&t.m.getAttribute("d")||t.a,flip:p?d.classList.contains(Ns)||d.classList.contains(Ts):t.flip,f:null!=(s=t.lf)?s:t.f,o:null!=(r=t.lo)?r:t.o,s:null!=(a=t.ls)?a:t.s,col:null!=(c=t.lc)?c:t.col,al:null!=(h=t.la)?h:t.al,k:null!=(u=t.lk)?u:t.k,n:null,m:null,g:null,lb:null}))}),t.prevHighlightParts=e,t.prevHighlightLabels=this._captureLabels(),this._targets=new Map}_prev(){return this.w.globals.prevHighlightParts}_animates(){const t=this.ctx.renderer;return(!t||!t.kind||"svg"===t.kind)&&this._animatesUpdate()&&!!this.w.globals.shouldAnimate}_animatesUpdate(){const t=this.w,e=t.config.chart.animations;return!(!(mt.isBrowser()&&e.enabled&&e.dynamicAnimation.enabled&&t.globals.dataChanged)||_t())}_tween(t,e,i,n,s,r){const a=this.w,o=s||function(t){var e,i;const n=t.config.chart.animations;return An(null!=(i=null==(e=n.dynamicAnimation)?void 0:e.easing)?i:n.easing)}(a),l=this._live;let c=!1;const h={finish(){c||(c=!0,l.delete(h),i(1),n&&n())}};this._hold(h);const u=performance.now()+t,d=t=>{if(c)return;if(a.globals.isDestroyed)return c=!0,void l.delete(h);const n=Math.max(0,Math.min(1,(t-u)/e));i(o(n)),n<1?yt.requestAnimationFrame(d):h.finish()};i(0),r?r.animate(e,t).during(t=>c||i(t)).after(()=>h.finish()):yt.requestAnimationFrame(d)}_hold(t){const e=this._live,i=this.w.globals;e.add(t),i.highlightTween={finish:()=>Array.from(e).forEach(t=>t.finish())}}bar(t,e){var i,n,s,r,a,l,c,h;const u=this.w,d=u.highlightData;if(!d)return;this._render!==t&&this._beginRender(t,Is);const p=this._prev(),f=d.active;if(!f&&!(null==p?void 0:p.size))return;const{j:g,realIndex:m}=e,y=Is+`${m}::${Dn(u,m,g)}`;this._seen.add(y);const x=null==p?void 0:p.get(y),_=f?null==(i=d.parts[m])?void 0:i[g]:null;if(!f&&!x)return;const b=this.cfg,v=f?null!=(n=b.fadeOpacity)?n:.2:1,w=null==(s=u.seriesData.series[m])?void 0:s[g],A=!!u.config.chart.stacked,M=f&&A?this._stackGeometry(t,e,_,w,x):null==_?null:this._barGeometry(t,e,_,w),k={paint:(i,n)=>this._paintBar(e,i,n,{key:y,prev:x,geo:M,fadeTo:v,active:f,whole:w,bar:A?t:null})};if(f){const t={};"part"===(null!=(a=null==(r=b.dataLabels)?void 0:r.value)?a:"part")&&Object.assign(t,null==_?{hide:!0}:o({val:null!=(l=null==M?void 0:M.val)?l:_},null==M?void 0:M.label)),A&&"part"===(null!=(h=null==(c=b.dataLabels)?void 0:c.total)?h:"part")&&(t.total=M.total(null!=t.val?t.val<0:w<0)),k.label=t}return k}_beginRender(t,e){var i;this._render=t,this._targets=new Map,this._seen=new Set,this._seriesEls=new Map,this._cu=new m(this.w),this._stk=new Map,this._stkPrev=[],this._br=null,this._held=!1,e===Is&&!this.w.config.chart.stacked&&(null==(i=this._prev())?void 0:i.size)&&Promise.resolve().then(()=>this._orphans())}_orphans(){const t=this.w,e=this._prev();e&&!t.globals.isDestroyed&&this._animates()&&e.forEach((e,i)=>{var n;if(this._seen.has(i)||0!==i.indexOf(Is))return;const s=i.slice(2),r=this._seriesEls.get(s.slice(0,s.indexOf("::")));if(!r)return;const a=Array.from(r.querySelectorAll(".apexcharts-bar-ghost")).find(t=>t.getAttribute("data:ghostKey")===s);if(!a)return;if(a.setAttribute("fill-opacity",String(e.f)),!e.d)return;const o=new _(t,this.ctx).drawPath({d:e.d,stroke:"none",strokeWidth:0,fill:Xn(a.getAttribute("fill"))[0],fillOpacity:null!=(n=e.al)?n:1,classes:`${In} apexcharts-highlight-ghost`}).node;o.setAttribute("pointer-events","none"),o.setAttribute("clip-path",a.getAttribute("clip-path")||""),a.after(o);const l=a.style.transformOrigin||"",c=/^(left|right)/.test(l),h=parseFloat(a.getAttribute("data:ghostEdge")||""),[u]=Ys(e.d,c?0:1),d=o.style;d.transformBox="fill-box",d.transformOrigin=isFinite(h)?c?h-u+"px 50%":`50% ${h-u}px`:l;const p=()=>{a.parentNode&&!t.globals.isDestroyed?(d.transform=a.style.transform,d.opacity=a.style.opacity,yt.requestAnimationFrame(p)):o.remove()};p()})}_barGeometry(t,e,i,n){const s=this.w,{j:r,realIndex:a,translationsIndex:o,paths:l}=e,c=t.barHelpers,h=c.getStrokeWidth(e.i,r,a);if(t.isFunnel){const t=n?Math.min(Math.abs(i/n),1):0,e=s.layout.gridWidth/2;return{pathTo:Ks(l.pathTo,i=>e+(i-e)*t),base:Ks(l.pathTo,()=>e),overflow:!1}}const u=s.config.yaxis[s.globals.seriesYAxisReverseMap[a]],d=(null==u?void 0:u.logarithmic)&&!s.globals.invalidLogScale&&this._cu?Math.max(0,this._cu.getLogValAtSeriesIndex(i,a)):i;if(t.isHorizontal){const t=e.zeroW,s=c.getXForValue(d,e.zeroW),o=this._rect(c,{a:l.barYPosition,len:l.barHeight,v1:t,v2:s,strokeWidth:h,realIndex:a,j:r,dir:d>=0?1:-1,horizontal:!0});return{pathTo:o.pathTo,base:o.base,overflow:Gs(i,n),label:{x:s,barWidth:Math.abs(s-t)}}}const p=e.zeroH,f=c.getYForValue(d,e.zeroH,o),g=this._rect(c,{a:l.barXPosition,len:l.barWidth,v1:p,v2:f,strokeWidth:h,realIndex:a,j:r,dir:d>=0?1:-1,horizontal:!1});return{pathTo:g.pathTo,base:g.base,overflow:Gs(i,n),label:{y:f,barHeight:Math.abs(f-p)}}}_rect(t,e){const i=((Array.isArray(e.strokeWidth)?e.strokeWidth[e.realIndex]:e.strokeWidth)||0)/2,n=e.v2-e.v1;if(Math.abs(n)<2*i){const s=e.v1+n/2,r=i*e.dir*(t.barCtx.isReversed?-1:1)*(e.horizontal?-1:1);e=l(o({},e),{v1:s+r,v2:s-r})}return t.barRect(e)}_stackGeometry(t,e,i,n,s){var r,a;const o=this.w,{j:l,realIndex:c,translationsIndex:h,paths:u}=e,d=t.barHelpers,p=t.isHorizontal,f=p?e.zeroW:e.zeroH;this._br||(this._br=d.createBorderRadiusArr(((null==(r=o.highlightData)?void 0:r.parts)||[]).map(t=>t.map(t=>null!=t?t:0))),v.isSafari()&&(this._br=this._br.map(t=>t.map(()=>"none"))));const g=this._br,m=this._barKey(c,l);let y=this._stk.get(m);y||(y={p:f,n:f,raw:0,any:!1},this._stk.set(m,y));const x="100%"===o.config.chart.stackType,_=o.seriesData.stackedSeriesTotals[l],b=null==i?null:x?_?100*i/_:0:i,w=null!=b?b:0,A=null!=b?b<0:null!=(null==s?void 0:s.s)?s.s<0:n<0,M=(t,e)=>p?d.getXForValue(t,e):d.getYForValue(t,e,h);let k=A?y.n:y.p,L=M(w,k);A?y.n=L:y.p=L,null!=i&&(y.raw+=i,y.any=!0);const S=y.raw,C=y.any,E={p:y.p,n:y.n};let F=!1;if(x){const t=M(100,f),e=M(-100,f),i=Math.min(t,e),n=Math.max(t,e),s=t=>Math.min(n,Math.max(i,t));F=s(L)!==L,k=s(k),L=s(L),E.p=s(E.p),E.n=s(E.n)}const P=d.arrBorderRadius;let D;d.arrBorderRadius=g;try{D=this._rect(d,{a:p?u.barYPosition:u.barXPosition,len:p?o.globals.barHeight:o.globals.barWidth,v1:k,v2:L,strokeWidth:p?d.getStrokeWidth(e.i,l,c):t.strokeWidth,realIndex:c,j:l,dir:A?-1:1,horizontal:p})}finally{d.arrBorderRadius=P}return{pathTo:null==i?null:D.pathTo,square:D.squarePathTo,base:D.base,flip:null!=i&&t.cornerFlip(null==(a=g[c])?void 0:a[l],w),s:A?-1:1,overflow:F,val:b,label:p?{x:L,barWidth:Math.abs(L-k)}:{y:L,barHeight:Math.abs(L-k)},total:t=>!!C&&{val:S,edge:t?E.n:E.p}}}_barKey(t,e){var i;const n=this.w;return n.labelData.seriesGroupIndex[t]+"|"+(!n.config.plotOptions.bar.horizontal&&n.axisFlags.isXNumeric?null==(i=n.seriesData.seriesX[t])?void 0:i[e]:e)}line(t,e,i,n,s,r,a){var c,h;const u=this.w,d=u.highlightData;if(!d||"line"!==e&&"area"!==e)return;this._render!==t&&this._beginRender(t,"l:");const p=this._prev(),f=d.active;if(!f&&!(null==p?void 0:p.size))return;const g="l:"+s,m=null==p?void 0:p.get(g);if(!f&&!m)return;const y=u.globals,x=this._animates(),_="area"===e,b=f&&d.parts[s]||[],v=b.some(t=>null!=t),w=f&&t._shapeOnly,A=(t,e)=>t&&(t._cmd?t._cmd[e]:t.node.getAttribute(e)),M=t.marks||[],k=_?M.find(t=>"none"!==A(t,"fill")):null,L=M.find(t=>t!==k),[S,C]=k&&u.config.chart.stacked?Xn(A(k,"fill")):[k&&A(k,"fill"),1],E=M.concat(_?M.filter(t=>t!==k&&!t._cmd).map(t=>t.node.nextElementSibling).filter(t=>/#forecastMask/.test((null==t?void 0:t.getAttribute("clip-path"))||"")).map(t=>({node:t})):[]),F=f&&!w&&(v||u.config.chart.stacked)?this._lineBuild(t,e,i,n,s,r,this._partRow(b,n,s)):null;let P=w?{d:a.linePaths.join(" "),a:a.areaPaths.join(" ")}:v?{d:F.linePaths.join(" "),a:F.areaPaths.join(" "),num:F.numericXY}:null;const D=!P&&!!(null==m?void 0:m.d)&&x,R=f&&x&&(D||P&&!(null==m?void 0:m.d)&&(m||"baseline"===this.cfg.enter))?this._lineBase(t,e,i,n,s,r,v?b:null):null;F&&u.config.chart.stacked&&(this._swap(t,()=>t._recordStackTops(s,F.yArrj)),this._stkPrev.push(F.yArrj)),D&&(P=f?R:{d:a.linePaths.join(" "),a:a.areaPaths.join(" ")});const T=D&&!f;let N=P;const O={};let $=null,I=!1;if(P&&x)if(null==m?void 0:m.d){if(N={d:m.d,a:m.a||P.a},!D)if($=function(t,e,i,n){var s;const r=t.globals,a=r.prevStreamFrame;if(!a||!r.dataChanged||!(null==(s=t.axisFlags)?void 0:s.isXNumeric))return null;const o=a.seriesX[e],l=a.seriesY[e],c=t.seriesData.seriesX[e],h=t.seriesData.series[e];if(!(o&&l&&c&&h))return null;if(o.length<3||c.length<3)return null;let u=-1;for(let t=0;t<o.length;t++)if(o[t]===c[0]){u=t;break}if(-1===u)return null;const d=Math.min(o.length-u,c.length);if(d<2)return null;const p=c.length-d;if(0===u&&0===p)return null;for(let t=0;t<d;t++){if(o[u+t]!==c[t])return null;const e=l[u+t],i=h[t];if(e!==i&&(null!=e||null!=i))return null}const f=a.xPixels[e],g=a.yPixels[e];if(!f||!g)return null;let m=-1,y=-1;for(let t=0;t<d;t++)null!=f[u+t]&&null!=g[u+t]&&null!=i[t]&&null!=n[t]&&(-1===m&&(m=t),y=t);if(-1===m||y<=m)return null;const x=i[m],_=i[y],b=f[u+m],v=f[u+y];if(Math.abs(_-x)<1e-6)return null;const w=(v-b)/(_-x),A=b-w*x;if(!isFinite(w)||!isFinite(A))return null;if(Math.abs(w-1)>.02)return null;if(Math.abs(A)<.5)return null;let M=m,k=m;for(let t=m;t<=y;t++){const e=n[t];null!=e&&null!=g[u+t]&&(e<n[M]&&(M=t),e>n[k]&&(k=t))}let L=1,S=0;const C=n[M],E=n[k];if(Math.abs(E-C)>1e-6?(L=(g[u+k]-g[u+M])/(E-C),S=g[u+M]-L*C):S=g[u+M]-C,!isFinite(L)||!isFinite(S)||L<.2||L>5)return null;const F=Math.floor((m+y)/2);if(F!==m&&F!==y&&null!=i[F]&&null!=f[u+F]){const t=w*i[F]+A;if(Math.abs(t-f[u+F])>1.5)return null;if(null!=n[F]&&null!=g[u+F]){const t=L*n[F]+S;if(Math.abs(t-g[u+F])>1.5)return null}}return r.streamScrolled=!0,{ax:w,bx:A,ay:L,by:S}}(u,s,a.xArrj,a.yArrj),$)N={d:$n(P.d,$),a:$n(P.a,$)};else{const t=F||a,i=Nn(u,{type:e,realIndex:s,pathFromLine:m.d,pathFromArea:m.a||"",linePaths:t.linePaths,areaPaths:t.areaPaths});(null==i?void 0:i.line)&&([N.d,O.d]=[i.line.from,i.line.toInterp]),(null==i?void 0:i.area)&&([N.a,O.a]=[i.area.from,i.area.toInterp])}}else R?N=R:(I=!0,N={d:(null==L?void 0:L.node.getAttribute("pathFrom"))||P.d,a:(null==k?void 0:k.node.getAttribute("pathFrom"))||P.a});let B=null,z=null,W=null;if(P){const i=this._partGroup(t.elSeries,"apexcharts-line-highlight"),r=P.num,a={i:n,j:"h",realIndex:s,delay:n,speed:u.config.chart.animations.dynamicAnimation.speed,cls:`apexcharts-${e} apexcharts-line-highlight-part`,chartType:e,clip:`url(#gridRectMask${y.cuid})`,scroll:!!$};if(k&&(B=this._emitPart(i,l(o({},a),{from:N.a,to:P.a,interp:O.a,paint:S,num:r&&{xs:r.xs,ys:r.ys,closeY:r.areaCloseY}}))),L){const e=l(o({},a),{from:N.d,to:P.d,interp:O.d,paint:"none",stroke:A(L,"stroke"),width:t.strokeWidth,num:r&&{xs:r.xs,ys:r.ys}});z=this._emitPart(i,e),null==z||z.attr("fill-rule","evenodd");const n=!L._cmd&&L.node.getAttribute("clip-path");if(z&&n&&n.indexOf("nonForecast")>-1){const t=u.config.forecastDataPoints;z.attr("clip-path",n),W=this._emitPart(i,l(o({},e),{j:"hf",clip:`url(#forecastMask${y.cuid})`})),null==W||W.attr({"fill-rule":"evenodd","stroke-dasharray":t.dashArray,"stroke-width":t.strokeWidth||void 0})}}const c=this.ctx.renderer;c&&c.kind&&"svg"!==c.kind||!u.config.chart.animations.enabled||y.resized||y.dataChanged||[z,_&&L].forEach(t=>{const e=t&&t.node.getAttribute("stroke-dasharray");!t||e&&"0"!==e||t.node.setAttribute("stroke-dasharray","none")})}const H={d:null,a:null,f:1,o:f?1:0,n:D?null==z?void 0:z.node:null,m:D?null==B?void 0:B.node:null,c:!f};this._targets.set(g,H);const j=I?C:(null==m?void 0:m.d)&&null!=(c=m.al)?c:1,Y=T?C:1;H.al=Y,this._fadeLine(e,E,I?Ws:m?{f:m.f,o:null!=(h=m.o)?h:0}:Bs,T?Ws:f?zs:Bs,{width:t.strokeWidth,also:B&&(j<1||Y<1)?t=>{const e=jn(j,Y,t);H.la=e,B.node.setAttribute("fill-opacity",String(e))}:void 0,force:!!B&&j!==Y,land:T?Bs:void 0,done:D?()=>{null==z||z.remove(),null==W||W.remove(),null==B||B.remove()}:void 0,rec:H,ease:$?An("linear"):void 0}),P&&!D&&Object.assign(H,{d:P.d,a:P.a,n:null==z?void 0:z.node,m:null==B?void 0:B.node}),this._lineLabels(t,e,n,s,b,F,a)}_partRow(t,e,i){const n=this.w,s=this._cu,r=n.config.yaxis[n.globals.seriesYAxisReverseMap[i]],a=(null==r?void 0:r.logarithmic)&&!n.globals.invalidLogScale?t.map(t=>s.getLogValAtSeriesIndex(t,i)):t.slice(),o=n.config.fill.type,l=a.length-1;return"gradient"!==o&&"gradient"!==o[e]||null==a[l]||!a.every(t=>t===a[0])||(a[l]+=1e-6),a}_lineBuild(t,e,i,n,s,r,a){const o=this.w.globals.pointsArray,l=o[s],c=l?l.length:0,h=[t._shapeOnly,t.appendPathFrom],u=i.slice();u[n]=a,t._shapeOnly=!0;try{const i=this._swap(t,()=>t._buildSeriesPaths(e,u,n,s,r));return i.S=u,i}finally{[t._shapeOnly,t.appendPathFrom]=h,l?l.length=c:delete o[s]}}_swap(t,e){if(!this.w.config.chart.stacked)return e();const i=[t.prevSeriesYByX,t.prevSeriesY];t.prevSeriesYByX=this._stk,t.prevSeriesY=this._stkPrev;try{return e()}finally{[t.prevSeriesYByX,t.prevSeriesY]=i}}_lineBase(t,e,i,n,s,r,a){const o=(a||i[n]).map(t=>null==t?null:0),l=this._lineBuild(t,e,i,n,s,r,o);return{d:l.linePaths.join(" "),a:l.areaPaths.join(" "),num:l.numericXY}}_fadeLine(t,e,i,n,s){var r,a,o,l,c,h,u;const d=this.cfg,p=null!=(r=d.fadeOpacity)?r:.2,f=null!=(o=null==(a=d.outline)?void 0:a.width)?o:1,g=null!=(c=null==(l=d.outline)?void 0:l.opacity)?c:1,m=null!=(u=null==(h=d.line)?void 0:h.dashArray)?u:4,y=s.rec,x=["fill-opacity","stroke-opacity","stroke-width","stroke-dasharray"],_=e.map(e=>{var i;const n=e.node,s=x.map(t=>n.getAttribute(t)),r=parseFloat(null!=(i=s[0])?i:"1");return{node:n,own:s,k:isFinite(r)?r:1,fill:"area"===t&&"none"!==(e._cmd?e._cmd.fill:n.getAttribute("fill"))}}),b=(e,i)=>{y.lf=e,y.lo=i,_.forEach(({node:n,own:r,k:a,fill:o})=>{e>=1&&i<=0?x.forEach((t,e)=>null==r[e]?n.removeAttribute(t):n.setAttribute(t,r[e])):o?n.setAttribute("fill-opacity",String(a*e*jn(1,p,i))):"area"===t?(n.setAttribute("stroke-opacity",String(e*jn(1,g,i))),n.setAttribute("stroke-width",String(jn(s.width,f,i)))):(n.setAttribute("stroke-opacity",String(e)),n.setAttribute("stroke-dasharray",i<1?`${m} ${m*i}`:String(m)))})},v=t=>{b(jn(i.f,n.f,t),jn(i.o,n.o,t)),s.also&&s.also(t)},w=()=>{y.run=!1,s.land&&b(s.land.f,s.land.o),s.done&&s.done()};this._animates()&&(i.f!==n.f||i.o!==n.o||s.done||s.force)?(y.run=!0,this._tween(0,this.w.config.chart.animations.dynamicAnimation.speed,v,w,s.ease)):(v(1),w())}_lineLabels(t,e,i,n,s,r,a){var o,l,c,h;const u=this.w,d=u.globals,p=t.elDataLabelsWrap;if(!u.config.dataLabels.enabled||!(null==p?void 0:p.node)||t._shapeOnly)return;const f=(null==(o=u.highlightData)?void 0:o.active)&&"part"===(null!=(c=null==(l=this.cfg.dataLabels)?void 0:l.value)?c:"part");if(f){const a=p.node;for(;a.firstChild;)a.removeChild(a.firstChild);const o=d.dataLabelsRects;if(o[n]=[],d.lastDrawnDataLabelsIndexes[n]=[],r&&s.some(t=>null!=t)){const a=new wn(u,this.ctx);for(let l=0;l<r.xArrj.length-1;l++){const c=t.lineHelpers.calculatePoints({series:r.S,x:r.xArrj[l+1],y:r.yArrj[l+1],realIndex:n,i:i,j:l,prevY:r.yArrj[0]});c.x.forEach((t,i)=>{if(null==s[l?l+1:i])return void o[n].push({x:NaN,y:NaN,width:0,height:0});const r=a.drawDataLabel({type:e,pos:{x:l?[t]:i?[NaN,t]:[t,NaN],y:c.y},i:n,j:l?l+1:1,row:s});r&&p.add(r)})}}}const g=f?null==r?void 0:r.xArrj:a.xArrj,m=f?null==r?void 0:r.yArrj:a.yArrj;if(!this._animates()||!g||Tn(u,n))return;const y=d.riseLabels;if(null==y?void 0:y.has(n)){const t=new Map(y);t.delete(n),d.riseLabels=t.size?t:null}const x=d.prevStreamFrame,_=null==(h=d.prevHighlightLabels)?void 0:h.get(n);Promise.resolve().then(()=>{var t,e;return this._rideLabels(p.node,g,m,_,[null==(t=null==x?void 0:x.xPixels)?void 0:t[n],null==(e=null==x?void 0:x.yPixels)?void 0:e[n]])})}_captureLabels(){const t=this.w,e=t.config.chart.type,i=t.dom.baseEl,n=cs.indexOf(e)>-1;if(!t.config.dataLabels.enabled||"line"!==e&&"area"!==e&&!n||!i||!mt.isBrowser())return null;const s=new Map;if(n){const t=new Map;return i.querySelectorAll(".apexcharts-pie-label").forEach(e=>{const[i,n]=Un(e);t.set(Number(e.parentNode.getAttribute("data:slice")),{x:i,y:n})}),s.set(-1,t),s}return i.querySelectorAll(".apexcharts-datalabels[data\\:realIndex]").forEach(e=>{const i=Number(e.getAttribute("data:realIndex")),n=t.globals.seriesXvalues[i]||[],r=new Map;e.querySelectorAll(`text.apexcharts-datalabel, text.${$s}`).forEach(t=>{var e;const i=qs(n,parseFloat(t.getAttribute("cx")));if(i<0)return;const[s,a]=Un(t);r.set(i,{x:s,y:a,o:parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1"),els:Xs(t)})}),s.set(i,r)}),s}_rideLabels(t,e,i,n,s){const r=this.w;if(r.globals.isDestroyed||!t.isConnected)return;const[a,o]=s,l=[],c=new Set,h=t=>"number"==typeof t&&isFinite(t);if(t.querySelectorAll("text.apexcharts-datalabel").forEach(t=>{const s=qs(e,parseFloat(t.getAttribute("cx")));if(s<0)return;const[r,u]=Un(t),d=null==n?void 0:n.get(s);let p=0,f=0,g=0;d?(c.add(s),p=d.x-r,f=d.y-u,g=d.o):!(null==n?void 0:n.size)&&[null==a?void 0:a[s],null==o?void 0:o[s],e[s],i[s]].every(h)&&(p=a[s]-e[s],f=o[s]-i[s]),(g<1||Math.abs(p)>.01||Math.abs(f)>.01)&&l.push({els:Xs(t),dx:p,dy:f,o:g,to:1})}),null==n||n.forEach((e,i)=>{if(c.has(i))return;const n=e.els.map(e=>{const i=e.cloneNode(!0);return i.setAttribute("class",$s),i.setAttribute("pointer-events","none"),i.removeAttribute("transform"),t.appendChild(i),i}),[s,r]=Un(n[n.length-1]);l.push({els:n,dx:e.x-s,dy:e.y-r,o:e.o,to:0,out:!0})}),!l.length)return;l.forEach(t=>{t.bases=t.els.map(t=>t.getAttribute("transform")||""),t.ops=t.els.map(e=>{var i;return parseFloat(null!=(i=e.getAttribute("opacity"))?i:"1")/(t.out&&t.o>0?t.o:1)})});this._tween(0,r.config.chart.animations.dynamicAnimation.speed,t=>l.forEach(({els:e,dx:i,dy:n,o:s,to:r,out:a,bases:o,ops:l})=>e.forEach((e,c)=>{const h=o[c],u=a?1:1-t;u?e.setAttribute("transform",`translate(${i*u} ${n*u}) ${h}`.trim()):h?e.setAttribute("transform",h):e.removeAttribute("transform");const d=jn(s,r,t),p=l[c];d>=1&&p>=1?e.removeAttribute("opacity"):e.setAttribute("opacity",String(p*d))})),()=>l.forEach(t=>t.out&&t.els.forEach(t=>t.remove())))}_paintBar(t,e,i,n){var s,r,a,o,l,c,h,u,d,p;const f=this.w,g=this.cfg,m=this._animates(),{key:y,prev:x,geo:b,fadeTo:v,active:w,bar:A}=n,M=i.elSeries;this._seriesEls.set(String(t.realIndex),M.node);let k=(null==b?void 0:b.pathTo)||null;const L=!k&&!!(null==x?void 0:x.d)&&m;L&&(k=this._exitTo(x,w,i.pathTo,null==b?void 0:b.base));const S=k&&!L?this._from(x,null==b?void 0:b.base,i.pathFrom,!!A):null;let C=S?S.d:(null==x?void 0:x.d)||null;const E=L&&!w;let F="apexcharts-bar-highlight-part",P=!1,D=null;if(A&&k){if(C&&C!==k){const t=A._pathToInterp;A._pathToInterp=null;const e=A.cornerMorph(C,k,L?void 0:b.square);e!==k&&(C=e,D=A._pathToInterp),A._pathToInterp=t}const t=A.isHorizontal?Ts:Ns,i=e.node.classList.contains(t);P=L?w?!!x.flip:i:b.flip;const n=(null==x?void 0:x.d)?!!x.flip:!!(null==S?void 0:S.cover)&&i;(P||m&&n)&&(F+=" "+t),!P&&m&&n&&(F+=" "+Os,this._settleHeld(A))}const R="string"==typeof i.fill&&"none"!==i.fill&&i.fill.indexOf("url")<0?i.fill:f.globals.colors[f.config.plotOptions.bar.distributed?t.j:t.realIndex],[T,N]=Xn(i.fill&&"none"!==i.fill?i.fill:R),O=t.j>0&&i.elBarShadows?i.elBarShadows.node.lastElementChild:null,$=x?x.f:1,I=this._partGroup(M,"apexcharts-bar-highlight"),B=k?this._emitPart(I,{i:t.i,j:t.j,realIndex:t.realIndex,from:C||k,to:k,interp:D,paint:T,delay:i.delay,speed:i.speed,cls:F,chartType:"bar",clip:`url(#gridRectBarMask${f.globals.cuid})`}):null,z=qn(e.node),W=(null==S?void 0:S.cover)&&m?N:(null==x?void 0:x.d)&&null!=(s=x.al)?s:1,H=E?N:1,j=n.whole||(null==x?void 0:x.o)?null!=(a=null==(r=g.outline)?void 0:r.width)?a:1:0,Y=e.node,q=Y.getAttribute("stroke"),X=(null==S?void 0:S.cover)&&m?1:(null==x?void 0:x.d)&&null!=(o=x.k)?o:0,G=E?1:0,U=!!B&&j>0&&(X>0||G>0)&&parseFloat(Y.getAttribute("stroke-width"))>0&&!!q&&"none"!==q&&"transparent"!==q,K=qn(Y,"stroke-opacity"),V={};U&&(["stroke","stroke-width","stroke-opacity","stroke-dasharray"].forEach(t=>{var e;V[t]=B.node.getAttribute(t),B.node.setAttribute(t,null!=(e=Y.getAttribute(t))?e:"")}),Y.hasAttribute("stroke-dasharray")||B.node.removeAttribute("stroke-dasharray"));const Z={d:null,f:v,base:null!=(l=null==b?void 0:b.base)?l:null==x?void 0:x.base,edge:!1,s:null!=(c=null==b?void 0:b.s)?c:null==x?void 0:x.s,n:L?null==B?void 0:B.node:null,c:!w,al:H,k:U?G:0};this._targets.set(y,Z);const Q=E?zn:Wn(v);if(this._fade(e.node,(null==S?void 0:S.cover)&&m?zn:x?{f:x.f,o:null!=(h=x.o)?h:Wn(x.f).o}:Bn,n.whole?Q:{f:Q.f,o:0},i,{outline:j>0?{color:R,width:j,opacity:null!=(d=null==(u=g.outline)?void 0:u.opacity)?d:1}:null,also:t=>{null==O||O.setAttribute("fill-opacity",String(jn($,v,t))),(t=>{const e=jn(W,H,t);if(Z.la=e,B&&(z<1||W<1||H<1)&&B.node.setAttribute("fill-opacity",String(z*e)),!U)return;const i=jn(X,G,t);Z.lk=i,i>0||t<1?(B.node.setAttribute("stroke-opacity",String(K*i)),!(Z.lo>0)&&i>0&&Y.setAttribute("stroke-opacity","0")):B.attr(V)})(t)},force:!!B&&(W!==H||U),land:E?Bn:void 0,done:L?()=>null==B?void 0:B.remove():void 0,rec:Z}),!B||!k||L)return;if((null==b?void 0:b.overflow)&&B.node.classList.add("apexcharts-highlight-overflow"),(null==b?void 0:b.overflow)&&!A){const t=new _(f,this.ctx).drawPath({d:i.pathTo,stroke:"#fff",strokeWidth:1,fill:"none",strokeDashArray:3,classes:`${In} apexcharts-highlight-edge`});t.attr("clip-path",`url(#gridRectBarMask${f.globals.cuid})`),t.node.setAttribute("pointer-events","none"),I.add(t);const e=e=>t.node.setAttribute("stroke-opacity",String(.75*e));m&&!(null==x?void 0:x.edge)?this._tween(i.delayMs,i.speed,e):e(1)}const J=null==(p=this.ctx.renderer)?void 0:p.kind;J&&"svg"!==J||f.config.plotOptions.bar.isFunnel||this._hitProxy(I,k,i.pathTo,e.node,!!f.globals.isBarHorizontal),i.labels&&this._contrastLabels(i.labels,k),Object.assign(Z,{d:k,base:null==b?void 0:b.base,edge:!!(null==b?void 0:b.overflow)&&!A,s:null==b?void 0:b.s,flip:P,n:B.node})}_hitProxy(t,e,i,n,s){const r=s?0:1,[a,o]=Ys(e,r),[l,c]=Ys(i,r),[h,u]=Ys(e,r?0:1);if(!(o-a>.5&&u-h>.5))return;const d=[];c-l>.5?(a<l&&d.push([a,Math.min(o,l)]),o>c&&d.push([Math.max(a,c),o])):d.push([a,o]);const p=new _(this.w,this.ctx);for(const[e,i]of d){if(i-e<.5)continue;const r=p.drawPath({d:s?`M ${e} ${h} L ${i} ${h} L ${i} ${u} L ${e} ${u} Z`:`M ${h} ${e} L ${u} ${e} L ${u} ${i} L ${h} ${i} Z`,stroke:"none",strokeWidth:0,fill:"none",classes:"apexcharts-highlight-hit"}).node;r.setAttribute("pointer-events","all"),r.setAttribute("clip-path",`url(#gridRectBarMask${this.w.globals.cuid})`),Vn(n,r),t.add(r)}}_settleHeld(t){if(this._held)return;this._held=!0;const e=this.w;Promise.resolve().then(()=>{var i;e.globals.isDestroyed||(null==(i=e.dom.baseEl)?void 0:i.querySelector(`.apexcharts-series > .${Os}`))||t.settleHeldMirrors()})}_from(t,e,i,n){var s;return(null==t?void 0:t.d)?{d:t.d,cover:!1}:e&&(t||"baseline"===this.cfg.enter||n&&(!this.w.globals.dataChanged||(null==(s=this._prev())?void 0:s.size)))?{d:e,cover:!1}:i?{d:i,cover:!0}:null}_exitTo(t,e,i,n){return e?n||t.base||t.d:i}_partGroup(t,e){let i=t.node._apxHighlight;return i&&i.node.parentNode===t.node||(i=new _(this.w,this.ctx).group({class:e}),t.node._apxHighlight=i),t.add(i),i}_emitPart(t,e){const i=this.w,n=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,new _(i,this.ctx)).renderPaths({i:e.i,j:e.j,realIndex:e.realIndex,pathFrom:e.from,pathTo:e.to,pathToInterp:e.interp||void 0,pathToNumeric:e.num,scrollMorph:!!e.scroll,stroke:e.stroke||"none",strokeWidth:e.width||0,fill:e.paint,animationDelay:e.delay,initialSpeed:i.config.chart.animations.speed,dataChangeSpeed:e.speed,className:`${In} ${e.cls}`,chartType:e.chartType,bindEventsOnPaths:!1});return n&&n.node?(n.attr("clip-path",e.clip),n.node.setAttribute("pointer-events","none"),n.node.setAttribute("index",String(e.realIndex)),n.node.setAttribute("j",String(e.j)),t.add(n),n):null}_fade(t,e,i,n,s){var r;const a=s.attr||"fill-opacity",o=qn(t,a),l=s.outline,c=s.rec||{},h=l&&null==l.width?["stroke","stroke-opacity"]:["stroke","stroke-width","stroke-opacity"],u=h.map(e=>t.getAttribute(e)),d=(e,i)=>{c.lf=e,c.lo=l?i:0,t.setAttribute(a,String(o*e)),l&&(i<=0?h.forEach((e,i)=>null==u[i]?t.removeAttribute(e):t.setAttribute(e,u[i])):(t.setAttribute("stroke",l.color),null!=l.width&&t.setAttribute("stroke-width",String(l.width)),t.setAttribute("stroke-opacity",String(l.opacity*Math.min(1,i)))))},p=t=>{d(jn(e.f,i.f,t),jn(e.o,i.o,t)),s.also&&s.also(t)},f=()=>{c.run=!1,s.land&&d(s.land.f,s.land.o),s.done&&s.done()};(null!=(r=s.anim)?r:this._animates())&&(e.f!==i.f||e.o!==i.o||s.done||s.force)?(c.run=!0,this._tween(n.delayMs,n.speed,p,f,s.curve,n.el)):(p(1),f())}_runningExt(t,e,i){if(!e)return t;const n=new Map;return t.map((t,s)=>t.map((t,r)=>{if(null==t)return null;const a=e(s,r)+(i&&t<0?"-":"+"),o=(n.get(a)||0)+t;return n.set(a,o),o}))}_contrastLabels(t,e){const i=this.w,n=t.node;if(!n||/rotate\((?!0\))/.test(n.getAttribute("transform")||""))return;const[s,r]=Ys(e,0),[a,o]=Ys(e,1),l=new _(i);n.querySelectorAll("text").forEach(t=>{const e=(t.getAttribute("fill")||"").toLowerCase();if("#fff"!==e&&"#ffffff"!==e&&"white"!==e)return;const n=l.getTextRects(t.textContent,t.getAttribute("font-size"),t.getAttribute("font-family"),void 0,!0,t.getAttribute("font-weight")),c=parseFloat(t.getAttribute("x")),h=parseFloat(t.getAttribute("y")),u=t.getAttribute("text-anchor"),d="middle"===u?c-n.width/2:"end"===u?c-n.width:c;d>=s-1&&d+n.width<=r+1&&h-.75*n.height>=a-1&&h+.25*n.height<=o+1||t.setAttribute("fill",i.config.chart.foreColor)})}tooltipRow(t,e,i,n){var s,r,a,c,h,u,d,p,f,g,m;const y=this.w,x=this.cfg,_=x.tooltip||{},b=y.globals.axisCharts,w=this.isActive()&&!1!==_.show&&(null!=i||!b)&&!!t.yValue,A=b||"lanes"!==this._ind||"radialBar"!==y.config.chart.type?void 0:(null==(s=this._lane)?void 0:s[0])===e?this._lane[1]:"part";if(t.marker&&function(t,e,i=.2,n){const s=t.style,r=t.firstElementChild;if(!e){if(!t._apxHl)return;return t._apxHl=!1,s.background=s.boxShadow=s.borderRadius="",void(r&&(r.style.display=""))}t._apxHl=!0;const a="#"===e.charAt(0)?v.hexToRgba(e,i):`color-mix(in srgb, ${e} ${100*i}%, transparent)`;s.background="part"===n?e:n?a:`linear-gradient(90deg, ${e} 50%, ${a} 50%)`,s.boxShadow=`inset 0 0 0 1px ${e}`,s.borderRadius="3px",r&&(r.style.display="none")}(t.marker,w&&!y.config.tooltip.fillSeriesColor?(null==(a=null==(r=this._tiles)?void 0:r.get(e+"|"+i))?void 0:a.base)||y.globals.colors[e]:null,A?null!=(u=null==(h=null==(c=x.radialBar)?void 0:c.lanes)?void 0:h.opacity)?u:xs:x.fadeOpacity,A),!w)return;const M=this.valueAt(e,i),k=y.seriesData.series,L=b?null==(d=k[e])?void 0:d[i]:k[e],S=b?{series:k,seriesIndex:e,dataPointIndex:i,w:y}:l(o({},y),{w:y,series:k,seriesIndex:e,dataPointIndex:e,highlight:Gn(M,L),lane:A});if("function"==typeof _.formatter)return void(t.yValue.innerHTML=String(null!=(p=_.formatter(M,null!=L?L:null,S))?p:""));const C='<span class="apexcharts-highlight-total" style="font-weight: 400; opacity: 0.6">';if("whole"===A){if(null!=M){const e=null!=(m=null==(g=null==(f=y.globals.locale)?void 0:f.highlightFilter)?void 0:g.part)?m:"part";t.yValue.innerHTML+=` ${C}(${e} ${n.yLbFormatter(M,S)})</span>`}return}let E=t.yValue.innerHTML;null!=M&&(E=`/ ${E}`,_.share&&L&&(E+=` \xb7 ${Math.round(M/L*100)}%`)),t.yValue.innerHTML=(null==M?"":`${n.yLbFormatter(M,S)} `)+`${C}${E}</span>`}drillView(t){Array.isArray(null==t?void 0:t.series)&&(t.series=t.series.map(es),this._level={series:t.series,base:this.w.globals.initialSeries}),t&&null!=this.cfg.data&&(t.highlightFilter=l(o({},t.highlightFilter),{data:null}))}_drilled(){var t;const e=this._level;return!!(e&&((null==(t=this.ctx.drilldown)?void 0:t.depth)||0)>0&&this.w.globals.initialSeries===e.base)}_fire(t){var e;const i=null==(e=this.w.config.chart.events)?void 0:e.highlightFilterChanged;"function"==typeof i&&i(this.ctx,{active:"clear"!==t,phase:t})}pie(t){"radialBar"===t.chartType?bs(this,t):hs(this,t)}treemap(t){return Ps(this,t)}afterRender(){this._tipOn&&(this._tipOn=!1,this.w.config.tooltip.enabled=!1);const t=this._ride;this._ride=null;const e=this.w.globals.circleTween;!t||e&&!e.done||t();const i=this._drawnSig,n=this._sig;i!==n&&(this._drawnSig=n,this._fire(i?n?"update":"clear":"enter"))}set(t,e={}){var i;const n=this.w,s=n.globals;if(!s.axisCharts)return this._setCircle(t,e);const r=e.series||this._rawSeries();if("treemap"===n.config.chart.type&&s.treemapRoots)return this._apply(function(t,e,i){const n=t.w;return e.map((t,e)=>{const s=es(t),r=Array.isArray(null==i?void 0:i[e])?i[e]:null;if("function"!=typeof i&&!r)return s;let a=0;const c=s=>{var h,u,d;if(Yn(s)&&Array.isArray(s.children)&&s.children.length)return l(o({},s),{children:s.children.map(c)});const p=a++,f=Yn(s)?o({},s):{x:"",y:s};return f.highlight="function"==typeof i?i({seriesIndex:e,dataPointIndex:p,seriesName:t.name,x:null!=(h=f.x)?h:f.name,value:"number"==typeof(null!=(u=f.y)?u:f.value)?null!=(d=f.y)?d:f.value:null,datum:s,w:n}):null==r?void 0:r[p],f};return Array.isArray(s.data)&&(s.data=s.data.map(c)),s})}(this,r,t),e);const a=!e.series&&!!s.dataReducerRawSeries&&!!(null==(i=n.config.chart.dataReducer)?void 0:i.enabled),c=r.map((i,s)=>{const r=Array.isArray(i.data)?i.data:[],c="function"==typeof t?r.map((r,o)=>{var l;return t({seriesIndex:s,dataPointIndex:o,seriesName:i.name,x:Yn(r)?r.x:Array.isArray(r)?r[0]:n.labelData.labels[o],value:Us(r,e.series||a?null:null==(l=n.seriesData.series[s])?void 0:l[o]),datum:r,w:n})}):Array.isArray(null==t?void 0:t[s])?t[s]:null,h=es(i);return c&&(a&&h.data.every(t=>"number"!=typeof t)?h.data=h.data.map((t,e)=>null==t?t:Array.isArray(t)?{x:t[0],y:t[1],highlight:c[e]}:l(o({},t),{highlight:c[e]})):h.highlightData=c),h});return this._apply(c,e)}clear(t={}){return this.w.globals.axisCharts?this._apply(this._rawSeries().map(es),t):this._setCircle(null,t)}_setCircle(t,e){const i=this.w,n=e.series||this._rawSeries(),s={};if((e.series||n.some(ns))&&(s.series=n.map(es)),"function"==typeof t){const s=is(n),r=e.series?[]:i.seriesData.series,a=i.seriesData.seriesNames,o=s.length||n.length,l=[];for(let e=0;e<o;e++){const o=s.length?s[e]:n[e];l.push(t({seriesIndex:e,dataPointIndex:e,seriesName:s.length?String(o.x):a[e],x:s.length?o.x:a[e],value:Us(o,r[e]),datum:o,w:i}))}t=l}return s.highlightFilter={data:Array.isArray(t)?t:null},this.ctx.updateOptions(s,!1,!1!==e.animate,!0,!this._drilled())}_apply(t,e){const i=this._drilled();return i&&this._level&&(this._level.series=t.map(es)),this.ctx.updateSeries(t,!1!==e.animate,!i)}_rawSeries(){var t,e;const i=this.w.globals;return(this._drilled()&&(null==(t=this._level)?void 0:t.series)||i.treemapRawSeries||(i.dataReducerRawSeries&&(null==(e=this.w.config.chart.dataReducer)?void 0:e.enabled)?i.initialSeries:null)||i.initialSeries||this.w.config.series).map(t=>Yn(t)?o({},t):t)}teardown(){var t,e;Array.from(this._live).forEach(t=>t.finish()),this._live.clear(),this._targets=new Map,this._render=null,this._cu=null,this._level=null,this._seriesEls=new Map,this._tiles=null,this._tmDefs=[],null==(t=this.ctx.events)||t.removeEventListener("mounted",this._onRender),null==(e=this.ctx.events)||e.removeEventListener("updated",this._onRender)}}});const Vs=/[MmLlHhVvCcSsQqTtAaZz]/;function Zs(t,e=.6,i=!1){const n=e>0?e:.6,s=t.length;let r=0;const a=[];let o=[],l=0,c=0,h=0,u=0,d=0,p=0,f="";const g=t=>" "===t||","===t||"\t"===t||"\n"===t||"\r"===t;function m(){for(;r<s&&g(t[r]);)r++}function y(){m();const e=r;for("+"!==t[r]&&"-"!==t[r]||r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if("."===t[r])for(r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if("e"===t[r]||"E"===t[r])for(r++,"+"!==t[r]&&"-"!==t[r]||r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if(r===e)return null;const i=parseFloat(t.slice(e,r));return isFinite(i)?i:null}function x(){m();const e=t[r];return"0"===e||"1"===e?(r++,"1"===e):null}function _(){o.length>(i?1:2)&&a.push(o),o=[]}function b(t,e){_(),l=h=t,c=u=e,o=[{x:t,y:e}]}function v(t,e){o.push({x:t,y:e}),l=t,c=e}function w(t,e,i,s,r,a){const h=Math.hypot(t-l,e-c)+Math.hypot(i-t,s-e)+Math.hypot(r-i,a-s),u=Math.max(2,Math.min(160,Math.ceil(h/n))),f=l,g=c;for(let n=1;n<=u;n++){const l=n/u,c=1-l,h=c*c*c,d=3*c*c*l,p=3*c*l*l,m=l*l*l;o.push({x:h*f+d*t+p*i+m*r,y:h*g+d*e+p*s+m*a})}d=i,p=s,l=r,c=a}function A(t,e,i,n){const s=t,r=e;w(l+2/3*(t-l),c+2/3*(e-c),i+2/3*(t-i),n+2/3*(e-n),i,n),d=s,p=r}function M(t,e,i,s,r,a,h){if(!t||!e)return void v(a,h);const u=l,f=c;t=Math.abs(t),e=Math.abs(e);const g=i*Math.PI/180,m=Math.cos(g),y=Math.sin(g),x=(u-a)/2,_=(f-h)/2,b=m*x+y*_,w=-y*x+m*_,A=b*b/(t*t)+w*w/(e*e);if(A>1){const i=Math.sqrt(A);t*=i,e*=i}const M=t*t*e*e-t*t*w*w-e*e*b*b,k=t*t*w*w+e*e*b*b,L=(s===r?-1:1)*Math.sqrt(Math.max(0,M/(k||1))),S=L*t*w/e,C=-L*e*b/t,E=m*S-y*C+(u+a)/2,F=y*S+m*C+(f+h)/2,P=(b-S)/t,D=(w-C)/e,R=(-b-S)/t,T=(-w-C)/e,N=Math.atan2(D,P);let O=Math.atan2(T,R)-N;!r&&O>0&&(O-=2*Math.PI),r&&O<0&&(O+=2*Math.PI);const $=Math.max(2,Math.min(320,Math.ceil(Math.abs(O)*Math.max(t,e)/n)));for(let i=1;i<=$;i++){const n=N+O*i/$,s=Math.cos(n),r=Math.sin(n);o.push({x:E+t*s*m-e*r*y,y:F+t*s*y+e*r*m})}d=a,p=h,l=a,c=h}for(;r<s&&(m(),!(r>=s));){let e=t[r];if(Vs.test(e))r++;else{if(!f)break;e="M"===f?"L":"m"===f?"l":f}const i=e>="a"&&e<="z",n=e.toUpperCase();if("Z"===n){o.length&&o.push({x:h,y:u}),_(),l=h,c=u,f=e;continue}const s=t=>null==t?NaN:t,g=s(y());if(isNaN(g))break;switch(n){case"M":{const t=s(y());if(isNaN(t))return a;b(i?l+g:g,i?c+t:t);break}case"L":{const t=s(y());if(isNaN(t))return a;v(i?l+g:g,i?c+t:t);break}case"H":v(i?l+g:g,c);break;case"V":v(l,i?c+g:g);break;case"C":{const t=[g,y(),y(),y(),y(),y()];if(t.some(t=>null==t))return a;const e=t;w(i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3],i?l+e[4]:e[4],i?c+e[5]:e[5]);break}case"S":{const t=[g,y(),y(),y()];if(t.some(t=>null==t))return a;const e=t,n=f&&"CcSs".indexOf(f)>=0;w(n?2*l-d:l,n?2*c-p:c,i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3]);break}case"Q":{const t=[g,y(),y(),y()];if(t.some(t=>null==t))return a;const e=t;A(i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3]);break}case"T":{const t=s(y());if(isNaN(t))return a;const e=f&&"QqTt".indexOf(f)>=0;A(e?2*l-d:l,e?2*c-p:c,i?l+g:g,i?c+t:t);break}case"A":{const t=g,e=y(),n=y(),s=x(),r=x(),o=y(),h=y();if(null==e||null==n||null==s||null==r||null==o||null==h)return a;M(t,e,n,s,r,i?l+o:o,i?c+h:h);break}default:return a}"C"!==n&&"S"!==n&&"Q"!==n&&"T"!==n&&(d=l,p=c),f=e}return _(),a}function Qs(t){const e={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};return t.forEach(t=>{t.forEach(t=>{t.x<e.x0&&(e.x0=t.x),t.y<e.y0&&(e.y0=t.y),t.x>e.x1&&(e.x1=t.x),t.y>e.y1&&(e.y1=t.y)})}),e}const Js=128;function tr(t,e,i){const n=Math.max(1e-6,t.x1-t.x0),s=Math.max(1e-6,t.y1-t.y0),r=Math.min(e.width*i/n,e.height*i/s);return{scale:r,offX:e.x+e.width/2-(t.x0+n/2)*r,offY:e.y+e.height/2-(t.y0+s/2)*r}}function er(t,e,i){const n=.42*e,s=.45*e,r=t.maxY-t.minY,a=Math.max(1,Math.floor(r/i)),o=t.minY+(r-a*i)/2,l=[];let c=0;for(let r=0;r<a;r++){const a=o+(r+.5)*i,h=t.spansAt(a);for(let t=0;t<h.length;t++){const i=h[t].x1-h[t].x0;let o;o=i>=2*n?Math.floor((i-2*n)/e)+1:i>=s?1:0,o&&(l.push({y:a,x0:h[t].x0,x1:h[t].x1,cap:o,row:r}),c+=o)}}return{cells:l,capacity:c,inset:n}}function ir(t,e){const i=new Array(t.length).fill(0);let n=0;for(let e=0;e<t.length;e++)n+=t[e];if(!n||e<=0)return i;let s=0;const r=[];for(let a=0;a<t.length;a++){const o=e*t[a]/n;i[a]=Math.floor(o),s+=i[a],r.push({i:a,frac:o-i[a]})}r.sort((t,e)=>e.frac-t.frac);for(let t=0;s<e;t++,s++)i[r[t%r.length].i]++;return i}function nr(t,e,i){let n=1,s=Math.max(t.maxY-t.minY,8);for(let r=0;r<34;r++){const r=(n+s)/2;er(t,r,r*i).capacity>=e?n=r:s=r}return n}function sr(t,e){return Math.min(Math.max(t,e/3.2),e/2.3)}const rr={rows:null,rowsUp:(t,e)=>e.y-t.y||t.x-e.x,cols:(t,e)=>(t.qx||0)-(e.qx||0)||t.y-e.y,colsRev:(t,e)=>(e.qx||0)-(t.qx||0)||t.y-e.y,centerOut:(t,e)=>(t.qd||0)-(e.qd||0)||t.y-e.y,centerIn:(t,e)=>(e.qd||0)-(t.qd||0)||t.y-e.y};function ar(t,e,i,n){const s=void 0!==rr[i]?rr[i]:null;let r=e;if(s){let t=0,i=0;e.forEach(e=>{t+=e.x,i+=e.y}),t/=e.length||1,i/=e.length||1;const a=n>0?n:1;e.forEach(e=>{e.qx=Math.round(e.x/a),e.qd=Math.round(Math.hypot(e.x-t,e.y-i)/a)}),r=e.slice().sort(s)}const a=[];for(let e=0;e<t.length&&e<r.length;e++)a.push({id:t[e].id,x:r[e].x,y:r[e].y,r:r[e].r});return a}function or(t,e,i,n,s,r){if(e<=0)return;if(1===e)return void r.push({x:(t.x0+t.x1)/2,y:t.y,r:s,row:t.row});let a=t.x0+n;let o=(t.x1-n-a)/(e-1);o>1.5*i&&(o=i,a=(t.x0+t.x1)/2-o*(e-1)/2);for(let i=0;i<e;i++)r.push({x:a+i*o,y:t.y,r:s,row:t.row})}const lr=new Set;function cr(t,e){const i=e(t),n=t.minUnits||0,s=(e,s)=>{if(n&&e.length&&e.length<n&&!lr.has(t.name)){lr.add(t.name);const i="stroke"===t.kind?"A stroke thins to a dotted line below that, which may well be fine.":"Fine detail closes up below that.";console.warn(`[ApexCharts] unit shape "${t.name}" reads best from about ${n} units; this chart has ${e.length}. ${i} Lower plotOptions.unit.unitValue to draw more dots, or pick a simpler shape.`)}return i(e,s)};return s.shape=Object.freeze(o({},t)),s.with=i=>cr(o(o({},t),i),e),s}const hr=new Map;function ur(t){const e=t.path||"",i=t.order||"rows",n=null==t.padding?.94:t.padding,s=null==t.rowRatio?.88:t.rowRatio,r="evenodd"===t.fillRule,a=null==t.sampling?.6:t.sampling;return(t,o)=>{if(!t.length||!e)return[];const{polys:l,bounds:c}=function(t,e){const i=`${e}|${t}`;let n=hr.get(i);if(!n){const s=Zs(t,e);n={polys:s,bounds:Qs(s)},hr.set(i,n)}return n}(e,a);if(!l.length)return[];const h=function(t,e,i={}){const n=!!i.evenOdd,s=[];let r=1/0,a=-1/0,o=1/0,l=-1/0;if(t.forEach(t=>{for(let i=0;i<t.length;i++){const n=t[i],c=t[(i+1)%t.length],h=e.offX+n.x*e.scale,u=e.offY+n.y*e.scale,d=e.offX+c.x*e.scale,p=e.offY+c.y*e.scale;h<o&&(o=h),d<o&&(o=d),h>l&&(l=h),d>l&&(l=d),u<r&&(r=u),p<r&&(r=p),u>a&&(a=u),p>a&&(a=p),u!==p&&s.push({x0:h,y0:u,x1:d,y1:p})}}),!s.length)return{minY:0,maxY:0,minX:0,maxX:0,spansAt:()=>[]};const c=Math.max(1e-6,a-r),h=[];for(let t=0;t<Js;t++)h.push([]);return s.forEach(t=>{const e=Math.min(t.y0,t.y1),i=Math.max(t.y0,t.y1);let n=Math.floor((e-r)/c*Js),s=Math.floor((i-r)/c*Js);n=Math.max(0,Math.min(127,n)),s=Math.max(0,Math.min(127,s));for(let e=n;e<=s;e++)h[e].push(t)}),{minY:r,maxY:a,minX:o,maxX:l,spansAt:t=>{const e=Math.floor((t-r)/c*Js);if(e<0||e>127)return[];const i=h[e],s=[];for(let e=0;e<i.length;e++){const n=i[e],r=n.y1>n.y0,a=r?n.y0:n.y1,o=r?n.y1:n.y0;t<a||t>=o||s.push({x:n.x0+(t-n.y0)/(n.y1-n.y0)*(n.x1-n.x0),dir:r?1:-1})}if(s.length<2)return[];s.sort((t,e)=>t.x-e.x);const a=[];if(n){for(let t=0;t+1<s.length;t+=2)a.push({x0:s[t].x,x1:s[t+1].x});return a}let o=0,l=0;for(let t=0;t<s.length;t++){const e=o;o+=s[t].dir,0===e&&0!==o?l=s[t].x:0!==e&&0===o&&a.push({x0:l,x1:s[t].x})}return a}}}(l,tr(c,o,n),{evenOdd:r}),u=nr(h,t.length,s),d=er(h,u,u*s);if(!d.cells.length)return[];const p=ir(d.cells.map(t=>t.cap),t.length),f=sr(t[0].r>0?t[0].r:3,u),g=[];return d.cells.forEach((t,e)=>{or(t,p[e],u,d.inset,f,g)}),ar(t,g,i,u)}}function dr(t){return cr(l(o({},t),{kind:"silhouette"}),ur)}const pr=dr({name:"heart",category:"symbols",minUnits:40,source:"original",path:"M 50 93 C 20 71 5 53 5 34 C 5 17 18 6 32 6 C 41 6 47 11 50 19 C 53 11 59 6 68 6 C 82 6 95 17 95 34 C 95 53 80 71 50 93 Z"}),fr=dr({name:"droplet",category:"nature",minUnits:40,source:"original",path:"M 50 3 C 50 3 13 46 13 66 A 37 37 0 0 0 87 66 C 87 46 50 3 50 3 Z"}),gr=dr({name:"human",category:"people",minUnits:80,source:"original",path:"M 39 13 A 11 11 0 0 1 61 13 A 11 11 0 0 1 39 13 Z M 38 30 C 33 31 29 34 27 40 L 19 64 L 26 67 L 33 48 L 34 58 L 31 96 L 44 96 L 46 64 L 54 64 L 56 96 L 69 96 L 66 58 L 67 48 L 74 67 L 81 64 L 73 40 C 71 34 67 31 62 30 Z"}),mr=dr({name:"tree",category:"nature",minUnits:80,source:"original",path:"M 50 3 C 62 3 70 11 70 19 C 81 16 91 24 91 34 C 97 39 97 51 89 56 C 87 62 77 66 67 63 C 63 68 55 70 50 68 C 45 70 37 68 33 63 C 23 66 13 62 11 56 C 3 51 3 39 9 34 C 9 24 19 16 30 19 C 30 11 38 3 50 3 Z M 41 58 L 59 58 L 60 88 C 61 92 63 94 67 96 L 33 96 C 37 94 39 92 40 88 Z"}),yr=dr({name:"house",category:"objects",minUnits:120,order:"rows",source:"original",path:"M 50 4 L 97 44 L 97 50 L 84 50 L 84 95 L 16 95 L 16 50 L 3 50 L 3 44 Z M 44 95 L 56 95 L 56 70 L 44 70 Z M 25 58 L 25 69 L 37 69 L 37 58 Z M 63 58 L 63 69 L 75 69 L 75 58 Z"}),xr=dr({name:"battery",category:"objects",minUnits:40,order:"cols",source:"original",path:"M 14 22 L 72 22 C 78 22 82 26 82 32 L 82 38 L 93 38 L 93 62 L 82 62 L 82 68 C 82 74 78 78 72 78 L 14 78 C 8 78 4 74 4 68 L 4 32 C 4 26 8 22 14 22 Z"}),_r=dr({name:"shield",category:"technology",minUnits:40,source:"original",path:"M 6 8 L 94 8 L 94 38 C 94 60 82 81 50 97 C 18 81 6 60 6 38 Z"}),br=dr({name:"rocket",category:"objects",minUnits:120,source:"original",path:"M 50 2 C 59 13 65 28 66 45 L 66 76 L 58 88 L 42 88 L 34 76 L 34 45 C 35 28 41 13 50 2 Z M 65 56 L 85 86 L 85 95 L 65 82 Z M 35 56 L 15 86 L 15 95 L 35 82 Z M 43.5 34 A 6.5 6.5 0 0 0 56.5 34 A 6.5 6.5 0 0 0 43.5 34 Z"}),vr=t=>t.reduce((t,e)=>t+e,0);function wr(t){const e=null==t.padding?.94:t.padding,i="centerIn"===t.order,n=null==t.twist?2.399963:t.twist;return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.min(s.width,s.height)/2*e,o=s.x+s.width/2,l=s.y+s.height/2,c=t=>{const e=[];for(let i=0;i<t;i++)e.push(Math.max(1,Math.round(2*Math.PI*(i+.5))));return e};let h=1;for(;h<400&&vr(c(h))<r;)h++;const u=a/h,d=ir(c(h),r),p=sr(t[0].r>0?t[0].r:3,u),f=[];for(let t=0;t<h;t++){const e=i?h-1-t:t,s=(e+.5)*u,r=d[e],a=n*e;for(let e=0;e<r;e++){const i=a+e/r*2*Math.PI;f.push({x:o+s*Math.cos(i),y:l+s*Math.sin(i),r:p,row:t})}}return ar(t,f,"rows",u)}}function Ar(t){const e=null==t.padding?.94:t.padding,i=(null==t.tilt?15:t.tilt)*Math.PI/180,n=t.order||"rows";return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.min(s.width,s.height)/2*e,o=s.x+s.width/2,l=s.y+s.height/2,c=Math.cos(i),h=Math.sin(i),u=(t,e,i)=>{const n=e*Math.cos(i);return{x:a*e*Math.sin(i),y:a*(t*c+n*h),depth:n*c-t*h}},d=t=>{const e=Math.max(3,Math.ceil(Math.PI*a/t)),i=Math.PI/e,n=.95*t,s=n,r=new Map,d=[];let p=0;const f=t=>{const e=Math.floor(t.x/s),i=Math.floor(t.y/s);for(let s=-1;s<=1;s++)for(let a=-1;a<=1;a++){const o=r.get(`${e+s},${i+a}`);if(o)for(let e=0;e<o.length;e++)if(Math.hypot(o[e].x-t.x,o[e].y-t.y)<n)return!1}const a=`${e},${i}`,o=r.get(a);return o?o.push(t):r.set(a,[t]),!0};for(let n=0;n<e;n++){const e=-Math.PI/2+(n+.5)*i,s=Math.cos(e),r=Math.sin(e),a=r*h/(s*c||1e-9);if(a>=1)continue;const g=a<=-1?Math.PI:Math.acos(a),m=g>=Math.PI-1e-9,y=[],x=[0];for(let t=0;t<=40;t++){const e=u(r,s,2*g*t/40-g);if(y.push(e),t>0){const i=y[t-1];x.push(x[t-1]+Math.hypot(e.x-i.x,e.y-i.y))}}const _=x[x.length-1],b=m?0:Math.min(.42*t,_/2),v=_-2*b;let w;if(w=m?Math.max(1,Math.round(_/t)):v>0?Math.floor(v/t)+1:_>=.45*t?1:0,!w)continue;const A=m?_/w:w>1?v/(w-1):0,M=[];let k=0;for(let t=0;t<w;t++){const e=m?t*A:w>1?b+t*A:_/2;for(;k<x.length-2&&x[k+1]<e;)k++;const i=x[k],n=x[k+1],s=n>i?(e-i)/(n-i):0,r=y[k],a=y[k+1],c={x:o+r.x+(a.x-r.x)*s,y:l+r.y+(a.y-r.y)*s,depth:r.depth+(a.depth-r.depth)*s};f(c)&&M.push(c)}M.length&&(d.push(M),p+=M.length)}return{rows:d,total:p}};let p=1,f=2*a;for(let t=0;t<30;t++){const t=(p+f)/2;d(t).total>=r?p=t:f=t}const g=p,{rows:m}=d(g),y=ir(m.map(t=>t.length),r),x=sr(t[0].r>0?t[0].r:3,g),_=[];return m.forEach((t,e)=>{const i=y[e];if(i)for(let n=0;n<i;n++){const s=t[Math.min(t.length-1,Math.floor(n*t.length/i))];_.push({x:s.x,y:s.y,r:x*(.62+.38*Math.sqrt(Math.max(0,s.depth))),row:e})}}),_.sort((t,e)=>t.y-e.y||t.x-e.x),ar(t,_,n,g)}}function Mr(t){const e=null==t.padding?.94:t.padding,i=null==t.rowRatio?.9:t.rowRatio,n=t.order||"rowsUp";return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.max(1,Math.round((Math.sqrt(8*r+1)-1)/2)),o=[];for(let t=0;t<a;t++)o.push(t+1);const l=ir(o,r),c=Math.max(...l),h=Math.min(s.width*e/Math.max(1,c-1+1.6),s.height*e/(a*i)),u=h*i,d=s.x+s.width/2,p=s.y+(s.height-a*u)/2,f=sr(t[0].r>0?t[0].r:3,h),g=[];for(let t=0;t<a;t++)for(let e=0;e<l[t];e++)g.push({x:d+(e-(l[t]-1)/2)*h,y:p+(t+.5)*u,r:f,row:t});return ar(t,g,n,h)}}function kr(t){return cr(l(o({},t),{kind:"rings"}),wr)}function Lr(t){return cr(l(o({},t),{kind:"globe"}),Ar)}function Sr(t){return cr(l(o({},t),{kind:"tiers"}),Mr)}const Cr=kr({name:"target",category:"business",minUnits:40,order:"centerIn",source:"generated"}),Er=Lr({name:"globe",category:"geography",minUnits:60,tilt:15,source:"generated"}),Fr=Sr({name:"pyramid",category:"symbols",minUnits:20,order:"rowsUp",source:"generated"}),Pr=dr({name:"leaf",category:"nature",minUnits:60,source:"original",path:"M 27.5 7.6 C 22.6 28.3 17.8 49 26.2 64.9 C 35.6 82.6 55.5 90.1 71.6 90.6 C 80.2 77 85.1 56.3 75.7 38.6 C 67.2 22.7 47.3 15.2 27.5 7.6 Z M 67.1 88.5 L 71.9 101.8 L 80.7 97.1 L 72.4 85.7 Z"}),Dr=dr({name:"sun",category:"nature",minUnits:140,source:"original",path:"M 75.5 41.2 L 98 50 L 75.5 58.8 L 74.3 61.8 L 83.9 83.9 L 61.8 74.3 L 58.8 75.5 L 50 98 L 41.2 75.5 L 38.2 74.3 L 16.1 83.9 L 25.7 61.8 L 24.5 58.8 L 2 50 L 24.5 41.2 L 25.7 38.2 L 16.1 16.1 L 38.2 25.7 L 41.2 24.5 L 50 2 L 58.8 24.5 L 61.8 25.7 L 83.9 16.1 L 74.3 38.2 Z"}),Rr=dr({name:"flame",category:"nature",minUnits:60,source:"original",path:"M 56 2 C 52 24 34 30 30 50 C 27 64 33 70 34 78 C 24 72 20 60 21 50 C 12 62 10 76 16 86 C 24 95 38 98 52 98 C 72 98 84 84 82 64 C 80 46 68 40 66 26 C 64 38 60 42 58 44 C 62 30 60 14 56 2 Z"}),Tr=dr({name:"fish",category:"nature",minUnits:80,source:"original",path:"M 20 50 C 34 26 58 20 76 30 C 86 36 92 44 94 50 C 92 56 86 64 76 70 C 58 80 34 74 20 50 Z M 26 50 L 4 74 L 12 50 L 4 26 Z"}),Nr=dr({name:"star",category:"symbols",minUnits:80,source:"original",path:"M 50 2 L 61.8 33.8 L 95.7 35.2 L 69 56.2 L 78.2 88.8 L 50 70 L 21.8 88.8 L 31 56.2 L 4.3 35.2 L 38.2 33.8 Z"}),Or=dr({name:"arrow",category:"symbols",minUnits:60,source:"original",path:"M 50 4 L 92 46 L 70 46 L 70 96 L 30 96 L 30 46 L 8 46 Z"}),$r=dr({name:"crown",category:"symbols",minUnits:90,source:"original",path:"M 8 84 L 14 26 L 32 52 L 50 16 L 68 52 L 86 26 L 92 84 Z"}),Ir=dr({name:"cross",category:"symbols",minUnits:40,source:"original",path:"M 36 6 L 64 6 L 64 36 L 94 36 L 94 64 L 64 64 L 64 94 L 36 94 L 36 64 L 6 64 L 6 36 L 36 36 Z"}),Br=dr({name:"bolt",category:"symbols",minUnits:70,source:"original",path:"M 62 3 L 20 56 L 44 56 L 38 97 L 80 40 L 54 40 Z"}),zr=dr({name:"bulb",category:"objects",minUnits:90,source:"original",path:"M 50 4 C 29 4 14 21 14 39 C 14 54 25 62 30 72 L 70 72 C 75 62 86 54 86 39 C 86 21 71 4 50 4 Z M 34 74 L 36 96 L 64 96 L 66 74 Z"}),Wr=dr({name:"flask",category:"objects",minUnits:60,source:"original",path:"M 40 4 L 60 4 L 60 36 L 92 92 L 8 92 L 40 36 Z"}),Hr=dr({name:"car",category:"objects",minUnits:120,source:"original",path:"M 4 78 L 4 56 L 20 52 L 32 30 L 68 30 L 82 52 L 96 56 L 96 78 Z M 13 78 A 13 13 0 0 1 39 78 A 13 13 0 0 1 13 78 Z M 61 78 A 13 13 0 0 1 87 78 A 13 13 0 0 1 61 78 Z"}),jr=dr({name:"plane",category:"objects",minUnits:160,source:"original",path:"M 50 2 C 54 2 57 9 58 19 L 58 35 L 95 57 L 95 67 L 58 57 L 58 76 L 70 86 L 70 95 L 50 89 L 30 95 L 30 86 L 42 76 L 42 57 L 5 67 L 5 57 L 42 35 L 42 19 C 43 9 46 2 50 2 Z"}),Yr=dr({name:"group",category:"people",minUnits:160,source:"original",path:"M 8 94 L 8 57 C 8 48 14.6 48 14.6 48 L 23.4 48 C 23.4 48 30 48 30 57 L 30 94 Z M 9.5 34 A 9.5 9.5 0 0 1 28.5 34 A 9.5 9.5 0 0 1 9.5 34 Z M 36 94 L 36 47 C 36 38 44.4 38 44.4 38 L 55.6 38 C 55.6 38 64 38 64 47 L 64 94 Z M 38.5 23 A 11.5 11.5 0 0 1 61.5 23 A 11.5 11.5 0 0 1 38.5 23 Z M 70 94 L 70 57 C 70 48 76.6 48 76.6 48 L 85.4 48 C 85.4 48 92 48 92 57 L 92 94 Z M 71.5 34 A 9.5 9.5 0 0 1 90.5 34 A 9.5 9.5 0 0 1 71.5 34 Z"}),qr=dr({name:"trophy",category:"business",minUnits:110,source:"original",path:"M 30 8 L 70 8 L 68 40 C 68 54 58 62 50 62 C 42 62 32 54 32 40 Z M 45 60 L 55 60 L 55 78 L 45 78 Z M 30 78 L 70 78 L 74 92 L 26 92 Z"}),Xr=dr({name:"moneybag",category:"business",minUnits:80,source:"original",path:"M 36 8 L 64 8 L 59 24 C 80 32 90 48 90 65 C 90 83 73 94 50 94 C 27 94 10 83 10 65 C 10 48 20 32 41 24 Z"}),Gr=dr({name:"funnel",category:"business",minUnits:80,source:"original",path:"M 6 10 L 94 10 L 58 56 L 58 92 L 42 92 L 42 56 Z"}),Ur=dr({name:"gear",category:"technology",minUnits:260,source:"original",path:"M 82 50.9 L 96.8 54.3 L 93.2 68.5 L 78.6 64.4 L 73.9 71.2 L 83.1 83.3 L 71.2 92 L 62.6 79.4 L 54.7 81.7 L 53.9 96.8 L 39.3 95.8 L 40.8 80.6 L 33.2 77.3 L 22.9 88.4 L 12.4 78.2 L 23.2 67.5 L 19.6 60.1 L 4.6 62 L 3.1 47.4 L 18.2 46.2 L 20.2 38.2 L 7.5 30 L 15.7 17.8 L 28.1 26.7 L 34.8 21.9 L 30.3 7.3 L 44.4 3.3 L 48.2 18 L 56.4 18.7 L 62.3 4.6 L 75.7 10.7 L 69.2 24.4 L 75.1 30.1 L 88.6 23.2 L 95 36.4 L 81.2 42.7 Z M 37 50 A 13 13 0 0 0 63 50 A 13 13 0 0 0 37 50 Z"}),Kr=dr({name:"robot",category:"technology",minUnits:220,source:"original",path:"M 18 40 C 18 30 26 26 36 26 L 64 26 C 74 26 82 30 82 40 L 82 72 C 82 82 74 86 64 86 L 36 86 C 26 86 18 82 18 72 Z M 46 14 L 54 14 L 54 28 L 46 28 Z M 44 12 A 6 6 0 0 1 56 12 A 6 6 0 0 1 44 12 Z M 29 50 A 7 7 0 0 0 43 50 A 7 7 0 0 0 29 50 Z M 57 50 A 7 7 0 0 0 71 50 A 7 7 0 0 0 57 50 Z"}),Vr=dr({name:"pin",category:"geography",minUnits:120,source:"original",path:"M 50 96 C 50 96 16 56 16 38 C 16 20 31 6 50 6 C 69 6 84 20 84 38 C 84 56 50 96 50 96 Z M 39 37 A 11 11 0 0 0 61 37 A 11 11 0 0 0 39 37 Z"}),Zr=dr({name:"mountain",category:"geography",minUnits:60,source:"original",path:"M 2 90 L 34 26 L 50 56 L 64 18 L 98 90 Z"}),Qr=new Map;function Jr(t){const e=t.path||"",i=t.order||"rows",n=null==t.padding?.94:t.padding,s=null==t.rowRatio?.88:t.rowRatio,r=null==t.sampling?.6:t.sampling,a=Math.max(.5,(null==t.width?16:t.width)/2);return(t,o)=>{if(!t.length||!e)return[];const{polys:l,bounds:c}=function(t,e){const i=`${e}|${t}`;let n=Qr.get(i);if(!n){const s=Zs(t,e,!0);n={polys:s,bounds:Qs(s)},Qr.set(i,n)}return n}(e,r);if(!l.length)return[];const h=function(t,e,i){const n=Math.max(1e-6,i*e.scale),s=[];let r=1/0,a=-1/0,o=1/0,l=-1/0;if(t.forEach(t=>{for(let i=0;i+1<t.length;i++){const c=e.offX+t[i].x*e.scale,h=e.offY+t[i].y*e.scale,u=e.offX+t[i+1].x*e.scale,d=e.offY+t[i+1].y*e.scale,p=Math.hypot(u-c,d-h),f=p>1e-9?-(d-h)/p*n:n,g=p>1e-9?(u-c)/p*n:0;s.push({ax:c,ay:h,bx:u,by:d,nx:f,ny:g}),Math.min(c,u)-n<o&&(o=Math.min(c,u)-n),Math.max(c,u)+n>l&&(l=Math.max(c,u)+n),Math.min(h,d)-n<r&&(r=Math.min(h,d)-n),Math.max(h,d)+n>a&&(a=Math.max(h,d)+n)}}),!s.length)return{minY:0,maxY:0,minX:0,maxX:0,spansAt:()=>[]};const c=Math.max(1e-6,a-r),h=[];for(let t=0;t<Js;t++)h.push([]);s.forEach(t=>{const e=Math.min(t.ay,t.by)-n,i=Math.max(t.ay,t.by)+n;let s=Math.floor((e-r)/c*Js),a=Math.floor((i-r)/c*Js);s=Math.max(0,Math.min(127,s)),a=Math.max(0,Math.min(127,a));for(let e=s;e<=a;e++)h[e].push(t)});const u=(t,e,i)=>{const s=i-e;if(s<=-n||s>=n)return null;const r=Math.sqrt(n*n-s*s);return{x0:t-r,x1:t+r}};return{minY:r,maxY:a,minX:o,maxX:l,spansAt:t=>{const e=Math.floor((t-r)/c*Js);if(e<0||e>127)return[];const i=h[e],n=[];for(let e=0;e<i.length;e++){const s=i[e],r=[s.ax+s.nx,s.bx+s.nx,s.bx-s.nx,s.ax-s.nx],a=[s.ay+s.ny,s.by+s.ny,s.by-s.ny,s.ay-s.ny];let o=1/0,l=-1/0;for(let e=0;e<4;e++){const i=(e+1)%4,n=a[e],s=a[i];if(n===s)continue;const c=Math.min(n,s),h=Math.max(n,s);if(t<c||t>=h)continue;const u=r[e]+(t-n)/(s-n)*(r[i]-r[e]);u<o&&(o=u),u>l&&(l=u)}l>o&&n.push({x0:o,x1:l});const c=u(s.ax,s.ay,t);c&&n.push(c);const h=u(s.bx,s.by,t);h&&n.push(h)}if(!n.length)return[];n.sort((t,e)=>t.x0-e.x0);const s=[n[0]];for(let t=1;t<n.length;t++){const e=s[s.length-1];n[t].x0<=e.x1?n[t].x1>e.x1&&(e.x1=n[t].x1):s.push(n[t])}return s}}}(l,tr({x0:c.x0-a,y0:c.y0-a,x1:c.x1+a,y1:c.y1+a},o,n),a),u=nr(h,t.length,s),d=er(h,u,u*s);if(!d.cells.length)return[];const p=ir(d.cells.map(t=>t.cap),t.length),f=sr(t[0].r>0?t[0].r:3,u),g=[];return d.cells.forEach((t,e)=>{or(t,p[e],u,d.inset,f,g)}),ar(t,g,i,u)}}function ta(t){return cr(l(o({},t),{kind:"stroke"}),Jr)}const ea=[pr,fr,gr,mr,yr,xr,_r,br,Cr,Er,Fr,Pr,Dr,Rr,Tr,Nr,Or,$r,Ir,Br,zr,Wr,Hr,jr,Yr,qr,Xr,Gr,Ur,Kr,Vr,Zr,ta({name:"check",category:"symbols",minUnits:40,width:19,source:"original",path:"M 13 55 L 37 79 L 87 22"}),ta({name:"wifi",category:"technology",minUnits:120,width:8,source:"original",path:"M 11.9 62 A 44 44 0 0 1 88.1 62 M 24 69 A 30 30 0 0 1 76 69 M 36.1 76 A 16 16 0 0 1 63.9 76 M 50 86 L 50 86"}),ta({name:"pulse",category:"technology",minUnits:60,width:11,source:"original",path:"M 4 58 L 26 58 L 35 30 L 47 84 L 59 44 L 68 58 L 96 58"}),ta({name:"xmark",category:"symbols",minUnits:40,width:18,source:"original",path:"M 18 18 L 82 82 M 82 18 L 18 82"}),ta({name:"percent",category:"symbols",minUnits:150,width:9,source:"original",path:"M 12 24 A 12 12 0 0 1 36 24 A 12 12 0 0 1 12 24 Z M 64 76 A 12 12 0 0 1 88 76 A 12 12 0 0 1 64 76 Z M 80 14 L 20 86"}),ta({name:"question",category:"symbols",minUnits:90,width:14,source:"original",path:"M 25 32 C 25 8 76 8 76 33 C 76 52 50 54 50 70 M 50 90 L 50 90"}),ta({name:"spiral",category:"symbols",minUnits:140,width:9,source:"generated",path:"M 56.0 50.0 L 56.4 51.4 L 56.5 52.9 L 56.2 54.5 L 55.5 56.1 L 54.3 57.5 L 52.9 58.8 L 51.0 59.7 L 48.9 60.3 L 46.6 60.3 L 44.3 59.9 L 42.0 58.9 L 39.9 57.3 L 38.1 55.3 L 36.8 52.8 L 35.9 50.0 L 35.7 47.0 L 36.2 43.8 L 37.3 40.8 L 39.1 37.9 L 41.6 35.5 L 44.7 33.5 L 48.1 32.3 L 51.9 31.7 L 55.8 32.0 L 59.7 33.1 L 63.4 35.1 L 66.6 37.9 L 69.3 41.4 L 71.1 45.5 L 72.2 50.0 L 72.2 54.7 L 71.2 59.4 L 69.2 64.0 L 66.3 68.1 L 62.4 71.5 L 57.8 74.1 L 52.7 75.8 L 47.2 76.3 L 41.7 75.7 L 36.2 73.8 L 31.2 70.9 L 26.8 66.8 L 23.4 61.9 L 21.0 56.2 L 19.8 50.0 L 19.9 43.6 L 21.4 37.3 L 24.2 31.3 L 28.3 25.9 L 33.5 21.5 L 39.7 18.2 L 46.4 16.2 L 53.6 15.7 L 60.8 16.6 L 67.8 19.2 L 74.2 23.1 L 79.7 28.4 L 84.0 34.9 L 86.9 42.1 L 88.3 50.0 L 88.0 58.1 L 86.0 66.0 L 82.3 73.5 L 77.1 80.1 L 70.5 85.5 L 62.8 89.5 L 54.4 91.8 L 45.5 92.4 L 36.7 91.0 L 28.2 87.8 L 20.4 82.9 L 13.8 76.3 L 8.6 68.4 L 5.2 59.5 L 3.6 50.0 L 4.1 40.2 L 6.6 30.7 L 11.2 21.8"})],ia="__apexcharts_unit_layouts__";function na(t){const e=l(o({},t),{viewBox:t.viewBox||[0,0,100,100]});return e.with=e=>na(o(o({},t),e)),Object.freeze(e)}const sa=[na({name:"person",category:"people",source:"original",path:"M 37 18 A 13 13 0 0 1 63 18 A 13 13 0 0 1 37 18 Z M 50 34 C 61 34 69 40 70 50 L 73 72 L 65 72 L 63 58 L 61 96 L 53 96 L 51 66 L 49 66 L 47 96 L 39 96 L 37 58 L 35 72 L 27 72 L 30 50 C 31 40 39 34 50 34 Z"}),na({name:"house",category:"objects",source:"original",path:"M 50 8 L 94 46 L 82 46 L 82 92 L 58 92 L 58 64 L 42 64 L 42 92 L 18 92 L 18 46 L 6 46 Z"}),na({name:"heart",category:"symbols",source:"original",path:"M 50 90 C 22 70 6 54 6 36 C 6 21 17 11 30 11 C 39 11 46 16 50 24 C 54 16 61 11 70 11 C 83 11 94 21 94 36 C 94 54 78 70 50 90 Z"}),na({name:"tree",category:"nature",source:"original",path:"M 50 6 C 66 6 78 18 78 33 C 78 38 77 42 75 46 C 82 50 86 57 86 65 C 86 77 76 86 64 86 L 55 86 L 55 96 L 45 96 L 45 86 L 36 86 C 24 86 14 77 14 65 C 14 57 18 50 25 46 C 23 42 22 38 22 33 C 22 18 34 6 50 6 Z"}),na({name:"droplet",category:"nature",source:"original",path:"M 50 4 C 50 4 84 42 84 64 C 84 82 69 96 50 96 C 31 96 16 82 16 64 C 16 42 50 4 50 4 Z"}),na({name:"star",category:"symbols",source:"original",path:"M 50 6 L 61.2 36.6 L 93.8 37.8 L 68.1 57.9 L 77 89.2 L 50 71 L 23 89.2 L 31.9 57.9 L 6.2 37.8 L 38.8 36.6 Z"}),na({name:"car",category:"transport",source:"original",path:"M 6 72 L 9 53 C 10 46 15 41 22 40 L 32 23 C 35 19 39 17 44 17 L 60 17 C 65 17 69 19 71 23 L 81 40 C 88 41 93 46 94 53 L 97 72 L 97 80 L 6 80 Z M 13 88 A 11 11 0 1 1 35 88 A 11 11 0 1 1 13 88 Z M 65 88 A 11 11 0 1 1 87 88 A 11 11 0 1 1 65 88 Z"}),na({name:"bag",category:"objects",source:"original",path:"M 10 30 L 90 30 L 95 96 L 5 96 Z M 32 30 C 32 14 40 4 50 4 C 60 4 68 14 68 30 L 59 30 C 59 19 55 13 50 13 C 45 13 41 19 41 30 Z"}),na({name:"book",category:"objects",source:"original",path:"M 8 14 C 8 14 26 6 50 16 C 74 6 92 14 92 14 L 92 88 C 92 88 74 80 50 90 C 26 80 8 88 8 88 Z"}),na({name:"cup",category:"objects",source:"original",path:"M 14 22 L 70 22 L 70 34 L 80 34 C 90 34 96 41 96 51 C 96 63 87 71 75 71 L 69 71 C 65 84 55 92 42 92 C 26 92 14 79 14 61 Z"}),na({name:"bulb",category:"objects",source:"original",path:"M 50 4 C 32 4 18 18 18 36 C 18 48 25 56 31 63 C 35 68 37 72 37 78 L 63 78 C 63 72 65 68 69 63 C 75 56 82 48 82 36 C 82 18 68 4 50 4 Z M 38 84 L 38 90 L 62 90 L 62 84 Z M 42 94 L 45 99 L 55 99 L 58 94 Z"}),na({name:"plane",category:"transport",source:"original",path:"M 50 4 C 55 4 58 12 58 24 L 58 38 L 94 62 L 94 72 L 58 60 L 58 82 L 70 90 L 70 97 L 50 92 L 30 97 L 30 90 L 42 82 L 42 60 L 6 72 L 6 62 L 42 38 L 42 24 C 42 12 45 4 50 4 Z"})],ra="__apexcharts_unit_marks__";!function(t){const e=function(){const t=globalThis;return t[ia]||(t[ia]={}),t[ia]}(),i=[];(Array.isArray(t)?t.map(t=>[t.shape?t.shape.name:"",t]):Object.entries(t)).forEach(([t,n])=>{const s=String(t),r=n;s&&"function"==typeof r&&(e[s]=r,i.push(s))})}(ea),function(t){const e=function(){const t=globalThis;return t[ra]||(t[ra]={}),t[ra]}(),i=[];(Array.isArray(t)?t.map(t=>[t?t.name:"",t]):Object.entries(t)).forEach(([t,n])=>{const s=String(t);s&&n&&"string"==typeof n.path&&(e[s]=n,i.push(s))})}(sa);const aa=f.default;aa.unitShapes=ea,aa.pictograms=sa,Object.defineProperty(exports,"default",{enumerable:!0,get:()=>f.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,o=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&a(t,i,e[i]);if(n)for(var i of n(e))r.call(e,i)&&a(t,i,e[i]);return t},l=(t,n)=>e(t,i(n)),c=(t,e)=>{var i={};for(var a in t)s.call(t,a)&&e.indexOf(a)<0&&(i[a]=t[a]);if(null!=t&&n)for(var a of n(t))e.indexOf(a)<0&&r.call(t,a)&&(i[a]=t[a]);return i},h=(t,e,i)=>new Promise((n,s)=>{var r=t=>{try{o(i.next(t))}catch(t){s(t)}},a=t=>{try{o(i.throw(t))}catch(t){s(t)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(r,a);o((i=i.apply(t,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("apexcharts"),u=require("apexcharts/core");function p(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 n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const f=(t=>t&&t.__esModule?t:{default:t})(d),g=p(u),m=g.__apex_CoreUtils,y=g.__apex_ChartFactory_getChartClass,x=g.__apex_Fill,_=g.__apex_Graphics,b=g.__apex_Series,v=g.__apex_Animations,w=g.__apex_Animations_prefersReducedMotion,A=g.__apex_BrowserAPIs_BrowserAPIs,M=g.__apex_Environment_Environment,k=g.__apex_Easing_resolveEasing,L=g.__apex_PathMorphing_parsePath,S=g.__apex_PathMorphing_arrayToPath;function C(t,e,i){if(!t||"string"!=typeof t)return null;const n=L(t);if(!n.length||"M"!==n[0][0])return null;for(let t=1;t<n.length;t++)if("M"===n[t][0])return null;let s=n,r=null;if(i){if(n.length<5)return null;if(r=n.slice(-3),s=n.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===n[n.length-1][0])return null;if(s.length!==e||s.length<2)return null;const a=s[1][0];if("L"!==a&&"C"!==a)return null;for(let t=2;t<s.length;t++)if(s[t][0]!==a)return null;const o=s.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:s,closing:r,segType:a,anchors:o}}function E(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function F(t,e,i){const n=t,s=[e[1],e[2]],r=[e[3],e[4]],a=[e[5],e[6]],o=E(n,s,i),l=E(s,r,i),c=E(r,a,i),h=E(o,l,i),d=E(l,c,i),u=E(h,d,i);return{first:["C",o[0],o[1],h[0],h[1],u[0],u[1]],second:["C",d[0],d[1],c[0],c[1],a[0],a[1]],mid:u}}function D(t,e,i){const n=[e[1],e[2]],s=E(t,n,i);return{first:["L",s[0],s[1]],second:["L",n[0],n[1]],mid:s}}function P(t,e){const{body:i,closing:n,segType:s,anchors:r}=t,a=r.length,o=e.length,l=t=>"C"===s?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],c=[["M",r[0][0],r[0][1]]];let h=0;for(;h<o&&0!==e[h];)h++;for(let t=1;t<=h;t++)c.push(l(r[0]));let d=h+1;for(let t=0;t<a-1;t++){let n=0;for(;d+n<o&&-1===e[d+n];)n++;const a=i[t+1];if(n){const e=n+1;let i=r[t],o=a;for(let t=0;t<n;t++){const n=1/(e-t),r="C"===s?F(i,o,n):D(i,o,n);c.push(r.first),i=r.mid,o=r.second}c.push(o)}else c.push(a.slice());d+=n+1}for(;d<o;)c.push(l(r[a-1])),d++;return n&&n.forEach(t=>c.push(t.slice())),c}function R(t,e,i,n,s,r){const a=C(t,n,r);if(!a)return null;const o=C(e,s,r);if(!o)return null;if(a.segType!==o.segType)return null;if((a.closing||o.closing)&&(!a.closing||!o.closing||a.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),c=i.map(t=>t.newJ);return{from:S(P(a,l)),toInterp:S(P(o,c))}}function T(t,e,i){var n,s,r,a;if(null==(n=t.axisFlags)?void 0:n.isXNumeric){const n=null==(r=null==(s=t.seriesData)?void 0:s.seriesX)?void 0:r[e];if(n&&n.length&&null!=n[i])return"x:"+n[i]}const o=null==(a=t.globals.labels)?void 0:a[i];return null!=o&&""!==String(o)?"c:"+(Array.isArray(o)?o.join(" "):String(o)):"j:"+i}function N(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function O(t,e,i=!1,n=!1){var s,r;if(!function(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const n=null!=(e=i.largeDatasetThreshold)?e:0;return!(n>0&&t.globals.dataPoints>n||!(M.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate))}(t))return null;const a=t.globals.prevStreamFrame;if(!a)return null;const o=null==(s=a.seriesY)?void 0:s[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(o)||!Array.isArray(l))return null;if(!o.length||!l.length)return null;const c=N(o.map((t,i)=>function(t,e,i){var n,s;if(t.isXNumeric){const s=null==(n=t.seriesX)?void 0:n[e];if(s&&s.length&&null!=s[i])return"x:"+s[i]}const r=null==(s=t.labels)?void 0:s[i];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+i}(a,e,i))),h=function(t,e,i=0|(i=>null==(i=t.seriesData.series[e])?void 0:i.length)()){return N(Array.from({length:i},(i,n)=>T(t,e,n)))}(t,e),d=function(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const n=new Array(e.length),s=new Set;let r=-1,a=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!s.has(i.get(t))?i.get(t):-1;n[e]=l,-1!==l&&(s.add(l),l<r&&(a=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)s.has(e)||l.push(e);return{toOld:n,exits:l,ordered:a,changed:!o}}(c,h);return(d.ordered||n)&&(d.changed||i)?{join:d,oldKeys:c,newKeys:h}:null}function $(t,{type:e,realIndex:i,pathFromLine:n,pathFromArea:s,linePaths:r,areaPaths:a}){var o,l;const c=O(t,i);if(!c)return null;const{join:h,oldKeys:d,newKeys:u}=c,p=t.globals.prevStreamFrame;if(!p)return null;const f=null==(o=p.seriesY)?void 0:o[i],g=null==(l=t.seriesData.series)?void 0:l[i];if(f.length<2||g.length<2)return null;if(f.some(t=>null===t)||g.some(t=>null===t))return null;const m=function(t,e){const i=new Set(t.exits),n=[];let s=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;s<r;)i.has(s)&&n.push({oldJ:s,newJ:-1}),s++;n.push({oldJ:r,newJ:e}),s=r+1}else n.push({oldJ:-1,newJ:e})}for(;s<e;)i.has(s)&&n.push({oldJ:s,newJ:-1}),s++;return n}(h,d.length),y={};return Array.isArray(r)&&1===r.length&&n&&(y.line=R(n,r[0],m,d.length,u.length,!1)),"area"===e&&Array.isArray(a)&&1===a.length&&s&&(y.area=R(s,a[0],m,d.length,u.length,!0)),y.line||y.area?y:null}const I=g.__apex_Utils,B=t=>{const e=function(t){const e=[];let i=t[0],n=t[1],s=e[0]=W(i,n),r=1;for(let a=t.length-1;r<a;r++)i=n,n=t[r+1],e[r]=.5*(s+(s=W(i,n)));return e[r]=s,e}(t),i=t.length-1,n=[];let s,r,a,o;for(let n=0;n<i;n++)a=W(t[n],t[n+1]),Math.abs(a)<1e-6?e[n]=e[n+1]=0:(s=e[n]/a,r=e[n+1]/a,o=s*s+r*r,o>9&&(o=3*a/Math.sqrt(o),e[n]=o*s,e[n+1]=o*r));for(let s=0;s<=i;s++)o=(t[Math.min(i,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+e[s]*e[s])),n.push([o||0,e[s]*o||0]);return n},z={points(t){const e=B(t),i=t[1],n=t[0],s=[],r=e[1],a=e[0];s.push(n,[n[0]+a[0],n[1]+a[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,n=e.length;i<n;i++){const n=t[i],r=e[i];s.push([n[0]-r[0],n[1]-r[1],n[0],n[1]])}return s},slice(t,e,i){const n=t.slice(e,i);if(e){if(i-e>1&&n[1].length<6){const t=n[0].length;n[1]=[2*n[0][t-2]-n[0][t-4],2*n[0][t-1]-n[0][t-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n}};function W(t,e){return(e[1]-t[1])/(e[0]-t[0])}function H({graphics:t,w:e,elSeries:i,pointsByCat:n,options:s,distributed:r,realIndex:a,wrapClass:o,pointClass:l}){if(!s||!1===s.show||!n.length)return;const c=null!=s.opacity?s.opacity:.9,h=null!=s.strokeColor?s.strokeColor:"#fff",d=null!=s.strokeWidth?s.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:u?`${o} apexcharts-element-hidden`:o});u&&e.globals.delayedElements.push({el:p.node}),n.forEach(({groups:i,j:n})=>{const o=r?e.globals.colors[n]:e.globals.colors[a],u=s.fillColor,f="series"===u?o:"series-dark"===u?j(o,.45):u||j(o,.45);i.forEach(i=>{const s=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:f,stroke:d>0?h:"none",strokeWidth:d,fillOpacity:c,classes:l});s.attr("data:realIndex",a),s.attr("j",n),s.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),s.node.style.pointerEvents="none",p.add(s)})}),i.add(p)}function j(t,e){const i=I.parseColor(t)||I.parseColor(I.resolveColor(t));if(!i)return t;const n=Math.max(0,1-e);return`rgb(${Math.round(i[0]*n)},${Math.round(i[1]*n)},${Math.round(i[2]*n)})`}function Y(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),n=Math.floor(i),s=i-n,r=I.parseHex(t[n])||[0,0,0],a=I.parseHex(t[Math.min(n+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*s);return`rgb(${o(r[0],a[0])},${o(r[1],a[1])},${o(r[2],a[2])})`}function q(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function X(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function G(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const U=class{};class K extends U{constructor(t,e,i){!function(){const t=y("bar");if(Object.getPrototypeOf(K)===t)return;Object.setPrototypeOf(K,t),Object.setPrototypeOf(K.prototype,t.prototype)}(),super(t,e,i)}draw(t,e,i){var n,s,r;const a=this.w,o=new _(this.w),l=new x(this.w);this.violinOptions=a.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.jx=function(t,e){let i=1/0,n=-1/0;return t.slice(0,e.seriesData.series.length).flat(2).forEach(t=>{t===+t&&(t<i&&(i=t),t>n&&(n=t))}),[i,n]}(a.violinData.seriesViolinPoints,a),this.boxOptions=this.violinOptions.box||{},this.cloudSign=Z(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:Z(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?Q(this.boxOptions.width,.15):0,this.rainFrac=Q(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=a.config.plotOptions.bar.distributed,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.coreUtils=new m(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,i);const c=o.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let h,d;const u=[],p=[],f=a.globals.comboCharts?i[e]:e,{columnGroupIndex:g}=this.barHelpers.getGroupIndex(f),m=o.group({class:"apexcharts-series",seriesName:I.escapeString(a.seriesData.seriesNames[f]),rel:e+1,"data:realIndex":f});b.addCollapsedClassToSeries(this.w,m,f),t[e].length>0&&(this.visibleI=this.visibleI+1);const y=this.setSeriesAxis(f),x=this.barHelpers.initialPositions(f),{y:_,barHeight:v,yDivision:w,zeroW:A,x:M,barWidth:k,xDivision:L,zeroH:S}=x;d=_,h=M,p.push(h+(null!=k?k:0)/2);const C=o.group({class:"apexcharts-datalabels","data:realIndex":f});if(this.seriesMaxWeight=0,"group"===this.normalize){(a.violinData.seriesViolinDensity[f]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const E=[];for(let i=0;i<a.globals.dataPoints;i++){const o=this.barHelpers.getStrokeWidth(e,i,f),c=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:i,realIndex:f,translationsIndex:y},y:d,yDivision:w,barHeight:v,zeroW:A}):this.drawVerticalViolin({indexes:{i:e,j:i,realIndex:f,translationsIndex:y},x:h,xDivision:L,barWidth:k,zeroH:S});h=c.x,d=c.y,i>0&&p.push(c.center),u.push(c.alongRepresentative);const x=this.buildPointsSubPath({realIndex:f,j:i,center:c.center,halfExtent:c.halfExtent,alongFn:c.alongFn,density:c.density,maxWeight:c.maxWeight,cloudBase:c.cloudBase,cloudMaxPx:c.cloudMaxPx,rainCenter:c.rainCenter,rainHalfPx:c.rainHalfPx});x.length&&E.push({groups:x,j:i});const _=l.fillPath({seriesNumber:this.distributed?i:f,dataPointIndex:i,color:this.distributed?a.globals.colors[i]:void 0,value:t[e][i]});this.renderSeries({realIndex:f,pathFill:_,lineFill:a.globals.stroke.colors[f],j:i,i:e,pathFrom:c.pathFrom,pathTo:c.pathTo,strokeWidth:o,elSeries:m,x:h,y:d,series:t,columnGroupIndex:g,barHeight:v,barWidth:k,elDataLabelsWrap:C,visibleSeries:this.visibleI,type:"violin"});const b=m.node.querySelector(`path.apexcharts-violin-area[j='${i}']`);if(b&&isFinite(c.alongRepresentative)&&b.setAttribute(this.isHorizontal?"cx":"cy",`${c.alongRepresentative}`),b&&b.setAttribute("data:center",`${c.center}`),c.boxPaths){const s=null!=(n=this.boxOptions.strokeWidth)?n:1;c.boxPaths.forEach(n=>{this.renderSeries({realIndex:f,pathFill:n.filled?this.boxOptions.fillColor||_:"none",lineFill:a.globals.stroke.colors[f],j:i,i:e,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:s,elSeries:m,x:h,y:d,series:t,columnGroupIndex:g,barHeight:v,barWidth:k,elDataLabelsWrap:C,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box",noLabel:!0})})}const M=!b&&(null==(r=null==(s=a.globals.barCanvasCoords)?void 0:s[f])?void 0:r[i]);M&&isFinite(c.alongRepresentative)&&(this.isHorizontal?M.cx=c.alongRepresentative:(M.bodyCx=M.cx,M.cx=c.center,M.cy=c.alongRepresentative))}H({graphics:o,w:a,elSeries:m,pointsByCat:E,options:this.pointsOptions,distributed:this.distributed,realIndex:f,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),a.globals.seriesXvalues[f]=p,a.globals.seriesYvalues[f]=u,c.add(m)}return c}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:n,zeroH:s}){var r,a,o,l,c,h,d;const u=this.w,{realIndex:p,j:f,translationsIndex:g}=t,m=this.yRatio[g]*(this.isReversed?-1:1);let y=e+n*this.visibleI;u.axisFlags.isXNumeric&&({x:e,barXPosition:y}=this.getBarXForNumericXAxis({x:e,barWidth:n,realIndex:p,j:f}));const x=y+n/2,_=n/2,b=this.getDensity(p,f),v=this.effectiveMaxWeight(b),w=t=>s-this.logVal(t,p)/m,A=J({halfExtent:_,cloudSign:null!=(r=this.cloudSign)?r:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(o=this.boxFrac)?o:0,rainFrac:null!=(l=this.rainFrac)?l:0}),M=x+A.cloudBaseOff,k=this.buildBodyPath({nodes:b.nodes,center:M,halfExtent:A.cloudMaxPx,maxWeight:v,vertical:!0,alongFn:w,collapsed:!1,sideSign:this.cloudSign});let L=null;const S=null==(h=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:h.getInitialPathFor(p,f);return S?L=S:u.globals.previousPaths.length>0&&(L=this._prevBody(p,f,k)),null==L&&(L=this.buildBodyPath({nodes:b.nodes,center:M,halfExtent:A.cloudMaxPx,maxWeight:v,vertical:!0,alongFn:w,collapsed:!0,sideSign:this.cloudSign})),u.axisFlags.isXNumeric||(e+=i),{pathTo:k,pathFrom:L,x:e,y:s,center:x,halfExtent:_,alongFn:w,density:b,maxWeight:v,cloudBase:M,cloudMaxPx:A.cloudMaxPx,rainCenter:x+A.rainCenterOff,rainHalfPx:A.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:f,boxCenter:x+A.boxCenterOff,boxHalfPx:A.boxHalfPx,alongFn:w,vertical:!0}),alongRepresentative:w(null!=(d=u.seriesData.series[p][f])?d:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:n,zeroW:s}){var r,a,o,l,c,h,d;const u=this.w,{realIndex:p,j:f}=t,g=this.invertedYRatio*(this.isReversed?-1:1),m=e+n*this.visibleI+n/2,y=n/2,x=this.getDensity(p,f),_=this.effectiveMaxWeight(x),b=t=>s+this.logVal(t,p)/g,v=J({halfExtent:y,cloudSign:null!=(r=this.cloudSign)?r:0,rainSign:null!=(a=this.rainSign)?a:0,boxFrac:null!=(o=this.boxFrac)?o:0,rainFrac:null!=(l=this.rainFrac)?l:0}),w=m+v.cloudBaseOff,A=this.buildBodyPath({nodes:x.nodes,center:w,halfExtent:v.cloudMaxPx,maxWeight:_,vertical:!1,alongFn:b,collapsed:!1,sideSign:this.cloudSign});let M=null;const k=null==(h=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:h.getInitialPathFor(p,f);return k?M=k:u.globals.previousPaths.length>0&&(M=this._prevBody(p,f,A)),null==M&&(M=this.buildBodyPath({nodes:x.nodes,center:w,halfExtent:v.cloudMaxPx,maxWeight:_,vertical:!1,alongFn:b,collapsed:!0,sideSign:this.cloudSign})),{pathTo:A,pathFrom:M,x:s,y:e+=i,center:m,halfExtent:y,alongFn:b,maxWeight:_,density:x,cloudBase:w,cloudMaxPx:v.cloudMaxPx,rainCenter:m+v.rainCenterOff,rainHalfPx:v.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:p,j:f,boxCenter:m+v.boxCenterOff,boxHalfPx:v.boxHalfPx,alongFn:b,vertical:!1}),alongRepresentative:b(null!=(d=u.seriesData.series[p][f])?d:0)}}getDensity(t,e){var i;const n=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!n||!n.values.length)return{nodes:[],maxWeight:0};const s=n.values.map((t,e)=>e);s.sort((t,e)=>n.values[t]-n.values[e]);const r=[];let a=null;for(const t of s){const e=n.values[t];null!==a&&e===a||(r.push({v:e,w:n.weights[t]}),a=e)}return{nodes:r,maxWeight:n.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:n,vertical:s,alongFn:r,collapsed:a,sideSign:o=0}){const l=new _(this.w);if(0===t.length){const t=r(0);return s?l.move(e,t)+l.line(e,t):l.move(t,e)+l.line(t,e)}const c=t=>{if(a||n<=0)return 0;const e=t/n*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},h=[],d=[];for(let i=0;i<t.length;i++){const n=r(t[i].v),a=c(t[i].w),l=0===o?e+a:e+o*a,u=0===o?e-a:e;s?(h.push([l,n]),d.push([u,n])):(h.push([n,l]),d.push([n,u]))}return d.reverse(),this.smoothSegment(h,s,!1)+this.smoothSegment(d,s,!0)+"z"}_prevBody(t,e,i){var n,s;const r=null==(s=null==(n=this._prevKeyedPaths(t))?void 0:n.get(T(this.w,t,e)))?void 0:s.d;return r&&K.pathCommandCount(r)===K.pathCommandCount(i)?r:null}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:n,alongFn:s,vertical:r}){var a,o,l;const c=this.w;if(!this.boxShown||n<=0)return null;const h=null==(a=c.violinData.seriesViolinSummary[t])?void 0:a[e];if(!h)return null;const d=n*Math.min(1,Math.max(0,null!=(o=this.boxOptions.capWidth)?o:.5)),[u,p,f,g,m]=h.map(t=>s(t)),y=(t,e)=>{const n=new _(this.w),s=(t,e)=>r?[t,e]:[e,t],a=t=>t.map(([t,e],i)=>0===i?n.move(t,e):n.line(t,e)).join(""),o=i;return{whiskers:a([s(o,u),s(o,p)])+a([s(o,g),s(o,m)])+a([s(o-t,u),s(o+t,u)])+a([s(o-t,m),s(o+t,m)]),box:a([s(o-e,p),s(o+e,p),s(o+e,g),s(o-e,g)])+"z"+a([s(o-e,f),s(o+e,f)])}},x=y(d,n),b=y(0,0),v=c.globals.previousPaths.length?this._prevKeyedPaths(t):null,w=(null==(l=null==v?void 0:v.get(T(c,t,e)))?void 0:l.box)||[];return[{pathTo:x.whiskers,pathFrom:w[0]||b.whiskers,filled:!1},{pathTo:x.box,pathFrom:w[1]||b.box,filled:!0}]}smoothSegment(t,e,i){const n=new _(this.w),s=t[0];let r=i?n.line(s[0],s[1]):n.move(s[0],s[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=n.line(t[e][0],t[e][1]);return r}const a=t.map(([t,i])=>e?[i,t]:[t,i]),o=z.points(a);return r+=(t=>{let e="";for(let i=0;i<t.length;i++){const n=t[i],s=n.length;s>4?(e+=`C${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`,e+=`, ${n[4]}, ${n[5]}`):s>2&&(e+=`S${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`)}return e})(e?o.map(V):o),r}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:n,alongFn:s,density:r,maxWeight:a,cloudBase:o,cloudMaxPx:l,rainCenter:c,rainHalfPx:h}){var d;const u=0!==this.rainSign,p=u?c:0!==this.cloudSign?o:i,f=u?h:0!==this.cloudSign?l:n;return function({points:t,extent:e,seedA:i,seedB:n,center:s,halfExtent:r,alongFn:a,isHorizontal:o,options:l,clampAt:c,sideSign:h}){var d,u;const p=l;if(!p||!1===p.show)return[];if(!t||!t.length)return[];const f=p.maxPoints||3e3,g=t.length>f?Math.ceil(t.length/f):1,m=null!=p.size?p.size:2.5,y=r*(null!=p.jitter?p.jitter:.5),x=!1!==p.constrainToViolin&&"function"==typeof c,_="square"===p.shape,b=p.colorScale,v=b&&Array.isArray(b.colors)&&b.colors.length>0,w=v?Math.max(2,b.steps||24):1,A=null!=(d=null==b?void 0:b.min)?d:e[0],M=(null!=(u=null==b?void 0:b.max)?u:e[1])-A||1,k=v?new Array(w).fill(""):[""];for(let e=0;e<t.length;e+=g){const r=t[e],l=a(r);let d=2*(q(7919*i+100003*n+e)-.5)*y;if(x){const t=c(r);d>t&&(d=t),d<-t&&(d=-t)}h&&(d=Math.abs(d)*h);const u=o?l:s+d,p=o?s+d:l,f=_?G(u,p,m):X(u,p,m);if(v){let t=(r-A)/M;t<0&&(t=0),t>1&&(t=1),k[Math.round(t*(w-1))]+=f}else k[0]+=f}if(!v)return k[0]?[{fill:null,d:k[0]}]:[];const L=[];for(let t=0;t<w;t++)k[t]&&L.push({fill:Y(b.colors,t/(w-1)),d:k[t]});return L}({points:null==(d=this.w.violinData.seriesViolinPoints[t])?void 0:d[e],extent:this.jx,seedA:t,seedB:e,center:p,halfExtent:f,alongFn:s,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:u?null:t=>this.halfWidthAtValue(t,r,f,a),sideSign:u?0:this.cloudSign})}halfWidthAtValue(t,e,i,n){const{nodes:s}=e,r=null!=n?n:e.maxWeight;if(!s.length||r<=0)return 0;const a=t=>Math.min(i,t/r*i*this.bandwidthScale);if(t<=s[0].v)return a(s[0].w);if(t>=s[s.length-1].v)return a(s[s.length-1].w);for(let e=1;e<s.length;e++)if(t<=s[e].v){const i=s[e-1],n=s[e],r=n.v===i.v?0:(t-i.v)/(n.v-i.v);return a(i.w+(n.w-i.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function V(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function Z(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function Q(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function J({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:n,rainFrac:s}){const r=n*t,a=0===i?t:s*t,o=0===i?0:i*(t-a);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:r,rainCenterOff:o,rainHalfPx:a};const l=0===i?0:s,c=2*Math.max(0,1-l-n)*t,h=e*(t-c);return{cloudBaseOff:h,cloudMaxPx:c,boxCenterOff:h-e*r,boxHalfPx:r,rainCenterOff:o,rainHalfPx:a}}g.default.use({violin:K});const tt=globalThis.console;function et(t,...e){tt.error(t,...e)}function it(t){tt.warn(t)}const nt="APEX-",st=new Date("2027-07-31T00:00:00Z"),rt="__apex_license_v1__";function at(){const t=globalThis;let e=t[rt];return e||(e={key:null,listeners:new Set,result:null},t[rt]=e),e}const ot=class{static get licenseKey(){return at().key}static set licenseKey(t){at().key=t}static get listeners(){return at().listeners}static get validationResult(){return at().result}static set validationResult(t){at().result=t}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(t){return!!t&&this.validateKey(t).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}static setLicense(t){var e,i;if(!t)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});const n=this.validateKey(t);n.valid||t===this.licenseKey||!(null==(i=this.validationResult)?void 0:i.valid)?(this.licenseKey=t,this.publish(n),n.valid||et(`[Apex] ${n.message}`)):it(`[Apex] Ignoring license key: ${null!=(e=n.message)?e:"it is not valid"} A valid license is already active on this page.`)}static validateKey(t){const e=this.parseKey(t),i=this.validateStructure(t,e);if(!i.valid||!(null==e?void 0:e.signature))return i;const n=this.verdicts.get(t);return!1===n?{data:e.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===n&&this.verifySignature(t,e,i),l(o({},i),{signatureVerified:!0===n}))}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnverifiable=!1,this.epoch++}static base64ToBytes(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(4*Math.ceil(e.length/4),"="),n=globalThis.atob;if("function"!=typeof n)throw new Error("no base64 decoder available");const s=n(i),r=new Uint8Array(s.length);for(let t=0;t<s.length;t++)r[t]=s.charCodeAt(t);return r}static canonicalPayload(t){const e=t.domains&&t.domains.length>0?t.domains.join(","):"";return`v1|${t.issueDate}|${t.expiryDate}|${t.plan}|${e}`}static notify(t){for(const e of this.listeners)try{e(t)}catch(t){}}static parseKey(t){if("string"!=typeof t||!t.startsWith(nt))return null;const e=t.slice(5);if(!e)return null;try{const t=(new TextDecoder).decode(this.base64ToBytes(e)),i=JSON.parse(t);return i.issueDate&&i.expiryDate&&i.plan?{data:{domains:Array.isArray(i.domains)?i.domains:void 0,expiryDate:i.expiryDate,issueDate:i.issueDate,plan:i.plan,valid:!0},signature:"string"==typeof i.sig&&i.sig?i.sig:null}:null}catch(t){return null}}static publish(t){this.validationResult=t,this.notify(t)}static validateStructure(t,e){const i=t=>({expired:!1,message:t,signatureVerified:!1,valid:!1});if("string"!=typeof t||!t.startsWith(nt))return i('Invalid license key format. License key must start with "APEX-".');if(!e)return i("Invalid license key. Unable to decode license data.");const{data:n,signature:s}=e;if(!s&&new Date>=st)return i("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(n.expiryDate)<new Date)return{data:n,expired:!0,message:`License expired on ${n.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(n.domains&&n.domains.length>0){const t="undefined"==typeof location?"":location.hostname;if(!n.domains.some(e=>t===e||t.endsWith(`.${e}`)))return{data:n,expired:!1,message:`License is not valid for this domain (${t}). Allowed domains: ${n.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:n,expired:!1,signatureVerified:!1,valid:!0}}static verifySignature(t,e,i){return h(this,null,function*(){var n;if(this.verifying.has(t)||this.verdicts.has(t))return;this.verifying.add(t);const s=this.epoch,r=null==(n=globalThis.crypto)?void 0:n.subtle;if(!r||0===this.publicKeysSpki.length)return this.verifying.delete(t),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,it(r?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.")));const a=(new TextEncoder).encode(this.canonicalPayload(e.data));let c=!1;for(const t of this.publicKeysSpki){try{const i=yield r.importKey("spki",this.base64ToBytes(t),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);c=yield r.verify({hash:"SHA-256",name:"ECDSA"},i,this.base64ToBytes(e.signature),a)}catch(t){c=!1}if(c)break}if(this.verifying.delete(t),this.epoch!==s)return;if(this.verdicts.set(t,c),c){const e=l(o({},i),{signatureVerified:!0});return void(this.licenseKey===t?this.publish(e):this.notify(e))}const h="Invalid license key. The license signature does not verify.",d={data:e.data,expired:!1,message:h,signatureVerified:!0,valid:!1};this.licenseKey===t?this.publish(d):this.notify(d),et(`[Apex] ${h}`)})}};ot.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],ot.verdicts=new Map,ot.verifying=new Set,ot.warnedUnverifiable=!1,ot.epoch=0;let lt=ot;function ct(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const n=(i-1)*e,s=Math.floor(n),r=Math.ceil(n);return s===r?t[s]:t[s]+(t[r]-t[s])*(n-s)}function ht(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let n=i[0],s=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(n=t,s=e)}if(!(s>n)){const t=Math.abs(n)>0?.05*Math.abs(n):.5;return{edges:[n-t,n+t],binWidth:2*t,rule:"single",capped:!1}}const a=s-n;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 n=t.length,s=t=>e/Math.max(1,Math.ceil(t)),r=()=>s(Math.log2(n)+1);switch(i){case"sqrt":return{width:s(Math.sqrt(n)),rule:"sqrt"};case"rice":return{width:s(2*Math.cbrt(n)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let n=0;n<e;n++)i+=t[n];const n=i/e;let s=0;for(let i=0;i<e;i++){const e=t[i]-n;s+=e*e}return Math.sqrt(s/e)}(t);return e>0?{width:3.49*e*Math.pow(n,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=ct(t,.75)-ct(t,.25);return e>0?{width:2*e*Math.pow(n,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=ct(t,.75)-ct(t,.25);if(i<=0)return{width:e,rule:"sturges"};const s=2*i*Math.pow(n,-1/3);return s<e?{width:s,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,a,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!Number.isFinite(o)||o<=0)&&(o=a);let c=Math.ceil(a/o);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),o=a/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=n+t*o;return d[c]=Math.max(d[c],s),{edges:d,binWidth:o,rule:l,capped:h}}function dt(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const n=(e[i]-e[0])/i;if(n>0){let s=Math.floor((t-e[0])/n);return s<0&&(s=0),s>i-1&&(s=i-1),t<e[s]?s--:t>=e[s+1]&&s++,s<0||s>i-1?-1:s}let s=0,r=i-1;for(;s<=r;){const i=s+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;s=i+1}}return-1}const ut=class{static applyStyles(t){Object.assign(t.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(t){return t?t.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(t,e){return t&&"undefined"!=typeof document?(this.setManaged(t,e),this.paint(t)):null}static exists(t){return!!this.node(t)}static remove(t,e){t&&(this.setManaged(t,e),this.erase(t))}static untrack(t){this.managed.delete(t)}static createWatermarkPattern(){const t=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text\n x="50%"\n y="50%"\n dominant-baseline="middle"\n text-anchor="middle"\n font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n font-size="18"\n font-weight="600"\n fill="rgba(134, 134, 134, 0.1)"\n transform="rotate(-35, 100, 60)"\n >${t}</text>\n </svg>\n `.trim())}")`}static erase(t){var e;null==(e=this.node(t))||e.remove()}static paint(t){let e=this.node(t);return e||(e=document.createElement("div"),e.setAttribute(this.WATERMARK_ATTR,""),t.appendChild(e)),this.applyStyles(e),"function"==typeof getComputedStyle&&"static"===getComputedStyle(t).position&&(t.style.position="relative"),e}static reconcile(){const t=lt.isLicenseValid();for(const e of this.managed)e.isConnected?t?this.erase(e):this.paint(e):this.managed.delete(e)}static setManaged(t,e){!1!==(null==e?void 0:e.manage)?this.track(t):this.managed.delete(t)}static track(t){this.managed.add(t),this.subscribed||(this.subscribed=!0,lt.onChange(()=>{this.reconcile()}))}};ut.WATERMARK_ATTR="data-apexcharts-watermark",ut.WATERMARK_TEXT="APEXCHARTS",ut.ATTR="data-apexcharts-watermark",ut.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},ut.managed=new Set,ut.subscribed=!1;let pt=ut;const ft=1/45;function gt(t,e,i,n){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function mt(t,e){if(e<=0)return xt(t);let i=e;for(;i>0;){const e=Math.min(i,ft),n=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=n*e,t.value+=t.velocity*e,i-=e}return!!xt(t)&&(t.value=t.target,t.velocity=0,!0)}function yt(t,e){t.target=e}function xt(t){var e,i;const n=null!=(e=t.restVelocity)?e:.05,s=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<n&&Math.abs(t.value-t.target)<s}const _t={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const bt="__apexcharts_crossfilters__";function vt(t){if(!Number.isFinite(t))return t;const e=Number(t.toPrecision(12));return Object.is(e,-0)?0:e}function wt(t){return"number"==typeof t&&Number.isFinite(t)}function At(t){if("function"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.sum){const e=t.sum;return t=>t.reduce((t,i)=>t+(Number(i[e])||0),0)}if("string"==typeof t.avg){const e=t.avg;return t=>t.length?t.reduce((t,i)=>t+(Number(i[e])||0),0)/t.length:0}if("string"==typeof t.min){const e=t.min;return t=>t.length?Math.min(...t.map(t=>Number(t[e])||0)):0}if("string"==typeof t.max){const e=t.max;return t=>t.length?Math.max(...t.map(t=>Number(t[e])||0)):0}}return t=>t.length}function Mt(t,e){return"function"==typeof e?t.slice().sort(e):"asc"===e?t.slice().sort((t,e)=>t>e?1:t<e?-1:0):"desc"===e?t.slice().sort((t,e)=>t<e?1:t>e?-1:0):t}function kt(t,e){if(!wt(t))return-1;const i=e.length-1;if(t<e[0]||t>e[i])return-1;if(t===e[i])return i-1;for(let n=0;n<i;n++)if(t>=e[n]&&t<e[n+1])return n;return-1}function Lt(t){const e=[];for(let i=0;i<t.length-1;i++)e.push(vt((t[i]+t[i+1])/2));return e}class St{constructor(t,e){this.dims=new Map,this.listeners=new Map,this.id=t,this.records=Array.isArray(e)?e:[]}static store(){const t=globalThis;return t[bt]||(t[bt]=new Map),t[bt]}static getOrCreate(t){if(!t||"string"!=typeof t.id)throw new Error("Crossfilter.getOrCreate requires an { id } string.");const e=St.store(),i=e.get(t.id);if(i)return t.records&&i.setRecords(t.records),i;const n=new St(t.id,t.records);return e.set(t.id,n),n}static get(t){return St.store().get(t)||null}setRecords(t){return this.records=Array.isArray(t)?t:[],this.dims.forEach(t=>this.recomputeDomain(t)),this.emit("records",this.state()),this.emit("change",this.state()),this}registerDimension(t,e){if(!e||"function"!=typeof e.dimension)throw new Error(`crossfilter.registerDimension("${t}") needs a dimension function.`);const i=e.type||(e.bins?"range":"category"),n={accessor:e.dimension,reducer:At(e.reduce),type:i,bins:e.bins,order:e.order,filter:null,labels:[],edges:null,xLabels:[],yLabels:[]};return this.dims.set(t,n),this.recomputeDomain(n),null!=e.filter&&this.setFilterOn(n,e.filter),this}hasDimension(t){return this.dims.has(t)}removeDimension(t){const e=this.dims.get(t),i=!!e&&this.hasFilter(e);return this.dims.delete(t),i&&this.emit("change",this.state()),this}recomputeDomain(t){if("matrix"===t.type){const e=function(t,e,i){const n=new Set,s=new Set,r=[],a=[];for(let i=0;i<t.length;i++){const o=e(t[i]);if(!o)continue;const l=o[0],c=o[1];null==l||n.has(l)||(n.add(l),r.push(l)),null==c||s.has(c)||(s.add(c),a.push(c))}return{xLabels:Mt(r,i),yLabels:Mt(a,i)}}(this.records,t.accessor,t.order);return t.xLabels=e.xLabels,t.yLabels=e.yLabels,void(t.edges=null)}if("range"===t.type)return t.edges=function(t,e,i){if(i&&Array.isArray(i.thresholds)&&i.thresholds.length>=2){const t=Array.from(new Set(i.thresholds.filter(wt))).sort((t,e)=>t-e);return t.length>=2?t.map(vt):[0,1]}let n=1/0,s=-1/0;for(let i=0;i<t.length;i++){const r=e(t[i]);wt(r)&&(r<n&&(n=r),r>s&&(s=r))}if(n===1/0)return[0,1];if(n===s){const t=Math.abs(n)>0?Math.abs(n):1;return[vt(n),vt(n+t)]}if(i&&wt(i.width)&&i.width>0){const t=i.width,e=Math.floor(n/t)*t;let r=Math.ceil(s/t)*t;r<=e&&(r=e+t);const a=Math.max(1,Math.round((r-e)/t)),o=new Array(a+1);for(let i=0;i<=a;i++)o[i]=vt(e+i*t);return o}const r=i&&wt(i.count)&&i.count>=1?Math.floor(i.count):30,a=(s-n)/r,o=new Array(r+1);for(let t=0;t<=r;t++)o[t]=vt(n+t*a);return o[r]=vt(s),o}(this.records,t.accessor,t.bins),void(t.labels=Lt(t.edges));if(t.labels=function(t,e,i){const n=new Set,s=[];for(let i=0;i<t.length;i++){const r=e(t[i]);null!=r&&(n.has(r)||(n.add(r),s.push(r)))}return Mt(s,i)}(this.records,t.accessor,t.order),t.edges=null,t.filter instanceof Set){const e=new Set(t.labels);Array.from(t.filter).forEach(i=>{e.has(i)||t.filter.delete(i)})}}filter(t,e){const i=this.dims.get(t);return i?(this.setFilterOn(i,e),this.emit("change",this.state()),this):this}toggleKey(t,e){const i=this.dims.get(t);if(!i||"category"!==i.type)return this;i.filter instanceof Set||(i.filter=new Set);const n=i.filter;return n.has(e)?n.delete(e):n.add(e),0===n.size&&(i.filter=null),this.emit("change",this.state()),this}setFilterOn(t,e){if(null==e)return void(t.filter=null);if("range"===t.type){if(Array.isArray(e)&&2===e.length&&e.every(wt)){const[i,n]=e;t.filter=[Math.min(i,n),Math.max(i,n)]}else t.filter=null;return}const i=new Set(e);t.filter=i.size?i:null}clear(t){const e=this.dims.get(t);return e&&(e.filter=null),this.emit("change",this.state()),this}reset(){return this.dims.forEach(t=>{t.filter=null}),this.emit("change",this.state()),this}hasFilter(t){return null!=t.filter&&(!(t.filter instanceof Set)||t.filter.size>0)}passes(t,e){if(!this.hasFilter(t))return!0;const i=t.accessor(e);if(t.filter instanceof Set)return t.filter.has(i);if(!wt(i))return!1;const[n,s]=t.filter;return i>=n&&i<=s}filteredRecords(t){const e=[];return this.dims.forEach((i,n)=>{n!==t&&this.hasFilter(i)&&e.push(i)}),0===e.length?this.records:this.records.filter(t=>e.every(e=>this.passes(e,t)))}filteredRows(){return this.filteredRecords(null)}aggregateFor(t){const e=this.dims.get(t);if(!e)return{type:"category",labels:[],values:[],keys:[]};const i=this.filteredRecords(t);if("matrix"===e.type){const t=new Map(e.xLabels.map((t,e)=>[t,e])),n=new Map(e.yLabels.map((t,e)=>[t,e])),s=e.yLabels.map(()=>e.xLabels.map(()=>[]));for(let r=0;r<i.length;r++){const a=e.accessor(i[r]);if(!a)continue;const o=t.get(a[0]),l=n.get(a[1]);null!=o&&null!=l&&s[l][o].push(i[r])}return{type:"matrix",xLabels:e.xLabels.slice(),yLabels:e.yLabels.slice(),matrix:s.map(t=>t.map(t=>e.reducer(t)))}}if("range"===e.type){const t=e.edges||[0,1],n=t.length-1,s=Array.from({length:n},()=>[]);for(let n=0;n<i.length;n++){const r=kt(e.accessor(i[n]),t);r>=0&&s[r].push(i[n])}return{type:"range",labels:Lt(t),values:s.map(t=>e.reducer(t)),keys:s.map((e,i)=>[t[i],t[i+1]]),edges:t}}const n=new Map;e.labels.forEach(t=>n.set(t,[]));for(let t=0;t<i.length;t++){const s=n.get(e.accessor(i[t]));s&&s.push(i[t])}return{type:"category",labels:e.labels.slice(),values:e.labels.map(t=>e.reducer(n.get(t)||[])),keys:e.labels.slice()}}aggregateAll(){const t={};return this.dims.forEach((e,i)=>{t[i]=this.aggregateFor(i)}),t}state(){const t={};return this.dims.forEach((e,i)=>{this.hasFilter(e)&&(t[i]=e.filter instanceof Set?Array.from(e.filter):e.filter.slice())}),{filters:t,filteredCount:this.filteredRows().length,total:this.records.length}}filterOf(t){const e=this.dims.get(t);return e&&this.hasFilter(e)?e.filter instanceof Set?new Set(e.filter):e.filter.slice():null}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>this.off(t,e)}off(t,e){var i;return null==(i=this.listeners.get(t))||i.delete(e),this}emit(t,e){var i;null==(i=this.listeners.get(t))||i.forEach(i=>{try{i(e)}catch(e){et(`[Apex] a crossfilter ${t} listener threw`,e)}})}static esc(t){return String(null==t?"":t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}resolveColumns(t){if(Array.isArray(t)&&t.length)return t.map(t=>"string"==typeof t?{field:t,label:t}:{field:t.field,label:t.label||t.field,format:t.format});const e=this.records[0];return(e?Object.keys(e):[]).map(t=>({field:t,label:t}))}tableHTML(t,e,i){const n="<thead><tr>"+t.map(t=>`<th>${St.esc(t.label)}</th>`).join("")+"</tr></thead>",s="<tbody>"+e.map(e=>"<tr>"+t.map(t=>{const i=e[t.field],n=t.format?t.format(i,e):i;return`<td>${St.esc(n)}</td>`}).join("")+"</tr>").join("")+"</tbody>";return`<table class="apexcharts-cf-table"><caption>${e.length} of ${i} rows</caption>${n}${s}</table>`}dataTable(t,e){if(!t)return{refresh(){},destroy(){}};const i=e||{},n=this.resolveColumns(i.columns),s=i.pageSize||0,r=i.page||0,a=()=>{const e=this.filteredRows(),i=s?e.slice(r*s,r*s+s):e;t.innerHTML=this.tableHTML(n,i,e.length)};a();const o=this.on("change",a);return{refresh:a,destroy:()=>{o(),t.innerHTML=""}}}destroy(){St.store().delete(this.id),this.dims.clear(),this.listeners.clear(),this.records=[]}}const Ct="__apexcharts_unit_layouts__";function Et(t){return t&&globalThis[Ct][t]||null}globalThis[Ct]||(globalThis[Ct]={});const Ft="__apexcharts_unit_marks__";function Dt(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function Pt(t){return t&&globalThis[Ft][t]||null}function Rt(t,e,i={}){const n=new _(t),s=i.fontSize||"12px",r=parseFloat(s)||12;let a=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=n.getTextRects(e,s,i.fontFamily,"",!0,i.fontWeight).width;a=Math.max(a,o>0?o:e.length*r*.58)}),a}globalThis[Ft]||(globalThis[Ft]={});const Tt=Math.PI*(3-Math.sqrt(5)),Nt=(t,e)=>{const i=(t.get(e)||0)+1;return t.set(e,i),i>1?e+"#"+i:e},Ot=t=>("string"==typeof t&&(t=parseFloat(t)),"number"==typeof t&&isFinite(t)?t:null);function $t(t){return 1-Math.pow(1-t,3)}function It(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function Bt(t,e){const[i,n]=null!=(r=_t[null!=(s=t)?s:"crisp"])?r:_t.crisp;var s,r;const a=800/Math.max(1,e);return[i*a*a,n*a]}g.default.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new _(e,this.ctx),n=i.group({class:"apexcharts-unit"});if(A.cancelAnimationFrame(e.globals.unitGatherRAF||0),A.cancelAnimationFrame(e.globals.unitExitRAF||0),e.globals.unitGatherRAF=e.globals.unitExitRAF=null,e.globals.noData||!Array.isArray(t)||0===t.length)return n;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",a=s.transition,c="flow"===a,h="identity"===a,d=s.unitValue>0?s.unitValue:1,u="grid"===r&&!(!s.grid||!s.grid.split);let p=t.map(t=>{const e=Math.abs(I.parseNumber(t))/d;return u?e:e>0?Math.max(1,Math.round(e)):0});u||"scatter"===r||(p=this._applyMaxUnits(p,s.maxUnits));const f=p.reduce((t,e)=>t+e,0),g="packed"===r?this._layoutPacked(p,s):"columns"===r?this._layoutColumns(p,s):"grid"===r?this._layoutGrid(p,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(p,s):"custom"===r?this._layoutCustom(p,s):this._layoutGrouped(p,s);"scatter"===r&&this._drawScatterAxes(n,i);const m=this._lastDotR,y=this._shouldAnimate(),x=this.ctx&&this.ctx.morphTypeChange,b=y&&!!x&&"function"==typeof x.isActive&&x.isActive()&&"function"==typeof x.getInitialSlotFor,v=b&&"function"==typeof x.usesPieceTakeover&&x.usesPieceTakeover(),w=y&&!b&&this.ctx?this.ctx._unitPrevDots:null,M=this.ctx&&this.ctx._unitPieces;M&&(this.ctx._unitPieces=null,w&&M.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),i=w.get(e),n=e=>+t.getAttribute(e);i&&w.set(e,l(o({},i),{x:n("x")+n("width")/2,y:n("y")+n("height")/2,r:Math.min(n("width"),n("height"))/2,fill:t.getAttribute("fill")}))}));const k=new Map,L=[],S=e.seriesData.unitData||[],C=this._bubbleStats(S,s,m);let E=0;const F=new Map,D=u&&this._gridTrack&&this._gridTrack.cells||[],P=i.group({class:"apexcharts-unit-track"});D.length&&n.add(P);const R=s.grid&&s.grid.trackColor||"rgba(128,128,128,0.14)",T=this._baseSpec({shape:"square"===s.shape&&"square"},m),N=D.length/Math.max(1,g.length),O=this.ctx&&this.ctx._unitSprings,$=(t,e,i,n,s,r,a,o)=>{const l=w&&w.get(s),c=O&&O.get(s),h=l&&l.x===i&&l.y===n&&l.r===r&&(!c||c.x.value===i&&c.y.value===n);if(k.set(s,{x:i,y:n,fill:R,r:r,spec:e}),w&&y&&!v&&!h){const c=l?l.x:i,h=l?l.y:n;t.style.opacity=l?"1":"0",this._place(t,e,c,h),L.splice(a,0,{node:t,spec:e,x:i,y:n,cx0:c,cy0:h,key:s,r0:l&&null!=l.r?l.r:r,r1:r,delay:0,isEnter:!l,pair:o})}else this._place(t,e,i,n)},B=(t,e)=>{const n=this._drawDot(i,s,m,R,-1,0,T);n.node.classList.add("apexcharts-unit-track-cell"),P.add(n),$(n.node,T,D[t].x,D[t].y,"trk:"+t,m,L.length,e)};if(g.forEach((t,a)=>{const o=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",l=i.group({class:"apexcharts-series",seriesName:I.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),d=t.dots.length,g=S[t.i],_=L.length;t.dots.forEach((e,n)=>{D.length&&B(a*N+n,!0);const r=null!=e.j?e.j:n,p=g?g[r]:void 0,f=p&&"object"==typeof p&&p.fillColor?p.fillColor:o,_=null!=e.r?e.r:C?this._radiusForValue(this._unitValueOf(p),C):m,A=this._markSpecFor(s,p,t.i,_),M=this._drawDot(i,s,_,f,t.i,r,A);let S;if(l.add(M),h){const t=p&&"object"==typeof p?null!=p.id?p.id:p.name:void 0;S=null!=t?`id:${Nt(F,String(t))}`:`g:${E}`}else S=c?String(E):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(E++,k.set(S,{x:e.x,y:e.y,fill:f,r:_,spec:A}),v)this._place(M.node,A,e.x,e.y),M.node.setAttribute("opacity","0"),M.node.setAttribute("data-piece-hidden","1"),M.node.setAttribute("data-key",S);else if(y){const i=w&&w.get(S),n=i||(b?x.getInitialSlotFor(t.i,r,d):null),a=s.gather&&s.gather.enter||"burst",o=u||"fade"===a||"rise"===a,l=n||u&&w&&w.get("trk:"+e.slot),c=l?l.x:o?e.x:t.cx,h=l?l.y:"rise"!==a||u?o?e.y:t.cy:e.y+14;M.node.style.opacity=n?"1":"0",this._place(M.node,A,c,h),L.push({node:M.node,spec:A,x:e.x,y:e.y,cx0:c,cy0:h,key:S,r0:i&&null!=i.r?i.r:_,r1:_,fill0:i?i.fill:f,fill1:f,delay:0,isEnter:!n})}else this._place(M.node,A,e.x,e.y)});for(let e=t.dots.length;e<N;e++)B(a*N+e,!1);if(("grouped"===r||"columns"===r||u)&&s.clusterLabels&&s.clusterLabels.show&&p[t.i]>0){const e=u?this._gridDenom:f,i=this._drawClusterLabel(l,t,p[t.i],e,s,o);if(i&&u){const e={pk:1,hx:0,hy:0,r:0},n=+(i.getAttribute("x")||0),s=+(i.getAttribute("y")||0);$(i,e,n,s,"lbl:"+t.i,0,_,L.length>_)}}n.add(l)}),this._outerLabelsOn(s)&&this._drawOuterLabels(n,g,p,f,s,y&&!w),w){const t=this._collectExits(w,k,s);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});n.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=k),!this.ctx||y&&!b||(this.ctx._unitSprings=null),y&&L.length?this._runGather(L):e.globals.animationEnded=!0,n}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const n=e/i,s=this.ctx||{};return s._unitCapWarned||(s._unitCapWarned=!0,console.warn(`[ApexCharts] unit chart: ${i} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`)),t.map(t=>t>0?Math.max(1,Math.round(t*n)):0)}_layoutCustom(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),a=this._resolveLayoutProvider(e);if(!a)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,n-2*o),height:s},c=Math.sqrt(l.width*l.height/Math.PI),h=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(h,e);const d=this._lastDotR,u=this._layoutObjects(t,d);let p;try{p=a(u,l)}catch(i){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",i),this._layoutGrouped(t,e)}if(!Array.isArray(p))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const f=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&f.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const g=t.map((t,e)=>({i:e,cx:n/2,cy:s/2,outerR:d,dots:[]}));return u.forEach(t=>{const e=f.get(t.id);e&&g[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),g.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let n=0;t.dots.forEach(e=>{n=Math.max(n,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=n+d}),g}_layoutObjects(t,e){const i=this.w,n=i.seriesData.unitData||[],s=i.seriesData.seriesNames||[],r=[],a=new Map;let o=0;return t.forEach((t,i)=>{var l;const c=n[i];for(let n=0;n<t;n++){const t=c?c[n]:void 0,h=Nt(a,!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${n}`:String(null!=t.id?t.id:t.name));r.push({id:h,index:o,seriesIndex:i,dataPointIndex:n,label:s[i],value:null!=(l=this._unitValueOf(t))?l:void 0,datum:t,r:e}),o++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=Et(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,a=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,a.length),l=new Array(t.length).fill(-1);a.forEach((t,e)=>l[t]=e);const c=n/o,h=s-r,d=Math.max(1,...t),u=.08*Math.min(c,h),p=Math.max(4,Math.min(c,h)/2-u),f=this._resolveStep(e,p,d);this._lastDotR=this._dotRadiusFromStep(f,e);const g=this._lastDotR,m=r+h/2,y=t.map(t=>f*Math.sqrt(Math.max(1,t))+g);let x=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):n/2)(e));const _=a.map(t=>y[t]);let b=!1;for(let t=1;t<o;t++)if(x[a[t]]-x[a[t-1]]<_[t]+_[t-1]){b=!0;break}if(b){const e=Math.max(2*g,8),i=_.reduce((t,e)=>t+2*e,0)+e*(o-1);let s;if(i<=n){let t=(n-i)/2;s=_.map(i=>{const n=t+i;return t+=2*i+e,n})}else if(1===o)s=[n/2];else{const t=_[0],e=n-_[o-1];s=_.map((i,n)=>t+(e-t)*n/(o-1))}x=t.map((t,e)=>l[e]>=0?s[l[e]]:n/2)}return t.map((t,e)=>({i:e,cx:x[e],cy:m,outerR:y[e],dots:this._spiral(x[e],m,t,f,0)}))}_layoutPacked(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),a=Math.max(4,Math.min(n,s-6)/2-.06*Math.min(n,s)),o=this._resolveStep(e,a,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=n/2,c=6+(s-6)/2,h=t.map((t,e)=>e);!1!==e.sortByGroup&&h.sort((e,i)=>t[e]-t[i]);const d=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let u=0;return h.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(u+.5),i=u*Tt;d[e].dots.push({x:l+t*Math.cos(i),y:c+t*Math.sin(i),slot:u}),u++}}),d}_layoutArc(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),a=e.arc||{},o="number"==typeof a.startAngle?a.startAngle:-90,l="number"==typeof a.endAngle?a.endAngle:90,c=o*Math.PI/180,h=l*Math.PI/180,d=h-c||Math.PI,u=Math.max(0,Math.min(.95,"number"==typeof a.innerRadiusRatio?a.innerRadiusRatio:.4)),p=t=>Math.sin(t),f=t=>-Math.cos(t),g=this._arcBounds(c,h),m=.04*Math.min(n,s),y=Math.max(1e-6,g.maxX-g.minX),x=Math.max(1e-6,g.maxY-g.minY),_=t=>Math.max(4,Math.min((n-2*m-t)/y,(s-2*m-t)/x)),b=t=>_(2*this._arcAllocate(r,t*u,t,d,e).dotR);let v=_(0),w=b(v);for(let t=0;t<6;t++){const t=(w+v)/2;t<=b(t)?w=t:v=t}const A=n/2-(g.minX+g.maxX)/2*w,M=s/2-(g.minY+g.maxY)/2*w,k=this._arcAllocate(r,w*u,w,d,e);this._lastDotR=k.dotR;const L=[];for(let t=0;t<k.R;t++){const e=k.radii[t],i=k.seatsPerRow[t];for(let t=0;t<i;t++){const n=1===i?(c+h)/2:c+d*(t+.5)/i;L.push({a:n,x:A+e*p(n),y:M+e*f(n)})}}L.sort((t,e)=>t.a-e.a);const S=t.map((t,e)=>({i:e,cx:A,cy:M,outerR:w,dots:[]}));let C=0,E=0;return L.forEach((e,i)=>{for(;C<t.length&&E>=t[C];)C++,E=0;C>=t.length||(S[C].dots.push({x:e.x,y:e.y,slot:i}),E++)}),S}_arcBounds(t,e){const i=t=>Math.sin(t),n=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),a=[0,i(t),i(e)],o=[0,n(t),n(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)a.push(i(t*l)),o.push(n(t*l));return{minX:Math.min(...a),maxX:Math.max(...a),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,n,s){const r=s.spacing>0?s.spacing:1.05,a=Math.abs(n)||Math.PI,o=this._fixedRadius(s),l=n=>{n=Math.max(1,Math.round(n));const s=[];for(let t=0;t<n;t++)s.push(1===n?(e+i)/2:e+t/(n-1)*(i-e));const o=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let h=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{h>0&&(c[t.idx]++,h--)});h>0;)c[n-1]++,h--;const d=1===n?i-e||i:(i-e)/(n-1);let u=1/0;for(let t=0;t<n;t++){const e=c[t];if(e<=0)continue;const i=s[t]*a/e;i<u&&(u=i)}const p=Math.min(d,u);return{R:n,radii:s,seatsPerRow:c,dotR:Math.max(1,p/(2*r))}},c=s.arc&&s.arc.rows;let h;if("number"==typeof c&&c>=1)h=l(c);else if(o){h=l((i-e)/(2*o*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));h=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>h.dotR&&(h=e)}}return o&&(h.dotR=o),h}_layoutColumns(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),a=r&&"bottom"===e.clusterLabels.position,o=r&&!a?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),h=new Array(t.length).fill(-1);l.forEach((t,e)=>h[t]=e);const d=n/c,u=.62*d,p=Math.max(8,.04*s)+(a?30:0),f=Math.max(4,s-o-p),g=Math.max(1,...t),m=e.spacing>0?e.spacing:1,y=e.columns?e.columns.size:void 0;let x;x="image"!==e.shape&&"auto"===y?null:"image"!==e.shape&&"number"==typeof y&&y>0?y:this._fixedRadius(e);let _=1,b=0;if(x){b=2*x*m,this._lastDotR=x;const t=Math.max(1,Math.floor(f/b)),e=Math.max(1,Math.floor(u/b));_=Math.max(1,Math.min(e,Math.ceil(g/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(u/4)));for(let i=1;i<=e;i++){const e=Math.ceil(g/i),n=Math.min(u/i,f/e);n>t&&(t=n,_=i)}b=t,this._lastDotR=Math.max(1,b/(2*m))}const v=this._lastDotR,w=Math.ceil(g/_),A=o+(f+Math.min(f,w*b))/2;return t.map((t,e)=>{const i=h[e]>=0?d*(h[e]+.5):n/2,s=Math.ceil(Math.max(1,t)/_)*b,r=i-_*b/2+b/2,a=[];for(let e=0;e<t;e++){const t=Math.floor(e/_),i=e%_;a.push({x:r+i*b,y:A-v-t*b})}return{i:e,cx:i,cy:A-s/2,outerR:s/2,flat:!0,dots:a}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},a=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),h=Math.max(1,Math.ceil(Math.max(1,c)/a)),d=e.spacing>0?e.spacing:1,u=Math.max(4,n),p=Math.max(4,s-6),f=this._fixedRadius(e);let g=0;f?(g=2*f*d,this._lastDotR=f):(g=Math.min(u/a,p/h),this._lastDotR=Math.max(1,g/(2*d)));const m=a*g,y=h*g,x=(n-m)/2+g/2,_=6+(p-y)/2,b=t=>"bottom"===o?_+y-g/2-t*g:_+g/2+t*g,v=t.map((t,e)=>({i:e,cx:n/2,cy:6+p/2,outerR:Math.max(m,y)/2,dots:[]}));let w=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=w%a,i=Math.floor(w/a);v[t].dots.push({x:x+e*g,y:b(i),slot:w}),w++}return v}_layoutGridSplit(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=e.grid||{},a=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/a)),h=t.map((t,e)=>e).filter(e=>t[e]>0),d=Math.max(1,h.length),u=r.max>0?r.max:Math.max(...t)||1,p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(d)))),f=Math.max(1,Math.ceil(d/p)),g=!(e.clusterLabels&&!1===e.clusterLabels.show),m=g&&e.clusterLabels&&"bottom"===e.clusterLabels.position,y=g&&!m?22:4,x=g&&m?22:4,_=n/p,b=s/f,v=Math.max(4,.86*_),w=Math.max(4,b-y-x),A=e.spacing>0?e.spacing:1,M=this._fixedRadius(e);let k=0;M?(k=2*M*A,this._lastDotR=M):(k=Math.min(v/a,w/c),this._lastDotR=Math.max(1,k/(2*A)));const L=a*k,S=c*k,C=(t,e)=>"bottom"===o?t+S-k/2-e*k:t+k/2+e*k,E=[],F=[];return h.forEach((e,i)=>{const n=i%p,s=Math.floor(i/p),r=n*_,o=r+(_-L)/2+k/2,c=s*b+y+(w-S)/2,h=t=>({x:o+t%a*k,y:C(c,Math.floor(t/a))});for(let t=0;t<l;t++)E.push(h(t));const d=Math.max(0,Math.min(l,Math.round(t[e]/u*l))),f=[];for(let t=0;t<d;t++){const e=h(t);f.push({x:e.x,y:e.y,slot:i*l+t})}F.push({i:e,cx:r+_/2,cy:c+S/2,outerR:S/2,flat:!0,split:!0,dots:f})}),this._gridDenom=u,this._gridTrack={cells:E},F}_layoutScatter(t){const e=this.w,i=t.scatter||{},n=e.seriesData.unitData||[],s=n.map(t=>t?t.length:0),r=this._applyMaxUnits(s,t.maxUnits),a=(t,e)=>Math.floor((e+1)*r[t]/s[t])>Math.floor(e*r[t]/s[t]);if("value"===i.y)return this._layoutScatter2D(t,a);if("vertical"===i.orientation)return this._layoutScatterVertical(t,a);const o=e.layout.gridWidth,l=e.layout.gridHeight,c=e.seriesData.seriesNames||[],h=t=>this._unitValueOf(t),d=this._scatterSizeStats(i,n),u=n.map(t=>Array.isArray(t)?t.map(h):[]),p=t=>null!=t&&isFinite(t),f=u.map((t,e)=>e).filter(t=>u[t].some(p)),g=Math.max(1,f.length);let m=1/0,y=-1/0;u.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<m&&(m=t),t>y&&(y=t))})),m===1/0&&(m=0,y=1);const x=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),_=this._scatterValueDomain(i.xMin,i.xMax,m,y,x),b=_.min,v=_.max,w=v-b||1,A={fontFamily:e.config.chart.fontFamily,fontWeight:600},M=t=>c[t]||`series-${t+1}`,k=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):g>1?Math.min(o/3,Rt(e,f.map(M),A)+14):8,L=30+(i.xTitle?20:0),S=k,C=o-8,E=l-L,F=Math.max(4,C-S),D=Math.max(4,E-10),P=t=>S+(t-b)/w*F,R=D/g;let T=0;const N=this._fixedRadius(t);if(N)T=N;else{const t=Math.max(1,...f.map(t=>u[t].filter(p).length));T=Math.max(2,Math.min(6,.12*R,F/(2.5*Math.sqrt(t))))}this._lastDotR=T;const O=t.spacing>0?t.spacing:1,$=Math.max(.5,T*O),I="jitter"===i.spread,B=[],z=[],W=d?d.rMax:T;f.forEach((t,i)=>{const s=(t=>10+R*(t+.5))(i);let r=M(t);const o=k>12?Rt(e,[r],A):0;o>k-14&&o&&(r=r.slice(0,Math.max(1,Math.floor(r.length*(k-14)/o)-1))+"\u2026"),z.push({i:t,cy:s,name:r});const l=[];if((n[t]||[]).forEach((e,i)=>{const n=h(e);if(!p(n)||!a(t,i))return;const r={j:i,px:P(n),y:s};d&&(r.r=this._scatterRadius(e,d,T)),l.push(r)}),I){const e=Math.max(W,R/2-W);l.forEach(i=>{i.y=s+(2*q(7919*t+i.j)-1)*e})}else this._beeswarm(l,s,T,$,W);B.push({i:t,cx:(S+C)/2,cy:s,outerR:R/2,dots:l.map(t=>({x:t.px,y:t.y,r:t.r,j:t.j}))})});const H=_.ticks;return this._scatterAxis={mode:"1d",plotL:S,plotR:C,plotT:10,plotB:E,xMin:b,xMax:v,plotX:P,ticks:H,lanes:z,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},B}_layoutScatterVertical(t,e){const i=this.w,n=t.scatter||{},s=i.layout.gridWidth,r=i.layout.gridHeight,a=i.seriesData.unitData||[],o=i.seriesData.seriesNames||[],l=t=>this._unitValueOf(t),c=this._scatterSizeStats(n,a),h=a.map(t=>Array.isArray(t)?t.map(l):[]),d=t=>null!=t&&isFinite(t),u=h.map((t,e)=>e).filter(t=>h[t].some(d)),p=Math.max(1,u.length);let f=1/0,g=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<f&&(f=t),t>g&&(g=t))})),f===1/0&&(f=0,g=1);const m=Math.max(2,Math.round(n.tickAmount>0?n.tickAmount:5)),y=this._scatterValueDomain(n.xMin,n.xMax,f,g,m),x=y.min,_=y.max,b=_-x||1,v=46+(n.xTitle?18:0),w=s-10,A=r-(p>1?26:10),M=Math.max(4,w-v),k=Math.max(4,A-10),L=t=>A-(t-x)/b*k,S=M/p;let C=0;const E=this._fixedRadius(t);if(E)C=E;else{const t=Math.max(1,...u.map(t=>h[t].filter(d).length));C=Math.max(2,Math.min(6,.12*S,k/(2.5*Math.sqrt(t))))}this._lastDotR=C;const F=t.spacing>0?t.spacing:1,D=Math.max(.5,C*F),P="jitter"===n.spread,R=[],T=[],N=c?c.rMax:C;u.forEach((t,i)=>{const n=(t=>v+S*(t+.5))(i);T.push({i:t,cx:n,name:o[t]||`series-${t+1}`});const s=[];if((a[t]||[]).forEach((i,r)=>{const a=l(i);if(!d(a)||!e(t,r))return;const o={j:r,py:L(a),x:n};c&&(o.r=this._scatterRadius(i,c,C)),s.push(o)}),P){const e=Math.max(N,S/2-N);s.forEach(i=>{i.x=n+(2*q(7919*t+i.j)-1)*e})}else this._beeswarm(s,n,C,D,N,!0);R.push({i:t,cx:n,cy:(10+A)/2,outerR:S/2,dots:s.map(t=>({x:t.x,y:t.py,r:t.r,j:t.j}))})});const O=y.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:v,plotR:w,plotT:10,plotB:A,vMin:x,vMax:_,plotY:L,ticks:O,lanes:T,valueTitle:n.xTitle,formatter:"function"==typeof n.xFormatter?n.xFormatter:null,gridlines:!1!==n.gridlines},R}_layoutScatter2D(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=t.scatter||{},a=i.seriesData.unitData||[],o=t=>null!=t,l=t=>t&&"object"==typeof t?Ot(t.x):null,c=t=>t&&"object"==typeof t?Ot(null!=t.y?t.y:t.value):null,h=a.map((t,e)=>e).filter(t=>(a[t]||[]).some(t=>o(l(t))&&o(c(t))));let d=1/0,u=-1/0,p=1/0,f=-1/0;a.forEach(t=>(t||[]).forEach(t=>{const e=l(t),i=c(t);o(e)&&o(i)&&(e<d&&(d=e),e>u&&(u=e),i<p&&(p=i),i>f&&(f=i))})),d===1/0&&(d=0,u=1,p=0,f=1);const g=this._scatterValueDomain(r.xMin,r.xMax,d,u,Math.max(2,Math.round(r.tickAmount>0?r.tickAmount:5))),m=this._scatterValueDomain(r.yMin,r.yMax,p,f,Math.max(2,Math.round(r.yTickAmount>0?r.yTickAmount:5))),y=g.min,x=g.max,_=m.min,b=m.max,v=x-y||1,w=b-_||1,A=46+(r.yTitle?18:0),M=30+(r.xTitle?20:0),k=A,L=n-12,S=s-M,C=Math.max(4,L-k),E=Math.max(4,S-10),F=t=>k+(t-y)/v*C,D=t=>S-(t-_)/w*E,P=this._scatterSizeStats(r,a),R=this._fixedRadius(t)||5;this._lastDotR=R;const T=[];return h.forEach(t=>{const i=[];(a[t]||[]).forEach((n,s)=>{const r=l(n),a=c(n);null!=r&&null!=a&&e(t,s)&&i.push({x:F(r),y:D(a),r:P?this._scatterRadius(n,P,R):void 0,j:s})}),T.push({i:t,cx:(k+L)/2,cy:(10+S)/2,outerR:E/2,dots:i})}),this._scatterAxis={mode:"2d",plotL:k,plotR:L,plotT:10,plotB:S,plotX:F,plotY:D,xTicks:g.ticks,yTicks:m.ticks,xTitle:r.xTitle,yTitle:r.yTitle,xFormatter:"function"==typeof r.xFormatter?r.xFormatter:null,yFormatter:"function"==typeof r.yFormatter?r.yFormatter:null,gridlines:!1!==r.gridlines},T}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const n=Math.max(.5,+i[0]),s=Math.max(n,+i[1]),r=t.sizeField||"z";let a=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<a&&(a=e),e>o&&(o=e))})),a===1/0?null:{zmin:a,zmax:o,rMin:n,rMax:s,field:r}}_scatterRadius(t,e,i){if(!e)return i;const n=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof n||!isFinite(n))return e.rMin;const s=e.zmax>e.zmin?(n-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),a=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(a+r*(o-a))}_beeswarm(t,e,i,n,s,r=!1){const a=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[a]-e[a]),c=[],h=null!=s?s:i;l.forEach(t=>{const s=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*n*(i%2?1:-1),l=e+o;let d=!0;for(let e=c.length-1;e>=0;e--){const i=c[e],n=t[a]-i.f;if(n>s+h)break;const r=s+i.r,o=l-i.s;if(n*n+o*o<r*r){d=!1;break}}if(d){r=o;break}}t[o]=e+r,c.push({f:t[a],s:t[o],r:s})})}_scatterValueDomain(t,e,i,n,s){const r=(t,e,i)=>{const n=[];for(let s=0,r=t;r<=e+.5*i;r=t+ ++s*i)n.push(Math.abs(r)<1e-9*i?0:r);return n};if(null!=t||null!=e){let a=null!=t?t:e,o=null!=e?e:t;const l=o>a?(o-a)/Math.max(1,s-1):this._niceScale(Math.min(a,i),Math.max(o,n),s).spacing;if(i<a&&(a-=Math.ceil((a-i)/l)*l),n>o&&(o+=Math.ceil((n-o)/l)*l),o>a||(o=a+l),(o-a)/l<=2*s)return{min:a,max:o,ticks:r(a,o,l)};i=a,n=o}const a=this._niceScale(i,n,s),o=a.spacing||(a.max-a.min)/Math.max(1,s-1);return{min:a.min,max:a.max,ticks:r(a.min,a.max,o)}}_niceScale(t,e,i){const n=t;let s=e;s>n||(s=n+1);const r=this._niceNum(s-n,!1),a=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(n/a)*a,max:Math.ceil(s/a)*a,spacing:a}}_niceNum(t,e){const i=t>0?t:1,n=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,n);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,n)}_drawScatterAxes(t,e){const i=this.w;if(!M.isBrowser())return;const n=this._scatterAxis;if(!n)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),a=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,h=c||"rgba(120,130,140,0.9)",d=(t,e,i,n,a)=>{const o=A.createElementNS(s,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(n)),o.setAttribute("stroke",a),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},u=(t,e,n,a,o,l,c,h)=>{const d=A.createElementNS(s,"text");d.setAttribute("class",h),d.setAttribute("x",String(e)),d.setAttribute("y",String(n)),d.setAttribute("text-anchor",a),d.setAttribute("dominant-baseline","middle"),d.setAttribute("font-size",`${l}px`),d.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),d.setAttribute("font-weight",String(c)),d.setAttribute("fill",o),d.textContent=t,r.node.appendChild(d)};if("2d"!==n.mode){if("vertical"===n.orientation){if(n.ticks.forEach(t=>{const e=n.plotY(t);n.gridlines&&d(n.plotL,e,n.plotR,e,a);const i=n.formatter?String(n.formatter(t)):this._formatTick(t,n.ticks);u(i,n.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),d(n.plotL,n.plotT,n.plotL,n.plotB,o),n.valueTitle){const t=A.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,a=(n.plotT+n.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(a)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${a})`),t.textContent=String(n.valueTitle),r.node.appendChild(t)}return n.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,t.cx,n.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}n.ticks.forEach((t,e)=>{const i=n.plotX(t);n.gridlines&&d(i,n.plotT,i,n.plotB,a);const s=n.formatter?String(n.formatter(t)):this._formatTick(t,n.ticks),r=0===e?"start":e===n.ticks.length-1?"end":"middle";u(s,i,n.plotB+14,r,h,11,400,"apexcharts-unit-tick")}),d(n.plotL,n.plotB,n.plotR,n.plotB,o),n.xTitle&&u(String(n.xTitle),(n.plotL+n.plotR)/2,n.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),n.plotL>12&&n.lanes.forEach(t=>{const e=c||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,n.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(n.yTicks.forEach(t=>{const e=n.plotY(t);n.gridlines&&d(n.plotL,e,n.plotR,e,a);const i=n.yFormatter?String(n.yFormatter(t)):this._formatTick(t,n.yTicks);u(i,n.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),n.xTicks.forEach(t=>{const e=n.plotX(t);n.gridlines&&d(e,n.plotT,e,n.plotB,a);const i=n.xFormatter?String(n.xFormatter(t)):this._formatTick(t,n.xTicks);u(i,e,n.plotB+14,"middle",h,11,400,"apexcharts-unit-tick")}),d(n.plotL,n.plotB,n.plotR,n.plotB,o),d(n.plotL,n.plotT,n.plotL,n.plotB,o),n.xTitle&&u(String(n.xTitle),(n.plotL+n.plotR)/2,n.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),n.yTitle){const t=A.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,a=(n.plotT+n.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(a)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${a})`),t.textContent=String(n.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t,e){if(!isFinite(t))return"";const i=Math.abs(t);if(i>=1e6)return+(t/1e6).toFixed(1)+"M";if(i>=1e4)return+(t/1e3).toFixed(1)+"k";if(Number.isInteger(t))return String(t);const n=Math.abs(e[1]-e[0])||1;return String(+t.toFixed(Math.min(20,Math.max(2,1-Math.floor(Math.log10(n))))))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const n=t.map(t=>t/i*e),s=n.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),a=Math.max(0,e-r),o=n.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<a&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,n,s){const r=[];for(let a=0;a<i;a++){const i=s+a,o=n*Math.sqrt(i+.5),l=i*Tt;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){return Ot(t&&"object"==typeof t?null!=t.value?t.value:t.y:t)}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,n=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+n*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+n*(r-s))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let n=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<n&&(n=e),e>s&&(s=e))})}),n===1/0||s<n)return null;const r=e.sizeByValue,a=i,o=Math.max(1,Math.min(a,"number"==typeof r.minRadius?r.minRadius:.35*a));return{min:n,max:s,minR:o,maxR:a,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const n=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*n:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,n=this._fixedRadius(e);return n||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,n,s=1){const r=e;2===r.pk?t.setAttribute("transform","translate("+(i-r.ox*s)+","+(n-r.oy*s)+(1===s?r.tail:") scale("+r.s*s+")")):1===r.pk?(t.setAttribute("x",String(i-r.hx*s)),t.setAttribute("y",String(n-r.hy*s))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(n)))}_size(t,e,i){const n=e;0===n.pk?t.setAttribute("r",String(n.r*i)):1===n.pk&&(t.setAttribute("width",String(2*n.hx*i)),t.setAttribute("height",String(2*n.hy*i)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:n,hy:s}=this._halfExtent(t,i);return{pk:1,hx:n,hy:s,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return Dt(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return Dt(e);const i=Pt(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,i){const n=Math.round(10*e)/10,s=t.name+t.path+t.viewBox+t.fillRule+n,r=this._specCache.get(s);if(r)return r;const a=t.viewBox||[0,0,100,100],o=2*n*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/a[2]:"height"===i.fit?o/a[3]:o/Math.max(a[2],a[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(a[0]+a[2]/2)*l,oy:(a[1]+a[3]/2)*l,tail:") scale("+l+")",r:n});return this._specCache.set(s,c),c}_markSpecFor(t,e,i,n){if("pictogram"!==t.shape)return this._baseSpec(t,n);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,a=Array.isArray(s.mark)?s.mark[i%s.mark.length]:s.mark,c=this._resolveMark(null!=r?r:a);return c?this._glyphSpec(c,n,s):this._baseSpec(l(o({},t),{shape:"square"===s.fallback?"square":"circle"}),n)}_drawDot(t,e,i,n,s,r,a){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[s]||"none",h="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let d;if(2===a.pk)d=o.dom.Paper.path(a.d),d.node.setAttribute("fill",n),"evenodd"===a.fillRule&&d.node.setAttribute("fill-rule","evenodd"),h<1&&d.node.setAttribute("fill-opacity",String(h)),d.node.setAttribute("data:r",String(a.r));else if(1===a.pk&&"image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;d=o.dom.Paper.image(e.image.src),d.node.setAttribute("width",String(t)),d.node.setAttribute("height",String(i)),d.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&d.node.setAttribute("filter",`url(#${this._tintFilter(n)})`)}else if(1===a.pk){const s=2*i;d=t.drawRect(0,0,s,s,e.borderRadius||0,n,1,l,c),d.node.setAttribute("fill",n),h<1&&d.node.setAttribute("fill-opacity",String(h))}else d=t.drawCircle(i,{fill:n,"stroke-width":l,stroke:c}),d.node.setAttribute("fill",n),h<1&&d.node.setAttribute("fill-opacity",String(h));return s>=0&&(d.node.classList.add("apexcharts-unit-area"),d.node.setAttribute("i",String(s)),d.node.setAttribute("j",String(r))),d}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",n=this._tints||(this._tints=new Map);let s=n.get(t);if(s)return s;s=`apexcharts-unit-tint-${e.globals.chartID}-${n.size}`,n.set(t,s);const r=e.dom.Paper.node;let a=r.querySelector("defs");a||(a=A.createElementNS(i,"defs"),r.insertBefore(a,r.firstChild));const o=A.createElementNS(i,"filter");o.setAttribute("id",s),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=A.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=A.createElementNS(i,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),a.appendChild(o),s}_placeDot(t,e,i,n,s){this._place(t,s||this._baseSpec(e),i,n)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!M.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!w()))))}_seedSprings(t,e,i){const[n,s]=Bt(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,a=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=o?o.x:gt(i.cx0,n,s),c=o?o.y:gt(i.cy0,n,s);o&&(l.stiffness=n,c.stiffness=n,l.damping=s,c.damping=s,i.cx0=l.value,i.cy0=c.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===c.velocity||(i.delay=0)),i.sx=l,i.sy=c,null!=i.key&&a.set(i.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=a)}_stale(t){const e=this.w.dom.Paper;return!!this.w.globals.isDestroyed||!e||!e.node.contains(t)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,n=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*n,450),r=t.length;for(let e=r;e--;)t[e].delay=t[e].pair?t[e+1].delay:r>1?e/(r-1)*s:0;const a=i.gather||{},o=a.motion||"auto";"spring"===o||"auto"===o&&(!a.easing||"outCubic"===a.easing)?this._seedSprings(t,a,n):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];i.r0!==i.r1&&(this._size(i.node,i.spec,i.r0/i.r1),this._place(i.node,i.spec,i.cx0,i.cy0,i.r0/i.r1))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===a.easing?(c="number"==typeof a.overshoot?a.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===a.easing?It:$t;var c;const h=performance.now();let d=h;const u=e=>{if(this._stale(t[0].node))return void(this.w.globals.unitGatherRAF=null);const i=Math.min(.25,Math.max(0,(e-d)/1e3));d=e;let s=!0;for(let a=0;a<r;a++){const r=t[a],o=e-h-r.delay,c=Math.max(0,Math.min(1,o/n)),d=$t(c);let u,p;if(r.sx&&r.sy){o>=0&&!r.released&&(yt(r.sx,r.x),yt(r.sy,r.y),r.released=!0);const t=mt(r.sx,i),e=mt(r.sy,i);r.released&&t&&e||(s=!1),u=r.sx.value,p=r.sy.value}else{const t=l(c);u=r.cx0+(r.x-r.cx0)*t,p=r.cy0+(r.y-r.cy0)*t}let f=1;if(r.r0!==r.r1&&(f=(r.r0+(r.r1-r.r0)*d)/r.r1,this._size(r.node,r.spec,f)),this._place(r.node,r.spec,u,p,f),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*d),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*d),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*d);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),i.r0!==i.r1&&(this._size(i.node,i.spec,1),this._place(i.node,i.spec,i.x,i.y))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=A.requestAnimationFrame(u)};this.w.globals.unitGatherRAF=A.requestAnimationFrame(u)}_collectExits(t,e,i){const n=Math.max(0,i.maxUnits||5e3),s=[];for(const[i,r]of t)if(!e.has(i)&&"l"!==i[0]&&(s.push(r),s.length>=n))break;return s}_runExits(t,e,i){const n=this.w,s=new _(n,this.ctx),r=this._lastDotR,a=n.layout.gridWidth/2,o=n.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,c=[];if(e.forEach(e=>{const n=null!=e.r?e.r:r,a=e.spec||this._baseSpec(i,n),o=this._drawDot(s,i,n,e.fill,-1,0,a);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,a,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:a})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const h=Math.max(1,n.config.chart.animations.speed||800),d=performance.now(),u=e=>{if(this._stale(t.node))return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-d)/h)),n=$t(i);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(a-e.x0)*n*l,i=e.y0+(o-e.y0)*n*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-n)}i<1?this.w.globals.unitExitRAF=A.requestAnimationFrame(u):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=A.requestAnimationFrame(u)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,n){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,a=i>0?e/i*100:0,o=n.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:a,w:s}):`${r}\n${a.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,n=e.clusterLabels,s=n.external.connector||{},r=t.reduce((t,e)=>t+e,0),a=[];if(t.forEach((t,i)=>{t>0&&a.push(...this._outerLabelLines(i,t,r,e))}),!a.length)return 0;const o=Rt(i,a,{fontSize:n.fontSize,fontFamily:n.fontFamily||i.config.chart.fontFamily,fontWeight:n.fontWeight})+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(n.external.offsetX)||0);return Math.min(o,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,n,s,r){const a=this.w;if(!M.isBrowser())return;const o=s.clusterLabels,l=o.external,c=l.connector||{},h=null!=c.gap?c.gap:8,d=null!=c.length?c.length:22,u=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,f=a.layout.gridWidth,g=a.layout.gridHeight,m=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let x=0,b=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);x=Math.max(...t)-Math.min(...t),b=Math.max(...e)-Math.min(...e)}const v=x>b,w=parseFloat(o.fontSize)||13,A=Math.round(1.35*w),k=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],n,s);if(!r.some(t=>""!==t))return;const a=v?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===a?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>c&&(c=i,l=e)});const g={x:l.x+o*(l.r||m),y:l.y},y={x:g.x+o*h,y:g.y};k.push({i:t.i,lines:r,anchor:g,elbow:y,labelX:y.x+o*d+u,idealY:g.y+p,labelY:g.y+p,side:a})}),!k.length)return;const L=k.reduce((t,e)=>Math.max(t,e.lines.length),1)*A,S=L/2;["left","right"].forEach(t=>{!function(t,e,i,n){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],a=r?r.labelY-i:0;if(a>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=a,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=n&&s.length&&s[0].labelY<n){const t=n-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(k.filter(e=>e.side===t),L+2,g-S,S)});const C=new _(a,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,a.config.chart.animations.speed||800);C.node.classList.add("apexcharts-unit-label-delay"),C.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}k.forEach(t=>{const e=a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";C.add(function(t,e){const{lines:i,lineHeight:n,anchor:s,elbow:r,labelX:a,labelY:o,side:l,connector:c,style:h,foreColor:d}=e,u=new _(t),p=u.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${a} ${o}`,i=u.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const f="right"===l?a+4:a-4,g=i.length,m=o-(g-1)*n/2,y=u.drawText({x:f,y:m,text:1===g?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:h.fontSize,fontFamily:h.fontFamily,fontWeight:h.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(g>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${f}`),t[e].setAttribute("dy",0===e?"0":`${n}`)}return p.add(y),p}(a,{lines:t.lines,lineHeight:A,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||a.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||a.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(C)}_drawClusterLabel(t,e,i,n,s,r){const a=this.w;if(!M.isBrowser())return;const o="http://www.w3.org/2000/svg",l=a.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=n>0?i/n*100:0,h=s.clusterLabels,d=parseFloat(h.fontSize)||13;let u;u="function"==typeof h.formatter?h.formatter(l,{seriesIndex:e.i,value:i,percent:c,w:a}):`${l} (${c.toFixed(1)}%)`;const p="string"==typeof u?u:String(u),f=A.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${d}px`),f.setAttribute("font-family",h.fontFamily||a.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(h.fontWeight||600)),f.setAttribute("fill",h.color||r);const g="bottom"===h.position,m=e.outerR+.6*d+3+(h.offsetY||0),y=p.length*d*.55;if(!g&&!e.flat&&!1!==h.curved&&y<=Math.PI*m*.95){const i=e.cy,n=`M ${e.cx-m} ${i} A ${m} ${m} 0 0 1 ${e.cx+m} ${i}`,s=`apexcharts-unit-label-${a.globals.chartID}-${e.i}`,r=A.createElementNS(o,"path");r.setAttribute("id",s),r.setAttribute("d",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=A.createElementNS(o,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=p,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=g?e.cy+e.outerR+d+6+(h.offsetY||0):e.cy-e.outerR-6-(h.offsetY||0);f.setAttribute("y",String(t)),f.textContent=p}return t.node.appendChild(f),f}}});const zt=Math.PI/180,Wt=180/Math.PI;function Ht(t,e,i,n){return{x:t+i*Math.cos((n-90)*zt),y:e+i*Math.sin((n-90)*zt)}}const jt=t=>`${t.x} ${t.y}`;function Yt(t,e){var i;const n=String(t).replace(/\//g,"%2F"),s=(null!=(i=e.get(n))?i:-1)+1;return e.set(n,s),`${s}:${n}`}function qt(t,e,i,n,s,r=null,a={},o=new Map){var l,c,h;const d=e&&"object"==typeof e,u=d&&null!=(c=null!=(l=e.x)?l:e.name)?c:"",p=d?null!=(h=e.y)?h:e.value:e,f=null==p||""===p?NaN:Number(p),g={name:String(u),value:isNaN(f)?null:f,color:d&&e.color?e.color:void 0,_key:`${s}/${Yt(u,o)}`};n&&!g.color&&(g.color=n[i%n.length]),a.keepDatum&&(g._datum=e);const m=new Map;if(d&&Array.isArray(e.children)&&e.children.length)g.children=e.children.map((e,i)=>qt(t,e,i,null,g._key,r,a,m));else if(d&&null!=e.drilldown&&!1!==a.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const n=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(n&&Array.isArray(n.data)&&n.data.length){const s=new Set(i);s.add(e.drilldown);const r=Array.isArray(n.colors)?n.colors:null;g.children=n.data.map((e,i)=>qt(t,e,i,r,g._key,s,a,m))}}}return g}function Xt(t,e={}){const i=t.config.series,n=i&&i[0],s=n&&Array.isArray(n.data)?n.data:i;if(!Array.isArray(s))return[];const r=new Map;return s.map((i,n)=>qt(t,i,n,null,"",null,e,r))}function Gt(t){t.children&&t.children.length&&(t.children.forEach(t=>Gt(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function Ut(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}const Kt="http://www.w3.org/1999/xhtml";function Vt(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function Zt(t,e,i,n){var s;const r=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,a=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=n&&n.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,n=t.dom.elWrap;if(!n)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const r=n.getBoundingClientRect().top,a=e.getBoundingClientRect();let o=i;for(let t=0;t<s.length;t++){const e=s[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}function Qt(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function Jt(t,e,i,n,s,r){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=n,t._parent=s,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=r.cap&&e>=r.cap,e>r.maxDepth&&(r.maxDepth=e),t._leaf||t._clipped)return;const a=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let o=i;for(let s=0;s<t.children.length;s++){const l=t.children[s],c=(n-i)*Math.max(0,l.value)/a;Jt(l,e+1,o,o+c,t,r),o+=c}}function te({roots:t,nodesAll:e,focus:i,t0:n,t1:s,cap:r}){for(let t=0;t<e.length;t++)e[t]._show=!1;const a={maxDepth:0,cap:r};if(i)return Jt(i,0,n,s,i._parent,a),a.maxDepth;const o=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=n;for(let e=0;e<t.length;e++){const i=(s-n)*Math.max(0,t[e].value)/o;Jt(t[e],0,l,l+i,null,a),l+=i}return a.maxDepth}function ee({maxDepth:t,near:e,far:i,gap:n=0}){const s=t+1,r=(i-e)/s,a=s>1?n:0;return{near:t=>e+t*r+(t>0?a/2:0),far:t=>e+(t+1)*r-a/2}}function ie(t,e,i,n,s){return t._leaf&&"extend"===n&&t._vDepth<i?s:e.far(t._vDepth)}function ne(t,{type:e,remedy:i}){let n=!1;const s=t=>{if(t.children&&t.children.length){const r=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!n&&null!=t.value&&Math.abs(r-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${r}). ${i}`),n=!0),t.children.forEach(s)}};t.forEach(s)}function se(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function re(t,e,i){let n=t===e?t._parent||null:t;return!n||n.children&&n.children.length||(n=n._parent||null),i&&1===i.length&&n===i[0]&&(n=null),n===e?{changed:!1,focus:e}:{changed:!0,focus:n}}function ae(t,e,i){var n;const s=t&&e.find(e=>e._key===t);return s&&(null==(n=s.children)?void 0:n.length)&&(1!==i.length||s!==i[0])?s:null}function oe(t,e){M.isBrowser()&&!1!==t.cfg.zoomOnClick&&(e._el.node.style.cursor=re(e,t._focus,t._roots).changed?"pointer":"default")}function le(t,e,i=0){if("number"==typeof t)return t;const n=String(t).trim();if(n.endsWith("%"))return parseFloat(n)/100*e;const s=parseFloat(n);return isNaN(s)?i*e:s}function ce(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const n=parseInt(i,16);if(isNaN(n))return t;let s=n>>16&255,r=n>>8&255,a=255&n;return s=Math.round(s+(255-s)*e),r=Math.round(r+(255-r)*e),a=Math.round(a+(255-a)*e),"#"+((1<<24)+(s<<16)+(r<<8)+a).toString(16).slice(1)}function he(t,e,i,n){if(t._color=t.color||e,n.push(t),t.children)for(let e=0;e<t.children.length;e++){const s=t.children[e];he(s,s.color||ce(t._color,i),i,n)}}class de{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&M.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){var i;const n=this._tip();if(!n)return;const s=this.w,r=(e.value/this.total*100).toFixed(1),a=e._parent?e._parent.value:this.total,o=a>0?(e.value/a*100).toFixed(1):r,l=s.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"",c=s.config.tooltip.y,h=null==(i=Array.isArray(c)?c[0]:c)?void 0:i.formatter,d=h?h(e.value,{seriesIndex:0,dataPointIndex:-1,w:s,node:e}):+e.value.toPrecision(12);n.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${l}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${d} (${o}% of parent, ${r}% of total)</span></div></div></div>`,n.classList.add("apexcharts-active"),n.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),n=e.offsetWidth,s=e.offsetHeight;let r=t.clientX-i.left+12;r+n>i.width&&(r=t.clientX-i.left-n-12),r=Math.max(0,Math.min(r,i.width-n));let a=t.clientY-i.top+12;a+s>i.height&&(a=t.clientY-i.top-s-12),a=Math.max(0,Math.min(a,i.height-s)),e.style.left=r+"px",e.style.top=a+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const ue=Math.PI/180,pe=180/Math.PI,fe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml",me=(t,e,i)=>t+(e-t)*i;g.default.use({sunburst:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.sunburst,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.startAngle=this.cfg.startAngle,this.endAngle=this.cfg.endAngle,this.maxDepth=0,this.centerX=0,this.centerY=0,this.maxRadius=0,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._innerR=()=>0,this._outerR=()=>0,this._tooltip=new de(t),this._lblSeq=0,this._morphLeafIndex=0,this._graphics=null,this._ringsG=null,this._labelsG=null}draw(t){const e=this.w,i=new _(this.w);this._graphics=i;const n=i.group({class:"apexcharts-sunburst"});if(e.globals.noData||!t||!t.length)return n;const s=e.layout.gridWidth,r=e.layout.gridHeight;if(this.centerX=s/2+(this.cfg.offsetX||0),this.centerY=r/2+(this.cfg.offsetY||0),this.maxRadius=Math.min(s,r)/2.05-this.strokeWidth-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.maxRadius<5)return n;if(this._roots=Xt(e),!this._roots.length)return n;this._roots.forEach(Gt),this._validateStrict(),this._nodesAll=[];const a=e.globals.colors||[];this._roots.forEach((t,e)=>{he(t,t.color||a[e%a.length]||"#008FFB",this.cfg.tint,this._nodesAll)}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._ringsG=i.group({class:"apexcharts-sunburst-rings"}),this._labelsG=i.group({class:"apexcharts-sunburst-labels"}),n.add(this._ringsG),n.add(this._labelsG),this._focus=ae(e.globals.sunburstFocusKey,this._nodesAll,this._roots),this._relayout(this._focus);let o="none";return e.config.chart.animations.enabled&&(e.globals.dataChanged?!1!==e.globals.shouldAnimate&&(o="update"):e.globals.resized||(o="intro")),this._applyLayout(o),this._renderBreadcrumb(),n}_validateStrict(){"strict"===this.cfg.partition&&ne(this._roots,{type:"sunburst",remedy:"Angles are normalized to fill the wedge."})}_relayout(t){this.w.globals.sunburstFocusKey=t&&t._key,this._focusMaxDepth=te({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:this.startAngle,t1:this.endAngle});const e=le(this.cfg.innerSize,this.maxRadius,.15),i=ee({maxDepth:this._focusMaxDepth,near:e,far:this.maxRadius,gap:1});this._innerR=i.near,this._outerR=i.far,this._nodesAll.forEach(t=>{t._show&&(t._iR=i.near(t._vDepth),t._oR=ie(t,i,this._focusMaxDepth,this.cfg.leaf,this.maxRadius))})}_applyLayout(t){var e,i,n;const s=this.w,r=s.config.chart.animations,a=r.dynamicAnimation,o=r.enabled&&"none"!==t?"intro"===t?null!=(e=r.speed)?e:500:a.enabled?null!=(i=a.speed)?i:350:0:0,l=++this._zoomGen,c=null==(n=this.ctx)?void 0:n.morphTypeChange,h=!!c&&"function"==typeof c.isActive&&c.isActive()&&"function"==typeof c.getInitialPathAt,d=h?c.getSpeed():0;this._morphLeafIndex=0;const u="update"===t?this.ctx._sunburstPrevGeoms:null,p=t=>t._cur||{a0:t._t0,a1:t._t1,iR:t._iR,oR:t._oR},f=t=>{const e=(t.a0+t.a1)/2;return{a0:e,a1:e,iR:t.iR,oR:t.iR}};if(this._nodesAll.forEach(e=>{if(e._show){const i={a0:e._t0,a1:e._t1,iR:e._iR,oR:e._oR};e._el||(e._el=this._createArcEl(e)),oe(this,e);const n=h?this._morphSourceFor(e):null;if(n&&d>0)this._morphArcFrom(e,n,i,d,l);else if(("intro"===t||h)&&o>0)this._sweepArc(e,i,h?d:o,l);else{const t=u&&u.get(e._key),n=e._cur||(t?p(t):f(i));this._animateArc(e,n,i,o,!1,!e._cur&&!t,l)}}else e._el&&e._cur&&this._animateArc(e,e._cur,f(e._cur),o,!0,!1,l)}),u&&o&&!h){const t=new Set(this._nodesAll.map(t=>t._show&&t._key));u.forEach((e,i)=>{if(t.has(i)||!e._show&&!e._cur)return;const n=this._graphics.drawPath({fill:e._color,stroke:this.strokeColor,strokeWidth:this.strokeWidth,classes:"apexcharts-sunburst-arc"});n.node.setAttribute("data:name",e.name),this._ringsG.add(n.attr({opacity:e._el.attr("opacity")}));const s=p(e),r={_el:n,_color:e._color,name:e.name,_key:i,_cur:s};this._nodesAll.push(r),this._animateArc(r,s,f(s),o,!0,!1,l)})}const g=Math.max(o,d);g?this._ringsG.animate(g).after(()=>{this._zoomGen===l&&this._ringsG.node.isConnected&&new v(s,this.ctx).animationCompleted(this._ringsG.node)}):s.globals.animationEnded=!0;const m=new Map;this._nodesAll.forEach(t=>{(t._show||t._cur)&&m.set(t._key,t)}),this.ctx._sunburstPrevGeoms=m,this._renderLabels(o)}_morphSourceFor(t){const e=this.ctx,i=e&&e.morphTypeChange;return i?"function"==typeof i.hasKeyedMarks&&i.hasKeyedMarks()&&"function"==typeof i.getInitialPathForKey?i.getInitialPathForKey(Ut(t._key)):t.children&&t.children.length?null:i.getInitialPathAt(this._morphLeafIndex++):null}_morphArcFrom(t,e,i,n,s){const r=t._el,a=this._arcPath(i.iR,i.oR,i.a0,i.a1,this.cfg.borderRadius);r.node.style.display="",r.attr({d:e,opacity:1}),t._cur=i,this._zoomGen===s&&new v(this.w,this.ctx).morphSVG(r,0,null,t._color,e,a,n,0)}_sweepArc(t,e,i,n){const s=t._el,r=this.cfg.borderRadius,a=this.startAngle,o=this.endAngle;s.node.style.display="",s.attr({d:"",opacity:1}),s.animate(i).during(i=>{if(this._zoomGen!==n)return;const l=a+(o-a)*i;if(l<=e.a0+.01)return void s.attr({d:""});const c=Math.min(e.a1,l);s.attr({d:this._arcPath(e.iR,e.oR,e.a0,c,r)}),t._cur={a0:e.a0,a1:c,iR:e.iR,oR:e.oR}}).after(()=>{this._zoomGen===n&&(t._cur=e)})}_createArcEl(t){const e=this._graphics.drawPath({fill:t._color,stroke:this.strokeColor,strokeWidth:this.strokeWidth,classes:"apexcharts-sunburst-arc"}),i=e.node;return i.setAttribute("data:name",t.name),i.setAttribute("data:value",String(t.value)),i.setAttribute("data:key",Ut(t._key)),i.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(i,t),M.isBrowser()&&!1!==this.cfg.zoomOnClick&&i.addEventListener("click",()=>this._zoomTo(t)),this._ringsG.add(e),e}_animateArc(t,e,i,n,s,r,a){const o=t._el,l=this.cfg.borderRadius;if(o.attr({fill:t._color}),0===n)return o.attr({d:this._arcPath(i.iR,i.oR,i.a0,i.a1,l),opacity:s?0:1}),o.node.style.display=s?"none":"",void(t._cur=s?null:i);o.node.style.display="";const c=s?Number(o.attr("opacity"))||1:r?0:1,h=s?0:1;o.attr({opacity:c}),o.animate(n).during(n=>{if(this._zoomGen!==a)return;const s=me(e.a0,i.a0,n),r=me(e.a1,i.a1,n),d=me(e.iR,i.iR,n),u=me(e.oR,i.oR,n);o.attr({d:this._arcPath(d,u,s,r,l),opacity:me(c,h,n)}),t._cur={a0:s,a1:r,iR:d,oR:u}}).after(()=>{this._zoomGen===a&&(s?(o.node.style.display="none",t._cur=null):t._cur=i)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);if(!this.cfg.dataLabels.show)return;this._nodesAll.forEach(t=>{t._show&&(t._t1-t._t0<this.cfg.dataLabels.minAngleToShow||this._renderCurvedLabel(t))});const i=this._zoomGen;e.attr({opacity:t>0?0:1}),t>0&&e.animate(250,t).during(t=>{this._zoomGen===i&&e.attr({opacity:t})})}_renderCurvedLabel(t){const e=this.cfg.dataLabels.style,i=this.w,n=(t._iR+t._oR)/2,s=((t._t0+t._t1)/2%360+360)%360,r=s>90&&s<270,a=Math.min(n>0?4/n*pe:0,(t._t1-t._t0)/2),o=r?t._t1-a:t._t0+a,l=r?t._t0+a:t._t1-a,c=this._ptAt(n,o),h=this._ptAt(n,l),d=Math.abs(l-o)>180?1:0,u=r?0:1,p=`apx-sb-lbl-${i.globals.cuid}-${this._lblSeq++}`,f=A.createElementNS(fe,"path");f.setAttribute("id",p),f.setAttribute("d",`M ${c.x} ${c.y} A ${n} ${n} 0 ${d} ${u} ${h.x} ${h.y}`),f.setAttribute("fill","none"),f.setAttribute("stroke","none");const g=e.colors,m=(Array.isArray(g)?g[0]:g)||"#fff",y=A.createElementNS(fe,"text");y.setAttribute("font-size",e.fontSize||"12px"),e.fontFamily&&y.setAttribute("font-family",e.fontFamily),y.setAttribute("font-weight",String(e.fontWeight||400)),y.setAttribute("fill",m),y.setAttribute("dominant-baseline","central"),y.style.pointerEvents="none";const x=A.createElementNS(fe,"textPath");x.setAttribute("href","#"+p),x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+p),x.setAttribute("startOffset","50%"),x.setAttribute("text-anchor","middle"),x.textContent=this._truncate(t.name,n,t._t1-t._t0,e.fontSize),y.appendChild(x),this._labelsG.node.appendChild(f),this._labelsG.node.appendChild(y)}_truncate(t,e,i,n){const s=e*i*ue-8,r=.58*(parseFloat(n)||12),a=Math.floor(s/r);return a>=t.length?t:a<=1?"":t.slice(0,Math.max(1,a-1))+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=re(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!M.isBrowser())return;const t=this.w,e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");if(i&&i.parentNode&&i.parentNode.removeChild(i),!this._focus)return;const n=A.createElementNS(ge,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label","Sunburst breadcrumb"),n.style.position="absolute",n.style.top="0px",n.style.left="0px";const s=[{name:"All",node:null}].concat(se(this._focus).map(t=>({name:t.name,node:t})));s.forEach((t,e)=>{if(e>0){const t=A.createElementNS(ge,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.textContent=" / ",n.appendChild(t)}if(e===s.length-1){const e=A.createElementNS(ge,"span");e.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),e.textContent=t.name,n.appendChild(e)}else{const i=A.createElementNS(ge,"button");if(i.setAttribute("type","button"),i.setAttribute("class","apexcharts-breadcrumb-item"),0===e){const t=A.createElementNS(ge,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.textContent="\u2190",i.appendChild(t)}const s=A.createElementNS(ge,"span");s.setAttribute("class","apexcharts-breadcrumb-label"),s.textContent=t.name,i.appendChild(s),i.addEventListener("click",()=>{this._focus=t.node,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}),n.appendChild(i)}}),e.appendChild(n),function(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const n=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),s=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!s)break;e.style.top=s.getBoundingClientRect().bottom-n+4+"px"}}(t,n)}_ptAt(t,e){return{x:this.centerX+t*Math.cos((e-90)*ue),y:this.centerY+t*Math.sin((e-90)*ue)}}_arcPath(t,e,i,n,s){if(e<=t+.01)return"";let r=n-i;const a=this.cfg.spacing;if(a>0&&r>0&&e>0){const t=a/e*pe,s=Math.min(t/2,Math.max(0,r/2-.25));r=(n-=s)-(i+=s)}if(r<=0)return"";const o=r*ue,l=this.centerX,c=this.centerY;let h=s;return h=Math.min(h,o*t/2,o*e/2,(e-t)/2),h>.5?function({cx:t,cy:e,rIn:i,rOut:n,a0:s,a1:r,r:a,spanDeg:o}){const l=(i,n)=>Ht(t,e,i,n),c=a/n*Wt,h=a/i*Wt,d=l(n,s+c),u=l(n,r-c),p=o-2*c>180?1:0,f=l(n,r),g=l(n-a,r),m=l(n,s),y=l(n-a,s),x=l(i,r-h),_=l(i,s+h),b=o-2*h>180?1:0,v=l(i,r),w=l(i+a,r),A=l(i,s),M=l(i+a,s);return["M",jt(d),"A",n,n,0,p,1,jt(u),"Q",jt(f),jt(g),"L",jt(w),"Q",jt(v),jt(x),"A",i,i,0,b,0,jt(_),"Q",jt(A),jt(M),"L",jt(y),"Q",jt(m),jt(d),"Z"].join(" ")}({cx:l,cy:c,rIn:t,rOut:e,a0:i,a1:n,r:h,spanDeg:r}):function({cx:t,cy:e,rIn:i,rOut:n,a0:s,a1:r,spanDeg:a}){const o=(i,n)=>Ht(t,e,i,n),l=a>180?1:0,c=o(n,s),h=o(n,r),d=o(i,r),u=o(i,s);return["M",jt(c),"A",n,n,0,l,1,jt(h),"L",jt(d),"A",i,i,0,l,0,jt(u),"Z"].join(" ")}({cx:l,cy:c,rIn:t,rOut:e,a0:i,a1:n,spanDeg:r})}}});const ye="http://www.w3.org/2000/svg",xe=(t,e,i)=>t+(e-t)*i;g.default.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new de(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new _(this.w);this._graphics=i;const n=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return n;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return n;const s=this.cfg.direction;if(this._vertical="right"!==s&&"left"!==s,this._flip="up"===s||"left"===s,this._roots=Xt(this.w),!this._roots.length)return n;this._roots.forEach(t=>Gt(t)),this._nodesAll=[],this._colorNodes(),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),n=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&n(t[e].children)};n(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&ne(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),n.add(this._cellsG),n.add(this._labelsG),this._focus=ae(e.globals.icicleFocusKey,this._nodesAll,this._roots),this._relayout(this._focus);const r=e.config.chart.animations;let a="none";return r.enabled&&(e.globals.dataChanged?r.dynamicAnimation.enabled&&(a="update"):e.globals.resized||(a="intro")),this._applyLayout(a),this._renderBreadcrumb(),n}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const n=[];for(;1===i.length&&i[0].children&&i[0].children.length;)n.push(i[0]),i=i[0].children;const s=ce(e,.62);n.forEach(t=>{t._color=t.color||s,this._nodesAll.push(t)}),i.forEach((i,n)=>{he(i,i.color||t[n%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){this.w.globals.icicleFocusKey=t&&t._key;const e=this._valueExtent(),i=this.cfg.maxDepth,n="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=se(t).length-1;this._focusMaxDepth=te({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:n?n-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=te({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:n?n-1:void 0});const s=this._depthExtent(),r=this._focusMaxDepth+1,a="equal"===this.cfg.levelSize?0:le(this.cfg.levelSize,s,0),o=a>0?Math.min(s,a*r):s,l=ee({maxDepth:this._focusMaxDepth,near:0,far:o,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=l.near(t._vDepth),t._d1=ie(t,l,this._focusMaxDepth,this.cfg.leaf,o))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const n=e/i,s=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-s)*n,r=(t._t1-s)*n;r<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,r))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),n=t._d0,s=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-n-s:n,w:i,h:s}:{x:this._flip?this.width-n-s:n,y:e,w:s,h:i}}_applyLayout(t){var e,i;const n=this.w.config.chart.animations,s=n.dynamicAnimation,r=n.enabled&&"none"!==t?"intro"===t?null!=(e=n.speed)?e:500:s.enabled?null!=(i=s.speed)?i:350:0:0,a=++this._zoomGen,o="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),oe(this,e),"intro"===t&&r>0)return void this._wipeCell(e,i,r,a);let n,s=!1;e._cur?n=e._cur:o&&o.get(e._key)?n=o.get(e._key)():(n={x:i.x+i.w/2,y:i.y+i.h/2,w:0,h:0},s=!0),this._animateCell(e,n,i,r,!1,s,a)}else if(e._el&&e._cur){const t=e._cur,i={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,i,r,!0,!1,a)}});const l=new Map;this._nodesAll.forEach(t=>{const e=this._box(t);t._show&&l.set(t._key,()=>t._cur||e)}),this.ctx._iciclePrevGeoms=l,this._renderLabels(r)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const n=i.node;return n.setAttribute("data:name",t.name),n.setAttribute("data:value",String(t.value)),n.setAttribute("data:key",Ut(t._key)),n.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(n,t),M.isBrowser()&&!1!==this.cfg.zoomOnClick&&n.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,n){const s=t._el,r=this._focusMaxDepth+1,a=r>1?t._vDepth/r*i*.6:0,o=i-a,l=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(s,l),s.attr({opacity:1}),s.node.style.display="",t._cur=l,s.animate(o,a).during(i=>{if(this._zoomGen!==n)return;const r={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(s,r),t._cur=r}).after(()=>{this._zoomGen===n&&(this._setBox(s,e),t._cur=e)})}_animateCell(t,e,i,n,s,r,a){const o=t._el;if(o.attr({fill:t._color}),0===n)return this._setBox(o,i),o.attr({opacity:s?0:1}),o.node.style.display=s?"none":"",void(t._cur=s?null:i);o.node.style.display="";const l=s?Number(o.attr("opacity"))||1:r?0:1,c=s?0:1;o.attr({opacity:l}),o.animate(n).during(n=>{if(this._zoomGen!==a)return;const s={x:xe(e.x,i.x,n),y:xe(e.y,i.y,n),w:xe(e.w,i.w,n),h:xe(e.h,i.h,n)};this._setBox(o,s),o.attr({opacity:xe(l,c,n)}),t._cur=s}).after(()=>{this._zoomGen===a&&(s?(o.node.style.display="none",t._cur=null):(this._setBox(o,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,n=Math.min(i,Math.max(0,e.w-.5))/2,s=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+n,y:e.y+s,width:Math.max(0,e.w-2*n),height:Math.max(0,e.h-2*s)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);if(!this.cfg.dataLabels.show)return;this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))});const i=this._zoomGen;e.attr({opacity:t>0?0:1}),t>0&&e.animate(250,t).during(t=>{this._zoomGen===i&&e.attr({opacity:t})})}_renderLabel(t){const e=this.cfg.dataLabels,i=e.style,n=this._box(t),s="always"===e.rotate||"never"!==e.rotate&&n.h>n.w,r=s?n.h:n.w,a=s?n.w:n.h,o=parseFloat(i.fontSize)||12;if(r<e.minSizeToShow)return;if(a<o+2)return;const l=r-8;let c=t.name;if(e.showValue){const e=`${t.name}: ${+t.value.toPrecision(12)}`;this._fits(e,l,o)&&(c=e)}const h=this._truncate(c,l,o);if(!h)return;const d=i.colors,u=(Array.isArray(d)?d[0]:d)||"#fff",p=A.createElementNS(ye,"text");p.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&p.setAttribute("font-family",i.fontFamily),p.setAttribute("font-weight",String(i.fontWeight||400)),p.setAttribute("fill",u),p.setAttribute("dominant-baseline","central"),p.style.pointerEvents="none",p.textContent=h;const f="center"===e.align?"middle":"right"===e.align?"end":"start",g=n.x+4,m=n.x+n.w-4,y=n.x+n.w/2;if(s){const t=n.x+n.w/2,e=n.y+n.h-4,i=n.y+4,s=n.y+n.h/2,r="middle"===f?s:"end"===f?i:e;p.setAttribute("text-anchor",f),p.setAttribute("x",String(t)),p.setAttribute("y",String(r)),p.setAttribute("transform",`rotate(-90 ${t} ${r})`)}else{const t="middle"===f?y:"end"===f?m:g;p.setAttribute("text-anchor",f),p.setAttribute("x",String(t)),p.setAttribute("y",String(n.y+n.h/2))}this._labelsG.node.appendChild(p)}_renderMoreMark(t){const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,n=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,s=A.createElementNS(ye,"g");s.setAttribute("class","apexcharts-icicle-more"),s.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=A.createElementNS(ye,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:n)),e.setAttribute("cy",String(this._vertical?n:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),s.appendChild(e)}this._labelsG.node.appendChild(s)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const n=.58*i,s=Math.floor(e/n);return s>=t.length?t:s<4?"":t.slice(0,s-1)+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=re(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!M.isBrowser())return;if(!this._focus)return void Qt(this.w);const t=Vt(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(se(this._focus).map(t=>({label:t.name,data:t}))),n=function(t,e){if(!M.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;Qt(t);const n=e.config||Vt(t);if(!1===n.show)return null;const s=e.crumbs||[];if(s.length<2)return null;const r=A.createElementNS(Kt,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,n=e.offsetY||0;t.style.position="absolute",t.style.top=n+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,n),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const a=null!=n.separator?n.separator:" / ";return s.forEach((t,i)=>{var o;if(i>0){const t=A.createElementNS(Kt,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}let l=0===i?null!=(o=n.rootLabel)?o:"All":t.label;if("function"==typeof n.formatter&&(l=n.formatter(l,{index:i,depth:s.length-1,data:t.data})),i===s.length-1){const t=A.createElementNS(Kt,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const c=A.createElementNS(Kt,"button");if(c.setAttribute("type","button"),c.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=A.createElementNS(Kt,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",c.appendChild(t)}const h=A.createElementNS(Kt,"span");h.setAttribute("class","apexcharts-breadcrumb-label"),h.textContent=String(l),c.appendChild(h),c.addEventListener("click",n=>e.onNavigate(i,t,n)),r.appendChild(c)}),i.appendChild(r),r}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});n&&Zt(this.w,this.ctx,n,t)}}});const _e="__apexcharts_series_transforms__";function be(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[_e][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}function ve(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),n=i.length;let s=e.bandwidth;if(!("number"==typeof s&&s>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let n=0;n<e;n++)i+=t[n];const n=i/e;let s=0;for(let i=0;i<e;i++){const e=t[i]-n;s+=e*e}return Math.sqrt(s/e)}(i),e=ct(i,.75)-ct(i,.25);s=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(n,-.2)}if(!isFinite(s)||s<=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*s,o=(i[n-1]+2*s-a)/(r-1),l=1/(n*s*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<n;t++){const n=(e-i[t])/s;r+=Math.exp(-.5*n*n)}c.push([e,r*l])}return{density:c,bandwidth:s}}function we(t,e){var i,n;const s=null!=(i=t.statsDerived)?i:t.statsDerived={};return null!=(n=s[e])?n:s[e]=new Map}function Ae(t,e,i){const n=t.get(e);if(!n||!Array.isArray(i)||n.length!==i.length)return!1;for(let t=0;t<i.length;t++){const e=n[t],s=i[t];if(e!==s&&(!Array.isArray(e)||!Array.isArray(s)||e[0]!==s[0]||e[1]!==s[1]))return!1}return!0}globalThis[_e]||(globalThis[_e]={}),be("raincloud",function(t,e){var i,n;if(!Array.isArray(t))return t;const s=(null==(i=e.config.plotOptions)?void 0:i.violin)||{},r=s.kde||{},a=(null==(n=s.box)?void 0:n.whiskers)||"minmax",c=we(e,"raincloudDensity"),h=we(e,"raincloudSummary");return t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"raincloud"!==t.type&&"violin"!==t.type)return t;let i=!1;const n=t.data.map((t,n)=>{const s=e+":"+n,d=(null==t?void 0:t.y)&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{},u=!Array.isArray(d.density)||!d.density.length||Ae(c,s,d.density),p=!Array.isArray(d.summary)||5!==d.summary.length||Ae(h,s,d.summary);if(!u&&!p)return t;const f=function(t){var e;if(!t||"object"!=typeof t||Array.isArray(t))return null;let i=null;if(Array.isArray(t.points)?i=t.points:Array.isArray(null==(e=t.y)?void 0:e.points)?i=t.y.points:Array.isArray(t.y)&&"number"==typeof t.y[0]&&(i=t.y),!i)return null;const n=[];for(let t=0;t<i.length;t++){const e=I.parseNumber(i[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}(t);if(!f)return t;const g=o({},d);if(u){const e=ve(f,{bandwidth:r.bandwidth,resolution:r.resolution});if(!e)return t;g.density=e.density,g.points=f,c.set(s,e.density)}if(p){const t=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),n=ct(i,.25),s=ct(i,.5),r=ct(i,.75),a=r-n;let o=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&a>0){const t=n-1.5*a,e=r+1.5*a;let s=0;for(;s<i.length&&i[s]<t;)s++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;s<=h&&(o=i[s],l=i[h],c=i.slice(0,s).concat(i.slice(h+1)))}return{summary:[o,n,s,r,l],outliers:c,iqr:a}}(f,{whiskers:a});t&&(g.summary=t.summary,h.set(s,t.summary))}return i=!0,l(o({},t),{y:g})});return i?l(o({},t),{data:n}):t})});const Me="http://www.w3.org/1999/xhtml";class ke{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!M.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const n=i.querySelector(".apexcharts-breadcrumb[aria-label^=Drill]");n&&n.parentNode&&n.parentNode.removeChild(n);const s=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!s||!1===s.show)return;if(0===this.drilldown.depth)return;const r=A.createElementNS(Me,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,s);const a=null!=s.separator?s.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=A.createElementNS(Me,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=a,r.appendChild(t)}const n=this._label(e,i);if(i===t.length-1){const t=A.createElementNS(Me,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=n,r.appendChild(t)}else{const t=A.createElementNS(Me,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=A.createElementNS(Me,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=A.createElementNS(Me,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=n,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&Zt(this.w,this.ctx,r,s),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 n=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),s=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(!s)break;t.style.top=s.getBoundingClientRect().bottom-n+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let n;if(0===e)n=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);n=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(n,{index:e,depth:this.drilldown.depth}):n}_position(t,e){const i=e.offsetX||0,n=e.offsetY||0;t.style.position="absolute",t.style.top=n+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const Le="http://www.w3.org/1999/xhtml",Se="apexcharts-drilldown-loading";class Ce{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(!M.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=A.createElementNS(Le,"div");i.setAttribute("class",Se),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const n=A.createElementNS(Le,"div");if(n.setAttribute("class",`${Se}-spinner`),n.setAttribute("aria-hidden","true"),i.appendChild(n),t.text){const e=A.createElementNS(Le,"span");e.setAttribute("class",`${Se}-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(`.${Se}`);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 Ee="__apexDrilldownMarker";g.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 ke(t,e,this),this.loading=new Ce(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 n=this._resolveChild(t);return n?this._drillInto(n,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):(console.warn(`ApexCharts: drilldown id "${t}" not found in chart.drilldown.series, and no onDrillDown resolver is set.`),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],n=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const s=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(n),"up",{from:i,to:s})}_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 console.warn("ApexCharts: drilldown max depth (32) reached."),Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const n=this.path[this.path.length-1],s={id:t.id,name:t.name,restore:this._snapshot()};return this.stack.push(s),this._apply(this._viewFromChild(t),"down",{from:n,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex}).catch(e=>{throw this.stack[this.stack.length-1]===s&&this.stack.pop(),this._fire("drillDownError",{id:t.id,error:e}),e})}_drillDownAsync(t,e,i){const n=this.w.config.drilldown.onDrillDown,s=this._cacheGet(t);if(s)return this._drillInto(s,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=n({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(n=>{if(a(),this._isDead())return this.ctx;if(!n||!n.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 s=null!=n.id?n:l(o({},n),{id:t});return this._cacheSet(t,s),this._drillInto(s,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(I.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=I.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=I.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=I.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?I.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=I.clone(t.plotOptions)),e.has("fill")&&(i.fill=I.clone(t.fill)),e.has("legend")&&(i.legend=I.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,n=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!n.length)return t;const s=e.config.chart.type,r=("pie"===s||"donut"===s||"polarArea"===s)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of n){const n=e.index;i.axisCharts?t[n]&&(t[n].data=Array.isArray(e.data)?e.data.slice():e.data):r[n]&&"object"==typeof r[n]?r[n].y=e.data:void 0!==r[n]&&(r[n]=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){var n;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 r=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i),null==(n=this.ctx.highlightFilter)||n.drillView(t);const a=e=>this.ctx.updateOptions(t,!1,e,!1,!1),c=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(r&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>a(!1)).then(c)}return a(r).then(c)}_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(!M.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const n=e.getBoundingClientRect();let s=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(s=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),s&&"function"==typeof s.getBoundingClientRect){const t=s.getBoundingClientRect();return{x:t.left+t.width/2-n.left,y:t.top+t.height/2-n.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-n.left,y:r.top+r.height/2-n.top}}_zoomDrill(t,e,i){return h(this,null,function*(){const n=this._zoomDuration(),s="down"===e,r=Math.round(.55*n),a=s?"scale(1.03)":"scale(0.97)",o=s?"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:n,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})}_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||this._retired())return;const n=this._pointAt(i.seriesIndex,i.dataPointIndex);return n&&"object"==typeof n&&null!=n.drilldown?this.drillDown(n.drilldown,n,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,n,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const n=i[t];return n&&Array.isArray(n.data)&&null!=n.data[e]?n.data[e]:null}_retired(){return this.ctx.drilldown!==this&&(Promise.resolve().then(()=>{const t=this.ctx.events;t&&(t.removeEventListener("dataPointSelection",this._onPointSelect),t.removeEventListener("mounted",this._afterRender),t.removeEventListener("updated",this._afterRender))}),!0)}_afterRender(){const t=this.w;this._retired()||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(!M.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let n=0;i.forEach((t,i)=>{const s=t&&Array.isArray(t.data)?t.data:null;s&&s.forEach((t,s)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${s}"]`);r.length||n++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),n&&!this._warnedUnreachable&&(this._warnedUnreachable=!0,console.warn(`ApexCharts: ${n} drillable point(s) have no clickable mark, so clicking them cannot do anything. Leave \`drilldown.marker\` on, or give the series markers of its own (\`markers.size > 0\`).`))}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0,console.warn("ApexCharts: `plotOptions.pie.expandOnClick` is not available in a drilldown pie/donut, so it was ignored. A slice click navigates, and a slice that slid out would be discarded by the drill it just triggered."))}_wirePlotClick(){if(!M.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 n=t.target;if(!n||"function"!=typeof n.closest)return;if(n.closest(".apexcharts-drilldown-target"))return;if(n.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const s=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==s||null==r||s<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[s]))return;const a=this._pointAt(s,r);return a&&"object"==typeof a&&null!=a.drilldown?this.drillDown(a.drilldown,a,{seriesIndex:s,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,n=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[Ee]):[],s=i&&i.marker||{};if(!1===s.show||!Array.isArray(t))return n;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 n={seriesIndex:e,dataPointIndex:i,[Ee]:!0};void 0!==s.size&&(n.size=s.size),void 0!==s.shape&&(n.shape=s.shape),void 0!==s.fillColor&&(n.fillColor=s.fillColor),void 0!==s.strokeColor&&(n.strokeColor=s.strokeColor),r.push(n)})}),n.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,n=Array.isArray(i)?i[t]:i;return!(Number(n)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});function Fe(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function De(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const n=t||{},{hidden:s}=n,r=c(n,["hidden"]);let a=r.data;if(Array.isArray(a)&&!a.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(a=t.data)}return l(o({},r),{data:Array.isArray(a)?a.slice():a})})}function Pe(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:n,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function Re(t,e,i){if(t&&t.fillColor)return t.fillColor;const n=i[e];return"string"==typeof n&&n?n:void 0}function Te(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}be("waterfall",function(t,e){var i,n,s;const r=e.config,a=e.globals;if(!Array.isArray(t))return t;a.waterfallRawSeries||(a.waterfallRawSeries=De(t,a));const c=a.waterfallRawSeries,h=(null==(n=null==(i=r.plotOptions)?void 0:i.waterfall)?void 0:n.colors)||{},d=null==(s=r.xaxis)?void 0:s.categories,u=Fe(a),p=[],f=[],g=[],m=c.map((t,e)=>{const i=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==u.indexOf(e))return p[e]=[],f[e]=[],g[e]=[],l(o({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.length)return!0}return!1}(i))return p[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=I.parseNumber(e[0]),n=I.parseNumber(e[1]);return null===i||null===n?null:n-i}),f[e]=i.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,i=Array.isArray(e)?I.parseNumber(e[1]):null;return null===i?0:i}),g[e]=i.map(()=>null),t;const n=function(t,e,i){const n=[],s=[],r=[],a=[];let c=0,h=0;for(let d=0;d<t.length;d++){const{x:u,y:p,isSubtotal:f,isTotal:g,rest:m}=Pe(t[d],d,e);let y,x,_;if(g||f)y=g?0:h,x=c,_=g?"total":"subtotal",h=c;else{const t=I.parseNumber(p);if(null===t||!isFinite(t)){n.push(l(o({},m),{x:u,y:null})),s.push(null),r.push(c),a.push(null);continue}y=c,x=c+t,c=x,_=t<0?"negative":"positive"}const b=Re(m,_,i);n.push(o(l(o({},m),{x:u,y:[y,x]}),b?{fillColor:b}:{})),s.push(x-y),r.push(c),a.push(_)}return{data:n,values:s,cumulative:r,kinds:a}}(i,d,h);return p[e]=n.values,f[e]=n.cumulative,g[e]=n.kinds,l(o({},t),{data:n.data})});return e.waterfallData={values:p,cumulative:f,kinds:g,geometry:[]},m}),g.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 n=null==(e=null==(t=i.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!n||!1===n.show)return;const s=i.dom.elGraphical,r=i.waterfallData&&i.waterfallData.geometry;if(!s||!r)return;this.removeConnectors();const a=new _(i,this.ctx),o=a.group({class:"apexcharts-waterfall-connectors"}),l=n.color||i.config.grid.borderColor,c=null==n.strokeWidth?1:n.strokeWidth,h=null==n.strokeDashArray?3:n.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],n=e[t+1];if(!i||!n)continue;if(!(n.slotStart-i.slotEnd>.5))continue;const s=i.horizontal?a.drawLine(i.levelEnd,i.slotEnd,i.levelEnd,n.slotStart,l,h,c):a.drawLine(i.slotEnd,i.levelEnd,n.slotStart,i.levelEnd,l,h,c);s.node.classList.add("apexcharts-waterfall-connector"),o.add(s),d++}}if(!d)return;o.attr("clip-path",`url(#gridRectBarMask${i.globals.cuid})`);const u=s.node.querySelector(".apexcharts-xaxis");u?s.node.insertBefore(o.node,u):s.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;M.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),be("dumbbell",function(t,e){var i;const n=e.config,s=e.globals;if(!Array.isArray(t))return t;s.dumbbellRawSeries||(s.dumbbellRawSeries=De(t,s));const r=s.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.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=n.xaxis)?void 0:i.categories,c=Fe(s),{xs:h,rows:d,byX:u}=function(t,e){var i;const n=[],s=[],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}=Te(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,n.length),n.push(i),s.push(o({},l)));const u=r.get(d);h.set(u,I.parseNumber(a))}a.push(h)}return{xs:n,rows:s,byX:a}}(r,a),p=[],f=[],g=[];for(let t=0;t<r.length;t++)-1===c.indexOf(t)&&g.push(t);const m=[];for(let t=0;t<h.length;t++){const e=[];for(let i=0;i<r.length;i++){const n=u[i].has(t)?u[i].get(t):null;e.push(null!=n&&isFinite(n)?n:null)}p.push(e);let i=null,n=null,s=-1,a=-1;for(let t=0;t<g.length;t++){const r=g[t],o=e[r];null!==o&&((null===i||o<i)&&(i=o,s=r),(null===n||o>n)&&(n=o,a=r))}null!==i&&null!==n?(f.push([s,a]),m.push(l(o({},d[t]),{x:h[t],y:[i,n]}))):(f.push(null),m.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:p,order:f,carrier:g.length?g[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&&g.length?m:[]}))});class Ne{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)/Ne.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*Ne.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,n=i&&i.querySelector(".apexcharts-svg");if(!n)return e-t.layout.translateX;const s=n.getBoundingClientRect(),r=t.globals.svgWidth?s.width/t.globals.svgWidth:1;return(e-s.left)/(r||1)-t.layout.translateX}}const Oe=["wiggle","silhouette","zero","expand"],$e=["inside-out","inverse","none"];function Ie(t,e,i){const n=i&&void 0!==i[e]?i[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}be("streamgraph",function(t,e){var i,n;const s=e.config,r=e.globals;if(!Array.isArray(t))return t;r.streamgraphRawSeries||(r.streamgraphRawSeries=De(t,r));const a=r.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const i=t[e],n=Array.isArray(i)?i[1]:i&&"object"==typeof i?i.y:i;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const c=(null==(i=s.plotOptions)?void 0:i.streamgraph)||{},h=-1!==Oe.indexOf(c.offset)?c.offset:"wiggle",d=-1!==$e.indexOf(c.order)?c.order:"inside-out",u=null==(n=s.xaxis)?void 0:n.categories,p=Fe(r),{xs:f,rows:g,grids:m}=function(t,e){var i;const n=[],s=[],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}=Ie(c[t],t,e),d=i instanceof Date?i.getTime():i;r.has(d)||(r.set(d,n.length),n.push(i),s.push(o({},l))),h.set(r.get(d),I.parseNumber(a))}a.push(h)}return{xs:n,rows:s,grids:a}}(a,u),y=function(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i]instanceof Date?t[i].getTime():t[i];if("number"!=typeof n||!isFinite(n))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 n=i.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(f),x=y?y.map(t=>f[t]):f,_=y?y.map(t=>g[t]):g,b=x.length;let v=!1;const w=[];for(let t=0;t<a.length;t++){const e=new Array(b);for(let i=0;i<b;i++){const n=m[t].get(y?y[i]:i);let s=null==n?0:Number(n);isFinite(s)||(s=0),s<0&&(v=!0,s=0),e[i]=s}w.push(e)}v&&!r.streamgraphWarnedNegative&&(r.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const A=[];for(let t=0;t<a.length;t++)-1===p.indexOf(t)&&A.push(t);let M=w;if("expand"===h){M=w.map(t=>t.slice());for(let t=0;t<b;t++){let e=0;for(let i=0;i<A.length;i++)e+=M[A[i]][t];if(e)for(let i=0;i<A.length;i++)M[A[i]][t]/=e}}const k=function(t,e,i){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},s={};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);n[r]=o,s[r]=c}const r=e.slice().sort((t,e)=>s[t]-s[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+=n[e],l.push(e)):(o+=n[e],c.push(e))}return c.reverse().concat(l)}(d,A,M),L=function(t,e,i,n){const s=new Array(n).fill(0);if(0===n||0===e.length)return s;if("zero"===t||"expand"===t)return s;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let s=0;s<e.length;s++)n+=i[e[s]][t];s[t]=-n/2}return s}let r=0;for(let t=1;t<n;t++){let n=0,a=0;for(let s=0;s<e.length;s++){const r=i[e[s]],o=r[t];let l=(o-r[t-1])/2;for(let n=0;n<s;n++){const s=i[e[n]];l+=s[t]-s[t-1]}n+=o,a+=l*o}n&&(r-=a/n),s[t]=r}return s}(h,k,M,b),S=a.map(()=>null),C=a.map(()=>null);for(let t=0;t<k.length;t++)S[k[t]]=new Array(b),C[k[t]]=new Array(b);for(let t=0;t<b;t++){let e=L[t];for(let i=0;i<k.length;i++){const n=k[i],s=S[n],r=C[n];s[t]=e,e+=M[n][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:x,values:w,lows:S,highs:C,order:k,offset:h,hidden:a.map((t,e)=>e).filter(t=>-1!==p.indexOf(t))},a.map((t,e)=>{const i=S[e],n=C[e];if(!i||!n)return l(o({},t),{data:[]});const s=new Array(b);for(let t=0;t<b;t++)s[t]=l(o({},_[t]),{x:x[t],y:[i[t],n[t]]});return l(o({},t),{data:s})})}),g.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,n=i.globals,s=i.layout.gridHeight,r=n.maxY-n.minY;if(!r||!isFinite(r))return s/2;const a=(t-n.minY)/r;return(null==(e=i.config.yaxis[0])?void 0:e.reversed)?a*s:s-a*s}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,i,n,s,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 _(o,this.ctx),u=d.group({class:"apexcharts-streamgraph-labels"}),p=(null==(i=l.style)?void 0:i.fontSize)||"auto",f=(null==(n=l.style)?void 0:n.fontFamily)||o.config.chart.fontFamily,g=(null==(s=l.style)?void 0:s.fontWeight)||600,m=null==l.minWidth?24:l.minWidth,y=[];for(let t=0;t<h.order.length;t++){const e=h.order[t],i=this._placeLabel(e,{fontSize:p,fontFamily:f,fontWeight:g,minWidth:m,graphics:d});i&&y.push(i)}let x=0;for(const t of this._deconflict(y)){const e=t.k,i=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:f,fontWeight:g,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),x++}if(!x)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:n,minWidth:s,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 p=0;for(let t=0;t<d;t++){const e=Math.abs(this._yPx(c[t])-this._yPx(l[t]));u[t]=e,e>p&&(p=e)}if(p<=0)return null;const f=this._resolveFontSize(e,p),g=String(o.names[t]);let m=f,y=r.getTextRects(g,`${m}px`,i,"",!0,n);if(p<y.height+6)return null;const x=this._widestRun(u,h,y.height+6,d);if(!x)return null;if(y.width>x.width&&"auto"===e){const t=Math.floor(m*(x.width/y.width));if(t<this._autoBounds().min)return null;if(m=t,y=r.getTextRects(g,`${m}px`,i,"",!0,n),p<y.height+6)return null}const _=y.height+6,b=[];for(const e of this._runs(u,_,d)){const a=Number(h[e.l]),o=Number(h[e.r]);if(!isFinite(a)||!isFinite(o))continue;let u=o-a;if(u<=0&&d>1){const t=Math.abs(Number(h[Math.min(e.r+1,d-1)])-Number(h[Math.max(e.l-1,0)]));u=isFinite(t)?t:0}if(u<s||u<.35*y.width)continue;const p=y.width<=u?g:r.getTextBasedOnMaxWidth({text:g,maxWidth:u,fontSize:`${m}px`,fontFamily:i,fontWeight:n});if(!p||"..."===p)continue;const f=p===g?y.width:y.width*(p.length/g.length),x=[a+u/2];u>2.2*f&&x.push(a+f/2+2,o-f/2-2);for(const i of x){let n=e.l,s=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(h[t])-i);e<s&&(s=e,n=t)}b.push({x:i,y:(this._yPx(l[n])+this._yPx(c[n]))/2,text:p,color:this._contrastOn(t),fontSize:`${m}px`,width:f,height:y.height})}if(b.length>=6)break}return b.length?{k:t,weight:p,candidates:b}:null}_runs(t,e,i){const n=[];let s=0;for(;s<i;){if(t[s]<e){s++;continue}let r=s,a=t[s];for(;r+1<i&&t[r+1]>=e;)r++,t[r]>a&&(a=t[r]);n.push({l:s,r:r,maxT:a}),s=r+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,i,n){let s=-1;for(const r of this._runs(t,i,n)){const t=Number(e[r.r])-Number(e[r.l]);isFinite(t)&&t>s&&(s=t)}return s>=0?{width:s}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),i=[],n=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 s={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(n(s)){i.push(l(o({k:t.k},e),{box:s}));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:n}=this._autoBounds();return Math.max(i,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const i=this.w,n=null==(e=i.globals.colors)?void 0:e[t],s="string"==typeof n?I.parseHex(n):null;return s?I.relativeLuminance(s)>.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(!M.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 n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const s=n.getBoundingClientRect(),r=e.globals.svgWidth?s.width/e.globals.svgWidth:1,a=Ne.screenXToPlotPx(e,t.clientX),o=(t.clientY-s.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],n=this._yPx(i.highs[e][h]),s=this._yPx(i.lows[e][h]),r=Math.min(n,s),a=Math.max(n,s);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(),n=null==i.opacity?.35:i.opacity,s=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<s.length;t++){const e=s[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}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;M.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});const Be=g.__apex_Resize_addResizeListener,ze=g.__apex_Resize_removeResizeListener;class We{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,i={}){return this.ctx.graphics.drawMarker(t,e,i)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const He=["none","lighten","darken"];function je(t){const e=t.config.series||[],i=t.config.chart.type,n="scatter"===i||"bubble"===i,s=t.config.markers&&t.config.markers.size,r=Array.isArray(s)?s.some(t=>t>0):(s||0)>0,a=!(!t.config.dataLabels||!t.config.dataLabels.enabled),o="heatmap"===i;let l=0,c=0;e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>c&&(c=e),(n||r||o)&&(l+=e),a&&(l+=e)});return c>=5e4&&(l=Math.max(l,c)),l}function Ye(t){var e,i,n,s;const r=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(r)?r.some(a):a(r))return!0;const o=null==(i=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:i.colors;if(o&&o.colorAboveThreshold&&o.colorBelowThreshold)return!0;if("heatmap"===t.config.chart.type&&"rect"!==((null==(s=null==(n=t.config.plotOptions)?void 0:n.heatmap)?void 0:s.shape)||"rect"))return!0;const l=t.config.states||{},c=l.hover&&l.hover.filter&&l.hover.filter.type,h=l.active&&l.active.filter&&l.active.filter.type;return!(!c||He.includes(c))||!(!h||He.includes(h))}const qe="__apexcharts_renderers__";function Xe(){const t=globalThis;return t[qe]||(t[qe]=new Map),t[qe]}class Ge{static get _rendererRegistry(){return Xe()}static registerRenderer(t,e){Xe().set(t,e)}static unregisterRenderer(t){Xe().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new We(t,e),this.active=this.svg,this._activeKind="svg",this._instances={},this.w.globals.activeRenderer=this.active}_activate(t,e){this.active=e,this._activeKind=t,this.ctx.renderer=e,this.w.globals.activeRenderer=e}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";if(!M.isBrowser())return"svg";if("svg"===e)return"svg";if(Ye(this.w))return"svg";if("canvas"===e)return"canvas";return je(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const i=Xe().get(e);if(i)return this._instances[e]||(this._instances[e]=i(this.w,this.ctx)),this._activate(e,this._instances[e]),this._activeKind;t!==e||this._warned||(this._warned=1,function(t,e,i={}){const{module:n=`features/${e}`,entry:s,scripts:r=[`features/${e}.js`],tail:a}=i,o=r.map(t=>`<script src='.../dist/${t}'>`).join(" and ");globalThis.console.warn(`ApexCharts: ${t} requires the ${e} feature, which is not in this bundle. Bundler: import 'apexcharts/${n}'`+(s?` (or from 'apexcharts/${s}')`:"")+`. Script tag: add ${o} after the ApexCharts script, or load apexcharts.full.min.js instead.`+(a?` ${a}`:""))}(`\`chart.renderer: '${e}'\``,`renderer-${e}`,{tail:"Falling back to SVG."}))}else"canvas"===t&&!this._warned&&Ye(this.w)&&(this._warned=1,console.warn('[apexcharts] renderer:"canvas" requested but this chart uses a feature the canvas renderer does not render yet (gradient/pattern/image fill or a state color-matrix filter); falling back to SVG.'));const i=this._instances[this._activeKind];return i&&(i.destroy(),delete this._instances[this._activeKind]),this._activate("svg",this.svg),this._activeKind}pendingKind(){const t=this._desiredKind();return"svg"===t||Xe().has(t)?t:"svg"}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg",this.w.globals.activeRenderer=null}}const Ue=g.__apex_helpers_InitCtxVariables;function Ke(t){if(!Array.isArray(t)||0===t.length)return"empty";for(let e=0;e<t.length;e++){const i=t[e];if(null!=i)return Array.isArray(i)?"paired":"object"==typeof i?"object":"plain"}return"empty"}function Ve(t,e){if(null!=t){if("paired"===e){const e=t[0];return e instanceof Date?e.getTime():e}if("object"===e){const e=t.x;return e instanceof Date?e.getTime():e}}}function Ze(t,e){return"paired"===e?[t,null]:"object"===e?{x:t,y:null}:null}function Qe(t,e,i){const n="function"==typeof i?i(t,e):t?t[i]:void 0;return null==n||""===n?null:String(n)}function Je(t,e){if(!e||"first-seen"===e)return t.slice();if("asc"===e||"desc"===e){const i=t.slice().sort((t,e)=>{const i=Number(t),n=Number(e);return isFinite(i)&&isFinite(n)?i-n:t<e?-1:t>e?1:0});return"desc"===e?i.reverse():i}if(Array.isArray(e)){const i=e.map(String).filter(e=>-1!==t.indexOf(e)),n=t.filter(t=>-1===i.indexOf(t));return i.concat(n)}return"function"==typeof e?t.slice().sort(e):t.slice()}function ti(t,e){const i=[],n=new Set;let s=!1,r=!1,a=0,o="plain";t.forEach(t=>{const e=Ke(t&&t.data);if("empty"!==e){if("plain"===e)return r=!0,void(a=Math.max(a,t.data.length));s=!0,o=e,t.data.forEach(t=>{const s=Ve(t,e);if(void 0===s)return;const r=typeof s+":"+String(s);n.has(r)||(n.add(r),i.push(s))})}}),s&&r&&e.push("trellis: mixing x-keyed data ([x,y] / {x,y}) with plain value arrays; plain series are padded by position, not by x");const l=s&&i.every(t=>"number"==typeof t&&isFinite(t));return l&&i.sort((t,e)=>Number(t)-Number(e)),{unionX:i,sawKeyed:s,plainMaxLen:a,xForm:o,xIsNumeric:l}}const ei=["scatter","bubble"];function ii(t,e,i=!0){const n=[],s=new Set;let r=0;return{align:a=>{const c=Ke(a&&a.data),h=a&&null!=a.name?String(a.name):`series-${r+1}`;r++,s.has(h)||(s.add(h),n.push(h));const d=l(o({},a),{name:h});if(!i)return d.data=Array.isArray(a.data)?a.data.slice():[],d;if("plain"===c||"empty"===c){const e=t.sawKeyed?t.unionX.length:t.plainMaxLen,i=Array.isArray(a.data)?a.data.slice(0,e):[];for(;i.length<e;)i.push(null);if(d.data=i,Array.isArray(a.highlightData)){const t=a.highlightData.slice(0,e);for(;t.length<e;)t.push(null);d.highlightData=t}return d}const u=new Map,p=new Map,f=Array.isArray(a.highlightData)?a.highlightData:null;return a.data.forEach((t,i)=>{const n=Ve(t,c);void 0===n||u.has(n)?void 0!==n&&u.has(n)&&e.push(`trellis: duplicate x "${String(n)}" in series "${h}"; keeping the first`):(u.set(n,t),f&&p.set(n,f[i]))}),d.data=t.unionX.map(t=>u.has(t)?u.get(t):Ze(t,c)),f&&(d.highlightData=t.unionX.map(t=>p.has(t)?p.get(t):null)),d},seriesNames:n}}function ni(t,e={}){const i=t.xForm,n={bar:0,column:0,rangeBar:[0,0],candlestick:[0,0,0,0],boxPlot:[0,0,0,0,0]},s=e.chartType&&e.chartType in n?n[e.chartType]:null,r="plain"===i?t.unionX.map(()=>s):t.unionX.map(t=>{if(null===s)return Ze(t,i);const e=Array.isArray(s)?s.slice():s;return"object"===i?{x:t,y:e}:[t,e]});return{name:e.name||t.seriesNames[0]||"series-1",data:r}}function si(t,e={},i={}){const n=[],s=Array.isArray(t)?t:[],r=(a=i.chartType,!ei.includes(a||""));var a;if(e.row||e.column)return e.by&&n.push("trellis: `by` is ignored when `row`/`column` are set (they are mutually exclusive)"),function(t,e,i,n=!0){const s=e.row,r=e.column,a=new Map,o=new Map,l=new Map,c=[],h=[],d=[],u=(t,e)=>{-1===t.indexOf(e)&&t.push(e)};if(t.forEach((t,e)=>{var i,n;const p=s?Qe(t,e,s):"",f=r?Qe(t,e,r):"";if(null===p&&null===f)return void c.push(t);if(null===p)return u(d,f),l.has(f)||l.set(f,[]),void(null==(i=l.get(f))||i.push(t));if(null===f)return u(h,p),o.has(p)||o.set(p,[]),void(null==(n=o.get(p))||n.push(t));u(h,p),u(d,f);let g=a.get(p);g||(g=new Map,a.set(p,g));let m=g.get(f);m||(m=[],g.set(f,m)),m.push(t)}),!h.length&&!d.length)return ri(["trellis: no series carries the row/column facet keys; nothing to split"]);"number"==typeof e.limit&&e.limit>0&&i.push("trellis: `limit` is not applied to a 2-D grid; ignoring it");const p=Je(h.length?h:[""],e.order),f=Je(d.length?d:[""],e.order),g=ti(t,i),{align:m,seriesNames:y}=ii(g,i,n),x=[];return p.forEach(t=>{f.forEach(e=>{var i;const n=((null==(i=a.get(t))?void 0:i.get(e))||[]).concat(o.get(t)||[]).concat(l.get(e)||[]).concat(c).map(m);x.push({key:[t,e].filter(t=>""!==t).join(" / ")||"all",rowKey:t,colKey:e,series:n,seriesNames:n.map(t=>t.name),empty:0===n.length})})}),{mode:"2d",panels:x,rowKeys:p,colKeys:f,seriesNames:y,xForm:g.sawKeyed?g.xForm:"plain",unionX:g.sawKeyed?g.unionX:Array.from({length:g.plainMaxLen},(t,e)=>e),xIsNumeric:g.xIsNumeric,dropped:0,warnings:i}}(s,e,n,r);const o=e.by||"facet",l=new Map,c=[];if(s.forEach((t,e)=>{const i=Qe(t,e,o);if(null===i)c.push(t);else{l.has(i)||l.set(i,[]);const e=l.get(i);e&&e.push(t)}}),0===l.size)return ri(["trellis: no series carries the facet key; nothing to split"]);let h=Je(Array.from(l.keys()),e.order),d=0;"number"==typeof e.limit&&e.limit>0&&h.length>e.limit&&(d=h.length-e.limit,h=h.slice(0,e.limit));const u=ti(h.reduce((t,e)=>t.concat(l.get(e)||[]),[]).concat(c),n),{align:p,seriesNames:f}=ii(u,n,r);return{mode:"1d",panels:h.map(t=>{const e=(l.get(t)||[]).map(p),i=c.map(p),n=e.concat(i);return{key:t,rowKey:null,colKey:null,series:n,seriesNames:n.map(t=>t.name),empty:0===n.length}}),rowKeys:null,colKeys:null,seriesNames:f,xForm:u.sawKeyed?u.xForm:"plain",unionX:u.sawKeyed?u.unionX:Array.from({length:u.plainMaxLen},(t,e)=>e),xIsNumeric:u.xIsNumeric,dropped:d,warnings:n}}function ri(t){return{mode:"1d",panels:[],rowKeys:null,colKeys:null,seriesNames:[],xForm:"plain",unionX:[],xIsNumeric:!1,dropped:0,warnings:t}}const ai=["heatmap","pie","donut","polarArea","radialBar"],oi=["pie","donut","polarArea"];function li(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const n=t[i];let s=n;Array.isArray(n)?s=1===n.length?n[0]:n[1]:n&&"object"==typeof n&&(s=void 0!==n.y?n.y:n.x);const r=Number(s);null!=s&&isFinite(r)&&e.push(r)}return e}function ci(t,e,i,n){var s,r,a,o,l,c;const h={plotOptions:null,yExtentOverride:null,skipYaxisPush:ai.includes(n),forceSharedY:!1,pieScaleOf:null,warnings:[]},d=t.panels,u=(null==i?void 0:i.plotOptions)||{};if("histogram"===n){const t=u.histogram||{};let i=[];const n=d.map(t=>t.series.map(t=>{const e=li(t.data);return i=i.concat(e),e})),r=ht(i,{bins:t.bins,binWidth:t.binWidth,range:t.range});if(r&&r.edges.length>1){const i=r.edges;h.plotOptions={histogram:{range:[i[0],i[i.length-1]],binWidth:r.binWidth}};let a=0;n.forEach(e=>e.forEach(e=>{if(!e.length)return;(function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const n=t.reduce((t,e)=>t+e,0);if(n<=0)return i;if("relative"===e.normalize)return i.map(t=>t/n*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(n*t))}return i})(function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let n=0;n<t.length;n++){const s=dt(t[n],e);s>=0&&i[s]++}return i}(e,i),{normalize:t.normalize,cumulative:t.cumulative,binWidth:r.binWidth}).forEach(t=>{isFinite(t)&&t>a&&(a=t)})})),a>0&&(h.yExtentOverride={min:0,max:a});const o=(null==(s=e.scales)?void 0:s.y)||"shared";"independent-row"!==o&&"independent-column"!==o||(h.forceSharedY=!0,h.warnings.push("histogram trellis: group y scales would re-derive counts per group; using scales.y 'shared' (use 'independent' for per-panel count scales)."))}}if("violin"===n){const t=(null==(r=u.violin)?void 0:r.kde)||{};if(!("number"==typeof t.bandwidth&&t.bandwidth>0)){let t=[];d.forEach(e=>e.series.forEach(e=>{t=t.concat(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{const i=t&&"object"==typeof t?t.y:null;Array.isArray(i)&&i.forEach(t=>{const i=Number(t);null!=t&&isFinite(i)&&e.push(i)})}),e):e}(e.data))}));const e=t.length?ve(t,{resolution:8}):null;e&&isFinite(e.bandwidth)&&e.bandwidth>0&&(h.plotOptions={violin:{kde:{bandwidth:e.bandwidth}}})}}if("heatmap"===n){"independent"===(null==(a=e.scales)?void 0:a.color)&&h.warnings.push("a heatmap trellis must share its color scale (the same color meaning different values per panel is a silent lie); ignoring scales.color 'independent'.");const t=null==(l=null==(o=u.heatmap)?void 0:o.colorScale)?void 0:l.ranges;if(!(Array.isArray(t)&&t.length>0)){let t=1/0,e=-1/0;d.forEach(i=>i.series.forEach(i=>{li(i.data).forEach(i=>{i<t&&(t=i),i>e&&(e=i)})})),isFinite(t)&&isFinite(e)&&(h.plotOptions={heatmap:{colorScale:{min:t,max:e}}})}}if("bubble"===n){"independent"===(null==(c=e.scales)?void 0:c.size)&&h.warnings.push("a bubble trellis must share its size scale; ignoring scales.size 'independent'.");let t=1/0,i=-1/0;d.forEach(e=>e.series.forEach(e=>{(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{let i=null;Array.isArray(t)&&t.length>2?i=t[2]:t&&"object"==typeof t&&(i=t.z);const n=Number(i);null!=i&&isFinite(n)&&e.push(n)}),e):e})(e.data).forEach(e=>{e<t&&(t=e),e>i&&(i=e)})})),isFinite(t)&&isFinite(i)&&(h.plotOptions={bubble:{minZ:t,maxZ:i}})}if(oi.includes(n)&&e.radiusByTotal){const t=new Map;let e=0;d.forEach(i=>{let n=0;i.series.forEach(t=>{li(t.data).forEach(t=>{n+=Math.abs(t)})}),t.set(i.key,n),n>e&&(e=n)}),e>0&&(h.pieScaleOf=i=>{const n=t.get(i);return"number"!=typeof n||n<=0?null:Math.sqrt(n/e)})}return h}const hi=g.__apex_ThemePalettes_getThemePalettes;function di(t,e,i=3){if(!isFinite(t)||!isFinite(e))return{min:0,max:1,tickAmount:1};if(t===e){const i=0===t?1:.1*Math.abs(t);t-=i,e+=i}const n=Math.max(1,i),s=(e-t)/n,r=Math.pow(10,Math.floor(Math.log10(s)));let a={dist:1/0,ticks:0,min:0,max:1};return(r>=10?[1,2,2.5,5,10]:[1,2,5,10]).forEach(i=>{const s=i*r,o=Math.floor(t/s)*s,l=Math.ceil(e/s)*s,c=Math.max(1,Math.round((l-o)/s)),h=Math.abs(c-n);(h<a.dist||h===a.dist&&c<a.ticks)&&(a={dist:h,ticks:c,min:o,max:l})}),{min:a.min,max:a.max,tickAmount:a.ticks}}function ui(t,e,i){if(null==t)return;let n=t;if("paired"===e?n=t[1]:"object"===e&&(n=t.y),null==n)return;if(Array.isArray(n)){for(let t=0;t<n.length;t++){const e=Number(n[t]);isFinite(e)&&(e<i.min&&(i.min=e),e>i.max&&(i.max=e))}return}const s=Number(n);isFinite(s)&&(s<i.min&&(i.min=s),s>i.max&&(i.max=s))}function pi(t,e,i){const n=e&&"object"==typeof e&&!Array.isArray(e)&&"highlight"in e?e.highlight:Array.isArray(t.highlightData)?t.highlightData[i]:null;return"number"==typeof n&&isFinite(n)?n:null}function fi(t){if("number"!=typeof t||!isFinite(t)||t%1==0)return 0;const e=String(t);return-1!==e.indexOf("e")||-1!==e.indexOf("E")?4:Math.min(4,(e.split(".")[1]||"").length)}function gi(t,e,i={}){const n={min:1/0,max:-1/0},s=t=>{isFinite(t)&&(t<n.min&&(n.min=t),t>n.max&&(n.max=t))};return t.forEach(t=>{const r=new Map;t.series.forEach(t=>{var s;if(!Array.isArray(t.data))return;if(!function(t,e){if(!e.stackOnlyBar)return!0;const i=t&&t.type;return null==i||"bar"===i||"column"===i}(t,i))return void t.data.forEach(t=>ui(t,e,n));const a=String(null!=(s=t.group)?s:""),o=t=>{const e=r.get(t)||{pos:[],neg:[]};return r.set(t,e),e},l=o(a),c=i.parts?o("~"+a):null;t.data.forEach((i,n)=>{[l,c].forEach((s,r)=>{if(!s)return;void 0===s.pos[n]&&(s.pos[n]=0,s.neg[n]=0);const a=r?pi(t,i,n):(t=>{if(null==t)return null;const i="paired"===e?t[1]:"object"===e?t.y:t;if(null==i||Array.isArray(i))return null;const n=Number(i);return isFinite(n)?n:null})(i);null!==a&&(a>0?s.pos[n]+=a:s.neg[n]+=a)})})}),r.forEach(t=>{t.pos.forEach(s),t.neg.forEach(s)})}),isFinite(n.min)&&isFinite(n.max)?n:null}function mi(t,e={},i={}){const n=e.scales||{},s=n.x||"shared",r=n.y||"shared";let a=null;if("shared"===s&&t.xIsNumeric&&t.unionX.length){const e=t.unionX;a={min:e[0],max:e[e.length-1]}}const o=["bar","column","histogram"].includes(i.chartType||""),l=t=>t?(o&&t.min>0&&(t.min=0),di(t.min,t.max,e.targetTicks||3)):null,c=!!i.stacked&&"100%"===i.stackType,h=!!i.stacked&&!c,d=e=>c?{min:0,max:100}:h?gi(e,t.xForm,{stackOnlyBar:i.stackOnlyBar,parts:i.parts}):function(t,e,i=!1){const n={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((s,r)=>{ui(s,e,n);const a=i?pi(t,s,r):null;null!==a&&ui(a,"plain",n)})})),isFinite(n.min)&&isFinite(n.max)?n:null}(e,t.xForm,i.parts);let u=null;"shared"===r&&(u=l(i.yExtentOverride||d(t.panels)));let p=null;if("independent-row"===r){p=new Map;const e=new Map;t.panels.forEach(t=>{var i;const n=null!=(i=t.rowKey)?i:"";e.has(n)||e.set(n,[]),e.get(n).push(t)}),e.forEach((t,e)=>{const i=l(d(t));i&&(null==p||p.set(e,i))})}let f=null;if("independent-column"===r){f=new Map;const e=new Map;t.panels.forEach(t=>{var i;const n=null!=(i=t.colKey)?i:"";e.has(n)||e.set(n,[]),e.get(n).push(t)}),e.forEach((t,e)=>{const i=l(d(t));i&&(null==f||f.set(e,i))})}const g=hi().palette1,m=Array.isArray(i.userColors)?i.userColors.filter(t=>"string"==typeof t):[],y=m.length?m:g,x=t.seriesNames;return{x:a,y:u,rowY:p,colY:f,colorOf:t=>{const e=x.indexOf(t);return y[(-1===e?0:e)%y.length]},palette:y}}function yi({panelCount:t,containerWidth:e,cfg:i,hostHeight:n,chromeHeight:s}){var r,a;const o=null!=(r=i.gap)?r:12,l=function(t,e,i={}){var n,s;const r=null!=(n=i.gap)?n:12;if("number"==typeof i.columns&&i.columns>0)return Math.max(1,Math.min(Math.floor(i.columns),e));const a=null!=(s=i.minPanelWidth)?s:220,o=Math.floor((t+r)/(a+r));return Math.max(1,Math.min(o,e))}(e,t,i),c=Math.max(1,Math.ceil(t/l)),h=!i.header||!1!==i.header.show?22:0,d=Math.max(0,s||0),u=c*h+o*(c-1)+d,p="number"==typeof n&&n>0?n:0,f=Math.max(0,(e-o*(l-1))/l);let g;g="number"==typeof i.panelHeight&&i.panelHeight>0?i.panelHeight:p>0?(p-u)/c:f/(null!=(a=i.aspectRatio)?a:1.6);const m="number"==typeof i.minPanelHeight&&i.minPanelHeight>0?i.minPanelHeight:80;g=Math.max(m,Math.round(g));const y=c*(g+h)+o*(c-1),x=p>0?Math.max(0,y+d-p):0,_=i.axes&&i.axes.labels||"edges",b=i.scales||{},v=1===l,w=Array.from({length:t},(e,i)=>{const n=Math.floor(i/l),s=i%l;let r,a;return"none"===_?(r=!1,a=!1):"all"===_||v?(r=!0,a=!0):(r="independent"===b.x||n===function(t,e,i,n){return t<e-(n-1)*i?n-1:n-2}(s,t,l,c),a="independent"===b.y||"independent-column"===b.y||0===s),{i:i,r:n,c:s,showXLabels:r,showYLabels:a}});return{cols:l,rows:c,panelW:f,panelH:g,headerH:h,gap:o,cells:w,gridH:y,overflowH:x}}const xi=["#cf4d3f","#8f9499","#26a75b"],_i=(t,e,i)=>t+(e-t)*i;function bi(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function vi(t,e,i){const n=I.parseHex(wi(t)),s=I.parseHex(wi(e));return n&&s?"#"+bi(_i(n[0],s[0],i))+bi(_i(n[1],s[1],i))+bi(_i(n[2],s[2],i)):t}function wi(t){if("string"!=typeof t)return"#000000";if(I.isColorHex(t))return t;return I.rgb2hex(t)||"#000000"}function Ai(t,e,i,n){var s,r,a;if(!e||"object"!=typeof e)return null;const o=null==(a=null==(r=null==(s=t.config.plotOptions)?void 0:s.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:n,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function Mi(t){var e,i,n;const s=null==(n=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:n.colorScale,r=s&&s.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 n=0;n<i.length;n++){const s=Ai(t,i[n],e,n);null!=s&&(c=!0,s<o&&(o=s),s>l&&(l=s))}}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 p=function(t,e,i,n){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:wi(t.color)})).sort((t,e)=>t.value-e.value);const s=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:xi).map(wi),r=s.length;if(null!=n&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:_i(e,n,i/t),color:s[i]});for(let e=t+1;e<r;e++)a.push({value:_i(n,i,(e-t)/(r-1-t)),color:s[e]});return a}return s.map((t,n)=>({value:_i(e,i,n/(r-1)),color:t}))}(r,h,d,u);if(p.length<2)return null;const f=d-h,g=p.map(t=>({percent:0===f?0:(t.value-h)/f,color:t.color}));return{min:h,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const i=p[e];if(t<=i.value){const n=p[e-1],s=i.value-n.value,r=0===s?0:(t-n.value)/s;return vi(n.color,i.color,r)}}return e.color},legendStops:g}}const ki=g.__apex_tooltip_Utils,Li="http://www.w3.org/2000/svg";class Si{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._grad=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this.panelsW=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,n,s,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==(s=null==(n=null==t?void 0:t.config)?void 0:n.plotOptions)?void 0:s[a])?void 0:r.colorScale)||null}static configFor(t){const e=Si.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return Si.configFor(this.w)||{}}static isEnabled(t){if(!Si.supports(t))return!1;const e=Si.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===n||"treemap"===n}draw(t=null){var e,i,n,s,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,p="left"===u||"right"===u,f=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,g=f+4,m=d.showLabels?28:4,y=d.showLabels?20:4,x=d.showLabels?44:0,_=this._resolveStripLength(p?d.height:d.width,p),b=d.thickness,v=p?Math.max(b+g+4,x):_+2*m,w=p?_+2*y:b+g+4,M=(v-(b+g))/2,k=p?"left"===u?M:M+g:m,L=p?y:"top"===u?g:4,S=A.createElementNS(Li,"svg");S.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),S.setAttribute("width",String(v)),S.setAttribute("height",String(w)),S.setAttribute("overflow","visible");const C=A.createElementNS(Li,"defs"),E=`apexcharts-heatmap-gradient-${c.globals.cuid}`,F=A.createElementNS(Li,"linearGradient");F.setAttribute("id",E),p?(F.setAttribute("x1","0"),F.setAttribute("y1","1"),F.setAttribute("x2","0"),F.setAttribute("y2","0")):(F.setAttribute("x1","0"),F.setAttribute("y1","0"),F.setAttribute("x2","1"),F.setAttribute("y2","0")),this._grad=F;const{min:D,max:P,bands:R}=this._paintStops();C.appendChild(F),S.appendChild(C);const T=A.createElementNS(Li,"rect");if(T.setAttribute("x",String(k)),T.setAttribute("y",String(L)),T.setAttribute("width",String(p?b:_)),T.setAttribute("height",String(p?_:b)),T.setAttribute("rx","2"),T.setAttribute("fill",`url(#${E})`),S.appendChild(T),d.showLabels){const t=(null==(n=d.labelStyle)?void 0:n.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==(s=d.labelStyle)?void 0:s.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,a=this._getFormatter(),o=(n,s,r,a)=>{const o=A.createElementNS(Li,"text");return o.setAttribute("x",String(s)),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(n),o};if(p){const t=k+b/2;S.appendChild(o(a(D),t,L+_+10,"middle")),S.appendChild(o(a(P),t,L-10,"middle"))}else{const t=L+b/2;S.appendChild(o(a(D),k-6,t,"end")),S.appendChild(o(a(P),k+_+6,t,"start"))}}const N=(null==(a=d.arrow)?void 0:a.color)||c.config.chart.foreColor,O=this._buildArrow(f,N,u);if(S.appendChild(O),this.arrowEl=O,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&R.length>0&&R.forEach(t=>{const e=A.createElementNS(Li,"rect");if(p){const i=L+_-t.p2*_,n=L+_-t.p1*_;e.setAttribute("x",String(k)),e.setAttribute("y",String(i)),e.setAttribute("width",String(b)),e.setAttribute("height",String(Math.max(0,n-i)))}else e.setAttribute("x",String(k+t.p1*_)),e.setAttribute("y",String(L)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*_))),e.setAttribute("height",String(b));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",S.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:k,stripY:L,stripLength:_,stripThickness:b,arrowSize:f,svgWidth:v,svgHeight:w},d.showHoverValue){const t=A.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(S),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=S,t?(h.style.width=v+"px",h.style.height=w+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,p,v,w),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,n=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,n*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,n,s){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=n+"px",t.style.height=s+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-s-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-n-o+h+"px"}else{const i=l-n-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-s-o+d+"px"}}repositionToPlot(){var t,e;if(this._grad&&this._paintStops(),!M.isBrowser())return;if(this._targetEl)return;const i=this.w,n=i.globals,s=i.dom.elLegendWrap;if(!s||!this._geom)return;if(!Number.isFinite(n.gridWidth)||!Number.isFinite(n.gridHeight))return;const{isVertical:r,position:a,svgWidth:o,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",p=i.config.legend.offsetX||0,f=i.config.legend.offsetY||0,g=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=g?g.getTitleSubtitleCoords("title").height+g.getTitleSubtitleCoords("subtitle").height:0,y=i.layout.xAxisHeight||0,x=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){s.style.top=n.translateY+x(n.gridHeight,l)+f+"px";const t=(("left"===a?0:n.translateX+n.gridWidth)+("left"===a?n.translateX:n.svgWidth))/2;s.style.left=t-c-d/2+p+"px"}else{s.style.left=n.translateX+x(n.gridWidth,o)+p+"px";const t=(("top"===a?m:n.translateY+n.gridHeight+y)+("top"===a?n.translateY:n.svgHeight))/2;s.style.top=t-h-d/2+f+"px"}A.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const n=i.getBoundingClientRect(),s=ki.plotRect(t);if(!(n.width&&n.height&&s.width&&s.height))return;const r=s.left,a=s.left+s.width,o=s.top,l=s.top+s.height,c=s.zoom,{isVertical:h,position:d}=this._geom;if(h){const t=("left"===d?r-n.right:n.left-a)/c;if(t<16){const i=parseFloat(e.style.left)||0,n=16-t;e.style.left=i+("left"===d?-n:n)+"px"}}else{const t=("top"===d?o-n.bottom:n.top-l)/c;if(t<16){const i=parseFloat(e.style.top)||0,n=16-t;e.style.top=i+("top"===d?-n:n)+"px"}}}destroy(){var t,e,i,n,s,r,a;for(let i=0;i<this._bandHitEls.length;i++){const n=this._bandHitEls[i];null==(t=n.removeEventListener)||t.call(n,"mousemove",this._onBandEnter),null==(e=n.removeEventListener)||e.call(n,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(s=(n=this.ctx.events).removeEventListener)||s.call(n,"dataPointMouseEnter",this._onCellEnter),null==(a=(r=this.ctx.events).removeEventListener)||a.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(M.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,n,s;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==(s=null==(n=null==(i=this.ctx)?void 0:i.events)?void 0:n.fireEvent)||s.call(n,"legendHover",[this.ctx,o,r]),this._highlightRange(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,this._highlightRange(t,"reset")}_highlightRange(t,e){var i;((null==(i=this.panelsW)?void 0:i.call(this))||[this.w]).forEach(i=>new b(i).highlightRangeInSeries(t,e))}_attachHoverListeners(){var t,e;M.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,n;if(!this.arrowEl)return;const s=t[t.length-1];if(!s||"object"!=typeof s)return;const r=s.w||this.w,a=s.seriesIndex,o=s.dataPointIndex;if("number"!=typeof a||"number"!=typeof o)return;if(!Si.supports(r))return;let l;l=this._continuous?function(t,e,i){const n=t.config.series[e];return Ai(t,n&&Array.isArray(n.data)?n.data[i]:null,e,i)}(r,a,o):null==(n=null==(i=null==(e=r.seriesData)?void 0:e.series)?void 0:i[a])?void 0:n[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:n,stripY:s,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=s+r-h*r;let e,l;"left"===i?(e=n+a,l=e+o):(e=n,l=e-o);const c=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=n+h*r;let e,l;"top"===i?(e=s+a,l=e+o):(e=s,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=s+r-h*r;"left"===i?this.hoverValueEl.style.left=`${n+a+o+8}px`:(this.hoverValueEl.style.left=n-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=n+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${s+a+o+8}px`:s-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const n=A.createElementNS(Li,"polygon");return n.setAttribute("fill",e),n.setAttribute("opacity","0"),n.setAttribute("class","apexcharts-heatmap-gradient-arrow"),n.setAttribute("points","0,0 0,0 0,0"),n.setAttribute("pointer-events","none"),n}_paintStops(){const t=this._computeStops(),e=this._grad;return this._min=t.min,this._max=t.max,e.innerHTML="",t.stops.forEach(t=>{const i=A.createElementNS(Li,"stop");i.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),i.setAttribute("stop-color",t.color),e.appendChild(i)}),t}_computeStops(){var t,e;const i=this.w,n=Si.colorScaleOf(i)||{},s=this._cfg(),r=Mi(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;const p=void 0!==n.min&&void 0!==n.max&&n.max>n.min;p?(d=n.min,u=n.max):(void 0!==n.min&&(d=n.min<a?n.min:a),void 0!==n.max&&(u=n.max>c?n.max:c));const f=[],g=[];if(n.ranges&&n.ranges.length>0){const t=n.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 s=i-e||1;t.forEach(t=>{const i=(t.from-e)/s,n=(t.to-e)/s;f.push({percent:(i+n)/2,color:t.color}),g.push({index:t._originalIndex,p1:i,p2:n})})}else{const t=i.globals.colors[0]||"#008FFB",r=new I,a=i.config.chart.type,o=i.config.plotOptions[a]||{},l=null!=(e=o.shadeIntensity)?e:.5,c=i.globals,h=c.hasNegs,g="heatmap"===a&&!o.distributed&&!p&&c.maxY>=c.minY,m=g?c.maxY:u,y=Math.abs(m)+Math.abs(g?n.min<c.minY?n.min:c.minY:d),x=1.25*l,_=Math.max(2,s.stops||16);for(let e=0;e<_;e++){const n=e/(_-1),s=0===y?0:Math.min(d+n*(u-d),m)/y,c=Math.max(-1,Math.min(1,h?o.reverseNegativeShade?(s<0?s:1-s)*x:s<=0?1-(1+s)*l:(1-s)*l:(1-s)*("treemap"===a?x:1))),p=o.enableShades?r.shadeColor("dark"===i.config.theme.mode?-c:c,t):t;f.push({percent:n,color:p})}}return{min:d,max:u,stops:f,bands:g}}}const Ci={zoom:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l5 5"/><path d="M8 10.5h5M10.5 8v5"/></svg>',pan:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 3v18M3 12h18"/><path d="M9 6l3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3"/></svg>',reset:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 10a8 8 0 1 1 2 6"/><path d="M4 4v6h6"/></svg>',download:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 4v11"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></svg>'};class Ei{constructor(t){this.trellis=t,this.elLegend=null,this.elToolbar=null,this.elTitle=null,this.elBreadcrumb=null,this.gradientLegend=null,this._gradPending=null,this._gradWire=null}buildHeader(t,e,i){const n=this.trellis,s=n.cfg.header||{};if(!1===s.show)return;const r=A.createElement("div");r.className="apexcharts-trellis-header";let a=e;"function"==typeof s.formatter&&(a=s.formatter(e,{dimension:"string"==typeof n.cfg.by?n.cfg.by:void 0,index:i.index,count:i.count})),r.textContent=null==a?"":String(a);const o=s.style||{};if(o.fontSize&&(r.style.fontSize=o.fontSize),o.fontWeight&&(r.style.fontWeight=String(o.fontWeight)),o.color&&(r.style.color=o.color),!1!==n.cfg.promote){r.classList.add("apexcharts-trellis-header-clickable"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("title","Expand this panel");const t=()=>{n._promotedKey===e?n.restorePromotion():n.promote(e)};r.addEventListener("click",t),r.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}t.appendChild(r)}stripEl(t,e,i){const n=this.trellis.cfg.header||{},s=A.createElement("div");s.className=`apexcharts-trellis-strip apexcharts-trellis-strip-${t}`;let r=e;"function"==typeof n.formatter&&(r=n.formatter(e,{dimension:t,index:i.index,count:i.count})),s.textContent=null==r?"":String(r);const a=n.style||{};return a.fontSize&&(s.style.fontSize=a.fontSize),a.fontWeight&&(s.style.fontWeight=String(a.fontWeight)),a.color&&(s.style.color=a.color),s}buildBreadcrumb(t,e,i){this.removeBreadcrumb();const n=A.createElement("div");n.className="apexcharts-trellis-breadcrumb";const s=A.createElement("button");s.setAttribute("type","button"),s.className="apexcharts-trellis-breadcrumb-back",s.textContent="All panels",s.addEventListener("click",i);const r=A.createElement("span");r.className="apexcharts-trellis-breadcrumb-sep",r.textContent="/";const a=A.createElement("span");a.className="apexcharts-trellis-breadcrumb-current",a.textContent=e,n.appendChild(s),n.appendChild(r),n.appendChild(a),t.appendChild(n),this.elBreadcrumb=n}removeBreadcrumb(){this.elBreadcrumb&&this.elBreadcrumb.parentNode&&this.elBreadcrumb.parentNode.removeChild(this.elBreadcrumb),this.elBreadcrumb=null}buildTitle(t){const e=this.trellis.w.config.title;if(!e||!e.text)return;const i=A.createElement("div");i.className="apexcharts-trellis-title",i.textContent=e.text;const n=e.style||{};n.fontSize&&(i.style.fontSize=n.fontSize),n.color&&(i.style.color=n.color),t.appendChild(i),this.elTitle=i}buildLegend(t){const e=this.trellis;if("shared"!==(e.cfg.legend||"shared"))return;if("heatmap"===e.w.config.chart.type)return void this.buildGradientLegend(t);const i=e.split?e.split.seriesNames:[];if(i.length<2)return;const n=A.createElement("div");n.className="apexcharts-trellis-legend apexcharts-legend",n.setAttribute("role","list"),i.forEach(t=>{const i=A.createElement("div");i.className="apexcharts-legend-series apexcharts-trellis-legend-item",i.setAttribute("role","listitem"),i.setAttribute("tabindex","0"),i.setAttribute("data:collapsed","false");const s=A.createElement("span");s.className="apexcharts-legend-marker",s.style.background=e.scales?e.scales.colorOf(t):"#008FFB";const r=A.createElement("span");r.className="apexcharts-legend-text",r.textContent=t,i.appendChild(s),i.appendChild(r);const a=()=>{const n=e.sync.toggleSeries(t);i.classList.toggle("apexcharts-inactive-legend",n),i.setAttribute("data:collapsed",String(n))};i.addEventListener("click",a),i.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a())}),n.appendChild(i)}),t.appendChild(n),this.elLegend=n}refreshLegendColors(){const t=this.trellis,e=this.elLegend,i=t.scales;if(!e||!i)return;e.querySelectorAll(".apexcharts-trellis-legend-item").forEach(t=>{var e;const n=null==(e=t.querySelector(".apexcharts-legend-text"))?void 0:e.textContent,s=t.querySelector(".apexcharts-legend-marker");n&&s&&(s.style.background=i.colorOf(n))})}buildGradientLegend(t){const e=this.trellis,i=e.panels.find(t=>t.chart);if(!i){if(this._gradPending)return;const i=()=>{var n,s;this._gradPending=null,null==(s=(n=e.ctx.events).removeEventListener)||s.call(n,"panelMounted",i),this.buildGradientLegend(t)};return this._gradPending=i,void e.ctx.events.addEventListener("panelMounted",i)}const n=A.createElement("div");n.className="apexcharts-trellis-legend apexcharts-trellis-gradient-legend",t.appendChild(n),this.elLegend=n;const s=i.chart,r=new Si(s.w,s.ctx);r.draw(n),this.gradientLegend=r,r.panelsW=()=>e.panels.filter(t=>t.chart).map(t=>t.chart.w);const a=(t,e)=>{var i;const n=e.chart!==s&&(null==(i=e.chart)?void 0:i.ctx.events);n&&(n.addEventListener("dataPointMouseEnter",r._onCellEnter),n.addEventListener("dataPointMouseLeave",r._onCellLeave))};e.panels.forEach(t=>a(0,t)),e.ctx.events.addEventListener("panelMounted",a),this._gradWire=a}destroyGradientLegend(){var t,e;const i=this.trellis;if(this._gradPending&&(null==(e=(t=i.ctx.events).removeEventListener)||e.call(t,"panelMounted",this._gradPending),this._gradPending=null),i.ctx.events.removeEventListener("panelMounted",this._gradWire),this.gradientLegend){try{this.gradientLegend.destroy()}catch(t){}this.gradientLegend=null}}buildToolbar(t){const e=this.trellis;if("shared"!==(e.cfg.toolbar||"shared"))return;const i=A.createElement("div");i.className="apexcharts-trellis-toolbar";const n={},s=t=>{e.panels.forEach(e=>{if(!e.chart)return;const i=e.chart.w.interact;i.zoomEnabled="zoom"===t,i.panEnabled="pan"===t,i.selectionEnabled=!1}),n.zoom.classList.toggle("apexcharts-selected","zoom"===t),n.pan.classList.toggle("apexcharts-selected","pan"===t),n.zoom.setAttribute("aria-pressed",String("zoom"===t)),n.pan.setAttribute("aria-pressed",String("pan"===t))},r=(t,e,s)=>{const r=A.createElement("button");return r.className=`apexcharts-trellis-tool apexcharts-trellis-tool-${t}`,r.setAttribute("type","button"),r.setAttribute("aria-label",e),r.setAttribute("title",e),r.innerHTML=Ci[t],r.addEventListener("click",s),n[t]=r,i.appendChild(r),r};if(r("zoom","Selection zoom",()=>s("zoom")),r("pan","Pan",()=>s("pan")),r("reset","Reset zoom",()=>{e.sync.resetAll()}),e.ctx.exports){const t=A.createElement("div");t.className="apexcharts-trellis-menu",[["png","Download PNG"],["svg","Download SVG"],["csv","Download CSV"]].forEach(([i,n])=>{const s=A.createElement("button");s.setAttribute("type","button"),s.className="apexcharts-trellis-menu-item",s.textContent=n,s.addEventListener("click",()=>{t.classList.remove("apexcharts-trellis-menu-open"),e.exports.download(i)}),t.appendChild(s)}),r("download","Download",()=>{t.classList.toggle("apexcharts-trellis-menu-open")}),i.appendChild(t)}n.zoom.classList.add("apexcharts-selected"),n.zoom.setAttribute("aria-pressed","true"),n.pan.setAttribute("aria-pressed","false"),t.appendChild(i),this.elToolbar=i,t.classList.add("apexcharts-trellis-has-toolbar")}}function Fi(t,e){const i=I.clone(t.w.config.yaxis);return(Array.isArray(i)?i:[i]).map(t=>I.extend(t,e))}class Di{constructor(t){this.trellis=t,this._syncing=!1,this._hidden=new Set,this.currentWindow=null}_noteWindow(t,e){const i=t&&t.xaxis;i&&null!=i.min&&null!=i.max?this.currentWindow={x:{min:i.min,max:i.max},y:this.currentWindow&&this.currentWindow.y||null,zoomed:e||!(!this.currentWindow||!this.currentWindow.zoomed)}:e&&(this.currentWindow=null)}makeZoomedHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!0),this.onZoomed(i)}}makeScrolledHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!1)}}onZoomed(t){const e=this.trellis;if(this._syncing)return;const i=e.cfg;if(!i||"shared"!==(i.scales.y||"shared"))return;if(!e.autoScaleYaxis)return;const n=t&&t.xaxis;if(!n||null==n.min||null==n.max)return;if(!e.split||!e.split.xIsNumeric)return;const s=function(t,e,i,n,s=!1){const r={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((a,o)=>{if(null==a)return;const l="paired"===e?a[0]:"object"===e?a.x:null,c=l instanceof Date?l.getTime():Number(l);if(!isFinite(c)||c<i||c>n)return;ui(a,e,r);const h=s?pi(t,a,o):null;null!==h&&ui(h,"plain",r)})})),isFinite(r.min)&&isFinite(r.max)?r:null}(e.split.panels,e.split.xForm,n.min,n.max,e._stackingHost().parts);if(!s)return;const r=di(s.min,s.max,i.targetTicks||3);this.currentWindow&&(this.currentWindow.y={min:r.min,max:r.max,tickAmount:r.tickAmount}),this._syncing=!0;const a=e.panels.map(t=>t.chart?t.chart.updateOptions({yaxis:Fi(t.chart,{min:r.min,max:r.max,tickAmount:r.tickAmount})},!1,!1,!1).catch(()=>{}):Promise.resolve());Promise.all(a).finally(()=>{this._syncing=!1})}resetAll(){const t=this.trellis;this.currentWindow=null;const e=t.scales&&t.scales.x?{min:t.scales.x.min,max:t.scales.x.max}:{min:void 0,max:void 0};this._syncing=!0;const i=t.panels.map(i=>{if(!i.chart)return Promise.resolve();i.chart.w.interact.zoomed=!1;const n={xaxis:e},s=t.split?t._yBoundsFor(t.split.panels[i.index]):null;return s&&(n.yaxis=Fi(i.chart,{min:s.min,max:s.max,tickAmount:s.tickAmount})),i.chart.updateOptions(n,!1,!1,!1).catch(()=>{})});return Promise.all(i).finally(()=>{this._syncing=!1})}toggleSeries(t){const e=!this._hidden.has(t);return e?this._hidden.add(t):this._hidden.delete(t),this.trellis.panels.forEach(i=>{const n=i.chart;if(!n)return;if(-1!==(n.w.seriesData.seriesNames||[]).indexOf(t))try{e?n.hideSeries(t):n.showSeries(t)}catch(t){}}),e}isHidden(t){return this._hidden.has(t)}applyHiddenTo(t){if(!this._hidden.size||!t)return;const e=t.w.seriesData&&t.w.seriesData.seriesNames||[];this._hidden.forEach(i=>{if(-1!==e.indexOf(i))try{t.hideSeries(i)}catch(t){}})}wireCrosshairs(t){let e=0,i=null;const n=()=>{const t=i&&i.closest?i.closest(".apexcharts-trellis-cell"):null,e=t?t.querySelector(".apexcharts-xcrosshairs"):null,n=e&&e.classList.contains("apexcharts-active");this.trellis.panels.forEach(i=>{if(!i.cellEl||i.cellEl===t)return;const s=i.cellEl.querySelector(".apexcharts-xcrosshairs");s&&(n?(s.setAttribute("x",e.getAttribute("x")||"0"),s.setAttribute("x1",e.getAttribute("x1")||"0"),s.setAttribute("x2",e.getAttribute("x2")||"0"),s.classList.add("apexcharts-active")):s.classList.remove("apexcharts-active"))})},s=()=>{if(t!==this.trellis.elGrid)return e=0;n(),e=i?requestAnimationFrame(s):0};t.addEventListener("mousemove",t=>{i=t.target,e||(e=requestAnimationFrame(s))},{passive:!0}),t.addEventListener("mouseleave",()=>{i=null,e&&(cancelAnimationFrame(e),e=0),this.trellis.panels.forEach(t=>{const e=t.cellEl&&t.cellEl.querySelector(".apexcharts-xcrosshairs");e&&e.classList.remove("apexcharts-active")})},{passive:!0})}}function Pi(t,e){const i=null!=t,n=null!=e;return i||n?{min:i?t:null,max:n?e:null}:null}function Ri(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function Ti(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function Ni(t,e){const i=t.config.annotations?I.clone(t.config.annotations):null,n=[],s=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of s){if(!t||"addAnnotation"!==t.label)continue;const i=Ti(t.method,e);i&&n.push({kind:i,params:I.clone(t.params)})}return{static:i,dynamic:n}}function Oi(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}function $i(t,e){var i,n;const s=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>Pi(t&&t.min,t&&t.max)),a=r.some(t=>null!==t),o=t.config.theme,l=e&&e.drilldown;return{v:1,window:{xaxis:Pi(s.min,s.max),yaxis:a?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:Ri(t.interact.selectedDataPoints),theme:o?{mode:null!=(i=o.mode)?i:null,palette:null!=(n=o.palette)?n:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:Ni(t,e),drill:l&&l.depth>0?{path:l.path.slice()}:null,measure:Oi(e)}}function Ii(t,e){if(!t||!e)return;const i=t.w;i.interact.zoomed=!!e.zoomed,function(t,e,i){const n=t.w;if(null==e&&null==i)return;const s=n.globals.seriesNames||[],r=new Set([...e||[],...i||[]]),a=new Set([...n.globals.collapsedSeriesIndices||[],...n.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<s.length;e++){const i=s[e];if(null==i)continue;const n=r.has(e),o=a.has(e);n&&!o?t.hideSeries(i):!n&&o&&t.showSeries(i)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const i=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);i&&"function"==typeof t[i]&&t[i](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=Ri(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==i.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}class Bi{constructor(t){this.trellis=t,this.active=!1,this._io=null,this._byCell=new Map,this._dirty=new Set,this._raf=null,this._draining=!1,this._gutterFloor=0}static supported(){return"undefined"!=typeof IntersectionObserver}_rootMargin(){const t=this.trellis.layout,e=t?Math.max(0,Math.round(t.panelH+t.headerH+t.gap)):300;return`${e}px 0px ${e}px 0px`}start(){Bi.supported()&&(this.active=!0,this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this.trellis.panels.forEach(t=>{var e;t.wantMounted=!1,t.cellEl&&(this._byCell.set(t.cellEl,t),null==(e=this._io)||e.observe(t.cellEl))}))}refresh(){this.active&&this._io&&(this._io.disconnect(),this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this._byCell.forEach((t,e)=>{var i;return null==(i=this._io)?void 0:i.observe(e)}))}_onEntries(t){if(this.active){for(const e of t){const t=this._byCell.get(e.target);t&&(t.wantMounted=e.isIntersecting,this._dirty.add(t))}this._schedule()}}_schedule(){var t;this._raf||this._draining||!this.active||(this._raf=(t=()=>{this._raf=null,this._drain()},"function"==typeof requestAnimationFrame?{kind:"raf",id:requestAnimationFrame(t)}:{kind:"timeout",id:setTimeout(()=>t(0),16)}))}_drain(){return h(this,null,function*(){if(!this._draining&&this.active){this._draining=!0;try{let t=0,e=0;for(;this.active&&this._dirty.size&&t<2&&e<6;){const i=this._dirty.values().next().value;this._dirty.delete(i);const n=!!i.wantMounted;n!==!!i.chart&&(e++,n?(t++,yield this._mount(i)):this._unmount(i))}}finally{this._draining=!1,this.active&&this._dirty.size?this._schedule():this.active&&(this.trellis.w.globals.animationEnded=!0)}}})}_liveWindow(t){const e=this.trellis.panels.find(e=>e!==t&&e.chart);if(!e||!e.chart)return null;const i=e.chart.w,n=i.config.xaxis||{},s=Array.isArray(i.config.yaxis)?i.config.yaxis[0]:i.config.yaxis;return{zoomed:!!i.interact.zoomed,x:null!=n.min||null!=n.max?{min:n.min,max:n.max}:null,y:!s||null==s.min&&null==s.max?null:{min:s.min,max:s.max,tickAmount:s.tickAmount}}}_patchYaxis(t,e){const i=Array.isArray(t.yaxis)?t.yaxis:t.yaxis?[t.yaxis]:[{}];i.forEach(t=>{Object.keys(e).forEach(i=>{"labels"===i?t.labels=o(o({},t.labels||{}),e.labels):t[i]=e[i]})}),t.yaxis=i}_mount(t){return h(this,null,function*(){var e,i,n,s,r,a,c,h;const d=this.trellis;if(!t.el||t.chart||t.noMount)return;const u=t.viewStash,p="shared"===d._yMode(),f=!p,g=d._assemblePanelOptions(t.index,{noAnimation:!!u}),m=u&&u.window;m&&m.xaxis&&(g.xaxis=l(o({},g.xaxis||{}),{min:null!=(e=m.xaxis.min)?e:void 0,max:null!=(i=m.xaxis.max)?i:void 0})),f&&m&&Array.isArray(m.yaxis)&&m.yaxis[0]&&this._patchYaxis(g,{min:null!=(n=m.yaxis[0].min)?n:void 0,max:null!=(s=m.yaxis[0].max)?s:void 0});const y=this._liveWindow(t);y&&y.x&&(g.xaxis=l(o({},g.xaxis||{}),{min:y.x.min,max:y.x.max})),y&&y.y&&p&&this._patchYaxis(g,o({min:y.y.min,max:y.y.max},null!=y.y.tickAmount?{tickAmount:y.y.tickAmount}:{}));const x=d.sync.currentWindow;x&&x.x&&(g.xaxis=l(o({},g.xaxis||{}),{min:x.x.min,max:x.x.max})),x&&x.y&&p&&this._patchYaxis(g,o({min:x.y.min,max:x.y.max},null!=x.y.tickAmount?{tickAmount:x.y.tickAmount}:{})),f&&this._gutterFloor>0&&this._patchYaxis(g,{labels:{minWidth:this._gutterFloor}}),t.el.classList.remove("apexcharts-trellis-skeleton");const _=new d._ApexCharts(t.el,g);t.chart=_;try{yield _.render()}catch(e){return t.chart=null,void t.el.classList.add("apexcharts-trellis-skeleton")}if(this.active){if(_.w.interact.zoomed=x?!!x.zoomed:y?y.zoomed:!(!u||!u.zoomed),d.sync.applyHiddenTo(_),u&&u.annotations&&Array.isArray(u.annotations.dynamic)){const t={xaxis:"addXaxisAnnotation",yaxis:"addYaxisAnnotation",point:"addPointAnnotation"},e=_;u.annotations.dynamic.forEach(i=>{const n=t[i.kind];n&&"function"==typeof e[n]&&e[n](i.params,!0)})}if(t.viewStash=null,f){const t=null==(h=null==(c=null==(a=null==(r=_.w)?void 0:r.globals)?void 0:a.yLabelsCoords)?void 0:c[0])?void 0:h.width;if("number"==typeof t&&isFinite(t)){const e=_.w.globals.isBarHorizontal?0:d._yLabelPad(),i=Math.max(0,t-e);i>this._gutterFloor+.5&&(this._gutterFloor=i,yield d._pushGutterFloor(this._gutterFloor))}}d._fire("panelMounted",{key:t.key,index:t.index,chart:_,remounted:!!u})}})}_unmount(t){if(t.chart){try{t.viewStash=$i(t.chart.w,t.chart)}catch(e){t.viewStash=null}try{t.chart.destroy()}catch(t){}if(t.chart=null,t.el){t.el.classList.add("apexcharts-trellis-skeleton");const e=this.trellis.layout;e&&(t.el.style.minHeight=`${e.panelH}px`)}}}stop(){var t;this.active=!1,this._io&&(this._io.disconnect(),this._io=null),this._byCell.clear(),this._dirty.clear(),(t=this._raf)&&("raf"===t.kind?cancelAnimationFrame(t.id):clearTimeout(t.id)),this._raf=null,this._gutterFloor=0}}const zi=["bar","column","rangeBar","candlestick","boxPlot","violin"];class Wi{constructor(t){this.trellis=t,this.el=null,this._raf=0,this._lastEvent=null}wire(t,e){const i=A.createElement("div");i.className="apexcharts-trellis-tooltip apexcharts-theme-light",i.setAttribute("role","status"),e.appendChild(i),this.el=i;const n=()=>{this._update(e),this._raf=this._lastEvent?requestAnimationFrame(n):0};t.addEventListener("mousemove",t=>{this._lastEvent=t,this._raf||(this._raf=requestAnimationFrame(n))},{passive:!0}),t.addEventListener("mouseleave",()=>{this._lastEvent=null,this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),i.classList.remove("apexcharts-trellis-tooltip-active")},{passive:!0})}_hoverIndex(t,e,i){const n=t.w,s=n.globals.dataPoints;if(!s||s<1)return-1;const r=n.layout.gridWidth;if(!r)return-1;const a=Ne.screenXToPlotPx(n,e),o=n.globals.barPadForNumericAxis||0;if(a<-o||a>r+o)return-1;const l=n.dom&&n.dom.baseEl;if(l&&l.querySelector(".apexcharts-svg")){const t=ki.plotRect(n);if(t.height&&(i<t.top||i>t.top+t.height))return-1}const c=(-1!==zi.indexOf(n.config.chart.type)||"between"===n.config.xaxis.tickPlacement)&&!n.config.xaxis.convertedCatToNumeric?Math.ceil(a/(r/s))-1:Math.round(a/(r/Math.max(1,s-1)));return Math.max(0,Math.min(s-1,c))}_valueAt(t,e,i,n){var s,r;const a=t.series.find(t=>t.name===e);if(!a||!Array.isArray(a.data))return null;const o=a.data[n];if(null==o)return null;let l=o;if(Array.isArray(o)?l=o[1]:"object"==typeof o&&(l=o.y),null==l)return null;const c=this.trellis.w.config,h=Array.isArray(null==(s=c.tooltip)?void 0:s.y)?c.tooltip.y[i]:null==(r=c.tooltip)?void 0:r.y,d=Array.isArray(c.yaxis)?c.yaxis[0]:c.yaxis,u=h&&"function"==typeof h.formatter&&h.formatter||d&&d.labels&&"function"==typeof d.labels.formatter&&d.labels.formatter||null,p=t=>{if(u)try{return String(u(t,{seriesIndex:i,dataPointIndex:n,w:null}))}catch(e){return String(t)}return String(t)};return Array.isArray(l)?l.map(p).join(" / "):p(l)}_update(t){const e=this.trellis,i=this.el,n=this._lastEvent;if(!i||!n||!e.split)return;const s=n.target&&n.target.closest?n.target.closest(".apexcharts-trellis-cell"):null,r=s?e.panels.find(t=>t.cellEl===s):void 0,a=r&&r.chart?this._hoverIndex(r.chart,n.clientX,n.clientY):-1;if(!r||-1===a)return void i.classList.remove("apexcharts-trellis-tooltip-active");const o=s?s.querySelector(".apexcharts-tooltip-title"):null,l=o&&o.textContent?o.textContent:"",c=e.split.seriesNames,h=e.scales,d=[];e.split.panels.forEach(t=>{const e=[];c.forEach((i,n)=>{const s=this._valueAt(t,i,n,a);if(null===s)return;const r=h?h.colorOf(i):"#008FFB";e.push(`<span class="apexcharts-trellis-tooltip-val"><span class="apexcharts-trellis-tooltip-marker" style="background:${ji(r)}"></span>${Hi(s)}</span>`)});const i=t.key===r.key;d.push(`<div class="apexcharts-trellis-tooltip-row${i?" apexcharts-trellis-tooltip-row-active":""}" data-key="${ji(t.key)}"><span class="apexcharts-trellis-tooltip-key">${Hi(t.key)}</span><span class="apexcharts-trellis-tooltip-vals">${e.join("")}</span></div>`)});let u="";l&&(u+=`<div class="apexcharts-tooltip-title">${Hi(l)}</div>`),u+=d.join(""),i.innerHTML=u,i.classList.add("apexcharts-trellis-tooltip-active");const p=t.getBoundingClientRect(),f=ki.plotRect(r.chart.w).zoom;let g=(n.clientX-p.left)/f+14,m=(n.clientY-p.top)/f+14;const y=i.offsetWidth,x=i.offsetHeight,_=p.width/f,b=p.height/f;g+y>_-4&&(g=Math.max(4,g-y-28)),m+x>b-4&&(m=Math.max(4,m-x-28)),i.style.left=`${Math.round(g)}px`,i.style.top=`${Math.round(m)}px`}destroy(){this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),this._lastEvent=null,this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null}}function Hi(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function ji(t){return String(t).replace(/"/g,""")}class Yi{constructor(t){this.trellis=t}supported(){return!!this.trellis.ctx.exports}_rectIn(t){const e=this.trellis.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.left-e.left,y:i.top-e.top,w:i.width,h:i.height}}_size(){const t=this.trellis.elWrap.getBoundingClientRect();return{w:Math.ceil(t.width),h:Math.ceil(t.height)}}_background(){const t=this.trellis.panels.find(t=>t.chart),e=t&&t.chart.exports;if(e&&"function"==typeof e.resolveExportBackground){const t=e.resolveExportBackground();if(t&&"transparent"!==t)return t}return"#fff"}_chromeTexts(){const t=this.trellis,e=[],i=(t,i)=>{if(!t||!t.textContent)return;const n=this._rectIn(t),s=getComputedStyle(t);e.push({text:t.textContent,x:"center"===i?n.x+n.w/2:n.x,y:n.y+n.h/2,font:`${s.fontWeight} ${s.fontSize} ${s.fontFamily}`,fontSize:parseFloat(s.fontSize)||12,color:s.color||"#373d3f",align:i})};return i(t.chrome.elTitle,"left"),t.panels.forEach(t=>{t.cellEl&&i(t.cellEl.querySelector(".apexcharts-trellis-header"),"center")}),t.chrome.elLegend&&t.chrome.elLegend.querySelectorAll(".apexcharts-legend-text").forEach(t=>i(t,"left")),e}_legendMarkers(){const t=this.trellis.chrome.elLegend;return t?Array.from(t.querySelectorAll(".apexcharts-legend-marker"),t=>({rect:this._rectIn(t),color:t.style.background||t.style.backgroundColor||"#008FFB"})):[]}dataURI(){return h(this,arguments,function*(t={}){const e=this.trellis,i=t.scale||1,n=this._size(),s=document.createElement("canvas");s.width=n.w*i,s.height=n.h*i;const r=s.getContext("2d");if(!r)return{imgURI:""};const a=r;a.scale(i,i),a.fillStyle=this._background(),a.fillRect(0,0,n.w,n.h);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){a.fillStyle="rgba(120, 120, 120, 0.06)",a.fillRect(e.x,e.y,e.w,e.h);continue}const{imgURI:n}=yield t.chart.dataURI({scale:i});if(!n)continue;const s=yield qi(n);a.drawImage(s,e.x,e.y,e.w,e.h)}for(const t of this._chromeTexts())a.font=t.font,a.fillStyle=t.color,a.textAlign=t.align,a.textBaseline="middle",a.fillText(t.text,t.x,t.y);for(const t of this._legendMarkers())a.fillStyle=t.color,a.beginPath(),a.arc(t.rect.x+t.rect.w/2,t.rect.y+t.rect.h/2,Math.max(2,t.rect.w/2),0,2*Math.PI),a.fill();return{imgURI:s.toDataURL("image/png")}})}svgString(t=1){return h(this,null,function*(){const e=this.trellis,i=this._size(),n=[];n.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${i.w*t}" height="${i.h*t}" viewBox="0 0 ${i.w} ${i.h}">`),n.push(`<rect width="${i.w}" height="${i.h}" fill="${this._background()}"/>`);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){n.push(`<rect x="${e.x}" y="${e.y}" width="${e.w}" height="${e.h}" fill="rgba(120,120,120,0.06)" rx="4"/>`);continue}const i=yield t.chart.getSvgString();n.push(`<g transform="translate(${e.x}, ${e.y})">${i}</g>`)}for(const t of this._chromeTexts()){const e="center"===t.align?"middle":"start";n.push(`<text x="${t.x}" y="${t.y}" text-anchor="${e}" dominant-baseline="central" style="font:${Ui(t.font)};fill:${Ui(t.color)}">${Gi(t.text)}</text>`)}for(const t of this._legendMarkers())n.push(`<circle cx="${t.rect.x+t.rect.w/2}" cy="${t.rect.y+t.rect.h/2}" r="${Math.max(2,t.rect.w/2)}" fill="${Ui(t.color)}"/>`);return n.push("</svg>"),n.join("")})}csv(t={}){var e,i,n;const s=this.trellis,r=s.split;if(!r)return"";const a=s.w,o=t.columnDelimiter||(null==(n=null==(i=null==(e=a.config.chart.toolbar)?void 0:e.export)?void 0:i.csv)?void 0:n.columnDelimiter)||",",l=a.config.xaxis&&"datetime"===a.config.xaxis.type,c=t=>{if(null==t)return"";const e=String(t);return/[",\n]/.test(e)||-1!==e.indexOf(o)?`"${e.replace(/"/g,'""')}"`:e},h=t=>l&&"number"==typeof t?new Date(t).toISOString():t,d=r.seriesNames,u=[["x","facet",...d].map(c).join(o)];return r.panels.forEach(t=>{r.unionX.forEach((e,i)=>{const n=[h(e),t.key];d.forEach(e=>{const s=t.series.find(t=>t.name===e);if(!s||!Array.isArray(s.data))return void n.push("");const r=s.data[i];let a=r;Array.isArray(r)?a=r[1]:r&&"object"==typeof r&&(a=r.y),n.push(Array.isArray(a)?a.join("|"):a)}),u.push(n.map(c).join(o))})}),u.join(t.lineDelimiter||"\n")}download(t){return h(this,arguments,function*(t,e={}){var i;const n=this.trellis,s=(null==(i=n.w.config.chart.toolbar)?void 0:i.export)||{},r=String(n.w.globals.chartID||"trellis");if("png"===t){const{imgURI:t}=yield this.dataURI();Xi(t,s.png&&s.png.filename||r,".png")}else if("svg"===t){const t=yield this.svgString();Xi("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t),s.svg&&s.svg.filename||r,".svg")}else{Xi("data:text/csv;charset=utf-8,"+encodeURIComponent("\ufeff"+this.csv(e)),e.fileName||s.csv&&s.csv.filename||r,".csv")}})}}function qi(t){return new Promise((e,i)=>{const n=new Image;n.onload=()=>e(n),n.onerror=i,n.src=t})}function Xi(t,e,i){const n=document.createElement("a");n.href=t,n.download=e+i,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Gi(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Ui(t){return String(t).replace(/"/g,""")}const Ki=["annotations","colors","dataLabels","fill","forecastDataPoints","grid","markers","noData","states","stroke","tooltip"],Vi={treemap:"trellis does not support treemap: area encoding needs room a panel cannot give. Rendering a single chart.",sunburst:"trellis does not support sunburst: its labels are illegible at panel size. Rendering a single chart.",unit:"the unit type has its own small-multiples mode (plotOptions.unit.grid.split), which beats a trellis of unit charts. Rendering a single chart."};g.default.registerFeatures({trellis:class{constructor(t,e){this.w=t,this.ctx=e,this.panels=[],this._stripEls=[],this.split=null,this.scales=null,this.layout=null,this.cfg={},this.sync=new Di(this),this.chrome=new Ei(this),this.virtual=new Bi(this),this.exports=new Yi(this),this.gridTooltip=null,this._promotedKey=null,this._ApexCharts=g.default,this._virtualActive=!1,this._panelRenderer=null,this._yLabelDecimals=0,this.elWrap=null,this.elGrid=null,this._mounted=!1,this._rendering=!1,this._renderPromise=null,this._raf=0,this._lastWidth=0,this._lastHeight=0,this._chromeH=0,this._overflowWarned=!1,this._resizeHandler=this._onContainerResize.bind(this),this.autoScaleYaxis=!1,this._elChromeTop=null,this._vetoWarned=!1,this._noKeyWarned=!1,this._frames=null}isActive(){var t;const e=this.w.config.trellis;if(!e||!(e.by||e.row||e.column))return!1;const i=null==(t=this.w.config.chart)?void 0:t.type;if(i&&Vi[i])return this._vetoWarned||(this._vetoWarned=!0,console.warn(`ApexCharts: ${Vi[i]}`)),!1;if(e.by&&!e.row&&!e.column&&!Array.isArray(e.data)){if(!(this.w.config.series||[]).some((t,i)=>null!==Qe(t,i,e.by))){if(!this._noKeyWarned){this._noKeyWarned=!0;const t="function"==typeof e.by?"the `trellis.by` function returned no key for any series":`no series carries the \`trellis.by\` key '${e.by}'`;console.warn(`ApexCharts: ${t}; there is nothing to split. Rendering as a single chart.`)}return!1}}return!0}_layoutCfg(){return this.split&&"2d"===this.split.mode&&this.split.colKeys?l(o({},this.cfg),{columns:this.split.colKeys.length}):this.cfg}_stackingHost(){var t,e;const i=this.w.config,n=i.chart||{},s=i.highlightFilter||{};return{stacked:!!n.stacked,stackType:n.stackType,stackOnlyBar:!!n.stackOnlyBar,parts:!!Ue._featureRegistry.get("highlightFilter")&&!1!==s.enabled&&"clamp"!==s.axis&&["bar","line","area"].includes(n.type)&&!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.isFunnel)}}_yMode(){var t;return this._frames&&this._frames.forceSharedY?"shared":(null==(t=this.cfg.scales)?void 0:t.y)||"shared"}_yBoundsFor(t){var e,i;const n=this.scales;if(!n)return null;if(this._frames&&this._frames.skipYaxisPush)return null;const s=this._yMode();return"shared"===s?n.y:"independent-row"===s&&n.rowY?n.rowY.get(null!=(e=t.rowKey)?e:"")||null:"independent-column"===s&&n.colY&&n.colY.get(null!=(i=t.colKey)?i:"")||null}_valueAxisIsX(){var t,e;const i=this.w.config;return["bar","boxPlot","violin"].includes(i.chart.type)&&!!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.horizontal)}_valueAxisXPatch(t){var e,i;const n={min:t.min,max:t.max};return"number"!=typeof(null==(i=null==(e=this.ctx.opts)?void 0:e.xaxis)?void 0:i.tickAmount)&&(n.tickAmount=t.tickAmount),n}_groupId(){return`${this.w.globals.chartID}-tg`}_fire(t,e){var i,n;const s=null==(n=null==(i=this.w.config.chart)?void 0:i.events)?void 0:n[t];"function"==typeof s&&s(this.ctx,e),this.ctx.events.fireEvent(t,[this.ctx,e])}render(){const t=this._render();return this._renderPromise=t,t}whenSettled(){return this._rendering&&this._renderPromise?this._renderPromise.catch(()=>{}):Promise.resolve()}_render(){return h(this,null,function*(){var t,e,i,n;const s=this.w;if(!this._mounted&&!this._rendering)if(M.isBrowser()){this._rendering=!0;try{this.cfg=s.config.trellis||{},this.autoScaleYaxis=!!(null==(e=null==(t=s.config.chart)?void 0:t.zoom)?void 0:e.autoScaleYaxis);let r=s.config.series||[];if(Array.isArray(this.cfg.data)){const t=function(t,e={}){const i=[],n=e.by;if("string"!=typeof n||!n)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs a string `by` column name"]};const s=e.x,r=e.y;if(!s||!r)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs `x` and `y` column names"]};const a=Array.isArray(t)?t:[];if(!a.length)return{series:[],warnings:["trellis: trellis.data is empty"]};const o=e.seriesBy;let l=0,c=0;const h=new Map;a.forEach(t=>{if(!t||"object"!=typeof t)return void l++;const e=t[n],i=t[s];if(null==e||null==i)return void l++;const a=o&&void 0!==t[o]&&null!==t[o]?String(t[o]):String(r);let d=h.get(String(e));d||(d=new Map,h.set(String(e),d));let u=d.get(a);u||(u=new Map,d.set(a,u));const p=i instanceof Date?i.getTime():i;u.has(p)&&c++;const f=t[r];u.set(p,void 0===f?null:f)}),l&&i.push(`trellis: ${l} row(s) missing "${n}" or "${s}" were skipped`),c&&i.push(`trellis: ${c} duplicate (panel, series, x) row(s); kept the last. Aggregate the rows first if you want sums or means.`);const d=[];return h.forEach((t,e)=>{t.forEach((t,i)=>{d.push({name:i,[n]:e,data:Array.from(t,([t,e])=>({x:t,y:e}))})})}),{series:d,warnings:i}}(this.cfg.data,this.cfg);t.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),t.series.length&&(r.length&&console.warn("ApexCharts: trellis received both `series` and `trellis.data`; using trellis.data."),r=t.series)}const a=si(r,this.cfg,{chartType:s.config.chart.type});if(this.split=a,a.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),!a.panels.length)return;a.dropped>0&&console.warn(`ApexCharts: trellis rendered ${a.panels.length} panels; ${a.dropped} more hidden by trellis.limit.`);const c=null!=(i=this.cfg.virtualize)?i:"auto";let h=!0===c||"auto"===c&&a.panels.length>64;h&&!Bi.supported()&&(console.warn("ApexCharts: trellis virtualization needs IntersectionObserver; rendering eagerly."),h=!1),this._virtualActive=h,!h&&a.panels.length>64&&console.warn(`ApexCharts: trellis with ${a.panels.length} panels renders eagerly; set trellis.virtualize (or trellis.limit).`),a.panels.length>256&&console.warn(`ApexCharts: ${a.panels.length} trellis panels is a lot to read at once; consider trellis.limit.`);const d="histogram"===s.config.chart.requestedType?"histogram":s.config.chart.type;this._frames=ci(a,this.cfg,s.config,d),this._frames.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),this._yLabelDecimals=this._frames.yExtentOverride?0:function(t){let e=0;const i=t=>{const i=fi(t);i>e&&(e=i)};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach(t=>{if(null==t)return;let e=t;Array.isArray(t)?e=t[1]:"object"==typeof t&&(e=t.y),Array.isArray(e)?e.forEach(i):i(e)})})),e}(a.panels);const u=this._yMode()!==((null==(n=this.cfg.scales)?void 0:n.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=mi(a,u,o({chartType:s.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost())),this._panelRenderer=function(t,e,i,n){if(i&&i.chart&&i.chart.renderer)return null;if(!n)return null;const s={config:{series:t.panels.reduce((t,e)=>t.concat(e.series),[]),chart:{type:e.chart.type},markers:e.markers,dataLabels:e.dataLabels,fill:e.fill,plotOptions:e.plotOptions,states:e.states}};if(Ye(s))return null;const r=e.chart.rendererThreshold||8e3;return je(s)>=r?"canvas":null}(a,s.config,this.ctx.opts,Ge._rendererRegistry.has("canvas")),this._buildSkeleton();const p=this._containerWidth();this._lastWidth=p,this._lastHeight=this._hostHeight()||0,this._chromeH=0,this.layout=yi({panelCount:a.panels.length,containerWidth:p,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._buildCells();const f="shared"!==this._yMode(),m=this.elWrap;if(h)this.virtual.start();else{f&&(m.style.visibility="hidden");for(let t=0;t<this.panels.length;t++){const e=this.panels[t];if(e.noMount)continue;const i=this._assemblePanelOptions(e.index),n=new g.default(e.el,i);e.chart=n,yield n.render(),this._fire("panelMounted",{key:e.key,index:e.index,chart:n})}f&&(yield this._alignGutters(),m.style.visibility="")}this.chrome.buildTitle(this._elChromeTop),this.chrome.buildToolbar(m),this.chrome.buildLegend(m),this.sync.wireCrosshairs(this.elGrid),"grid"===(this.cfg.tooltip||"panel")&&(this.gridTooltip=new Wi(this),this.gridTooltip.wire(this.elGrid,m)),this._mounted=!0,this._refitForChrome(),Be(this.ctx.el,this._resizeHandler),h||(s.globals.animationEnded=!0),this._fire("trellisMounted",{panels:this.getPanels()})}finally{this._rendering=!1}}else console.warn("ApexCharts: trellis rendering is browser-only in this version; SSR hosts render nothing.")})}_containerWidth(){const t=this.ctx.el;return t.getBoundingClientRect().width||t.clientWidth||800}_hostHeight(){var t;const e=this.w.config.chart&&this.w.config.chart.height;if(null==e||""===e||"auto"===e)return;const i=String(e).trim();if(i.endsWith("%")){const e=parseFloat(i);if(!isFinite(e)||e<=0)return;const n=null==(t=this.ctx.el)?void 0:t.parentNode;if(!n||"function"!=typeof n.getBoundingClientRect)return;const s=(n.getBoundingClientRect().height||n.clientHeight||0)*e/100;return s>0?s:void 0}const n=parseFloat(i);return isFinite(n)&&n>0?n:void 0}_chromeHeight(){const t=this.elWrap,e=this.elGrid;if(!t||!e||"function"!=typeof t.getBoundingClientRect)return 0;const i=t.getBoundingClientRect().height-e.getBoundingClientRect().height;return isFinite(i)&&i>0?i:0}_buildSkeleton(){var t;const e=this.ctx.el,i=A.createElementNS("http://www.w3.org/1999/xhtml","div");i.className="apexcharts-trellis",this.split&&"2d"===this.split.mode&&i.classList.add("apexcharts-trellis-2d"),i.id=`apexcharts-trellis${this.w.globals.chartID}`,i.setAttribute("data-tooltip-mode",this.cfg.tooltip||"panel");const n=null==(t=this.w.config.chart)?void 0:t.foreColor;n&&i.style.setProperty("--apx-trellis-fore",n);const s=A.createElement("div");s.className="apexcharts-trellis-chrome",i.appendChild(s),this._elChromeTop=s;const r=A.createElement("div");r.className="apexcharts-trellis-grid",i.appendChild(r),e.appendChild(i),this.elWrap=i,this.elGrid=r,this.w.dom.baseEl=e,this.w.dom.elWrap=i}_applyGridStyle(){var t;const e=this.elGrid,i=this.layout;e.style.display="grid";const n=this.split&&"2d"===this.split.mode&&!1!==(null==(t=this.cfg.header)?void 0:t.show);e.style.gridTemplateColumns=n?`auto repeat(${i.cols}, minmax(0, 1fr))`:`repeat(${i.cols}, minmax(0, 1fr))`,e.style.gap=`${i.gap}px`}_buildCells(){var t;const e=this.elGrid,i=this.split,n=this.layout,s="2d"===i.mode,r=s&&!1!==(null==(t=this.cfg.header)?void 0:t.show);this._stripEls=[];const a=this.cfg.emptyPanels||"placeholder";if(r){const t=A.createElement("div");t.className="apexcharts-trellis-corner",e.appendChild(t),this._stripEls.push(t),(i.colKeys||[]).forEach((t,n)=>{const s=this.chrome.stripEl("column",t,{index:n,count:(i.colKeys||[]).length});e.appendChild(s),this._stripEls.push(s)})}this.panels=[],i.panels.forEach((t,o)=>{var l;if(r&&o%n.cols===0){const t=Math.floor(o/n.cols),s=this.chrome.stripEl("row",null!=(l=(i.rowKeys||[])[t])?l:"",{index:t,count:(i.rowKeys||[]).length});e.appendChild(s),this._stripEls.push(s)}const c=A.createElement("div");c.className="apexcharts-trellis-cell",c.setAttribute("data-key",t.key),this._applyCellMutes(c,n.cells[o]),s||this.chrome.buildHeader(c,t.key,{index:o,count:i.panels.length});const h=A.createElement("div");h.className="apexcharts-trellis-panel",this._virtualActive&&(h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${n.panelH}px`),c.appendChild(h);const d=t.empty&&"placeholder"!==a;if(t.empty)if(c.classList.add("apexcharts-trellis-cell-empty"),"hide"===a)c.classList.add("apexcharts-trellis-cell-hidden");else if("skip"===a)h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${n.panelH}px`;else{const t=A.createElement("div");t.className="apexcharts-trellis-empty-label",t.textContent=this.w.config.noData&&this.w.config.noData.text||"no data",c.appendChild(t)}e.appendChild(c),this.panels.push({key:t.key,index:o,el:h,cellEl:c,chart:null,empty:t.empty,noMount:d})})}_applyCellMutes(t,e){t.classList.toggle("apexcharts-trellis-mute-x",!e.showXLabels),t.classList.toggle("apexcharts-trellis-mute-y",!e.showYLabels)}_assemblePanelOptions(t,{noAnimation:e=!1}={}){var i,n,s,r,a,c,h,d,u,p,f,g,m,y;const x=this.w,_=this.split,b=this.scales,v=this.layout,w=_.panels[t],A=I.clone(this.ctx.opts||{});delete A.trellis,delete A.series,delete A.responsive,A.annotations&&(A.annotations=function(t,e){if(!t||"object"!=typeof t)return t;const i=o({},t);for(const t of["yaxis","xaxis","points","texts","images"]){const n=i[t];Array.isArray(n)&&(i[t]=n.filter(t=>!t||void 0===t.scope||null===t.scope||"trellis"===t.scope||(Array.isArray(t.scope)?-1!==t.scope.map(String).indexOf(e):String(t.scope)===e)).map(t=>{if(!t||void 0===t.scope)return t;const e=o({},t);return delete e.scope,e}))}return i}(A.annotations,w.key));const M=A.chart||{},k=M.events||{},L=x.globals.chartID,S=null==(s=null==(n=null==(i=this.ctx.opts)?void 0:i.chart)?void 0:n.animations)?void 0:s.enabled,C=e||_.panels.length>16&&void 0===S,E=w.empty&&"placeholder"===(this.cfg.emptyPanels||"placeholder");let F=E?[ni(_,{chartType:x.config.chart.type})]:w.series;const D=["pie","donut","polarArea","radialBar"].includes(x.config.chart.type);D&&(F=F.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0));const P=o(o(l(o({chart:l(o(o({id:`${L}-tp${t}`,group:this._groupId(),height:v.panelH,width:"100%",redrawOnParentResize:!1,redrawOnWindowResize:!1,print:{enabled:!1},parentHeightOffset:0,toolbar:{show:!1},zoom:{enabled:"none"!==this.cfg.zoom,resetControl:"none"==this.cfg.toolbar&&!1!==x.config.chart.zoom.resetControl}},C?{animations:{enabled:!1}}:{}),this._panelRenderer?{renderer:this._panelRenderer}:{}),{events:l(o({},k),{zoomed:this.sync.makeZoomedHandler(k.zoomed),scrolled:this.sync.makeScrolledHandler(k.scrolled)})}),series:F},D?{}:{colors:F.map(t=>b.colorOf(t.name))}),{title:{text:"",margin:0,floating:!0},subtitle:{text:"",margin:0,floating:!0},legend:{show:!1}}),E?{tooltip:{enabled:!1}}:{}),v.panelH<120&&"grid"!==this.cfg.tooltip&&"boolean"!=typeof(null==(a=null==(r=this.ctx.opts)?void 0:r.tooltip)?void 0:a.compact)?{tooltip:{compact:!0}}:{});if(!(null==(c=M.sparkline)?void 0:c.enabled)&&!["pie","donut","polarArea","radialBar","radar","treemap"].includes(x.config.chart.type)){const t=A.grid&&A.grid.padding||{},e="datetime"===(null==(d=null==(h=this.ctx.opts)?void 0:h.xaxis)?void 0:d.type)?2:7;P.grid={padding:{top:("number"==typeof t.top?t.top:0)-12,bottom:("number"==typeof t.bottom?t.bottom:0)-e}}}const R=this._valueAxisIsX();b.x&&!R&&(P.xaxis={min:b.x.min,max:b.x.max});const T=this._yBoundsFor(w);if(T){const t=Array.isArray(null==(u=this.ctx.opts)?void 0:u.yaxis)?this.ctx.opts.yaxis[0]:null==(p=this.ctx.opts)?void 0:p.yaxis,e=Array.isArray(A.yaxis)?A.yaxis[0]:A.yaxis;let i={};if("function"!=typeof(null==(f=null==t?void 0:t.labels)?void 0:f.formatter)){const t=(T.max-T.min)/Math.max(1,T.tickAmount),e=Math.max(this._yLabelDecimals,fi(t));i={labels:{formatter:t=>"number"==typeof t&&isFinite(t)?t.toFixed(e):t}}}P.yaxis=I.extend(e||{},o({min:T.min,max:T.max,tickAmount:T.tickAmount},i)),delete A.yaxis,R&&(P.xaxis=I.extend(P.xaxis||{},this._valueAxisXPatch(T)))}const N=this._frames;if(N&&N.plotOptions&&(P.plotOptions=I.clone(N.plotOptions)),N&&N.pieScaleOf){const t=N.pieScaleOf(w.key);if(null!==t){const e=null==(y=null==(m=null==(g=this.ctx.opts)?void 0:g.plotOptions)?void 0:m.pie)?void 0:y.customScale;P.plotOptions=I.extend(P.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}let O=I.extend(A,P);if("function"==typeof this.cfg.panel){const e=this.cfg.panel(w.key,{index:t,seriesNames:w.seriesNames});e&&"object"==typeof e&&(O=I.extend(O,e))}return O}_alignGutters(){return h(this,null,function*(){var t,e,i,n;const s=this.panels.map(t=>{var e,i,n,s,r;return null==(r=null==(s=null==(n=null==(i=null==(e=t.chart)?void 0:e.w)?void 0:i.globals)?void 0:n.yLabelsCoords)?void 0:s[0])?void 0:r.width}).filter(t=>"number"==typeof t&&isFinite(t));if(!s.length)return;const r=!!(null==(n=null==(i=null==(e=null==(t=this.panels[0])?void 0:t.chart)?void 0:e.w)?void 0:i.globals)?void 0:n.isBarHorizontal)?0:10,a=Math.max(0,Math.max(...s)-r);yield this._pushGutterFloor(a)})}_yLabelPad(){return 10}_pushGutterFloor(t){return h(this,null,function*(){for(const e of this.panels)e.chart&&(yield e.chart.updateOptions({yaxis:Fi(e.chart,{labels:{minWidth:t}})},!1,!1,!1).catch(()=>{}))})}_refitForChrome(){if(!this._hostHeight())return;const t=this._chromeHeight();t<=0||Math.round(t)===Math.round(this._chromeH)?this._warnIfOverflowing():(this._chromeH=t,this._relayout(this._containerWidth()))}_warnIfOverflowing(){const t=this.layout;t&&t.overflowH&&!this._overflowWarned&&(this._overflowWarned=!0,console.warn(`ApexCharts: trellis needs ${Math.round(t.gridH+this._chromeH)}px but its container gives ${Math.round(this._hostHeight()||0)}px; ${t.rows} rows cannot go below the ${t.panelH}px panel floor. Raise the container, use fewer panels (trellis.limit) or more columns (trellis.columns), or lower trellis.minPanelHeight.`))}_onContainerResize(){this._mounted&&(this._raf||(this._raf=requestAnimationFrame(()=>{this._raf=0;const t=this._containerWidth(),e=this._hostHeight()||0;if(Math.round(t)!==Math.round(this._lastWidth)||Math.round(e)!==Math.round(this._lastHeight)){if(this._lastWidth=t,this._lastHeight=e,this._promotedKey){const t=this.panels.find(t=>t.key===this._promotedKey);return void(t&&t.chart&&t.chart.updateOptions({},!1,!1,!1).catch(()=>{}))}this._relayout(t)}})))}promote(t){return h(this,null,function*(){var e;const i=this.panels.find(e=>e.key===String(t));if(!i||i.noMount||!this._mounted)return;if(this._promotedKey===i.key)return;this._promotedKey&&(yield this.restorePromotion()),this._promotedKey=i.key;const n=this.layout,s=this.elGrid?this.elGrid.getBoundingClientRect().height:0,r=Math.round(Math.max(280,Math.min(560,s||(n?2.4*n.panelH:420))));null==(e=this.elWrap)||e.classList.add("apexcharts-trellis-promoting"),this.panels.forEach(t=>{if(!t.cellEl)return;const e=t===i;t.cellEl.classList.toggle("apexcharts-trellis-cell-promoted",e),t.cellEl.classList.toggle("apexcharts-trellis-cell-parked",!e)}),this._stripEls.forEach(t=>t.classList.add("apexcharts-trellis-cell-parked")),this.chrome.buildBreadcrumb(this._elChromeTop,i.key,()=>this.restorePromotion()),!i.chart&&this._virtualActive&&(i.wantMounted=!0,this.virtual._dirty.add(i),this.virtual._schedule()),i.el&&(i.el.style.minHeight=`${r}px`),i.chart&&(yield i.chart.updateOptions({chart:{height:r}},!1,!1,!1).catch(()=>{})),this._fire("panelPromoted",{key:i.key,chart:i.chart})})}restorePromotion(){return h(this,null,function*(){var t;if(!this._promotedKey)return;const e=this.panels.find(t=>t.key===this._promotedKey);this._promotedKey=null,null==(t=this.elWrap)||t.classList.remove("apexcharts-trellis-promoting"),this.panels.forEach(t=>{t.cellEl&&(t.cellEl.classList.remove("apexcharts-trellis-cell-promoted"),t.cellEl.classList.remove("apexcharts-trellis-cell-parked"))}),this._stripEls.forEach(t=>t.classList.remove("apexcharts-trellis-cell-parked")),this.chrome.removeBreadcrumb();const i=this.layout;e&&e.el&&i&&(e.el.style.minHeight=`${i.panelH}px`),e&&e.chart&&i&&(yield e.chart.updateOptions({chart:{height:i.panelH}},!1,!1,!1).catch(()=>{})),this._lastWidth=0,this._relayout(this._containerWidth()),this._lastWidth=this._containerWidth(),this._fire("panelRestored",{key:e?e.key:null})})}_relayout(t){const e=this.split;if(!e)return;const i=this.layout?this.layout.panelH:0;this.layout=yi({panelCount:e.panels.length,containerWidth:t,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._warnIfOverflowing();const n=this.layout;this.panels.forEach((t,e)=>{if(t.cellEl&&this._applyCellMutes(t.cellEl,n.cells[e]),t.el&&this._virtualActive&&(t.el.style.minHeight=`${n.panelH}px`),!t.chart)return;const s=n.panelH!==i?{chart:{height:n.panelH}}:{};t.chart.updateOptions(s,!1,!1,!1).catch(()=>{})}),this._virtualActive&&this.virtual.refresh()}canApplyInPlace(t){if(!this._mounted||this._promotedKey)return!1;if(!t||"object"!=typeof t)return!1;const e=Object.keys(t);return!!e.length&&e.every(t=>Ki.includes(t))}applyPanelOptions(t=!0){return h(this,null,function*(){var e,i,n;const s=this.split;if(!s)return;const r=this._yMode()!==((null==(e=this.cfg.scales)?void 0:e.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=mi(s,r,o({chartType:this.w.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames?this._frames.yExtentOverride:null},this._stackingHost())),yield Promise.all(this.panels.map(e=>{if(!e.chart)return Promise.resolve();const i=this._assemblePanelOptions(e.index);return delete i.series,i.chart&&delete i.chart.height,e.chart.updateOptions(i,!1,t,!1,!1).catch(()=>{})})),null==(n=(i=this.chrome).refreshLegendColors)||n.call(i)})}updateSeries(t,e=!0){return h(this,null,function*(){var i;const n=this.w;if(Array.isArray(this.cfg.data)&&this.cfg.data.length)return console.warn("ApexCharts: this trellis renders from trellis.data; update it via updateOptions({ trellis: { data } })."),Promise.resolve();if(n.config.series=t,this.ctx.opts&&(this.ctx.opts.series=t),!this._mounted)return this.ctx.render();const s=si(t||[],this.cfg,{chartType:n.config.chart.type});if(!(s.panels.length===this.panels.length&&s.panels.every((t,e)=>t.key===this.panels[e].key)))return this.teardown(),this.ctx.render();this.split=s,this._frames=ci(s,this.cfg,n.config,"histogram"===n.config.chart.requestedType?"histogram":n.config.chart.type);const r=this._yMode()!==((null==(i=this.cfg.scales)?void 0:i.y)||"shared")?l(o({},this.cfg),{scales:l(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=mi(s,r,o({chartType:n.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost()));const a=this.scales,c=this._frames,h=["pie","donut","polarArea","radialBar"].includes(n.config.chart.type),d=this.panels.map((t,i)=>{var n,r,o;if(!t.chart)return Promise.resolve();const l={series:h?s.panels[i].series.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0):s.panels[i].series},d=this._valueAxisIsX();a.x&&!d&&(l.xaxis={min:a.x.min,max:a.x.max});const u=this._yBoundsFor(s.panels[i]);if(u&&(l.yaxis=Fi(t.chart,{min:u.min,max:u.max,tickAmount:u.tickAmount}),d&&(l.xaxis=I.extend(l.xaxis||{},this._valueAxisXPatch(u)))),c.plotOptions&&(l.plotOptions=I.clone(c.plotOptions)),c.pieScaleOf){const t=c.pieScaleOf(s.panels[i].key);if(null!==t){const e=null==(o=null==(r=null==(n=this.ctx.opts)?void 0:n.plotOptions)?void 0:r.pie)?void 0:o.customScale;l.plotOptions=I.extend(l.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}return t.chart.updateOptions(l,!1,e,!1).catch(()=>{})});return Promise.all(d)})}getPanels(){return this.panels.map(t=>({key:t.key,index:t.index,chart:t.chart,el:t.cellEl}))}getPanel(t){const e=this.panels.find(e=>e.key===String(t));return e?e.chart:null}teardown(){this.virtual.stop(),this._virtualActive=!1,this._panelRenderer=null,this._promotedKey=null,this._frames=null,this.chrome.destroyGradientLegend(),this.gridTooltip&&(this.gridTooltip.destroy(),this.gridTooltip=null),this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),M.isBrowser()&&this.ctx.el&&ze(this.ctx.el,this._resizeHandler),this.panels.forEach(t=>{if(t.chart)try{t.chart.destroy()}catch(t){}t.chart=null}),this.panels=[],this._stripEls=[],this.elWrap&&this.elWrap.parentNode&&this.elWrap.parentNode.removeChild(this.elWrap),this.elWrap=null,this.elGrid=null,this._mounted=!1,this.ctx._renderPromise=null}}});g.default.registerFeatures({measure:class{constructor(t,e){this.w=t,this.ctx=e,this.graphics=new _(t),this.pins=[],this.drag=null,this.armed=!1,this.persistent=!1,this.pane=null,this._seedActive=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onSeedDown=this._onSeedDown.bind(this),this._onSeedKey=this._onSeedKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender),this._bindKeys()}_cfg(){return this.w.config.chart.measure||{}}_enabled(){return this.w.globals.axisCharts&&!0===this._cfg().enabled}_mode(){return"free"===this._cfg().mode?"free":"span"}_snapToSeries(t){const e=(this.w.config.series||[])[0];if(!e)return null;const i=this._points(e.data||[]);if(!i.length)return null;let n=i[0],s=Math.abs(i[0].x-t);for(let e=1;e<i.length;e++){const r=Math.abs(i[e].x-t);r<s&&(s=r,n=i[e])}return n}_resolve(t){if("free"===this._mode())return t;const e=this._snapToSeries(t.x);if(!e)return t;const i=this._dataToGrid(e.x,e.y);return{x:e.x,y:e.y,gx:i.gx,gy:i.gy}}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_bindKeys(){if(this._keysBound)return;const t=this._doc();t&&(t.addEventListener("keydown",this._onKeyDown),t.addEventListener("keyup",this._onKeyUp),this._keysBound=!0)}_onKeyDown(t){if(!this._enabled()||this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()?this._arm():"Escape"===t.key&&this._cancelDrag()}_onKeyUp(t){if(this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()&&(this.drag||this._disarm())}startMeasure(){this._enabled()&&(this.persistent=!0,this._arm())}stopMeasure(){this.persistent=!1,this._cancelDrag(),this._disarm()}seedFromClient(t,e){if(!this._enabled())return;this._cancelDrag(),this._endSeed(!1);const i=this._project(t,e);this.drag={a:i,b:i},this._seedActive=!0;const n=this._doc();n&&(n.addEventListener("mousemove",this._onMove),n.addEventListener("touchmove",this._onMove,{passive:!1}),n.addEventListener("mousedown",this._onSeedDown,!0),n.addEventListener("touchstart",this._onSeedDown,!0),n.addEventListener("keydown",this._onSeedKey,!0)),this._renderLive()}_onSeedDown(t){if(!this._seedActive||!this.drag)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:i}=this._clientXY(t);this.drag.b=this._project(e,i),this._endSeed(!0)}_onSeedKey(t){"Escape"===t.key&&this._endSeed(!1)}_endSeed(t){var e,i;if(!this._seedActive)return;this._seedActive=!1;const n=this._doc();n&&(n.removeEventListener("mousemove",this._onMove),n.removeEventListener("touchmove",this._onMove),n.removeEventListener("mousedown",this._onSeedDown,!0),n.removeEventListener("touchstart",this._onSeedDown,!0),n.removeEventListener("keydown",this._onSeedKey,!0));const s=this.drag;if(this.drag=null,this._clearLive(),!t||!s)return;const r=this._resolve(s.a),a=this._resolve(s.b);if(Math.abs(r.gx-a.gx)<2&&Math.abs(r.gy-a.gy)<2)return;const o=this._mode();!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:r.x,ya:r.y,xb:a.x,yb:a.y,mode:o}),this._renderPins(),null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,"measure")),this._fireMeasured(r,a)}clearMeasures(){var t,e;this.pins=[],this._renderPins(),null==(e=null==(t=this.ctx.history)?void 0:t.snapshot)||e.call(t,"clear measures")}getPins(){return this.pins.map(t=>({xa:t.xa,ya:t.ya,xb:t.xb,yb:t.yb,mode:"free"===t.mode?"free":"span"}))}setPins(t){this.pins=Array.isArray(t)?t.filter(t=>t&&isFinite(t.xa)&&isFinite(t.ya)&&isFinite(t.xb)&&isFinite(t.yb)).map(t=>({xa:+t.xa,ya:+t.ya,xb:+t.xb,yb:+t.yb,mode:"free"===t.mode?"free":"span"})):[],this._renderPins()}_points(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i];let s,r;Array.isArray(n)?(s=+n[0],r=+n[1]):n&&"object"==typeof n?(s=+n.x,r=+n.y):(s=i,r=+n),isFinite(s)&&isFinite(r)&&e.push({x:s,y:r})}return e}_arm(){if(this.armed||!this._enabled())return;const t=this.w,e=t.dom.elGraphical;if(!e)return;this.armed=!0;const i=this.graphics.drawRect(0,0,t.layout.gridWidth,t.layout.gridHeight);i.node.setAttribute("class","apexcharts-measure-capture"),i.node.setAttribute("fill","transparent"),i.node.style.cursor="crosshair",i.node.style.pointerEvents="all",i.node.addEventListener("mousedown",this._onDown),i.node.addEventListener("touchstart",this._onDown,{passive:!1}),e.add(i),this.pane=i}_disarm(){if(this.armed=!1,this.pane){this.pane.node.removeEventListener("mousedown",this._onDown),this.pane.node.removeEventListener("touchstart",this._onDown);const t=this.pane.node;t.parentNode&&t.parentNode.removeChild(t),this.pane=null}}_clientXY(t){const e=t.touches&&t.touches[0]?t.touches[0]:t;return{cx:e.clientX,cy:e.clientY}}_plotRect(){const t=this.w;return t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg")?ki.plotRect(t):null}_yRange(){const t=this.w.globals,e=t.yAxisScale&&t.yAxisScale[0];return e&&isFinite(e.niceMin)&&isFinite(e.niceMax)&&e.niceMax!==e.niceMin?[e.niceMin,e.niceMax]:[t.minY,t.maxY]}_project(t,e){const i=this.w,n=this._plotRect(),s=i.layout.gridWidth,r=i.layout.gridHeight,a=t=>t<0?0:t>1?1:t,o=n&&n.width?a((t-n.left)/n.width):0,l=n&&n.height?a((e-n.top)/n.height):0,[c,h]=this._yRange();return{x:i.globals.minX+o*(i.globals.maxX-i.globals.minX),y:h-l*(h-c),gx:o*s,gy:l*r}}_dataToGrid(t,e){const i=this.w,n=i.layout.gridWidth,s=i.layout.gridHeight,r=i.globals.maxX-i.globals.minX||1,[a,o]=this._yRange(),l=o-a||1;return{gx:(t-i.globals.minX)/r*n,gy:s-(e-a)/l*s}}_onDown(t){if(!this.armed)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:i}=this._clientXY(t),n=this._project(e,i);this.drag={a:n,b:n};const s=this._doc();s&&(s.addEventListener("mousemove",this._onMove),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("touchend",this._onUp)),this._renderLive()}_onMove(t){if(!this.drag)return;t.cancelable&&t.preventDefault();const{cx:e,cy:i}=this._clientXY(t);this.drag.b=this._project(e,i),this._renderLive()}_onUp(t){var e,i;const n=this._doc();if(n&&(n.removeEventListener("mousemove",this._onMove),n.removeEventListener("mouseup",this._onUp),n.removeEventListener("touchmove",this._onMove),n.removeEventListener("touchend",this._onUp)),!this.drag)return;const s=this.drag.a,r=this.drag.b;if(this.drag=null,this._clearLive(),Math.abs(s.gx-r.gx)<2&&Math.abs(s.gy-r.gy)<2)return void(this.persistent||this._disarm());const a=this._mode(),o=this._resolve(s),l=this._resolve(r);!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:o.x,ya:o.y,xb:l.x,yb:l.y,mode:a}),this._renderPins(),null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,"measure")),this._fireMeasured(o,l),this.persistent||this._disarm()}_cancelDrag(){const t=this._doc();t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("touchend",this._onUp)),this.drag=null,this._clearLive()}_stats(t,e){const i=e.x-t.x,n=e.y-t.y;return{dx:i,dy:n,pct:0!==t.y?n/Math.abs(t.y)*100:NaN,slope:0!==i?n/i:NaN}}_fmt(t){if(!isFinite(t))return"n/a";const e=Math.abs(t);return 0!==e&&(e<.01||e>=1e6)?t.toExponential(2):String(Math.round(100*t)/100)}_computedStyle(){if(!M.isBrowser())return null;const t=this.w.dom.elGraphical&&this.w.dom.elGraphical.node;if(!t||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(t)}catch(t){return null}}_resolveColor(t,e,i,n){if(t)return t;const s=void 0!==n?n:this._computedStyle();return(s?s.getPropertyValue(e).trim():"")||i}_colors(){const t=this._cfg().colors||{},e=this._computedStyle();return{up:this._resolveColor(t.up,"--apx-measure-up","#16a34a",e),down:this._resolveColor(t.down,"--apx-measure-down","#dc2626",e),neutral:this._resolveColor(t.neutral,"--apx-measure-neutral","#64748b",e),guide:this._resolveColor(t.guide,"--apx-measure-guide","#94a3b8",e)}}_dirColor(t){const e=this._colors();return 0===t?e.neutral:t>0?e.up:e.down}_dirClass(t){return 0===t?"apexcharts-measure-flat":t>0?"apexcharts-measure-up":"apexcharts-measure-down"}_fmtPct(t){if(!isFinite(t))return"n/a";const e=this._cfg().format&&this._cfg().format.percent;if("function"==typeof e)try{const i=e(t);if(null!=i)return String(i)}catch(t){}return(t>=0?"+":"")+this._fmt(t)+"%"}_label(t,e,i,n){const s=this._cfg().label;if("function"==typeof s){const r=s({from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:i.dx,dy:i.dy,percentChange:i.pct,slope:i.slope,mode:n});return Array.isArray(r)?r.map(String):[String(r)]}if("span"===n){const n=0===i.dy?"":i.dy>0?" \u2191":" \u2193",s=isFinite(i.pct)?"("+this._fmtPct(i.pct)+")":"";return[this._fmtY(i.dy)+" "+s+n,this._fmtX(t.x)+" to "+this._fmtX(e.x)]}return["\u0394x "+this._fmtDx(i.dx),"\u0394y "+this._fmtY(i.dy),this._fmtPct(i.pct)]}_fmtDx(t){if("datetime"===this.w.config.xaxis.type){const e=t/864e5;return Math.round(10*e)/10+"d"}return this._fmt(t)}_fmtY(t){const e=this._cfg().format&&this._cfg().format.y;if("function"==typeof e)try{const i=e(t);if(null!=i)return String(i)}catch(t){}const i=this.w.globals.yLabelFormatters&&this.w.globals.yLabelFormatters[0];if("function"==typeof i)try{const e=i(t,{seriesIndex:0,dataPointIndex:-1,w:this.w});if(null!=e&&""!==e)return String(e)}catch(t){}return this._fmt(t)}_fmtX(t){const e=this.w,i=this._cfg().format&&this._cfg().format.x;if("function"==typeof i)try{const e=i(t);if(null!=e)return String(e)}catch(t){}if("datetime"===e.config.xaxis.type){return new Date(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}const n=e.globals.xLabelFormatter;if("function"==typeof n)try{const i=n(t,{w:e});if(null!=i&&""!==i)return String(i)}catch(t){}return this._fmt(t)}_liveGroup(){const t=this.w;if(this._live&&this._live.node&&this._live.node.parentNode)return this._live;const e=this.graphics.group({class:"apexcharts-measure-live"});return e.node.style.pointerEvents="none",t.dom.elGraphical&&t.dom.elGraphical.add(e),this._live=e,e}_clearLive(){if(this._live&&this._live.node){const t=this._live.node;t.parentNode&&t.parentNode.removeChild(t)}this._live=null}_renderLive(){if(!this.drag)return;const t=this._liveGroup();for(;t.node.firstChild;)t.node.removeChild(t.node.firstChild);const e=this._resolve(this.drag.a),i=this._resolve(this.drag.b);this._drawRuler(t,e,i,!1,this._mode())}_renderPins(){const t=this.w,e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-measure-pins");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this.pins.length||!t.dom.elGraphical)return;const i=this.graphics.group({class:"apexcharts-measure-pins"});i.node.style.pointerEvents="none",t.dom.elGraphical.add(i),this.pins.forEach(t=>{const e=l(o({},this._dataToGrid(t.xa,t.ya)),{x:t.xa,y:t.ya}),n=l(o({},this._dataToGrid(t.xb,t.yb)),{x:t.xb,y:t.yb});this._drawRuler(i,e,n,!0,t.mode||"span")})}_drawRuler(t,e,i,n,s){const r=this._stats(e,i),a=this.graphics.group({class:"apexcharts-measure-ruler "+this._dirClass(r.dy)+(n?" apexcharts-measure-pinned":"")});"free"===(s||this._mode())?this._drawFree(a,e,i,r):this._drawSpan(a,e,i,r),t.add(a)}_dot(t,e,i){if(!1===this._cfg().markers)return;const n=this.graphics.drawMarker(e.gx,e.gy,{pSize:4,shape:"circle",pointFillColor:i,pointFillOpacity:1,pointStrokeColor:"#fff",pointStrokeWidth:2,pointStrokeOpacity:1});t.add(n)}_readout(t,e,i,n,s,r,a){const o=this.graphics.drawRect(i,n,s,r,4);o.node.setAttribute("class","apexcharts-measure-label-bg"),o.attr({fill:"#ffffff","fill-opacity":.95,stroke:a,"stroke-width":1}),t.add(o);const l=this.graphics.drawText({x:i+9,y:n+15,text:e,textAnchor:"start",fontSize:"11px",foreColor:"#1e293b",cssClass:"apexcharts-measure-label"});t.add(l)}_drawSpan(t,e,i,n){const s=this.w,r=this._cfg(),a=s.layout.gridHeight,o=this._dirColor(n.dy),l=Math.min(e.gx,i.gx),c=Math.max(e.gx,i.gx);if(!1!==r.band){const e=this.graphics.drawRect(l,0,Math.max(0,c-l),a,0);e.node.setAttribute("class","apexcharts-measure-band"),e.attr({fill:o,"fill-opacity":.09,stroke:"none"}),t.add(e)}!1!==r.guides&&[e,i].forEach(e=>{const i=this.graphics.drawLine(e.gx,0,e.gx,a,this._colors().guide,4,1);i.node.setAttribute("class","apexcharts-measure-vline"),t.add(i)}),[e,i].forEach(e=>this._dot(t,e,o));const h=this._label(e,i,n,"span"),d=h.reduce((t,e)=>Math.max(t,e.length),0),u=Math.max(148,6.4*d),p=20+15*h.length;let f=(l+c)/2-u/2;f=Math.max(2,Math.min(f,s.layout.gridWidth-u-2)),this._readout(t,h,f,4,u,p,o)}_drawFree(t,e,i,n){const s=this._dirColor(n.dy),r=this.graphics.drawLine(e.gx,e.gy,i.gx,i.gy,s,0,2);r.node.setAttribute("class","apexcharts-measure-line"),t.add(r),[e,i].forEach(e=>this._dot(t,e,s));const a=this._label(e,i,n,"free"),o=a.reduce((t,e)=>Math.max(t,e.length),0),l=Math.max(72,6.2*o),c=16+15*a.length;let h=(e.gx+i.gx)/2+8,d=(e.gy+i.gy)/2-c/2;h=Math.max(2,Math.min(h,this.w.layout.gridWidth-l-2)),d=Math.max(2,Math.min(d,this.w.layout.gridHeight-c-2)),this._readout(t,a,h,d,l,c,s)}_fireMeasured(t,e){const i=this._stats(t,e),n={from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:i.dx,dy:i.dy,percentChange:i.pct,slope:i.slope},s=this.w.config.chart.events.measured;"function"==typeof s&&s(this.ctx,n),this.ctx.events.fireEvent("measured",[this.ctx,n])}_afterRender(){this._enabled()&&(this.w.interact.measureEnabled&&!this.persistent&&(this.persistent=!0),this.pins.length&&this._renderPins(),this.persistent&&!this.drag&&(this._disarm(),this._arm()))}teardown(){this._cancelDrag(),this._endSeed(!1),this._disarm();const t=this._doc();t&&this._keysBound&&(t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("keyup",this._onKeyUp)),this._keysBound=!1,this.pins=[]}}});const Zi=[".apexcharts-bar-area",".apexcharts-candlestick-area",".apexcharts-boxPlot-area",".apexcharts-rangebar-area",".apexcharts-marker"].join(", "),Qi=[".apexcharts-pie-area",".apexcharts-bar-area"].join(", "),Ji="apexcharts-crossfilter-dimmed",tn=["pie","donut","polarArea","radialBar"];g.default.registerFeatures({linkedViews:class{constructor(t,e){this.w=t,this.ctx=e,this._dimmed=!1,this._wired=!1,this._pending=!1,this._lastValues=null,this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onChange=this._onChange.bind(this),"filter"===this._mode()&&this._initEngine()}_mode(){const t=this.w.config.chart.link;return t&&"function"==typeof t.dimension?"filter":t&&t.enabled?"highlight":"off"}_enabled(){const t=this.w.config.chart.link;return!(!t||!t.enabled)}onSourceSelection(t){var e;const i=this._mode();if("off"===i)return;if(!t||null==t.min||null==t.max)return;let n=Math.min(t.min,t.max),s=Math.max(t.min,t.max);const r=this.w.globals.minX,a=this.w.globals.maxX;if(isFinite(r)&&isFinite(a)&&a>r){const t=1e-6*(a-r);n-r<=t&&(n=r),a-s<=t&&(s=a)}if("filter"===i){const t=this._cf();if(!t)return;return t.filter(this._chartId(),[n,s]),void this._fireFilterChange(t,[n,s])}this._group().forEach(t=>{var e;null==(e=null==t?void 0:t.linkedViews)||e.applyDim(n,s)});const o={xaxis:{min:n,max:s},sourceChartID:this.w.globals.chartID};"function"==typeof this.w.config.chart.events.crossFilter&&this.w.config.chart.events.crossFilter(this.ctx,o),null==(e=this.ctx.events)||e.fireEvent("crossFilter",[this.ctx,o])}_group(){const t="function"==typeof this.ctx.getGroupedCharts?this.ctx.getGroupedCharts():[];return[this.ctx,...t]}applyDim(t,e){if(!this._enabled())return;const i=this.w,n=i.dom.baseEl;if(!n)return;const s=i.config.chart.link.dimOpacity;i.dom.elWrap&&"number"==typeof s&&i.dom.elWrap.style.setProperty("--apx-cf-dim",String(s));const r=i.globals.seriesX||[];n.querySelectorAll(Zi).forEach(i=>{const n=i.getAttribute("j");if(null===n)return;const s=parseInt(n,10),a=i.getAttribute("index"),o=null===a?0:parseInt(a,10),l=r[o]||r[0];if(!l)return;const c=l[s];null!=c&&i.classList.toggle(Ji,c<t||c>e)}),this._dimmed=!0}clear(){const t=this.w.dom.baseEl;t&&(t.querySelectorAll("."+Ji).forEach(t=>t.classList.remove(Ji)),this._dimmed=!1)}clearGroup(){if("filter"===this._mode()){const t=this._cf();return void(t&&t.reset())}this._group().forEach(t=>{var e;return null==(e=null==t?void 0:t.linkedViews)?void 0:e.clear()})}_chartId(){return this.w.globals.chartID}_cf(){const t=this.w.config.chart.link,e=t&&(t.id||this.w.config.chart.group);return e?St.get(e):null}_isPie(){return-1!==tn.indexOf(this.w.config.chart.type)}_isHeatmap(){return"heatmap"===this.w.config.chart.type}_initEngine(){const t=this._cf(),e=this.w.config.chart.link;if(!t){const t=e&&e.id||this.w.config.chart.group;return void console.warn(`[apexcharts] chart.link.dimension is set but no crossfilter coordinator "${t}" exists. Call ApexCharts.crossfilter({ id, records }) before creating the chart.`)}const i=this._chartId();t.hasDimension(i)||t.registerDimension(i,{dimension:e.dimension,reduce:e.reduce,type:e.type||(this._isHeatmap()?"matrix":void 0),bins:e.bins,order:e.order}),this._injectSeries(t.aggregateFor(i)),this._wire(t)}_seriesFromAgg(t){if("matrix"===t.type)return t.yLabels.map((e,i)=>({name:String(e),data:t.xLabels.map((e,n)=>({x:String(e),y:t.matrix[i][n]}))}));if(this._isPie())return t.values.slice();const e=this.w.config.chart.link.seriesName||"Count";return"range"===t.type?[{name:e,data:t.labels.map((e,i)=>[e,t.values[i]])}]:[{name:e,data:t.values.slice()}]}_sigOf(t){return JSON.stringify(t.matrix||t.values)}_injectSeries(t){const e=this.w;this._lastValues=this._sigOf(t),e.config.series=this._seriesFromAgg(t),"matrix"!==t.type&&(this._isPie()?e.config.labels=t.labels.map(String):"category"===t.type?(e.config.xaxis||(e.config.xaxis={}),e.config.xaxis.categories=t.labels.map(String)):"range"===t.type&&this._pinRangeDomain(t.edges))}_pinRangeDomain(t){if(!Array.isArray(t)||t.length<2)return;const e=this.w;e.config.xaxis||(e.config.xaxis={}),null==e.config.xaxis.min&&(e.config.xaxis.min=t[0]),null==e.config.xaxis.max&&(e.config.xaxis.max=t[t.length-1])}_wire(t){this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.on("change",this._onChange))}_onPointSelect(t,e,i){if("filter"!==this._mode()||!i||null==i.dataPointIndex)return;const n=this._cf();if(!n)return;const s=this._chartId(),r=n.aggregateFor(s);if("matrix"===r.type)return;const a=r.keys[i.dataPointIndex];null!=a&&(n.toggleKey(s,a),this._fireFilterChange(n,a))}_onChange(){"filter"!==this._mode()||this._pending||(this._pending=!0,Promise.resolve().then(()=>{this._pending=!1,this.w.globals.isDestroyed||this._applyAggregation()}))}_applyAggregation(){if("filter"!==this._mode())return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),i=this._sigOf(e);i!==this._lastValues?(this._lastValues=i,this.ctx.updateSeries(this._seriesFromAgg(e),!0)):this._applySelfDim()}_afterRender(){if("filter"!==this._mode())return;const t=this.w.config.series;t&&0!==t.length?this._applySelfDim():this._reassertSeries()}_reassertSeries(){this._pending||(this._pending=!0,Promise.resolve().then(()=>{if(this._pending=!1,this.w.globals.isDestroyed)return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),i=this._seriesFromAgg(e);i.length&&(this._lastValues=this._sigOf(e),this.ctx.updateSeries(i,!0))}))}_applySelfDim(){const t=this._cf();if(!t)return;const e=this.w,i=e.dom.baseEl;if(!i)return;const n=this._chartId(),s=t.filterOf(n),r=e.config.chart.link.dimOpacity;e.dom.elWrap&&"number"==typeof r&&e.dom.elWrap.style.setProperty("--apx-cf-dim",String(r));const a=s instanceof Set,o=Array.isArray(s),l=t.aggregateFor(n);if("matrix"===l.type)return;const c=l.keys;i.querySelectorAll(Qi).forEach(t=>{const e=t.getAttribute("j");if(null===e)return;const i=c[parseInt(e,10)];let n=!1;a?n=!s.has(i):o&&Array.isArray(i)&&(n=i[1]<=s[0]||i[0]>=s[1]),t.classList.toggle(Ji,n)}),this._dimmed=!!s}_fireFilterChange(t,e){var i;const n=l(o({},t.state()),{sourceChartID:this._chartId(),key:e}),s=this.w.config.chart.events;"function"==typeof s.filterChange&&s.filterChange(this.ctx,n),null==(i=this.ctx.events)||i.fireEvent("filterChange",[this.ctx,n])}teardown(){var t,e,i,n,s,r;if(this.clear(),this._wired){null==(e=(t=this.ctx).removeEventListener)||e.call(t,"dataPointSelection",this._onPointSelect),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"mounted",this._afterRender),null==(r=(s=this.ctx).removeEventListener)||r.call(s,"updated",this._afterRender);const a=this._cf();a&&(a.off("change",this._onChange),a.removeDimension(this._chartId())),this._wired=!1}}},crossfilter:St});const en=g.__apex_Options,nn=["point","xaxis","yaxis"],sn=[10,11,12,14,17,20],rn=["circle","square","diamond","triangle"],an={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},on=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class ln{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let i=t,n=1/0;for(let s=0;s<e.length;s++){const r=Math.abs(e[s]-t);r<n&&(n=r,i=e[s])}return i}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const i=this.w.globals.yAxisScale,n=i&&i[e];return n&&Array.isArray(n.result)&&n.result.length?this._nearest(t,n.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const i="point"===t?"points":t;return Array.isArray(e[i])?e[i]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return nn.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){if(this._closeEditor(!1),this._attach(),this._creating){const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0))}}_attach(){const t=this.w,e=t.dom.baseEl;e&&(nn.forEach(i=>{this._annoList(i).forEach((n,s)=>{this._isDraggable(n)&&(n.id||(n.id="apexcharts-ink-"+i+"-"+s+"-"+t.globals.chartID),e.querySelectorAll("."+n.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,i,s)),t.addEventListener("touchstart",t=>this._onDown(t,i,s)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(i,s,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,i){if(t.button&&0!==t.button)return;const n=this.w,s=n.dom.baseEl&&n.dom.baseEl.ownerDocument;if(!s)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const r="touchstart"===t.type?t.touches[0]:t,a=n.dom.Paper&&n.dom.Paper.node,o=a&&a.getScreenCTM?a.getScreenCTM():null,l=this._annoList(e)[i];let c="move",h=null,d=0,u=0;if("xaxis"===e&&null!=l.x2&&(h=n.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),h)){const t=h.getBoundingClientRect();Math.abs(r.clientX-t.left)<=8?c="resize-x1":Math.abs(r.clientX-t.right)<=8&&(c="resize-x2"),d=parseFloat(h.getAttribute("x"))||0,u=parseFloat(h.getAttribute("width"))||0}this._drag={type:e,index:i,anno:l,els:Array.from(n.dom.baseEl.querySelectorAll("."+l.id)),mode:c,rect:h,origX:d,origW:u,startX:r.clientX,startY:r.clientY,scaleX:o&&o.a?o.a:1,scaleY:o&&o.d?o.d:1,dxPixel:0,dyPixel:0,moved:!1},s.addEventListener("mousemove",this._onMove),s.addEventListener("touchmove",this._onMove,{passive:!1}),s.addEventListener("mouseup",this._onUp),s.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const i="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(i.clientX-e.startX)/e.scaleX,e.dyPixel=(i.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,i;null==(i=null==(e=this.ctx.history)?void 0:e.snapshot)||i.call(e,t)}_applyDelta(t,e){const i=this.w,n=i.layout.gridWidth?t.dxPixel*(i.globals.xRange/i.layout.gridWidth):0;if("point"===t.type){const{newX:n,newY:s}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(n),null!=s){const t=e.yAxisIndex||0,n=i.globals.seriesYAxisMap;e.y=this._snapY(s,n&&n[t]?n[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const n=e.yAxisIndex||0,s=i.globals.seriesYAxisMap,r=s&&s[n]?s[n][0]:0,a=i.globals.yRange?i.globals.yRange[r]:null;if(null==a||!i.layout.gridHeight)return;const o=-t.dyPixel*(a/i.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=o),e.y2+=o):"number"==typeof e.y&&(e.y=this._snapY(e.y+o,r))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=n,e.x2+=n):e.x=this._snapX(e.x+n);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const i=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!i:i)?e.x=this._snapX(e.x+n):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+n))}}}_invertPoint(t,e,i){const n=this.w,s=("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)&&!n.axisFlags.dataFormatXNumeric;let r=t.x;!s&&"number"==typeof t.x&&n.layout.gridWidth&&(r=t.x+e*(n.globals.xRange/n.layout.gridWidth));let a=t.y;const o=t.yAxisIndex||0,l=n.globals.seriesYAxisMap,c=l&&l[o]?l[o][0]:0,h=n.globals.yRange?n.globals.yRange[c]:null,d=n.config.yaxis[o]&&n.config.yaxis[o].logarithmic;return"number"==typeof t.y&&null!=h&&!d&&n.layout.gridHeight&&(a=t.y-i*(h/n.layout.gridHeight)),{newX:r,newY:a}}_redrawAnno(t,e,i){const n=this.w.dom.baseEl,s=this.ctx.annotations;if(!n||!s)return;n.querySelectorAll("."+e.id).forEach(t=>t.remove());const r=n.querySelector(".apexcharts-"+t+"-annotations");if(!r)return;"point"===t&&s.pointsAnnotations?s.pointsAnnotations.addPointAnnotation(e,r,i):"xaxis"===t&&s.xAxisAnnotations?s.xAxisAnnotations.addXaxisAnnotation(e,r,i):"yaxis"===t&&s.yAxisAnnotations&&s.yAxisAnnotations.addYaxisAnnotation(e,r,i);const a=n.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(a&&s.helpers&&e.label&&e.label.text){const t=s.helpers.addBackgroundToAnno(a,e);t&&a.parentNode&&a.parentNode.insertBefore(t.node,a)}this._attach()}_fireAnnotationEvent(t,e){var i;const n=this.w.config.chart.events;"function"==typeof n[t]&&n[t](this.ctx,e),null==(i=this.ctx.events)||i.fireEvent(t,[this.ctx,e])}_fireDragged(t,e,i){const n={type:t,id:e.id,index:i,x:e.x,y:e.y};null!=e.x2&&(n.x2=e.x2),null!=e.y2&&(n.y2=e.y2),this._fireAnnotationEvent("annotationDragged",n)}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,i={}){const n=this.w;this._wire(),this._createSeq+=1;const s="apexcharts-ink-new-"+this._createSeq+"-"+n.globals.chartID,r=I.extend((new en).pointAnnotation,{x:t,y:e,id:s,owner:"ink",draggable:!0,label:{text:i.text||"Note"}});n.config.annotations||(n.config.annotations={}),Array.isArray(n.config.annotations.points)||(n.config.annotations.points=[]),n.config.annotations.points.push(r);const a=n.config.annotations.points.length-1;return this._redrawAnno("point",r,a),this._checkpoint("ink:create"),this._fireCreated("point",r,a),this._startEdit("point",a,{select:!0}),r}createLineAt(t,e,i={}){const n=this.w;this._wire(),this._createSeq+=1;const s="apexcharts-ink-new-"+this._createSeq+"-"+n.globals.chartID,r="y"===t?"yaxis":"xaxis",a="yaxis"===r?(new en).yAxisAnnotation:(new en).xAxisAnnotation,o={id:s,owner:"ink",draggable:!0,strokeDashArray:null!=i.strokeDashArray?i.strokeDashArray:4,label:{text:i.text||""}};i.color&&(o.borderColor=i.color,o.label.borderColor=i.color),"yaxis"===r?o.y=e:o.x=e;const l=I.extend(a,o);n.config.annotations||(n.config.annotations={}),Array.isArray(n.config.annotations[r])||(n.config.annotations[r]=[]),n.config.annotations[r].push(l);const c=n.config.annotations[r].length-1;return this._redrawAnno(r,l,c),this._checkpoint("ink:create"),this._fireCreated(r,l,c),!1!==i.select&&this._startEdit(r,c,{select:!0}),l}_pixelToData(t,e){const i=this.w;if(!i.globals.axisCharts||!i.dom.baseEl||!i.dom.baseEl.querySelector(".apexcharts-svg"))return null;const n=ki.plotRect(i);if(!n.width||!n.height)return null;const s=(t-n.left)/n.width,r=(e-n.top)/n.height;let a=i.globals.minX+s*i.globals.xRange;const o=(i.globals.minYArr&&null!=i.globals.minYArr[0]?i.globals.minYArr[0]:i.globals.minY)+(1-r)*(i.globals.yRange&&null!=i.globals.yRange[0]?i.globals.yRange[0]:i.globals.maxY-i.globals.minY);return("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric&&(a=Math.round(a)),{x:a,y:o}}_fireCreated(t,e,i){const n={type:t,id:e.id,index:i};void 0!==e.x&&(n.x=e.x),void 0!==e.y&&(n.y=e.y),this._fireAnnotationEvent("annotationCreated",n)}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,i=e.createElement("div");i.className="apexcharts-ink-palette";const n=i.style;n.position="absolute",n.top="6px",n.left="6px",n.zIndex="15";const s=e.createElement("button");s.type="button",s.className="apexcharts-ink-add",s.textContent="+ Note";const r=s.style;r.cursor="pointer",r.font="12px sans-serif",r.padding="4px 9px",r.borderRadius="5px",r.border="1px solid #6366f1",r.color="#4338ca",r.background="#fff",s.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),i.appendChild(s),t.appendChild(i),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:on}static _isLight(t){const e=String(t||"").replace("#",""),i=3===e.length?e.split("").map(t=>t+t).join(""):e,n=parseInt(i,16);if(isNaN(n)||6!==i.length)return!1;return(.299*(n>>16&255)+.587*(n>>8&255)+.114*(255&n))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,i,n,s,r){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-btn"+(s?" "+s:""),a.title=i,a.setAttribute("aria-label",i),r?a.innerHTML=e:a.textContent=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),n()}),a}_cardLabel(t,e){const i=t.createElement("span");return i.className="apexcharts-ink-cardlabel",i.textContent=e,i}_mkSwatch(t,e,i,n){const s=t.createElement("button");return s.type="button",s.className="apexcharts-ink-swatch"+(n?" "+n:""),s.title=e,s.setAttribute("aria-label","Color "+e),s.dataset.color=e,s.style.background=e,s.addEventListener("mousedown",t=>t.preventDefault()),s.addEventListener("click",t=>{t.stopPropagation(),i(e)}),s}_startEdit(t,e,i={}){const n=this.w,s=this._annoList(t)[e],r=n.dom.baseEl,a=n.dom.elWrap;if(!(s&&s.id&&r&&a))return;this._closeEditor(!1);const o=r.ownerDocument,l=o.createElement("div");l.className="apexcharts-ink-card",l.setAttribute("role","dialog"),l.setAttribute("aria-label","Edit note"),l.style.visibility="hidden";const c=o.createElement("div");c.className="apexcharts-ink-card-row";const h=o.createElement("input");h.type="text",h.className="apexcharts-ink-editor",h.placeholder="Note text",h.value=s.label&&s.label.text||"",c.appendChild(h),c.appendChild(this._cardBtn(o,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),l.appendChild(c);const d=o.createElement("div");d.className="apexcharts-ink-card-row","point"!==t&&d.appendChild(this._cardLabel(o,"Label")),this._noteColors().forEach(t=>{d.appendChild(this._mkSwatch(o,t,t=>this._applyColor(t)))});const u=o.createElement("span");if(u.className="apexcharts-ink-sep",d.appendChild(u),d.appendChild(this._cardBtn(o,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),d.appendChild(this._cardBtn(o,"A-","Smaller text",()=>this._stepFont(-1))),d.appendChild(this._cardBtn(o,"A+","Larger text",()=>this._stepFont(1))),l.appendChild(d),"point"!==t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(o,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),l.appendChild(t)}if("point"===t){const t=o.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(o,"Marker")),t.appendChild(this._cardBtn(o,"-","Smaller marker",()=>this._stepMarker(-1)));const e=o.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(o,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(o,an.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),l.appendChild(t)}a.appendChild(l),this._editor={card:l,input:h,type:t,index:e},this._positionCard(),this._syncCard(),l.style.visibility="",h.focus(),i.select&&h.select(),l.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===h&&(t.preventDefault(),this._closeEditor(!0))}),o.addEventListener("mousedown",this._onDocDownEditor,!0),o.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,i=e.dom.baseEl,n=e.dom.elWrap,s=this._annoList(t.type)[t.index];if(!i||!n||!s)return;const r=i.querySelector(".apexcharts-"+t.type+"-annotation-label."+s.id)||i.querySelector("."+s.id);if(!r)return;const a=n.getBoundingClientRect(),o=r.getBoundingClientRect(),l=t.card.offsetWidth,c=t.card.offsetHeight;let h=Math.round(o.left-a.left),d=Math.round(o.bottom-a.top)+8;d+c>n.clientHeight-4&&(d=Math.round(o.top-a.top)-c-8),h+l>n.clientWidth-4&&(h=n.clientWidth-l-4),t.card.style.left=Math.max(4,h)+"px",t.card.style.top=Math.max(4,d)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const i=e.label&&e.label.style||{},n=String(i.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===n)});const s=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===s)});const r=t.card.querySelector(".apexcharts-ink-btn--bold");r&&r.classList.toggle("apexcharts-ink-btn--active",ln._isBold(i));const a=e.marker||{},o=t.card.querySelector(".apexcharts-ink-marker-size");o&&(o.textContent=String("number"==typeof a.size?a.size:4));const l=t.card.querySelector(".apexcharts-ink-btn--shape");l&&(l.textContent=an[a.shape]||an.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const i=t.input.value;e.label||(e.label={}),e.label.text!==i&&(e.label.text=i,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const i=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;i&&(i.removeEventListener("mousedown",this._onDocDownEditor,!0),i.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const i=this._editor;if(!i)return;const n=this._annoList(i.type)[i.index];n&&(this._commitTextOf(i),n.label||(n.label={}),n.label.style||(n.label.style={}),e(n),this._redrawAnno(i.type,n,i.index),this._checkpoint(t),this._fireStyled(i.type,n,i.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const i=ln._isLight(t);this._applyStyle("ink:style",n=>{n.label.style.background=t,n.label.style.color=i?"#334155":"#ffffff",n.label.borderColor=i?"#cbd5e1":t,"point"===e.type&&(n.marker||(n.marker={}),n.marker.strokeColor=i?"#334155":t,n.marker.fillColor=i?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const i=parseFloat(e.label.style.fontSize)||11;let n=0;for(let t=1;t<sn.length;t++)Math.abs(sn[t]-i)<Math.abs(sn[n]-i)&&(n=t);n=Math.min(sn.length-1,Math.max(0,n+t)),e.label.style.fontSize=sn[n]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=ln._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const i="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,i+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=rn.indexOf(t.marker.shape);t.marker.shape=rn[(e+1)%rn.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),i=e[t.index];if(this._closeEditor(!1),!i)return;const n=this.w.dom.baseEl;n&&i.id&&n.querySelectorAll("."+i.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let i=t.index;i<e.length;i++)this._redrawAnno(t.type,e[i],i);this._checkpoint("ink:delete"),this._fireDeleted(t.type,i,t.index)}_fireEdited(t,e,i){const n={type:t,id:e.id,index:i,text:e.label?e.label.text:""};this._fireAnnotationEvent("annotationEdited",n)}_fireStyled(t,e,i){const n={type:t,id:e.id,index:i,label:e.label,marker:e.marker};this._fireAnnotationEvent("annotationStyled",n)}_fireDeleted(t,e,i){const n={type:t,id:e.id,index:i};this._fireAnnotationEvent("annotationDeleted",n)}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,i,n;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onRerender),this._wired=!1)}}g.default.registerFeatures({ink:ln});const cn="https://apexcharts.com/pricing",hn="__apexcharts_license_enforcer_v1__";globalThis[hn]||(globalThis[hn]={perspectivesTokenDecoded:!1,enforced:new Set});const dn=globalThis[hn],un=dn.enforced;function pn(){dn.perspectivesTokenDecoded=!0,xn()}const fn=new Set(["premium","enterprise"]);function gn(t,e){const i=pt.add(e,{manage:!1});if(!i||"undefined"==typeof MutationObserver)return;if(t._wmNodeObserver&&t._wmObservedNode===i)return;t._wmNodeObserver&&t._wmNodeObserver.disconnect();const n=new MutationObserver(()=>{const t=pt.node(e);t&&(n.disconnect(),pt.applyStyles(t),n.takeRecords(),n.observe(t,{attributes:!0,attributeFilter:["style"]}))});n.observe(i,{attributes:!0,attributeFilter:["style"]}),t._wmNodeObserver=n,t._wmObservedNode=i}function mn(t,e){t._wmWrapObserver&&(t._wmWrapObserver.disconnect(),t._wmWrapObserver=null),t._wmNodeObserver&&(t._wmNodeObserver.disconnect(),t._wmNodeObserver=null),t._wmObservedNode=null,t._wmObservedWrap=null;const i=e||t.w&&t.w.dom&&t.w.dom.elWrap;i&&pt.remove(i,{manage:!1})}function yn(t,e){try{if(!M.isBrowser())return;if(t&&t.globals&&t.globals.isDestroyed)return void un.delete(e);const i=t&&t.dom&&t.dom.elWrap;if(!i)return;const n=function(t,e){var i;const n=t&&t.config&&t.config.chart||{},s=[];"unit"===n.type&&s.push("unit"),"raincloud"===n.requestedType&&s.push("raincloud"),e.trellis&&"function"==typeof e.trellis.isActive&&e.trellis.isActive()&&s.push("trellis"),e.storyboard&&e.storyboard._used&&s.push("storyboard");const r=n.link;return e.linkedViews&&r&&(!0===r.enabled||"function"==typeof r.dimension)&&s.push("link"),e.ink&&n.ink&&!0===n.ink.enabled&&s.push("ink"),e.measure&&n.measure&&!0===n.measure.enabled&&s.push("measure"),e.contextMenu&&n.contextMenu&&!0===n.contextMenu.enabled&&s.push("context-menu"),e.perspectives&&(e.perspectives._used||dn.perspectivesTokenDecoded)&&s.push("perspectives"),e.history&&n.history&&!0===n.history.enabled&&s.push("history"),(null==(i=e._highlightFilter)?void 0:i.isActive())&&s.push("highlight-filter"),s}(t,e);if(0===n.length)return un.delete(e),void mn(e,i);un.add(e);const s=function(t){const e=t&&t.config&&t.config.chart&&t.config.chart.license;if(e)return e;const i=lt.getKey();if(i)return i;const n=M.getApex();return n&&n.license?n.license:null}(t);if(function(t){if(!t)return!1;const e=lt.validateKey(t);if(!e.valid)return!1;const i=e.data&&e.data.plan;return"string"==typeof i&&fn.has(i.toLowerCase())}(s))return void mn(e,i);!function(t,e){if(gn(t,e),"undefined"==typeof MutationObserver)return;if(t._wmWrapObserver&&t._wmObservedWrap===e)return;t._wmWrapObserver&&t._wmWrapObserver.disconnect();const i=new MutationObserver(()=>{pt.node(e)||gn(t,e)});i.observe(e,{childList:!0}),t._wmWrapObserver=i,t._wmObservedWrap=e}(e,i),function(t,e,i){if(t._premiumLicenseNotified)return;t._premiumLicenseNotified=!0;const n=i.length>1;if(!e)return void console.warn(`[ApexCharts] Premium feature${n?"s":""} in use (${i.join(", ")}) without a license. Running in trial mode with a watermark. Get a license: ${cn}`);const s=lt.validateKey(e);if(s.valid){const t=s.data&&s.data.plan||"current";return void console.warn(`[ApexCharts] Premium feature${n?"s":""} in use (${i.join(", ")}) require a Premium or Enterprise license; the ${t} plan does not include ${n?"them":"it"}. Running in trial mode with a watermark. Upgrade: ${cn}`)}e!==lt.getKey()&&console.error(`[Apex] ${s.message}`)}(e,s,n)}catch(t){}}function xn(){if(!M.isBrowser())return;const t=new Set,e=M.getApex(),i=e&&e._chartInstances;Array.isArray(i)&&i.forEach(e=>{const i=e&&e.chart;i&&i.w&&!i.w.globals.isDestroyed&&(t.add(i),yn(i.w,i))}),Array.from(un).forEach(e=>{const i=e&&e.w,n=i&&i.dom&&i.dom.elWrap;i&&!i.globals.isDestroyed&&n&&!1!==n.isConnected?t.has(e)||yn(i,e):un.delete(e)})}lt.onChange(xn);const _n="apex";function bn(t){return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf-8").toString("base64");const e=(new TextEncoder).encode(t);let i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return btoa(i)}(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function vn(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf-8");const e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return(new TextDecoder).decode(i)}(e)}class wn{constructor(t,e){this.w=t,this.ctx=e,this._saved=[],this._counter=0,this._used=!1}capture(){const t={v:1,view:$i(this.w,this.ctx)},e=this._serializableDelta();return e&&Object.keys(e).length&&(t.options=e),t}_serializableDelta(){const t=this.w.config,e=t.chart&&t.chart.perspectives&&t.chart.perspectives.serializeOptions||["theme","xaxis","yaxis","title","subtitle"],i={};return e.forEach(e=>{if(void 0!==t[e]){const n=function(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return}}(t[e]);void 0!==n&&(i[e]=n)}}),i}encode(t){const e=t||this.capture();return bn(JSON.stringify(e))}decode(t){return wn.decode(t)}toURL(){if(!M.isBrowser())return"";const t=this.encode(this.capture()),e=new URL(window.location.href);return e.hash=`${_n}=${t}`,e.toString()}apply(t,e={}){const i="string"==typeof t?wn.decode(t):t;if(!i||!i.view)return;this._used=!0,yn(this.w,this.ctx);const n=void 0===e.animate||e.animate,s=I.extend(i.options?I.clone(i.options):{},e.mergeOptions||{}),r=Object.keys(s).length?s:void 0;(this.w.config.chart.group?this.ctx.getSyncedCharts():[this.ctx]).forEach(t=>{!function(t,e,{animate:i=!0,mergeOptions:n}={}){var s,r;if(!t||!e)return;"number"==typeof e.v&&e.v>1&&console.warn(`[apexcharts] ViewState v${e.v} is newer than this build understands (v1); applying best-effort.`),t.clearAnnotations();const a=n?I.clone(n):{},o=e.window&&e.window.xaxis;a.xaxis=Object.assign({},a.xaxis,o?{min:null!=(s=o.min)?s:void 0,max:null!=(r=o.max)?r:void 0}:{min:void 0,max:void 0});const l=e.window&&e.window.yaxis;if(Array.isArray(l)&&(a.yaxis=l.map(t=>{var e,i;return t?{min:null!=(e=t.min)?e:void 0,max:null!=(i=t.max)?i:void 0}:{}})),e.theme){const t={};null!=e.theme.mode&&(t.mode=e.theme.mode),null!=e.theme.palette&&(t.palette=e.theme.palette),Object.keys(t).length&&(a.theme=Object.assign({},a.theme,t))}e.annotations&&e.annotations.static&&(a.annotations=I.clone(e.annotations.static)),t.updateOptions(a,!1,i,!1,!1),Ii(t,e)}(t,i.view,{animate:n,mergeOptions:r})})}save(t){const e="perspective-"+ ++this._counter;return this._saved.push({id:e,name:t||e,token:this.capture()}),this._used=!0,yn(this.w,this.ctx),e}list(){return this._saved.map(t=>({id:t.id,name:t.name,token:t.token}))}delete(t){const e=this._saved.findIndex(e=>e.id===t);e>-1&&this._saved.splice(e,1)}teardown(){this._saved=[],this._counter=0}static decode(t){if("string"!=typeof t||!t)return null;try{const e=JSON.parse(vn(t));return e&&"object"==typeof e?1!==e.v?(console.warn(`apexcharts: unsupported perspective version ${e.v} (expected 1).`),null):e:null}catch(t){return console.warn("apexcharts: failed to decode perspective token.",t),null}}static fromURL(t){try{const e=t||(M.isBrowser()?window.location.href:"");if(!e)return null;const i=new URL(e).hash.replace(/^#/,"");if(!i)return null;const n=i.split("&").map(t=>t.split("=")).find(t=>t[0]===_n);return n&&null!=n[1]?wn.decode(decodeURIComponent(n[1])):null}catch(t){return null}}}g.default.registerFeatures({perspectives:wn,perspectivesStatics:{decode:t=>(pn(),wn.decode(t)),fromURL:t=>(pn(),wn.fromURL(t))}}),g.default.registerFeatures({storyboard:class{constructor(t,e){this.w=t,this.ctx=e,this._beats=[],this._observer=null,this._activeIndex=-1,this._animate=!0,this._warnedNoPerspectives=!1,this._used=!1}bind(t={}){var e;if(this.unbind(),!M.isBrowser())return 0;const i=this.ctx.el&&this.ctx.el.ownerDocument;if(!i||"undefined"==typeof IntersectionObserver)return 0;let n=null;if(t.scroller&&(n="string"==typeof t.scroller?i.querySelector(t.scroller):t.scroller),this._beats=this._resolveBeats(i,n,t.beats),!this._beats.length)return 0;this._animate=!1!==t.animate;const s=Math.min(Math.max(null!=(e=t.offset)?e:.5,0),1),r=+(100*s).toFixed(3),a=+(100-100*s).toFixed(3);return this._observer=new IntersectionObserver(t=>this._onIntersect(t),{root:n,rootMargin:`-${r}% 0px -${a}%`,threshold:0}),this._beats.forEach(t=>{var e;return null==(e=this._observer)?void 0:e.observe(t.el)}),this._used=!0,yn(this.w,this.ctx),this._beats.length}_resolveBeats(t,e,i){const n=[];if(Array.isArray(i))return i.forEach((e,i)=>{var s,r;if(!e)return;const a=e.el&&"object"==typeof e.el?e.el:e.selector?t.querySelector(e.selector):null;a?n.push({el:a,key:null!=(r=null!=(s=e.key)?s:a.getAttribute("data-apex-beat"))?r:String(i),view:e.view,options:e.options,announce:e.announce,onEnter:"function"==typeof e.onEnter?e.onEnter:void 0}):console.warn(`apexcharts: storyboard beat ${i} has no resolvable element; skipped.`)}),n;return(e||t).querySelectorAll("[data-apex-beat]").forEach((t,e)=>{n.push({el:t,key:t.getAttribute("data-apex-beat")||String(e),view:t.getAttribute("data-apex-view")||void 0,options:void 0,announce:t.getAttribute("data-apex-announce")||void 0,onEnter:void 0})}),n}_onIntersect(t){t.forEach(t=>{const e=this._beats.findIndex(e=>e.el===t.target);e<0||(t.isIntersecting?this._activate(e):e===this._activeIndex&&t.rootBounds&&t.boundingClientRect.top>=t.rootBounds.bottom&&e>0&&this._activate(e-1))})}_activate(t,e={}){var i,n;if(t===this._activeIndex)return;const s=this._beats[t];if(!s)return;const r=t>this._activeIndex?"down":"up";this._activeIndex=t;const a=(void 0!==e.animate?e.animate:this._animate)&&!w();if(null!=s.view||s.options)if(this.ctx.perspectives){const t=null!=(i=s.view)?i:{},e="string"==typeof t||t.view?t:{view:this._normalizeView(t)};this.ctx.perspectives.apply(e,{animate:a,mergeOptions:s.options})}else this._warnedNoPerspectives||(this._warnedNoPerspectives=!0,console.warn('apexcharts: storyboard beats carry views but the perspectives feature is not bundled. import "apexcharts/features/storyboard" (which includes it) or drive beats via onEnter.'));const o={index:t,key:s.key,el:s.el,direction:r};s.onEnter&&s.onEnter(this.ctx,o),s.announce&&this._announce(s.announce),"function"==typeof this.w.config.chart.events.beatChange&&this.w.config.chart.events.beatChange(this.ctx,o),null==(n=this.ctx.events)||n.fireEvent("beatChange",[this.ctx,o])}_normalizeView(t){const e=t.annotations&&t.annotations.static||{};return l(o({},t),{annotations:{static:o({points:[],xaxis:[],yaxis:[],texts:[],images:[]},e),dynamic:t.annotations&&t.annotations.dynamic||[]}})}goTo(t,e={}){const i="number"==typeof t?t:this._beats.findIndex(e=>e.key===t);i>=0&&i<this._beats.length&&this._activate(i,e)}current(){if(this._activeIndex<0)return null;const t=this._beats[this._activeIndex];return{index:this._activeIndex,key:t?t.key:null}}unbind(){this._observer&&(this._observer.disconnect(),this._observer=null),this._beats=[],this._activeIndex=-1,this._used=!1,yn(this.w,this.ctx)}teardown(){this.unbind()}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const n=i.querySelector(".apexcharts-sr-status");n&&(n.textContent="",setTimeout(()=>{n.textContent=t},0))}}});const An={fill:"fill",stroke:"stroke","stroke-width":"strokeWidth","stroke-dasharray":"strokeDash","stroke-linecap":"lineCap","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","fill-rule":"fillRule"},Mn=Symbol("never");const kn={circle:0,square:1,rect:1,triangle:2,diamond:3,star:4,sparkle:5,cross:6,plus:7,line:8},Ln=["circle","square","triangle","diamond","star","sparkle","cross","plus","line"];function Sn(t){return t.boxOf!==t.d&&(t.box=function(t){const e="string"==typeof t?t.match(/[a-df-z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi):null;if(!e)return null;let i=1/0,n=1/0,s=-1/0,r=-1/0,a=0,o=0,l=0,c=0,h="",d=0;const u=()=>Number(e[d++]),p=(t,e)=>{isFinite(t)&&isFinite(e)&&(i=Math.min(i,t),n=Math.min(n,e),s=Math.max(s,t),r=Math.max(r,e))},f=t=>{const e=h===h.toLowerCase();let i=a,n=o;for(let s=0;s<t;s++)i=u()+(e?a:0),n=u()+(e?o:0),p(i,n);a=i,o=n};for(;d<e.length;){if(/^[a-z]$/i.test(e[d])){h=e[d++],"Z"!==h&&"z"!==h||(a=l,o=c);continue}const t=h===h.toLowerCase();switch(h.toUpperCase()){case"M":f(1),l=a,c=o,h=t?"l":"L";break;case"L":case"T":f(1);break;case"H":a=u()+(t?a:0),p(a,o);break;case"V":o=u()+(t?o:0),p(a,o);break;case"S":case"Q":f(2);break;case"C":f(3);break;case"A":d+=5,f(1);break;default:d++}}return isFinite(i)?{x:i,y:n,width:s-i,height:r-n}:null}(t.d),t.boxOf=t.d),t.box}const Cn={attr:()=>Cn,plot:()=>Cn,during:()=>Cn,after:t=>("function"==typeof t&&t(),Cn),animate:()=>Cn,delay:()=>Cn,loop:()=>Cn,finish:()=>Cn,stop:()=>Cn},En={nodeName:"path",style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},Fn={__isCanvasMark:!0,node:{nodeName:"g",instance:null,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},attr:()=>Fn,add:()=>Fn,addTo:()=>Fn,remove:()=>Fn,clear:()=>Fn,css:()=>Fn,hide:()=>Fn,show:()=>Fn,removeClass:()=>Fn,animate:()=>Cn};class Dn{constructor(t,e){this.__isCanvasMark=!0,this._g=t,this._i=e}get node(){return En}attr(t,e){return"string"==typeof t?("fill"===t&&void 0!==e?this._g._setMarkerFill(this._i,e):"rel"===t&&void 0!==e&&(this._g._mdi[this._i]=e),void 0===e?null:this):(t&&void 0!==t.fill&&this._g._setMarkerFill(this._i,t.fill),t&&void 0!==t.rel&&(this._g._mdi[this._i]=t.rel),this)}add(t){return this}addTo(t){return this}remove(){return this}css(t){return this}fill(t){return void 0!==t&&this._g._setMarkerFill(this._i,t),this}stroke(t){return this}hide(){return this}show(){return this}removeClass(t){return this}animate(){return Cn}}const Pn={__isCanvasMark:!0,node:En,attr:()=>Pn,add:()=>Pn,addTo:()=>Pn,remove:()=>Pn,css:()=>Pn,animate:()=>Cn};class Rn{constructor(t){this.__isCanvasMark=!0,this._cmd=t;const e=this;this.node={nodeName:t?t.tag:"g",instance:this,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(t,i){e._applyAttr(t,i)},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>e.bbox()}}_applyAttr(t,e){const i=this._cmd;if(!i)return;if("clip-path"===t){const t=function(t){if(null==t||"none"===t)return null;const e=/^url\(#gridRect(Bar|Marker)?Mask/.exec(String(t));return e?"Bar"===e[1]?"bar":"Marker"===e[1]?"marker":"grid":void 0}(e);return void(void 0!==t&&(i.clip=t))}const n=An[t];void 0!==n&&(i[n]=e)}attr(t,e){if("string"==typeof t)return void 0===e?null:(this._applyAttr(t,e),this);for(const e in t)void 0!==t[e]&&this._applyAttr(e,t[e]);return this}add(t){return this}addTo(t){return this}remove(){return this}clear(){return this}css(t){return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),this):this.attr("stroke",t)}plot(t){return"string"==typeof t&&this._cmd&&"path"===this._cmd.tag&&(this._cmd.d=t),this}hide(){return this}show(){return this}removeClass(t){return this}bbox(){const t=this._cmd,e=t&&"path"===t.tag?Sn(t):null;return e?o({},e):{x:0,y:0,width:0,height:0}}animate(){return Cn}}class Tn{constructor(t){this.w=t,this._g=new _(t),this._list=[],this._mx=new Float64Array(16),this._my=new Float64Array(16),this._msize=new Float64Array(16),this._mshape=new Int16Array(16),this._mstyle=new Int32Array(16),this._msi=new Int32Array(16),this._mdi=new Int32Array(16),this._mn=0,this._mcap=16,this._crx=new Float64Array(16),this._cry=new Float64Array(16),this._crw=new Float64Array(16),this._crh=new Float64Array(16),this._crstyle=new Int32Array(16),this._crsi=new Int32Array(16),this._crdi=new Int32Array(16),this._crn=0,this._crcap=16,this._cellRadius=0,this._styles=[],this._styleMap=new Map,this._lf=Mn,this._ls=Mn,this._lsw=Mn,this._ld=Mn,this._lfo=Mn,this._lso=Mn,this._lid=-1,this._lofFill=Mn,this._lofBase=-1,this._lofId=-1,this._rlf=Mn,this._rls=Mn,this._rlsw=Mn,this._rlfo=Mn,this._rlso=Mn,this._rlid=-1}_resetStyleCache(){this._lf=Mn,this._ls=Mn,this._lsw=Mn,this._ld=Mn,this._lfo=Mn,this._lso=Mn,this._lid=-1,this._lofFill=Mn,this._lofBase=-1,this._lofId=-1,this._rlf=Mn,this._rls=Mn,this._rlsw=Mn,this._rlfo=Mn,this._rlso=Mn,this._rlid=-1}reset(){this._list=[],this._mn=0,this._styles=[],this._styleMap=new Map,this._resetStyleCache();const t=this.w.config.series||[];let e=16;for(let i=0;i<t.length;i++){const n=t[i]&&t[i].data;Array.isArray(n)&&(e+=n.length)}e=Math.ceil(1.15*e)+16,e>this._mcap&&this._allocMarkers(e),this._crn=0,this._cellRadius=0,e>this._crcap&&this._allocRects(e)}_allocRects(t){this._crcap=t,this._crx=new Float64Array(t),this._cry=new Float64Array(t),this._crw=new Float64Array(t),this._crh=new Float64Array(t),this._crstyle=new Int32Array(t),this._crsi=new Int32Array(t),this._crdi=new Int32Array(t)}_growRects(){const t=2*this._crcap,e=new Float64Array(t);e.set(this._crx),this._crx=e;const i=new Float64Array(t);i.set(this._cry),this._cry=i;const n=new Float64Array(t);n.set(this._crw),this._crw=n;const s=new Float64Array(t);s.set(this._crh),this._crh=s;const r=new Int32Array(t);r.set(this._crstyle),this._crstyle=r;const a=new Int32Array(t);a.set(this._crsi),this._crsi=a;const o=new Int32Array(t);o.set(this._crdi),this._crdi=o,this._crcap=t}_allocMarkers(t){this._mcap=t,this._mx=new Float64Array(t),this._my=new Float64Array(t),this._msize=new Float64Array(t),this._mshape=new Int16Array(t),this._mstyle=new Int32Array(t),this._msi=new Int32Array(t),this._mdi=new Int32Array(t)}_growMarkers(){const t=2*this._mcap,e=new Float64Array(t);e.set(this._mx),this._mx=e;const i=new Float64Array(t);i.set(this._my),this._my=i;const n=new Float64Array(t);n.set(this._msize),this._msize=n;const s=new Int16Array(t);s.set(this._mshape),this._mshape=s;const r=new Int32Array(t);r.set(this._mstyle),this._mstyle=r;const a=new Int32Array(t);a.set(this._msi),this._msi=a;const o=new Int32Array(t);o.set(this._mdi),this._mdi=o,this._mcap=t}displayList(){return this._list}markerCount(){return this._mn}_internStyle(t,e,i,n,s,r){const a=`${t}|${e}|${i}|${n}|${s}|${r}`,o=this._styleMap.get(a);if(void 0!==o)return o;const l=this._styles.length;return this._styles.push({fill:t,stroke:e,strokeWidth:i,strokeDash:n,fillOpacity:s,strokeOpacity:r}),this._styleMap.set(a,l),l}_setMarkerFill(t,e){const i=this._mstyle[t];if(e===this._lofFill&&i===this._lofBase)return void(this._mstyle[t]=this._lofId);const n=this._styles[i];if(!n||n.fill===e)return this._lofFill=e,this._lofBase=i,void(this._lofId=i);const s=this._internStyle(e,n.stroke,n.strokeWidth,n.strokeDash,n.fillOpacity,n.strokeOpacity);this._mstyle[t]=s,this._lofFill=e,this._lofBase=i,this._lofId=s}markerStyle(t){return this._styles[this._mstyle[t]]}markerSeries(t){return this._msi[t]}shapeName(t){return Ln[t]||"circle"}drawRectCell(t,e,i,n,s={}){const r=this._rectStyleId(s);this._crn>=this._crcap&&this._growRects();const a=this._crn++;return this._crx[a]=t||0,this._cry[a]=e||0,this._crw[a]=i>0?i:0,this._crh[a]=n>0?n:0,this._crstyle[a]=r,this._crsi[a]=null==s.seriesIndex?-1:s.seriesIndex,this._crdi[a]=null==s.dataPointIndex?-1:s.dataPointIndex,s.radius&&(this._cellRadius=s.radius),Pn}_rectStyleId(t){const e=t.fill,i=t.stroke,n=t.strokeWidth,s=t.fillOpacity,r=t.strokeOpacity;if(e===this._rlf&&i===this._rls&&n===this._rlsw&&s===this._rlfo&&r===this._rlso)return this._rlid;const a=this._internStyle(e,i,n,0,s,r);return this._rlf=e,this._rls=i,this._rlsw=n,this._rlfo=s,this._rlso=r,this._rlid=a,a}rectCount(){return this._crn}rectStyle(t){return this._styles[this._crstyle[t]]}rectSeries(t){return this._crsi[t]}_cmd(t,e){const i={tag:t,z:e||0,fill:void 0,stroke:void 0,strokeWidth:void 0,strokeDash:void 0,lineCap:void 0,fillOpacity:void 0,strokeOpacity:void 0,fillRule:void 0,clip:null};return this._list.push(i),i}group(t){return Fn}drawMarker(t,e,i={}){var n;const s=this._markerStyleId(i);this._mn>=this._mcap&&this._growMarkers();const r=this._mn++;return this._mx[r]=t||0,this._my[r]="number"==typeof e?e:NaN,this._msize[r]=i.pSize||0,this._mshape[r]=null!=(n=kn[i.shape||"circle"])?n:0,this._mstyle[r]=s,this._msi[r]=null==i.seriesIndex?-1:i.seriesIndex,this._mdi[r]=-1,new Dn(this,r)}_markerStyleId(t){const e=t.shape||"circle",i="line"===e||"plus"===e||"cross"===e,n=i?"none":t.pointFillColor,s=i?t.pointFillColor:t.pointStrokeColor,r=t.pointStrokeWidth,a=t.pointStrokeDashArray,o=t.pointFillOpacity,l=i?t.pointFillOpacity:t.pointStrokeOpacity;if(n===this._lf&&s===this._ls&&r===this._lsw&&a===this._ld&&o===this._lfo&&l===this._lso)return this._lid;const c=this._internStyle(n,s,r,a,o,l);return this._lf=n,this._ls=s,this._lsw=r,this._ld=a,this._lfo=o,this._lso=l,this._lid=c,c}renderPaths(t){const e=this._cmd("path",t.realIndex);if(e.d=t.pathTo,t.pathToNumeric&&(e.nxs=t.pathToNumeric.xs,e.nys=t.pathToNumeric.ys,e.ncloseY=t.pathToNumeric.closeY),e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.lineCap=t.strokeLinecap,e.strokeDash=this._g.seriesDash(t.realIndex),e.si=t.realIndex,"number"==typeof t.j&&(e.dj=t.j),!1!==t.shouldClipToGrid){const i=this.w.globals;e.clip="bar"===t.chartType&&!i.isBarHorizontal||i.comboCharts?"bar":"grid"}return this.w.globals.animationEnded=!0,new Rn(e)}drawPath(t){const e=this._cmd("path",0);return e.d=t.d,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.strokeOpacity=t.strokeOpacity,e.lineCap=t.strokeLinecap,e.strokeDash=t.strokeDashArray,new Rn(e)}drawLine(t,e,i,n,s="#a8a8a8",r=0,a=1){const o=this._cmd("line",0);return o.lx1=t,o.ly1=e,o.lx2=i,o.ly2=n,o.stroke=s,o.strokeDash=r,o.strokeWidth=a,new Rn(o)}drawRect(t=0,e=0,i=0,n=0,s=0,r="#fefefe",a=1,o=null,l=null,c=0){const h=this._cmd("rect",0);return h.x1=t,h.y1=e,h.rw=i>0?i:0,h.rh=n>0?n:0,h.radius=s,h.fill=r,h.fillOpacity=a,null!=l&&(h.stroke=l,h.strokeWidth=null==o?1:o,h.strokeDash=c),new Rn(h)}drawCircle(t,e=null){const i=this._cmd("circle",0);return i.r=t<0?0:t,e&&(i.cx=e.cx,i.cy=e.cy,void 0!==e.fill&&(i.fill=e.fill),void 0!==e.stroke&&(i.stroke=e.stroke)),new Rn(i)}drawText(t){const e=this._cmd("text",0);return e.text=Array.isArray(t.text)?t.text.join(" "):t.text,e.tx=t.x,e.ty=t.y,e.textAnchor=t.textAnchor||"start",e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.foreColor,new Rn(e)}markerPath(t,e,i,n){return this._g.getMarkerPath(t,e,Ln[i]||"circle",n)}}const Nn=g.__apex_SVGElement,On=g.__apex_math_SVGNS,$n=g.__apex_axes_Grid,In=2*Math.PI;class Bn{constructor(t){this.w=t,this._host=null,this._canvas=null,this._c2d=null,this._pad={left:0,top:0,right:0,bottom:0},this._clips=null,this._clipRect=null,this._dpr=1,this._dim=null,this._alpha=1,this._unitPaths=new Map,this._markerBatches=0}markerBatchCount(){return this._markerBatches}_seriesAlpha(t){const e=this._dim;return!e||null==e.active||e.active<0||null==t||t<0||t===e.active?1:null==e.opacity?.2:e.opacity}_plotDims(){var t;const e=Math.max(0,Math.ceil(this.w.layout.gridWidth||0)),i=Math.max(0,Math.ceil(this.w.layout.gridHeight||0)),n=(null==(t=this.w.globals.markers)?void 0:t.largestSize)||0,s=Math.ceil(n+8),r=$n.maskRects(this.w),a={left:s,top:s,right:s,bottom:s},o=t=>Number.isFinite(t)?Math.ceil(t):0;return Object.values(r).forEach(t=>{a.left=Math.max(a.left,o(-t.x)),a.top=Math.max(a.top,o(-t.y)),a.right=Math.max(a.right,o(t.x+t.width-e)),a.bottom=Math.max(a.bottom,o(t.y+t.height-i))}),{gw:e,gh:i,pad:a,clips:r}}createHost(){const t=A.getWindow();this._dpr=Math.min(2,t&&t.devicePixelRatio||1);const{gw:e,gh:i,pad:n,clips:s}=this._plotDims();this._pad=n,this._clips=s;const r=e+n.left+n.right,a=i+n.top+n.bottom,o=A.createElementNS(On,"foreignObject");o.setAttribute("x",String(-n.left)),o.setAttribute("y",String(-n.top)),o.setAttribute("width",String(r)),o.setAttribute("height",String(a)),o.setAttribute("class","apexcharts-canvas-series"),o.style.overflow="visible";const l=A.createElement("canvas");return l.setAttribute("class","apexcharts-series-canvas"),l.width=Math.max(1,Math.round(r*this._dpr)),l.height=Math.max(1,Math.round(a*this._dpr)),l.style.width=r+"px",l.style.height=a+"px",l.style.pointerEvents="none",o.appendChild(l),this._canvas=l,this._c2d=l.getContext("2d"),this._host=new Nn(o),this._host}getHost(){return this._host}clipRect(t){const e=t&&this._clips?this._clips[t]:null;return e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.width)&&Number.isFinite(e.height)?e:null}_clipTo(t,e){const i=this.clipRect(e);if(i!==this._clipRect&&(this._clipRect&&t.restore(),this._clipRect=i,i)){const e=this._dpr,{left:n,top:s}=this._pad,r=Math.floor((n+i.x)*e),a=Math.floor((s+i.y)*e),o=Math.ceil((n+i.x+i.width)*e),l=Math.ceil((s+i.y+i.height)*e);t.save(),t.setTransform(1,0,0,1,0,0),t.beginPath(),t.rect(r,a,o-r,l-a),t.clip(),t.setTransform(e,0,0,e,n*e,s*e)}}clear(){this._c2d&&this._canvas&&(this._c2d.setTransform(1,0,0,1,0,0),this._c2d.clearRect(0,0,this._canvas.width,this._canvas.height))}_syncDpr(){if(!this._canvas)return;const t=A.getWindow(),e=Math.min(2,t&&t.devicePixelRatio||1);if(e===this._dpr)return;this._dpr=e;const i=parseFloat(this._canvas.style.width)||0,n=parseFloat(this._canvas.style.height)||0;this._canvas.width=Math.max(1,Math.round(i*e)),this._canvas.height=Math.max(1,Math.round(n*e))}paint(t,e,i=null){const n=this._c2d;if(!n)return;this._dim=i||null,this._syncDpr(),this.clear();const s=this._dpr,{left:r,top:a}=this._pad;if(n.setTransform(s,0,0,s,r*s,a*s),this._clipRect=null,t.length){const e=t.length>1?t.map((t,e)=>[t,e]).sort((t,e)=>t[0].z===e[0].z?t[1]-e[1]:t[0].z-e[0].z).map(t=>t[0]):t;for(let t=0;t<e.length;t++){const i=e[t];this._alpha=this._dim?this._seriesAlpha(i.si):1,this._clipTo(n,i.clip),this._paintOne(n,i)}this._clipTo(n,null)}this._paintRects(n,e),this._clipTo(n,"marker"),this._paintMarkers(n,e),this._clipTo(n,null),this._alpha=1}_paintRects(t,e){const i=e.rectCount?e.rectCount():0;if(!i)return;const n=e._crx,s=e._cry,r=e._crw,a=e._crh,o=e._crstyle,l=e._cellRadius||0,c=t,h=l>0&&"function"==typeof c.roundRect,d=!!this._dim,u=Math.max(0,this.w.layout.gridWidth||0),p=Math.max(0,this.w.layout.gridHeight||0);t.save(),t.beginPath(),t.rect(0,0,u,p),t.clip();let f=0;for(;f<i;){const u=o[f],p=e.rectStyle(f);if(!p){f++;continue}const g=p.fill,m=g&&"none"!==g&&!("string"==typeof g&&0===g.indexOf("url(")),y=p.stroke,x=null==p.strokeWidth?0:Number(p.strokeWidth),_=y&&"none"!==y&&x>0&&!("string"==typeof y&&0===y.indexOf("url("));m&&(t.fillStyle=g),_&&(t.strokeStyle=y,t.lineWidth=x,t.setLineDash([]));const b=null==p.fillOpacity?1:Number(p.fillOpacity),v=null==p.strokeOpacity?1:Number(p.strokeOpacity);let w=f;for(;w<i&&o[w]===u;){const i=r[w],o=a[w];if(i>0&&o>0){const r=d?this._seriesAlpha(e.rectSeries(w)):1;h?(t.beginPath(),c.roundRect(n[w],s[w],i,o,l),m&&(t.globalAlpha=b*r,t.fill()),_&&(t.globalAlpha=v*r,t.stroke())):(m&&(t.globalAlpha=b*r,t.fillRect(n[w],s[w],i,o)),_&&(t.globalAlpha=v*r,t.strokeRect(n[w],s[w],i,o)))}w++}f=w}t.globalAlpha=1,t.restore()}_unitPath(t,e,i){const n=e+"|"+i;let s=this._unitPaths.get(n);if(void 0===s){try{s=new Path2D(t.markerPath(0,0,e,i))}catch(t){s=null}this._unitPaths.set(n,s)}return s}_paintMarkers(t,e){this._markerBatches=0;const i=e.markerCount();if(!i)return;const n=e._mx,s=e._my,r=e._msize,a=e._mshape,o=e._mstyle,l=!!this._dim;l||(this._alpha=1);let c=0;for(;c<i;){const h=o[c],d=a[c],u=e.markerStyle(c);if(!u){c++;continue}const p=this._applyFill(t,u),f=this._applyStroke(t,u);this._markerBatches++;const g=null==u.fillOpacity?1:Number(u.fillOpacity),m=null==u.strokeOpacity?1:Number(u.strokeOpacity);if(0===d){let d=c;for(;d<i&&0===a[d]&&o[d]===h;){const i=r[d]||0,a=s[d];if(i>0&&a==a)if(t.beginPath(),t.arc(n[d],a,i,0,In),l){const i=this._seriesAlpha(e.markerSeries(d));p&&(t.globalAlpha=g*i,t.fill()),f&&(t.globalAlpha=m*i,t.stroke())}else p&&t.fill(),f&&t.stroke();d++}t.globalAlpha=1,c=d}else{const u=this._dpr,y=this._pad.left,x=this._pad.top;let _=c;for(;_<i&&a[_]===d&&o[_]===h;){const i=s[_],a=r[_];if(i==i&&a>0){const s=this._unitPath(e,d,a);if(s){t.setTransform(u,0,0,u,(y+n[_])*u,(x+i)*u);const r=l?this._seriesAlpha(e.markerSeries(_)):1;p&&(t.globalAlpha=g*r,t.fill(s)),f&&(t.globalAlpha=m*r,t.stroke(s))}}_++}t.setTransform(u,0,0,u,y*u,x*u),t.globalAlpha=1,c=_}}}_paintNumericPath(t,e){const i=e.nxs,n=e.nys,s=i.length;if(s){t.beginPath(),t.moveTo(i[0],n[0]);for(let e=1;e<s;e++)t.lineTo(i[e],n[e]);null!=e.ncloseY&&(t.lineTo(i[s-1],e.ncloseY),t.lineTo(i[0],e.ncloseY),t.closePath()),this._applyFill(t,e)&&t.fill("evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}}_paintOne(t,e){switch(e.tag){case"path":if(e.nxs){this._paintNumericPath(t,e);break}if(!e.d)return;if(!e.path2d)try{e.path2d=new Path2D(e.d)}catch(t){return}this._fillStrokePath(t,e,e.path2d);break;case"rect":{const i=new Path2D;e.radius&&"function"==typeof i.roundRect?i.roundRect(e.x1,e.y1,e.rw,e.rh,e.radius):i.rect(e.x1,e.y1,e.rw,e.rh),this._fillStrokePath(t,e,i);break}case"circle":if(!(e.r>0))return;t.beginPath(),t.arc(e.cx,e.cy,e.r,0,In),this._fillStroke(t,e);break;case"line":t.beginPath(),t.moveTo(e.lx1,e.ly1),t.lineTo(e.lx2,e.ly2),this._strokeOnly(t,e);break;case"text":{if(null==e.text)return;t.save(),t.globalAlpha=this._alpha,t.fillStyle=e.fill||"#000";const i=e.fontSize||"11px";t.font=`${"number"==typeof i?i+"px":i} ${e.fontFamily||"Helvetica, Arial, sans-serif"}`,t.textAlign="middle"===e.textAnchor?"center":"end"===e.textAnchor?"right":"left",t.fillText(String(e.text),e.tx,e.ty),t.restore();break}}}_fillStrokePath(t,e,i){this._applyFill(t,e)&&t.fill(i,"evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(i),t.globalAlpha=1}_fillStroke(t,e){this._applyFill(t,e)&&t.fill(),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_strokeOnly(t,e){this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_applyFill(t,e){const i=e.fill;return!(!i||"none"===i)&&(("string"!=typeof i||0!==i.indexOf("url("))&&(t.globalAlpha=(null==e.fillOpacity?1:Number(e.fillOpacity))*this._alpha,t.fillStyle=i,!0))}_applyStroke(t,e){const i=e.stroke,n=null==e.strokeWidth?1:Number(e.strokeWidth);if(!(i&&"none"!==i&&n>0))return!1;if("string"==typeof i&&0===i.indexOf("url("))return!1;t.globalAlpha=(null==e.strokeOpacity?1:Number(e.strokeOpacity))*this._alpha,t.strokeStyle=i,t.lineWidth=n,t.lineCap=e.lineCap||"butt";const s=e.strokeDash;return s&&0!==s?t.setLineDash(Array.isArray(s)?s:[Number(s)]):t.setLineDash([]),!0}toDataURL(){return this._canvas?this._canvas.toDataURL():null}destroy(){this._host=null,this._canvas=null,this._c2d=null,this._clips=null,this._clipRect=null,this._unitPaths.clear()}}class zn{constructor(t,e){this.w=t,this.ctx=e,this.kind="canvas",this._g=new Tn(t),this._compositor=new Bn(t),this._hitCtx=void 0}beginSeries(){this._g.reset()}present(){const t=this._compositor.createHost();return this._compositor.paint(this._g.displayList(),this._g),t}clear(){this._compositor.clear()}canRepaintInPlace(){const t=this._compositor.getHost();return!!(t&&t.node&&t.node.isConnected)}repaintInPlace(){this._compositor.paint(this._g.displayList(),this._g)}group(t){return this._g.group(t)}drawPath(t){return this._g.drawPath(t)}drawLine(...t){return this._g.drawLine(...t)}drawRect(...t){return this._g.drawRect(...t)}drawRectCell(t,e,i,n,s){return this._g.drawRectCell(t,e,i,n,s)}drawCircle(t,e){return this._g.drawCircle(t,e)}drawMarker(t,e,i){return this._g.drawMarker(t,e,i)}renderPaths(t){return this._g.renderPaths(t)}drawText(t){return this._g.drawText(t)}supports(t){return"solidFill"===t||"dashArray"===t}hitTest(t,e){const i=this._g,n=i.rectCount?i.rectCount():0,s=i._crx,r=i._cry,a=i._crw,o=i._crh;for(let l=n-1;l>=0;l--){const n=a[l],c=o[l];if(!(n<=0||c<=0)&&(t>=s[l]&&t<s[l]+n&&e>=r[l]&&e<r[l]+c))return{seriesIndex:i._crsi[l],dataPointIndex:i._crdi[l],x:s[l],y:r[l],width:n,height:c}}return this._hitTestMarks(t,e)}_hitTestMarks(t,e){const i=this._g.displayList();for(let n=i.length-1;n>=0;n--){const s=i[n];if("path"!==s.tag||null==s.dj||!s.d)continue;const r=!!s.fill&&"none"!==s.fill,a=!!s.stroke&&"none"!==s.stroke&&s.strokeWidth>0;if(!r&&!a)continue;const l=this._compositor.clipRect(s.clip);if(l&&(t<l.x||t>l.x+l.width||e<l.y||e>l.y+l.height))continue;const c=Sn(s);if(!c)continue;const h=a?5*s.strokeWidth:0;if(t<c.x-h||t>c.x+c.width+h||e<c.y-h||e>c.y+c.height+h)continue;const d=this._hitContext();if(!d)return null;if(!s.path2d)try{s.path2d=new Path2D(s.d)}catch(t){continue}const u="evenodd"===s.fillRule?"evenodd":"nonzero";let p=r&&d.isPointInPath(s.path2d,t,e,u);if(!p&&a&&(d.lineWidth=s.strokeWidth,d.lineCap=s.lineCap||"butt",p=d.isPointInStroke(s.path2d,t,e)),p)return o({seriesIndex:s.si,dataPointIndex:s.dj},c)}return null}hitTestMarker(t,e){const i=this._g,n=i.markerCount();if(!n)return null;const s=this._compositor.clipRect("marker");if(s&&(t<s.x||t>s.x+s.width||e<s.y||e>s.y+s.height))return null;for(let s=n-1;s>=0;s--){const n=i._msize[s],r=i._mx[s],a=i._my[s],o=i._mdi[s];if(!(n>0)||a!=a||o<0)continue;const l=i.markerStyle(s),c=!!(null==l?void 0:l.stroke)&&"none"!==l.stroke&&l.strokeWidth>0,h=c?l.strokeWidth/2:0,d=1.2*n+h,u=t-r,p=e-a;if(u<-d||u>d||p<-d||p>d)continue;let f;if(f=0===i._mshape[s]?u*u+p*p<=(n+h)*(n+h):this._hitsMarkerShape(s,u,p,n,l,c),f)return{seriesIndex:i._msi[s],dataPointIndex:o,x:r,y:a,size:n}}return null}_hitsMarkerShape(t,e,i,n,s,r){const a=this._hitContext();if(!a)return!1;let o;try{o=new Path2D(this._g.markerPath(0,0,this._g._mshape[t],n))}catch(t){return!1}return!(!(null==s?void 0:s.fill)||"none"===s.fill||!a.isPointInPath(o,e,i))||!!r&&(a.lineWidth=s.strokeWidth,a.lineCap="butt",a.isPointInStroke(o,e,i))}findMark(t,e){const i=this._g.displayList();for(let n=0;n<i.length;n++){const s=i[n];if("path"!==s.tag||!s.d)continue;if(s.si!==t||s.dj!==e)continue;const r=Sn(s);if(r)return l(o({seriesIndex:t,dataPointIndex:e},r),{d:s.d})}return null}findMarker(t,e){const i=this._g;for(let n=i.markerCount()-1;n>=0;n--){if(i._msi[n]!==t||i._mdi[n]!==e)continue;const s=i._msize[n],r=i._my[n];if(!(s>0)||r!=r)continue;const a=i._mx[n];return{seriesIndex:t,dataPointIndex:e,x:a,y:r,size:s,d:i.markerPath(a,r,i._mshape[n],s)}}return null}findCell(t,e){const i=this._g,n=i.rectCount?i.rectCount():0,s=i._crsi,r=i._crdi;for(let a=n-1;a>=0;a--)if(s[a]===t&&r[a]===e)return{seriesIndex:t,dataPointIndex:e,x:i._crx[a],y:i._cry[a],width:i._crw[a],height:i._crh[a],radius:i._cellRadius||0};return null}_hitContext(){if(void 0===this._hitCtx){const t=A.createElement("canvas");this._hitCtx=(null==t?void 0:t.getContext)&&t.getContext("2d")||null}return this._hitCtx}restyle(t){this._compositor.paint(this._g.displayList(),this._g,t||null)}toBitmap(){const t=this._compositor.toDataURL();if(!t)return null;const e=this.w.globals,i=this.w.config.chart,n=this._compositor._pad;return{dataURL:t,x:(e.translateX||0)+(i.offsetX||0)-n.left,y:(e.translateY||0)+(i.offsetY||0)-n.top,w:(this.w.layout.gridWidth||0)+n.left+n.right,h:(this.w.layout.gridHeight||0)+n.top+n.bottom}}destroy(){this._compositor.destroy(),this._hitCtx=void 0}}g.default.registerRenderer("canvas",(t,e)=>new zn(t,e));g.default.registerFeatures({contextMenu:class{constructor(t,e){this.w=t,this.ctx=e,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!M.isBrowser())return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.addEventListener("contextmenu",this._onContext),this._trigger=t)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(t){this._enabled()&&(t.preventDefault(),this.open(t.clientX,t.clientY))}_clientToData(t,e){const i=this.w;if(!i.globals.axisCharts||!i.dom.baseEl||!i.dom.baseEl.querySelector(".apexcharts-svg"))return null;const n=ki.plotRect(i);if(!n.width||!n.height)return null;const s=t=>t<0?0:t>1?1:t,r=s((t-n.left)/n.width),a=s((e-n.top)/n.height),o=i.globals.minX+r*(i.globals.maxX-i.globals.minX),l=i.globals.yAxisScale&&i.globals.yAxisScale[0],c=l&&isFinite(l.niceMin)?l.niceMin:i.globals.minY,h=l&&isFinite(l.niceMax)?l.niceMax:i.globals.maxY;return{x:o,y:h-a*(h-c)}}_resolveItems(t){const e=this._cfg(),i=Array.isArray(e.items)&&e.items.length?e.items:["annotate","xline","yline","measure"],n=e.labels||{},s=[];return i.forEach(e=>{if("string"==typeof e){if("annotate"===e)s.push({id:"annotate",label:n.annotate||"Add note here",run:()=>this._annotate(t)});else if("xline"===e)s.push({id:"xline",label:n.xline||"Annotate here",run:()=>this._line(t,"x")});else if("yline"===e)s.push({id:"yline",label:n.yline||"Mark this level",run:()=>this._line(t,"y")});else if("measure"===e){const e=this.ctx.measure;e&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&s.push({id:"measure",label:n.measure||"Measure from here",run:()=>e.seedFromClient(t.clientX,t.clientY)})}}else e&&"object"==typeof e&&"function"==typeof e.onClick&&s.push({id:e.id||"custom",label:e.label||"Action",run:()=>e.onClick(this.ctx,t)})}),s}_annotate(t){if(null==t.x||null==t.y)return;const e=this._cfg(),i=this.ctx.ink;i&&"function"==typeof i.createAt?i.createAt(t.x,t.y,{text:e.noteText||"Note"}):this.ctx.addPointAnnotation({x:t.x,y:t.y,marker:{size:5},label:{text:e.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(t,e){const i=this._cfg().line||{},n="x"===e?t.x:t.y;if(null==n)return;const s=this.ctx.ink;if(s&&"function"==typeof s.createLineAt)return void s.createLineAt(e,n,{text:i.text,strokeDashArray:i.strokeDashArray,color:i.color});const r={strokeDashArray:null!=i.strokeDashArray?i.strokeDashArray:4};i.text&&(r.label={text:i.text}),i.color&&(r.borderColor=i.color,r.label=I.extend(r.label||{},{borderColor:i.color})),"x"===e?this.ctx.addXaxisAnnotation(I.extend(r,{x:n}),!0):this.ctx.addYaxisAnnotation(I.extend(r,{y:n}),!0)}open(t,e){this.close();const i=this.w,n=i.dom.elWrap,s=this._doc();if(!n||!s)return;const r=this._clientToData(t,e),a=i.globals,o={x:r?r.x:null,y:r?r.y:null,seriesIndex:a.capturedSeriesIndex>=0?a.capturedSeriesIndex:null,dataPointIndex:a.capturedDataPointIndex>=0?a.capturedDataPointIndex:null,clientX:t,clientY:e},l=this._resolveItems(o);if(!l.length)return;this._items=l;const c=s.createElement("div");c.className="apexcharts-context-menu",c.setAttribute("role","menu"),c.style.position="absolute",c.style.visibility="hidden",l.forEach((t,e)=>{const i=s.createElement("button");i.type="button",i.className="apexcharts-context-menu-item",i.setAttribute("role","menuitem"),i.tabIndex=-1,i.textContent=t.label,i.addEventListener("click",t=>{t.stopPropagation(),this._activate(e)}),i.addEventListener("mouseenter",()=>this._focus(e)),c.appendChild(i)}),n.appendChild(c),this.menu=c;const h=n.getBoundingClientRect(),d=ki.plotRect(i).zoom;let u=(t-h.left)/d,p=(e-h.top)/d;const f=c.offsetWidth,g=c.offsetHeight,m=Math.max(0,n.clientWidth-f),y=Math.max(0,n.clientHeight-g);u>m&&(u=m),p>y&&(p=y),c.style.left=Math.max(0,u)+"px",c.style.top=Math.max(0,p)+"px",c.style.visibility="visible",s.addEventListener("mousedown",this._onDocDown,!0),s.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(t){if(!this.menu)return;const e=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&e[this._focusIndex]&&e[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=t,e[t]&&(e[t].classList.add("apexcharts-context-menu-item--active"),"function"==typeof e[t].focus&&e[t].focus())}_activate(t){const e=this._items[t];this.close(),e&&e.run()}_onDocDown(t){this.menu&&this.menu.contains(t.target)||this.close()}_onKey(t){this.menu&&this._items.length&&("Escape"===t.key?(t.preventDefault(),this.close()):"ArrowDown"===t.key?(t.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===t.key?(t.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const t=this._doc();t&&(t.removeEventListener("mousedown",this._onDocDown,!0),t.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}});g.default.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;M.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const i=this.ctx.el;if(!i)return;const n=i.ownerDocument,s=n&&n.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(s))return;if(!i.contains(s)&&!this._engaged)return;const r="y"===e||t.shiftKey;t.preventDefault(),r?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&M.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const i=this._capture(t),n=this.stack[this.pointer];if(!n||n.sig!==i.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(i),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=$i(this.w,this.ctx),{config:i,seriesSig:n}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:i,seriesSig:n,label:t||"change",at:M.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,i)}}_cloneConfigCOW(){const t=this.w,e=this.stack[this.pointer];let i=null;try{i=JSON.stringify(t.config.series)}catch(t){i=null}const n=this.ctx.responsive?this.ctx.responsive.withoutBreakpoints(t.config):t.config;let s;if(e&&null!==i&&e.seriesSig===i){const t=n,{series:i}=t,r=c(t,["series"]);s=I.clone(r),s.series=e.config.series}else s=I.clone(n);return{config:s,seriesSig:i}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let i;this.applying=!0;try{this.ctx.clearAnnotations(),i=this.ctx.updateOptions(I.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(i).then(()=>{this.w.globals.isDestroyed?this.applying=!1:(Ii(this.ctx,t.view),this._refreshSettle(),this._emitChange())}).catch(()=>{this.applying=!1})}_refreshSettle(){M.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const i=this.stack.findIndex(e=>e.id===t);-1!==i&&i!==this.pointer&&(this.pointer=i,this._restore(this.stack[i],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const i=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=i,i||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,i,n,s,r,a,o;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(n=(i=this.ctx).removeEventListener)||n.call(i,"updated",this._onUpdated),null==(r=(s=this.ctx).removeEventListener)||r.call(s,"scrolled",this._onUpdated),null==(o=(a=this.ctx).removeEventListener)||o.call(a,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}});const Wn=g.__apex_DataLabels;const Hn=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function jn(t,e){const{ax:i,bx:n,ay:s,by:r}=e,a=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(Hn)||[]).map(parseFloat);if("Z"===t){a.push("z");continue}if("H"===t){for(const t of e)a.push(`H ${i*t+n}`);continue}if("V"===t){for(const t of e)a.push(`V ${s*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)a.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+n} ${s*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+n} ${s*e[t+1]+r}`);o.length&&a.push(`${t} ${o.join(" ")}`)}return a.join(" ")}const Yn="apexcharts-highlight-part",qn={f:1,o:0},Xn={f:0,o:0},Gn=t=>({f:t,o:t<1?1:0}),Un=t=>"number"==typeof t&&t==t&&t!==1/0&&t!==-1/0,Kn=(t,e,i)=>i>=1?e:t+(e-t)*i,Vn=t=>t&&"object"==typeof t&&!Array.isArray(t),Zn=(t,e="fill-opacity")=>{var i;const n=null==(i=t.instance)?void 0:i._cmd,s=parseFloat(n?n[e.replace("-o","O")]:t.getAttribute(e));return isFinite(s)?s:1};function Qn(t){const e="string"==typeof t?t.trim():"";let i,n=null;return(i=/^rgba\(([^,]+,[^,]+,[^,]+),([^)]+)\)$/i.exec(e))?n=[`rgb(${i[1]})`,parseFloat(i[2])]:(i=/^color-mix\(in srgb, (.+) ([\d.]+)%, transparent\)$/.exec(e))?n=[i[1],parseFloat(i[2])/100]:(i=/^(#[\da-f]{6})([\da-f]{2})$/i.exec(e))&&(n=[i[1],parseInt(i[2],16)/255]),n&&n[1]>0&&n[1]<1?n:[t,1]}function Jn(t,e){const i=null!=t&&e?t/e:null;return{value:null!=t?t:null,total:null!=e?e:null,share:i,overflow:null!=i&&(i<0?"sign":i>1)}}function ts(t){let e=parseFloat(t.getAttribute("x")),i=parseFloat(t.getAttribute("y"));return String(t.getAttribute("transform")||"").replace(/translate\(\s*([^\s,)]+)[\s,]*([^\s,)]*)\s*\)/g,(t,n,s)=>(e+=parseFloat(n)||0,i+=parseFloat(s)||0,"")),[e,i]}const es=["mousemove","mousedown","mouseup","mouseover","mouseout","click","touchstart","touchmove","touchend"];function is(t,e){const i=t._apxHits||(t._apxHits=new Set);if(!t._apxHitStop){t._apxHitStop=!0;const e=t=>{i.has(t.relatedTarget)&&t.stopImmediatePropagation()};["mouseout","mouseleave","mouseover","mouseenter"].forEach(i=>t.addEventListener(i,e,!0))}i.add(e),es.forEach(i=>e.addEventListener(i,e=>{e.stopPropagation();const n="mouseover"===i,s="mouseout"===i;(n||s)&&e.relatedTarget===t||(as(t,i,e),n&&as(t,"mouseenter",e),s&&as(t,"mouseleave",e))},{passive:!0}))}function ns(t,e){const i=()=>{const i=t.getAttribute("filter");i?e.setAttribute("filter",i):e.removeAttribute("filter")};i(),M.isBrowser()&&"undefined"!=typeof MutationObserver&&new MutationObserver(i).observe(t,{attributes:!0,attributeFilter:["filter"]})}function ss(t,e){const i=t.parentNode,n=Array.from(i.childNodes);i.insertBefore(e,n[n.indexOf(t)+1]||null)}const rs=(t,e)=>t.setAttribute("class",`${t.getAttribute("class")||""} ${e}`.trim());function as(t,e,i){try{const n=i.touches?{bubbles:!0,cancelable:!0,touches:Array.from(i.touches),targetTouches:Array.from(i.targetTouches),changedTouches:Array.from(i.changedTouches)}:"mouseenter"===e||"mouseleave"===e?{clientX:i.clientX,clientY:i.clientY,screenX:i.screenX,screenY:i.screenY,relatedTarget:i.relatedTarget,buttons:i.buttons}:i;t.dispatchEvent(new i.constructor(e,n))}catch(t){}}function os(t){if(!Vn(t))return t;const e=t,{highlightData:i,highlight:n}=e,s=c(e,["highlightData","highlight"]);return["data","children"].forEach(t=>{Array.isArray(s[t])&&(s[t]=s[t].map(hs))}),s}function ls(t){const e=[];return(t||[]).forEach(t=>(Vn(t)&&Array.isArray(t.data)?t.data:[]).forEach(t=>{Vn(t)&&void 0!==t.x&&(void 0!==t.y||Array.isArray(t.children))&&e.push(t)})),e}const cs=t=>Vn(t)&&("highlight"in t||"highlightData"in t||[t.data,t.children].some(t=>Array.isArray(t)&&t.some(cs))),hs=t=>Vn(t)&&("highlight"in t||Array.isArray(t.children))?os(t):t;function ds(t,e){if("number"==typeof e)return e;const i=t.config&&t.config.series||[];for(let t=0;t<i.length;t++)if(i[t]&&i[t].name===e)return t;return-1}function us(t){return!!(t&&t.weaveHighlights&&t.weaveHighlights.records.length)}function ps(t,e){if(!us(t))return null;let i=null;for(const n of t.weaveHighlights.records)for(const s of n.entries)ds(t,s.series)===e&&(i=s.values);return i}const fs="p:",gs=["pie","donut","polarArea"];function ms(t,e){var i;const n=t.w.highlightData;if(!n)return;if(t._render!==e&&t._beginRender(e,"p:"),!n.active&&!(null==(i=t._prev())?void 0:i.size))return;n.active&&"polarArea"===e.chartType&&"clamp"!==t.cfg.axis&&n.parts.forEach(t=>{Un(t[0])&&(e.maxY=Math.max(e.maxY,t[0]))});const s=e.animatePaths,r=e.drawArcs,a=e.getSliceMovers,c=e.getHoverOutlinePath,h={arcs:[],movers:[],reach:[],ap:s};e.animatePaths=(t,i)=>{const n=o({},i);s.call(e,t,i),n.run=i.dur,h.arcs[i.i]={a:n,el:t}},e.drawArcs=(...i)=>{const n=r.apply(e,i);return function(t,e,i,n){var s,r,a,c,h,d,u,p,f,g;const m=t.w,y=m.globals,x=t.cfg,b=m.highlightData,v=b.active,w=t._prev(),A=e.chartType,k="polarArea"===A,L=y.radialSize,S="donut"===A?e.donutSize:0,C=v?null!=(s=x.fadeOpacity)?s:.2:1,E=!0===(null==(r=t.ctx.morphTypeChange)?void 0:r.isActive()),F=!y.dataChanged||!y.shouldAnimate,D="area"===(null==(a=x.pie)?void 0:a.encoding),P=m.seriesData.series,R="part"===(null!=(h=null==(c=x.dataLabels)?void 0:c.value)?h:"part"),T=e.strokeWidth>0&&(null!=(u=null==(d=x.outline)?void 0:d.width)?u:1)>0?{opacity:null!=(f=null==(p=x.outline)?void 0:p.opacity)?f:1}:null,N=null==(g=y.prevHighlightLabels)?void 0:g.get(-1),O=[],$=(t,e)=>{var i,n;return(null==(i=t.classList)?void 0:i.contains(e))||` ${null==(n=t.getAttribute)?void 0:n.call(t,"class")} `.indexOf(` ${e} `)>-1};Array.from(i.node.childNodes).filter(t=>$(t,"apexcharts-pie-series")).forEach(i=>{var s,r,a,c,h,d;const u=Array.from(i.childNodes).find(t=>$(t,"apexcharts-pie-area"));if(!u)return;const p=Number(u.getAttribute("j")),f=fs+p,g=F||null==w?void 0:w.get(f);if(!v&&!g)return;const A=n.arcs[p],B=P[p],z=v?null==(s=b.parts[p])?void 0:s[0]:null,W=e.sliceSizes[p],H=k?W:L,j=M.isBrowser()&&!!A&&A.a.run>0&&!E,Y=+(null==A?void 0:A.a.animBeginArr[p])||0,q=null!=z&&B>0?z/B:null;let X=null,G=!1;if(null!=q&&q>0)if(G=q>1,k)X=Math.min(L,W*q);else{const t=Math.min(q,1);X=D?Math.sqrt(S*S+t*(L*L-S*S)):S+(L-S)*t}const U=null!=(r=null==g?void 0:g.lr)?r:null==g?void 0:g.fr;let K=X;const V=null==X&&null!=U&&j;V&&(K=y.collapsedSeriesIndices.indexOf(p)>-1?U*L:v?S:H);const Z=V&&!v;let Q=K,J=!1;null!=K&&j&&!F&&(null!=U?Q=U*L:g||"baseline"===x.enter?Q=S:(J=!0,Q=k?null!=(a=A.a.prevSize)?a:W:L),V||Math.abs(A.a.prevEndAngle-A.a.prevStartAngle)>.01||(Q=K,J=!1));let tt=null,et=null;const it=t=>{const e=u.getAttribute("transform");e&&(t.setAttribute("transform",e),t.classList.add("apexcharts-slice-mover"),t.style.transition=u.style.transition),(n.movers[p]=n.movers[p]||[]).push(t)},nt=(t,i,s,r)=>{if(A&&!E)n.ap.call(t,i,l(o({},A.a),{size:s,prevSize:F?void 0:r,isTrack:!0}));else{const n=Number(u.getAttribute("data:angle"));i.attr({d:t.getPiePath({me:t,startAngle:Number(u.getAttribute("data:startAngle")),angle:n>=e.fullAngle?e.fullAngle-.01:n,size:s}),"stroke-width":t.strokeWidth})}},st=u.getAttribute("fill"),[rt,at]=Qn(st),ot=Zn(u),lt=!!st&&"none"!==st&&!/^url\(/i.test(st),ct=lt?at*ot:ot,ht=lt?J?ct:null!=U&&null!=(c=g.al)?c:1:ot,dt=lt?Z?ct:1:ot;if(null!=K){const s=bs(e,H);tt=new _(m).drawPath({d:"",fill:rt,stroke:u.getAttribute("stroke"),strokeWidth:0,fillOpacity:ht,classes:`${Yn} apexcharts-pie-highlight-part`});const r=tt.node;if(r.setAttribute("pointer-events","none"),null!=q&&r.setAttribute("data:hl-share",String(q)),i.appendChild(r),it(r),j&&!F&&r.setAttribute("d",s.getChangedPath(A.a.prevStartAngle,A.a.prevEndAngle,Q)),nt(s,tt,K,Q),G&&!V&&r.classList.add("apexcharts-highlight-overflow"),ns(u,r),G&&!V||V&&(null==g?void 0:g.edge)){et=new _(m).drawPath({d:"",fill:"none",stroke:"#fff",strokeWidth:1,strokeDashArray:3,classes:`${Yn} apexcharts-highlight-edge`}),et.node.setAttribute("pointer-events","none"),et.node.setAttribute("stroke-opacity","0"),i.appendChild(et.node),it(et.node);nt(bs(e,H,{strokeWidth:{value:1}}),et,k?W:L-2,k?null==A?void 0:A.a.prevSize:L-2)}if(k&&G&&!V&&(r.removeAttribute("pointer-events"),is(u,r),n.reach[p]=K),E){const e=[r,null==et?void 0:et.node].filter(Boolean),i=t=>e.forEach(e=>e.setAttribute("opacity",t));i(0),t._tween(t.ctx.morphTypeChange.getSpeed(),m.config.chart.animations.dynamicAnimation.speed,i,()=>e.forEach(t=>t.removeAttribute("opacity")))}}const ut={d:null,fr:null,f:C,edge:!1,c:!v,al:dt};t._targets.set(f,ut);const pt=G&&null!=X?.75:0,ft=F?pt:(null==g?void 0:g.edge)?.75:0,gt=null!=Q?Q:0,mt=null!=K?K:0;t._fade(u,F?Gn(C):J?Xn:g?{f:g.f,o:null!=(h=g.o)?h:Gn(g.f).o}:qn,Z?Xn:Gn(C),{delayMs:Y,speed:null==A?void 0:A.a.run,el:null==A?void 0:A.el},{anim:j,force:!!tt&&(gt!==mt||ft!==pt||ht!==dt),outline:T&&l(o({},T),{color:y.colors[p]}),also:t=>{tt&&(ut.lr=Kn(gt,mt,t)/L,ut.la=Kn(ht,dt,t),tt.node.setAttribute("fill-opacity",String(ut.la))),null==et||et.node.setAttribute("stroke-opacity",String(Kn(ft,pt,t)))},land:Z?qn:void 0,done:V?()=>{null==tt||tt.remove(),null==et||et.remove(),ut.lr=null}:void 0,rec:ut}),null!=X&&Object.assign(ut,{fr:X/L,edge:G,n:tt.node});const yt=e.sliceLabelGroups[p],xt=yt&&Array.from(yt.childNodes).find(t=>$(t,"apexcharts-pie-label"));if(xt&&v){if(null==z&&R)return e.sliceLabels=e.sliceLabels.filter(t=>t.node!==yt),null==(d=yt.parentNode)||d.removeChild(yt),void delete e.sliceLabelGroups[p];!function(t,e,i,n,s,r,a,o,l){var c,h;const d=t.config.dataLabels.formatter;if(null!=r){const e=null!=(h=null==(c=t.globals.seriesPercent[s])?void 0:c[0])?h:0,i=a?e*r/a:0;n.textContent=String(d?d(i,{seriesIndex:s,dataPointIndex:s,series:t.seriesData.series,w:t,highlight:Jn(r,a)}):i+"%")}const u=parseFloat(n.getAttribute("font-size"))||12,p=Number(i.getAttribute("data:startAngle")),f=Number(i.getAttribute("data:angle"));if(null!=r&&null!=o&&o-l>=1.2*u){const i=t.config.plotOptions.pie.dataLabels.offset,s=I.polarToCartesian(e.centerX,e.centerY,"donut"===e.chartType?(l+o)/2+i:o/1.25+i,(p+f/2)%e.fullAngle);n.setAttribute("x",s.x),n.setAttribute("y",s.y)}const g=new _(t).getTextRects(n.textContent,n.getAttribute("font-size"),n.getAttribute("font-family"),void 0,!0,n.getAttribute("font-weight")),m=parseFloat(n.getAttribute("x")),y=parseFloat(n.getAttribute("y")),x=null!=o&&[[m-g.width/2,y-.75*g.height],[m+g.width/2,y-.75*g.height],[m-g.width/2,y+.25*g.height],[m+g.width/2,y+.25*g.height]].every(([t,i])=>{const n=t-e.centerX,s=i-e.centerY,r=Math.hypot(n,s),a=((180*Math.atan2(s,n)/Math.PI+90-p)%360+360)%360;return r>=l&&r<=o&&a<=f});x||(n.setAttribute("fill",t.config.chart.foreColor),n.removeAttribute("filter"))}(m,e,u,xt,p,R?z:null,B,X,S)}xt&&j&&!F&&N&&O.push({t:xt,src:N.get(p),el:A.el,delayMs:Y,arc:A})}),O.length&&(t._ride=()=>function(t,e){e.forEach(({t:e,src:i,el:n,delayMs:s,arc:r})=>{if(!e.isConnected)return;const[a,o]=ts(e),l=i?i.x-a:0,c=i?i.y-o:0;i&&Math.abs(l)<.5&&Math.abs(c)<.5||t._tween(s,r.a.run,t=>{const n=1-t;n>0&&i?e.setAttribute("transform",`translate(${l*n} ${c*n})`):e.removeAttribute("transform"),i||(t<1?e.setAttribute("opacity",String(t)):e.removeAttribute("opacity"))},void 0,void 0,n)})}(t,O))}(t,e,n,h),n},e.getSliceMovers=t=>a.call(e,t).concat(h.movers[t]||[]),e.getHoverOutlinePath=t=>{const i=e.sliceSizes;if(!(h.reach[t]>i[t]))return c.call(e,t);e.sliceSizes=i.slice(),e.sliceSizes[t]=h.reach[t];try{return c.call(e,t)}finally{e.sliceSizes=i}},ys(t,e)}function ys(t,e){const i=e.renderInnerDataLabels,n=e.printInnerLabels;e.renderInnerDataLabels=(n,s,r)=>xs(t,()=>i.call(e,n,_s(t,s,0),r)),e.printInnerLabels=(i,s,r,a)=>xs(t,()=>n.call(e,_s(t,i,a?+a.parentNode.getAttribute("rel")-1:-1),s,r,a))}function xs(t,e){var i,n;const s=t.w.globals,r=t.w.highlightData;if(!(null==r?void 0:r.active)||"part"!==(null!=(n=null==(i=t.cfg.dataLabels)?void 0:i.total)?n:"part"))return e();const a=s.seriesTotals;s.seriesTotals=r.parts.map(t=>{var e;return null!=(e=t[0])?e:0});try{return e()}finally{s.seriesTotals=a}}function _s(t,e,i){var n,s;const r=t.w,a=r.highlightData;if(!(null==a?void 0:a.active))return e;const c=r.seriesData.series,h=a.parts.map(t=>t[0]),d=i>-1&&"part"===(null!=(s=null==(n=t.cfg.dataLabels)?void 0:n.value)?s:"part")?h[i]:null,u=t=>t.reduce((t,e)=>t+(Un(e)?e:0),0),p=e.total.formatter,f=e.value.formatter;return l(o({},e),{total:l(o({},e.total),{formatter:p&&(t=>p(t,{highlight:Jn(u(h),u(c))}))}),value:l(o({},e.value),{formatter:(t,e)=>f(null!=d?d:t,e,{highlight:i>-1?Jn(h[i],c[i]):void 0})})})}const bs=(t,e,i)=>Object.create(t,o({getSliceExtent:{value:i=>t.getSliceExtent(l(o({},i),{size:e}))}},i));const vs="r:",ws="r:o",As=["length","baseWidth","tipWidth","offsetY"],Ms=.45,ks=`${Yn} apexcharts-radialbar-highlight-lane`;function Ls(t,e){var i,n,s,r,a,l,c;const h=t.w,d=h.highlightData,u=null==(n=null==(i=t.ctx.lastUpdateOptions)?void 0:i.tooltip)?void 0:n.enabled;if(null!=u?t._tipUser=u:t._tipOn&&(h.config.tooltip.enabled=!1),t._tipOn=!1,!d)return;t._render!==e&&t._beginRender(e,vs),function(t){const e=t.ctx.morphTypeChange;if(!e||e._hfOut)return;e._hfOut=!0;const i=e.captureBeforeDestroy;e.captureBeforeDestroy=n=>{const s=function(t,e){var i,n,s,r,a;const o=t.w,l=o.globals,c=null==(i=o.dom.baseEl)?void 0:i.querySelector(".apexcharts-radialbar");if("radialBar"!==e&&"gauge"!==e||!c)return null;const h=t.ctx.morphTypeChange,d=null!=(s=null==(n=l.circleGeometry)?void 0:n.cx)?s:0,u=null!=(a=null==(r=l.circleGeometry)?void 0:r.cy)?a:0,p=new Map,f=new Set,g=new Set;c.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(e=>{var i,n,s,r;const a=e.parentNode,o=+a.getAttribute("data:realIndex"),l=vs+e.getAttribute("j"),c=null!=(n=t._targets.get(l))?n:null==(i=t._prev())?void 0:i.get(l),m=a.querySelector(".apexcharts-radialbar-highlight-part");if(!(m||(null==c?void 0:c.s)>0||(null!=(r=null!=(s=null==c?void 0:c.lf)?s:null==c?void 0:c.f)?r:1)<1))return;f.add(e);const y=null==m?void 0:m.getAttribute("d"),x=+(null==m?void 0:m.getAttribute("stroke-width"));let _=null;if(y&&x>0&&"0"!==m.getAttribute("opacity"))_=h._radialArcToFilledSegment(y,x,d,u)||y,g.add(m);else{const t=/M\s*(-?[\d.e]+)\s+(-?[\d.e]+)/.exec(e.getAttribute("d")||"");t&&(_=`M ${t[1]} ${t[2]} L ${t[1]} ${t[2]} Z`)}_&&p.set(o,_)});const m=[...c.getElementsByClassName(Yn)];return p.size||m.length?(m.forEach(t=>g.has(t)||t.closest(".apexcharts-tracks")||f.add(t)),{marks:p,ghost:()=>{const t="data-hf-ghost";f.forEach(e=>e.setAttribute(t,""));const e=o.dom.Paper.node.cloneNode(!0);f.forEach(e=>e.removeAttribute(t));const i=new Set(e.querySelectorAll(`[${t}]`)),n=new Set;i.forEach(i=>{i.removeAttribute(t);for(let t=i.parentNode;t&&t!==e;t=t.parentNode)n.add(t)});const s=t=>[...t.children].forEach(t=>{i.has(t)||(n.has(t)?s(t):"defs"!==t.tagName.toLowerCase()&&t.remove())});return s(e),e.removeAttribute("id"),[e,...e.querySelectorAll("*")].forEach(t=>{t.id&&(t.id+="-hf"),[...t.attributes].forEach(e=>{e.value.includes("url(#")&&t.setAttribute(e.name,e.value.replace(/url\(#([^)]+)\)/g,"url(#$1-hf)"))})}),e}}):null}(t,null==n?void 0:n.fromType);if(!s)return i.call(e,n);const r=e._captureFromDOM;let a;e._captureFromDOM=t=>{const i=r.call(e,t);return i.marks.forEach(t=>{var e;t.d=null!=(e=s.marks.get(t.realIndex))?e:t.d}),i};try{a=i.call(e,n)}finally{e._captureFromDOM=r}const o=e._snapshot;return!a||!o||e._ghost||o.pieceOut||o.pieceIn||(e._ghost=s.ghost()),a}}(t);const p=h.config.plotOptions.radialBar;if(t._ind=null!=(r=null==(s=t.cfg.radialBar)?void 0:s.indicator)?r:"needle"===p.shape?"needle":"arc","lanes"!==t._ind||"needle"!==p.shape||(null==(a=p.needle)?void 0:a.showValueArc)||(t._ind="needle"),!d.active&&!(null==(l=t._prev())?void 0:l.size))return;const f=h.config.tooltip;d.active&&!f.enabled&&null==t._tipUser&&M.isBrowser()&&(f.enabled=!0,t._tipOn=!0),ys(t,e),function(t,e){const i=e.renderInnerDataLabels,n=e.printInnerLabels;e.renderInnerDataLabels=(n,s,r)=>{const a=i(n||e.dataLabelsGroup,s,r);return Es(t,e,s,-1,a),a},e.printInnerLabels=(i,s,r,a)=>{n(i,s,r,a),Es(t,e,i,a?+a.parentNode.getAttribute("rel")-1:-1)}}(t,e);const g=e.drawNeedle;e.drawNeedle=i=>{const n=g.call(e,i);return function(t,e,i){var n,s;const r=t.w,a=r.globals,o=r.highlightData.active,l=!a.dataChanged||!a.shouldAnimate,c=l||null==(n=t._prev())?void 0:n.get(ws);if(!o&&!c)return;const h=o?null!=(s=t.cfg.fadeOpacity)?s:.2:1,d=l?h:c?c.f:1,u={d:null,f:h,c:!o};t._targets.set(ws,u);const p=t=>{u.lf=t,t<1?i.node.setAttribute("opacity",String(t)):i.node.removeAttribute("opacity")},f=t.ctx.morphTypeChange,g=(null==f?void 0:f.isActive())?{delay:f.getSpeed(),speed:r.config.chart.animations.dynamicAnimation.speed}:e.needleMotion();g&&d!==h?(u.run=!0,t._tween(g.delay||0,g.speed,t=>p(Kn(d,h,t)),()=>u.run=!1,g.ease)):p(h);o&&M.isBrowser()&&Promise.resolve().then(()=>{var t;const e=r.dom.baseEl,n=null==e?void 0:e.querySelector(".apexcharts-radialbar-slice-0");n&&i.node.isConnected&&(is(n,i.node),null==(t=e.querySelector(".apexcharts-radialbar-hollow"))||t.setAttribute("pointer-events","none"))})}(t,e,n),n};const m=e.animatePaths;e.animatePaths=(i,n)=>{const s=o({},n);m.call(e,i,n),n.isTrack||(s.run=n.dur,Ss(t,e,i,s,m))},!0===(null==(c=t.ctx.morphTypeChange)?void 0:c.isActive())&&Promise.resolve().then(()=>{var i;t._render!==e||h.globals.isDestroyed||null==(i=h.dom.baseEl)||i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>Ss(t,e,i.instance,null,m))})}function Ss(t,e,i,n,s){var r,a,c,h,d,u;const p=t.w,f=p.globals,g=t.cfg,m=p.highlightData,y=m.active,x=i.node,b=n?n.i:Number(x.getAttribute("j")),v=vs+b,w=!n,A=!f.dataChanged||!f.shouldAnimate,k=t._prev(),L=A||null==k?void 0:k.get(v),S=p.config.plotOptions.radialBar,C=t._ind,E=x.getAttribute("stroke"),F=x.getAttribute("fill"),D=E&&"transparent"!==E?E:w&&F&&"none"!==F?F:null,P=0===b&&("needle"===C||!D),R=p.seriesData.series[b],T=y&&f.collapsedSeriesIndices.indexOf(b)<0&&null!=(a=null==(r=m.parts[b])?void 0:r[0])?a:null,N=e.startAngle,O=n?n.endAngle:e._arcEnd(R),$=n?n.run:0,B=M.isBrowser()&&$>0,z=n&&+n.animBeginArr[b]||0,W=null!=(c=g.fadeOpacity)?c:.2,H=y&&!P&&!!D,j={f:W,o:0},Y=n?n.size:Math.hypot(x.getAttribute("data:cx")-f.circleGeometry.cx,x.getAttribute("data:cy")-f.circleGeometry.cy);if("lanes"===C&&D)return function(t,e,i,n){var s,r,a,c,h,d,u;const{i:p,c:f,prev:g,mount:m,pv:y,whole:x,wholeEnd:b,run:v,anim:w,delayMs:A,size:k}=n,L=t.w,S=L.globals,C=t.cfg,E=L.config.plotOptions.radialBar,F=L.highlightData.active,D=i.node,P=!f,R=e.startAngle,T=F&&S.collapsedSeriesIndices.indexOf(p)<0?1:0,N=P?M.isBrowser()&&!!T:w&&!m,O=!P&&w&&m,$=P?0:N?null!=(s=null==g?void 0:g.s)?s:0:T,I=P?{delayMs:t.ctx.morphTypeChange.getSpeed(),speed:L.config.chart.animations.dynamicAnimation.speed}:{delayMs:A,speed:v};0===p&&function(t,e){var i;const n=null==(i=t._render)?void 0:i._hfLine,s=null==n?void 0:n.rec;if(!s||s.run||s.lf===s.f)return;const r=s.lf,a=()=>{var t,e;if(s.run=!1,s.f)return;s.done=!0;const i=null==(t=n.node)?void 0:t.previousSibling;null!=s.hold&&i&&i.textContent===s.pv&&(i.textContent=s.vt=s.hold),null==(e=n.node)||e.remove(),n.node=null};if(!e)return s.lf=s.f,Ds(n),void a();s.run=!0,t._tween(e.delayMs,e.speed,t=>{s.lf=Kn(r,s.f,t),Ds(n)},a,void 0,e.el)}(t,N?l(o({},I),{el:i}):null);if(!T&&!$)return;const B=null!=y?e._arcEnd(y):R,z=b,W=T?B:z;let H=z,j=W;P?j="baseline"===C.enter?R:z:N?(H=null!=(r=null==g?void 0:g.we)?r:Un(f.prevEndAngle)?f.prevEndAngle:z,j=null!=(a=null==g?void 0:g.e)?a:"baseline"===C.enter?R:H):O&&(H=j=R);const Y=T?null!=(d=null==(h=null==(c=C.radialBar)?void 0:c.lanes)?void 0:h.opacity)?d:Ms:1,q=P?1:N?g?g.f:1:Y,X=P?e.getStrokeWidth({size:S.circleGeometry.r,series:L.seriesData.series}):Number(D.getAttribute("stroke-width")),G=D.getAttribute("stroke-opacity"),U=t=>{var e;const i=new _(L).drawPath({d:"",stroke:n.paint,strokeWidth:X,fill:"none",strokeOpacity:Zn(D,"stroke-opacity"),strokeDashArray:null!=(e=D.getAttribute("stroke-dasharray"))?e:0,classes:`${ks} ${t}`});return i.node.setAttribute("aria-hidden","true"),ns(D,i.node),i},K=U("apexcharts-radialbar-highlight-whole"),V=U("apexcharts-radialbar-highlight-part");ss(D,K.node),ss(K.node,V.node),K.node.setAttribute("pointer-events","none"),T&&B-z>.01?is(D,V.node):V.node.setAttribute("pointer-events","none");null!=y&&(y>(null!=x?x:0)||y>("number"==typeof E.max?E.max:100))&&rs(V.node,"apexcharts-highlight-overflow");const Z=L.seriesData.series.length,Q=function(t){var e,i;if(t._hfTracks)return t._hfTracks;const n=(t,e)=>{var i;return` ${null==(i=t.getAttribute)?void 0:i.call(t,"class")} `.includes(` ${e} `)},s=[...(null==(i=null==(e=t.w.dom.Paper)?void 0:e.node)?void 0:i.childNodes)||[]];let r=[];for(let t=s.length-1;t>=0&&!r.length;t--){const e=[...s[t].childNodes||[]].find(t=>n(t,"apexcharts-tracks"));e&&(r=[...e.childNodes].map(t=>[...t.childNodes].find(t=>n(t,"apexcharts-radialbar-area"))))}return t._hfTracks=r}(e)[E.inverseOrder?Z-1-p:p],J=Q&&[Q.getAttribute("d"),Q.getAttribute("stroke-width")],tt=J?(parseFloat(J[1])||0)/(X||1):0;let et=null;if(Q){et=new _(L).drawPath({d:"",stroke:Q.getAttribute("stroke"),strokeWidth:0,fill:"none",strokeOpacity:null!=(u=Q.getAttribute("stroke-opacity"))?u:1,classes:`${Yn} apexcharts-radialbar-highlight-track`});const t=Q.getAttribute("filter");t&&et.node.setAttribute("filter",t),et.node.setAttribute("pointer-events","none"),et.node.setAttribute("aria-hidden","true"),ss(Q,et.node)}const it=k-X/2,nt=k+X/2,st=Z<2,rt=st?Math.max(2,.12*X):Math.max(1,Math.min(.08*X,e.margin/3)),at=st?0:Math.max(0,(3*rt-e.margin)/2),ot=Math.max(.5,(X-rt)/2-at),lt=(t,i)=>{const n=t-R;return n>.01?e.getPiePath({me:e,startAngle:R,angle:n===e.fullAngle?e.fullAngle-.01:n,size:i}):""},ct=t=>{const i=e.trackStartAngle;let n=e.trackEndAngle;Math.abs(n)+Math.abs(i)>=360&&(n=360-Math.abs(e.startAngle)-.1);const s=n<i?e.fullAngle+n-i:n-i;return e.getPiePath({me:e,startAngle:i,angle:s===e.fullAngle?s-.01:s,size:t})},ht=(t,e,i)=>{t.setAttribute("d",e),t.setAttribute("stroke-width",String(i))},dt={d:null,c:!F,f:Y,cx:f?f.centerX:S.circleGeometry.cx,cy:f?f.centerY:S.circleGeometry.cy};t._targets.set(vs+p,dt);const ut=(t,e,i)=>{dt.s=t,dt.we=e,dt.e=i;const n=nt-at*t,s=it+t*(nt-at-ot-it),r=it+at*t,a=r+t*ot;dt.mid=(s+a)/2,ht(K.node,lt(e,(s+n)/2),n-s),ht(V.node,a>r?lt(i,(r+a)/2):"",a-r),Q&&(t?(ht(Q,ct((s+n)/2),(n-s)*tt),ht(et.node,ct((r+a)/2),(a-r)*tt)):(ht(Q,J[0],J[1]),ht(et.node,"",0)))},pt=[K.node,V.node,null==et?void 0:et.node].filter(Boolean);let ft=!P;const gt=()=>{ft=!0,D.setAttribute("stroke-opacity","0"),pt.forEach(t=>t.removeAttribute("opacity"))};ft?gt():pt.forEach(t=>t.setAttribute("opacity","0"));ut($,H,j);let mt=!1;(N||O)&&K.animate(I.speed,I.delayMs).during(t=>{mt||(ft||gt(),ut(Kn($,T,t),Kn(H,z,t),Kn(j,W,t)))});if(t._fade(K.node,{f:q,o:0},{f:Y,o:0},l(o({},I),{el:K}),{attr:"stroke-opacity",anim:N,force:N,done:T?void 0:()=>{mt=!0,pt.forEach(t=>t.remove()),Q&&ht(Q,J[0],J[1]),null==G?D.removeAttribute("stroke-opacity"):D.setAttribute("stroke-opacity",G),dt.s=0},rec:dt}),M.isBrowser()){const e=e=>{t._lane=[p,Cs(D,e,dt)]};["mouseover","mousemove","mousedown","touchstart","touchmove"].forEach(t=>D.addEventListener(t,e,!0))}}(t,e,i,{i:b,c:n,prev:L,mount:A,pv:T,whole:R,wholeEnd:O,run:$,anim:B,delayMs:z,size:Y,paint:D}),void(0===b&&Rs(t,e,i,!1,T,A,w,n));const q=H&&null!=T?e._arcEnd(T):null,X=null!=q&&q-N>.01,G=null!=(h=null==L?void 0:L.e)?h:null,U=!X&&null!=G&&B,K=U&&!H,V=X?q:U?K?O:N:null;let Z=V,Q=!1;null!=V&&B&&!A&&(null!=G?Z=G:L||"baseline"===g.enter?Z=N:(Q=!0,Z=Un(n.prevEndAngle)?n.prevEndAngle:O));const J=t=>{const i=t-N;return e.getPiePath({me:e,startAngle:N,angle:i===e.fullAngle?e.fullAngle-.01:i,size:Y})};let tt=null;if(null!=V&&D){tt=new _(p).drawPath({d:"",stroke:D,strokeWidth:w?e.getStrokeWidth({size:f.circleGeometry.r,series:p.seriesData.series}):Number(x.getAttribute("stroke-width")),fill:"none",strokeOpacity:Zn(x,"stroke-opacity"),strokeDashArray:null!=(d=x.getAttribute("stroke-dasharray"))?d:0,classes:`${Yn} apexcharts-radialbar-highlight-part`});const t=tt.node;t.setAttribute("aria-hidden","true"),ss(x,t),X&&T>("number"==typeof S.max?S.max:100)&&rs(t,"apexcharts-highlight-overflow"),ns(x,t),X&&q-O>.01?is(x,t):t.setAttribute("pointer-events","none"),n&&B&&!A?(t.setAttribute("d",J(Z)),s.call(e,tt,l(o({},n),{endAngle:V,prevStartAngle:N,prevEndAngle:Z,isTrack:!0}))):n?s.call(e,tt,l(o({},n),{endAngle:V,dur:$,isTrack:!0})):t.setAttribute("d",J(V))}const et=X&&q-O>.01?.75:0,it=A?et:null!=(u=null==L?void 0:L.tk)?u:0;let nt=null;if(tt&&(et||it&&B)){const t=Number(tt.node.getAttribute("stroke-width"))||0,e=n?n.centerX:f.circleGeometry.cx,i=n?n.centerY:f.circleGeometry.cy;nt=new _(p).drawPath({d:"",fill:"none",stroke:"#fff",strokeWidth:1,strokeDashArray:3,classes:`${Yn} apexcharts-highlight-edge apexcharts-radialbar-highlight-edge`});const s=nt.node;s.setAttribute("pointer-events","none"),s.setAttribute("aria-hidden","true"),s.setAttribute("stroke-opacity",String(it)),ss(tt.node,s);const r=n=>{const r=I.polarToCartesian(e,i,Y-t/2,n),a=I.polarToCartesian(e,i,Y+t/2,n);s.setAttribute("d",`M ${r.x} ${r.y} L ${a.x} ${a.y}`)},a=B?Un(n.prevEndAngle)&&!A?n.prevEndAngle:N:O;r(a),a!==O&&nt.animate($,z).during(t=>r(Kn(a,O,t)))}const st=[];tt&&w&&st.push(tt.node),nt&&w&&st.push(nt.node);const rt={d:null,e:null,f:H?W:1,c:!y};if(D&&(y||L)){t._targets.set(v,rt);const e=null!=Z?Z:0,s=null!=V?V:0;tt&&(rt.e=s),tt&&n&&B&&!A&&e!==s&&(rt.e=e,tt.animate($,z).during(t=>null!=rt.e&&(rt.e=Kn(e,s,t))));const r=p.config.chart.animations.dynamicAnimation.speed;t._fade(x,A&&!w?H?j:qn:Q?Xn:L?{f:L.f,o:0}:qn,K?Xn:H?j:qn,w?{delayMs:t.ctx.morphTypeChange.getSpeed(),speed:r}:{delayMs:z,speed:$,el:i},{attr:"stroke-opacity",anim:w?M.isBrowser():B,force:!!tt&&(w||e!==s||it!==et),also:t=>{nt&&(rt.tk=Kn(it,et,t),nt.node.setAttribute("stroke-opacity",String(rt.tk))),st.forEach(e=>t<1?e.setAttribute("opacity",t):e.removeAttribute("opacity"))},land:K?qn:void 0,done:U||nt&&!et?()=>{U&&(null==tt||tt.remove(),rt.e=null),null==nt||nt.remove(),rt.tk=0}:void 0,rec:rt}),tt&&(rt.n=tt.node)}0===b&&Rs(t,e,i,P,T,A,w,n)}function Cs(t,e,i){var n,s;const r=(null==(n=e.touches)?void 0:n[0])||e,a=null==(s=t.getScreenCTM)?void 0:s.call(t);if(!(a&&i.s>0))return"part";const o=r.clientX-a.e,l=r.clientY-a.f,c=a.a*a.d-a.b*a.c||1,h=(a.d*o-a.c*l)/c,d=(a.a*l-a.b*o)/c;return Math.hypot(h-i.cx,d-i.cy)>i.mid?"whole":"part"}function Es(t,e,i,n,s){var r,a,o;const l=t.w,c=l.globals;if("lanes"!==t._ind)return;const h=l.highlightData.active;let d=e._hfLine;if(!d){const n=!c.dataChanged||!c.shouldAnimate,s=n||null==(r=t._prev())?void 0:r.get("r:w"),o=h?Ps(t,i,-1):"",l=o?1:0,u=n||!M.isBrowser()?l:null!=(a=null==s?void 0:s.f)?a:0;if(d=e._hfLine={node:null,rec:null},!l&&!u)return;d.rec={d:null,c:!h,t:o||(null==s?void 0:s.t)||"",f:l,lf:u,o0:u,pv:l?null:null==s?void 0:s.vt},t._targets.set("r:w",d.rec)}const u=d.rec;if(s){if(d.node=null,!u||!u.lf&&u.done)return;const e=s.node.childNodes,n=i.value.show?e[e.length-1]:null;if(!n)return;null==u.pv||u.done||(u.hold=n.textContent,n.textContent=u.pv),u.vt=n.textContent;const r=Fs(l,i,n,(h?Ps(t,i,-1):"")||u.t);s.add(r),d.node=r.node}else if(h){const e=Ps(t,i,n),s=null==(o=l.dom.baseEl)?void 0:o.querySelector(".apexcharts-datalabel-value");!d.node&&e&&n>-1&&s&&(d.node=Fs(l,i,s,e).node,s.parentNode.appendChild(d.node)),d.node&&(d.node.textContent=e),u&&s&&(u.vt=s.textContent)}Ds(d)}function Fs(t,e,i,n){const s=parseFloat(e.value.fontSize)||14,r=Math.max(11,Math.round(s/2)),a=new _(t).drawText({x:+i.getAttribute("x"),y:+i.getAttribute("y")+s/4+4+.8*r,text:n,textAnchor:"middle",fontSize:r+"px",fontFamily:e.value.fontFamily,fontWeight:400,foreColor:i.getAttribute("fill"),cssClass:"apexcharts-datalabel-whole"});return a.node.setAttribute("aria-hidden","true"),a}function Ds(t){var e,i,n;null==(n=t.node)||n.setAttribute("fill-opacity",String(.6*(null!=(i=null==(e=t.rec)?void 0:e.lf)?i:1)))}function Ps(t,e,i){var n,s;const r=t.w,a=t.cfg.dataLabels||{},c=r.seriesData.series,h=r.highlightData.parts.map(t=>t[0]),d=i>-1?i:c.length<2?0:-1,u=(t,e)=>{const i=String(t(e)),n=String(t(l(o({},e),{lane:"whole"})));return n!==i?n:"/ "+i};if(d>-1)return"part"===(null!=(n=a.value)?n:"part")&&Un(h[d])?u(t=>e.value.formatter(c[d],r,t),{highlight:Jn(h[d],c[d])}):"";if(!e.total.show||"part"!==(null!=(s=a.total)?s:"part")||!e.total.formatter||!h.some(Un))return"";const p=t=>t.reduce((t,e)=>t+(Un(e)?e:0),0);return u(t=>e.total.formatter(r,t),{highlight:Jn(p(h),p(c))})}function Rs(t,e,i,n,s,r,a,o){var l,c,h;const d=t.w,u=d.globals,p=t.cfg,f=d.highlightData.active,g=r||null==(l=t._prev())?void 0:l.get("r:n"),m=n&&null!=s?e._angleAtValue(s):null;if(null==m&&!g)return;const y=d.config.plotOptions.radialBar,x=a?null:"needle"===y.shape?e.needleMotion():o&&o.run>0&&M.isBrowser()?{speed:o.run,delay:+o.animBeginArr[0]||0}:null;let b,v=1,w=m,k=1;const L=null==m;if(L){if(!x)return;b=g.ang,v=g.op,w=f&&n?e.startAngle:e._angleAtValue(d.seriesData.series[0]),k=0}else x?r?b=e.startAngle:g?(b=g.ang,v=g.op):(b=e._angleAtValue(u.dataChanged?u.previousPaths[0]:d.seriesData.series[0]),v=0):b=w;const S=u.circleGeometry,C=(null==(c=p.radialBar)?void 0:c.needle)||{},E=y.needle||{},F={};As.forEach(t=>{var e;return F[t]=null!=(e=C[t])?e:E[t]});const D=null!=(h=C.color)?h:u.colors[0],{path:P,cx:R,cy:T}=e.needlePath({size:S.r,centerX:S.cx,centerY:S.cy,series:d.seriesData.series},F),N=new _(d),O=N.group({class:"apexcharts-gauge-needle-highlight"});L||!M.isBrowser()?O.node.setAttribute("pointer-events","none"):is(i.node,O.node),O.node.setAttribute("aria-hidden","true"),O.node.setAttribute("transform-origin",`${R} ${T}`),O.add(N.drawPath({d:P,stroke:D,strokeWidth:0,fill:D,classes:`${Yn} apexcharts-gauge-needle-highlight-shape`})),null!=s&&s>("number"==typeof y.max?y.max:100)&&rs(O.node,"apexcharts-highlight-overflow");const $=i.node.parentNode.parentNode;$.insertBefore(O.node,$.childNodes[0]||null);const I=()=>{const t=[...$.childNodes].filter(t=>t!==O.node),e=t.findIndex(t=>{var e;return` ${null==(e=t.getAttribute)?void 0:e.call(t,"class")} `.includes(" apexcharts-radialbar-hollow ")});return!(e<0||O.node.parentNode!==$)&&($.insertBefore(O.node,t[e+1]||null),!0)};I()||Promise.resolve().then(I);const B={d:null,ang:b,op:v,c:!f};t._targets.set("r:n",B);const z=(t,e)=>{B.ang=t,B.op=e,O.node.setAttribute("transform",`rotate(${t})`),e<1?O.node.setAttribute("opacity",String(e)):O.node.removeAttribute("opacity")},W=t=>z(b+(w-b)*t,Kn(v,k,t)),H=()=>{B.run=!1,L?O.remove():z(w,k)};if(a)return z(w,0),void t._tween(t.ctx.morphTypeChange.getSpeed(),d.config.chart.animations.dynamicAnimation.speed,t=>z(w,t),H);if(!x||b===w&&v===k)return W(1),void H();B.run=!0,W(0);const j=x;if(j.ease){const i=performance.now(),n=s=>{if(u.isDestroyed||t._render!==e)return;const r=Math.max(0,Math.min(1,(s-i)/j.speed));W(j.ease(r)),r<1?A.requestAnimationFrame(n):H()};A.requestAnimationFrame(n)}else O.animate(j.speed,j.delay||0).during(t=>W(t)).after(H)}const Ts="apexcharts-highlight-tile",Ns="apexcharts-highlight-overflow",Os=/^url\(/i;function $s(t,e){var i,n,s;const r=t.w,a=r.globals,l=r.highlightData;if(!l)return;t._beginRender(e,"t:"),t._tmDefs.forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)}),t._tmDefs=[];const c=t._tiles=new Map,h=l.active,d=r.seriesData.series;!function(t,e,i){const n=s=>{var r,a;const o=s.children;if(!o||!o.length){const t=null==(r=null==e?void 0:e[s._si])?void 0:r[s._di];return s.highlight=e?Jn(Un(t)?t:null,null==(a=i[s._si])?void 0:a[s._di]):void 0,s.highlight}let l=null;if(o.forEach(t=>{const e=n(t);!e||null==e.value||e.value*(e.total||0)<0||(l=(l||0)+Math.abs(e.value))}),!e)return s.highlight=void 0;const c=t._subtreeArea(s),h=null!=l&&c?l/c:null;return s.highlight={value:l,total:c,share:h,overflow:null!=h&&h>1},s.highlight};(t.roots||[]).forEach(n)}(e,h?l.parts:null,d);const u=t._prev();if(!h&&!(null==u?void 0:u.size))return;const p=new Map;null==u||u.forEach(t=>p.set(t.ij,t)),null==(i=a.prevTreemapView)||i.querySelectorAll(`.${Ts}`).forEach(t=>{t.classList.remove(Ts,Ns),t.removeAttribute("data:hl-share")});const f=t.cfg,g=h?null!=(n=f.fadeOpacity)?n:.2:1,m=!0===(null==(s=t.ctx.morphTypeChange)?void 0:s.isActive()),y=e.dynamicAnim,x=m||!!(a.dataChanged&&y.enabled&&a.shouldAnimate),b=m?t.ctx.morphTypeChange.getSpeed():y.speed,v=r.config.chart.foreColor;let w=!1;h&&function(t,e){const i=e._showParentTooltip;e._showParentTooltip=(n,s)=>{var r,a,o;i.call(e,n,s);const l=s.highlight,c=t.cfg.tooltip||{};if(null==(null==l?void 0:l.value)||!1===c.show||"function"==typeof(null==(a=null==(r=t.w.config.plotOptions.treemap.parents)?void 0:r.tooltip)?void 0:a.formatter))return;const h=null==(o=e._tip())?void 0:o.querySelector(".apexcharts-tooltip-text-y-value");if(!h)return;let d=`/ ${e._formatValue(l.total,s._si)}`;c.share&&l.total&&(d+=` \xb7 ${Math.round(100*l.share)}%`),h.innerHTML=`${e._formatValue(l.value,s._si)} <span class="apexcharts-highlight-total" style="font-weight: 400; opacity: 0.6">${d}</span>`}}(t,e);let A=null;const M=e.helpers.calculateDataLabels;e.helpers.calculateDataLabels=t=>{const i=M.call(e.helpers,t),n=A=c.get(t.i+"|"+t.j);if(i&&n){const t=function(t){const e=[];return function t(i){"text"===String(i.tagName||i.nodeName).toLowerCase()&&e.push(i),Array.from(i.childNodes||[]).forEach(t)}(t),e}(i.node);n.lb=t.filter(t=>/^(#fff|#ffffff|white)$/i.test(t.getAttribute("fill")||""));const e=t[0],[,s,,r]=n.r;if(e&&r>s){const t=parseFloat(e.getAttribute("font-size"))||12;n.need=(r-parseFloat(e.getAttribute("y"))+.9*t)/(r-s)}Is(n,v)}return i};const k=e.rotateToFitLabel;return e.rotateToFitLabel=(...t)=>{k.apply(e,t);const i=A;if(A=null,(null==i?void 0:i.lb)&&/rotate/.test(t[0].node.getAttribute("transform")||"")){const e=new _(r).getTextRects(t[2],String(t[1])).width;i.need=.5+e/2/(t[6]-t[4]),i.tone=null,Is(i,v)}},(e,i,n,s,y)=>{var _,A,M,k;const L="t:"+y._key,S=i+"|"+n,C=null==(_=d[i])?void 0:_[n],E=x?(null==u?void 0:u.get(L))||(C?void 0:p.get(S)):void 0;if(!h&&!E)return;if(Os.test(s))return void(h&&!w&&(w=!0,t._warn("fill","treemap tiles with a gradient, pattern or image fill are drawn without their parts.")));const F=h?null==(A=l.parts[i])?void 0:A[n]:null;if(!C&&!E)return;const D=Un(F)&&C?F/C:null;let P=h?{s:null==D||D<0?0:Math.min(D,1),f:g,c:s}:{s:1,f:0,c:s},R=P;if(E)R={s:E.s,f:E.f,c:E.col},!C&&h&&(P=o({},R));else if(x){const t=null==(M=a.previousPaths[i])?void 0:M[n];(m||(null==(k=null==t?void 0:t.rect)?void 0:k.width)>0)&&(R="baseline"===f.enter?{s:0,f:1,c:P.c}:{s:1,f:0,c:P.c},m||!t.fill||Os.test(t.fill)||(R.c=t.fill))}const T=R.s!==P.s||R.f!==P.f||R.c!==P.c;if(!h&&!T)return;const N=r.dom.Paper.gradient("linear",t=>{for(let e=0;e<4;e++)t.stop(0,s,1)});N.from(0,1).to(0,0),t._tmDefs.push(N.node);const O=Array.from(N.node.childNodes),$=e.node;h&&($.setAttribute("class",`${$.getAttribute("class")||""} ${Ts}${null!=D&&D>1?" "+Ns:""}`.trim()),$.setAttribute("data:hl-share",null==D?"":String(D)));const I={s:P.s,f:P.f,col:P.c,c:!h,ij:S,run:!1,base:s,r:y.rect,lb:null,need:.5,tone:null};t._targets.set(L,I),c.set(S,I);const B=function(t,e){const i=Bs(t),n=Bs(e);return t!==e&&i&&n?t=>t>=1?e:`rgba(${[0,1,2].map(e=>Math.round(Kn(i[e],n[e],t))).join(",")},${+Kn(i[3],n[3],t).toFixed(3)})`:i=>i>=1?e:t}(R.c,P.c),z=t=>{I.ls=t.s,I.lf=t.f,I.lc=t.c,O.forEach((e,i)=>{e.setAttribute("offset",String(0===i?0:3===i?1:t.s)),e.setAttribute("stop-color",t.c),e.setAttribute("stop-opacity",String(i<2?1:t.f))}),Is(I,v)},W=()=>{var t;I.run=!1,z(P),!h&&$.isConnected&&($.setAttribute("fill",s),null==(t=N.node.parentNode)||t.removeChild(N.node))};if(x&&T){I.run=!0,z(R);let e=null,i=!1;const n={finish(){t._live.delete(n),h?z({s:I.ls,f:e=P.f,c:I.lc}):(i=!0,W())}};t._hold(n),N.animate(b,0).during(t=>i||z({s:Kn(R.s,P.s,t),f:null!=e?e:Kn(R.f,P.f,t),c:B(t)})).after(()=>{t._live.delete(n),i||W()})}else z(P);return N.url()}}function Is(t,e){var i;const n=(null!=(i=t.ls)?i:t.s)>=t.need-1e-9;t.lb&&t.tone!==n&&(t.tone=n,t.lb.forEach(t=>{null==t._apxFill&&(t._apxFill=t.getAttribute("fill")),t.setAttribute("fill",n?t._apxFill:e)}))}function Bs(t){var e;const i=String(t).trim();let n=/^#([\da-f]+)$/i.exec(i);if(n){let t=n[1];return t.length<5&&(t=t.replace(/./g,"$&$&")),6!==t.length&&8!==t.length?null:[0,2,4,6].map(e=>e<t.length?parseInt(t.slice(e,e+2),16)/(6===e?255:1):1)}if(n=/^rgba?\(([^)]*)\)$/i.exec(i),!n)return null;const s=n[1].split(/[\s,/]+/).filter(Boolean).map(parseFloat);return s.length>=3&&s.every(isFinite)?[s[0],s[1],s[2],null!=(e=s[3])?e:1]:null}["prevHighlightParts","prevHighlightLabels"].forEach(t=>{-1===b.HELD.indexOf(t)&&b.HELD.push(t)});const zs="apexcharts-flip-x",Ws="apexcharts-flip-y",Hs="apexcharts-flip-held",js="apexcharts-highlight-label-exit",Ys="b:",qs={f:1,o:0},Xs={f:1,o:1},Gs={f:0,o:1};function Us(t){if(!t)return!1;if(Array.isArray(t.highlightData))return!0;const e=t.data;if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++){const i=e[t];if(Vn(i)){if("highlight"in i)return!0}else if(null!=i)return!1}return!1}function Ks(t,e,i){return Vn(t)&&"highlight"in t?t.highlight:e?e[i]:null}function Vs(t,e){let i=1/0,n=-1/0;return String(t).replace(/([MLQCT])([^MLQCTZz]*)/g,(t,s,r)=>{const a=r.trim().split(/[\s,]+/).filter(Boolean).map(Number);for(let t=e;t<a.length;t+=2)a[t]<i&&(i=a[t]),a[t]>n&&(n=a[t]);return""}),[i,n]}function Zs(t,e){let i=-1,n=1/0;return t.forEach((t,s)=>{null!=t&&Math.abs(t-e)<n&&(n=Math.abs(t-e),i=s)}),i}function Qs(t){const e=t.previousElementSibling;return e&&"rect"===e.tagName.toLowerCase()?[e,t]:[t]}function Js(t,e){return null!=e&&0!==e&&t/e>1}function tr(t,e){const i=Vn(t)?t.y:Array.isArray(t)?t[1]:t;return"number"==typeof i?i:null!=e?e:null}function er(t,e,i){return t?t.replace(/([MLQCT])([^MLQCTZz]*)/g,(t,i,n)=>{const s=n.trim().split(/[\s,]+/).filter(Boolean).map(Number);for(let t=0;t+1<s.length;t+=2)s[t]=e(s[t]);return`${i} ${s.join(" ")} `}):t}g.default.registerFeatures({highlightFilter:class{constructor(t,e){var i,n,s,r;this.w=t,this.ctx=e,this._targets=new Map,this._render=null,this._seen=new Set,this._seriesEls=new Map,this._cu=null,this._stk=new Map,this._stkPrev=[],this._br=null,this._held=!1,this._warned=new Set,this._rows=[],this._level=null,this._live=new Set,this._sig="",this._drawnSig="",this._ride=null,this._tiles=null,this._tmDefs=[],this._tipUser=null==(n=null==(i=e.opts)?void 0:i.tooltip)?void 0:n.enabled,this._tipOn=!1,this._ind=void 0,this._lane=null,this._onRender=()=>this.afterRender(),null==(s=e.events)||s.addEventListener("mounted",this._onRender),null==(r=e.events)||r.addEventListener("updated",this._onRender)}get cfg(){return this.w.config.highlightFilter||{}}isActive(){var t;return!!(null==(t=this.w.highlightData)?void 0:t.active)}canDrawParts(){const t=this.w,e=t.config,i=e.chart.type;return t.globals.axisCharts?!(t.globals.comboCharts||"bar"!==i&&"line"!==i&&"area"!==i&&"treemap"!==i||t.rangeData.seriesRange.length||"histogram"===e.chart.requestedType):gs.indexOf(i)>-1||"radialBar"===i}callerCarriesParts(){const t=this.w;return t.globals.axisCharts?(t.config.series||[]).some(Us):Array.isArray(this.cfg.data)||ls(t.config.series||[]).some(t=>"highlight"in t)}valueAt(t,e){var i,n,s;const r=null==(s=null==(n=null==(i=this.w.highlightData)?void 0:i.parts)?void 0:n[t])?void 0:s[this.w.globals.axisCharts?e:0];return null==r?null:r}_warn(t,e){this._warned.has(t)||(this._warned.add(t),console.warn("ApexCharts highlightFilter: "+e))}parse(){var t,e,i;const n=this.w,s=n.config,r=this.cfg,a=s.series||[],o=n.seriesData.series||[];if(!n.globals.axisCharts)return this._parseCircle();const l=!!s.chart.stacked,c=s.chart.type,h="bar"===c,d=function(t,e){const i=t.w.globals;if("treemap"!==e||!i.treemapRoots)return!1;const n=i.treemapRawSeries||[];n.some(t=>Array.isArray(null==t?void 0:t.highlightData))&&t._warn("nested","on a nested treemap put the part on each leaf as { x, y, highlight }; highlightData is ignored.");const s=t=>Vn(t)&&Array.isArray(t.children)&&t.children.length>0&&("highlight"in t||t.children.some(s));return n.some(t=>((null==t?void 0:t.data)||[]).some(s))&&t._warn("parent","a parent's highlight is ignored: parents add up their leaves' parts."),!0}(this,c),u=us(n);let p=!1;for(let e=0;e<a.length;e++)if(d?cs({data:null==(t=a[e])?void 0:t.data}):Us(a[e])||u&&ps(n,e)){p=!0;break}let f=n.globals.axisCharts&&this.canDrawParts();p&&!f&&this._unsupported();const g=(n.globals.seriesYAxisMap||[]).map((t,e)=>t&&t.length?e:-1).filter(t=>t>-1);p&&f&&l&&(g.length>1||g.some(t=>{var e;return null==(e=s.yaxis[t])?void 0:e.logarithmic}))&&(f=!1,this._warn("stack","parts are not drawn on a stacked chart with more than one y axis or a logarithmic y axis."));const m=!(!1===r.enabled||!p||!f);if(!m)return void this._inactive(f);const y=[];let x=!1,_=!1;const b=n.globals;for(let t=0;t<o.length;t++){const e=a[t]||{},i=Array.isArray(e.data)?e.data:[],s=!d&&Array.isArray(e.highlightData),r=d?null:s?e.highlightData:u?ps(n,t):null,l=b.collapsedSeriesIndices.indexOf(t)>-1||b.ancillaryCollapsedSeriesIndices.indexOf(t)>-1;r&&!l&&r.length!==i.length&&(s?x=!0:_=!0);const c=[],h=o[t]?o[t].length:0;for(let t=0;t<h;t++){const e=Ks(i[t],r,t);c.push(Un(e)?l?0:e:null)}y.push(c)}m&&x&&this._warn("length","highlightData and data differ in length; the extra entries are ignored and the missing ones read as null."),m&&_&&this._warn("plugged-length","a plugin registered highlight parts that do not line up with the series data; the extra entries are ignored and the missing ones read as null.");const v=a.some(t=>Array.isArray(null==t?void 0:t.highlightData));v&&(null==(e=s.chart.dataReducer)?void 0:e.enabled)&&this._warn("reducer","highlightData cannot follow chart.dataReducer; put the part on each point as { x, y, highlight } instead."),v&&(null==(i=s.chart.streaming)?void 0:i.enabled)&&this._warn("stream","highlightData cannot follow chart.streaming; put the part on each point as { x, y, highlight } instead.");const w=m&&"clamp"!==r.axis&&"treemap"!==c&&!s.plotOptions.bar.isFunnel&&!(l&&"100%"===s.chart.stackType);let A=null;if(l&&h)A=(t,e)=>this._barKey(t,e);else if(l){const t=n.seriesData.seriesX;A=(e,i)=>{var s;return String(n.axisFlags.isXNumeric?null==(s=t[e])?void 0:s[i]:i)}}const M=w?this._runningExt(y,A,h):null;this._publish(y,M)}_unsupported(){const t=this.w.config.chart;this._warn("type",`parts are not drawn on this chart (type "${t.requestedType||t.type}"). Supported: column, bar, line and area (stacked too), funnel, pie, donut, polarArea, radialBar, gauge and treemap.`)}_inactive(t){t||(this._targets=new Map),this.w.highlightData={active:!1,parts:[],ext:null,capture:()=>this.capture()},this._sig="",this._rows=[]}_parseCircle(){const t=this.w,e=t.config,i=this.cfg,n=t.globals,s=(t.seriesData.series||[]).length,r=ls(e.series);let a=r.some(t=>"highlight"in t);a&&r.length!==s&&(this._warn("points","per-point highlight values do not line up with the slices; use highlightFilter.data instead."),a=!1);let o=Array.isArray(i.data)?i.data:null;o&&o.length!==s&&(this._warn("length",`highlightFilter.data has ${o.length} values for ${s} slices; it is ignored until they match.`),o=null),o&&o.some(t=>Array.isArray(t))&&(o.some(t=>Array.isArray(t)&&1!==t.length)?(this._warn("rows","highlightFilter.data takes one value per slice (or ring); a row of several values is ignored."),o=null):o=o.map(t=>Array.isArray(t)?t[0]:t));const l=e.chart.type,c=gs.indexOf(l)>-1||"radialBar"===l,h=a||!!o;if(h&&!c&&this._unsupported(),!1===i.enabled||!h||!c)return void this._inactive(c);const d=[];for(let t=0;t<s;t++){const e=a?r[t]:null,i=e&&"highlight"in e?e.highlight:o?o[t]:null;d.push([Un(i)?n.collapsedSeriesIndices.indexOf(t)>-1?0:i:null])}this._publish(d,null)}_publish(t,e){const i=this.w.globals;this.w.highlightData={active:!0,parts:t,ext:e,capture:()=>this.capture()};const n=this._rows,s=[];for(let e=0;e<t.length;e++){const r=i.collapsedSeriesIndices.indexOf(e)>-1||i.ancillaryCollapsedSeriesIndices.indexOf(e)>-1;s.push(r&&e<n.length?n[e]:t[e].join(","))}this._rows=s,this._sig="#"+s.join("|")}capture(){const t=this.w.globals,e=new Map;this._targets.forEach((t,i)=>{var n,s,r,a,c,h,d;if(t.c&&!t.run)return;const u=t.n,p=!!(null==u?void 0:u.isConnected);e.set(i,l(o({},t),{d:p&&u.getAttribute("d")||t.d,a:(null==(n=t.m)?void 0:n.isConnected)&&t.m.getAttribute("d")||t.a,flip:p?u.classList.contains(Ws)||u.classList.contains(zs):t.flip,f:null!=(s=t.lf)?s:t.f,o:null!=(r=t.lo)?r:t.o,s:null!=(a=t.ls)?a:t.s,col:null!=(c=t.lc)?c:t.col,al:null!=(h=t.la)?h:t.al,k:null!=(d=t.lk)?d:t.k,n:null,m:null,g:null,lb:null}))}),t.prevHighlightParts=e,t.prevHighlightLabels=this._captureLabels(),this._targets=new Map}_prev(){return this.w.globals.prevHighlightParts}_animates(){const t=this.ctx.renderer;return(!t||!t.kind||"svg"===t.kind)&&this._animatesUpdate()&&!!this.w.globals.shouldAnimate}_animatesUpdate(){const t=this.w,e=t.config.chart.animations;return!(!(M.isBrowser()&&e.enabled&&e.dynamicAnimation.enabled&&t.globals.dataChanged)||w())}_tween(t,e,i,n,s,r){const a=this.w,o=s||function(t){var e,i;const n=t.config.chart.animations;return k(null!=(i=null==(e=n.dynamicAnimation)?void 0:e.easing)?i:n.easing)}(a),l=this._live;let c=!1;const h={finish(){c||(c=!0,l.delete(h),i(1),n&&n())}};this._hold(h);const d=performance.now()+t,u=t=>{if(c)return;if(a.globals.isDestroyed)return c=!0,void l.delete(h);const n=Math.max(0,Math.min(1,(t-d)/e));i(o(n)),n<1?A.requestAnimationFrame(u):h.finish()};i(0),r?r.animate(e,t).during(t=>c||i(t)).after(()=>h.finish()):A.requestAnimationFrame(u)}_hold(t){const e=this._live,i=this.w.globals;e.add(t),i.highlightTween={finish:()=>Array.from(e).forEach(t=>t.finish())}}bar(t,e){var i,n,s,r,a,l,c,h;const d=this.w,u=d.highlightData;if(!u)return;this._render!==t&&this._beginRender(t,Ys);const p=this._prev(),f=u.active;if(!f&&!(null==p?void 0:p.size))return;const{j:g,realIndex:m}=e,y=Ys+`${m}::${t._keys(m)[g]}`;this._seen.add(y);const x=null==p?void 0:p.get(y),_=f?null==(i=u.parts[m])?void 0:i[g]:null;if(!f&&!x)return;const b=this.cfg,v=f?null!=(n=b.fadeOpacity)?n:.2:1,w=null==(s=d.seriesData.series[m])?void 0:s[g],A=!!d.config.chart.stacked,M=f&&A?this._stackGeometry(t,e,_,w,x):null==_?null:this._barGeometry(t,e,_,w),k={paint:(i,n)=>this._paintBar(e,i,n,{key:y,prev:x,geo:M,fadeTo:v,active:f,whole:w,bar:A?t:null})};if(f){const t={};"part"===(null!=(a=null==(r=b.dataLabels)?void 0:r.value)?a:"part")&&Object.assign(t,null==_?{hide:!0}:o({val:null!=(l=null==M?void 0:M.val)?l:_},null==M?void 0:M.label)),A&&"part"===(null!=(h=null==(c=b.dataLabels)?void 0:c.total)?h:"part")&&(t.total=M.total(null!=t.val?t.val<0:w<0)),k.label=t}return k}_beginRender(t,e){var i;this._render=t,this._targets=new Map,this._seen=new Set,this._seriesEls=new Map,this._cu=new m(this.w),this._stk=new Map,this._stkPrev=[],this._br=null,this._held=!1,e===Ys&&!this.w.config.chart.stacked&&(null==(i=this._prev())?void 0:i.size)&&Promise.resolve().then(()=>this._orphans())}_orphans(){const t=this.w,e=this._prev();e&&!t.globals.isDestroyed&&this._animates()&&e.forEach((e,i)=>{var n;if(this._seen.has(i)||0!==i.indexOf(Ys))return;const s=i.slice(2),r=this._seriesEls.get(s.slice(0,s.indexOf("::")));if(!r)return;const a=Array.from(r.querySelectorAll(".apexcharts-bar-ghost")).find(t=>t.getAttribute("data:ghostKey")===s);if(!a)return;if(a.setAttribute("fill-opacity",String(e.f)),!e.d)return;const o=new _(t,this.ctx).drawPath({d:e.d,stroke:"none",strokeWidth:0,fill:Qn(a.getAttribute("fill"))[0],fillOpacity:null!=(n=e.al)?n:1,classes:`${Yn} apexcharts-highlight-ghost`}).node;o.setAttribute("pointer-events","none"),o.setAttribute("clip-path",a.getAttribute("clip-path")||""),a.after(o);const l=a.style.transformOrigin||"",c=/^(left|right)/.test(l),h=parseFloat(a.getAttribute("data:ghostEdge")||""),[d]=Vs(e.d,c?0:1),u=o.style;u.transformBox="fill-box",u.transformOrigin=isFinite(h)?c?h-d+"px 50%":`50% ${h-d}px`:l;const p=()=>{a.parentNode&&!t.globals.isDestroyed?(u.transform=a.style.transform,u.opacity=a.style.opacity,A.requestAnimationFrame(p)):o.remove()};p()})}_barGeometry(t,e,i,n){const s=this.w,{j:r,realIndex:a,translationsIndex:o,paths:l}=e,c=t.barHelpers,h=c.getStrokeWidth(e.i,r,a);if(t.isFunnel){const t=n?Math.min(Math.abs(i/n),1):0,e=s.layout.gridWidth/2;return{pathTo:er(l.pathTo,i=>e+(i-e)*t),base:er(l.pathTo,()=>e),overflow:!1}}const d=s.config.yaxis[s.globals.seriesYAxisReverseMap[a]],u=(null==d?void 0:d.logarithmic)&&!s.globals.invalidLogScale&&this._cu?Math.max(0,this._cu.getLogValAtSeriesIndex(i,a)):i;if(t.isHorizontal){const t=e.zeroW,s=c.getXForValue(u,e.zeroW),o=this._rect(c,{a:l.barYPosition,len:l.barHeight,v1:t,v2:s,strokeWidth:h,realIndex:a,j:r,dir:u>=0?1:-1,horizontal:!0});return{pathTo:o.pathTo,base:o.base,overflow:Js(i,n),label:{x:s,barWidth:Math.abs(s-t)}}}const p=e.zeroH,f=c.getYForValue(u,e.zeroH,o),g=this._rect(c,{a:l.barXPosition,len:l.barWidth,v1:p,v2:f,strokeWidth:h,realIndex:a,j:r,dir:u>=0?1:-1,horizontal:!1});return{pathTo:g.pathTo,base:g.base,overflow:Js(i,n),label:{y:f,barHeight:Math.abs(f-p)}}}_rect(t,e){const i=((Array.isArray(e.strokeWidth)?e.strokeWidth[e.realIndex]:e.strokeWidth)||0)/2,n=e.v2-e.v1;if(Math.abs(n)<2*i){const s=e.v1+n/2,r=i*e.dir*(t.barCtx.isReversed?-1:1)*(e.horizontal?-1:1);e=l(o({},e),{v1:s+r,v2:s-r})}return t.barRect(e)}_stackGeometry(t,e,i,n,s){var r,a;const o=this.w,{j:l,realIndex:c,translationsIndex:h,paths:d}=e,u=t.barHelpers,p=t.isHorizontal,f=p?e.zeroW:e.zeroH;this._br||(this._br=u.createBorderRadiusArr(((null==(r=o.highlightData)?void 0:r.parts)||[]).map(t=>t.map(t=>null!=t?t:0))),I.isSafari()&&(this._br=this._br.map(t=>t.map(()=>"none"))));const g=this._br,m=this._barKey(c,l);let y=this._stk.get(m);y||(y={p:f,n:f,raw:0,any:!1},this._stk.set(m,y));const x="100%"===o.config.chart.stackType,_=o.seriesData.stackedSeriesTotals[l],b=null==i?null:x?_?100*i/_:0:i,v=null!=b?b:0,w=null!=b?b<0:null!=(null==s?void 0:s.s)?s.s<0:n<0,A=(t,e)=>p?u.getXForValue(t,e):u.getYForValue(t,e,h);let M=w?y.n:y.p,k=A(v,M);w?y.n=k:y.p=k,null!=i&&(y.raw+=i,y.any=!0);const L=y.raw,S=y.any,C={p:y.p,n:y.n};let E=!1;if(x){const t=A(100,f),e=A(-100,f),i=Math.min(t,e),n=Math.max(t,e),s=t=>Math.min(n,Math.max(i,t));E=s(k)!==k,M=s(M),k=s(k),C.p=s(C.p),C.n=s(C.n)}const F=u.arrBorderRadius;let D;u.arrBorderRadius=g;try{D=this._rect(u,{a:p?d.barYPosition:d.barXPosition,len:p?o.globals.barHeight:o.globals.barWidth,v1:M,v2:k,strokeWidth:p?u.getStrokeWidth(e.i,l,c):t.strokeWidth,realIndex:c,j:l,dir:w?-1:1,horizontal:p})}finally{u.arrBorderRadius=F}return{pathTo:null==i?null:D.pathTo,square:D.squarePathTo,base:D.base,flip:null!=i&&t.cornerFlip(null==(a=g[c])?void 0:a[l],v),s:w?-1:1,overflow:E,val:b,label:p?{x:k,barWidth:Math.abs(k-M)}:{y:k,barHeight:Math.abs(k-M)},total:t=>!!S&&{val:L,edge:t?C.n:C.p}}}_barKey(t,e){var i;const n=this.w;return n.labelData.seriesGroupIndex[t]+"|"+(n.axisFlags.isXNumeric?null==(i=n.seriesData.seriesX[t])?void 0:i[e]:e)}line(t,e,i,n,s,r,a){var c,h;const d=this.w,u=d.highlightData;if(!u||"line"!==e&&"area"!==e)return;this._render!==t&&this._beginRender(t,"l:");const p=this._prev(),f=u.active;if(!f&&!(null==p?void 0:p.size))return;const g="l:"+s,m=null==p?void 0:p.get(g);if(!f&&!m)return;const y=d.globals,x=this._animates(),_="area"===e,b=f&&u.parts[s]||[],v=b.some(t=>null!=t),w=f&&t._shapeOnly,A=(t,e)=>t&&(t._cmd?t._cmd[e]:t.node.getAttribute(e)),M=t.marks||[],L=_?M.find(t=>"none"!==A(t,"fill")):null,S=M.find(t=>t!==L),[C,E]=L&&d.config.chart.stacked?Qn(A(L,"fill")):[L&&A(L,"fill"),1],F=M.concat(_?M.filter(t=>t!==L&&!t._cmd).map(t=>t.node.nextElementSibling).filter(t=>/#forecastMask/.test((null==t?void 0:t.getAttribute("clip-path"))||"")).map(t=>({node:t})):[]),D=f&&!w&&(v||d.config.chart.stacked)?this._lineBuild(t,e,i,n,s,r,this._partRow(b,n,s)):null;let P=w?{d:a.linePaths.join(" "),a:a.areaPaths.join(" ")}:v?{d:D.linePaths.join(" "),a:D.areaPaths.join(" "),num:D.numericXY}:null;const R=!P&&!!(null==m?void 0:m.d)&&x,T=f&&x&&(R||P&&!(null==m?void 0:m.d)&&(m||"baseline"===this.cfg.enter))?this._lineBase(t,e,i,n,s,r,v?b:null):null;D&&d.config.chart.stacked&&(this._swap(t,()=>t._recordStackTops(s,D.yArrj,D.S[n])),this._stkPrev.push(D.yArrj)),R&&(P=f?T:{d:a.linePaths.join(" "),a:a.areaPaths.join(" ")});const N=R&&!f;let O=P;const I={};let B=null,z=!1;if(P&&x)if(null==m?void 0:m.d){if(O={d:m.d,a:m.a||P.a},!R)if(B=function(t,e,i,n){var s;const r=t.globals,a=r.prevStreamFrame;if(!a||!r.dataChanged||!(null==(s=t.axisFlags)?void 0:s.isXNumeric))return null;const o=a.seriesX[e],l=a.seriesY[e],c=t.seriesData.seriesX[e],h=t.seriesData.series[e];if(!(o&&l&&c&&h))return null;if(o.length<3||c.length<3)return null;let d=-1;for(let t=0;t<o.length;t++)if(o[t]===c[0]){d=t;break}if(-1===d)return null;const u=Math.min(o.length-d,c.length);if(u<2)return null;const p=c.length-u;if(0===d&&0===p)return null;for(let t=0;t<u;t++){if(o[d+t]!==c[t])return null;const e=l[d+t],i=h[t];if(e!==i&&(null!=e||null!=i))return null}const f=a.xPixels[e],g=a.yPixels[e];if(!f||!g)return null;let m=-1,y=-1;for(let t=0;t<u;t++)null!=f[d+t]&&null!=g[d+t]&&null!=i[t]&&null!=n[t]&&(-1===m&&(m=t),y=t);if(-1===m||y<=m)return null;const x=i[m],_=i[y],b=f[d+m],v=f[d+y];if(Math.abs(_-x)<1e-6)return null;const w=(v-b)/(_-x),A=b-w*x;if(!isFinite(w)||!isFinite(A))return null;if(Math.abs(w-1)>.02)return null;if(Math.abs(A)<.5)return null;let M=m,k=m;for(let t=m;t<=y;t++){const e=n[t];null!=e&&null!=g[d+t]&&(e<n[M]&&(M=t),e>n[k]&&(k=t))}let L=1,S=0;const C=n[M],E=n[k];if(Math.abs(E-C)>1e-6?(L=(g[d+k]-g[d+M])/(E-C),S=g[d+M]-L*C):S=g[d+M]-C,!isFinite(L)||!isFinite(S)||L<.2||L>5)return null;const F=Math.floor((m+y)/2);if(F!==m&&F!==y&&null!=i[F]&&null!=f[d+F]){const t=w*i[F]+A;if(Math.abs(t-f[d+F])>1.5)return null;if(null!=n[F]&&null!=g[d+F]){const t=L*n[F]+S;if(Math.abs(t-g[d+F])>1.5)return null}}return r.streamScrolled=!0,{ax:w,bx:A,ay:L,by:S}}(d,s,a.xArrj,a.yArrj),B)O={d:jn(P.d,B),a:jn(P.a,B)};else{const t=D||a,i=$(d,{type:e,realIndex:s,pathFromLine:m.d,pathFromArea:m.a||"",linePaths:t.linePaths,areaPaths:t.areaPaths});(null==i?void 0:i.line)&&([O.d,I.d]=[i.line.from,i.line.toInterp]),(null==i?void 0:i.area)&&([O.a,I.a]=[i.area.from,i.area.toInterp])}}else T?O=T:(z=!0,O={d:(null==S?void 0:S.node.getAttribute("pathFrom"))||P.d,a:(null==L?void 0:L.node.getAttribute("pathFrom"))||P.a});let W=null,H=null,j=null;if(P){const i=this._partGroup(t.elSeries,"apexcharts-line-highlight"),r=P.num,a={i:n,j:"h",realIndex:s,delay:n,speed:d.config.chart.animations.dynamicAnimation.speed,cls:`apexcharts-${e} apexcharts-line-highlight-part`,chartType:e,clip:`url(#gridRectMask${y.cuid})`,scroll:!!B};if(L&&(W=this._emitPart(i,l(o({},a),{from:O.a,to:P.a,interp:I.a,paint:C,num:r&&{xs:r.xs,ys:r.ys,closeY:r.areaCloseY}}))),S){const e=l(o({},a),{from:O.d,to:P.d,interp:I.d,paint:"none",stroke:A(S,"stroke"),width:t.strokeWidth,num:r&&{xs:r.xs,ys:r.ys}});H=this._emitPart(i,e),null==H||H.attr("fill-rule","evenodd");const n=!S._cmd&&S.node.getAttribute("clip-path");if(H&&n&&n.indexOf("nonForecast")>-1){const t=d.config.forecastDataPoints;H.attr("clip-path",n),j=this._emitPart(i,l(o({},e),{j:"hf",clip:`url(#forecastMask${y.cuid})`})),null==j||j.attr({"fill-rule":"evenodd","stroke-dasharray":t.dashArray,"stroke-width":t.strokeWidth||void 0})}}const c=this.ctx.renderer;c&&c.kind&&"svg"!==c.kind||!d.config.chart.animations.enabled||y.resized||y.dataChanged||[H,_&&S].forEach(t=>{const e=t&&t.node.getAttribute("stroke-dasharray");!t||e&&"0"!==e||t.node.setAttribute("stroke-dasharray","none")})}const Y={d:null,a:null,f:1,o:f?1:0,n:R?null==H?void 0:H.node:null,m:R?null==W?void 0:W.node:null,c:!f};this._targets.set(g,Y);const q=z?E:(null==m?void 0:m.d)&&null!=(c=m.al)?c:1,X=N?E:1;Y.al=X,this._fadeLine(e,F,z?Gs:m?{f:m.f,o:null!=(h=m.o)?h:0}:qs,N?Gs:f?Xs:qs,{width:t.strokeWidth,also:W&&(q<1||X<1)?t=>{const e=Kn(q,X,t);Y.la=e,W.node.setAttribute("fill-opacity",String(e))}:void 0,force:!!W&&q!==X,land:N?qs:void 0,done:R?()=>{null==H||H.remove(),null==j||j.remove(),null==W||W.remove()}:void 0,rec:Y,ease:B?k("linear"):void 0}),P&&!R&&Object.assign(Y,{d:P.d,a:P.a,n:null==H?void 0:H.node,m:null==W?void 0:W.node}),this._lineLabels(t,e,n,s,b,D,a)}_partRow(t,e,i){const n=this.w,s=this._cu,r=n.config.yaxis[n.globals.seriesYAxisReverseMap[i]],a=(null==r?void 0:r.logarithmic)&&!n.globals.invalidLogScale?t.map(t=>s.getLogValAtSeriesIndex(t,i)):t.slice(),o=n.config.fill.type,l=a.length-1;return"gradient"!==o&&"gradient"!==o[e]||null==a[l]||!a.every(t=>t===a[0])||(a[l]+=1e-6),a}_lineBuild(t,e,i,n,s,r,a){const o=this.w.globals.pointsArray,l=o[s],c=l?l.length:0,h=[t._shapeOnly,t.appendPathFrom],d=i.slice();d[n]=a,t._shapeOnly=!0;try{const i=this._swap(t,()=>t._buildSeriesPaths(e,d,n,s,r));return i.S=d,i}finally{[t._shapeOnly,t.appendPathFrom]=h,l?l.length=c:delete o[s]}}_swap(t,e){if(!this.w.config.chart.stacked)return e();const i=[t.prevSeriesYByX,t.prevSeriesY];t.prevSeriesYByX=this._stk,t.prevSeriesY=this._stkPrev;try{return e()}finally{[t.prevSeriesYByX,t.prevSeriesY]=i}}_lineBase(t,e,i,n,s,r,a){const o=(a||i[n]).map(t=>null==t?null:0),l=this._lineBuild(t,e,i,n,s,r,o);return{d:l.linePaths.join(" "),a:l.areaPaths.join(" "),num:l.numericXY}}_fadeLine(t,e,i,n,s){var r,a,o,l,c,h,d;const u=this.cfg,p=null!=(r=u.fadeOpacity)?r:.2,f=null!=(o=null==(a=u.outline)?void 0:a.width)?o:1,g=null!=(c=null==(l=u.outline)?void 0:l.opacity)?c:1,m=null!=(d=null==(h=u.line)?void 0:h.dashArray)?d:4,y=s.rec,x=["fill-opacity","stroke-opacity","stroke-width","stroke-dasharray"],_=e.map(e=>{var i;const n=e.node,s=x.map(t=>n.getAttribute(t)),r=parseFloat(null!=(i=s[0])?i:"1");return{node:n,own:s,k:isFinite(r)?r:1,fill:"area"===t&&"none"!==(e._cmd?e._cmd.fill:n.getAttribute("fill"))}}),b=(e,i)=>{y.lf=e,y.lo=i,_.forEach(({node:n,own:r,k:a,fill:o})=>{e>=1&&i<=0?x.forEach((t,e)=>null==r[e]?n.removeAttribute(t):n.setAttribute(t,r[e])):o?n.setAttribute("fill-opacity",String(a*e*Kn(1,p,i))):"area"===t?(n.setAttribute("stroke-opacity",String(e*Kn(1,g,i))),n.setAttribute("stroke-width",String(Kn(s.width,f,i)))):(n.setAttribute("stroke-opacity",String(e)),n.setAttribute("stroke-dasharray",i<1?`${m} ${m*i}`:String(m)))})},v=t=>{b(Kn(i.f,n.f,t),Kn(i.o,n.o,t)),s.also&&s.also(t)},w=()=>{y.run=!1,s.land&&b(s.land.f,s.land.o),s.done&&s.done()};this._animates()&&(i.f!==n.f||i.o!==n.o||s.done||s.force)?(y.run=!0,this._tween(0,this.w.config.chart.animations.dynamicAnimation.speed,v,w,s.ease)):(v(1),w())}_lineLabels(t,e,i,n,s,r,a){var o,l,c,h;const d=this.w,u=d.globals,p=t.elDataLabelsWrap;if(!d.config.dataLabels.enabled||!(null==p?void 0:p.node)||t._shapeOnly)return;const f=(null==(o=d.highlightData)?void 0:o.active)&&"part"===(null!=(c=null==(l=this.cfg.dataLabels)?void 0:l.value)?c:"part");if(f){const a=p.node;for(;a.firstChild;)a.removeChild(a.firstChild);const o=u.dataLabelsRects;if(o[n]=[],u.lastDrawnDataLabelsIndexes[n]=[],r&&s.some(t=>null!=t)){const a=new Wn(d,this.ctx);for(let l=0;l<r.xArrj.length-1;l++){const c=t.lineHelpers.calculatePoints({series:r.S,x:r.xArrj[l+1],y:r.yArrj[l+1],realIndex:n,i:i,j:l,prevY:r.yArrj[0]});c.x.forEach((t,i)=>{if(null==s[l?l+1:i])return void o[n].push({x:NaN,y:NaN,width:0,height:0});const r=a.drawDataLabel({type:e,pos:{x:l?[t]:i?[NaN,t]:[t,NaN],y:c.y},i:n,j:l?l+1:1,row:s});r&&p.add(r)})}}}const g=f?null==r?void 0:r.xArrj:a.xArrj,m=f?null==r?void 0:r.yArrj:a.yArrj;if(!this._animates()||!g||O(d,n))return;const y=u.riseLabels;if(null==y?void 0:y.has(n)){const t=new Map(y);t.delete(n),u.riseLabels=t.size?t:null}const x=u.prevStreamFrame,_=null==(h=u.prevHighlightLabels)?void 0:h.get(n);Promise.resolve().then(()=>{var t,e;return this._rideLabels(p.node,g,m,_,[null==(t=null==x?void 0:x.xPixels)?void 0:t[n],null==(e=null==x?void 0:x.yPixels)?void 0:e[n]])})}_captureLabels(){const t=this.w,e=t.config.chart.type,i=t.dom.baseEl,n=gs.indexOf(e)>-1;if(!t.config.dataLabels.enabled||"line"!==e&&"area"!==e&&!n||!i||!M.isBrowser())return null;const s=new Map;if(n){const t=new Map;return i.querySelectorAll(".apexcharts-pie-label").forEach(e=>{const[i,n]=ts(e);t.set(Number(e.parentNode.getAttribute("data:slice")),{x:i,y:n})}),s.set(-1,t),s}return i.querySelectorAll(".apexcharts-datalabels[data\\:realIndex]").forEach(e=>{const i=Number(e.getAttribute("data:realIndex")),n=t.globals.seriesXvalues[i]||[],r=new Map;e.querySelectorAll(`text.apexcharts-datalabel, text.${js}`).forEach(t=>{var e;const i=Zs(n,parseFloat(t.getAttribute("cx")));if(i<0)return;const[s,a]=ts(t);r.set(i,{x:s,y:a,o:parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1"),els:Qs(t)})}),s.set(i,r)}),s}_rideLabels(t,e,i,n,s){const r=this.w;if(r.globals.isDestroyed||!t.isConnected)return;const[a,o]=s,l=[],c=new Set,h=t=>"number"==typeof t&&isFinite(t);if(t.querySelectorAll("text.apexcharts-datalabel").forEach(t=>{const s=Zs(e,parseFloat(t.getAttribute("cx")));if(s<0)return;const[r,d]=ts(t),u=null==n?void 0:n.get(s);let p=0,f=0,g=0;u?(c.add(s),p=u.x-r,f=u.y-d,g=u.o):!(null==n?void 0:n.size)&&[null==a?void 0:a[s],null==o?void 0:o[s],e[s],i[s]].every(h)&&(p=a[s]-e[s],f=o[s]-i[s]),(g<1||Math.abs(p)>.01||Math.abs(f)>.01)&&l.push({els:Qs(t),dx:p,dy:f,o:g,to:1})}),null==n||n.forEach((e,i)=>{if(c.has(i))return;const n=e.els.map(e=>{const i=e.cloneNode(!0);return i.setAttribute("class",js),i.setAttribute("pointer-events","none"),i.removeAttribute("transform"),t.appendChild(i),i}),[s,r]=ts(n[n.length-1]);l.push({els:n,dx:e.x-s,dy:e.y-r,o:e.o,to:0,out:!0})}),!l.length)return;l.forEach(t=>{t.bases=t.els.map(t=>t.getAttribute("transform")||""),t.ops=t.els.map(e=>{var i;return parseFloat(null!=(i=e.getAttribute("opacity"))?i:"1")/(t.out&&t.o>0?t.o:1)})});this._tween(0,r.config.chart.animations.dynamicAnimation.speed,t=>l.forEach(({els:e,dx:i,dy:n,o:s,to:r,out:a,bases:o,ops:l})=>e.forEach((e,c)=>{const h=o[c],d=a?1:1-t;d?e.setAttribute("transform",`translate(${i*d} ${n*d}) ${h}`.trim()):h?e.setAttribute("transform",h):e.removeAttribute("transform");const u=Kn(s,r,t),p=l[c];u>=1&&p>=1?e.removeAttribute("opacity"):e.setAttribute("opacity",String(p*u))})),()=>l.forEach(t=>t.out&&t.els.forEach(t=>t.remove())))}_paintBar(t,e,i,n){var s,r,a,o,l,c,h,d,u,p;const f=this.w,g=this.cfg,m=this._animates(),{key:y,prev:x,geo:b,fadeTo:v,active:w,bar:A}=n,M=i.elSeries;this._seriesEls.set(String(t.realIndex),M.node);let k=(null==b?void 0:b.pathTo)||null;const L=!k&&!!(null==x?void 0:x.d)&&m;L&&(k=this._exitTo(x,w,i.pathTo,null==b?void 0:b.base));const S=k&&!L?this._from(x,null==b?void 0:b.base,i.pathFrom,!!A):null;let C=S?S.d:(null==x?void 0:x.d)||null;const E=L&&!w;let F="apexcharts-bar-highlight-part",D=!1,P=null;if(A&&k){if(C&&C!==k){const t=A._pathToInterp;A._pathToInterp=null;const e=A.cornerMorph(C,k,L?void 0:b.square);e!==k&&(C=e,P=A._pathToInterp),A._pathToInterp=t}const t=A.isHorizontal?zs:Ws,i=e.node.classList.contains(t);D=L?w?!!x.flip:i:b.flip;const n=(null==x?void 0:x.d)?!!x.flip:!!(null==S?void 0:S.cover)&&i;(D||m&&n)&&(F+=" "+t),!D&&m&&n&&(F+=" "+Hs,this._settleHeld(A))}const R="string"==typeof i.fill&&"none"!==i.fill&&i.fill.indexOf("url")<0?i.fill:f.globals.colors[f.config.plotOptions.bar.distributed?t.j:t.realIndex],[T,N]=Qn(i.fill&&"none"!==i.fill?i.fill:R),O=t.j>0&&i.elBarShadows?i.elBarShadows.node.lastElementChild:null,$=x?x.f:1,I=this._partGroup(M,"apexcharts-bar-highlight"),B=k?this._emitPart(I,{i:t.i,j:t.j,realIndex:t.realIndex,from:C||k,to:k,interp:P,paint:T,delay:i.delay,speed:i.speed,cls:F,chartType:"bar",clip:`url(#gridRectBarMask${f.globals.cuid})`}):null,z=Zn(e.node),W=(null==S?void 0:S.cover)&&m?N:(null==x?void 0:x.d)&&null!=(s=x.al)?s:1,H=E?N:1,j=n.whole||(null==x?void 0:x.o)?null!=(a=null==(r=g.outline)?void 0:r.width)?a:1:0,Y=e.node,q=Y.getAttribute("stroke"),X=(null==S?void 0:S.cover)&&m?1:(null==x?void 0:x.d)&&null!=(o=x.k)?o:0,G=E?1:0,U=!!B&&j>0&&(X>0||G>0)&&parseFloat(Y.getAttribute("stroke-width"))>0&&!!q&&"none"!==q&&"transparent"!==q,K=Zn(Y,"stroke-opacity"),V={};U&&(["stroke","stroke-width","stroke-opacity","stroke-dasharray"].forEach(t=>{var e;V[t]=B.node.getAttribute(t),B.node.setAttribute(t,null!=(e=Y.getAttribute(t))?e:"")}),Y.hasAttribute("stroke-dasharray")||B.node.removeAttribute("stroke-dasharray"));const Z={d:null,f:v,base:null!=(l=null==b?void 0:b.base)?l:null==x?void 0:x.base,edge:!1,s:null!=(c=null==b?void 0:b.s)?c:null==x?void 0:x.s,n:L?null==B?void 0:B.node:null,c:!w,al:H,k:U?G:0};this._targets.set(y,Z);const Q=E?Xn:Gn(v);if(this._fade(e.node,(null==S?void 0:S.cover)&&m?Xn:x?{f:x.f,o:null!=(h=x.o)?h:Gn(x.f).o}:qn,n.whole?Q:{f:Q.f,o:0},i,{outline:j>0?{color:R,width:j,opacity:null!=(u=null==(d=g.outline)?void 0:d.opacity)?u:1}:null,also:t=>{null==O||O.setAttribute("fill-opacity",String(Kn($,v,t))),(t=>{const e=Kn(W,H,t);if(Z.la=e,B&&(z<1||W<1||H<1)&&B.node.setAttribute("fill-opacity",String(z*e)),!U)return;const i=Kn(X,G,t);Z.lk=i,i>0||t<1?(B.node.setAttribute("stroke-opacity",String(K*i)),!(Z.lo>0)&&i>0&&Y.setAttribute("stroke-opacity","0")):B.attr(V)})(t)},force:!!B&&(W!==H||U),land:E?qn:void 0,done:L?()=>null==B?void 0:B.remove():void 0,rec:Z}),!B||!k||L)return;if((null==b?void 0:b.overflow)&&B.node.classList.add("apexcharts-highlight-overflow"),(null==b?void 0:b.overflow)&&!A){const t=new _(f,this.ctx).drawPath({d:i.pathTo,stroke:"#fff",strokeWidth:1,fill:"none",strokeDashArray:3,classes:`${Yn} apexcharts-highlight-edge`});t.attr("clip-path",`url(#gridRectBarMask${f.globals.cuid})`),t.node.setAttribute("pointer-events","none"),I.add(t);const e=e=>t.node.setAttribute("stroke-opacity",String(.75*e));m&&!(null==x?void 0:x.edge)?this._tween(i.delayMs,i.speed,e):e(1)}const J=null==(p=this.ctx.renderer)?void 0:p.kind;J&&"svg"!==J||f.config.plotOptions.bar.isFunnel||this._hitProxy(I,k,i.pathTo,e.node,!!f.globals.isBarHorizontal),i.labels&&this._contrastLabels(i.labels,k),Object.assign(Z,{d:k,base:null==b?void 0:b.base,edge:!!(null==b?void 0:b.overflow)&&!A,s:null==b?void 0:b.s,flip:D,n:B.node})}_hitProxy(t,e,i,n,s){const r=s?0:1,[a,o]=Vs(e,r),[l,c]=Vs(i,r),[h,d]=Vs(e,r?0:1);if(!(o-a>.5&&d-h>.5))return;const u=[];c-l>.5?(a<l&&u.push([a,Math.min(o,l)]),o>c&&u.push([Math.max(a,c),o])):u.push([a,o]);const p=new _(this.w,this.ctx);for(const[e,i]of u){if(i-e<.5)continue;const r=p.drawPath({d:s?`M ${e} ${h} L ${i} ${h} L ${i} ${d} L ${e} ${d} Z`:`M ${h} ${e} L ${d} ${e} L ${d} ${i} L ${h} ${i} Z`,stroke:"none",strokeWidth:0,fill:"none",classes:"apexcharts-highlight-hit"}).node;r.setAttribute("pointer-events","all"),r.setAttribute("clip-path",`url(#gridRectBarMask${this.w.globals.cuid})`),is(n,r),t.add(r)}}_settleHeld(t){if(this._held)return;this._held=!0;const e=this.w;Promise.resolve().then(()=>{var i;e.globals.isDestroyed||(null==(i=e.dom.baseEl)?void 0:i.querySelector(`.apexcharts-series > .${Hs}`))||t.settleHeldMirrors()})}_from(t,e,i,n){var s;return(null==t?void 0:t.d)?{d:t.d,cover:!1}:e&&(t||"baseline"===this.cfg.enter||n&&(!this.w.globals.dataChanged||(null==(s=this._prev())?void 0:s.size)))?{d:e,cover:!1}:i?{d:i,cover:!0}:null}_exitTo(t,e,i,n){return e?n||t.base||t.d:i}_partGroup(t,e){let i=t.node._apxHighlight;return i&&i.node.parentNode===t.node||(i=new _(this.w,this.ctx).group({class:e}),t.node._apxHighlight=i),t.add(i),i}_emitPart(t,e){const i=this.w,n=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,new _(i,this.ctx)).renderPaths({i:e.i,j:e.j,realIndex:e.realIndex,pathFrom:e.from,pathTo:e.to,pathToInterp:e.interp||void 0,pathToNumeric:e.num,scrollMorph:!!e.scroll,stroke:e.stroke||"none",strokeWidth:e.width||0,fill:e.paint,animationDelay:e.delay,initialSpeed:i.config.chart.animations.speed,dataChangeSpeed:e.speed,className:`${Yn} ${e.cls}`,chartType:e.chartType,bindEventsOnPaths:!1});return n&&n.node?(n.attr("clip-path",e.clip),n.node.setAttribute("pointer-events","none"),n.node.setAttribute("index",String(e.realIndex)),n.node.setAttribute("j",String(e.j)),t.add(n),n):null}_fade(t,e,i,n,s){var r;const a=s.attr||"fill-opacity",o=Zn(t,a),l=s.outline,c=s.rec||{},h=l&&null==l.width?["stroke","stroke-opacity"]:["stroke","stroke-width","stroke-opacity"],d=h.map(e=>t.getAttribute(e)),u=(e,i)=>{c.lf=e,c.lo=l?i:0,t.setAttribute(a,String(o*e)),l&&(i<=0?h.forEach((e,i)=>null==d[i]?t.removeAttribute(e):t.setAttribute(e,d[i])):(t.setAttribute("stroke",l.color),null!=l.width&&t.setAttribute("stroke-width",String(l.width)),t.setAttribute("stroke-opacity",String(l.opacity*Math.min(1,i)))))},p=t=>{u(Kn(e.f,i.f,t),Kn(e.o,i.o,t)),s.also&&s.also(t)},f=()=>{c.run=!1,s.land&&u(s.land.f,s.land.o),s.done&&s.done()};(null!=(r=s.anim)?r:this._animates())&&(e.f!==i.f||e.o!==i.o||s.done||s.force)?(c.run=!0,this._tween(n.delayMs,n.speed,p,f,s.curve,n.el)):(p(1),f())}_runningExt(t,e,i){if(!e)return t;const n=new Map;return t.map((t,s)=>t.map((t,r)=>{if(null==t)return null;const a=e(s,r)+(i&&t<0?"-":"+"),o=(n.get(a)||0)+t;return n.set(a,o),o}))}_contrastLabels(t,e){const i=this.w,n=t.node;if(!n||/rotate\((?!0\))/.test(n.getAttribute("transform")||""))return;const[s,r]=Vs(e,0),[a,o]=Vs(e,1),l=new _(i);n.querySelectorAll("text").forEach(t=>{const e=(t.getAttribute("fill")||"").toLowerCase();if("#fff"!==e&&"#ffffff"!==e&&"white"!==e)return;const n=l.getTextRects(t.textContent,t.getAttribute("font-size"),t.getAttribute("font-family"),void 0,!0,t.getAttribute("font-weight")),c=parseFloat(t.getAttribute("x")),h=parseFloat(t.getAttribute("y")),d=t.getAttribute("text-anchor"),u="middle"===d?c-n.width/2:"end"===d?c-n.width:c;u>=s-1&&u+n.width<=r+1&&h-.75*n.height>=a-1&&h+.25*n.height<=o+1||t.setAttribute("fill",i.config.chart.foreColor)})}tooltipRow(t,e,i,n){var s,r,a,c,h,d,u,p,f,g,m;const y=this.w,x=this.cfg,_=x.tooltip||{},b=y.globals.axisCharts,v=this.isActive()&&!1!==_.show&&(null!=i||!b)&&!!t.yValue,w=b||"lanes"!==this._ind||"radialBar"!==y.config.chart.type?void 0:(null==(s=this._lane)?void 0:s[0])===e?this._lane[1]:"part";if(t.marker&&function(t,e,i=.2,n){const s=t.style,r=t.firstElementChild;if(!e){if(!t._apxHl)return;return t._apxHl=!1,s.background=s.boxShadow=s.borderRadius="",void(r&&(r.style.display=""))}t._apxHl=!0;const a="#"===e.charAt(0)?I.hexToRgba(e,i):`color-mix(in srgb, ${e} ${100*i}%, transparent)`;s.background="part"===n?e:n?a:`linear-gradient(90deg, ${e} 50%, ${a} 50%)`,s.boxShadow=`inset 0 0 0 1px ${e}`,s.borderRadius="3px",r&&(r.style.display="none")}(t.marker,v&&!y.config.tooltip.fillSeriesColor?(null==(a=null==(r=this._tiles)?void 0:r.get(e+"|"+i))?void 0:a.base)||y.globals.colors[e]:null,w?null!=(d=null==(h=null==(c=x.radialBar)?void 0:c.lanes)?void 0:h.opacity)?d:Ms:x.fadeOpacity,w),!v)return;const A=this.valueAt(e,i),M=y.seriesData.series,k=b?null==(u=M[e])?void 0:u[i]:M[e],L=b?{series:M,seriesIndex:e,dataPointIndex:i,w:y}:l(o({},y),{w:y,series:M,seriesIndex:e,dataPointIndex:e,highlight:Jn(A,k),lane:w});if("function"==typeof _.formatter)return void(t.yValue.innerHTML=String(null!=(p=_.formatter(A,null!=k?k:null,L))?p:""));const S='<span class="apexcharts-highlight-total" style="font-weight: 400; opacity: 0.6">';if("whole"===w){if(null!=A){const e=null!=(m=null==(g=null==(f=y.globals.locale)?void 0:f.highlightFilter)?void 0:g.part)?m:"part";t.yValue.innerHTML+=` ${S}(${e} ${n.yLbFormatter(A,L)})</span>`}return}let C=t.yValue.innerHTML;null!=A&&(C=`/ ${C}`,_.share&&k&&(C+=` \xb7 ${Math.round(A/k*100)}%`)),t.yValue.innerHTML=(null==A?"":`${n.yLbFormatter(A,L)} `)+`${S}${C}</span>`}drillView(t){Array.isArray(null==t?void 0:t.series)&&(t.series=t.series.map(os),this._level={series:t.series,base:this.w.globals.initialSeries}),t&&null!=this.cfg.data&&(t.highlightFilter=l(o({},t.highlightFilter),{data:null}))}_drilled(){var t;const e=this._level;return!!(e&&((null==(t=this.ctx.drilldown)?void 0:t.depth)||0)>0&&this.w.globals.initialSeries===e.base)}_fire(t){var e;const i=null==(e=this.w.config.chart.events)?void 0:e.highlightFilterChanged;"function"==typeof i&&i(this.ctx,{active:"clear"!==t,phase:t})}pie(t){"radialBar"===t.chartType?Ls(this,t):ms(this,t)}treemap(t){return $s(this,t)}afterRender(){this._tipOn&&(this._tipOn=!1,this.w.config.tooltip.enabled=!1);const t=this._ride;this._ride=null;const e=this.w.globals.circleTween;!t||e&&!e.done||t();const i=this._drawnSig,n=this._sig;i!==n&&(this._drawnSig=n,this._fire(i?n?"update":"clear":"enter"))}set(t,e={}){var i;const n=this.w,s=n.globals;if(!s.axisCharts)return this._setCircle(t,e);const r=e.series||this._rawSeries();if("treemap"===n.config.chart.type&&s.treemapRoots)return this._apply(function(t,e,i){const n=t.w;return e.map((t,e)=>{const s=os(t),r=Array.isArray(null==i?void 0:i[e])?i[e]:null;if("function"!=typeof i&&!r)return s;let a=0;const c=s=>{var h,d,u;if(Vn(s)&&Array.isArray(s.children)&&s.children.length)return l(o({},s),{children:s.children.map(c)});const p=a++,f=Vn(s)?o({},s):{x:"",y:s};return f.highlight="function"==typeof i?i({seriesIndex:e,dataPointIndex:p,seriesName:t.name,x:null!=(h=f.x)?h:f.name,value:"number"==typeof(null!=(d=f.y)?d:f.value)?null!=(u=f.y)?u:f.value:null,datum:s,w:n}):null==r?void 0:r[p],f};return Array.isArray(s.data)&&(s.data=s.data.map(c)),s})}(this,r,t),e);const a=!e.series&&!!s.dataReducerRawSeries&&!!(null==(i=n.config.chart.dataReducer)?void 0:i.enabled),c=r.map((i,s)=>{const r=Array.isArray(i.data)?i.data:[],c="function"==typeof t?r.map((r,o)=>{var l;return t({seriesIndex:s,dataPointIndex:o,seriesName:i.name,x:Vn(r)?r.x:Array.isArray(r)?r[0]:n.labelData.labels[o],value:tr(r,e.series||a?null:null==(l=n.seriesData.series[s])?void 0:l[o]),datum:r,w:n})}):Array.isArray(null==t?void 0:t[s])?t[s]:null,h=os(i);return c&&(a&&h.data.every(t=>"number"!=typeof t)?h.data=h.data.map((t,e)=>null==t?t:Array.isArray(t)?{x:t[0],y:t[1],highlight:c[e]}:l(o({},t),{highlight:c[e]})):h.highlightData=c),h});return this._apply(c,e)}clear(t={}){return this.w.globals.axisCharts?this._apply(this._rawSeries().map(os),t):this._setCircle(null,t)}_setCircle(t,e){const i=this.w,n=e.series||this._rawSeries(),s={};if((e.series||n.some(cs))&&(s.series=n.map(os)),"function"==typeof t){const s=ls(n),r=e.series?[]:i.seriesData.series,a=i.seriesData.seriesNames,o=s.length||n.length,l=[];for(let e=0;e<o;e++){const o=s.length?s[e]:n[e];l.push(t({seriesIndex:e,dataPointIndex:e,seriesName:s.length?String(o.x):a[e],x:s.length?o.x:a[e],value:tr(o,r[e]),datum:o,w:i}))}t=l}return s.highlightFilter={data:Array.isArray(t)?t:null},this.ctx.updateOptions(s,!1,!1!==e.animate,!0,!this._drilled())}_apply(t,e){const i=this._drilled();return i&&this._level&&(this._level.series=t.map(os)),this.ctx.updateSeries(t,!1!==e.animate,!i)}_rawSeries(){var t,e;const i=this.w.globals;return(this._drilled()&&(null==(t=this._level)?void 0:t.series)||i.treemapRawSeries||(i.dataReducerRawSeries&&(null==(e=this.w.config.chart.dataReducer)?void 0:e.enabled)?i.initialSeries:null)||i.initialSeries||this.w.config.series).map(t=>Vn(t)?o({},t):t)}teardown(){var t,e;Array.from(this._live).forEach(t=>t.finish()),this._live.clear(),this._targets=new Map,this._render=null,this._cu=null,this._level=null,this._seriesEls=new Map,this._tiles=null,this._tmDefs=[],null==(t=this.ctx.events)||t.removeEventListener("mounted",this._onRender),null==(e=this.ctx.events)||e.removeEventListener("updated",this._onRender)}}});const ir=/[MmLlHhVvCcSsQqTtAaZz]/;function nr(t,e=.6,i=!1){const n=e>0?e:.6,s=t.length;let r=0;const a=[];let o=[],l=0,c=0,h=0,d=0,u=0,p=0,f="";const g=t=>" "===t||","===t||"\t"===t||"\n"===t||"\r"===t;function m(){for(;r<s&&g(t[r]);)r++}function y(){m();const e=r;for("+"!==t[r]&&"-"!==t[r]||r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if("."===t[r])for(r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if("e"===t[r]||"E"===t[r])for(r++,"+"!==t[r]&&"-"!==t[r]||r++;r<s&&t[r]>="0"&&t[r]<="9";)r++;if(r===e)return null;const i=parseFloat(t.slice(e,r));return isFinite(i)?i:null}function x(){m();const e=t[r];return"0"===e||"1"===e?(r++,"1"===e):null}function _(){o.length>(i?1:2)&&a.push(o),o=[]}function b(t,e){_(),l=h=t,c=d=e,o=[{x:t,y:e}]}function v(t,e){o.push({x:t,y:e}),l=t,c=e}function w(t,e,i,s,r,a){const h=Math.hypot(t-l,e-c)+Math.hypot(i-t,s-e)+Math.hypot(r-i,a-s),d=Math.max(2,Math.min(160,Math.ceil(h/n))),f=l,g=c;for(let n=1;n<=d;n++){const l=n/d,c=1-l,h=c*c*c,u=3*c*c*l,p=3*c*l*l,m=l*l*l;o.push({x:h*f+u*t+p*i+m*r,y:h*g+u*e+p*s+m*a})}u=i,p=s,l=r,c=a}function A(t,e,i,n){const s=t,r=e;w(l+2/3*(t-l),c+2/3*(e-c),i+2/3*(t-i),n+2/3*(e-n),i,n),u=s,p=r}function M(t,e,i,s,r,a,h){if(!t||!e)return void v(a,h);const d=l,f=c;t=Math.abs(t),e=Math.abs(e);const g=i*Math.PI/180,m=Math.cos(g),y=Math.sin(g),x=(d-a)/2,_=(f-h)/2,b=m*x+y*_,w=-y*x+m*_,A=b*b/(t*t)+w*w/(e*e);if(A>1){const i=Math.sqrt(A);t*=i,e*=i}const M=t*t*e*e-t*t*w*w-e*e*b*b,k=t*t*w*w+e*e*b*b,L=(s===r?-1:1)*Math.sqrt(Math.max(0,M/(k||1))),S=L*t*w/e,C=-L*e*b/t,E=m*S-y*C+(d+a)/2,F=y*S+m*C+(f+h)/2,D=(b-S)/t,P=(w-C)/e,R=(-b-S)/t,T=(-w-C)/e,N=Math.atan2(P,D);let O=Math.atan2(T,R)-N;!r&&O>0&&(O-=2*Math.PI),r&&O<0&&(O+=2*Math.PI);const $=Math.max(2,Math.min(320,Math.ceil(Math.abs(O)*Math.max(t,e)/n)));for(let i=1;i<=$;i++){const n=N+O*i/$,s=Math.cos(n),r=Math.sin(n);o.push({x:E+t*s*m-e*r*y,y:F+t*s*y+e*r*m})}u=a,p=h,l=a,c=h}for(;r<s&&(m(),!(r>=s));){let e=t[r];if(ir.test(e))r++;else{if(!f)break;e="M"===f?"L":"m"===f?"l":f}const i=e>="a"&&e<="z",n=e.toUpperCase();if("Z"===n){o.length&&o.push({x:h,y:d}),_(),l=h,c=d,f=e;continue}const s=t=>null==t?NaN:t,g=s(y());if(isNaN(g))break;switch(n){case"M":{const t=s(y());if(isNaN(t))return a;b(i?l+g:g,i?c+t:t);break}case"L":{const t=s(y());if(isNaN(t))return a;v(i?l+g:g,i?c+t:t);break}case"H":v(i?l+g:g,c);break;case"V":v(l,i?c+g:g);break;case"C":{const t=[g,y(),y(),y(),y(),y()];if(t.some(t=>null==t))return a;const e=t;w(i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3],i?l+e[4]:e[4],i?c+e[5]:e[5]);break}case"S":{const t=[g,y(),y(),y()];if(t.some(t=>null==t))return a;const e=t,n=f&&"CcSs".indexOf(f)>=0;w(n?2*l-u:l,n?2*c-p:c,i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3]);break}case"Q":{const t=[g,y(),y(),y()];if(t.some(t=>null==t))return a;const e=t;A(i?l+e[0]:e[0],i?c+e[1]:e[1],i?l+e[2]:e[2],i?c+e[3]:e[3]);break}case"T":{const t=s(y());if(isNaN(t))return a;const e=f&&"QqTt".indexOf(f)>=0;A(e?2*l-u:l,e?2*c-p:c,i?l+g:g,i?c+t:t);break}case"A":{const t=g,e=y(),n=y(),s=x(),r=x(),o=y(),h=y();if(null==e||null==n||null==s||null==r||null==o||null==h)return a;M(t,e,n,s,r,i?l+o:o,i?c+h:h);break}default:return a}"C"!==n&&"S"!==n&&"Q"!==n&&"T"!==n&&(u=l,p=c),f=e}return _(),a}function sr(t){const e={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};return t.forEach(t=>{t.forEach(t=>{t.x<e.x0&&(e.x0=t.x),t.y<e.y0&&(e.y0=t.y),t.x>e.x1&&(e.x1=t.x),t.y>e.y1&&(e.y1=t.y)})}),e}const rr=128;function ar(t,e,i){const n=Math.max(1e-6,t.x1-t.x0),s=Math.max(1e-6,t.y1-t.y0),r=Math.min(e.width*i/n,e.height*i/s);return{scale:r,offX:e.x+e.width/2-(t.x0+n/2)*r,offY:e.y+e.height/2-(t.y0+s/2)*r}}function or(t,e,i){const n=.42*e,s=.45*e,r=t.maxY-t.minY,a=Math.max(1,Math.floor(r/i)),o=t.minY+(r-a*i)/2,l=[];let c=0;for(let r=0;r<a;r++){const a=o+(r+.5)*i,h=t.spansAt(a);for(let t=0;t<h.length;t++){const i=h[t].x1-h[t].x0;let o;o=i>=2*n?Math.floor((i-2*n)/e)+1:i>=s?1:0,o&&(l.push({y:a,x0:h[t].x0,x1:h[t].x1,cap:o,row:r}),c+=o)}}return{cells:l,capacity:c,inset:n}}function lr(t,e){const i=new Array(t.length).fill(0);let n=0;for(let e=0;e<t.length;e++)n+=t[e];if(!n||e<=0)return i;let s=0;const r=[];for(let a=0;a<t.length;a++){const o=e*t[a]/n;i[a]=Math.floor(o),s+=i[a],r.push({i:a,frac:o-i[a]})}r.sort((t,e)=>e.frac-t.frac);for(let t=0;s<e;t++,s++)i[r[t%r.length].i]++;return i}function cr(t,e,i){let n=1,s=Math.max(t.maxY-t.minY,8);for(let r=0;r<34;r++){const r=(n+s)/2;or(t,r,r*i).capacity>=e?n=r:s=r}return n}function hr(t,e){return Math.min(Math.max(t,e/3.2),e/2.3)}const dr={rows:null,rowsUp:(t,e)=>e.y-t.y||t.x-e.x,cols:(t,e)=>(t.qx||0)-(e.qx||0)||t.y-e.y,colsRev:(t,e)=>(e.qx||0)-(t.qx||0)||t.y-e.y,centerOut:(t,e)=>(t.qd||0)-(e.qd||0)||t.y-e.y,centerIn:(t,e)=>(e.qd||0)-(t.qd||0)||t.y-e.y};function ur(t,e,i,n){const s=void 0!==dr[i]?dr[i]:null;let r=e;if(s){let t=0,i=0;e.forEach(e=>{t+=e.x,i+=e.y}),t/=e.length||1,i/=e.length||1;const a=n>0?n:1;e.forEach(e=>{e.qx=Math.round(e.x/a),e.qd=Math.round(Math.hypot(e.x-t,e.y-i)/a)}),r=e.slice().sort(s)}const a=[];for(let e=0;e<t.length&&e<r.length;e++)a.push({id:t[e].id,x:r[e].x,y:r[e].y,r:r[e].r});return a}function pr(t,e,i,n,s,r){if(e<=0)return;if(1===e)return void r.push({x:(t.x0+t.x1)/2,y:t.y,r:s,row:t.row});let a=t.x0+n;let o=(t.x1-n-a)/(e-1);o>1.5*i&&(o=i,a=(t.x0+t.x1)/2-o*(e-1)/2);for(let i=0;i<e;i++)r.push({x:a+i*o,y:t.y,r:s,row:t.row})}const fr=new Set;function gr(t,e){const i=e(t),n=t.minUnits||0,s=(e,s)=>{if(n&&e.length&&e.length<n&&!fr.has(t.name)){fr.add(t.name);const i="stroke"===t.kind?"A stroke thins to a dotted line below that, which may well be fine.":"Fine detail closes up below that.";console.warn(`[ApexCharts] unit shape "${t.name}" reads best from about ${n} units; this chart has ${e.length}. ${i} Lower plotOptions.unit.unitValue to draw more dots, or pick a simpler shape.`)}return i(e,s)};return s.shape=Object.freeze(o({},t)),s.with=i=>gr(o(o({},t),i),e),s}const mr=new Map;function yr(t){const e=t.path||"",i=t.order||"rows",n=null==t.padding?.94:t.padding,s=null==t.rowRatio?.88:t.rowRatio,r="evenodd"===t.fillRule,a=null==t.sampling?.6:t.sampling;return(t,o)=>{if(!t.length||!e)return[];const{polys:l,bounds:c}=function(t,e){const i=`${e}|${t}`;let n=mr.get(i);if(!n){const s=nr(t,e);n={polys:s,bounds:sr(s)},mr.set(i,n)}return n}(e,a);if(!l.length)return[];const h=function(t,e,i={}){const n=!!i.evenOdd,s=[];let r=1/0,a=-1/0,o=1/0,l=-1/0;if(t.forEach(t=>{for(let i=0;i<t.length;i++){const n=t[i],c=t[(i+1)%t.length],h=e.offX+n.x*e.scale,d=e.offY+n.y*e.scale,u=e.offX+c.x*e.scale,p=e.offY+c.y*e.scale;h<o&&(o=h),u<o&&(o=u),h>l&&(l=h),u>l&&(l=u),d<r&&(r=d),p<r&&(r=p),d>a&&(a=d),p>a&&(a=p),d!==p&&s.push({x0:h,y0:d,x1:u,y1:p})}}),!s.length)return{minY:0,maxY:0,minX:0,maxX:0,spansAt:()=>[]};const c=Math.max(1e-6,a-r),h=[];for(let t=0;t<rr;t++)h.push([]);return s.forEach(t=>{const e=Math.min(t.y0,t.y1),i=Math.max(t.y0,t.y1);let n=Math.floor((e-r)/c*rr),s=Math.floor((i-r)/c*rr);n=Math.max(0,Math.min(127,n)),s=Math.max(0,Math.min(127,s));for(let e=n;e<=s;e++)h[e].push(t)}),{minY:r,maxY:a,minX:o,maxX:l,spansAt:t=>{const e=Math.floor((t-r)/c*rr);if(e<0||e>127)return[];const i=h[e],s=[];for(let e=0;e<i.length;e++){const n=i[e],r=n.y1>n.y0,a=r?n.y0:n.y1,o=r?n.y1:n.y0;t<a||t>=o||s.push({x:n.x0+(t-n.y0)/(n.y1-n.y0)*(n.x1-n.x0),dir:r?1:-1})}if(s.length<2)return[];s.sort((t,e)=>t.x-e.x);const a=[];if(n){for(let t=0;t+1<s.length;t+=2)a.push({x0:s[t].x,x1:s[t+1].x});return a}let o=0,l=0;for(let t=0;t<s.length;t++){const e=o;o+=s[t].dir,0===e&&0!==o?l=s[t].x:0!==e&&0===o&&a.push({x0:l,x1:s[t].x})}return a}}}(l,ar(c,o,n),{evenOdd:r}),d=cr(h,t.length,s),u=or(h,d,d*s);if(!u.cells.length)return[];const p=lr(u.cells.map(t=>t.cap),t.length),f=hr(t[0].r>0?t[0].r:3,d),g=[];return u.cells.forEach((t,e)=>{pr(t,p[e],d,u.inset,f,g)}),ur(t,g,i,d)}}function xr(t){return gr(l(o({},t),{kind:"silhouette"}),yr)}const _r=xr({name:"heart",category:"symbols",minUnits:40,source:"original",path:"M 50 93 C 20 71 5 53 5 34 C 5 17 18 6 32 6 C 41 6 47 11 50 19 C 53 11 59 6 68 6 C 82 6 95 17 95 34 C 95 53 80 71 50 93 Z"}),br=xr({name:"droplet",category:"nature",minUnits:40,source:"original",path:"M 50 3 C 50 3 13 46 13 66 A 37 37 0 0 0 87 66 C 87 46 50 3 50 3 Z"}),vr=xr({name:"human",category:"people",minUnits:80,source:"original",path:"M 39 13 A 11 11 0 0 1 61 13 A 11 11 0 0 1 39 13 Z M 38 30 C 33 31 29 34 27 40 L 19 64 L 26 67 L 33 48 L 34 58 L 31 96 L 44 96 L 46 64 L 54 64 L 56 96 L 69 96 L 66 58 L 67 48 L 74 67 L 81 64 L 73 40 C 71 34 67 31 62 30 Z"}),wr=xr({name:"tree",category:"nature",minUnits:80,source:"original",path:"M 50 3 C 62 3 70 11 70 19 C 81 16 91 24 91 34 C 97 39 97 51 89 56 C 87 62 77 66 67 63 C 63 68 55 70 50 68 C 45 70 37 68 33 63 C 23 66 13 62 11 56 C 3 51 3 39 9 34 C 9 24 19 16 30 19 C 30 11 38 3 50 3 Z M 41 58 L 59 58 L 60 88 C 61 92 63 94 67 96 L 33 96 C 37 94 39 92 40 88 Z"}),Ar=xr({name:"house",category:"objects",minUnits:120,order:"rows",source:"original",path:"M 50 4 L 97 44 L 97 50 L 84 50 L 84 95 L 16 95 L 16 50 L 3 50 L 3 44 Z M 44 95 L 56 95 L 56 70 L 44 70 Z M 25 58 L 25 69 L 37 69 L 37 58 Z M 63 58 L 63 69 L 75 69 L 75 58 Z"}),Mr=xr({name:"battery",category:"objects",minUnits:40,order:"cols",source:"original",path:"M 14 22 L 72 22 C 78 22 82 26 82 32 L 82 38 L 93 38 L 93 62 L 82 62 L 82 68 C 82 74 78 78 72 78 L 14 78 C 8 78 4 74 4 68 L 4 32 C 4 26 8 22 14 22 Z"}),kr=xr({name:"shield",category:"technology",minUnits:40,source:"original",path:"M 6 8 L 94 8 L 94 38 C 94 60 82 81 50 97 C 18 81 6 60 6 38 Z"}),Lr=xr({name:"rocket",category:"objects",minUnits:120,source:"original",path:"M 50 2 C 59 13 65 28 66 45 L 66 76 L 58 88 L 42 88 L 34 76 L 34 45 C 35 28 41 13 50 2 Z M 65 56 L 85 86 L 85 95 L 65 82 Z M 35 56 L 15 86 L 15 95 L 35 82 Z M 43.5 34 A 6.5 6.5 0 0 0 56.5 34 A 6.5 6.5 0 0 0 43.5 34 Z"}),Sr=t=>t.reduce((t,e)=>t+e,0);function Cr(t){const e=null==t.padding?.94:t.padding,i="centerIn"===t.order,n=null==t.twist?2.399963:t.twist;return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.min(s.width,s.height)/2*e,o=s.x+s.width/2,l=s.y+s.height/2,c=t=>{const e=[];for(let i=0;i<t;i++)e.push(Math.max(1,Math.round(2*Math.PI*(i+.5))));return e};let h=1;for(;h<400&&Sr(c(h))<r;)h++;const d=a/h,u=lr(c(h),r),p=hr(t[0].r>0?t[0].r:3,d),f=[];for(let t=0;t<h;t++){const e=i?h-1-t:t,s=(e+.5)*d,r=u[e],a=n*e;for(let e=0;e<r;e++){const i=a+e/r*2*Math.PI;f.push({x:o+s*Math.cos(i),y:l+s*Math.sin(i),r:p,row:t})}}return ur(t,f,"rows",d)}}function Er(t){const e=null==t.padding?.94:t.padding,i=(null==t.tilt?15:t.tilt)*Math.PI/180,n=t.order||"rows";return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.min(s.width,s.height)/2*e,o=s.x+s.width/2,l=s.y+s.height/2,c=Math.cos(i),h=Math.sin(i),d=(t,e,i)=>{const n=e*Math.cos(i);return{x:a*e*Math.sin(i),y:a*(t*c+n*h),depth:n*c-t*h}},u=t=>{const e=Math.max(3,Math.ceil(Math.PI*a/t)),i=Math.PI/e,n=.95*t,s=n,r=new Map,u=[];let p=0;const f=t=>{const e=Math.floor(t.x/s),i=Math.floor(t.y/s);for(let s=-1;s<=1;s++)for(let a=-1;a<=1;a++){const o=r.get(`${e+s},${i+a}`);if(o)for(let e=0;e<o.length;e++)if(Math.hypot(o[e].x-t.x,o[e].y-t.y)<n)return!1}const a=`${e},${i}`,o=r.get(a);return o?o.push(t):r.set(a,[t]),!0};for(let n=0;n<e;n++){const e=-Math.PI/2+(n+.5)*i,s=Math.cos(e),r=Math.sin(e),a=r*h/(s*c||1e-9);if(a>=1)continue;const g=a<=-1?Math.PI:Math.acos(a),m=g>=Math.PI-1e-9,y=[],x=[0];for(let t=0;t<=40;t++){const e=d(r,s,2*g*t/40-g);if(y.push(e),t>0){const i=y[t-1];x.push(x[t-1]+Math.hypot(e.x-i.x,e.y-i.y))}}const _=x[x.length-1],b=m?0:Math.min(.42*t,_/2),v=_-2*b;let w;if(w=m?Math.max(1,Math.round(_/t)):v>0?Math.floor(v/t)+1:_>=.45*t?1:0,!w)continue;const A=m?_/w:w>1?v/(w-1):0,M=[];let k=0;for(let t=0;t<w;t++){const e=m?t*A:w>1?b+t*A:_/2;for(;k<x.length-2&&x[k+1]<e;)k++;const i=x[k],n=x[k+1],s=n>i?(e-i)/(n-i):0,r=y[k],a=y[k+1],c={x:o+r.x+(a.x-r.x)*s,y:l+r.y+(a.y-r.y)*s,depth:r.depth+(a.depth-r.depth)*s};f(c)&&M.push(c)}M.length&&(u.push(M),p+=M.length)}return{rows:u,total:p}};let p=1,f=2*a;for(let t=0;t<30;t++){const t=(p+f)/2;u(t).total>=r?p=t:f=t}const g=p,{rows:m}=u(g),y=lr(m.map(t=>t.length),r),x=hr(t[0].r>0?t[0].r:3,g),_=[];return m.forEach((t,e)=>{const i=y[e];if(i)for(let n=0;n<i;n++){const s=t[Math.min(t.length-1,Math.floor(n*t.length/i))];_.push({x:s.x,y:s.y,r:x*(.62+.38*Math.sqrt(Math.max(0,s.depth))),row:e})}}),_.sort((t,e)=>t.y-e.y||t.x-e.x),ur(t,_,n,g)}}function Fr(t){const e=null==t.padding?.94:t.padding,i=null==t.rowRatio?.9:t.rowRatio,n=t.order||"rowsUp";return(t,s)=>{const r=t.length;if(!r)return[];const a=Math.max(1,Math.round((Math.sqrt(8*r+1)-1)/2)),o=[];for(let t=0;t<a;t++)o.push(t+1);const l=lr(o,r),c=Math.max(...l),h=Math.min(s.width*e/Math.max(1,c-1+1.6),s.height*e/(a*i)),d=h*i,u=s.x+s.width/2,p=s.y+(s.height-a*d)/2,f=hr(t[0].r>0?t[0].r:3,h),g=[];for(let t=0;t<a;t++)for(let e=0;e<l[t];e++)g.push({x:u+(e-(l[t]-1)/2)*h,y:p+(t+.5)*d,r:f,row:t});return ur(t,g,n,h)}}function Dr(t){return gr(l(o({},t),{kind:"rings"}),Cr)}function Pr(t){return gr(l(o({},t),{kind:"globe"}),Er)}function Rr(t){return gr(l(o({},t),{kind:"tiers"}),Fr)}const Tr=Dr({name:"target",category:"business",minUnits:40,order:"centerIn",source:"generated"}),Nr=Pr({name:"globe",category:"geography",minUnits:60,tilt:15,source:"generated"}),Or=Rr({name:"pyramid",category:"symbols",minUnits:20,order:"rowsUp",source:"generated"}),$r=xr({name:"leaf",category:"nature",minUnits:60,source:"original",path:"M 27.5 7.6 C 22.6 28.3 17.8 49 26.2 64.9 C 35.6 82.6 55.5 90.1 71.6 90.6 C 80.2 77 85.1 56.3 75.7 38.6 C 67.2 22.7 47.3 15.2 27.5 7.6 Z M 67.1 88.5 L 71.9 101.8 L 80.7 97.1 L 72.4 85.7 Z"}),Ir=xr({name:"sun",category:"nature",minUnits:140,source:"original",path:"M 75.5 41.2 L 98 50 L 75.5 58.8 L 74.3 61.8 L 83.9 83.9 L 61.8 74.3 L 58.8 75.5 L 50 98 L 41.2 75.5 L 38.2 74.3 L 16.1 83.9 L 25.7 61.8 L 24.5 58.8 L 2 50 L 24.5 41.2 L 25.7 38.2 L 16.1 16.1 L 38.2 25.7 L 41.2 24.5 L 50 2 L 58.8 24.5 L 61.8 25.7 L 83.9 16.1 L 74.3 38.2 Z"}),Br=xr({name:"flame",category:"nature",minUnits:60,source:"original",path:"M 56 2 C 52 24 34 30 30 50 C 27 64 33 70 34 78 C 24 72 20 60 21 50 C 12 62 10 76 16 86 C 24 95 38 98 52 98 C 72 98 84 84 82 64 C 80 46 68 40 66 26 C 64 38 60 42 58 44 C 62 30 60 14 56 2 Z"}),zr=xr({name:"fish",category:"nature",minUnits:80,source:"original",path:"M 20 50 C 34 26 58 20 76 30 C 86 36 92 44 94 50 C 92 56 86 64 76 70 C 58 80 34 74 20 50 Z M 26 50 L 4 74 L 12 50 L 4 26 Z"}),Wr=xr({name:"star",category:"symbols",minUnits:80,source:"original",path:"M 50 2 L 61.8 33.8 L 95.7 35.2 L 69 56.2 L 78.2 88.8 L 50 70 L 21.8 88.8 L 31 56.2 L 4.3 35.2 L 38.2 33.8 Z"}),Hr=xr({name:"arrow",category:"symbols",minUnits:60,source:"original",path:"M 50 4 L 92 46 L 70 46 L 70 96 L 30 96 L 30 46 L 8 46 Z"}),jr=xr({name:"crown",category:"symbols",minUnits:90,source:"original",path:"M 8 84 L 14 26 L 32 52 L 50 16 L 68 52 L 86 26 L 92 84 Z"}),Yr=xr({name:"cross",category:"symbols",minUnits:40,source:"original",path:"M 36 6 L 64 6 L 64 36 L 94 36 L 94 64 L 64 64 L 64 94 L 36 94 L 36 64 L 6 64 L 6 36 L 36 36 Z"}),qr=xr({name:"bolt",category:"symbols",minUnits:70,source:"original",path:"M 62 3 L 20 56 L 44 56 L 38 97 L 80 40 L 54 40 Z"}),Xr=xr({name:"bulb",category:"objects",minUnits:90,source:"original",path:"M 50 4 C 29 4 14 21 14 39 C 14 54 25 62 30 72 L 70 72 C 75 62 86 54 86 39 C 86 21 71 4 50 4 Z M 34 74 L 36 96 L 64 96 L 66 74 Z"}),Gr=xr({name:"flask",category:"objects",minUnits:60,source:"original",path:"M 40 4 L 60 4 L 60 36 L 92 92 L 8 92 L 40 36 Z"}),Ur=xr({name:"car",category:"objects",minUnits:120,source:"original",path:"M 4 78 L 4 56 L 20 52 L 32 30 L 68 30 L 82 52 L 96 56 L 96 78 Z M 13 78 A 13 13 0 0 1 39 78 A 13 13 0 0 1 13 78 Z M 61 78 A 13 13 0 0 1 87 78 A 13 13 0 0 1 61 78 Z"}),Kr=xr({name:"plane",category:"objects",minUnits:160,source:"original",path:"M 50 2 C 54 2 57 9 58 19 L 58 35 L 95 57 L 95 67 L 58 57 L 58 76 L 70 86 L 70 95 L 50 89 L 30 95 L 30 86 L 42 76 L 42 57 L 5 67 L 5 57 L 42 35 L 42 19 C 43 9 46 2 50 2 Z"}),Vr=xr({name:"group",category:"people",minUnits:160,source:"original",path:"M 8 94 L 8 57 C 8 48 14.6 48 14.6 48 L 23.4 48 C 23.4 48 30 48 30 57 L 30 94 Z M 9.5 34 A 9.5 9.5 0 0 1 28.5 34 A 9.5 9.5 0 0 1 9.5 34 Z M 36 94 L 36 47 C 36 38 44.4 38 44.4 38 L 55.6 38 C 55.6 38 64 38 64 47 L 64 94 Z M 38.5 23 A 11.5 11.5 0 0 1 61.5 23 A 11.5 11.5 0 0 1 38.5 23 Z M 70 94 L 70 57 C 70 48 76.6 48 76.6 48 L 85.4 48 C 85.4 48 92 48 92 57 L 92 94 Z M 71.5 34 A 9.5 9.5 0 0 1 90.5 34 A 9.5 9.5 0 0 1 71.5 34 Z"}),Zr=xr({name:"trophy",category:"business",minUnits:110,source:"original",path:"M 30 8 L 70 8 L 68 40 C 68 54 58 62 50 62 C 42 62 32 54 32 40 Z M 45 60 L 55 60 L 55 78 L 45 78 Z M 30 78 L 70 78 L 74 92 L 26 92 Z"}),Qr=xr({name:"moneybag",category:"business",minUnits:80,source:"original",path:"M 36 8 L 64 8 L 59 24 C 80 32 90 48 90 65 C 90 83 73 94 50 94 C 27 94 10 83 10 65 C 10 48 20 32 41 24 Z"}),Jr=xr({name:"funnel",category:"business",minUnits:80,source:"original",path:"M 6 10 L 94 10 L 58 56 L 58 92 L 42 92 L 42 56 Z"}),ta=xr({name:"gear",category:"technology",minUnits:260,source:"original",path:"M 82 50.9 L 96.8 54.3 L 93.2 68.5 L 78.6 64.4 L 73.9 71.2 L 83.1 83.3 L 71.2 92 L 62.6 79.4 L 54.7 81.7 L 53.9 96.8 L 39.3 95.8 L 40.8 80.6 L 33.2 77.3 L 22.9 88.4 L 12.4 78.2 L 23.2 67.5 L 19.6 60.1 L 4.6 62 L 3.1 47.4 L 18.2 46.2 L 20.2 38.2 L 7.5 30 L 15.7 17.8 L 28.1 26.7 L 34.8 21.9 L 30.3 7.3 L 44.4 3.3 L 48.2 18 L 56.4 18.7 L 62.3 4.6 L 75.7 10.7 L 69.2 24.4 L 75.1 30.1 L 88.6 23.2 L 95 36.4 L 81.2 42.7 Z M 37 50 A 13 13 0 0 0 63 50 A 13 13 0 0 0 37 50 Z"}),ea=xr({name:"robot",category:"technology",minUnits:220,source:"original",path:"M 18 40 C 18 30 26 26 36 26 L 64 26 C 74 26 82 30 82 40 L 82 72 C 82 82 74 86 64 86 L 36 86 C 26 86 18 82 18 72 Z M 46 14 L 54 14 L 54 28 L 46 28 Z M 44 12 A 6 6 0 0 1 56 12 A 6 6 0 0 1 44 12 Z M 29 50 A 7 7 0 0 0 43 50 A 7 7 0 0 0 29 50 Z M 57 50 A 7 7 0 0 0 71 50 A 7 7 0 0 0 57 50 Z"}),ia=xr({name:"pin",category:"geography",minUnits:120,source:"original",path:"M 50 96 C 50 96 16 56 16 38 C 16 20 31 6 50 6 C 69 6 84 20 84 38 C 84 56 50 96 50 96 Z M 39 37 A 11 11 0 0 0 61 37 A 11 11 0 0 0 39 37 Z"}),na=xr({name:"mountain",category:"geography",minUnits:60,source:"original",path:"M 2 90 L 34 26 L 50 56 L 64 18 L 98 90 Z"}),sa=new Map;function ra(t){const e=t.path||"",i=t.order||"rows",n=null==t.padding?.94:t.padding,s=null==t.rowRatio?.88:t.rowRatio,r=null==t.sampling?.6:t.sampling,a=Math.max(.5,(null==t.width?16:t.width)/2);return(t,o)=>{if(!t.length||!e)return[];const{polys:l,bounds:c}=function(t,e){const i=`${e}|${t}`;let n=sa.get(i);if(!n){const s=nr(t,e,!0);n={polys:s,bounds:sr(s)},sa.set(i,n)}return n}(e,r);if(!l.length)return[];const h=function(t,e,i){const n=Math.max(1e-6,i*e.scale),s=[];let r=1/0,a=-1/0,o=1/0,l=-1/0;if(t.forEach(t=>{for(let i=0;i+1<t.length;i++){const c=e.offX+t[i].x*e.scale,h=e.offY+t[i].y*e.scale,d=e.offX+t[i+1].x*e.scale,u=e.offY+t[i+1].y*e.scale,p=Math.hypot(d-c,u-h),f=p>1e-9?-(u-h)/p*n:n,g=p>1e-9?(d-c)/p*n:0;s.push({ax:c,ay:h,bx:d,by:u,nx:f,ny:g}),Math.min(c,d)-n<o&&(o=Math.min(c,d)-n),Math.max(c,d)+n>l&&(l=Math.max(c,d)+n),Math.min(h,u)-n<r&&(r=Math.min(h,u)-n),Math.max(h,u)+n>a&&(a=Math.max(h,u)+n)}}),!s.length)return{minY:0,maxY:0,minX:0,maxX:0,spansAt:()=>[]};const c=Math.max(1e-6,a-r),h=[];for(let t=0;t<rr;t++)h.push([]);s.forEach(t=>{const e=Math.min(t.ay,t.by)-n,i=Math.max(t.ay,t.by)+n;let s=Math.floor((e-r)/c*rr),a=Math.floor((i-r)/c*rr);s=Math.max(0,Math.min(127,s)),a=Math.max(0,Math.min(127,a));for(let e=s;e<=a;e++)h[e].push(t)});const d=(t,e,i)=>{const s=i-e;if(s<=-n||s>=n)return null;const r=Math.sqrt(n*n-s*s);return{x0:t-r,x1:t+r}};return{minY:r,maxY:a,minX:o,maxX:l,spansAt:t=>{const e=Math.floor((t-r)/c*rr);if(e<0||e>127)return[];const i=h[e],n=[];for(let e=0;e<i.length;e++){const s=i[e],r=[s.ax+s.nx,s.bx+s.nx,s.bx-s.nx,s.ax-s.nx],a=[s.ay+s.ny,s.by+s.ny,s.by-s.ny,s.ay-s.ny];let o=1/0,l=-1/0;for(let e=0;e<4;e++){const i=(e+1)%4,n=a[e],s=a[i];if(n===s)continue;const c=Math.min(n,s),h=Math.max(n,s);if(t<c||t>=h)continue;const d=r[e]+(t-n)/(s-n)*(r[i]-r[e]);d<o&&(o=d),d>l&&(l=d)}l>o&&n.push({x0:o,x1:l});const c=d(s.ax,s.ay,t);c&&n.push(c);const h=d(s.bx,s.by,t);h&&n.push(h)}if(!n.length)return[];n.sort((t,e)=>t.x0-e.x0);const s=[n[0]];for(let t=1;t<n.length;t++){const e=s[s.length-1];n[t].x0<=e.x1?n[t].x1>e.x1&&(e.x1=n[t].x1):s.push(n[t])}return s}}}(l,ar({x0:c.x0-a,y0:c.y0-a,x1:c.x1+a,y1:c.y1+a},o,n),a),d=cr(h,t.length,s),u=or(h,d,d*s);if(!u.cells.length)return[];const p=lr(u.cells.map(t=>t.cap),t.length),f=hr(t[0].r>0?t[0].r:3,d),g=[];return u.cells.forEach((t,e)=>{pr(t,p[e],d,u.inset,f,g)}),ur(t,g,i,d)}}function aa(t){return gr(l(o({},t),{kind:"stroke"}),ra)}const oa=[_r,br,vr,wr,Ar,Mr,kr,Lr,Tr,Nr,Or,$r,Ir,Br,zr,Wr,Hr,jr,Yr,qr,Xr,Gr,Ur,Kr,Vr,Zr,Qr,Jr,ta,ea,ia,na,aa({name:"check",category:"symbols",minUnits:40,width:19,source:"original",path:"M 13 55 L 37 79 L 87 22"}),aa({name:"wifi",category:"technology",minUnits:120,width:8,source:"original",path:"M 11.9 62 A 44 44 0 0 1 88.1 62 M 24 69 A 30 30 0 0 1 76 69 M 36.1 76 A 16 16 0 0 1 63.9 76 M 50 86 L 50 86"}),aa({name:"pulse",category:"technology",minUnits:60,width:11,source:"original",path:"M 4 58 L 26 58 L 35 30 L 47 84 L 59 44 L 68 58 L 96 58"}),aa({name:"xmark",category:"symbols",minUnits:40,width:18,source:"original",path:"M 18 18 L 82 82 M 82 18 L 18 82"}),aa({name:"percent",category:"symbols",minUnits:150,width:9,source:"original",path:"M 12 24 A 12 12 0 0 1 36 24 A 12 12 0 0 1 12 24 Z M 64 76 A 12 12 0 0 1 88 76 A 12 12 0 0 1 64 76 Z M 80 14 L 20 86"}),aa({name:"question",category:"symbols",minUnits:90,width:14,source:"original",path:"M 25 32 C 25 8 76 8 76 33 C 76 52 50 54 50 70 M 50 90 L 50 90"}),aa({name:"spiral",category:"symbols",minUnits:140,width:9,source:"generated",path:"M 56.0 50.0 L 56.4 51.4 L 56.5 52.9 L 56.2 54.5 L 55.5 56.1 L 54.3 57.5 L 52.9 58.8 L 51.0 59.7 L 48.9 60.3 L 46.6 60.3 L 44.3 59.9 L 42.0 58.9 L 39.9 57.3 L 38.1 55.3 L 36.8 52.8 L 35.9 50.0 L 35.7 47.0 L 36.2 43.8 L 37.3 40.8 L 39.1 37.9 L 41.6 35.5 L 44.7 33.5 L 48.1 32.3 L 51.9 31.7 L 55.8 32.0 L 59.7 33.1 L 63.4 35.1 L 66.6 37.9 L 69.3 41.4 L 71.1 45.5 L 72.2 50.0 L 72.2 54.7 L 71.2 59.4 L 69.2 64.0 L 66.3 68.1 L 62.4 71.5 L 57.8 74.1 L 52.7 75.8 L 47.2 76.3 L 41.7 75.7 L 36.2 73.8 L 31.2 70.9 L 26.8 66.8 L 23.4 61.9 L 21.0 56.2 L 19.8 50.0 L 19.9 43.6 L 21.4 37.3 L 24.2 31.3 L 28.3 25.9 L 33.5 21.5 L 39.7 18.2 L 46.4 16.2 L 53.6 15.7 L 60.8 16.6 L 67.8 19.2 L 74.2 23.1 L 79.7 28.4 L 84.0 34.9 L 86.9 42.1 L 88.3 50.0 L 88.0 58.1 L 86.0 66.0 L 82.3 73.5 L 77.1 80.1 L 70.5 85.5 L 62.8 89.5 L 54.4 91.8 L 45.5 92.4 L 36.7 91.0 L 28.2 87.8 L 20.4 82.9 L 13.8 76.3 L 8.6 68.4 L 5.2 59.5 L 3.6 50.0 L 4.1 40.2 L 6.6 30.7 L 11.2 21.8"})],la="__apexcharts_unit_layouts__";function ca(t){const e=l(o({},t),{viewBox:t.viewBox||[0,0,100,100]});return e.with=e=>ca(o(o({},t),e)),Object.freeze(e)}const ha=[ca({name:"person",category:"people",source:"original",path:"M 37 18 A 13 13 0 0 1 63 18 A 13 13 0 0 1 37 18 Z M 50 34 C 61 34 69 40 70 50 L 73 72 L 65 72 L 63 58 L 61 96 L 53 96 L 51 66 L 49 66 L 47 96 L 39 96 L 37 58 L 35 72 L 27 72 L 30 50 C 31 40 39 34 50 34 Z"}),ca({name:"house",category:"objects",source:"original",path:"M 50 8 L 94 46 L 82 46 L 82 92 L 58 92 L 58 64 L 42 64 L 42 92 L 18 92 L 18 46 L 6 46 Z"}),ca({name:"heart",category:"symbols",source:"original",path:"M 50 90 C 22 70 6 54 6 36 C 6 21 17 11 30 11 C 39 11 46 16 50 24 C 54 16 61 11 70 11 C 83 11 94 21 94 36 C 94 54 78 70 50 90 Z"}),ca({name:"tree",category:"nature",source:"original",path:"M 50 6 C 66 6 78 18 78 33 C 78 38 77 42 75 46 C 82 50 86 57 86 65 C 86 77 76 86 64 86 L 55 86 L 55 96 L 45 96 L 45 86 L 36 86 C 24 86 14 77 14 65 C 14 57 18 50 25 46 C 23 42 22 38 22 33 C 22 18 34 6 50 6 Z"}),ca({name:"droplet",category:"nature",source:"original",path:"M 50 4 C 50 4 84 42 84 64 C 84 82 69 96 50 96 C 31 96 16 82 16 64 C 16 42 50 4 50 4 Z"}),ca({name:"star",category:"symbols",source:"original",path:"M 50 6 L 61.2 36.6 L 93.8 37.8 L 68.1 57.9 L 77 89.2 L 50 71 L 23 89.2 L 31.9 57.9 L 6.2 37.8 L 38.8 36.6 Z"}),ca({name:"car",category:"transport",source:"original",path:"M 6 72 L 9 53 C 10 46 15 41 22 40 L 32 23 C 35 19 39 17 44 17 L 60 17 C 65 17 69 19 71 23 L 81 40 C 88 41 93 46 94 53 L 97 72 L 97 80 L 6 80 Z M 13 88 A 11 11 0 1 1 35 88 A 11 11 0 1 1 13 88 Z M 65 88 A 11 11 0 1 1 87 88 A 11 11 0 1 1 65 88 Z"}),ca({name:"bag",category:"objects",source:"original",path:"M 10 30 L 90 30 L 95 96 L 5 96 Z M 32 30 C 32 14 40 4 50 4 C 60 4 68 14 68 30 L 59 30 C 59 19 55 13 50 13 C 45 13 41 19 41 30 Z"}),ca({name:"book",category:"objects",source:"original",path:"M 8 14 C 8 14 26 6 50 16 C 74 6 92 14 92 14 L 92 88 C 92 88 74 80 50 90 C 26 80 8 88 8 88 Z"}),ca({name:"cup",category:"objects",source:"original",path:"M 14 22 L 70 22 L 70 34 L 80 34 C 90 34 96 41 96 51 C 96 63 87 71 75 71 L 69 71 C 65 84 55 92 42 92 C 26 92 14 79 14 61 Z"}),ca({name:"bulb",category:"objects",source:"original",path:"M 50 4 C 32 4 18 18 18 36 C 18 48 25 56 31 63 C 35 68 37 72 37 78 L 63 78 C 63 72 65 68 69 63 C 75 56 82 48 82 36 C 82 18 68 4 50 4 Z M 38 84 L 38 90 L 62 90 L 62 84 Z M 42 94 L 45 99 L 55 99 L 58 94 Z"}),ca({name:"plane",category:"transport",source:"original",path:"M 50 4 C 55 4 58 12 58 24 L 58 38 L 94 62 L 94 72 L 58 60 L 58 82 L 70 90 L 70 97 L 50 92 L 30 97 L 30 90 L 42 82 L 42 60 L 6 72 L 6 62 L 42 38 L 42 24 C 42 12 45 4 50 4 Z"})],da="__apexcharts_unit_marks__";!function(t){const e=function(){const t=globalThis;return t[la]||(t[la]={}),t[la]}(),i=[];(Array.isArray(t)?t.map(t=>[t.shape?t.shape.name:"",t]):Object.entries(t)).forEach(([t,n])=>{const s=String(t),r=n;s&&"function"==typeof r&&(e[s]=r,i.push(s))})}(oa),function(t){const e=function(){const t=globalThis;return t[da]||(t[da]={}),t[da]}(),i=[];(Array.isArray(t)?t.map(t=>[t?t.name:"",t]):Object.entries(t)).forEach(([t,n])=>{const s=String(t);s&&n&&"string"==typeof n.path&&(e[s]=n,i.push(s))})}(ha);const ua=f.default;ua.unitShapes=oa,ua.pictograms=ha,Object.defineProperty(exports,"default",{enumerable:!0,get:()=>f.default});
|