apexcharts 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +1 -1
- package/dist/apexcharts.core.min.js +1 -1
- package/dist/apexcharts.esm.js +167 -2
- package/dist/apexcharts.js +167 -2
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +167 -2
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +1 -1
- package/dist/bar.esm.js +1 -1
- package/dist/bar.js +1 -1
- package/dist/boxPlot.common.js +1 -1
- package/dist/boxPlot.esm.js +1 -1
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +1 -1
- package/dist/candlestick.esm.js +1 -1
- package/dist/candlestick.js +1 -1
- package/dist/column.common.js +1 -1
- package/dist/column.esm.js +1 -1
- package/dist/core.common.js +1 -1
- package/dist/core.esm.js +1 -1
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +1 -1
- package/dist/dumbbell.esm.js +1 -1
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +167 -2
- 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 +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- 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/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 +1 -1
- package/dist/features/keyboard.esm.js +1 -1
- package/dist/features/keyboard.js +1 -1
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- 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 +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- 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 +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +1 -1
- package/dist/features/toolbar.esm.js +1 -1
- package/dist/features/toolbar.js +1 -1
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- 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 +2 -2
- package/dist/features/weave.esm.js +167 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +1 -1
- package/dist/histogram.esm.js +1 -1
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- 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 +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- 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 +1 -1
- package/dist/raincloud.esm.js +1 -1
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +1 -1
- package/dist/rangeBar.esm.js +1 -1
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- 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 +1 -1
- package/dist/unit.esm.js +1 -1
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +1 -1
- package/dist/violin.esm.js +1 -1
- package/dist/violin.js +1 -1
- package/dist/waterfall.common.js +1 -1
- package/dist/waterfall.esm.js +1 -1
- package/package.json +1 -1
- package/src/modules/weave/PluginAPI.js +37 -1
- package/src/modules/weave/WeaveHost.js +148 -0
package/dist/waterfall.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,l=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},n=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Graphics,b=d.__apex_Environment_Environment;const u=d.__apex_Utils;function g(t,e,s){const a=s&&void 0!==s[e]?s[e]:e+1;return null==t?{x:a,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:a,y:t[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:a,y:t.y,isSubtotal:!0===t.isSubtotal,isTotal:!0===t.isTotal,rest:t}:{x:a,y:t,isSubtotal:!1,isTotal:!1,rest:{}}}function p(t,e,s){if(t&&t.fillColor)return t.fillColor;const a=s[e];return"string"==typeof a&&a?a:void 0}const x="__apexcharts_series_transforms__";var f,y;globalThis[x]||(globalThis[x]={}),f="waterfall","function"==typeof(y=function(t,e){var s,a,i;const r=e.config,o=e.globals;if(!Array.isArray(t))return t;o.waterfallRawSeries||(o.waterfallRawSeries=t.map(t=>n(l({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const h=o.waterfallRawSeries,d=(null==(a=null==(s=r.plotOptions)?void 0:s.waterfall)?void 0:a.colors)||{},c=null==(i=r.xaxis)?void 0:i.categories,b=o.collapsedSeriesIndices||[],x=[],f=[],y=[],v=h.map((t,e)=>{const s=Array.isArray(null==t?void 0:t.data)?t.data:[];if(-1!==b.indexOf(e))return x[e]=[],f[e]=[],y[e]=[],n(l({},t),{data:[]});if(function(t){for(let e=0;e<t.length;e++){const s=t[e],a=Array.isArray(s)?s[1]:s&&"object"==typeof s?s.y:s;if(Array.isArray(a)&&2===a.length)return!0}return!1}(s))return x[e]=s.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t;if(!Array.isArray(e))return null;const s=u.parseNumber(e[0]),a=u.parseNumber(e[1]);return null===s||null===a?null:a-s}),f[e]=s.map(t=>{const e=Array.isArray(t)?t[1]:t&&"object"==typeof t?t.y:t,s=Array.isArray(e)?u.parseNumber(e[1]):null;return null===s?0:s}),y[e]=s.map(()=>null),t;const a=function(t,e,s){const a=[],i=[],r=[],o=[];let h=0,d=0;for(let c=0;c<t.length;c++){const{x:b,y:x,isSubtotal:f,isTotal:y,rest:v}=g(t[c],c,e);let m,C,w;if(y||f)m=y?0:d,C=h,w=y?"total":"subtotal",d=h;else{const t=u.parseNumber(x);if(null===t||!isFinite(t)){a.push(n(l({},v),{x:b,y:null})),i.push(null),r.push(h),o.push(null);continue}m=h,C=h+t,h=C,w=t<0?"negative":"positive"}const I=p(v,w,s);a.push(l(n(l({},v),{x:b,y:[m,C]}),I?{fillColor:I}:{})),i.push(C-m),r.push(h),o.push(w)}return{data:a,values:i,cumulative:r,kinds:o}}(s,c,d);return x[e]=a.values,f[e]=a.cumulative,y[e]=a.kinds,n(l({},t),{data:a.data})});return e.waterfallData={values:x,cumulative:f,kinds:y,geometry:[]},v})&&(globalThis[x][f]=y),d.default.registerFeatures({waterfall:class{constructor(t,e){this.w=t,this.ctx=e}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var t,e;const s=this.w;if(!this.isActive())return;const a=null==(e=null==(t=s.config.plotOptions)?void 0:t.waterfall)?void 0:e.connectors;if(!a||!1===a.show)return;const i=s.dom.elGraphical,r=s.waterfallData&&s.waterfallData.geometry;if(!i||!r)return;this.removeConnectors();const o=new c(s,this.ctx),l=o.group({class:"apexcharts-waterfall-connectors"}),n=a.color||s.config.grid.borderColor,h=null==a.strokeWidth?1:a.strokeWidth,d=null==a.strokeDashArray?3:a.strokeDashArray;let b=0;for(let t=0;t<r.length;t++){const e=r[t];if(Array.isArray(e))for(let t=0;t<e.length-1;t++){const s=e[t],a=e[t+1];if(!s||!a)continue;if(!(a.slotStart-s.slotEnd>.5))continue;const i=s.horizontal?o.drawLine(s.levelEnd,s.slotEnd,s.levelEnd,a.slotStart,n,d,h):o.drawLine(s.slotEnd,s.levelEnd,a.slotStart,s.levelEnd,n,d,h);i.node.classList.add("apexcharts-waterfall-connector"),l.add(i),b++}}if(!b)return;l.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`);const u=i.node.querySelector(".apexcharts-xaxis");u?i.node.insertBefore(l.node,u):i.add(l),this.holdUntilBarsLand(l)}removeConnectors(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-waterfall-connectors");e&&e.parentNode&&e.parentNode.removeChild(e)}holdUntilBarsLand(t){const e=this.w;b.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}});const v=d.__apex_DataLabels,m=(t,e,s,a)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(i)?i:0},C=d.__apex_BrowserAPIs_BrowserAPIs;function w(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(b.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function I(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const l=null==(o=t.globals.labels)?void 0:o[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}function P(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function S(t,e,s=!1,a=!1){var i,r;if(!w(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const l=null==(i=o.seriesY)?void 0:i[e],n=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(l)||!Array.isArray(n))return null;if(!l.length||!n.length)return null;const h=P(l.map((t,s)=>function(t,e,s){var a,i;if(t.isXNumeric){const i=null==(a=t.seriesX)?void 0:a[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const r=null==(i=t.labels)?void 0:i[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(o,e,s))),d=P(n.map((s,a)=>I(t,e,a))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),i=new Set;let r=-1,o=!0,l=t.length===e.length;e.forEach((t,e)=>{const n=s.has(t)&&!i.has(s.get(t))?s.get(t):-1;a[e]=n,-1!==n&&(i.add(n),n<r&&(o=!1),r=n),n!==e&&(l=!1)});const n=[];for(let e=0;e<t.length;e++)i.has(e)||n.push(e);return{toOld:a,exits:n,ordered:o,changed:!l}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function L({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!w(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const l=new Set(a),n=s.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new c(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];n.forEach(s=>{let a=s.fill||d||"#c8c8c8";0===String(a).indexOf("url(")&&(a=d||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:a,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(s.d);let c=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const u=Math.max(1,r||1),g=performance.now(),p=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-g)/u)),a=1-Math.pow(1-s,3),r=1-a;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-a),s<1?C.requestAnimationFrame(p):l.parentNode.removeChild(l)};C.requestAnimationFrame(p)})}class H{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s;const{x:a,y:i,y1:r,y2:o,i:h,j:d,realIndex:b,columnGroupIndex:u,barHeight:g,barWidth:p,barXPosition:x,barYPosition:f,visibleSeries:y}=t,v=this.w,C=new c(this.barCtx.w),w=v.waterfallData&&v.waterfallData.values,I=w&&w[b]&&null!=w[b][d]?w[b][d]:null,P=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[b]:this.barCtx.strokeWidth;let S,L;v.axisFlags.isXNumeric&&!v.globals.isBarHorizontal?(S=a+p*(y+1),L=i+g*(y+1)-P):(S=a+p*y,L=i+g*y);let H=null,k=null,D=a,A=i,R={};const X=v.config.dataLabels,W=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==f&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(L=f,A=f),void 0!==x&&this.barCtx.isVerticalGroupedRangeBar&&(S=x,D=x);const O=m(X.offsetX,v,b,d),Y=m(X.offsetY,v,b,d);let T={width:0,height:0};if(v.config.dataLabels.enabled){const t=null!==I?I:v.seriesData.series[b][d];T=C.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(t,n(l({},v),{seriesIndex:b,dataPointIndex:d,w:v})):v.formatters.yLabelFormatters[0](t),parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight)}const B={x:a,y:i,i:h,j:d,realIndex:b,columnGroupIndex:u,bcx:S,bcy:L,barHeight:g,barWidth:p,textRects:T,strokeWidth:P,dataLabelsX:D,dataLabelsY:A,dataLabelsConfig:X,barDataLabelsConfig:W,barTotalDataLabelsConfig:F,offX:O,offY:Y};if(R=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(B):this.calculateColumnsDataLabelsPosition(B),null!==I&&this.barCtx.isHorizontal&&"center"===W.position){const t=null==(s=null==(e=v.waterfallData.geometry)?void 0:e[b])?void 0:s[d];t&&t.horizontal&&(R.dataLabelsX=(t.levelStart+t.levelEnd)/2+O)}return H=this.drawCalculatedDataLabels({x:R.dataLabelsX,y:R.dataLabelsY,val:null!==I?I:this.barCtx.isRangeBar?[r,o]:"100%"===v.config.chart.stackType?v.globals.seriesPercent[b][d]:v.seriesData.series[b][d],i:b,j:d,barWidth:p,barHeight:g,textRects:T,dataLabelsConfig:X}),v.config.chart.stacked&&F.enabled&&(k=this.drawTotalDataLabels({x:R.totalDataLabelsX,y:R.totalDataLabelsY,barWidth:p,barHeight:g,realIndex:b,j:d,textAnchor:R.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:b,j:d}),rawVal:this.getStackedTotalValue({realIndex:b,j:d}),dataLabelsConfig:X,barTotalDataLabelsConfig:F})),{dataLabelsPos:R,dataLabels:H,totalDataLabels:k}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const s=this.w,a=this.getTotalGroupContext(t),i=s.seriesData.stackedSeriesTotalsByGroups;return a&&i&&i[a.groupIndex]?i[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:b,dataLabelsX:u,dataLabelsY:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:y,offX:v,offY:m}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:I}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=y/2;const P=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?n-h/2+v:n-P+h/2+v,!e.config.chart.stacked&&I>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*I)),w){const t=2;u=u+b.height/2-y/2-t}const S=e.seriesData.series[i][r]<0;let L=l;switch(this.barCtx.isReversed&&(L=l+(S?d:-d)),x.position){case"center":g=w?S?L-d/2+m:L+d/2-m:S?L-d/2+b.height/2+m:L+d/2+b.height/2-m;break;case"bottom":g=w?S?L-d+m:L+d-m:S?L-d+b.height+y+m:L+d-b.height/2+y-m;break;case"top":g=w?S?L+m:L-m:S?L-b.height/2-m:L+b.height+m}let H=L;const k=this.getTotalGroupContext(o);if((k?[k.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{H=S?Math.max(t[r],H):Math.min(t[r],H)})}),this.drawsStackedTotal(o)&&f.enabled){const t=18,i=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=S?H-i.height/2-m-f.offsetY+t:H+i.height+m+f.offsetY-t;const l=P;a=C+(e.axisFlags.isXNumeric?-h/2:h/2-l)+f.offsetX}return e.config.chart.stacked||(g<0?g=0+y:g+b.height/3>e.layout.gridHeight&&(g=e.layout.gridHeight-y)),{bcx:n,bcy:l,dataLabelsX:u,dataLabelsY:g,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:b,strokeWidth:u,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:y}=t;const v=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,I;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+y-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:v)+n/2+d.height/2+y-3;!s.config.chart.stacked&&m>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*m);let P="start";const S=s.seriesData.series[i][r]<0;let L=a;if(this.barCtx.isReversed&&(L=a+(S?-h:h),P=S?"start":"end"),this.barCtx.isPyramid)b=s.layout.gridWidth/2+f;else switch(p.position){case"center":b=S?L+h/2-f:Math.max(d.width/2,L-h/2)+f;break;case"bottom":b=S?L+h-u-f:L-h+u+f;break;case"top":b=S?L-u-f:L-u+f}let H=L;const k=this.getTotalGroupContext(o);if((k?[k.group]:s.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{H=S?Math.min(t[r],H):Math.max(t[r],H)})}),this.drawsStackedTotal(o)&&x.enabled){const t=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),g.fontSize);S?(w=H-u-f-x.offsetX,P="end"):w=H+f+x.offsetX+(this.barCtx.isReversed?-(h+u):u),I=C-d.height/2+t.height/2+x.offsetY+u,s.globals.barGroups.length>1&&!k&&(I-=s.globals.barGroups.length/2*(n/2))}if(!s.config.chart.stacked){const t=S&&"middle"!==g.textAnchor?"start"===g.textAnchor?"end":"start":g.textAnchor;let e;e="vertical"===p.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===p.orientation?d.height:d.width)-e;b+a>s.layout.gridWidth-u&&(b=s.layout.gridWidth-a-u),b-e<u&&(b=e+u)}return{bcx:a,bcy:l,dataLabelsX:b,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:I,totalDataLabelsAnchor:P}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){var b,u,g;const p=this.w;let x="rotate(0)";"vertical"===p.config.plotOptions.bar.dataLabels.orientation&&(x=`rotate(-90, ${t}, ${e})`);const f=new v(this.barCtx.w,this.barCtx.ctx),y=new c(this.barCtx.w),m=d.formatter;let C=null;const w=p.globals.collapsedSeriesIndices.indexOf(a)>-1,P=(p.globals.collapsingSeriesIndices||[]).indexOf(a)>-1;if(P){const t=null==(b=p.globals.prevDataLabels)?void 0:b.get(`${a}::${I(p,a,i)}`);t&&isFinite(t.val)&&(s=t.val)}if(d.enabled&&(!w||P)){C=y.group({class:"apexcharts-data-labels",transform:x});const c=p.config.dataLabels;((null==(u=c.animate)?void 0:u.enabled)||(null==(g=c.countUp)?void 0:g.enabled))&&(C.node.setAttribute("data:dlKey",`${a}::${I(p,a,i)}`),C.node.setAttribute("data:dlJ",String(i)),"number"==typeof s&&isFinite(s)&&C.node.setAttribute("data:dlVal",String(s)));let b="";void 0!==s&&(b=m(s,n(l({},p),{seriesIndex:a,dataPointIndex:i,w:p}))),!s&&p.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b="");const v=p.seriesData.series[a][i]<0,w=p.config.plotOptions.bar.dataLabels.position;if("vertical"===p.config.plotOptions.bar.dataLabels.orientation&&("top"===w&&(d.textAnchor=v?"end":"start"),"center"===w&&(d.textAnchor="middle"),"bottom"===w&&(d.textAnchor=v?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<y.getTextRects(b,parseFloat(d.style.fontSize).toString()).width&&(b="")}p.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!P&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(b=""):r.height/1.6>Math.abs(o)&&(b=""));const S=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?S.textAnchor="end":"end"===d.textAnchor&&(S.textAnchor="start")),f.plotDataLabelsText({x:t,y:e,text:b,i:a,j:i,parent:C,dataLabelsConfig:S,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return C}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:l}){var n,h;const d=new c(this.barCtx.w);let b;if(l.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){b=d.drawText({x:t,y:e,foreColor:l.style.color,text:s,textAnchor:o,fontFamily:l.style.fontFamily,fontSize:l.style.fontSize,fontWeight:l.style.fontWeight}),b.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const c=this.w.config.dataLabels;if((null==(n=c.animate)?void 0:n.enabled)||(null==(h=c.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);b.node.setAttribute("data:dlTotalKey",`${t}::${I(this.w,i,r)}`),b.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof a&&isFinite(a)&&b.node.setAttribute("data:dlTotalVal",String(a))}}return b}}const k=d.__apex_Series,D=d.__apex_Fill;function A(t){var e,s,a,i,r,o,l;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(i=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:i.overlap)&&(null!=(l=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?l:0)>1)}class R{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),u.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let a=0;a<e.length;a++){const i=e[a];for(;s[a]<i.length&&"number"!=typeof i[s[a]];)s[a]++;if(s[a]>=i.length)continue;const o=i[s[a]];o==o?o<t&&(t=o,r=a):(s[a]++,a--)}if(-1===r)break;if(s[r]++,a==a){const e=t-a;e>0&&e<i&&(i=e)}a=t}return isFinite(i)?i:0}initialPositions(t){const e=this.w;let s,a,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||A(e))&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(r=e/t),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:l}).x}else s=e.globals.padHorizontal+u.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var i;const r=this.w,o=new D(this.barCtx.w);let l=null;const n=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(l=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(i=r.config.series[e].data[s])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(l=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?n:a,dataPointIndex:s,color:l,opacity:b,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[a]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const i=s.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=a.order[e];if(!r)return null;const o=s.globals.colors[r[0]],l=s.globals.colors[r[1]];return o&&l?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:l,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const l="bar"===this.w.config.chart.type&&1===r,n=l?"top":"both",h=l?"top":"bottom";for(const e of this.getStackedSeriesIndices(i))for(let s=0;s<r;s++){const a=[],i=[];for(const r of e){const e=t[r][s];e>0?a.push(r):e<0&&i.push(r)}if(a.length>0&&0===i.length)if(1===a.length)o[a[0]][s]=n;else{const t=a[0],e=a[a.length-1];for(const i of a)o[i][s]=i===t?h:i===e?"top":"none"}else if(i.length>0&&0===a.length)if(1===i.length)o[i[0]][s]="both";else{const t=Math.max(...i),e=Math.min(...i);for(const a of i)o[a][s]=a===t?"bottom":a===e?"top":"none"}else if(a.length>0&&i.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const l=this.w,n=new c(this.barCtx.w),h=new k(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=n.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:b}){var u,g,p;const x=new c(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(u=b.config.series[n].data[d])?void 0:u.columnWidthOffset)&&(y=e-b.config.series[n].data[d].columnWidthOffset/2,f=t+b.config.series[n].data[d].columnWidthOffset);const v=i/2,m=y+v,C=y+f-v,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001-v*w,a+=.001+v*w;const I=x.line(C,s),P="around"===b.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",S=x.move(m,s)+x.line(m,a)+x.line(C,a)+I+P;let L=S;"none"!==this.arrBorderRadius[n][d]&&(L=x.roundPathCorners(L,b.config.plotOptions.bar.borderRadius));let H=null;const k=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(k?H=k:b.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(n,d,L,S)),null==H&&(H=x.move(m,s)+x.line(m,s)+I+I+I+I+I+x.line(m,s)+P),b.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(a-v*w),t.yArrjF.push(Math.abs(s-a+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:L,pathFrom:H,drawnBox:{x1:m,x2:C,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new c(this.barCtx.w),b=l.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,g=u(s[a][i]),p=i===s[a].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:g:u(s[a][i+1]);const y=o/2,v=t+y,m=t+e-y,C=b-g,w=b+g,I=b-f,P=b+f,S=d.move(C,v)+d.line(w,v)+d.line(P,m)+d.line(I,m)+" Z";let L=null;const H=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?L=H:l.globals.previousPaths.length>0&&(L=this.barCtx.getPreviousPath(r,i,S)),null==L&&(L=d.move(b,v)+d.line(b,v)+d.line(b,m)+d.line(b,m)+" Z"),{pathTo:S,pathFrom:L,x:w,x1:C,barXPosition:b}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const a=l/r,h=e*s,d=a*s;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new c(this.barCtx.w),b=l.layout.gridWidth/2,u=o/2,g=t+u,p=t+e-u,x=b-s,f=b+s,y=b-a,v=b+a,m=d.move(x,g)+d.line(f,g)+d.line(v,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(b,g)+d.line(b,g)+d.line(b,p)+d.line(b,p)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:b}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:b}){var u,g,p;const x=new c(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(u=b.config.series[n].data[d])?void 0:u.barHeightOffset)&&(f=t-b.config.series[n].data[d].barHeightOffset/2,y=e+b.config.series[n].data[d].barHeightOffset);const v=i/2,m=f+v,C=f+y-v,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001+v*w,a+=.001-v*w;const I=this.barCtx.isFunnel,P=I?(s+a)/2:s,S=x.line(s,C),L="around"===b.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",H=x.move(s,m)+x.line(a,m)+x.line(a,C)+S+L;let k=H;"none"!==this.arrBorderRadius[n][d]&&(k=x.roundPathCorners(k,b.config.plotOptions.bar.borderRadius));let D=null;const A=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(A?D=A:b.globals.previousPaths.length>0&&(D=this.barCtx.getPreviousPath(n,d,k,H)),null==D){const t=I?x.line(P,C):S;D=x.move(P,m)+x.line(P,m)+t+t+t+t+t+x.line(P,m)+L}if(b.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(a+v*w),t.xArrjF.push(Math.abs(s-a-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:k,pathFrom:D,drawnBox:{x1:s,x2:a,y1:m,y2:C}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,i);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=n(l({},s),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,i,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===r&&r!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],i=s.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&a.push({value:r,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new c(this.barCtx.w),l=o.group({class:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;n=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n),t.attrs.label&&l.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,a=t+s+i/2;n=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n),e.attrs.label&&l.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),l}drawDumbbellLabel(t,e){const s=this.w,a=new c(s),i=s.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:b}=e,g=n+e.barHeight,p=new c(this.barCtx.w),x=new u,f=p.move(l,g)+p.line(o,g)+p.line(h,b)+p.line(d,b)+p.line(l,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return p.drawPath({d:f,fill:x.shadeColor(.5,u.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let i=0,r=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let i=a.indexOf(s);return i<0&&(a.push(s),i=a.length-1),{groupIndex:s,columnGroupIndex:i}}}const X=d.__apex_CoreUtils,W=d.__apex_Filters,F=d.__apex_Animations_computeStagger;class O{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)/O.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*O.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const i=a.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class Y{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new k(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new X(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new R(this)}draw(t,e){var s,a,i;const r=this.w,o=new c(this.w),h=new X(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,c=0;h<t.length;h++,c++){let b,g;const p=[],x=[],f=r.globals.comboCharts?e[h]:h,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(f),v=o.group({class:"apexcharts-series",rel:h+1,seriesName:u.escapeString(r.seriesData.seriesNames[f]),"data:realIndex":f});k.addCollapsedClassToSeries(this.w,v,f),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[f],this.translationsIndex=f);const m=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const C=this.barHelpers.initialPositions(f),{y:w,yDivision:P,zeroW:S,x:H,xDivision:D,zeroH:A}=C;let R=C.barHeight,X=C.barWidth;g=w,b=H,this.isHorizontal||x.push(b+(null!=X?X:0)/2);const F=o.group({class:"apexcharts-datalabels","data:realIndex":f});r.globals.delayedElements.push({el:F.node,holdUntilComplete:!(null==(s=r.config.dataLabels.animate)?void 0:s.enabled)&&this.isLengthTransition(f)}),F.node.classList.add("apexcharts-element-hidden");const O=o.group({class:"apexcharts-bar-goals-markers"}),Y=o.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:Y.node}),Y.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const s=this.barHelpers.getStrokeWidth(h,e,f);let o=null;const d={indexes:{i:h,j:e,realIndex:f,translationsIndex:m,bc:c},x:b,y:g,strokeWidth:s,elSeries:v};this.isHorizontal?(o=this.drawBarPaths(n(l({},d),{barHeight:R,zeroW:S,yDivision:P})),X=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(n(l({},d),{xDivision:D,barWidth:X,zeroH:A})),R=this.series[h][e]/this.yRatio[m]);const C=this.barHelpers.getPathFillColor(t,h,e,f);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(a=r.config.plotOptions.funnel)?void 0:a.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof C.color&&-1===(null==(i=C.color)?void 0:i.indexOf("url"))?C.color:u.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:f,j:e});if(Y.add(t),r.config.chart.dropShadow.enabled){new W(this.w).dropShadow(t,r.config.chart.dropShadow,f)}}this.pathArr.push(o);const w=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:R,barWidth:X});w&&O.add(w),g=o.y,b=o.x,e>0&&x.push(b+(null!=X?X:0)/2),p.push(g),this.renderSeries(n(l({realIndex:f,pathFill:C.color},C.useRangeColor?{lineFill:C.color}:{}),{j:e,i:h,columnGroupIndex:y,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:s,elSeries:v,x:b,y:g,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:R),barWidth:Math.abs(o.barWidth?o.barWidth:X),elDataLabelsWrap:F,elGoalsMarkers:O,elBarShadows:Y,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[f]=x,r.globals.seriesYvalues[f]=p,r.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[h].length;s++)e.push(I(r,f,s));L({w:r,elSeries:v,record:this._prevRecord(f),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}d.add(v)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:b,y1:u,y2:g,series:p,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,elDataLabelsWrap:m,elGoalsMarkers:C,elBarShadows:w,visibleSeries:P,type:S,classes:L}){var k,D,A,R,X,O,Y;const T=this.w,B=new c(this.w,this.ctx),j=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,B);let G=!1;const z=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,B.setupEventDelegation(h,`.apexcharts-${S}-area`)),!s){let e=function(t){const e=T.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:T.seriesData.series[t][a],dataPointIndex:a,w:T}):s};const i="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];s=this.barOptions.distributed?T.globals.stroke.colors[a]:i}const _=T.config.chart.animations,M=_.animateGradually;let N=0,E=0;if(M&&!1!==M.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=M.delay||0,s=Math.min(e,.5*_.speed/Math.max(1,t));E=F({style:"sequential",index:a,baseDelay:s}),T.config.chart.stacked&&!T.globals.dataChanged&&(E+=i*s*.5);N=E/(e||1)}const V=new H(this).handleBarDataLabels({x:d,y:b,y1:u,y2:g,i:i,j:a,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,visibleSeries:P});if(E>0){const t=T.config.dataLabels;if((null==(k=t.animate)?void 0:k.enabled)||(null==(D=t.countUp)?void 0:D.enabled)){const t=String(Math.round(E));null==(R=null==(A=V.dataLabels)?void 0:A.node)||R.setAttribute("data:dlDelay",t),null==(O=null==(X=V.totalDataLabels)?void 0:X.node)||O.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(V.dataLabelsPos.dataLabelsX+Math.max(f,T.globals.barPadForNumericAxis)<0||V.dataLabelsPos.dataLabelsX-Math.max(f,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(G=!0),T.config.series[i].data[a]&&T.config.series[i].data[a].strokeColor&&(s=T.config.series[i].data[a].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!G){const r=!0===(null==(Y=this.ctx.morphTypeChange)?void 0:Y.isActive()),d=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,c=r&&this.ctx.morphTypeChange.claimsTargetMark(t,a);c&&(o=l,N=0);const b=j.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:z,animationDelay:N,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${S}-area${L?` ${L}`:""}`,chartType:S,bindEventsOnPaths:!1});b.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),c&&(b.node.setAttribute("opacity","0"),b.node.setAttribute("data-piece-hidden","1"));const p=T.config.forecastDataPoints;p.count>0&&a>=T.globals.dataPoints-p.count&&(b.node.setAttribute("stroke-dasharray",p.dashArray),b.node.setAttribute("stroke-width",p.strokeWidth),b.node.setAttribute("fill-opacity",p.fillOpacity)),void 0!==u&&void 0!==g&&(b.attr("data-range-y1",u),b.attr("data-range-y2",g));new W(this.w).setSelectionFilter(b,t,a),h.add(b),b.attr({cy:V.dataLabelsPos.bcy,cx:V.dataLabelsPos.bcx,j:a,val:T.seriesData.series[i][a],barHeight:x,barWidth:f,"data:pathKey":I(T,t,a)}),"canvas"===j.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][a]={cx:V.dataLabelsPos.bcx,cy:V.dataLabelsPos.bcy,barWidth:f}),null!==V.dataLabels&&m.add(V.dataLabels),V.totalDataLabels&&m.add(V.totalDataLabels),h.add(m),C&&h.add(C),w&&h.add(w)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!u;if(u)c=u.y,e=u.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||g)&&(a=p.x1,i=p.x),n.axisFlags.isXNumeric||g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*s}else g=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),u.isNumber(i.seriesData.seriesX[r][a])&&(t=O.dataXToPx(i,i.seriesData.seriesX[r][a])-e*this.seriesLen/2),{barXPosition:t+(A(i)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let i=!1;if(w(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(I(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=S(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return w(i)?null:s;let o=null,l=!1;const n=this._prevKeyedPaths(t);if(n){const s=n.get(I(i,t,e));s?o=s.d:l=!0}else void 0!==r.paths[e]?o=r.paths[e].d:l=!0;if(o){const t=Y.pathCommandCount(o),e=Y.pathCommandCount(s);if(t===e)return o;const r=new c(i),l=t=>{const e=Y.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=t<e?l(o)>1:l(s)>1;if(t<e){const t=r.roundPathCorners(o,0);if(Y.pathCommandCount(t)===e){if(n&&a){const t=r.roundPathCorners(a,0);Y.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(s,0);if(Y.pathCommandCount(e)===t){if(this._pathToInterp=e,n){const e=Y.squareLike(o),s=e?r.roundPathCorners(e,0):null;if(s&&Y.pathCommandCount(s)===t)return s}return o}}}return l&&w(i)?null:s}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Y.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:i,maxY:r,start:o,vertical:l}=e,n=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,b;l?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,b]=n(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=n(o[0],s,a));const u=t.trim().endsWith("Z")?" Z":" z";return l?`M ${h} ${c} L ${h} ${b} L ${d} ${b} L ${d} ${c}${u}`:`M ${h} ${c} L ${d} ${c} L ${d} ${b} L ${h} ${b}${u}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const i=this._prevKeyedPaths(t),r=i?i.get(I(s,t,e)):a.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}d.default.use({bar:Y,column:Y,barStacked:class extends Y{draw(t,e){const s=this.w;this.graphics=new c(this.w),this.bar=new Y(this.w,this.ctx,this.xyRatios);const a=new X(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,o=0;const h=s.config.chart.animations,d=h.enabled&&h.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let b=!1;for(let a=0,h=0;a<t.length;a++,h++){const c=s.globals.comboCharts?e[a]:a,{groupIndex:g,columnGroupIndex:p}=this.barHelpers.getGroupIndex(c);this.groupCtx=this[s.labelData.seriesGroups[g]];const x=[],f=[];let y=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[c][0],y=c),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:u.escapeString(s.seriesData.seriesNames[c]),rel:a+1,"data:realIndex":c});k.addCollapsedClassToSeries(this.w,v,c);const m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c});k.addCollapsedClassToSeries(this.w,m,c),(s.globals.collapsingSeriesIndices||[]).indexOf(c)>-1&&m.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(r,o,void 0,void 0,void 0,void 0,y),{xDivision:I,yDivision:P,zeroH:S,zeroW:L}=w;let H=w.barHeight,D=w.barWidth;o=w.y,r=w.x,s.globals.barHeight=H,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>S),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(a,e,c),u={indexes:{i:a,j:e,realIndex:c,translationsIndex:y,bc:h},strokeWidth:i,x:r,y:o,elSeries:v,columnGroupIndex:p,seriesGroup:s.labelData.seriesGroups[g]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(n(l({},u),{zeroW:L,barHeight:H,yDivision:P})),D=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(n(l({},u),{xDivision:I,barWidth:D,zeroH:S})),H=this.series[a][e]/this.yRatio[y]);const k=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:H,barWidth:D});k&&C.add(k),o=w.y,r=w.x,x.push(r),f.push(o);const A=this.barHelpers.getPathFillColor(t,a,e,c);let R="";const X=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",W="bottom"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]>0||"top"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]<0,F=d&&!W&&this.getPreviousFlip(c,e);(W||F)&&(R=X),F&&(R+=" apexcharts-flip-held",b=!0),v=this.renderSeries(n(l({realIndex:c,pathFill:A.color},A.useRangeColor?{lineFill:A.color}:{}),{j:e,i:a,columnGroupIndex:p,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:i,elSeries:v,x:r,y:o,series:t,barHeight:H,barWidth:D,elDataLabelsWrap:m,elGoalsMarkers:C,type:"bar",visibleSeries:p,classes:R}))}s.globals.seriesXvalues[c]=x,s.globals.seriesYvalues[c]=f,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(v)}return b&&this.settleHeldMirrors(),i}settleHeldMirrors(){const t=this.w;if(!b.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&u.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,s,a,i,r,o){const l=this.w;let n,h;if(this.isHorizontal){a=l.layout.gridHeight/l.globals.dataPoints;const t=l.config.plotOptions.bar.barHeight;n=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,r=l.globals.padHorizontal+(this.isReversed?l.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-n)/2}else{h=s=l.layout.gridWidth/l.globals.dataPoints;const e=l.config.plotOptions.bar.columnWidth,a=l.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),i=this.isReversed?this.baseLineY[o]:l.layout.gridHeight-this.baseLineY[o],t=l.globals.padHorizontal+(s-h)/2}const d=l.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=n?n:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,columnGroupIndex:o,seriesGroup:l,yDivision:n,elSeries:h}){var d,c,b,u,g;const p=this.w,x=r+o*e;let f;const y=t.i,v=t.j,m=t.realIndex,C=t.translationsIndex;let w=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)w+=this.groupCtx.prevXF[t][v];const I=this.groupCtx.prevX.length;if(I>0){let t=a;this.groupCtx.prevXVal[I-1][v]<0?t=(null==(d=this.series[y])?void 0:d[v])>=0?this.groupCtx.prevX[I-1][v]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[I-1][v]:this.groupCtx.prevXVal[I-1][v]>=0&&(t=(null==(c=this.series[y])?void 0:c[v])>=0?this.groupCtx.prevX[I-1][v]:this.groupCtx.prevX[I-1][v]-w+2*(this.isReversed?w:0)),f=t}else f=a;i=null===(null==(b=this.series[y])?void 0:b[v])?f:f+(null==(u=this.series[y])?void 0:u[v])/this.invertedYRatio-2*(this.isReversed?(null==(g=this.series[y])?void 0:g[v])/this.invertedYRatio:0);const P=this.barHelpers.getBarpaths({barYPosition:x,barHeight:e,x1:f,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:l,i:y,j:v,w:p});return this.barHelpers.barBackground({j:v,i:y,y1:x,y2:e,elSeries:h}),r+=n,{pathTo:P.pathTo,pathFrom:P.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,m,v,C),barXPosition:f,barYPosition:x,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,columnGroupIndex:o,seriesGroup:l,elSeries:n}){var h,d,c,b,u,g,p,x,f;const y=this.w,v=t.i,m=t.j,C=t.bc,w=t.realIndex,I=t.translationsIndex;if(y.axisFlags.isXNumeric){let t=y.seriesData.seriesX[w][m];t||(t=0),e=(t-y.globals.minX)/this.xRatio-i/2*y.globals.barGroups.length}const P=e+o*i;let S,L=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)L+=isNaN(this.groupCtx.prevYF[t][m])?0:this.groupCtx.prevYF[t][m];const H=this.groupCtx.prevY.length;if(H>0&&!y.axisFlags.isXNumeric||H>0&&y.axisFlags.isXNumeric&&y.seriesData.seriesX[w-1][m]===y.seriesData.seriesX[w][m]){let t,e;const s=Math.min(this.yRatio.length+1,w+1);if(void 0!==this.groupCtx.prevY[H-1]&&this.groupCtx.prevY[H-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[H-t])?void 0:h[m])){e=this.groupCtx.prevY[H-t][m];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[H-a])?void 0:d[m])<0){t=(null==(c=this.series[v])?void 0:c[m])>=0?e-L+2*(this.isReversed?L:0):e;break}if((null==(b=this.groupCtx.prevYVal[H-a])?void 0:b[m])>=0){t=(null==(u=this.series[v])?void 0:u[m])>=0?e:e+L-2*(this.isReversed?L:0);break}}void 0===t&&(t=y.layout.gridHeight),S=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,H).every(t=>t.every(t=>isNaN(t)))?r:t}else S=r;s=(null==(p=this.series[v])?void 0:p[m])?S-(null==(x=this.series[v])?void 0:x[m])/this.yRatio[I]+2*(this.isReversed?(null==(f=this.series[v])?void 0:f[m])/this.yRatio[I]:0):S;const k=this.barHelpers.getColumnPaths({barXPosition:P,barWidth:i,y1:S,y2:s,yRatio:this.yRatio[I],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:v,j:m,w:y});return this.barHelpers.barBackground({bc:C,j:m,i:v,x1:P,x2:i,elSeries:n}),{pathTo:k.pathTo,pathFrom:k.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,w,m,0),barXPosition:P,x:y.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends Y{draw(t,e){var s,a,i,r,o,n,h,d,b;const g=this.w,p=new c(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const x=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let c=0;c<t.length;c++){let f,y;const v=g.globals.comboCharts?e[c]:c,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(v),C=p.group({class:"apexcharts-series",seriesName:u.escapeString(g.seriesData.seriesNames[v]),rel:c+1,"data:realIndex":v});k.addCollapsedClassToSeries(this.w,C,v),t[c].length>0&&(this.visibleI=this.visibleI+1);let w=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[v][0],w=v);const I=this.barHelpers.initialPositions(v),{y:P,zeroW:S,x:L,zeroH:H}=I;let D=null!=(s=I.barWidth)?s:0,A=null!=(a=I.barHeight)?a:0;const R=null!=(i=I.yDivision)?i:0,X=null!=(r=I.xDivision)?r:0;y=P,f=L;const W=p.group({class:"apexcharts-datalabels","data:realIndex":v}),F=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(c,e,v),a=this.seriesRangeStart[c][e],i=this.seriesRangeEnd[c][e];let r=null,u=null,p=null;const x={x:f,y:y,strokeWidth:s,elSeries:C};let P=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=g.config.series[c].data)?void 0:o[e]))break;if(this.isHorizontal){p=y+A*this.visibleI;const t=(R-A*P)/2;if(null==(h=null==(n=g.config.series[c].data)?void 0:n[e])?void 0:h.x){const s=this.detectOverlappingBars({i:c,j:e,barYPosition:p,srty:t,barHeight:A,yDivision:R,initPositions:I});A=s.barHeight,p=s.barYPosition}r=this.drawRangeBarPaths(l({indexes:{i:c,j:e,realIndex:v},barHeight:A,barYPosition:p,zeroW:S,yDivision:R,y1:a,y2:i},x)),D=r.barWidth}else{g.axisFlags.isXNumeric&&(f=(g.seriesData.seriesX[c][e]-g.globals.minX)/this.xRatio-D/2),u=f+D*this.visibleI;const t=(X-D*P)/2;if(null==(b=null==(d=g.config.series[c].data)?void 0:d[e])?void 0:b.x){const s=this.detectOverlappingBars({i:c,j:e,barXPosition:u,srtx:t,barWidth:D,xDivision:X,initPositions:I});D=s.barWidth,u=s.barXPosition}r=this.drawRangeColumnPaths(l({indexes:{i:c,j:e,realIndex:v,translationsIndex:w},barWidth:D,barXPosition:u,zeroH:H,xDivision:X},x)),A=r.barHeight}const L=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:p,goalX:r.goalX,goalY:r.goalY,barHeight:A,barWidth:D});L&&F.add(L),y=r.y,f=r.x;const k=this.barHelpers.getPathFillColor(t,c,e,v);this.renderSeries({realIndex:v,pathFill:k.color,lineFill:k.useRangeColor?k.color:g.globals.stroke.colors[v],j:e,i:c,x:f,y:y,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:C,series:t,barHeight:A,barWidth:D,barXPosition:u,barYPosition:p,columnGroupIndex:m,elDataLabelsWrap:W,elGoalsMarkers:F,visibleSeries:this.visibleI,type:"rangebar"})}x.add(C)}return x}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:i,srtx:r,barHeight:o,barWidth:l,yDivision:n,xDivision:h,initPositions:d}){var c,b,u,g;const p=this.w;let x=[];const f=null==(b=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:b[e],y=null==(g=null==(u=p.config.series[t].data)?void 0:u[e])?void 0:g.x,v=Array.isArray(y)?y.join(" "):y,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(v),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===v&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?i+n*m:i+o*this.visibleI+n*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+n*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+n*m))):(m>-1&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+l*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(l=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:l}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,l;const n=this.w,{i:h,j:d,realIndex:c,translationsIndex:b}=t,u=this.yRatio[b],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(l=this.series[h])?void 0:l[d]));f?(p=r-p/u,x=r-x/u):p=r;const y=Math.abs(x-p),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:n});if(f){const t=v.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,i=t.barXPosition}else e+=s;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,c,d,b),barXPosition:i}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:i,barHeight:r,barYPosition:o,zeroW:l}){const n=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(l+s/this.invertedYRatio),b=this.preventBarOverflow(l+a/this.invertedYRatio),u=this.getRangeValue(h,d),g=Math.abs(b-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:c,x2:b,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:n});if(null!=u.start&&null!=u.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return n.axisFlags.isXNumeric||(e+=i),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:u.start<0&&u.end<0?c:b,goalX:this.barHelpers.getGoalValues("x",l,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
package/dist/waterfall.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -20,12 +20,17 @@
|
|
|
20
20
|
* v3 added `api.reserve()`, for a plugin that renders its own UI inside the
|
|
21
21
|
* chart's container and needs the chart to make room for it.
|
|
22
22
|
*
|
|
23
|
+
* v4 added `api.pointer()`, so a plugin can learn which data point a viewer is
|
|
24
|
+
* pointing at or has selected. The chart already computed that for its own
|
|
25
|
+
* tooltip and its `dataPoint*` events; before this a plugin either re-derived
|
|
26
|
+
* it from raw pixels or did without.
|
|
27
|
+
*
|
|
23
28
|
* Feature-detect rather than bumping `apiVersion` unless the plugin genuinely
|
|
24
29
|
* cannot work without the new surface: a plugin declaring v3 is SKIPPED
|
|
25
30
|
* outright on a v2 host, so `apiVersion: 2` plus `typeof api.reserve ===
|
|
26
31
|
* 'function'` keeps one build working on both.
|
|
27
32
|
*/
|
|
28
|
-
export const WEAVE_API_VERSION =
|
|
33
|
+
export const WEAVE_API_VERSION = 4
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
36
|
* Public chart methods safe to expose to plugins (each bound to ctx). Excludes
|
|
@@ -372,6 +377,37 @@ export function buildPluginAPI(host, record) {
|
|
|
372
377
|
return api
|
|
373
378
|
},
|
|
374
379
|
|
|
380
|
+
/**
|
|
381
|
+
* Subscribe to the data point a viewer is pointing at.
|
|
382
|
+
*
|
|
383
|
+
* The chart already knows this: it resolves the series and point under the
|
|
384
|
+
* pointer for its own tooltip and fires `dataPointMouseEnter`,
|
|
385
|
+
* `dataPointMouseLeave` and `dataPointSelection` for the caller. This
|
|
386
|
+
* forwards the same three, so a plugin gets the host's answer rather than
|
|
387
|
+
* hit-testing the SVG itself and disagreeing with the tooltip.
|
|
388
|
+
*
|
|
389
|
+
* The payload is normalised rather than the chart's own argument list,
|
|
390
|
+
* which passes `w`. A plugin must not receive `w`, and the three things a
|
|
391
|
+
* plugin actually wants (which series, which point, what the point is
|
|
392
|
+
* called) are exactly what the chart has already resolved.
|
|
393
|
+
*
|
|
394
|
+
* `category` is the resolved display label, the same string `api.categories`
|
|
395
|
+
* carries, because a plugin coordinating two charts keys on the label
|
|
396
|
+
* rather than on an index that means something different on each chart.
|
|
397
|
+
*
|
|
398
|
+
* Nothing here gives a plugin the ability to intercept or cancel: the
|
|
399
|
+
* chart's own tooltip, selection state and caller events are unaffected,
|
|
400
|
+
* and a handler that throws is contained rather than allowed to break the
|
|
401
|
+
* interaction it was watching.
|
|
402
|
+
*
|
|
403
|
+
* @param {(e: {type: 'enter'|'leave'|'select', seriesIndex: number, dataPointIndex: number, category: string|undefined, seriesName: string|undefined, selected: boolean|undefined}) => void} fn
|
|
404
|
+
* @returns {() => void} unsubscribe
|
|
405
|
+
* @since Weave v4
|
|
406
|
+
*/
|
|
407
|
+
pointer(fn) {
|
|
408
|
+
return host._onPointer(record.def.name, fn)
|
|
409
|
+
},
|
|
410
|
+
|
|
375
411
|
// ── custom events out to the host app ──
|
|
376
412
|
/**
|
|
377
413
|
* Fires as `plugin:<pluginName>:<name>` on the chart's event bus. The
|
|
@@ -50,6 +50,10 @@ export default class WeaveHost {
|
|
|
50
50
|
this._reserved = null
|
|
51
51
|
/** @type {any} pending re-render for a changed reservation */
|
|
52
52
|
this._reserveTimer = null
|
|
53
|
+
/** @type {Map<string, Function[]>|null} plugin name -> pointer handlers */
|
|
54
|
+
this._pointerSubs = null
|
|
55
|
+
/** @type {Array<[string, Function]>|null} chart listeners to remove on teardown */
|
|
56
|
+
this._pointerWired = null
|
|
53
57
|
|
|
54
58
|
this._onUpdated = this._onUpdated.bind(this)
|
|
55
59
|
this._init()
|
|
@@ -385,6 +389,143 @@ export default class WeaveHost {
|
|
|
385
389
|
this._repairInitialSeries()
|
|
386
390
|
}
|
|
387
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Subscribe a plugin to the data point the viewer is pointing at.
|
|
394
|
+
*
|
|
395
|
+
* Wired lazily: a chart whose plugins never ask pays nothing, and the chart
|
|
396
|
+
* fires these three events whether or not anyone is listening, so there is no
|
|
397
|
+
* cost to the chart either way.
|
|
398
|
+
*
|
|
399
|
+
* The chart's own handler signature is `(e, ctx, {seriesIndex,
|
|
400
|
+
* dataPointIndex, w})`. `w` stops here: what reaches a plugin is the
|
|
401
|
+
* normalised payload documented on `api.pointer`.
|
|
402
|
+
*
|
|
403
|
+
* @param {string} pluginName
|
|
404
|
+
* @param {Function} fn
|
|
405
|
+
* @returns {() => void} unsubscribe
|
|
406
|
+
*/
|
|
407
|
+
_onPointer(pluginName, fn) {
|
|
408
|
+
if (typeof fn !== 'function') return () => {}
|
|
409
|
+
if (!this._pointerSubs) this._pointerSubs = new Map()
|
|
410
|
+
const list = this._pointerSubs.get(pluginName) || []
|
|
411
|
+
list.push(fn)
|
|
412
|
+
this._pointerSubs.set(pluginName, list)
|
|
413
|
+
this._wirePointer()
|
|
414
|
+
return () => {
|
|
415
|
+
const current = this._pointerSubs && this._pointerSubs.get(pluginName)
|
|
416
|
+
if (!current) return
|
|
417
|
+
const i = current.indexOf(fn)
|
|
418
|
+
if (i > -1) current.splice(i, 1)
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/** Attach to the chart's own data point events, once. */
|
|
423
|
+
_wirePointer() {
|
|
424
|
+
if (this._pointerWired) return
|
|
425
|
+
if (!this.ctx || typeof this.ctx.addEventListener !== 'function') return
|
|
426
|
+
/** @type {Array<['enter'|'leave'|'select', string]>} */
|
|
427
|
+
const map = [
|
|
428
|
+
['enter', 'dataPointMouseEnter'],
|
|
429
|
+
['leave', 'dataPointMouseLeave'],
|
|
430
|
+
['select', 'dataPointSelection'],
|
|
431
|
+
]
|
|
432
|
+
this._pointerWired = []
|
|
433
|
+
for (const [type, name] of map) {
|
|
434
|
+
const handler = (/** @type {any} */ _e, /** @type {any} */ _ctx, /** @type {any} */ opts) => {
|
|
435
|
+
this._emitPointer(type, opts)
|
|
436
|
+
}
|
|
437
|
+
this.ctx.addEventListener(name, handler)
|
|
438
|
+
this._pointerWired.push([name, handler])
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Hand one pointer event to every subscribed plugin.
|
|
444
|
+
*
|
|
445
|
+
* A handler that throws is contained per plugin, on the same terms as every
|
|
446
|
+
* other plugin callback here: this runs inside the viewer's own hover, and a
|
|
447
|
+
* plugin breaking the chart's interaction would be the worst failure mode
|
|
448
|
+
* this facade has.
|
|
449
|
+
*
|
|
450
|
+
* @param {'enter'|'leave'|'select'} type
|
|
451
|
+
* @param {any} opts
|
|
452
|
+
*/
|
|
453
|
+
_emitPointer(type, opts) {
|
|
454
|
+
if (!this._pointerSubs || !this._pointerSubs.size) return
|
|
455
|
+
const seriesIndex = opts && typeof opts.seriesIndex === 'number' ? opts.seriesIndex : -1
|
|
456
|
+
const dataPointIndex =
|
|
457
|
+
opts && typeof opts.dataPointIndex === 'number' ? opts.dataPointIndex : -1
|
|
458
|
+
// The host's OWN category resolution, the same one `api.categories` reads.
|
|
459
|
+
// `globals.labels` is the raw slot list and on a category axis it is
|
|
460
|
+
// [1,2,3,4], so keying a cross-chart selection on it would key on a number
|
|
461
|
+
// that means something different on every chart. Measured: a chart with
|
|
462
|
+
// xaxis.categories ['Jan'..'Apr'] reported category 3 rather than 'Mar'.
|
|
463
|
+
const labels = this._categories() || []
|
|
464
|
+
const w = this.w
|
|
465
|
+
const config = (w && w.config && w.config.series) || []
|
|
466
|
+
const payload = {
|
|
467
|
+
type,
|
|
468
|
+
seriesIndex,
|
|
469
|
+
dataPointIndex,
|
|
470
|
+
category: dataPointIndex > -1 ? labels[dataPointIndex] : undefined,
|
|
471
|
+
// A pie/donut carries bare numbers in `series`, so there is no name to
|
|
472
|
+
// read: undefined rather than a guess, on the same terms as `category`.
|
|
473
|
+
seriesName: WeaveHost._seriesName(config, seriesIndex),
|
|
474
|
+
// Only meaningful on a select: the chart hands back its whole selection
|
|
475
|
+
// set, and what a plugin wants to know is whether THIS point is now in
|
|
476
|
+
// it, so a second click reads as a deselect rather than another select.
|
|
477
|
+
selected: type === 'select' ? WeaveHost._isSelected(opts, seriesIndex, dataPointIndex) : undefined,
|
|
478
|
+
}
|
|
479
|
+
for (const [name, handlers] of this._pointerSubs) {
|
|
480
|
+
for (const fn of handlers.slice()) {
|
|
481
|
+
try {
|
|
482
|
+
fn(payload)
|
|
483
|
+
} catch (e) {
|
|
484
|
+
console.warn(
|
|
485
|
+
'[apexcharts] plugin "' + name + '" threw in a pointer handler',
|
|
486
|
+
e
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* The configured name of series `i`, where there is one.
|
|
495
|
+
*
|
|
496
|
+
* @param {any[]} config
|
|
497
|
+
* @param {number} i
|
|
498
|
+
* @returns {string|undefined}
|
|
499
|
+
*/
|
|
500
|
+
static _seriesName(config, i) {
|
|
501
|
+
if (i < 0) return undefined
|
|
502
|
+
const entry = config[i]
|
|
503
|
+
if (!entry || typeof entry !== 'object') return undefined
|
|
504
|
+
return typeof entry.name === 'string' ? entry.name : undefined
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Whether the chart now counts this point as selected.
|
|
509
|
+
*
|
|
510
|
+
* `selectedDataPoints` is an array per series of the indexes selected in it.
|
|
511
|
+
* Absent on a chart type that does not carry point selection, in which case
|
|
512
|
+
* the answer is undefined rather than false: "not selected" and "selection
|
|
513
|
+
* does not apply here" are different, and a plugin keying on it should be
|
|
514
|
+
* able to tell.
|
|
515
|
+
*
|
|
516
|
+
* @param {any} opts
|
|
517
|
+
* @param {number} seriesIndex
|
|
518
|
+
* @param {number} dataPointIndex
|
|
519
|
+
* @returns {boolean|undefined}
|
|
520
|
+
*/
|
|
521
|
+
static _isSelected(opts, seriesIndex, dataPointIndex) {
|
|
522
|
+
const all = opts && opts.selectedDataPoints
|
|
523
|
+
if (!Array.isArray(all) || seriesIndex < 0) return undefined
|
|
524
|
+
const mine = all[seriesIndex]
|
|
525
|
+
if (!Array.isArray(mine)) return false
|
|
526
|
+
return mine.indexOf(dataPointIndex) > -1
|
|
527
|
+
}
|
|
528
|
+
|
|
388
529
|
/**
|
|
389
530
|
* Record a plugin's container reservation and re-render if it changed.
|
|
390
531
|
*
|
|
@@ -657,6 +798,13 @@ export default class WeaveHost {
|
|
|
657
798
|
this.active = []
|
|
658
799
|
this._derived = null
|
|
659
800
|
this._reserved = null
|
|
801
|
+
this._pointerSubs = null
|
|
802
|
+
if (this._pointerWired) {
|
|
803
|
+
for (const [name, handler] of this._pointerWired) {
|
|
804
|
+
this.ctx.removeEventListener && this.ctx.removeEventListener(name, handler)
|
|
805
|
+
}
|
|
806
|
+
this._pointerWired = null
|
|
807
|
+
}
|
|
660
808
|
// Nothing left to re-render for, and firing this after a destroy would
|
|
661
809
|
// call update() on a torn-down chart.
|
|
662
810
|
if (this._reserveTimer != null) {
|