{}[\]\\/]/gi,e),s}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,s){if(s>=t.length){let e=s-t.length+1;for(;e--;)t.push(void 0)}return t.splice(s,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){const s=(String(t).split(".")[1]||"").length,i=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(s,i));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){if(u.isSSR())return!1;const t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}static getGCD(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));for(i>1?(t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i)):i=1;e;){const s=e;e=t%e,t=s}return t/i}static getPrimeFactors(t){const e=[];let s=2;for(;t>=2;)t%s==0?(e.push(s),t/=s):s++;return e}static mod(t,e,s=7){const i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));return(t=Math.round(Math.abs(t)*i))%(e=Math.round(Math.abs(e)*i))/i}};class A{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return"number"!=typeof t&&!isNaN(this.parseDate(t))}getTimeStamp(t){return Date.parse(t)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime():t}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){const e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let s=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return s=this.getTimeStamp(s),s}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){const s=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...s.months],r=["",...s.shortMonths],o=["",...s.days],n=["",...s.shortDays];function l(t,e=2){let s=t+"";for(;s.length12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+l(u))).replace(/(^|[^\\])h/g,"$1"+u);const p=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(p))).replace(/(^|[^\\])m/g,"$1"+p);const f=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(f))).replace(/(^|[^\\])s/g,"$1"+f);let x=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(x,3)),x=Math.round(x/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(x)),x=Math.round(x/10);const b=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+x)).replace(/(^|[^\\])TT+/g,"$1"+b)).replace(/(^|[^\\])T/g,"$1"+b.charAt(0));const m=b.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+m)).replace(/(^|[^\\])t/g,"$1"+m.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);const t=y%60;w+=l(Math.floor(y/60))+":"+l(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);const v=(i?t.getUTCDay():t.getDay())+1;return(e=(e=(e=(e=e.replace(new RegExp(o[0],"g"),o[v])).replace(new RegExp(n[0],"g"),n[v])).replace(new RegExp(a[0],"g"),a[h])).replace(new RegExp(r[0],"g"),r[h])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){const s=this.w;void 0!==s.config.xaxis.min&&(t=s.config.xaxis.min),void 0!==s.config.xaxis.max&&(e=s.config.xaxis.max);const i=this.getDate(t),a=this.getDate(e),r=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),o=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(r[6],10),maxMillisecond:parseInt(o[6],10),minSecond:parseInt(r[5],10),maxSecond:parseInt(o[5],10),minMinute:parseInt(r[4],10),maxMinute:parseInt(o[4],10),minHour:parseInt(r[3],10),maxHour:parseInt(o[3],10),minDate:parseInt(r[2],10),maxDate:parseInt(o[2],10),minMonth:parseInt(r[1],10)-1,maxMonth:parseInt(o[1],10)-1,minYear:parseInt(r[0],10),maxYear:parseInt(o[0],10)}}isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}calculcateLastDaysOfMonth(t,e,s){return this.determineDaysOfMonths(t,e)-s}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,s){let i=this.daysCntOfYear[e]+s;return e>1&&this.isLeapYear(t)&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=v.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(s=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:s=31}return s}}class S{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){const a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){const t=new A(this.w);return t.formatDate(t.getDate(e),a.config.tooltip.x.format)}return t(e,s,i)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(t=>t):t}defaultYFormatter(t,e){const s=this.w;if(v.isNumber(t))if(0!==s.globals.yValueDecimal)t=t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:s.globals.yValueDecimal);else{const e=t.toFixed(0);t=Number(e)===t?e:t.toFixed(1)}return t}setLabelFormatters(){const t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),e.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),e.ttZFormatter=t=>t,e.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=e=>{if(v.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(v.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;return s>0&&s<100?e.toFixed(1):e.toFixed(0)}}return t.globals.isBarHorizontal&&t.globals.maxY-t.globals.minYArr<4?e.toFixed(1):e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(e.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(e.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((s,i)=>{void 0!==s.labels.formatter?e.yLabelFormatters[i]=s.labels.formatter:e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(t=>this.defaultYFormatter(t,s)):this.defaultYFormatter(e,s):e}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();const e=t.seriesData.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}const C=({isTimeline:t,seriesIndex:e,dataPointIndex:s,y1:i,y2:a,w:r})=>{var o;let n=r.rangeData.seriesRangeStart[e][s],l=r.rangeData.seriesRangeEnd[e][s],c=r.labelData.labels[s],h=r.config.series[e].name?r.config.series[e].name:"";const d=r.formatters.ttKeyFormatter,g=r.config.tooltip.y.title.formatter,u={w:r,seriesIndex:e,dataPointIndex:s,start:n,end:l};"function"==typeof g&&(h=g(h,u)),(null==(o=r.config.series[e].data[s])?void 0:o.x)&&(c=r.config.series[e].data[s].x),t||"datetime"!==r.config.xaxis.type||(c=new S(r).xLabelFormat(r.formatters.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new A(r).formatDate,w:r})),"function"==typeof d&&(c=d(c,u)),Number.isFinite(i)&&Number.isFinite(a)&&(n=i,l=a);let p="",f="";const x=r.globals.colors[e];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){const t=new A(r);p=t.formatDate(t.getDate(n),r.config.tooltip.x.format),f=t.formatDate(t.getDate(l),r.config.tooltip.x.format)}else p=n,f=l;else p=r.config.tooltip.x.formatter(n),f=r.config.tooltip.x.formatter(l);return{start:n,end:l,startVal:p,endVal:f,ylabel:c,color:x,seriesName:h}},k=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:r,seriesIndex:o,dataPointIndex:n}=t;const l=t.w.globals.tooltip.tooltipLabels.getFormatters(o);a=l.yLbFormatter(a),r=l.yLbFormatter(r);const c=l.yLbFormatter(t.w.seriesData.series[o][n]);let h="";const d=`\n ${a}\n - \n ${r}\n `;return h=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[o].type||"rangeBar"===t.w.config.series[o].type?d:`${c}`:d,'"};class D{constructor(t){this.opts=t}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){return this.hideYAxis(),v.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){const s=e.w.config.series[e.seriesIndex].name;return null!==t?s+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),d(h({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Open","High","","Low","Close"],"candlestick")},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}rangeBar(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(t,{seriesIndex:e,dataPointIndex:s,w:i}){const a=()=>{const t=i.rangeData.seriesRangeStart[e][s];return i.rangeData.seriesRangeEnd[e][s]-t};return i.globals.comboCharts?"rangeBar"===i.config.series[e].type||"rangeArea"===i.config.series[e].type?a():t:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:t=>t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(t=>{const{color:e,seriesName:s,ylabel:i,startVal:a,endVal:r}=C(d(h({},t),{isTimeline:!0}));return k(d(h({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=C(t);return k(d(h({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,s;return(null==(e=t.plotOptions.bar)?void 0:e.barHeight)||(t.plotOptions.bar.barHeight=2),(null==(s=t.plotOptions.bar)?void 0:s.columnWidth)||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:t=>(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=C(t);return k(d(h({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)}}}brush(t){return v.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;const e=t.dataLabels.formatter;return t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100}),"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}stackedBars(){const t=this.bar();return d(h({},t),{plotOptions:d(h({},t.plotOptions),{bar:d(h({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return v.isNumber(t)?Math.floor(t):t};const s=t.xaxis.labels.formatter;let i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(i=e.map(t=>Array.isArray(t)?t:String(t))),i&&i.length&&(t.xaxis.labels.formatter=function(t){return v.isNumber(t)?s(i[Math.floor(t)-1]):s(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,s,i,a){const r=t.candleData.seriesCandleO[e][s],o=t.candleData.seriesCandleH[e][s],n=t.candleData.seriesCandleM[e][s],l=t.candleData.seriesCandleL[e][s],c=t.candleData.seriesCandleC[e][s],h=t.config.series[e];return h.type&&h.type!==a?`\n ${h.name?h.name:"series-"+(e+1)}: ${t.seriesData.series[e][s]}\n
`:`"}}const L={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}};class P{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[L],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:t=>t},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:t=>t+"%"},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)/t.seriesData.series.length+"%"}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:t=>t,onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:t=>t},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:t=>t},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:t=>null!==t?t:"",textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:t=>t?t+": ":""}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}}class E{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,r,o,n,l,c,h;let d=this.opts;const g=new P,p=new D(d);this.chartType=d.chart.type,d=this.extendYAxis(d),d=this.extendAnnotations(d);let f=g.init(),x={};if(d&&"object"==typeof d){let g={};g=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(d.chart.type)?p[d.chart.type]():p.line(),(null==(s=null==(e=d.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(g=p.funnel()),d.chart.stacked&&"bar"===d.chart.type&&(g=p.stackedBars()),(null==(i=d.chart.brush)?void 0:i.enabled)&&(g=p.brush(g)),(null==(r=null==(a=d.plotOptions)?void 0:a.line)?void 0:r.isSlopeChart)&&(g=p.slope()),d.chart.stacked&&"100%"===d.chart.stackType&&(d=p.stacked100(d)),(null==(n=null==(o=d.plotOptions)?void 0:o.bar)?void 0:n.isDumbbell)&&(d=p.dumbbell(d)),this.checkForDarkTheme(u.getApex()),this.checkForDarkTheme(d),d.xaxis=d.xaxis||u.getApex().xaxis||{},t||(d.xaxis.convertedCatToNumeric=!1),d=this.checkForCatToNumericXAxis(this.chartType,g,d),((null==(l=d.chart.sparkline)?void 0:l.enabled)||(null==(h=null==(c=u.getApex().chart)?void 0:c.sparkline)?void 0:h.enabled))&&(g=p.sparkline(g)),x=v.extend(f,g)}const b=v.extend(x,u.getApex());return f=v.extend(b,d),f=this.handleUserInputErrors(f),f}checkForCatToNumericXAxis(t,e,s){var i,a;const r=new D(s),o=("bar"===t||"boxPlot"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),n="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,l="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type,c=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return o||n||!l||"between"===c||(s=r.convertCatToNumeric(s)),s}extendYAxis(t,e){const s=new P;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={});const i=u.getApex();t.yaxis.constructor!==Array&&i.yaxis&&i.yaxis.constructor!==Array&&(t.yaxis=v.extend(t.yaxis,i.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[v.extend(s.yAxis,t.yaxis)]:t.yaxis=v.extendArray(t.yaxis,s.yAxis);let a=!1;t.yaxis.forEach(t=>{t.logarithmic&&(a=!0)});let r=t.series;return e&&!r&&(r=e.config.series),a&&r.length!==t.yaxis.length&&r.length&&(t.yaxis=r.map((e,i)=>{if(e.name||(r[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=r[i].name,t.yaxis[i];{const e=v.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),a&&r.length>1&&(r.length,t.yaxis.length),t}extendAnnotations(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),this.extendPointAnnotations(t)}extendYAxisAnnotations(t){const e=new P;return t.annotations.yaxis=v.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){const e=new P;return t.annotations.xaxis=v.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){const e=new P;return t.annotations.points=v.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){const e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&"barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),"candlestick"!==e.chart.type&&"boxPlot"!==e.chart.type||e.yaxis[0].reversed&&(e.yaxis[0].reversed=!1),e}}const M=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],I=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24];class O{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){const e=(e,s,i=s)=>{Object.defineProperty(e,i,{get:()=>t[s],set(e){t[s]=e},enumerable:!0,configurable:!0})},s={};e(s,"series","data");for(const t of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(s,t);Object.defineProperty(t,"seriesNS",{value:s,writable:!1,enumerable:!1,configurable:!0});const i={};for(const t of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(i,t);Object.defineProperty(t,"axes",{value:i,writable:!1,enumerable:!1,configurable:!0});const a={};for(const t of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,t);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});const r={};for(const t of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(r,t);Object.defineProperty(t,"cache",{value:r,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},LINE_HEIGHT_RATIO:1.618,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,invalidLogScale:!1,hasNullValues:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],svgWidth:0,svgHeight:0,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:M,niceScaleDefaultTicks:I,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}init(t){const e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=v.extend({},t),e.initialSeries=v.clone(t.series),e.lastXAxis=v.clone(e.initialConfig.xaxis),e.lastYAxis=v.clone(e.initialConfig.yaxis),e}}class T{constructor(t){this.opts=t}init(){const t=new E(this.opts).init({responsiveOverride:!1}),e=(new O).init(t),s={config:t,globals:e,dom:{},interact:{zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},lastWheelExecution:0,capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:!!u.isBrowser()&&("ontouchstart"in window||navigator.maxTouchPoints>0)},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[]}};Object.defineProperty(e,"dom",{get:()=>s.dom,set(t){s.dom=t},enumerable:!1,configurable:!0});for(const t of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,t,{get:()=>s.formatters[t],set(e){s.formatters[t]=e},enumerable:!1,configurable:!0});for(const t of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","lastWheelExecution","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,t,{get:()=>s.interact[t],set(e){s.interact[t]=e},enumerable:!1,configurable:!0});for(const t of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords"])Object.defineProperty(e,t,{get:()=>s.layout[t],set(e){s.layout[t]=e},enumerable:!1,configurable:!0});for(const t of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,t,{get:()=>s.seriesData[t],set(e){s.seriesData[t]=e},enumerable:!1,configurable:!0});for(const t of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,t,{get:()=>s.axisFlags[t],set(e){s.axisFlags[t]=e},enumerable:!1,configurable:!0});for(const t of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,t,{get:()=>s.labelData[t],set(e){s.labelData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,t,{get:()=>s.rangeData[t],set(e){s.rangeData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,t,{get:()=>s.candleData[t],set(e){s.candleData[t]=e},enumerable:!1,configurable:!0});return s}}class F{constructor(t){this.w=t}static checkComboSeries(t,e){let s=!1,i=0,a=0;return void 0===e&&(e="line"),t.length&&void 0!==t[0].type&&t.forEach(t=>{"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type&&"boxPlot"!==t.type||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w,s=[];if(0===e.seriesData.series.length)return s;for(let i=0;it+e,0):this.w.seriesData.series[t].reduce((t,e)=>t+e,0)}getStackedSeriesTotalsByGroups(){const t=this.w,e=[];return t.labelData.seriesGroups.forEach(s=>{const i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.seriesData.seriesNames[a])>-1&&i.push(a)});const a=t.seriesData.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){const t=this.w.globals,e=this.w.config;let s=[];const i=[],a=[],r=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(t=>Array.isArray(t.seriesName));e.series.forEach((t,e)=>{a.push(e),i.push(null)}),e.yaxis.forEach((t,e)=>{s[e]=[]});const o=[];e.yaxis.forEach((t,i)=>{let n=!1;if(t.seriesName){let o=[];Array.isArray(t.seriesName)?o=t.seriesName:o.push(t.seriesName),o.forEach(t=>{e.series.forEach((e,o)=>{if(e.name===t){let t=o;i===o||r?(!r||a.indexOf(o)>-1)&&s[i].push([i,o]):(s[o].push([o,i]),t=i),n=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}n||o.push(i)}),s=s.map(t=>{const e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let n=e.yaxis.length-1;for(let t=0;t{s[n].push(t),i[t]=n}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{e.series[t]&&void 0===e.series[t].group&&(e.series[t].group="apexcharts-axis-".concat(s.toString()))})})}isSeriesNull(t=null){let e=[];return e=null===t?this.w.config.series.filter(t=>null!==t):this.w.config.series[t].data.filter(t=>null!==t),0===e.length}seriesHaveSameValues(t){return this.w.seriesData.series[t].every((t,e,s)=>t===s[0])}getCategoryLabels(t){const e=this.w;let s=t.slice();return e.config.xaxis.convertedCatToNumeric&&(s=t.map(t=>e.config.xaxis.labels.formatter(t-e.globals.minX+1))),s}getLargestSeries(){const t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(t=>t.length)))}getLargestMarkerSize(){const t=this.w;let e=0;return t.globals.markers.size.forEach(t=>{e=Math.max(e,t)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(t=>{e=Math.max(e,t.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){const t=this.w;t.globals.seriesTotals=t.seriesData.series.map(t=>{let e=0;if(Array.isArray(t))for(let s=0;s{let r=0;for(let o=0;ot&&s.seriesData.seriesX[a][o]{const s=[];if(Array.isArray(e))for(let i=0;it+e,0);s.push(i)}return s})}getCalculatedRatios(){const t=this.w,e=t.globals,s=[];let i=0,a=0,r=0,o=0,n=[],l=.1,c=0;if(e.yRange=[],e.isMultipleYAxis)for(let t=0;t0){const r=(e,i)=>{const a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],r=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-r*e/s[i]};if(e.isMultipleYAxis){n=[];for(let t=0;t{const i=e.globals.seriesYAxisReverseMap[s];return e.config.yaxis[i]&&e.config.yaxis[i].logarithmic?t.map(t=>null===t?null:this.getLogVal(e.config.yaxis[i].logBase,t,s)):t}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(null===t)return null;const s=this.w,i=s.globals.seriesYAxisReverseMap[e];return s.config.yaxis[i]&&s.config.yaxis[i].logarithmic?this.getLogVal(s.config.yaxis[i].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,s){if(e<=0)return 0;const i=this.w,a=0===i.globals.minYArr[s]?-1:this.getBaseLog(t,i.globals.minYArr[s]),r=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;return e<1?e/r:(this.getBaseLog(t,e)-a)/r}getLogYRatios(t){const e=this.w,s=this.w.globals,i=s;return i.yLogRatio=t.slice(),i.logYRange=s.yRange.map((t,a)=>{const r=e.globals.seriesYAxisReverseMap[a];if(e.config.yaxis[r]&&this.w.config.yaxis[r].logarithmic){let t=-Number.MAX_VALUE,r=Number.MIN_VALUE,o=1;return s.seriesLog.forEach((s,i)=>{s.forEach(s=>{e.config.yaxis[i]&&e.config.yaxis[i].logarithmic&&(t=Math.max(s,t),r=Math.min(s,r))})}),o=Math.pow(s.yRange[a],Math.abs(r-t)/s.yRange[a]),i.yLogRatio[a]=o/this.w.layout.gridHeight,o}}),i.invalidLogScale?t.slice():i.yLogRatio}static extendArrayProps(t,e,s){var i,a;return(null==e?void 0:e.yaxis)&&(e=t.extendYAxis(e,s)),(null==e?void 0:e.annotations)&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(null==(i=null==e?void 0:e.annotations)?void 0:i.xaxis)&&(e=t.extendXAxisAnnotations(e)),(null==(a=null==e?void 0:e.annotations)?void 0:a.points)&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,s,i){const a=this.w,r=[];return t.series.length>0&&e.forEach(e=>{const o=[],n=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(o.push(t.series[i]),n.push(s))}),o.length>0&&r.push(i.draw(o,s,n))}),r}}class R{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,s,i){t.attr(e).animate(i).attr(s)}animateMarker(t,e,s,i){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{i()})}animateRect(t,e,s,i,a){t.attr(e).animate(i).attr(s).after(()=>a())}animatePathsGradually(t){const{el:e,realIndex:s,j:i,fill:a,pathFrom:r,pathTo:o,speed:n,delay:l}=t,c=this.w;let h=0;c.config.chart.animations.animateGradually.enabled&&(h=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&"bar"!==c.config.chart.type&&(h=0),this.morphSVG(e,s,i,"line"!==c.config.chart.type||c.globals.comboCharts?a:"stroke",r,o,n,l*h)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{const e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){const e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}morphSVG(t,e,s,i,a,r,o,n){const l=this.w;a||(a=t.attr("pathFrom")),r||(r=t.attr("pathTo"));const c=()=>("radar"===l.config.chart.type&&(o=1),`M 0 ${l.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=c()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=c()),l.globals.shouldAnimate||(o=1),t.plot(a).animate(1,n).plot(a).animate(o,n).plot(r).after(()=>{v.isNumber(s)?s===l.seriesData.series[l.globals.maxValsInArrayIndex].length-2&&l.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&l.globals.shouldAnimate&&(!l.globals.comboCharts&&e===l.seriesData.series.length-1||l.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class X{constructor(t){this.w=t}getDefaultFilter(t,e){const s=this.w;t.unfilter&&t.unfilter(!0),s.config.chart.dropShadow.enabled&&this.dropShadow(t,s.config.chart.dropShadow,e)}applyFilter(t,e,s){var i,a,r;const o=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const n=o.config.chart.dropShadow,l="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${l} 0 0 0 0\n 0 ${l} 0 0 0\n 0 0 ${l} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),n.enabled&&this.addShadow(t,e,n,"brightness")}),n.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(r=t.filterer())?void 0:r.node))}addShadow(t,e,s,i){var a;const r=this.w;let{blur:o,top:n,left:l,color:c,opacity:h}=s;if(c=Array.isArray(c)?c[e]:c,(null==(a=r.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===r.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:l,dy:n,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:o,result:"blur"}),t.flood({"flood-color":c,"flood-opacity":h,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",i])}dropShadow(t,e,s=0){var i,a,r,o,n;const l=this.w;return t.unfilter&&t.unfilter(!0),v.isMsEdge()&&"radialBar"===l.config.chart.type||(null==(i=l.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=l.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(o=null==(r=t.filterer())?void 0:r.node)||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(n=t.filterer())?void 0:n.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.interact.selectedDataPoints[e]&&i.interact.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);const s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){t&&(e=>{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class z{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,r=e.y-t.y,o=Math.sqrt(a*a+r*r);return i(t,e,Math.min(1,s/o))}function i(t,e,s){return{x:t.x+(e.x-t.x)*s,y:t.y+(e.y-t.y)*s}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function r(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var o=t.split(/[,\s]/).reduce(function(t,e){var s=e.match(/^([a-zA-Z])(.+)/);return s?(t.push(s[1]),t.push(s[2])):t.push(e),t},[]).reduce(function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t},[]),n=[];if(o.length>1){var l=r(o[0]),c=null;"Z"==o[o.length-1][0]&&o[0].length>2&&(c=["L",l.x,l.y],o[o.length-1]=c),n.push(o[0]);for(var h=1;h2&&"L"==g[0]&&u.length>2&&"L"==u[0]){var p,f,x=r(d),b=r(g),m=r(u);p=s(b,x,e),f=s(b,m,e),a(g,p),g.origPoint=b,n.push(g);var y=i(p,b,.5),w=i(b,f,.5),v=["C",y.x,y.y,w.x,w.y,f.x,f.y];v.origPoint=b,n.push(v)}else n.push(g)}if(c){var A=r(n[n.length-1]);n.push(["Z"]),a(n[0],A)}}else n=o;return n.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",r=0,o=null,n="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":r,"stroke-width":o,"stroke-linecap":n})}drawRect(t=0,e=0,s=0,i=0,a=0,r="#fefefe",o=1,n=null,l=null,c=0){const h=this.w.dom.Paper.rect();return h.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,rx:a,ry:a,opacity:o,"stroke-width":null!==n?n:0,stroke:null!==l?l:"none","stroke-dasharray":c}),h.node.setAttribute("fill",r),h}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.dom.Paper.circle(2*t);return null!==e&&s.attr(e),s}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:s=1,fill:i,fillOpacity:a=1,strokeOpacity:r=1,classes:o,strokeLinecap:n=null,strokeDashArray:l=0}){const c=this.w;return null===n&&(n=c.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${c.layout.gridHeight}`),c.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":r,"stroke-linecap":n,"stroke-width":s,"stroke-dasharray":l,class:o})}group(t=null){const e=this.w.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){return"H"===s?[" H",t].join(" "):"V"===s?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,s,i,a,r){return["C",t,e,s,i,a,r].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,r,o,n=!1){let l="A";return n&&(l="a"),[l,t,e,s,i,a,r,o].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,stroke:a,strokeWidth:r,strokeLinecap:o,fill:n,animationDelay:l,initialSpeed:c,dataChangeSpeed:g,className:u,chartType:p,shouldClipToGrid:f=!0,bindEventsOnPaths:x=!0,drawShadow:b=!0}){const m=this.w,y=new X(this.w),w=new R(this.w,void 0),v=this.w.config.chart.animations.enabled,A=v&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0")&&i){const t=i.match(/^M\s+[\d.-]+\s+[\d.-]+/);t&&(s=s.replace(/^M\s+0\s+0/,t[0]))}let S;const C=!!(v&&!m.globals.resized||A&&m.globals.dataChanged&&m.globals.shouldAnimate);C?S=s:(S=i,m.globals.animationEnded=!0);const k=m.config.stroke.dashArray;let D=0;D=Array.isArray(k)?k[e]:m.config.stroke.dashArray;const L=this.drawPath({d:S,stroke:a,strokeWidth:r,fill:n,fillOpacity:1,classes:u,strokeLinecap:o,strokeDashArray:D});L.attr("index",e),f&&("bar"===p&&!m.globals.isBarHorizontal||m.globals.comboCharts?L.attr({"clip-path":`url(#gridRectBarMask${m.globals.cuid})`}):L.attr({"clip-path":`url(#gridRectMask${m.globals.cuid})`})),m.config.chart.dropShadow.enabled&&b&&y.dropShadow(L,m.config.chart.dropShadow,e),x&&(L.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,L)),L.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,L)),L.node.addEventListener("mousedown",this.pathMouseDown.bind(this,L))),L.attr({pathTo:i,pathFrom:s});const P={el:L,j:t,realIndex:e,pathFrom:s,pathTo:i,fill:n,strokeWidth:r,delay:l};return!v||m.globals.resized||m.globals.dataChanged?!m.globals.resized&&m.globals.dataChanged||w.showDelayedElements():w.animatePathsGradually(d(h({},P),{speed:c})),m.globals.dataChanged&&A&&C&&w.animatePathsGradually(d(h({},P),{speed:g})),L}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,s,r=>{"horizontalLines"===t?r.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?r.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?r.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?r.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&r.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,r=null,o=null,n=[],l=0){const c=this.w;let h;e.length<9&&0===e.indexOf("#")&&(e=v.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=v.hexToRgba(s,a));let d=0,g=1,u=1,p=null;null!==o&&(d=void 0!==o[0]?o[0]/100:0,g=void 0!==o[1]?o[1]/100:1,u=void 0!==o[2]?o[2]/100:1,p=void 0!==o[3]?o[3]/100:null);const f=!("donut"!==c.config.chart.type&&"pie"!==c.config.chart.type&&"polarArea"!==c.config.chart.type&&"bubble"!==c.config.chart.type);if(h=n&&0!==n.length?c.dom.Paper.gradient(f?"radial":"linear",t=>{(Array.isArray(n[l])?n[l]:n).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):c.dom.Paper.gradient(f?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(u,s,a),null!==p&&t.stop(p,e,i)}),f){const t=c.layout.gridWidth/2,e=c.layout.gridHeight/2;"bubble"!==c.config.chart.type?h.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r}):h.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?h.from(0,0).to(0,1):"diagonal"===t?h.from(0,0).to(1,1):"horizontal"===t?h.from(0,1).to(1,1):"diagonal2"===t&&h.from(1,0).to(0,1);return h}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i,""),r=a.width/t.length,o=Math.floor(e/r);return e{for(let e=0;et.tspan(f))),b.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":u,"font-size":a,"font-family":r,"font-weight":o,fill:n,class:"apexcharts-text "+d}),b.node.style.fontFamily=r,b.node.style.opacity=l,b}getMarkerPath(t,e,s,i){let a="";switch(s){case"cross":a=`M ${t-(i/=1.4)} ${e-i} L ${t+i} ${e+i} M ${t-i} ${e+i} L ${t+i} ${e-i}`;break;case"plus":a=`M ${t-(i/=1.12)} ${e} L ${t+i} ${e} M ${t} ${e-i} L ${t} ${e+i}`;break;case"star":case"sparkle":{let r=5;i*=1.15,"sparkle"===s&&(i/=1.1,r=4);const o=Math.PI/r;for(let s=0;s<=2*r;s++){const r=s*o,n=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+n*Math.sin(r))+","+(e-n*Math.cos(r))}a+="Z";break}case"triangle":a=`M ${t} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"square":case"rect":a=`M ${t-(i/=1.125)} ${e-i} \n L ${t+i} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"diamond":a=`M ${t} ${e-(i*=1.05)} \n L ${t+i} ${e} \n L ${t} ${e+i} \n L ${t-i} ${e} \n Z`;break;case"line":a=`M ${t-(i/=1.1)} ${e} \n L ${t+i} ${e}`;break;default:a=`M ${t}, ${e} \n m -${(i*=2)/2}, 0 \n a ${i/2},${i/2} 0 1,0 ${i},0 \n a ${i/2},${i/2} 0 1,0 -${i},0`}return a}drawMarkerShape(t,e,s,i,a){const r=this.drawPath({d:this.getMarkerPath(t,e,s,i),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return r.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),r}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return v.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,h(h({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){var s,i;const a=this.w,r=new X(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(!(isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseEnter&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),z._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"===a.config.states.hover.filter.type||a.interact.isTouchDevice))){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}pathMouseLeave(t,e){var s,i;const a=this.w,r=new X(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseLeave&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),z._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==a.config.states.hover.filter.type&&r.getDefaultFilter(t,o))}pathMouseDown(t,e){var s,i;const a=this.w,r=new X(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(isNaN(o)||isNaN(n))return;let l="false";if("true"===t.node.getAttribute("selected")){t.node.setAttribute("selected","false");const e=a.interact.selectedDataPoints[o].indexOf(n);e>-1&&a.interact.selectedDataPoints[o].splice(e,1)}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0){a.interact.selectedDataPoints=[];const t=a.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=a.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),s=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),r.getDefaultFilter(t,o)})};s(t),s(e)}t.node.setAttribute("selected","true"),l="true",void 0===a.interact.selectedDataPoints[o]&&(a.interact.selectedDataPoints[o]=[]),a.interact.selectedDataPoints[o].push(n)}if("true"===l){const e=a.config.states.active.filter;if("none"!==e)r.applyFilter(t,o,e.type);else if("none"!==a.config.states.hover.filter&&!a.interact.isTouchDevice){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}else if("none"!==a.config.states.active.filter.type)if("none"===a.config.states.hover.filter.type||a.interact.isTouchDevice)r.getDefaultFilter(t,o);else{const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}"function"==typeof a.config.chart.events.dataPointSelection&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}),e&&z._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}])}rotateAroundCenter(t){let e={};return t&&"function"==typeof t.getBBox&&(e=t.getBBox()),{x:e.x+e.width/2,y:e.y+e.height/2}}setupEventDelegation(t,e){let s=null;t.node.addEventListener("mouseover",i=>{const a=z._findDelegateTarget(i.target,t.node,e);a&&a!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=a,a.instance&&this.pathMouseEnter(a.instance,i))}),t.node.addEventListener("mouseout",i=>{s&&(i.relatedTarget?z._findDelegateTarget(i.relatedTarget,t.node,e):null)!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=null)}),t.node.addEventListener("mousedown",s=>{const i=z._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,s)})}static _fireEvent(t,e,s){const i=t.globals.events;if(!i||!Object.prototype.hasOwnProperty.call(i,e))return;const a=i[e];for(let t=0;t0&&t.getComputedTextLength()>=s/1.1)){for(let i=e.length-3;i>0;i-=3)if(t.getSubStringLength(0,i)<=s/1.1)return void(t.textContent=e.substring(0,i)+"...");t.textContent="."}}}const Y="http://www.w3.org/2000/svg";class B{constructor(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new B(this.x,this.y)}}class N{constructor(t,e,s,i,a,r){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=s?s:0,this.d=null!=i?i:1,this.e=null!=a?a:0,this.f=null!=r?r:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new N(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new N(t,0,0,null!=e?e:t,0,0))}multiply(t){return new N(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new B(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class H{constructor(t,e,s,i){this.x=t,this.y=e,this.w=s,this.h=i,this.width=s,this.height=i,this.x2=t+s,this.y2=e+i}}class W{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){const e=this.w,i=e.config,a=parseInt(String(e.layout.gridWidth),10),r=parseInt(String(e.layout.gridHeight),10),o=a>r?a:r,n=t.image;let l=0,c=0;void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(l=i.fill.image.width+1,c=i.fill.image.height):(l=o+1,c=o):(l=t.width,c=t.height);const h=w.createElementNS(Y,"pattern");z.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:l+"px",height:c+"px"});const d=w.createElementNS(Y,"image");h.appendChild(d);const g=u.isBrowser()?window.SVG:s.g.SVG;d.setAttributeNS(g.xlink,"href",n),z.setAttrs(d,{x:0,y:0,preserveAspectRatio:"none",width:l+"px",height:c+"px"}),d.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(h)}getSeriesIndex(t){const e=this.w,s=e.config.chart.type;return("bar"===s||"rangeBar"===s)&&e.config.plotOptions.bar.distributed||"heatmap"===s||"treemap"===s?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(const s of t)s>=e.threshold?(null===i||s>i)&&(i=s):(null===a||s-1?u=v.getOpacityFromRGBA(d):x=v.hexToRgba(v.rgb2hex(d),u);const b=v.isCSSVariable(d)?v.getThemeColor(d):d;if("pattern"===g&&(l=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:l,fillColor:b,defaultColor:x})),p){const e=o.fill.gradient.colorStops?[...o.fill.gradient.colorStops]:[];let s=o.fill.gradient.type;h&&(e[this.seriesIndex]=this.computeColorStops(r.seriesData.series[this.seriesIndex],o.plotOptions.line.colors),s="vertical"),c=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:b,fillOpacity:u,colorStops:e,i:this.seriesIndex})}if("image"===g){const e=o.fill.image.src,s=t.patternID?t.patternID:"",i=`pattern${r.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:u,image:Array.isArray(e)?t.seriesNumber-1&&(u=v.getOpacityFromRGBA(g));let p=void 0===o.gradient.opacityTo?s:Array.isArray(o.gradient.opacityTo)?o.gradient.opacityTo[r]:o.gradient.opacityTo;if(void 0===o.gradient.gradientToColors||0===o.gradient.gradientToColors.length)d="dark"===o.gradient.shade?c.shadeColor(-1*parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?v.rgb2hex(e):e):c.shadeColor(parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?v.rgb2hex(e):e);else if(o.gradient.gradientToColors[n.seriesNumber]){const t=o.gradient.gradientToColors[n.seriesNumber];d=t,t.indexOf("rgba")>-1&&(p=v.getOpacityFromRGBA(t))}else d=e;if(o.gradient.gradientFrom&&(g=o.gradient.gradientFrom),o.gradient.gradientTo&&(d=o.gradient.gradientTo),o.gradient.inverseColors){const t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=v.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=v.rgb2hex(d)),l.drawGradient(t,g,d,u,p,n.size,o.gradient.stops,a,r)}}class _{constructor(t,e){this.w=t,this.ctx=e,this._filters=new X(this.w),this._graphics=new z(this.w,this.ctx)}setGlobalMarkerSize(){const t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.lengtht.config.markers.size)}plotChartMarkers({pointsPos:t,seriesIndex:e,j:s,pSize:i,alwaysDrawMarker:a=!1,isVirtualPoint:r=!1}){const o=this.w,n=e,l=t;let c=null;const h=new z(this.w),d=o.config.markers.discrete&&o.config.markers.discrete.length;if(Array.isArray(l.x))for(let t=0;t0:o.config.markers.size>0)||a||d){p||(f+=` w${v.randomId()}`);const s=this.getMarkerConfig({cssClass:f,seriesIndex:e,dataPointIndex:u}),r=o.config.series[n];r.data[u]&&(r.data[u].fillColor&&(s.pointFillColor=r.data[u].fillColor),r.data[u].strokeColor&&(s.pointStrokeColor=r.data[u].strokeColor)),void 0!==i&&(s.pSize=i),(l.x[t]<-o.globals.markers.largestSize||l.x[t]>o.layout.gridWidth+o.globals.markers.largestSize||l.y[t]<-o.globals.markers.largestSize||l.y[t]>o.layout.gridHeight+o.globals.markers.largestSize)&&(s.pSize=0),p||((o.globals.markers.size[e]>0||a||d)&&!c&&(c=h.group({class:a||d?"":"apexcharts-series-markers"}),c.attr("clip-path",`url(#gridRectMarkerMask${o.globals.cuid})`),this.setupMarkerDelegation(c)),g=h.drawMarker(l.x[t],l.y[t],s),g.attr("rel",u),g.attr("j",u),g.attr("index",e),g.node.setAttribute("default-marker-size",s.pSize),this._filters.setSelectionFilter(g,e,u),c&&c.add(g))}else void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e].push([l.x[t],l.y[t]])}return c}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:r=null}){const o=this.w,n=this.getMarkerStyle(e);let l=null===a?o.globals.markers.size[e]:a;const c=o.config.markers;return null!==s&&c.discrete.length&&c.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(n.pointStrokeColor=t.strokeColor,n.pointFillColor=t.fillColor,l=t.size,n.pointShape=t.shape)}),{pSize:null===i?l:i,pRadius:null!==i?i:c.radius,pointStrokeWidth:null!==r?r:Array.isArray(c.strokeWidth)?c.strokeWidth[e]:c.strokeWidth,pointStrokeColor:n.pointStrokeColor,pointFillColor:n.pointFillColor,shape:n.pointShape||(Array.isArray(c.shape)?c.shape[e]:c.shape),class:t,pointStrokeOpacity:Array.isArray(c.strokeOpacity)?c.strokeOpacity[e]:c.strokeOpacity,pointStrokeDashArray:Array.isArray(c.strokeDashArray)?c.strokeDashArray[e]:c.strokeDashArray,pointFillOpacity:Array.isArray(c.fillOpacity)?c.fillOpacity[e]:c.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){const e=this.w,s=".apexcharts-marker";this._graphics.setupEventDelegation(t,s),t.node.addEventListener("click",i=>{e.config.markers.onClick&&z._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}),t.node.addEventListener("dblclick",i=>{e.config.markers.onDblClick&&z._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}),t.node.addEventListener("touchstart",e=>{const i=z._findDelegateTarget(e.target,t.node,s);i&&i.instance&&this._graphics.pathMouseDown(i.instance,e)},{passive:!0})}addEvents(t){const e=this.w;t.node.addEventListener("mouseenter",this._graphics.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",this._graphics.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",this._graphics.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",this._graphics.pathMouseDown.bind(this.ctx,t),{passive:!0})}getMarkerStyle(t){const e=this.w,s=e.globals.markers.colors,i=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(i)?i[t]:i,pointFillColor:Array.isArray(s)?s[t]:s}}}class j{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new R(this.w),this.filters=new X(this.w),this.fill=new W(this.w),this.markers=new _(this.w,this.ctx),this.graphics=new z(this.w)}draw(t,e,s){const i=this.w,a=this.graphics,r=s.realIndex,o=s.pointsPos,n=s.zRatio,l=s.elParent,c=a.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(c.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(c),Array.isArray(o.x))for(let t=0;tt.maxBubbleRadius&&(h=t.maxBubbleRadius)}const d=o.x[t],g=o.y[t];if(h=h||0,null!==g&&void 0!==i.seriesData.series[r][s]||(a=!1),a){const t=this.drawPoint(d,g,h,r,s,e);c.add(t)}l.add(c)}}drawPoint(t,e,s,i,a,r){const o=this.w,n=i,l=this.anim,c=this.filters,h=this.fill,d=this.markers,g=this.graphics,u=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:n,dataPointIndex:a,radius:"bubble"===o.config.chart.type||o.globals.comboCharts&&o.config.series[i]&&"bubble"===o.config.series[i].type?s:null});let p=h.fillPath({seriesNumber:i,dataPointIndex:a,color:u.pointFillColor,patternUnits:"objectBoundingBox",value:o.seriesData.series[i][r]});const f=g.drawMarker(t,e,u),x=o.config.series[n];if(x.data[a]&&x.data[a].fillColor&&(p=x.data[a].fillColor),f.attr({fill:p}),o.config.chart.dropShadow.enabled){const t=o.config.chart.dropShadow;c.dropShadow(f,t,i)}if(!this.initialAnim||o.globals.dataChanged||o.globals.resized)o.globals.animationEnded=!0;else{const t=o.config.chart.animations.speed;l.animateMarker(f,t,o.globals.easing,()=>{window.setTimeout(()=>{l.animationCompleted(f)},100)})}return f.attr({rel:a,j:a,index:i,"default-marker-size":u.pSize}),c.setSelectionFilter(f,i,a),f.node.classList.add("apexcharts-marker"),f}centerTextInBubble(t){const e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class G{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,s,i,a,r,o){const n=this.w;let l=!1;const c=new z(this.w).getTextRects(s,o),h=c.width,d=c.height;e<0&&(e=0),e>n.layout.gridHeight+d&&(e=n.layout.gridHeight+d/2),void 0===n.globals.dataLabelsRects[i]&&(n.globals.dataLabelsRects[i]=[]),n.globals.dataLabelsRects[i].push({x:t,y:e,width:h,height:d});const g=n.globals.dataLabelsRects[i].length-2,u=void 0!==n.globals.lastDrawnDataLabelsIndexes[i]?n.globals.lastDrawnDataLabelsIndexes[i][n.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==n.globals.dataLabelsRects[i][g]){const s=n.globals.dataLabelsRects[i][u];(t>s.x+s.width||e>s.y+s.height||e+do.config.dataLabels.formatter(t,{seriesIndex:s,dataPointIndex:d,w:o});"bubble"===o.config.chart.type?(r=o.seriesData.seriesZ[s][d],l=u(r),h=e.y[n],h=new j(this.w,this.ctx).centerTextInBubble(h).y):void 0!==r&&(l=u(r));let p=o.config.dataLabels.textAnchor;o.globals.isSlopeChart&&(p=0===d?"end":d===o.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:c,y:h,text:l,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:o.config.dataLabels,textAnchor:p})}return g}plotDataLabelsText(t){const e=this.w,s=new z(this.w);let{x:i,y:a,i:r,j:o,text:n,textAnchor:l,fontSize:c,parent:h,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:u,offsetCorrection:p,className:f}=t,x=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)return x;let b={x:i,y:a,drawnextLabel:!0,textRects:null};if(p&&(b=this.dataLabelsCorrection(i,a,n,r,o,u,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(i=b.x,a=b.y),b.textRects){const t=e.globals.barPadForNumericAxis||0;(i<-(t+20)-b.textRects.width||i>e.layout.gridWidth+b.textRects.width+t+30)&&(n="")}let m=e.globals.dataLabels.style.colors[r];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(m=e.globals.dataLabels.style.colors[o]),"function"==typeof m&&(m=m({series:e.seriesData.series,seriesIndex:r,dataPointIndex:o,w:e})),g&&(m=g);let y=d.offsetX,w=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(y=0,w=0),e.globals.isSlopeChart&&(0!==o&&(y=-2*d.offsetX+5),0!==o&&o!==e.config.series[r].data.length-1&&(y=0)),b.drawnextLabel){if("middle"===l&&i===e.layout.gridWidth&&(l="end"),x=s.drawText({x:i+y,y:a+w,foreColor:m,textAnchor:l||d.textAnchor,text:n,fontSize:c||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),x.attr({class:f||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new X(this.w).dropShadow(x,t)}h.add(x),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(o)}return x}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,r=i.padding/2,o=e.width,n=e.height,l=new z(this.w).drawRect(e.x-a,e.y-r/2,o+2*a,n+r,i.borderRadius,"transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",i.opacity,i.borderWidth,i.borderColor);return i.dropShadow.enabled&&new X(this.w).dropShadow(l,i.dropShadow),l}dataLabelsBackground(){var t;const e=this.w;if("bubble"===e.config.chart.type)return;const s=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let i=0;i0?(g=(t=>{let s=null;return e.forEach(t=>{"month"===t.unit?s="year":"day"===t.unit?s="month":"hour"===t.unit?s="day":"minute"===t.unit&&(s="hour")}),s===t})(e[i].unit),s=e[i].position,c=e[i].value):"datetime"===n.config.xaxis.type&&void 0===d&&(c=""),void 0===c&&(c=""),c=Array.isArray(c)?c:c.toString();const f=new z(this.w);let x={};x=n.layout.rotateXLabels&&o?f.getTextRects(c,parseInt(r,10).toString(),null,`rotate(${n.config.xaxis.labels.rotate} 0 0)`,!1):f.getTextRects(c,parseInt(r,10).toString());const b=!n.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(c)&&("NaN"===String(c)||a.indexOf(c)>=0&&b)&&(c=""),{x:s,text:c,textRect:x,isBold:g}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;return"dataPoints"===a&&(a=Math.round(i.layout.gridWidth/120)),a>s||t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(r.config.xaxis.labels.trim&&"datetime"!==r.config.xaxis.type)return e;e.x-1===e.collapsedSeriesIndices.indexOf(t))}translateYAxisIndex(t){const e=this.w,s=e.globals,i=e.config.yaxis;return e.seriesData.series.length>i.length||i.some(t=>Array.isArray(t.seriesName))?t:s.seriesYAxisReverseMap[t]}isYAxisHidden(t){const e=this.w,s=e.config.yaxis[t];if(!s.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!s.showForNullSeries){const s=e.globals.seriesYAxisMap[t],i=new F(this.w);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){var s;const i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&(null==(s=this.theme)||s.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,s,i,a,r,o){const n=this.w,l=new z(this.w);let c=n.layout.translateY+n.config.yaxis[a].labels.offsetY;if(n.globals.isBarHorizontal?c=0:"heatmap"===n.config.chart.type&&(c+=r/2),i.show&&e>0){!0===n.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){const e=l.drawLine(t+s.offsetX-i.width+i.offsetX,c+i.offsetY,t+s.offsetX+i.offsetX,c+i.offsetY,i.color);o.add(e),c+=r}}}}class U{constructor(t,e,s){this.w=t,this.ctx=e,this.elgrid=s,this.axesUtils=new V(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===t.config.xaxis.position?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){const t=this.w,e=new z(this.w),s=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),i=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});s.add(i);let a=[];for(let t=0;te),t.labelData.hasXaxisGroups){const s=t.labelData.groups;a=[];for(let t=0;ts[t].cols*e,r)}if(void 0!==t.config.xaxis.title.text){const i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});i.add(a),s.add(i)}if(t.config.xaxis.axisBorder.show){const i=t.globals.barPadForNumericAxis,a=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-i,this.offY,this.xaxisBorderWidth+i,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):s.add(a)}return s}drawXAxisLabelAndGroup(t,e,s,i,a,r,o={}){const n=[],l=[],c=this.w,h=o.xaxisFontSize||this.xaxisFontSize,d=o.xaxisFontFamily||this.xaxisFontFamily,g=o.xaxisForeColors||this.xaxisForeColors,u=o.fontWeight||c.config.xaxis.labels.style.fontWeight,p=o.cssClass||c.config.xaxis.labels.style.cssClass;let f,x=c.globals.padHorizontal;const b=i.length;let m="category"===c.config.xaxis.type?c.globals.dataPoints:b;if(0===m&&b>m&&(m=b),a){const t=Math.max(Number(c.config.xaxis.tickAmount)||1,m>1?m-1:m);f=c.layout.gridWidth/Math.min(t,b-1),x=x+r(0,f)/2+c.config.xaxis.labels.offsetX}else f=c.layout.gridWidth/m,x=x+r(0,f)+c.config.xaxis.labels.offsetX;for(let a=0;a<=b-1;a++){let o=x-r(a,f)/2+c.config.xaxis.labels.offsetX;0===a&&1===b&&f/2===x&&1===m&&(o=c.layout.gridWidth/2);let y=this.axesUtils.getLabel(i,c.labelData.timescaleLabels,o,a,n,h,t),v=28;c.layout.rotateXLabels&&t&&(v=22),c.config.xaxis.title.text&&"top"===c.config.xaxis.position&&(v+=parseFloat(c.config.xaxis.title.style.fontSize)+2),t||(v=v+parseFloat(h)+(c.layout.xAxisLabelsHeight-c.layout.xAxisGroupLabelsHeight)+(c.layout.rotateXLabels?10:0)),y=void 0!==c.config.xaxis.tickAmount&&"dataPoints"!==c.config.xaxis.tickAmount&&"datetime"!==c.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,y,b):this.axesUtils.checkForOverflowingLabels(a,y,b,n,l);const A=()=>t&&c.config.xaxis.convertedCatToNumeric?g[c.globals.minX+a-1]:g[a];if(c.config.xaxis.labels.show){const i=e.drawText({x:y.x,y:this.offY+c.config.xaxis.labels.offsetY+v-("top"===c.config.xaxis.position?c.layout.xAxisHeight+c.config.xaxis.axisTicks.height-2:0),text:y.text,textAnchor:"middle",fontWeight:y.isBold?600:u,fontSize:h,fontFamily:d,foreColor:Array.isArray(g)?A():g,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+p});if(s.add(i),i.on("click",t=>{if("function"==typeof c.config.chart.events.xAxisLabelClick){const e=Object.assign({},c,{labelIndex:a});c.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){const t=w.createElementNS(Y,"title");t.textContent=Array.isArray(y.text)?y.text.join(" "):y.text,i.node.appendChild(t),""!==y.text&&(n.push(y.text),l.push(y))}}aArray.isArray(d)?d[i]:d;let u=0;Array.isArray(a)&&(u=a.length/2*parseInt(h.style.fontSize,10));let p=h.offsetX-15,f="end";this.yaxis.opposite&&(f="start"),"left"===e.config.yaxis[0].labels.align?(p=h.offsetX,f="start"):"center"===e.config.yaxis[0].labels.align?(p=h.offsetX,f="middle"):"right"===e.config.yaxis[0].labels.align&&(f="end");const x=s.drawText({x:p,y:l+n+h.offsetY-u,text:a,textAnchor:f,foreColor:g(),fontSize:h.style.fontSize,fontFamily:h.style.fontFamily,fontWeight:h.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+h.style.cssClass,maxWidth:h.maxWidth});r.add(x),x.on("click",t=>{if("function"==typeof e.config.chart.events.xAxisLabelClick){const s=Object.assign({},e,{labelIndex:i});e.config.chart.events.xAxisLabelClick(t,this.ctx,s)}});const b=w.createElementNS(Y,"title");if(b.textContent=Array.isArray(a)?a.join(" "):a,x.node.appendChild(b),0!==e.config.yaxis[t].labels.rotate){const i=s.rotateAroundCenter(x.node);x.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${i.y})`)}l+=n}if(void 0!==e.config.yaxis[0].title.text){const t=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+i+", 0)"}),r=s.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});t.add(r),a.add(t)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);const g=e.config.xaxis.axisBorder;if(g.show){const t=s.drawLine(e.globals.padHorizontal+g.offsetX+d,1+g.offsetY,e.globals.padHorizontal+g.offsetX+d,e.layout.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(t):a.add(t)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,o.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,n,a),a}drawXaxisTicks(t,e,s){const i=this.w,a=t;if(t<0||t-2>i.layout.gridWidth)return;const r=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+r+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=r-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){const o=new z(this.w).drawLine(t+i.config.xaxis.axisTicks.offsetX,r+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(o),o.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w,e=[],s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let t=0;t{a.placeTextWithEllipsis(t,t.textContent,i.layout.xAxisLabelsHeight-("bottom"===i.config.legend.position?20:10))})}else{const t=i.layout.gridWidth/(i.labelData.labels.length+1);for(let e=0;e{a.placeTextWithEllipsis(e,e.textContent,t)})}}if(n.length>0){const r=n[n.length-1].getBBox(),o=n[0].getBBox();r.x<-20&&(null==(t=n[n.length-1].parentNode)||t.removeChild(n[n.length-1])),o.x+o.width>i.layout.gridWidth&&!i.globals.isBarHorizontal&&(null==(e=n[0].parentNode)||e.removeChild(n[0]));for(let t=0;t0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new z(this.w);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(i),t}drawGrid(){if(this.w.globals.axisCharts){const t=this.renderGrid();return this.drawGridArea(t.el),t}return null}createGridMask(){const t=this.w,e=t.globals,s=new z(this.w),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const e=w.createElementNS(Y,"clipPath");return e.setAttribute("id",t),e};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let r=0,o=0;(["bar","rangeBar","candlestick","boxPlot"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(r=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),o=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),t.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,t.layout.gridWidth+i+4,t.layout.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=s.drawRect(-i/2-r-2,-i/2-2,t.layout.gridWidth+i+o+r+4,t.layout.gridHeight+i+4,0,"#fff");const n=t.globals.markers.largestSize;t.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-r-2,-n),-n,t.layout.gridWidth+Math.max(i+o+r+4,2*n),t.layout.gridHeight+2*n,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);const l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o}){const n=this.w;if(!(0===t&&n.globals.skipFirstTimelinelabel||t===r-1&&n.globals.skipLastTimelinelabel&&!n.config.xaxis.labels.formatter||"radar"===n.config.chart.type)){n.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o});let l=0;if(n.labelData.hasXaxisGroups&&"between"===n.config.xaxis.tickPlacement){const e=n.labelData.groups;if(e){let s=0;for(let i=0;s{for(let o=0;o{for(let n=0;n0&&"datetime"!==i.config.xaxis.type&&(n=a.yAxisScale[o].result.length-1)),this._drawXYLines({xCount:n,tickAmount:l})):(n=l,l=a.xTickAmount,this._drawInvertedXYLines({xCount:n,tickAmount:l})),this.drawGridBands(n,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:i.layout.gridWidth/n}}drawGridBands(t,e){var s,i,a,r,o;const n=this.w;if((null==(s=n.config.grid.row.colors)?void 0:s.length)>0&&((t,s,i,a,r,o)=>{for(let t=0,i=0;t=n.config.grid.row.colors.length&&(i=0),this._drawGridBandRect({c:i,x1:0,y1:a,x2:r,y2:o,type:"row"}),a+=n.layout.gridHeight/e})(0,e,0,0,n.layout.gridWidth,n.layout.gridHeight/e),(null==(i=n.config.grid.column.colors)?void 0:i.length)>0){let e=n.globals.isBarHorizontal||"on"!==n.config.xaxis.tickPlacement||"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric?t:t-1;n.axisFlags.isXNumeric&&(e=(null!=(r=null==(a=n.globals.xAxisScale)?void 0:a.result.length)?r:1)-1);let s=n.globals.padHorizontal;const i=0;let l=n.globals.padHorizontal+n.layout.gridWidth/e;const c=n.layout.gridHeight;for(let a=0,r=0;a=n.config.grid.column.colors.length&&(r=0),"datetime"===n.config.xaxis.type&&(s=this.xaxisLabels[a].position,l=((null==(o=this.xaxisLabels[a+1])?void 0:o.position)||n.layout.gridWidth)-this.xaxisLabels[a].position),this._drawGridBandRect({c:r,x1:s,y1:i,x2:l,y2:c,type:"column"}),s+=n.layout.gridWidth/e}}}class Z{constructor(t){this.w=t,this.coreUtils=new F(this.w)}niceScale(t,e,s=0){const i=1e-11,a=this.w,r=a.globals;let o,n,l,c;r.isBarHorizontal?(o=a.config.xaxis,n=Math.max((r.svgWidth-100)/25,2)):(o=a.config.yaxis[s],n=Math.max((r.svgHeight-100)/15,2)),v.isNumber(n)||(n=10),l=void 0!==o.min&&null!==o.min,c=void 0!==o.max&&null!==o.min;let h=void 0!==o.stepSize&&null!==o.stepSize,d=void 0!==o.tickAmount&&null!==o.tickAmount,g=d?o.tickAmount:I[Math.min(Math.round(n/2),I.length-1)];if(r.isMultipleYAxis&&!d&&r.multiAxisTickAmount>0&&(g=r.multiAxisTickAmount,d=!0),g="dataPoints"===g?r.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!v.isNumber(t)&&!v.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=v.isNumber(o.min)?o.min:0,e=v.isNumber(o.max)?o.max:t+g,r.allSeriesCollapsed=!1),t>e){const s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);const u=[];g<1&&(g=1);let p=g,f=Math.abs(e-t);!l&&t>0&&t/f<.15&&(t=0,l=!0),!c&&e<0&&-e/f<.15&&(e=0,c=!0),f=Math.abs(e-t);let x=f/p,b=x;const m=Math.floor(Math.log10(b)),y=Math.pow(10,m);let w=Math.ceil(b/y);if(w=M[0===r.yValueDecimal?0:1][w],b=w*y,x=b,r.isBarHorizontal&&o.stepSize&&"datetime"!==o.type?(x=o.stepSize,h=!0):h&&(x=o.stepSize),h&&o.forceNiceScale){const t=Math.floor(Math.log10(x));x*=Math.pow(10,m-t)}if(l&&c){let t=f/p;if(d)if(h)if(0!=v.mod(f,x)){const e=v.getGCD(x,t);x=t/e<10?e:t}else 0==v.mod(x,t)?x=t:(t=x,d=!1);else x=t;else if(h)0==v.mod(f,x)?t=x:x=t;else if(0==v.mod(f,x))t=x;else{p=Math.ceil(f/x),t=f/p;const e=v.getGCD(f,x);f/en&&(t=e-x*g,t+=x*Math.floor((s-t)/x))}else if(l)if(d)e=t+x*p;else{const s=e;e=x*Math.ceil(e/x),Math.abs(e-t)/v.getGCD(f,x)>n&&(e=t+x*g,e+=x*Math.ceil((s-e)/x))}}else if(r.isMultipleYAxis&&d){const s=x*Math.floor(t/x);let i=s+x*p;i0&&t16&&v.getPrimeFactors(p).length<2&&p++),!d&&o.forceNiceScale&&0===r.yValueDecimal&&p>f&&(p=f,x=Math.round(f/p)),p>n&&(!d&&!h||o.forceNiceScale)){const t=v.getPrimeFactors(p),e=t.length-1;let s=p;t:for(var A=0;AD);return{result:u,niceMin:u[0],niceMax:u[u.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){const r=Math.abs(e-t);let o=[];if(t===e)return o=[t],{result:o,niceMin:o[0],niceMax:o[o.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,r))&&(s=this.w.globals.dataPoints-1);const n=s;if(a||(a=r/n),0!==a&&isFinite(a)){const t=Math.floor(Math.log10(Math.abs(a))),e=Math.max(2,2-t),s=Math.pow(10,e);a=Math.round((a+Number.EPSILON)*s)/s}let l=s===Number.MAX_VALUE?5:n;s===Number.MAX_VALUE&&(a=1);let c=t;for(;l>=0;)o.push(c),c=v.preciseAddition(c,a),l-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}logarithmicScaleNice(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.ceil(Math.log(e)/Math.log(s)+1);for(let e=Math.floor(Math.log(t)/Math.log(s));e5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=r.forceNiceScale?this.logarithmicScaleNice(e,s,r.logBase):this.logarithmicScale(e,s,r.logBase)):s!==-Number.MAX_VALUE&&v.isNumber(s)&&e!==Number.MAX_VALUE&&v.isNumber(e)?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=this.niceScale(e,s,t)):i.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t)}setXScale(t,e){const s=this.w,i=s.globals;if(e!==-Number.MAX_VALUE&&v.isNumber(e)){const a=i.xTickAmount;i.xAxisScale=this.linearScale(t,e,a,0,void 0===s.config.xaxis.max?s.config.xaxis.stepSize:void 0)}else i.xAxisScale=this.linearScale(0,10,10);return i.xAxisScale}scaleMultipleYAxes(){const t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();const s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr;e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,r)=>{const o=[];if(s.forEach(e=>{var s;const i=null==(s=t.series[e])?void 0:s.group;o.indexOf(i)<0&&o.push(i)}),s.length>0){let n,l,c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=c,g=h;if(t.chart.stacked){const i=new Array(e.dataPoints).fill(0),a=[],u=[],p=[];o.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),u.push(i.map(()=>Number.MIN_VALUE)),p.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i{if(t.series[c].group===e)for(let t=0;t=0?u[s][t]+=e:p[s][t]+=e,a[s][t]+=e,d=Math.min(d,e),g=Math.max(g,e)}})),"bar"!==n&&"column"!==n||e.barGroups.push(l)}n||(n=t.chart.type),"bar"===n||"column"===n?o.forEach((t,e)=>{c=Math.min(c,Math.min.apply(null,p[e])),h=Math.max(h,Math.max.apply(null,u[e]))}):(o.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,a[e])),g=Math.max(g,Math.max.apply(null,a[e]))}),c=d,h=g),c===Number.MIN_VALUE&&h===Number.MIN_VALUE&&(h=-Number.MAX_VALUE)}else for(let t=0;ts.indexOf(t)===e),this.setYScaleForIndex(r,c,h),s.forEach(t=>{i[t]=e.yAxisScale[r].niceMin,a[t]=e.yAxisScale[r].niceMax})}else this.setYScaleForIndex(r,0,-Number.MAX_VALUE)})}}class K{constructor(t){this.w=t,this.scales=new Z(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,r,o,n,l;const c=this.w.config,h=this.w.globals;let d=-Number.MAX_VALUE,g=Number.MIN_VALUE;null===i&&(i=t+1);const u=this.w.seriesData.series;let p=u,f=u;"candlestick"===c.chart.type?(p=this.w.candleData.seriesCandleL,f=this.w.candleData.seriesCandleH):"boxPlot"===c.chart.type?(p=this.w.candleData.seriesCandleO,f=this.w.candleData.seriesCandleC):this.w.axisFlags.isRangeData&&(p=this.w.rangeData.seriesRangeStart,f=this.w.rangeData.seriesRangeEnd);let x=!1;if(this.w.seriesData.seriesX.length>=i){const t=null==(a=h.brushSource)?void 0:a.w.config.chart.brush;(c.chart.zoom.enabled&&c.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(x=!0)}for(let a=t;avoid 0!==t).length),this.w.labelData.labels.length&&"datetime"!==c.xaxis.type&&0!==this.w.seriesData.series.reduce((t,e)=>t+e.length,0)&&(h.dataPoints=Math.max(h.dataPoints,this.w.labelData.labels.length));let i=0,b=u[a].length-1;if(x){if(c.xaxis.min)for(;ii&&this.w.seriesData.seriesX[a][b]>c.xaxis.max;b--);}for(let c=i;c<=b&&c{d=Math.max(d,t.value),e=Math.min(e,t.value)}),s=d,i=v.noExponents(i),v.isFloat(i)&&(h.yValueDecimal=Math.max(h.yValueDecimal,i.toString().split(".")[1].length)),g>(null==(n=p[a])?void 0:n[c])&&(null==(l=p[a])?void 0:l[c])<0&&(g=p[a][c])}else h.hasNullValues=!0}"bar"!==t&&"column"!==t||(g<0&&d<0&&(d=0,s=Math.max(s,0)),g===Number.MIN_VALUE&&(g=0,e=Math.min(e,0)))}return"rangeBar"===c.chart.type&&this.w.rangeData.seriesRangeStart.length&&h.isBarHorizontal&&(g=e),"bar"===c.chart.type&&(g<0&&d<0&&(d=0),g===Number.MIN_VALUE&&(g=0)),{minY:g,maxY:d,lowestY:e,highestY:s}}setYRange(){const t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let s,i=Number.MAX_VALUE;if(t.isMultipleYAxis){i=Number.MAX_VALUE;for(let e=0;e{void 0!==e.max&&("number"==typeof e.max?t.maxYArr[s]=e.max:"function"==typeof e.max&&(t.maxYArr[s]=e.max(t.isMultipleYAxis?t.maxYArr[s]:t.maxY)),t.maxY=t.maxYArr[s]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[s]=e.min:"function"==typeof e.min&&(t.minYArr[s]=e.min(t.isMultipleYAxis?t.minYArr[s]===Number.MIN_VALUE?0:t.minYArr[s]:t.minY)),t.minY=t.minYArr[s])}),t.isBarHorizontal&&["min","max"].forEach(s=>{void 0!==e.xaxis[s]&&"number"==typeof e.xaxis[s]&&("min"===s?t.minY=e.xaxis[s]:t.maxY=e.xaxis[s])}),t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=i):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(s=>{const i=s;switch(i.type||e.chart.type){case"bar":case"column":t.barGroups.push(i.group);break;case"line":t.lineGroups.push(i.group);break;case"area":t.areaGroups.push(i.group)}}),t.barGroups=t.barGroups.filter((t,e,s)=>s.indexOf(t)===e),t.lineGroups=t.lineGroups.filter((t,e,s)=>s.indexOf(t)===e),t.areaGroups=t.areaGroups.filter((t,e,s)=>s.indexOf(t)===e),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){const t=this.w.globals,e=this.w.config,s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric;if(this.w.axisFlags.isXNumeric&&(()=>{for(let e=0;et.dataPoints&&0!==t.dataPoints&&(i=t.dataPoints-1);else if("dataPoints"===e.xaxis.tickAmount){if(this.w.seriesData.series.length>1&&(i=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){const e=Math.round(t.maxX-t.minX);e<30&&(i=e)}}else i=e.xaxis.tickAmount;if(t.xTickAmount=i,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){const e=[];for(let s=t.minX-1;s0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,i-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());s&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){const t=this.w.globals;if(this.w.axisFlags.isDataXYZ)for(let e=0;e{if(e.length){1===e.length&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){const a=e-s[i-1];a>0&&(t.minXDiff=Math.min(a,t.minXDiff))}}),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}})}_setStackedMinMax(){const t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(t=>t)]);const s={},i={};e.forEach(e=>{s[e]=[],i[e]=[],this.w.config.series.map((t,s)=>e.indexOf(this.w.seriesData.seriesNames[s])>-1?s:null).filter(t=>null!==t).forEach(a=>{var r,o,n,l;for(let c=0;c0?s[e][c]+=parseFloat(String(this.w.seriesData.series[a][c]))+1e-4:i[e][c]+=parseFloat(String(this.w.seriesData.series[a][c])))})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,r)=>{t.maxY=Math.max(t.maxY,s[e][r]),t.minY=Math.min(t.minY,i[e][r])})})}}class J{constructor(t,{theme:e=null,timeScale:s=null}={},i){this.w=t,this.elgrid=i,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===t.config.xaxis.position?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new V(t,{theme:e,timeScale:s})}drawYaxis(t){const e=this.w,s=new z(this.w),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:r,fontWeight:o}=i,n=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return n;const l=s.group({class:"apexcharts-yaxis-texts-g"});n.add(l);const c=e.globals.yAxisScale[t].result.length-1,h=e.layout.gridHeight/c,d=e.formatters.yLabelFormatters[t],g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let n=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?n=0:"heatmap"===e.config.chart.type&&(n-=h/2),n+=parseInt(a,10)/3;let u=null;for(let p=c;p>=0;p--){const c=d(g[p],p,e);let f=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(f*=-1);const x=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),b=this.axesUtils.getYAxisForeColor(i.colors,t),m=Array.isArray(b)?b[p]:b,y=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),w=s.drawText({x:f,y:n,text:y.includes(c)&&!e.config.yaxis[t].labels.showDuplicates?"":c,textAnchor:x,fontSize:a,fontFamily:r,fontWeight:o,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:m,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});l.add(w),this.addTooltip(w,c),null===u&&(u=w),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,w,u,e.config.yaxis[t].labels.rotate),n+=h}}return this.addYAxisTitle(s,n,t),this.addAxisBorder(s,n,t,c,h),n}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=w.createElementNS(Y,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),r=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${r.y})`)}addYAxisTitle(t,e,s){const i=this.w;if(void 0!==i.config.yaxis[s].title.text){const a=t.group({class:"apexcharts-yaxis-title"}),r=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,o=t.drawText({x:r,y:i.layout.gridHeight/2+i.layout.translateY+i.config.yaxis[s].title.offsetY,text:i.config.yaxis[s].title.text,textAnchor:"end",foreColor:i.config.yaxis[s].title.style.color,fontSize:i.config.yaxis[s].title.style.fontSize,fontWeight:i.config.yaxis[s].title.style.fontWeight,fontFamily:i.config.yaxis[s].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${i.config.yaxis[s].title.style.cssClass}`});a.add(o),e.add(a)}}addAxisBorder(t,e,s,i,a){const r=this.w,o=r.config.yaxis[s].axisBorder;let n=31+o.offsetX;if(r.config.yaxis[s].opposite&&(n=-31-o.offsetX),o.show){const s=t.drawLine(n,r.layout.translateY+o.offsetY-2,n,r.layout.gridHeight+r.layout.translateY+o.offsetY+2,o.color,0,o.width);e.add(s)}r.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(n,i,o,r.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new z(this.w),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});i.add(a);let r=e.globals.yAxisScale[t].result.length-1;const o=e.layout.gridWidth/r+.1;let n=o+e.config.xaxis.labels.offsetX;const l=e.formatters.xLabelFormatter;let c=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const h=e.labelData.timescaleLabels;if(h.length>0&&(this.xaxisLabels=h.slice(),c=h.slice(),r=c.length),e.config.xaxis.labels.show)for(let i=h.length?0:r;h.length?i=0;h.length?i++:i--){let r=null==l?void 0:l(c[i],i,e),d=e.layout.gridWidth+e.globals.padHorizontal-(n-o+e.config.xaxis.labels.offsetX);if(h.length){const t=this.axesUtils.getLabel(c,h,d,i,this.drawnLabels,this.xaxisFontSize);d=t.x,r=t.text,this.drawnLabels.push(t.text),0===i&&e.globals.skipFirstTimelinelabel&&(r=""),i===c.length-1&&e.globals.skipLastTimelinelabel&&(r="")}const g=s.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.layout.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:r,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.axisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:`apexcharts-xaxis-label ${e.config.xaxis.labels.style.cssClass}`});a.add(g),this.addTooltip(g,r),n+=o}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){const e=this.w,s=new z(this.w),i=e.config.xaxis.axisBorder;if(i.show){let a=0;"bar"===e.config.chart.type&&e.axisFlags.isXNumeric&&(a-=15);const r=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.layout.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(r):t.add(r)}}inversedYAxisTitleText(t){const e=this.w,s=new z(this.w);if(void 0!==e.config.xaxis.title.text){const i=s.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),a=s.drawText({x:e.layout.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:`apexcharts-xaxis-title-text ${e.config.xaxis.title.style.cssClass}`});i.add(a),t.add(i)}}yAxisTitleRotate(t,e){const s=this.w,i=new z(this.w),a=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),r=a?a.getBoundingClientRect():{width:0,height:0},o=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),n=o?o.getBoundingClientRect():{width:0,height:0};if(o){const a=this.xPaddingForYAxisTitle(t,r,n,e);o.setAttribute("x",String(a.xPos-(e?10:0)));const l=i.rotateAroundCenter(o);o.setAttribute("transform",`rotate(${e?-1*s.config.yaxis[t].title.rotate:s.config.yaxis[t].title.rotate} ${l.x} ${l.y})`)}}xPaddingForYAxisTitle(t,e,s,i){const a=this.w;let r=0,o=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:r,padd:0}:(i?r=e.width+a.config.yaxis[t].title.offsetX+s.width/2+o/2:(r=-1*e.width+a.config.yaxis[t].title.offsetX+o/2+s.width/2,a.globals.isBarHorizontal&&(o=25,r=-1*e.width-a.config.yaxis[t].title.offsetX-o)),{xPos:r,padd:o})}setYAxisXPosition(t,e){const s=this.w;let i=0,a=0,r=18,o=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((n,l)=>{const c=s.globals.ignoreYAxisIndexes.includes(l)||!n.show||n.floating||0===t[l].width,h=t[l].width+e[l].width;n.opposite?s.globals.isBarHorizontal?(a=s.layout.gridWidth+s.layout.translateX-1,s.globals.translateYAxisX[l]=a-n.labels.offsetX):(a=s.layout.gridWidth+s.layout.translateX+o,c||(o+=h+20),s.globals.translateYAxisX[l]=a-n.labels.offsetX+20):(i=s.layout.translateX-r,c||(r+=h+20),s.globals.translateYAxisX[l]=i+n.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;Array.from(t.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((e,s)=>{const i=t.config.yaxis[s];if(i&&!i.floating&&void 0!==i.labels.align){const e=t.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-texts-g`),a=Array.from(t.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-label`)),r=e.getBoundingClientRect();a.forEach(t=>{t.setAttribute("text-anchor",i.labels.align)}),"left"!==i.labels.align||i.opposite?"center"===i.labels.align?e.setAttribute("transform",`translate(${r.width/2*(i.opposite?1:-1)}, 0)`):"right"===i.labels.align&&i.opposite&&e.setAttribute("transform",`translate(${r.width}, 0)`):e.setAttribute("transform",`translate(-${r.width}, 0)`)}})}}class Q{constructor(t,e){this.w=t,this.ctx=e,this.documentEvent=this.documentEvent.bind(this)}addEventListener(t,e){const s=this.w;Object.prototype.hasOwnProperty.call(s.globals.events,t)?s.globals.events[t].push(e):s.globals.events[t]=[e]}removeEventListener(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;const i=s.globals.events[t].indexOf(e);-1!==i&&s.globals.events[t].splice(i,1)}fireEvent(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;e&&e.length||(e=[]);const i=s.globals.events[t],a=i.length;for(let t=0;t{null==s||s.addEventListener(i,s=>{const i=null===s.target.getAttribute("i")&&-1!==t.interact.capturedSeriesIndex?t.interact.capturedSeriesIndex:s.target.getAttribute("i"),a=null===s.target.getAttribute("j")&&-1!==t.interact.capturedDataPointIndex?t.interact.capturedDataPointIndex:s.target.getAttribute("j"),r=Object.assign({},t,{seriesIndex:t.globals.axisCharts?i:0,dataPointIndex:a});"keydown"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(e.ctx.keyboardNavigation&&e.ctx.keyboardNavigation.handleKey(s),"function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(s,e,r),e.ctx.events.fireEvent("keydown",[s,e,r])):"keyup"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&("function"==typeof t.config.chart.events.keyUp&&t.config.chart.events.keyUp(s,e,r),e.ctx.events.fireEvent("keyup",[s,e,r])):"mousemove"===s.type||"touchmove"===s.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(s,e,r):"mouseleave"===s.type||"touchleave"===s.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(s,e,r):("mouseup"===s.type&&1===s.which||"touchend"===s.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(s,e,r),e.ctx.events.fireEvent("click",[s,e,r]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.dom.baseEl.addEventListener(e,this.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}documentEvent(t){const e=this.w,s=t.target.className;if("click"===t.type){const t=e.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==s&&t.classList.remove("apexcharts-menu-open")}e.interact.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.interact.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class tt{constructor(t){this.w=t}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;const s=u.getApex();s.chart&&s.chart.locales&&s.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(s.chart.locales));const i=e.filter(e=>e.name===t)[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{const t=v.extend(L,i);this.w.globals.locale=t.options}}}class et{constructor(t,e){this.w=t,this.ctx=e}drawAxis(t,e){const s=this.w.globals,i=this.w.config,a=new U(this.w,this.ctx,e),r=new J(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale},e);if(s.axisCharts&&"radar"!==t){let t,e;s.isBarHorizontal?(e=r.drawYaxisInversed(0),t=a.drawXaxisInversed(0),this.w.dom.elGraphical.add(t),this.w.dom.elGraphical.add(e)):(t=a.drawXaxis(),this.w.dom.elGraphical.add(t),i.yaxis.map((t,i)=>{if(-1===s.ignoreYAxisIndexes.indexOf(i)&&(e=r.drawYaxis(i),this.w.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=this.w.dom.Paper.children()[1];t&&(t.remove(),this.w.dom.Paper.add(t))}}))}}}class st{constructor(t){this.w=t}drawXCrosshairs(){const t=this.w,e=new z(this.w),s=new X(this.w),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,o=i.colorFrom,n=i.colorTo,l=i.opacityFrom,c=i.opacityTo,h=i.stops,d=a.enabled,g=a.left,u=a.top,p=a.blur,f=a.color,x=a.opacity;let b=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===r&&(b=e.drawGradient("vertical",o,n,l,c,null,h,[]));let i=e.drawRect();1===t.config.xaxis.crosshairs.width&&(i=e.drawLine(0,0,0,0));let a=t.layout.gridHeight;(!v.isNumber(a)||a<0)&&(a=0);let m=t.config.xaxis.crosshairs.width;(!v.isNumber(m)||Number(m)<0)&&(m=0),i.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:a,width:m,height:a,fill:b,filter:"none","fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(i=s.dropShadow(i,{left:g,top:u,blur:p,color:f,opacity:x})),t.dom.elGraphical.add(i)}}drawYCrosshairs(){const t=this.w,e=new z(this.w),s=t.config.yaxis[0].crosshairs,i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.dom.elGraphical.add(a)}const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.dom.elGraphical.add(a)}}class it{constructor(t){this.w=t,this._activeBreakpoint=null}checkResponsiveConfig(t){const e=this.w,s=e.config;if(0===s.responsive.length)return;const i=s.responsive.slice();i.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();const a=new E({}),r=(t={})=>{const s=i[0].breakpoint,r=u.isBrowser()?window.innerWidth>0?window.innerWidth:screen.width:0;if(r>s){if(null!==this._activeBreakpoint){if(!e.globals.initialConfig)return;const s=v.clone(e.globals.initialConfig);s.series=v.clone(e.config.series);const i=F.extendArrayProps(a,s,e);t=v.extend(i,t),this.overrideResponsiveOptions(t),this._activeBreakpoint=null}}else for(let s=0;s-1&&(t[s].data=[]);return t}highlightSeries(t){var e;const s=this.w,i=this.getSeriesByName(t),a=parseInt(null!=(e=null==i?void 0:i.getAttribute("data:realIndex"))?e:"",10),r="highlightSeriesEls";let o=s.globals.cachedSelectors[r];o||(o=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),s.globals.cachedSelectors[r]=o);let n=null,l=null,c=null;if(s.globals.axisCharts||"radialBar"===s.config.chart.type)if(s.globals.axisCharts){n=s.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${a}']`),l=s.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${a}']`);const t=s.globals.seriesYAxisReverseMap[a];c=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}']`);else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}'] path`);for(let t=0;t{for(let e=0;e{for(let s=0;s=t.from&&(aMath.max(t,e.to),0))}else"mouseout"===t.type&&a("remove")}getActiveConfigSeriesIndex(t="asc",e=[]){const s=this.w;let i=0;if(s.config.series.length>1){const a=s.config.series.map((t,i)=>t.data&&t.data.length>0&&-1===s.globals.collapsedSeriesIndices.indexOf(i)&&(!s.globals.comboCharts||0===e.length||e.length&&e.indexOf(s.config.series[i].type)>-1)?i:-1);for(let e="asc"===t?0:a.length-1;"asc"===t?e=0;"asc"===t?e++:e--)if(-1!==a[e]){i=a[e];break}}return i}getBarSeriesIndices(){return this.w.globals.comboCharts?this.w.config.series.map((t,e)=>"bar"===t.type||"column"===t.type?e:-1).filter(t=>-1!==t):this.w.config.series.map((t,e)=>e)}getPreviousPaths(){var t,e,s,i;const a=this.w;function r(t,e,s){const i=t[e].childNodes,r={type:s,paths:[],realIndex:t[e].getAttribute("data:realIndex")};for(let t=0;t{const e=(s=t,a.dom.baseEl.querySelectorAll(`.apexcharts-${s}-series .apexcharts-series`));var s;for(let s=0;s0)for(let r=0;ro[a].getAttribute(t),l={x:parseFloat(null!=(t=r("x"))?t:"0"),y:parseFloat(null!=(e=r("y"))?e:"0"),width:parseFloat(null!=(s=r("width"))?s:"0"),height:parseFloat(null!=(i=r("height"))?i:"0")};n.push({rect:l,color:o[a].getAttribute("color")})}a.globals.previousPaths.push(n)}a.globals.axisCharts||(a.globals.previousPaths=a.seriesData.series)}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,s=new z(this.w);let i=t.globals.svgWidth/2,a=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(i=10,r="start"):"right"===e.align&&(i=t.globals.svgWidth-10,r="end"),"top"===e.verticalAlign?a=50:"bottom"===e.verticalAlign&&(a=t.globals.svgHeight-50),i+=e.offsetX,a=a+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&""!==e.text){const o=s.drawText({x:i,y:a,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,cssClass:"apexcharts-text-nodata"});t.dom.Paper.add(o)}}setNullSeriesToZeroValues(t){const e=this.w;for(let s=0;st.length>0?t:[])}}class rt{constructor(t){this.w=t,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}checkHeatmapDistributed(){const{chart:t,plotOptions:e}=this.w.config;return"treemap"===t.type&&e.treemap&&e.treemap.distributed||"heatmap"===t.type&&e.heatmap&&e.heatmap.distributed}checkBarDistributed(){const{chart:t,plotOptions:e}=this.w.config;return e.bar&&e.bar.distributed&&("bar"===t.type||"rangeBar"===t.type)}init(){this.setDefaultColors()}setDefaultColors(){var t;const e=this.w,s=new v;e.dom.elWrap.classList.add(`apexcharts-theme-${e.config.theme.mode||"light"}`);const i=null==(t=e.config.theme.accessibility)?void 0:t.colorBlindMode;if(i){e.globals.colors=this.getColorBlindColors(i),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors);const t=e.globals.colors.slice();return this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],t),this.applyDataLabelsColors(t),this.applyRadarPolygonsColors(),this.applyMarkersColors(t),void("highContrast"===i&&e.dom.elWrap.classList.add("apexcharts-high-contrast"))}const a=[...e.config.colors||e.config.fill.colors||[]];e.globals.colors=this.getColors(a),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.seriesData.series,s));const r=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],r),this.applyDataLabelsColors(r),this.applyRadarPolygonsColors(),this.applyMarkersColors(r)}getColors(t){const e=this.w;return t&&0!==t.length?Array.isArray(t)&&t.length>0&&"function"==typeof t[0]?(this.isColorFn=!0,e.config.series.map((s,i)=>{const a=t[i]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.seriesData.series[i][0]||0:e.seriesData.series[i],seriesIndex:i,dataPointIndex:i,w:this.w}):a})):t:this.predefined()}applySeriesColors(t,e){t.forEach((t,s)=>{t&&(e[s]=t)})}getMonochromeColors(t,e,s){const{color:i,shadeIntensity:a,shadeTo:r}=t,o=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,n=1/(o/a);let l=0;return Array.from({length:o},()=>{const t="dark"===r?s.shadeColor(-1*l,i):s.shadeColor(l,i);return l+=n,t})}applyColorTypes(t,e){const s=this.w;t.forEach(t=>{s.globals[t].colors=void 0===s.config[t].colors?this.isColorFn?s.config.colors:e:s.config[t].colors.slice(),this.pushExtraColors(s.globals[t].colors)})}applyDataLabelsColors(t){const e=this.w;e.globals.dataLabels.style.colors=void 0===e.config.dataLabels.style.colors?t:e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50)}applyRadarPolygonsColors(){const t=this.w;t.globals.radarPolygons.fill.colors=void 0===t.config.plotOptions.radar.polygons.fill.colors?["dark"===t.config.theme.mode?"#343A3F":"none"]:t.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(t.globals.radarPolygons.fill.colors,20)}applyMarkersColors(t){const e=this.w;e.globals.markers.colors=void 0===e.config.markers.colors?t:e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}pushExtraColors(t,e,s=null){const i=this.w;let a=e||i.seriesData.series.length;if(null===s&&(s=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===i.config.chart.type&&i.config.plotOptions.heatmap&&i.config.plotOptions.heatmap.colorScale.inverse),s&&i.seriesData.series.length&&(a=i.seriesData.series[i.globals.maxValsInArrayIndex].length*i.seriesData.series.length),t.lengtht.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}getDatalabelsRect(){const t=this.w,e=[];t.config.series.forEach((s,i)=>{s.data.forEach((s,a)=>{const r=(o=t.seriesData.series[i][a],t.config.dataLabels.formatter(o,{seriesIndex:i,dataPointIndex:a,w:t}));var o;e.push(r)})});const s=v.getLargestStringFromArr(e),i=new z(this.w),a=t.config.dataLabels.style,r=i.getTextRects(s,parseInt(a.fontSize).toString(),a.fontFamily);return{width:1.05*r.width,height:r.height}}getLargestStringFromMultiArr(t,e){let s=t;if(this.w.axisFlags.isMultiLineX){const t=e.map(t=>Array.isArray(t)?t.length:1),i=Math.max(...t);s=e[t.indexOf(i)]}return s}};class lt{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){const t=this.w;let e,s=t.labelData.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===s.length&&(s=t.labelData.categoryLabels),t.labelData.timescaleLabels.length>0){const s=this.getxAxisTimeScaleLabelsCoords();e={width:s.width,height:s.height},t.layout.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;const i=t.formatters.xLabelFormatter;let a=v.getLargestStringFromArr(s),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,s);t.globals.isBarHorizontal&&(a=t.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),r=a);const o=new S(this.w),n=a;a=o.xLabelFormat(i,a,n,{i:void 0,dateFormatter:new A(this.w).formatDate,w:t}),r=o.xLabelFormat(i,r,n,{i:void 0,dateFormatter:new A(this.w).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",r=a);const l=new z(this.w);let c=l.getTextRects(a,t.config.xaxis.labels.style.fontSize),h=c;if(a!==r&&(h=l.getTextRects(r,t.config.xaxis.labels.style.fontSize)),e={width:c.width>=h.width?c.width:h.width,height:c.height>=h.height?c.height:h.height},e.width*s.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.layout.rotateXLabels=!0;const s=e=>l.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,`rotate(${t.config.xaxis.labels.rotate} 0 0)`,!1);c=s(a),a!==r&&(h=s(r)),e.height=(c.height>h.height?c.height:h.height)/1.5,e.width=c.width>h.width?c.width:h.width}}else t.layout.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}getxAxisGroupLabelsCoords(){var t;const e=this.w;if(!e.labelData.hasXaxisGroups)return{width:0,height:0};const s=(null==(t=e.config.xaxis.group.style)?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,i=e.labelData.groups.map(t=>t.title);let a;const r=v.getLargestStringFromArr(i),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,i),n=new z(this.w),l=n.getTextRects(r,s);let c=l;return r!==o&&(c=n.getTextRects(o,s)),a={width:l.width>=c.width?l.width:c.width,height:l.height>=c.height?l.height:c.height},e.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}getxAxisTitleCoords(){const t=this.w;let e=0,s=0;if(void 0!==t.config.xaxis.title.text){const i=new z(this.w).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=i.width,s=i.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){const t=this.w;this.dCtx.timescaleLabels=t.labelData.timescaleLabels.slice();const e=this.dCtx.timescaleLabels.map(t=>t.value),s=e.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0),i=new z(this.w).getTextRects(s,t.config.xaxis.labels.style.fontSize);return 1.05*i.width*e.length>t.layout.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),i}additionalPaddingXLabels(t){const e=this.w,s=e.globals,i=e.config,a=i.xaxis.type,r=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;const o=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,n=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],o=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+r/1.75-this.dCtx.yAxisWidthRight,n=a.position-r/1.75+this.dCtx.yAxisWidthLeft,l="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;o>s.svgWidth-e.layout.translateX-l&&(s.skipLastTimelinelabel=!0),n<-(t.show&&!t.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type?10:r/1.75)&&(s.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right{o?(this.dCtx.gridPad.left{i.yaxis.length>1&&(t=>-1!==s.collapsedSeriesIndices.indexOf(t))(e)||n(t)})(t,e)})}}class ct{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){const t=this.w,e=[];let s=10;const i=new V(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});return t.config.yaxis.map((a,r)=>{const o={seriesIndex:r,dataPointIndex:-1,w:t},n=t.globals.yAxisScale[r];let l=0;if(!i.isYAxisHidden(r)&&a.labels.show&&void 0!==a.labels.minWidth&&(l=a.labels.minWidth),!i.isYAxisHidden(r)&&a.labels.show&&n.result.length){const i=t.formatters.yLabelFormatters[r],c=n.niceMin===Number.MIN_VALUE?0:n.niceMin;let h=n.result.reduce((t,e)=>{var s,a;return(null==(s=String(i(t,o)))?void 0:s.length)>(null==(a=String(i(e,o)))?void 0:a.length)?t:e},c);h=i(h,o);let d=h;if(void 0!==h&&0!==h.length||(h=n.niceMax),1===String(h).length&&(h+=".0",d=h),t.globals.isBarHorizontal){s=0;const e=t.labelData.labels.slice();h=v.getLargestStringFromArr(e),h=i(h,{seriesIndex:r,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(h,e)}const g=new z(this.w),u="rotate(".concat(a.labels.rotate," 0 0)"),p=g.getTextRects(h,a.labels.style.fontSize,a.labels.style.fontFamily,u,!1);let f=p;h!==d&&(f=g.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,u,!1)),e.push({width:(l>f.width||l>p.width?l:f.width>p.width?f.width:p.width)+s,height:f.height>p.height?f.height:p.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){const t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){const s=new z(this.w),i="rotate(".concat(t.title.rotate," 0 0)"),a=s.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,i,!1);e.push({width:a.width,height:a.height})}else e.push({width:0,height:0})}),e}getTotalYAxisWidth(){const t=this.w;let e=0,s=0,i=0;const a=t.globals.yAxisScale.length>1?10:0,r=new V(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale}),o=(o,n)=>{const l=t.config.yaxis[n].floating;let c=0;o.width>0&&!l?(c=o.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(n)&&(c=c-o.width-a)):c=l||r.isYAxisHidden(n)?0:5,t.config.yaxis[n].opposite?i+=c:s+=c,e+=c};return t.layout.yLabelsCoords.map((t,e)=>{o(t,e)}),t.layout.yTitleCoords.map((t,e)=>{o(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.layout.yLabelsCoords[0].width+t.layout.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}}class ht{constructor(t){this.w=t.w,this.dCtx=t}gridPadForColumnsInNumericAxis(t){const{w:e}=this,{config:s,globals:i}=e;if(i.noData||i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.series.length)return 0;const a=t=>["bar","rangeBar","candlestick","boxPlot"].includes(t),r=s.chart.type;let o=0,n=a(r)?s.series.length:1;i.comboBarCount>0&&(n=i.comboBarCount),i.collapsedSeries.forEach(t=>{a(t.type)&&(n-=1)}),s.chart.stacked&&(n=1);const l=a(r)||i.comboBarCount>0;let c=Math.abs(i.initialMaxX-i.initialMinX);if(l&&e.axisFlags.isXNumeric&&!i.isBarHorizontal&&n>0&&0!==c){c<=3&&(c=i.dataPoints);const e=c/t;let a=i.minXDiff&&i.minXDiff/e>0?i.minXDiff/e:0;a>t/2&&(a/=2),o=a*parseInt(s.plotOptions.bar.columnWidth,10)/100,o<1&&(o=1),i.barPadForNumericAxis=o}return o}gridPadFortitleSubtitle(){const{w:t}=this,{globals:e}=t;let s=this.dCtx.isSparkline||!e.axisCharts?0:10;["title","subtitle"].forEach(i=>{void 0!==t.config[i].text?s+=t.config[i].margin:s+=this.dCtx.isSparkline||!e.axisCharts?0:5}),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||e.axisCharts||(s+=10);const i=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");t.layout.gridHeight-=i.height+a.height+s,t.layout.translateY+=i.height+a.height+s}setGridXPosForDualYAxis(t,e){const{w:s}=this,i=new V(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});s.config.yaxis.forEach((a,r)=>{-1!==s.globals.ignoreYAxisIndexes.indexOf(r)||a.floating||i.isYAxisHidden(r)||(a.opposite&&(s.layout.translateX-=e[r].width+t[r].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.layout.translateX<2&&(s.layout.translateX=2))})}}class dt{constructor(t,e){this.w=t,this.ctx=e,this.theme=e.theme,this.timeScale=e.timeScale,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new nt(this),this.dimYAxis=new ct(this),this.dimXAxis=new lt(this),this.dimGrid=new ht(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0,this.datalabelsCoords={width:0,height:0},this.xAxisWidth=0,this.timescaleLabels=[]}plotCoords(){const t=this.w,e=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};const s=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach(([t,e])=>{this.gridPad[t]=Math.max(e,this.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(s/2,this.gridPad.top),this.gridPad.bottom=Math.max(s/2,this.gridPad.bottom)),e.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.layout.gridHeight=t.layout.gridHeight-this.gridPad.top-this.gridPad.bottom,t.layout.gridWidth=t.layout.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;const i=this.dimGrid.gridPadForColumnsInNumericAxis(t.layout.gridWidth);return t.layout.gridWidth=t.layout.gridWidth-2*i,t.layout.translateX=t.layout.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),t.layout.translateY=t.layout.translateY+this.gridPad.top,{layout:{gridHeight:t.layout.gridHeight,gridWidth:t.layout.gridWidth,translateX:t.layout.translateX,translateY:t.layout.translateY,translateXAxisX:t.layout.translateXAxisX,translateXAxisY:t.layout.translateXAxisY,rotateXLabels:t.layout.rotateXLabels,xAxisHeight:t.layout.xAxisHeight,xAxisLabelsHeight:t.layout.xAxisLabelsHeight,xAxisGroupLabelsHeight:t.layout.xAxisGroupLabelsHeight,xAxisLabelsWidth:t.layout.xAxisLabelsWidth,yLabelsCoords:t.layout.yLabelsCoords,yTitleCoords:t.layout.yTitleCoords}}}setDimensionsForAxisCharts(){const t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.layout.yLabelsCoords=[],t.layout.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.layout.yLabelsCoords.push({width:s[a].width,index:a}),t.layout.yTitleCoords.push({width:i[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();const a=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisGroupLabelsCoords(),o=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,o,r),t.layout.translateXAxisY=t.layout.rotateXLabels?this.xAxisHeight/8:-4,t.layout.translateXAxisX=t.layout.rotateXLabels&&t.axisFlags.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(t.layout.rotateXLabels=!1,t.layout.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),t.layout.translateXAxisY=t.layout.translateXAxisY+t.config.xaxis.labels.offsetY,t.layout.translateXAxisX=t.layout.translateXAxisX+t.config.xaxis.labels.offsetX;let n=this.yAxisWidth,l=this.xAxisHeight;t.layout.xAxisLabelsHeight=this.xAxisHeight-o.height,t.layout.xAxisGroupLabelsHeight=t.layout.xAxisLabelsHeight-a.height,t.layout.xAxisLabelsWidth=this.xAxisWidth,t.layout.xAxisHeight=this.xAxisHeight;let c=10;("radar"===t.config.chart.type||this.isSparkline)&&(n=0,l=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(n=0,l=0,c=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const h=()=>{t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-this.lgRect.height-l-(this.isSparkline||"treemap"===t.config.chart.type?0:t.layout.rotateXLabels?10:15),t.layout.gridWidth=e.svgWidth-n-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(c=t.layout.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":t.layout.translateY=c,h();break;case"top":t.layout.translateY=this.lgRect.height+c,h();break;case"left":t.layout.translateY=c,t.layout.translateX=this.lgRect.width+n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width;break;case"right":t.layout.translateY=c,t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s),new J(this.w,{theme:this.theme,timeScale:this.timeScale}).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){const t=this.w,e=t.globals,s=t.config;let i=0;t.config.legend.show&&!t.config.legend.floating&&(i=20);const a="pie"===s.chart.type||"polarArea"===s.chart.type||"donut"===s.chart.type?"pie":"radialBar",r=s.plotOptions[a].offsetY,o=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){t.layout.gridHeight=e.svgHeight;const s=t.dom.elWrap.getBoundingClientRect().width;return t.layout.gridWidth=Math.min(s,t.layout.gridHeight),t.layout.translateY=r,void(t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2)}switch(s.legend.position){case"bottom":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=r-10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"top":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=this.lgRect.height+r+10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"left":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+this.lgRect.width+i;break;case"right":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i-5,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){const i=this.w,a=i.labelData.hasXaxisGroups?2:1,r=s.height+t.height+e.height,o=i.axisFlags.isMultiLineX?1.2:1.618,n=i.layout.rotateXLabels?22:10,l=i.layout.rotateXLabels&&"bottom"===i.config.legend.position?10:0;this.xAxisHeight=r*o+a*n+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight{c+=t.labels.minWidth,h+=t.labels.maxWidth}),this.yAxisWidthh&&(this.yAxisWidth=h)}}const gt=10/86400;class ut{constructor(t,e){this.w=t,this.ctx=e,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){const s=this.w;if(s.globals.allSeriesCollapsed)return s.labelData.labels=[],s.labelData.timescaleLabels=[],[];const i=new A(this.w),a=(e-t)/864e5;this.determineInterval(a),s.interact.disableZoomIn=!1,s.interact.disableZoomOut=!1,a5e4&&(s.interact.disableZoomOut=!0);const r=i.getTimeUnitsfromTimestamp(t,e),o=s.layout.gridWidth/a,n=o/24,l=n/60,c=l/60,g=Math.floor(24*a),u=Math.floor(1440*a),p=Math.floor(86400*a),f=Math.floor(a),x=Math.floor(a/30),b=Math.floor(a/365),m={minMillisecond:r.minMillisecond,minSecond:r.minSecond,minMinute:r.minMinute,minHour:r.minHour,minDate:r.minDate,minMonth:r.minMonth,minYear:r.minYear},y={firstVal:m,currentMillisecond:m.minMillisecond,currentSecond:m.minSecond,currentMinute:m.minMinute,currentHour:m.minHour,currentMonthDate:m.minDate,currentDate:m.minDate,currentMonth:m.minMonth,currentYear:m.minYear,daysWidthOnXAxis:o,hoursWidthOnXAxis:n,minutesWidthOnXAxis:l,secondsWidthOnXAxis:c,numberOfSeconds:p,numberOfMinutes:u,numberOfHours:g,numberOfDays:f,numberOfMonths:x,numberOfYears:b};switch(this.tickInterval){case"years":this.generateYearScale(y);break;case"months":case"half_year":this.generateMonthScale(y);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(y);break;case"hours":this.generateHourScale(y);break;case"minutes_fives":case"minutes":this.generateMinuteScale(y);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(y)}const w=this.timeScaleArray.map(t=>{const e={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return"month"===t.unit?d(h({},e),{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?d(h({},e),{value:t.value}):"minute"===t.unit?d(h({},e),{value:t.value,minute:t.value}):"second"===t.unit?d(h({},e),{value:t.value,minute:t.minute,second:t.second}):t});return w.filter(t=>{let e=1,i=Math.ceil(s.layout.gridWidth/120);const a=t.value;void 0!==s.config.xaxis.tickAmount&&(i=s.config.xaxis.tickAmount),w.length>i&&(e=Math.floor(w.length/i));let r=!1,o=!1;switch(this.tickInterval){case"years":"year"===t.unit&&(r=!0);break;case"half_year":e=7,"year"===t.unit&&(r=!0);break;case"months":e=1,"year"===t.unit&&(r=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(r=!0),30===a&&(o=!0);break;case"months_days":e=10,"month"===t.unit&&(r=!0),30===a&&(o=!0);break;case"week_days":e=8,"month"===t.unit&&(r=!0);break;case"days":e=1,"month"===t.unit&&(r=!0);break;case"hours":"day"===t.unit&&(r=!0);break;case"minutes_fives":case"seconds_fives":a%5!=0&&(o=!0);break;case"seconds_tens":a%10!=0&&(o=!0)}if("hours"===this.tickInterval||"minutes_fives"===this.tickInterval||"seconds_tens"===this.tickInterval||"seconds_fives"===this.tickInterval){if(!o)return!0}else if((a%e===0||r)&&!o)return!0})}recalcDimensionsBasedOnFormat(t){const e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.labelData.timescaleLabels=i.slice();const a=new dt(this.w,this.ctx).plotCoords();this.ctx._writeLayoutCoords(a.layout)}determineInterval(t){const e=24*t,s=60*e;switch(!0){case t/365>5:this.tickInterval="years";break;case t>800:this.tickInterval="half_year";break;case t>180:this.tickInterval="months";break;case t>90:this.tickInterval="months_fortnight";break;case t>60:this.tickInterval="months_days";break;case t>30:this.tickInterval="week_days";break;case t>2:this.tickInterval="days";break;case e>2.4:this.tickInterval="hours";break;case s>15:this.tickInterval="minutes_fives";break;case s>5:this.tickInterval="minutes";break;case s>1:this.tickInterval="seconds_tens";break;case 60*s>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}generateYearScale({firstVal:t,currentMonth:e,currentYear:s,daysWidthOnXAxis:i,numberOfYears:a}){let r=t.minYear,o=0;const n=new A(this.w),l="year";if(t.minDate>1||t.minMonth>0){const e=n.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);o=(n.determineDaysOfYear(t.minYear)-e+1)*i,r=t.minYear+1,this.timeScaleArray.push({position:o,value:r,unit:l,year:r,month:1})}else 1===t.minDate&&0===t.minMonth&&this.timeScaleArray.push({position:o,value:r,unit:l,year:s,month:v.monthMod(e+1)});let c=r,h=o;for(let t=0;t1){n=(l.determineDaysOfMonths(s+1,t.minYear)-e+1)*a,o=v.monthMod(s+1);let r=i+h,d=v.monthMod(o),g=o;0===o&&(c="year",g=r,d=1,h+=1,r+=h),this.timeScaleArray.push({position:n,value:g,unit:c,year:r,month:d})}else this.timeScaleArray.push({position:n,value:o,unit:c,year:i,month:v.monthMod(s)});let d=o+1,g=n;for(let t=0,e=1;tt>r.determineDaysOfMonths(e+1,s)?(l=1,o="month",d=e+=1,e):e;let h=(24-t.minHour)*i,d=n,g=c(l,e,s);0===t.minHour&&1===t.minDate?(h=0,d=v.monthMod(t.minMonth),o="month",l=t.minDate):1!==t.minDate&&0===t.minHour&&0===t.minMinute&&(h=0,n=t.minDate,l=n,d=n,g=c(l,e,s),1!==d&&(o="day")),this.timeScaleArray.push({position:h,value:d,unit:o,year:this._getYear(s,g,0),month:v.monthMod(g),day:l});let u=h;for(let t=0;t(t>o.determineDaysOfMonths(e+1,i)&&(p=1,e+=1),{month:e,date:p}),c=(t,e)=>t>o.determineDaysOfMonths(e+1,i)?e+=1:e,h=60-(t.minMinute+t.minSecond/60);let d=h*a,g=t.minHour+1,u=g;60===h&&(d=0,g=t.minHour,u=g);let p=e;u>=24&&(u=0,p+=1,n="day",g=p);let f=l(p,s).month;f=c(p,f),"day"===n&&(g=p),this.timeScaleArray.push({position:d,value:g,unit:n,day:p,hour:u,year:i,month:v.monthMod(f)}),u++;let x=d;for(let t=0;t=24&&(u=0,p+=1,n="day",f=l(p,f).month,f=c(p,f));const t=this._getYear(i,f,0);x=60*a+x;const e=0===u?p:u;this.timeScaleArray.push({position:x,value:e,unit:n,hour:u,day:p,year:t,month:v.monthMod(f)}),u++}}generateMinuteScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:r,currentYear:o,minutesWidthOnXAxis:n,secondsWidthOnXAxis:l,numberOfMinutes:c}){const h=new A(this.w);let d=(60-e-t/1e3)*l,g=s+1;0===e&&0===t&&(d=0,g=s);let u=a,p=r;const f=o;let x=i,b=d;for(let t=0;t=60&&(g=0,x+=1,24===x)&&(x=0,u+=1,u>h.determineDaysOfMonths(p+1,this._getYear(f,p,0))&&(u=1,p+=1)),this.timeScaleArray.push({position:b,value:g,unit:"minute",hour:x,minute:g,day:u,year:this._getYear(f,p,0),month:v.monthMod(p)}),b+=n,g++}generateSecondScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:r,currentYear:o,secondsWidthOnXAxis:n,numberOfSeconds:l}){let c=(1e3-t)/1e3*n,h=e+1;0===t&&(c=0,h=e);let d=s;const g=a,u=r,p=o;let f=i,x=c;for(let t=0;t=60&&(d++,h=0,d>=60&&(f++,d=0,24===f&&(f=0))),this.timeScaleArray.push({position:x,value:h,unit:"second",hour:f,minute:d,second:h,day:g,year:this._getYear(p,u,0),month:v.monthMod(u)}),x+=n,h++}createRawDateString(t,e){let s=t.year;return 0===t.month&&(t.month=1),s+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?s+="-"+("0"+e).slice(-2):s+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?s+="T"+("0"+e).slice(-2):s+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),"minute"===t.unit?s+=":"+("0"+e).slice(-2):s+=":"+(t.minute?("0"+t.minute).slice(-2):"00"),"second"===t.unit?s+=":"+("0"+e).slice(-2):s+=":00",this.utc&&(s+=".000Z"),s}formatDates(t){const e=this.w;return t.map(t=>{let s=t.value.toString();const i=new A(this.w),a=this.createRawDateString(t,s);let r=i.getDate(i.parseDate(a));if(this.utc||(r=i.getDate(i.parseDateWithTimezone(a))),void 0===e.config.xaxis.labels.format){let a="dd MMM";const o=e.config.xaxis.labels.datetimeFormatter;"year"===t.unit&&(a=o.year),"month"===t.unit&&(a=o.month),"day"===t.unit&&(a=o.day),"hour"===t.unit&&(a=o.hour),"minute"===t.unit&&(a=o.minute),"second"===t.unit&&(a=o.second),s=i.formatDate(r,a)}else s=i.formatDate(r,e.config.xaxis.labels.format);return{dateString:a,position:t.position,value:s,unit:t.unit,year:t.year,month:t.month}})}removeOverlappingTS(t){const e=new z(this.w);let s,i=!1;t.length>0&&t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(i=!0,s=e.getTextRects(t[0].value,this.w.config.xaxis.labels.style.fontSize).width);let a=0,r=t.map((r,o)=>{if(o>0&&this.w.config.xaxis.labels.hideOverlappingLabels){const n=i?s:e.getTextRects(t[a].value,this.w.config.xaxis.labels.style.fontSize).width,l=t[a].position;return r.position>l+n+10?(a=o,r):null}return r});return r=r.filter(t=>null!==t),r}_getYear(t,e,s){return t+Math.floor(e/12)+s}}const pt="__apexcharts_registry__";function ft(){return globalThis[pt]}function xt(t){const e=ft()[t];if(!e)throw new Error(`ApexCharts: chart type "${t}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.`);return e}globalThis[pt]||(globalThis[pt]={});class bt{constructor(t,e,s){this.w=e,this.ctx=s,this.el=t}setupElements(){const{globals:t,config:e}=this.w,i=e.chart.type,a=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"],r=[...a,"radar","heatmap","treemap"];t.axisCharts=r.includes(i),t.xyCharts=a.includes(i),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(i)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,this.w.dom.baseEl=this.el,this.w.dom.elWrap=w.createElementNS("http://www.w3.org/1999/xhtml","div"),z.setAttrs(this.w.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(this.w.dom.elWrap);const o=u.isBrowser()?window.SVG:s.g.SVG;if(this.w.dom.Paper=o().addTo(this.w.dom.elWrap),this.w.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),this.w.dom.Paper.node.style.background="dark"!==e.theme.mode||e.chart.background?"light"!==e.theme.mode||e.chart.background?e.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),this.w.dom.elLegendForeign=w.createElementNS(Y,"foreignObject"),z.setAttrs(this.w.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),this.w.dom.elLegendWrap=w.createElementNS("http://www.w3.org/1999/xhtml","div"),this.w.dom.elLegendWrap.classList.add("apexcharts-legend"),this.w.dom.elWrap.appendChild(this.w.dom.elLegendWrap),this.w.dom.Paper.node.appendChild(this.w.dom.elLegendForeign),e.chart.accessibility.enabled){const t=this.getAccessibleChartLabel(),s=e.chart.accessibility.keyboard.enabled&&e.chart.accessibility.keyboard.navigation.enabled?"application":"img";if(this.w.dom.Paper.attr({role:s,"aria-label":t}),e.chart.accessibility.description){const t=w.createElementNS(Y,"desc");t.textContent=e.chart.accessibility.description,this.w.dom.Paper.node.insertBefore(t,this.w.dom.elLegendForeign.nextSibling)}}this.w.dom.elGraphical=this.w.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),this.w.dom.elDefs=this.w.dom.Paper.defs(),this.w.dom.Paper.add(this.w.dom.elGraphical),this.w.dom.elGraphical.add(this.w.dom.elDefs)}plotChartType(t,e){const{w:s,ctx:i}=this,{config:a,globals:r}=s,o={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},n=a.chart.type||"line";let l=null,c=0;this.w.seriesData.series.forEach((e,i)=>{var a,r;const h="column"===(null==(a=t[i])?void 0:a.type)?"bar":(null==(r=t[i])?void 0:r.type)||("column"===n?"bar":n);o[h]?("rangeArea"===h?(o[h].series.push(this.w.rangeData.seriesRangeStart[i]),o[h].seriesRangeEnd.push(this.w.rangeData.seriesRangeEnd[i])):o[h].series.push(e),o[h].i.push(i),"bar"===h&&(s.globals.columnSeries=o.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(h)&&(l=h),n!==h&&"scatter"!==h&&c++}),c>0&&o.bar.series.length>0&&a.plotOptions.bar.horizontal&&(c-=o.bar.series.length,o.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]}),r.comboCharts||(r.comboCharts=c>0);const h=o.line.series.length>0||o.area.series.length>0||o.scatter.series.length>0||o.bubble.series.length>0||o.rangeArea.series.length>0||!r.comboCharts&&["line","area","scatter","bubble","rangeArea"].includes(a.chart.type)?new(xt("line"))(i.w,i,e):null,d=o.candlestick.series.length>0||o.boxPlot.series.length>0||!r.comboCharts&&["candlestick","boxPlot"].includes(a.chart.type)?new(xt("candlestick"))(i.w,i,e):null,g=!r.comboCharts&&["pie","donut","polarArea"].includes(a.chart.type);i.pie=g?new(xt("pie"))(i.w,i):null;const u=o.rangeBar.series.length>0||!r.comboCharts&&"rangeBar"===a.chart.type;i.rangeBar=u?new(xt("rangeBar"))(i.w,i,e):null;let p=[];if(r.comboCharts){const t=new F(this.w);if(o.area.series.length>0&&p.push(...t.drawSeriesByGroup(o.area,r.areaGroups,"area",h)),o.bar.series.length>0)if(a.chart.stacked){const t=new(xt("barStacked"))(i.w,i,e);p.push(t.draw(o.bar.series,o.bar.i))}else i.bar=new(xt("bar"))(i.w,i,e),p.push(i.bar.draw(o.bar.series,o.bar.i));if(o.rangeArea.series.length>0&&p.push(h.draw(o.rangeArea.series,"rangeArea",o.rangeArea.i,o.rangeArea.seriesRangeEnd)),o.line.series.length>0&&p.push(...t.drawSeriesByGroup(o.line,r.lineGroups,"line",h)),o.candlestick.series.length>0&&p.push(d.draw(o.candlestick.series,"candlestick",o.candlestick.i)),o.boxPlot.series.length>0&&p.push(d.draw(o.boxPlot.series,"boxPlot",o.boxPlot.i)),o.rangeBar.series.length>0&&p.push(i.rangeBar.draw(o.rangeBar.series,o.rangeBar.i)),o.scatter.series.length>0){const t=new(xt("line"))(i.w,i,e,!0);p.push(t.draw(o.scatter.series,"scatter",o.scatter.i))}if(o.bubble.series.length>0){const t=new(xt("line"))(i.w,i,e,!0);p.push(t.draw(o.bubble.series,"bubble",o.bubble.i))}}else{const t=a.chart.type;switch(t){case"line":p=h.draw(this.w.seriesData.series,"line");break;case"area":p=h.draw(this.w.seriesData.series,"area");break;case"bar":a.chart.stacked?p=new(xt("barStacked"))(i.w,i,e).draw(this.w.seriesData.series):(i.bar=new(xt("bar"))(i.w,i,e),p=i.bar.draw(this.w.seriesData.series));break;case"candlestick":p=d.draw(this.w.seriesData.series,"candlestick");break;case"boxPlot":p=d.draw(this.w.seriesData.series,t);break;case"rangeBar":p=i.rangeBar.draw(this.w.seriesData.series);break;case"rangeArea":p=h.draw(this.w.rangeData.seriesRangeStart,"rangeArea",void 0,this.w.rangeData.seriesRangeEnd);break;case"heatmap":p=new(xt("heatmap"))(i.w,i,e).draw(this.w.seriesData.series);break;case"treemap":p=new(xt("treemap"))(i.w,i).draw(this.w.seriesData.series);break;case"pie":case"donut":case"polarArea":p=i.pie.draw(this.w.seriesData.series);break;case"radialBar":p=new(xt("radialBar"))(i.w,i).draw(this.w.seriesData.series);break;case"radar":p=new(xt("radar"))(i.w,i).draw(this.w.seriesData.series);break;default:p=h.draw(this.w.seriesData.series)}}return p}setSVGDimensions(){var t;const{globals:e,config:s}=this.w;s.chart.width=s.chart.width||"100%",s.chart.height=s.chart.height||"auto";const i=s.chart.width,a=s.chart.height;e.svgWidth=NaN,e.svgHeight=NaN;let r=v.getDimensions(this.el);const o=i.toString().split(/[0-9]+/g).pop();"%"===o?v.isNumber(r[0])&&(0===r[0].width&&(r=v.getDimensions(this.el.parentNode)),e.svgWidth=r[0]*parseInt(i,10)/100):"px"!==o&&""!==o||(e.svgWidth=parseInt(i,10));const n=String(a).toString().split(/[0-9]+/g).pop();if("auto"!==a&&""!==a)if("%"===n){const t=v.getDimensions(this.el.parentNode);e.svgHeight=t[1]*parseInt(a,10)/100}else e.svgHeight=parseInt(a,10);else e.svgHeight=e.axisCharts?e.svgWidth/1.61:e.svgWidth/1.2;if(e.svgWidth=Math.max(e.svgWidth,0),e.svgHeight=Math.max(e.svgHeight,0),z.setAttrs(this.w.dom.Paper.node,{width:e.svgWidth,height:e.svgHeight}),"%"!==n&&u.isBrowser()){const i=s.chart.sparkline.enabled?0:e.axisCharts?s.chart.parentHeightOffset:0,a=this.w.dom.Paper.node;(null==(t=a.parentNode)?void 0:t.parentNode)&&(a.parentNode.parentNode.style.minHeight=`${e.svgHeight+i}px`)}this.w.dom.elWrap.style.width=`${e.svgWidth}px`,this.w.dom.elWrap.style.height=`${e.svgHeight}px`}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:s}=t;z.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){var t,e;const{w:s}=this;let i=0,a=s.config.chart.sparkline.enabled?1:15;a+=s.config.grid.padding.bottom,["top","bottom"].includes(s.config.legend.position)&&s.config.legend.show&&!s.config.legend.floating&&(i=(null!=(e=null==(t=this.ctx.legend)?void 0:t.legendHelpers.getLegendDimensions().clwh)?e:0)+7);const r=s.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie");let o=2.05*s.globals.radialSize;if(r&&!s.config.chart.sparkline.enabled&&0!==s.config.plotOptions.radialBar.startAngle){const t=v.getBoundingClientRect(r);o=t.bottom;const e=t.bottom-t.top;o=Math.max(2.05*s.globals.radialSize,e)}const n=Math.ceil(o+this.w.layout.translateY+i+a);this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(n)),s.config.chart.height&&String(s.config.chart.height).includes("%")||(this.w.dom.elWrap.style.height=`${n}px`,z.setAttrs(this.w.dom.Paper.node,{height:n}),u.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${n}px`))}coreCalculations(){new K(this.w).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new O,{globals:s}=this.w,i={dataWasParsed:this.w.axisFlags.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(this.w.axisFlags.dataWasParsed=i.dataWasParsed,s.originalSeries=i.originalSeries)}isMultipleY(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}xySettings(){const{w:t}=this;let e=null;if(t.globals.axisCharts){if("back"===t.config.xaxis.crosshairs.position&&new st(this.w).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new st(this.w).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new ut(this.w,this.ctx);let e=[];isFinite(t.globals.minX)&&isFinite(t.globals.maxX)&&!t.globals.isBarHorizontal?e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX,t.globals.maxX):t.globals.isBarHorizontal&&(e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY,t.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(e)}e=new F(this.w).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.interact.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}setupBrushHandler(){const{ctx:t,w:e}=this;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){const s=Array.isArray(e.config.chart.brush.targets)?e.config.chart.brush.targets:[e.config.chart.brush.target];s.forEach(e=>{const s=t.constructor.getChartByID(e);s.w.globals.brushSource=this.ctx,"function"!=typeof s.w.config.chart.events.zoomed&&(s.w.config.chart.events.zoomed=()=>this.updateSourceChart(s)),"function"!=typeof s.w.config.chart.events.scrolled&&(s.w.config.chart.events.scrolled=()=>this.updateSourceChart(s))}),e.config.chart.events.selection=(e,i)=>{s.forEach(e=>{t.constructor.getChartByID(e).ctx.updateHelpers._updateOptions({xaxis:{min:i.xaxis.min,max:i.xaxis.max}},!1,!1,!1,!1)})}}}getAccessibleChartLabel(){const t=this.w,e=t.config;let s="";if(e.chart.accessibility&&e.chart.accessibility.description)s=e.chart.accessibility.description;else if(e.title.text){const t=e.chart.type;s=`${e.title.text}. ${t} chart`,e.subtitle.text&&(s+=`. ${e.subtitle.text}`)}else s=`${e.chart.type} chart with ${t.seriesData.series.length||(e.series?e.series.length:0)} data series`;return s}}class mt{constructor(t,{resetGlobals:e=()=>{},isMultipleY:s=()=>{}}={}){this.w=t,this.resetGlobals=e,this.isMultipleY=s,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new F(this.w),this.activeSeriesIndex=0}getFirstDataPoint(){const t=this.w.config.series,e=new at(this.w);this.activeSeriesIndex=e.getActiveConfigSeriesIndex();const s=t[this.activeSeriesIndex];return s&&s.data&&s.data.length>0&&null!==s.data[0]&&void 0!==s.data[0]?s.data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){var t;const e=this.getFirstDataPoint();if(!e||void 0===e.x)return!1;const s=null==(t=this.w.config.series[this.activeSeriesIndex])?void 0:t.data;if(s){const t=t=>t&&void 0!==t.x;for(let e=1;e=5?this.twoDSeries.push(v.parseNumber(e[4])):this.twoDSeries.push(v.parseNumber(o)),this.w.axisFlags.dataFormatXNumeric=!0),"datetime"===s.xaxis.type){const t=new Date(r).getTime();this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==n&&(this.threeDSeries.push(n),this.w.axisFlags.isDataXYZ=!0)}}handleFormatXY(t,e){const s=this.w.config,i=this.w.globals,a=new A(this.w),r=t[e].data;let o=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(o=this.activeSeriesIndex);const n=t[o].data;for(let t=0;t{t&&t.forEach(t=>{const e=t.y,s=e.length;if(!(s<=1))for(let i=0;i{if(!r.has(t.x)){const e={x:t.x,overlaps:new Set,y:[]};r.set(t.x,e),o.push(e)}}),"array"===t)for(let t=0;t