r){var c=r;r=a,a=c}var d=this.annoCtx.graphics.drawRect(0+t.offsetX,a+t.offsetY,this._getYAxisAnnotationWidth(t),r-a,0,t.fillColor,t.opacity,1,t.borderColor,s);d.node.classList.add("apexcharts-annotation-rect"),d.attr("clip-path","url(#gridRectMask".concat(n.globals.cuid,")")),e.appendChild(d.node),t.id&&d.node.classList.add(t.id)}var h="right"===t.label.position?n.globals.gridWidth:"center"===t.label.position?n.globals.gridWidth/2:0,u=this.annoCtx.graphics.drawText({x:h+t.label.offsetX,y:(null!=a?a:r)+t.label.offsetY-3,text:o,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});u.attr({rel:i}),e.appendChild(u.node)}},{key:"_getYAxisAnnotationWidth",value:function(t){var e=this.w;return e.globals.gridWidth,(t.width.indexOf("%")>-1?e.globals.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10))+t.offsetX}},{key:"drawYAxisAnnotations",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return e.config.annotations.yaxis.map((function(e,a){t.addYaxisAnnotation(e,i.node,a)})),i}}]),t}(),E=function(){function t(e){o(this,t),this.w=e.w,this.annoCtx=e,this.helpers=new k(this.annoCtx)}return c(t,[{key:"addPointAnnotation",value:function(t,e,i){this.w;var a=this.helpers.getX1X2("x1",t),n=this.helpers.getY1Y2("y1",t);if(b.isNumber(a)){var s={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:"apexcharts-point-annotation-marker ".concat(t.marker.cssClass," ").concat(t.id?t.id:"")},r=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,n+t.marker.offsetY,s);e.appendChild(r.node);var o=t.label.text?t.label.text:"",l=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:n+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:o,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});if(l.attr({rel:i}),e.appendChild(l.node),t.customSVG.SVG){var c=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});c.attr({transform:"translate(".concat(a+t.customSVG.offsetX,", ").concat(n+t.customSVG.offsetY,")")}),c.node.innerHTML=t.customSVG.SVG,e.appendChild(c.node)}if(t.image.path){var d=t.image.width?t.image.width:20,h=t.image.height?t.image.height:20;r=this.annoCtx.addImage({x:a+t.image.offsetX-d/2,y:n+t.image.offsetY-h/2,width:d,height:h,path:t.image.path,appendTo:".apexcharts-point-annotations"})}t.mouseEnter&&r.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&r.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&r.node.addEventListener("click",t.click.bind(this,t))}}},{key:"drawPointAnnotations",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return e.config.annotations.points.map((function(e,a){t.addPointAnnotation(e,i.node,a)})),i}}]),t}(),T={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"}}},O=function(){function t(){o(this,t),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,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: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,radius:2,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}}return c(t,[{key:"init",value:function(){return{annotations:{position:"front",yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"transparent",locales:[T],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},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},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,offsetX:0,offsetY: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},stacked:!1,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",dateFormatter:function(t){return new Date(t).toDateString()}},png:{filename:void 0},svg:{filename:void 0}},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,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,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},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:function(t){return t}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(t){return t+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return t+e}),0)/t.globals.series.length+"%"}}}},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:function(t){return t}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(t){return t}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return 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:function(t){return 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",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},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:[],labels:{colors:void 0,useSeriesColors:!1},markers:{width:12,height:12,strokeWidth:0,fillColors:void 0,strokeColor:"#fff",radius:12,customHTML:void 0,offsetX:0,offsetY:0,onClick:void 0},itemMargin:{horizontal:5,vertical:2},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",width:8,height:8,radius:2,offsetX:0,offsetY:0,onClick:void 0,onDblClick:void 0,showNullDataPoints:!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:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.1}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.5}}},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,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:function(t){return 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},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:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"light",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),t}(),M=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.graphics=new C(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new k(this),this.xAxisAnnotations=new A(this),this.yAxisAnnotations=new P(this),this.pointsAnnotations=new E(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return c(t,[{key:"drawAxesAnnotations",value:function(){var t=this.w;if(t.globals.axisCharts){for(var e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,s=[e,i,a],r=[i.node,e.node,a.node],o=0;o<3;o++)t.globals.dom.elGraphical.add(s[o]),!n||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&r[o].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[o],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var t=this;this.w.config.annotations.images.map((function(e,i){t.addImage(e,i)}))}},{key:"drawTextAnnos",value:function(){var t=this;this.w.config.annotations.texts.map((function(e,i){t.addText(e,i)}))}},{key:"addXaxisAnnotation",value:function(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}},{key:"addYaxisAnnotation",value:function(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}},{key:"addPointAnnotation",value:function(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}},{key:"addText",value:function(t,e){var i=t.x,a=t.y,n=t.text,s=t.textAnchor,r=t.foreColor,o=t.fontSize,l=t.fontFamily,c=t.fontWeight,d=t.cssClass,h=t.backgroundColor,u=t.borderWidth,p=t.strokeDashArray,f=t.borderRadius,g=t.borderColor,m=t.appendTo,v=void 0===m?".apexcharts-annotations":m,x=t.paddingLeft,b=void 0===x?4:x,y=t.paddingRight,w=void 0===y?4:y,C=t.paddingBottom,S=void 0===C?2:C,k=t.paddingTop,A=void 0===k?2:k,P=this.w,E=this.graphics.drawText({x:i,y:a,text:n,textAnchor:s||"start",fontSize:o||"12px",fontWeight:c||"regular",fontFamily:l||P.config.chart.fontFamily,foreColor:r||P.config.chart.foreColor,cssClass:d}),T=P.globals.dom.baseEl.querySelector(v);T&&T.appendChild(E.node);var O=E.bbox();if(n){var M=this.graphics.drawRect(O.x-b,O.y-A,O.width+b+w,O.height+S+A,f,h||"transparent",1,u,g,p);T.insertBefore(M.node,E.node)}}},{key:"addImage",value:function(t,e){var i=this.w,a=t.path,n=t.x,s=void 0===n?0:n,r=t.y,o=void 0===r?0:r,l=t.width,c=void 0===l?20:l,d=t.height,h=void 0===d?20:d,u=t.appendTo,p=void 0===u?".apexcharts-annotations":u,f=i.globals.dom.Paper.image(a);f.size(c,h).move(s,o);var g=i.globals.dom.baseEl.querySelector(p);return g&&g.appendChild(f.node),f}},{key:"addXaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}},{key:"addYaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}},{key:"addPointAnnotationExternal",value:function(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}},{key:"addAnnotationExternal",value:function(t){var e=t.params,i=t.pushToMemory,a=t.context,n=t.type,s=t.contextMethod,r=a,o=r.w,l=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(n,"-annotations")),c=l.childNodes.length+1,d=new O,h=Object.assign({},"xaxis"===n?d.xAxisAnnotation:"yaxis"===n?d.yAxisAnnotation:d.pointAnnotation),u=b.extend(h,e);switch(n){case"xaxis":this.addXaxisAnnotation(u,l,c);break;case"yaxis":this.addYaxisAnnotation(u,l,c);break;case"point":this.addPointAnnotation(u,l,c)}var p=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(n,"-annotations .apexcharts-").concat(n,"-annotation-label[rel='").concat(c,"']")),f=this.helpers.addBackgroundToAnno(p,u);return f&&l.insertBefore(f.node,p),i&&o.globals.memory.methodsToExec.push({context:r,id:u.id?u.id:b.randomId(),method:s,label:"addAnnotation",params:e}),a}},{key:"clearAnnotations",value:function(t){var e=t.w,i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");e.globals.memory.methodsToExec.map((function(t,i){"addText"!==t.label&&"addAnnotation"!==t.label||e.globals.memory.methodsToExec.splice(i,1)})),i=b.listToArray(i),Array.prototype.forEach.call(i,(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}))}},{key:"removeAnnotation",value:function(t,e){var i=t.w,a=i.globals.dom.baseEl.querySelectorAll(".".concat(e));a&&(i.globals.memory.methodsToExec.map((function(t,a){t.id===e&&i.globals.memory.methodsToExec.splice(a,1)})),Array.prototype.forEach.call(a,(function(t){t.parentElement.removeChild(t)})))}}]),t}(),L=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,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]}return c(t,[{key:"isValidDate",value:function(t){return!isNaN(this.parseDate(t))}},{key:"getTimeStamp",value:function(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}},{key:"getDate",value:function(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}},{key:"parseDate",value:function(t){var e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);var i=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return this.getTimeStamp(i)}},{key:"parseDateWithTimezone",value:function(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(t,e){var i=this.w.globals.locale,a=this.w.config.xaxis.labels.datetimeUTC,n=["\0"].concat(m(i.months)),s=[""].concat(m(i.shortMonths)),r=[""].concat(m(i.days)),o=[""].concat(m(i.shortDays));function l(t,e){var i=t+"";for(e=e||2;i.length12?u-12:0===u?12:u;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(u))).replace(/(^|[^\\])H/g,"$1"+u)).replace(/(^|[^\\])hh+/g,"$1"+l(p))).replace(/(^|[^\\])h/g,"$1"+p);var f=a?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(f))).replace(/(^|[^\\])m/g,"$1"+f);var g=a?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(g))).replace(/(^|[^\\])s/g,"$1"+g);var v=a?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(v,3)),v=Math.round(v/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(v)),v=Math.round(v/10);var x=u<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+v)).replace(/(^|[^\\])TT+/g,"$1"+x)).replace(/(^|[^\\])T/g,"$1"+x.charAt(0));var b=x.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));var y=-t.getTimezoneOffset(),w=a||!y?"Z":y>0?"+":"-";if(!a){var C=(y=Math.abs(y))%60;w+=l(Math.floor(y/60))+":"+l(C)}e=e.replace(/(^|[^\\])K/g,"$1"+w);var S=(a?t.getUTCDay():t.getDay())+1;return(e=(e=(e=(e=e.replace(new RegExp(r[0],"g"),r[S])).replace(new RegExp(o[0],"g"),o[S])).replace(new RegExp(n[0],"g"),n[d])).replace(new RegExp(s[0],"g"),s[d])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(t,e,i){var a=this.w;void 0!==a.config.xaxis.min&&(t=a.config.xaxis.min),void 0!==a.config.xaxis.max&&(e=a.config.xaxis.max);var n=this.getDate(t),s=this.getDate(e),r=this.formatDate(n,"yyyy MM dd HH mm ss fff").split(" "),o=this.formatDate(s,"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)}}},{key:"isLeapYear",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:"calculcateLastDaysOfMonth",value:function(t,e,i){return this.determineDaysOfMonths(t,e)-i}},{key:"determineDaysOfYear",value:function(t){var e=365;return this.isLeapYear(t)&&(e=366),e}},{key:"determineRemainingDaysOfYear",value:function(t,e,i){var a=this.daysCntOfYear[e]+i;return e>1&&this.isLeapYear()&&a++,a}},{key:"determineDaysOfMonths",value:function(t,e){var i=30;switch(t=b.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(i=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:i=31}return i}}]),t}(),I=function(t){var e,i=t.ctx,a=t.seriesIndex,n=t.dataPointIndex,s=t.y1,r=t.y2,o=t.w,l=o.globals.seriesRangeStart[a][n],c=o.globals.seriesRangeEnd[a][n],d=o.globals.labels[n],h=o.config.series[a].name?o.config.series[a].name:"",u=o.config.tooltip.y.formatter,p=o.config.tooltip.y.title.formatter,f={w:o,seriesIndex:a,dataPointIndex:n,start:l,end:c};"function"==typeof p&&(h=p(h,f)),null!==(e=o.config.series[a].data[n])&&void 0!==e&&e.x&&(d=o.config.series[a].data[n].x+":"),"function"==typeof u&&(d=u(d,f)),Number.isFinite(s)&&Number.isFinite(r)&&(l=s,c=r);var g="",m="",v=o.globals.colors[a];if(void 0===o.config.tooltip.x.formatter)if("datetime"===o.config.xaxis.type){var x=new L(i);g=x.formatDate(x.getDate(l),o.config.tooltip.x.format),m=x.formatDate(x.getDate(c),o.config.tooltip.x.format)}else g=l,m=c;else g=o.config.tooltip.x.formatter(l),m=o.config.tooltip.x.formatter(c);return{start:l,end:c,startVal:g,endVal:m,ylabel:d,color:v,seriesName:h}},_=function(t){var e=t.color,i=t.seriesName,a=t.ylabel,n=t.start,s=t.end,r=t.seriesIndex,o=t.dataPointIndex,l=t.ctx.tooltip.tooltipLabels.getFormatters(r);n=l.yLbFormatter(n),s=l.yLbFormatter(s);var c=l.yLbFormatter(t.w.globals.series[r][o]),d='\n '.concat(n,'\n - \n ').concat(s,"\n ");return'"},D=function(){function t(e){o(this,t),this.opts=e}return c(t,[{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(t){return 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,b.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}})}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"round"},fill:{opacity:.85},legend:{markers:{shape:"square",radius:2,size:8}},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}}}}}},{key:"candlestick",value:function(){var t=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(e){var i=e.seriesIndex,a=e.dataPointIndex,n=e.w;return t._getBoxTooltip(n,i,a,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var t=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(e){var i=e.seriesIndex,a=e.dataPointIndex,n=e.w;return t._getBoxTooltip(n,i,a,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:5,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(t,e){e.ctx;var i=e.seriesIndex,a=e.dataPointIndex,n=e.w,s=function(){var t=n.globals.seriesRangeStart[i][a];return n.globals.seriesRangeEnd[i][a]-t};return n.globals.comboCharts?"rangeBar"===n.config.series[i].type||"rangeArea"===n.config.series[i].type?s():t:s()},background:{enabled:!1},style:{colors:["#fff"]}},tooltip:{shared:!1,followCursor:!0,custom:function(t){return t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?function(t){var e=I(t),i=e.color,a=e.seriesName,n=e.ylabel,r=e.startVal,o=e.endVal;return _(s(s({},t),{},{color:i,seriesName:a,ylabel:n,start:r,end:o}))}(t):function(t){var e=I(t),i=e.color,a=e.seriesName,n=e.ylabel,r=e.start,o=e.end;return _(s(s({},t),{},{color:i,seriesName:a,ylabel:n,start:r,end:o}))}(t)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"area",value:function(){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}}}},{key:"rangeArea",value:function(){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:function(t){return function(t){var e=I(t),i=e.color,a=e.seriesName,n=e.ylabel,r=e.start,o=e.end;return _(s(s({},t),{},{color:i,seriesName:a,ylabel:n,start:r,end:o}))}(t)}}}}},{key:"brush",value:function(t){return b.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;var e=t.dataLabels.formatter;return t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})),"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}},{key:"convertCatToNumeric",value:function(t){return t.xaxis.convertedCatToNumeric=!0,t}},{key:"convertCatToNumericXaxis",value:function(t,e,i){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return b.isNumber(t)?Math.floor(t):t};var a=t.xaxis.labels.formatter,n=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return i&&i.length&&(n=i.map((function(t){return Array.isArray(t)?t:String(t)}))),n&&n.length&&(t.xaxis.labels.formatter=function(t){return b.isNumber(t)?a(n[Math.floor(t)-1]):a(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}},{key:"bubble",value:function(){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}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){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",size:10,offsetY:2}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(t){return 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"}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return 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"}}}},{key:"polarArea",value:function(){return this.opts.yaxis[0].tickAmount=this.opts.yaxis[0].tickAmount?this.opts.yaxis[0].tickAmount:6,{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"radar",value:function(){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:3,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1},xaxis:{labels:{formatter:function(t){return t},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){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}}}},{key:"_getBoxTooltip",value:function(t,e,i,a,n){var s=t.globals.seriesCandleO[e][i],r=t.globals.seriesCandleH[e][i],o=t.globals.seriesCandleM[e][i],l=t.globals.seriesCandleL[e][i],c=t.globals.seriesCandleC[e][i];return t.config.series[e].type&&t.config.series[e].type!==n?'\n '.concat(t.config.series[e].name?t.config.series[e].name:"series-"+(e+1),": ").concat(t.globals.series[e][i],"\n
"):'"}}]),t}(),z=function(){function t(e){o(this,t),this.opts=e}return c(t,[{key:"init",value:function(t){var e=t.responsiveOverride,i=this.opts,a=new O,n=new D(i);this.chartType=i.chart.type,"histogram"===this.chartType&&(i.chart.type="bar",i=b.extend({plotOptions:{bar:{columnWidth:"99.99%"}}},i)),i=this.extendYAxis(i),i=this.extendAnnotations(i);var s=a.init(),o={};if(i&&"object"===r(i)){var l={};l=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","histogram","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(i.chart.type)?n[i.chart.type]():n.line(),i.chart.brush&&i.chart.brush.enabled&&(l=n.brush(l)),i.chart.stacked&&"100%"===i.chart.stackType&&(i=n.stacked100(i)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(i),i.xaxis=i.xaxis||window.Apex.xaxis||{},e||(i.xaxis.convertedCatToNumeric=!1),((i=this.checkForCatToNumericXAxis(this.chartType,l,i)).chart.sparkline&&i.chart.sparkline.enabled||window.Apex.chart&&window.Apex.chart.sparkline&&window.Apex.chart.sparkline.enabled)&&(l=n.sparkline(l)),o=b.extend(s,l)}var c=b.extend(o,window.Apex);return s=b.extend(c,i),this.handleUserInputErrors(s)}},{key:"checkForCatToNumericXAxis",value:function(t,e,i){var a=new D(i),n=("bar"===t||"boxPlot"===t)&&i.plotOptions&&i.plotOptions.bar&&i.plotOptions.bar.horizontal,s="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,r="datetime"!==i.xaxis.type&&"numeric"!==i.xaxis.type,o=i.xaxis.tickPlacement?i.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return n||s||!r||"between"===o||(i=a.convertCatToNumeric(i)),i}},{key:"extendYAxis",value:function(t,e){var i=new O;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={}),t.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(t.yaxis=b.extend(t.yaxis,window.Apex.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[b.extend(i.yAxis,t.yaxis)]:t.yaxis=b.extendArray(t.yaxis,i.yAxis);var a=!1;t.yaxis.forEach((function(t){t.logarithmic&&(a=!0)}));var n=t.series;return e&&!n&&(n=e.config.series),a&&n.length!==t.yaxis.length&&n.length&&(t.yaxis=n.map((function(e,a){if(e.name||(n[a].name="series-".concat(a+1)),t.yaxis[a])return t.yaxis[a].seriesName=n[a].name,t.yaxis[a];var s=b.extend(i.yAxis,t.yaxis[0]);return s.show=!1,s}))),a&&n.length>1&&n.length!==t.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes. Please make sure to equalize both."),t}},{key:"extendAnnotations",value:function(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)}},{key:"extendYAxisAnnotations",value:function(t){var e=new O;return t.annotations.yaxis=b.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}},{key:"extendXAxisAnnotations",value:function(t){var e=new O;return t.annotations.xaxis=b.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}},{key:"extendPointAnnotations",value:function(t){var e=new O;return t.annotations.points=b.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}},{key:"checkForDarkTheme",value:function(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.chart.background||(t.chart.background="#424242"),t.theme.palette||(t.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(t){var 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&&(console.warn("Reversed y-axis in ".concat(e.chart.type," chart is not supported.")),e.yaxis[0].reversed=!1),e}}]),t}(),N=function(){function t(){o(this,t)}return c(t,[{key:"initGlobalVars",value:function(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.labels=[],t.hasGroups=!1,t.groups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.isXNumeric=!1,t.xaxisLabelsCount=0,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.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0}},{key:"globalVars",value:function(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],goldenPadding:35,invalidLogScale:!1,ignoreYAxisIndexes:[],yAxisSameScaleIndices:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,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,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null}}},{key:"init",value:function(t){var e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=b.extend({},t),e.initialSeries=b.clone(t.series),e.lastXAxis=b.clone(e.initialConfig.xaxis),e.lastYAxis=b.clone(e.initialConfig.yaxis),e}}]),t}(),j=function(){function t(e){o(this,t),this.opts=e}return c(t,[{key:"init",value:function(){var t=new z(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new N).init(t)}}}]),t}(),$=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.opts=null,this.seriesIndex=0}return c(t,[{key:"clippedImgArea",value:function(t){var e=this.w,i=e.config,a=parseInt(e.globals.gridWidth,10),n=parseInt(e.globals.gridHeight,10),s=a>n?a:n,r=t.image,o=0,l=0;void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(o=i.fill.image.width+1,l=i.fill.image.height):(o=s+1,l=s):(o=t.width,l=t.height);var c=document.createElementNS(e.globals.SVGNS,"pattern");C.setAttrs(c,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:o+"px",height:l+"px"});var d=document.createElementNS(e.globals.SVGNS,"image");c.appendChild(d),d.setAttributeNS(window.SVG.xlink,"href",r),C.setAttrs(d,{x:0,y:0,preserveAspectRatio:"none",width:o+"px",height:l+"px"}),d.style.opacity=t.opacity,e.globals.dom.elDefs.node.appendChild(c)}},{key:"getSeriesIndex",value:function(t){var e=this.w;return("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||"heatmap"===e.config.chart.type||"treemap"===e.config.chart.type?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(t){var e=this.w;this.opts=t;var i,a,n,s=this.w.config;this.seriesIndex=this.getSeriesIndex(t);var r=this.getFillColors()[this.seriesIndex];void 0!==e.globals.seriesColors[this.seriesIndex]&&(r=e.globals.seriesColors[this.seriesIndex]),"function"==typeof r&&(r=r({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:e}));var o=t.fillType?t.fillType:this.getFillType(this.seriesIndex),l=Array.isArray(s.fill.opacity)?s.fill.opacity[this.seriesIndex]:s.fill.opacity;t.color&&(r=t.color);var c=r;if(-1===r.indexOf("rgb")?r.length<9&&(c=b.hexToRgba(r,l)):r.indexOf("rgba")>-1&&(l=b.getOpacityFromRGBA(r)),t.opacity&&(l=t.opacity),"pattern"===o&&(a=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:a,fillColor:r,fillOpacity:l,defaultColor:c})),"gradient"===o&&(n=this.handleGradientFill({fillConfig:t.fillConfig,fillColor:r,fillOpacity:l,i:this.seriesIndex})),"image"===o){var d=s.fill.image.src,h=t.patternID?t.patternID:"";this.clippedImgArea({opacity:l,image:Array.isArray(d)?t.seriesNumber-1&&(p=b.getOpacityFromRGBA(u));var f=void 0===r.gradient.opacityTo?i:Array.isArray(r.gradient.opacityTo)?r.gradient.opacityTo[n]:r.gradient.opacityTo;if(void 0===r.gradient.gradientToColors||0===r.gradient.gradientToColors.length)o="dark"===r.gradient.shade?d.shadeColor(-1*parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e):d.shadeColor(parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e);else if(r.gradient.gradientToColors[l.seriesNumber]){var g=r.gradient.gradientToColors[l.seriesNumber];o=g,g.indexOf("rgba")>-1&&(f=b.getOpacityFromRGBA(g))}else o=e;if(r.gradient.gradientFrom&&(u=r.gradient.gradientFrom),r.gradient.gradientTo&&(o=r.gradient.gradientTo),r.gradient.inverseColors){var m=u;u=o,o=m}return u.indexOf("rgb")>-1&&(u=b.rgb2hex(u)),o.indexOf("rgb")>-1&&(o=b.rgb2hex(o)),c.drawGradient(h,u,o,p,f,l.size,r.gradient.stops,r.gradient.colorStops,n)}}]),t}(),H=function(){function t(e,i){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"setGlobalMarkerSize",value:function(){var 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.length4&&void 0!==arguments[4]&&arguments[4],r=this.w,o=e,l=t,c=null,d=new C(this.ctx),h=r.config.markers.discrete&&r.config.markers.discrete.length;if((r.globals.markers.size[e]>0||s||h)&&(c=d.group({class:s||h?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(r.globals.cuid,")")),Array.isArray(l.x))for(var u=0;u0:r.config.markers.size>0)||s||h){b.isNumber(l.y[u])?f+=" w".concat(b.randomId()):f="apexcharts-nullpoint";var g=this.getMarkerConfig({cssClass:f,seriesIndex:e,dataPointIndex:p});r.config.series[o].data[p]&&(r.config.series[o].data[p].fillColor&&(g.pointFillColor=r.config.series[o].data[p].fillColor),r.config.series[o].data[p].strokeColor&&(g.pointStrokeColor=r.config.series[o].data[p].strokeColor)),a&&(g.pSize=a),(n=d.drawMarker(l.x[u],l.y[u],g)).attr("rel",p),n.attr("j",p),n.attr("index",e),n.node.setAttribute("default-marker-size",g.pSize),new w(this.ctx).setSelectionFilter(n,e,p),this.addEvents(n),c&&c.add(n)}else void 0===r.globals.pointsArray[e]&&(r.globals.pointsArray[e]=[]),r.globals.pointsArray[e].push([l.x[u],l.y[u]])}return c}},{key:"getMarkerConfig",value:function(t){var e=t.cssClass,i=t.seriesIndex,a=t.dataPointIndex,n=void 0===a?null:a,s=t.finishRadius,r=void 0===s?null:s,o=this.w,l=this.getMarkerStyle(i),c=o.globals.markers.size[i],d=o.config.markers;return null!==n&&d.discrete.length&&d.discrete.map((function(t){t.seriesIndex===i&&t.dataPointIndex===n&&(l.pointStrokeColor=t.strokeColor,l.pointFillColor=t.fillColor,c=t.size,l.pointShape=t.shape)})),{pSize:null===r?c:r,pRadius:d.radius,width:Array.isArray(d.width)?d.width[i]:d.width,height:Array.isArray(d.height)?d.height[i]:d.height,pointStrokeWidth:Array.isArray(d.strokeWidth)?d.strokeWidth[i]:d.strokeWidth,pointStrokeColor:l.pointStrokeColor,pointFillColor:l.pointFillColor,shape:l.pointShape||(Array.isArray(d.shape)?d.shape[i]:d.shape),class:e,pointStrokeOpacity:Array.isArray(d.strokeOpacity)?d.strokeOpacity[i]:d.strokeOpacity,pointStrokeDashArray:Array.isArray(d.strokeDashArray)?d.strokeDashArray[i]:d.strokeDashArray,pointFillOpacity:Array.isArray(d.fillOpacity)?d.fillOpacity[i]:d.fillOpacity,seriesIndex:i}}},{key:"addEvents",value:function(t){var e=this.w,i=new C(this.ctx);t.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",i.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",i.pathMouseDown.bind(this.ctx,t),{passive:!0})}},{key:"getMarkerStyle",value:function(t){var e=this.w,i=e.globals.markers.colors,a=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(a)?a[t]:a,pointFillColor:Array.isArray(i)?i[t]:i}}}]),t}(),R=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled}return c(t,[{key:"draw",value:function(t,e,i){var a=this.w,n=new C(this.ctx),s=i.realIndex,r=i.pointsPos,o=i.zRatio,l=i.elParent,c=n.group({class:"apexcharts-series-markers apexcharts-series-".concat(a.config.chart.type)});if(c.attr("clip-path","url(#gridRectMarkerMask".concat(a.globals.cuid,")")),Array.isArray(r.x))for(var d=0;dg.maxBubbleRadius&&(f=g.maxBubbleRadius)}a.config.chart.animations.enabled||(p=f);var m=r.x[d],v=r.y[d];if(p=p||0,null!==v&&void 0!==a.globals.series[s][h]||(u=!1),u){var x=this.drawPoint(m,v,p,f,s,h,e);c.add(x)}l.add(c)}}},{key:"drawPoint",value:function(t,e,i,a,n,s,r){var o=this.w,l=n,c=new y(this.ctx),d=new w(this.ctx),h=new $(this.ctx),u=new H(this.ctx),p=new C(this.ctx),f=u.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:s,finishRadius:"bubble"===o.config.chart.type||o.globals.comboCharts&&o.config.series[n]&&"bubble"===o.config.series[n].type?a:null});a=f.pSize;var g,m=h.fillPath({seriesNumber:n,dataPointIndex:s,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:o.globals.series[n][r]});if("circle"===f.shape?g=p.drawCircle(i):"square"!==f.shape&&"rect"!==f.shape||(g=p.drawRect(0,0,f.width-f.pointStrokeWidth/2,f.height-f.pointStrokeWidth/2,f.pRadius)),o.config.series[l].data[s]&&o.config.series[l].data[s].fillColor&&(m=o.config.series[l].data[s].fillColor),g.attr({x:t-f.width/2-f.pointStrokeWidth/2,y:e-f.height/2-f.pointStrokeWidth/2,cx:t,cy:e,fill:m,"fill-opacity":f.pointFillOpacity,stroke:f.pointStrokeColor,r:a,"stroke-width":f.pointStrokeWidth,"stroke-dasharray":f.pointStrokeDashArray,"stroke-opacity":f.pointStrokeOpacity}),o.config.chart.dropShadow.enabled){var v=o.config.chart.dropShadow;d.dropShadow(g,v,n)}if(!this.initialAnim||o.globals.dataChanged||o.globals.resized)o.globals.animationEnded=!0;else{var x=o.config.chart.animations.speed;c.animateMarker(g,0,"circle"===f.shape?a:{width:f.width,height:f.height},x,o.globals.easing,(function(){window.setTimeout((function(){c.animationCompleted(g)}),100)}))}if(o.globals.dataChanged&&"circle"===f.shape)if(this.dynamicAnim){var b,S,k,A,P=o.config.chart.animations.dynamicAnimation.speed;null!=(A=o.globals.previousPaths[n]&&o.globals.previousPaths[n][r])&&(b=A.x,S=A.y,k=void 0!==A.r?A.r:a);for(var E=0;Eo.globals.gridHeight+h&&(e=o.globals.gridHeight+h/2),void 0===o.globals.dataLabelsRects[a]&&(o.globals.dataLabelsRects[a]=[]),o.globals.dataLabelsRects[a].push({x:t,y:e,width:d,height:h});var u=o.globals.dataLabelsRects[a].length-2,p=void 0!==o.globals.lastDrawnDataLabelsIndexes[a]?o.globals.lastDrawnDataLabelsIndexes[a][o.globals.lastDrawnDataLabelsIndexes[a].length-1]:0;if(void 0!==o.globals.dataLabelsRects[a][u]){var f=o.globals.dataLabelsRects[a][p];(t>f.x+f.width+2||e>f.y+f.height+2||t+de.globals.gridWidth+g.textRects.width+10)&&(o="");var m=e.globals.dataLabels.style.colors[s];(("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[r]),"function"==typeof m&&(m=m({series:e.globals.series,seriesIndex:s,dataPointIndex:r,w:e})),u&&(m=u);var v=h.offsetX,x=h.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(v=0,x=0),g.drawnextLabel){var b=i.drawText({width:100,height:parseInt(h.style.fontSize,10),x:a+v,y:n+x,foreColor:m,textAnchor:l||h.textAnchor,text:o,fontSize:c||h.style.fontSize,fontFamily:h.style.fontFamily,fontWeight:h.style.fontWeight||"normal"});if(b.attr({class:"apexcharts-datalabel",cx:a,cy:n}),h.dropShadow.enabled){var y=h.dropShadow;new w(this.ctx).dropShadow(b,y)}d.add(b),void 0===e.globals.lastDrawnDataLabelsIndexes[s]&&(e.globals.lastDrawnDataLabelsIndexes[s]=[]),e.globals.lastDrawnDataLabelsIndexes[s].push(r)}}}},{key:"addBackgroundToDataLabel",value:function(t,e){var i=this.w,a=i.config.dataLabels.background,n=a.padding,s=a.padding/2,r=e.width,o=e.height,l=new C(this.ctx).drawRect(e.x-n,e.y-s/2,r+2*n,o+s,a.borderRadius,"transparent"===i.config.chart.background?"#fff":i.config.chart.background,a.opacity,a.borderWidth,a.borderColor);return a.dropShadow.enabled&&new w(this.ctx).dropShadow(l,a.dropShadow),l}},{key:"dataLabelsBackground",value:function(){var t=this.w;if("bubble"!==t.config.chart.type)for(var e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),i=0;i0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.w,n=b.clone(a.globals.initialSeries);a.globals.previousPaths=[],i?(a.globals.collapsedSeries=[],a.globals.ancillaryCollapsedSeries=[],a.globals.collapsedSeriesIndices=[],a.globals.ancillaryCollapsedSeriesIndices=[]):n=this.emptyCollapsedSeries(n),a.config.series=n,t&&(e&&(a.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(n,a.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(t){for(var e=this.w,i=0;i-1&&(t[i].data=[]);return t}},{key:"toggleSeriesOnHover",value:function(t,e){var i=this.w;e||(e=t.target);var a=i.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels");if("mousemove"===t.type){var n=parseInt(e.getAttribute("rel"),10)-1,s=null,r=null;i.globals.axisCharts||"radialBar"===i.config.chart.type?i.globals.axisCharts?(s=i.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(n,"']")),r=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(n,"']"))):s=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(n+1,"']")):s=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(n+1,"'] path"));for(var o=0;o=t.from&&a<=t.to&&n[e].classList.remove(i.legendInactiveClass)}}(a.config.plotOptions.heatmap.colorScale.ranges[r])}else"mouseout"===t.type&&s("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"asc",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this.w,a=0;if(i.config.series.length>1)for(var n=i.config.series.map((function(t,a){return t.data&&t.data.length>0&&-1===i.globals.collapsedSeriesIndices.indexOf(a)&&(!i.globals.comboCharts||0===e.length||e.length&&e.indexOf(i.config.series[a].type)>-1)?a:-1})),s="asc"===t?0:n.length-1;"asc"===t?s=0;"asc"===t?s++:s--)if(-1!==n[s]){a=n[s];break}return a}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map((function(t,e){return"bar"===t.type||"column"===t.type?e:-1})).filter((function(t){return-1!==t})):this.w.config.series.map((function(t,e){return e}))}},{key:"getPreviousPaths",value:function(){var t=this.w;function e(e,i,a){for(var n=e[i].childNodes,s={type:a,paths:[],realIndex:e[i].getAttribute("data:realIndex")},r=0;r0)for(var a=function(e){for(var i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(e,"'] rect")),a=[],n=function(t){var e=function(e){return i[t].getAttribute(e)},n={x:parseFloat(e("x")),y:parseFloat(e("y")),width:parseFloat(e("width")),height:parseFloat(e("height"))};a.push({rect:n,color:i[t].getAttribute("color")})},s=0;s0)for(var a=0;a0?t:[]}))}}]),t}(),Y=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new S(this.ctx)}return c(t,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var t=this.w.config.series.slice(),e=new F(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0].x&&null!==t[this.activeSeriesIndex].data[0])return!0}},{key:"isFormat2DArray",value:function(){var t=this.w.config.series.slice(),e=new F(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&void 0!==t[this.activeSeriesIndex].data[0]&&null!==t[this.activeSeriesIndex].data[0]&&t[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(t,e){for(var i=this.w.config,a=this.w.globals,n="boxPlot"===i.chart.type||"boxPlot"===i.series[e].type,s=0;s=5?this.twoDSeries.push(b.parseNumber(t[e].data[s][4])):this.twoDSeries.push(b.parseNumber(t[e].data[s][1])),a.dataFormatXNumeric=!0),"datetime"===i.xaxis.type){var r=new Date(t[e].data[s][0]);r=new Date(r).getTime(),this.twoDSeriesX.push(r)}else this.twoDSeriesX.push(t[e].data[s][0]);for(var o=0;o-1&&(s=this.activeSeriesIndex);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this.ctx,a=this.w.config,n=this.w.globals,s=new L(i),r=a.labels.length>0?a.labels.slice():a.xaxis.categories.slice();n.isRangeBar="rangeBar"===a.chart.type&&n.isBarHorizontal,n.hasGroups="category"===a.xaxis.type&&a.xaxis.group.groups.length>0,n.hasGroups&&(n.groups=a.xaxis.group.groups);for(var o=function(){for(var t=0;t0&&(this.twoDSeriesX=r,n.seriesX.push(this.twoDSeriesX))),n.labels.push(this.twoDSeriesX);var c=t[l].data.map((function(t){return b.parseNumber(t)}));n.series.push(c)}n.seriesZ.push(this.threeDSeries),void 0!==t[l].name?n.seriesNames.push(t[l].name):n.seriesNames.push("series-"+parseInt(l+1,10)),void 0!==t[l].color?n.seriesColors.push(t[l].color):n.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(t){var e=this.w.globals,i=this.w.config;e.series=t.slice(),e.seriesNames=i.labels.slice();for(var a=0;a0?i.labels=e.xaxis.categories:e.labels.length>0?i.labels=e.labels.slice():this.fallbackToCategory?(i.labels=i.labels[0],i.seriesRange.length&&(i.seriesRange.map((function(t){t.forEach((function(t){i.labels.indexOf(t.x)<0&&t.x&&i.labels.push(t.x)}))})),i.labels=i.labels.filter((function(t,e,i){return i.indexOf(t)===e}))),e.xaxis.convertedCatToNumeric&&(new D(e).convertCatToNumericXaxis(e,this.ctx,i.seriesX[0]),this._generateExternalLabels(t))):this._generateExternalLabels(t)}},{key:"_generateExternalLabels",value:function(t){var e=this.w.globals,i=this.w.config,a=[];if(e.axisCharts){if(e.series.length>0)if(this.isFormatXY())for(var n=i.series.map((function(t,e){return t.data.filter((function(t,e,i){return i.findIndex((function(e){return e.x===t.x}))===e}))})),s=n.reduce((function(t,e,i,a){return a[t].length>e.length?t:i}),0),r=0;r0&&i<100?t.toFixed(1):t.toFixed(0)}return e.globals.isBarHorizontal&&e.globals.maxY-e.globals.minYArr<4?t.toFixed(1):t.toFixed(0)}return t},"function"==typeof e.config.tooltip.x.formatter?e.globals.ttKeyFormatter=e.config.tooltip.x.formatter:e.globals.ttKeyFormatter=e.globals.xLabelFormatter,"function"==typeof e.config.xaxis.tooltip.formatter&&(e.globals.xaxisTooltipFormatter=e.config.xaxis.tooltip.formatter),(Array.isArray(e.config.tooltip.y)||void 0!==e.config.tooltip.y.formatter)&&(e.globals.ttVal=e.config.tooltip.y),void 0!==e.config.tooltip.z.formatter&&(e.globals.ttZFormatter=e.config.tooltip.z.formatter),void 0!==e.config.legend.formatter&&(e.globals.legendFormatter=e.config.legend.formatter),e.config.yaxis.forEach((function(i,a){void 0!==i.labels.formatter?e.globals.yLabelFormatters[a]=i.labels.formatter:e.globals.yLabelFormatters[a]=function(n){return e.globals.xyCharts?Array.isArray(n)?n.map((function(e){return t.defaultYFormatter(e,i,a)})):t.defaultYFormatter(n,i,a):n}})),e.globals}},{key:"heatmapLabelFormatters",value:function(){var t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.globals.seriesNames.slice();var e=t.globals.seriesNames.reduce((function(t,e){return t.length>e.length?t:e}),0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}]),t}(),W=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"getLabel",value:function(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"12px",r=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=this.w,l=void 0===t[a]?"":t[a],c=l,d=o.globals.xLabelFormatter,h=o.config.xaxis.labels.formatter,u=!1,p=new B(this.ctx),f=l;r&&(c=p.xLabelFormat(d,l,f,{i:a,dateFormatter:new L(this.ctx).formatDate,w:o}),void 0!==h&&(c=h(l,t[a],{i:a,dateFormatter:new L(this.ctx).formatDate,w:o})));var g=function(t){var i=null;return e.forEach((function(t){"month"===t.unit?i="year":"day"===t.unit?i="month":"hour"===t.unit?i="day":"minute"===t.unit&&(i="hour")})),i===t};e.length>0?(u=g(e[a].unit),i=e[a].position,c=e[a].value):"datetime"===o.config.xaxis.type&&void 0===h&&(c=""),void 0===c&&(c=""),c=Array.isArray(c)?c:c.toString();var m=new C(this.ctx),v={};v=o.globals.rotateXLabels&&r?m.getTextRects(c,parseInt(s,10),null,"rotate(".concat(o.config.xaxis.labels.rotate," 0 0)"),!1):m.getTextRects(c,parseInt(s,10));var x=!o.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(c)&&(0===c.indexOf("NaN")||0===c.toLowerCase().indexOf("invalid")||c.toLowerCase().indexOf("infinity")>=0||n.indexOf(c)>=0&&x)&&(c=""),{x:i,text:c,textRect:v,isBold:u}}},{key:"checkLabelBasedOnTickamount",value:function(t,e,i){var a=this.w,n=a.config.xaxis.tickAmount;return"dataPoints"===n&&(n=Math.round(a.globals.gridWidth/120)),n>i||t%Math.round(i/(n+1))==0||(e.text=""),e}},{key:"checkForOverflowingLabels",value:function(t,e,i,a,n){var s=this.w;if(0===t&&s.globals.skipFirstTimelinelabel&&(e.text=""),t===i-1&&s.globals.skipLastTimelinelabel&&(e.text=""),s.config.xaxis.labels.hideOverlappingLabels&&a.length>0){var r=n[n.length-1];e.x0){!0===o.config.yaxis[n].opposite&&(t+=a.width);for(var d=e;d>=0;d--){var h=c+e/10+o.config.yaxis[n].labels.offsetY-1;o.globals.isBarHorizontal&&(h=s*d),"heatmap"===o.config.chart.type&&(h+=s/2);var u=l.drawLine(t+i.offsetX-a.width+a.offsetX,h+a.offsetY,t+i.offsetX+a.offsetX,h+a.offsetY,a.color);r.add(u),c+=s}}}}]),t}(),V=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"scaleSvgNode",value:function(t,e){var i=parseFloat(t.getAttributeNS(null,"width")),a=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",a*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+a)}},{key:"fixSvgStringForIe11",value:function(t){if(!b.isIE11())return t.replace(/ /g," ");var e=0,i=t.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g,(function(t){return 2==++e?'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev"':t}));return(i=i.replace(/xmlns:NS\d+=""/g,"")).replace(/NS\d+:(\w+:\w+=")/g,"$1")}},{key:"getSvgString",value:function(t){null==t&&(t=1);var e=this.w.globals.dom.Paper.svg();if(1!==t){var i=this.w.globals.dom.Paper.node.cloneNode(!0);this.scaleSvgNode(i,t),e=(new XMLSerializer).serializeToString(i)}return this.fixSvgStringForIe11(e)}},{key:"cleanup",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),i=t.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(a,(function(t){t.setAttribute("width",0)})),e&&e[0]&&(e[0].setAttribute("x",-500),e[0].setAttribute("x1",-500),e[0].setAttribute("x2",-500)),i&&i[0]&&(i[0].setAttribute("y",-100),i[0].setAttribute("y1",-100),i[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){this.cleanup();var t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}},{key:"dataURI",value:function(t){var e=this;return new Promise((function(i){var a=e.w,n=t?t.scale||t.width/a.globals.svgWidth:1;e.cleanup();var s=document.createElement("canvas");s.width=a.globals.svgWidth*n,s.height=parseInt(a.globals.dom.elWrap.style.height,10)*n;var r="transparent"===a.config.chart.background?"#fff":a.config.chart.background,o=s.getContext("2d");o.fillStyle=r,o.fillRect(0,0,s.width*n,s.height*n);var l=e.getSvgString(n);if(window.canvg&&b.isIE11()){var c=window.canvg.Canvg.fromString(o,l,{ignoreClear:!0,ignoreDimensions:!0});c.start();var d=s.msToBlob();c.stop(),i({blob:d})}else{var h="data:image/svg+xml,"+encodeURIComponent(l),u=new Image;u.crossOrigin="anonymous",u.onload=function(){if(o.drawImage(u,0,0),s.msToBlob){var t=s.msToBlob();i({blob:t})}else{var e=s.toDataURL("image/png");i({imgURI:e})}},u.src=h}}))}},{key:"exportToSVG",value:function(){this.triggerDownload(this.svgUrl(),this.w.config.chart.toolbar.export.svg.filename,".svg")}},{key:"exportToPng",value:function(){var t=this;this.dataURI().then((function(e){var i=e.imgURI,a=e.blob;a?navigator.msSaveOrOpenBlob(a,t.w.globals.chartID+".png"):t.triggerDownload(i,t.w.config.chart.toolbar.export.png.filename,".png")}))}},{key:"exportToCSV",value:function(t){var e=this,i=t.series,a=t.fileName,n=t.columnDelimiter,s=void 0===n?",":n,r=t.lineDelimiter,o=void 0===r?"\n":r,l=this.w;i||(i=l.config.series);var c=[],d=[],h="",u=l.globals.series.map((function(t,e){return-1===l.globals.collapsedSeriesIndices.indexOf(e)?t:[]})),p=Math.max.apply(Math,m(i.map((function(t){return t.data?t.data.length:0})))),f=new Y(this.ctx),g=new W(this.ctx),v=function(t){var i="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){var a=l.globals.yLabelFormatters[0],n=new F(e.ctx).getActiveConfigSeriesIndex();i=a(l.globals.labels[t],{seriesIndex:n,dataPointIndex:t,w:l})}else i=g.getLabel(l.globals.labels,l.globals.timescaleLabels,0,t).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?i=l.config.xaxis.categories[t]:l.config.labels.length&&(i=l.config.labels[t]))}else i=l.config.labels[t];return Array.isArray(i)&&(i=i.join(" ")),b.isNumber(i)?i:i.split(s).join("")};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):i.map((function(t,e){var i=t.name?t.name:"series-".concat(e);l.globals.axisCharts&&c.push(i.split(s).join("")?i.split(s).join(""):"series-".concat(e))})),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),d.push(c.join(s))),i.map((function(t,e){l.globals.axisCharts?function(t,e){if(c.length&&0===e&&d.push(c.join(s)),t.data){t.data=t.data.length&&t.data||m(Array(p)).map((function(){return""}));for(var a=0;a=10?l.config.chart.toolbar.export.csv.dateFormatter(n):b.isNumber(n)?n:n.split(s).join("")));for(var r=0;r0&&!a.globals.isBarHorizontal&&(this.xaxisLabels=a.globals.timescaleLabels.slice()),a.config.xaxis.overwriteCategories&&(this.xaxisLabels=a.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===a.config.xaxis.position?this.offY=0:this.offY=a.globals.gridHeight+1,this.offY=this.offY+a.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===a.config.chart.type&&a.config.plotOptions.bar.horizontal,this.xaxisFontSize=a.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=a.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=a.config.xaxis.labels.style.colors,this.xaxisBorderWidth=a.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=a.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=a.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=a.config.xaxis.axisBorder.height,this.yaxis=a.config.yaxis[0]}return c(t,[{key:"drawXaxis",value:function(){var t=this.w,e=new C(this.ctx),i=e.group({class:"apexcharts-xaxis",transform:"translate(".concat(t.config.xaxis.offsetX,", ").concat(t.config.xaxis.offsetY,")")}),a=e.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(t.globals.translateXAxisX,", ").concat(t.globals.translateXAxisY,")")});i.add(a);for(var n=[],s=0;s6&&void 0!==arguments[6]?arguments[6]:{},c=[],d=[],h=this.w,u=l.xaxisFontSize||this.xaxisFontSize,p=l.xaxisFontFamily||this.xaxisFontFamily,f=l.xaxisForeColors||this.xaxisForeColors,g=l.fontWeight||h.config.xaxis.labels.style.fontWeight,m=l.cssClass||h.config.xaxis.labels.style.cssClass,v=h.globals.padHorizontal,x=a.length,b="category"===h.config.xaxis.type?h.globals.dataPoints:x;if(0===b&&x>b&&(b=x),n){var y=b>1?b-1:b;r=h.globals.gridWidth/y,v=v+s(0,r)/2+h.config.xaxis.labels.offsetX}else r=h.globals.gridWidth/b,v=v+s(0,r)+h.config.xaxis.labels.offsetX;for(var w=function(n){var l=v-s(n,r)/2+h.config.xaxis.labels.offsetX;0===n&&1===x&&r/2===v&&1===b&&(l=h.globals.gridWidth/2);var y=o.axesUtils.getLabel(a,h.globals.timescaleLabels,l,n,c,u,t),w=28;if(h.globals.rotateXLabels&&t&&(w=22),h.config.xaxis.title.text&&"top"===h.config.xaxis.position&&(w+=parseFloat(h.config.xaxis.title.style.fontSize)+2),t||(w=w+parseFloat(u)+(h.globals.xAxisLabelsHeight-h.globals.xAxisGroupLabelsHeight)+(h.globals.rotateXLabels?10:0)),y=void 0!==h.config.xaxis.tickAmount&&"dataPoints"!==h.config.xaxis.tickAmount&&"datetime"!==h.config.xaxis.type?o.axesUtils.checkLabelBasedOnTickamount(n,y,x):o.axesUtils.checkForOverflowingLabels(n,y,x,c,d),t&&y.text&&h.globals.xaxisLabelsCount++,h.config.xaxis.labels.show){var C=e.drawText({x:y.x,y:o.offY+h.config.xaxis.labels.offsetY+w-("top"===h.config.xaxis.position?h.globals.xAxisHeight+h.config.xaxis.axisTicks.height-2:0),text:y.text,textAnchor:"middle",fontWeight:y.isBold?600:g,fontSize:u,fontFamily:p,foreColor:Array.isArray(f)?t&&h.config.xaxis.convertedCatToNumeric?f[h.globals.minX+n-1]:f[n]:f,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+m});if(i.add(C),C.on("click",(function(t){if("function"==typeof h.config.chart.events.xAxisLabelClick){var e=Object.assign({},h,{labelIndex:n});h.config.chart.events.xAxisLabelClick(t,o.ctx,e)}})),t){var S=document.createElementNS(h.globals.SVGNS,"title");S.textContent=Array.isArray(y.text)?y.text.join(" "):y.text,C.node.appendChild(S),""!==y.text&&(c.push(y.text),d.push(y))}}na.globals.gridWidth)){var s=this.offY+a.config.xaxis.axisTicks.offsetY;if(e=e+s+a.config.xaxis.axisTicks.height,"top"===a.config.xaxis.position&&(e=s-a.config.xaxis.axisTicks.height),a.config.xaxis.axisTicks.show){var r=new C(this.ctx).drawLine(t+a.config.xaxis.axisTicks.offsetX,s+a.config.xaxis.offsetY,n+a.config.xaxis.axisTicks.offsetX,e+a.config.xaxis.offsetY,a.config.xaxis.axisTicks.color);i.add(r),r.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var t=this.w,e=[],i=this.xaxisLabels.length,a=t.globals.padHorizontal;if(t.globals.timescaleLabels.length>0)for(var n=0;n0){var c=n[n.length-1].getBBox(),d=n[0].getBBox();c.x<-20&&n[n.length-1].parentNode.removeChild(n[n.length-1]),d.x+d.width>t.globals.gridWidth&&!t.globals.isBarHorizontal&&n[0].parentNode.removeChild(n[0]);for(var h=0;h0&&(this.xaxisLabels=i.globals.timescaleLabels.slice())}return c(t,[{key:"drawGridArea",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.w,i=new C(this.ctx);null===t&&(t=i.group({class:"apexcharts-grid"}));var a=i.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.globals.gridHeight,"transparent"),n=i.drawLine(e.globals.padHorizontal,e.globals.gridHeight,e.globals.gridWidth,e.globals.gridHeight,"transparent");return t.add(n),t.add(a),t}},{key:"drawGrid",value:function(){var t=null;return this.w.globals.axisCharts&&(t=this.renderGrid(),this.drawGridArea(t.el)),t}},{key:"createGridMask",value:function(){var t=this.w,e=t.globals,i=new C(this.ctx),a=Array.isArray(t.config.stroke.width)?0:t.config.stroke.width;if(Array.isArray(t.config.stroke.width)){var n=0;t.config.stroke.width.forEach((function(t){n=Math.max(n,t)})),a=n}e.dom.elGridRectMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elGridRectMask.setAttribute("id","gridRectMask".concat(e.cuid)),e.dom.elGridRectMarkerMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elGridRectMarkerMask.setAttribute("id","gridRectMarkerMask".concat(e.cuid)),e.dom.elForecastMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elForecastMask.setAttribute("id","forecastMask".concat(e.cuid)),e.dom.elNonForecastMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elNonForecastMask.setAttribute("id","nonForecastMask".concat(e.cuid));var s=t.config.chart.type,r=0,o=0;("bar"===s||"rangeBar"===s||"candlestick"===s||"boxPlot"===s||t.globals.comboBarCount>0)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(r=t.config.grid.padding.left,o=t.config.grid.padding.right,e.barPadForNumericAxis>r&&(r=e.barPadForNumericAxis,o=e.barPadForNumericAxis)),e.dom.elGridRect=i.drawRect(-a/2-r-2,-a/2,e.gridWidth+a+o+r+4,e.gridHeight+a,0,"#fff");var l=t.globals.markers.largestSize+1;e.dom.elGridRectMarker=i.drawRect(2*-l,2*-l,e.gridWidth+4*l,e.gridHeight+4*l,0,"#fff"),e.dom.elGridRectMask.appendChild(e.dom.elGridRect.node),e.dom.elGridRectMarkerMask.appendChild(e.dom.elGridRectMarker.node);var c=e.dom.baseEl.querySelector("defs");c.appendChild(e.dom.elGridRectMask),c.appendChild(e.dom.elForecastMask),c.appendChild(e.dom.elNonForecastMask),c.appendChild(e.dom.elGridRectMarkerMask)}},{key:"_drawGridLines",value:function(t){var e=t.i,i=t.x1,a=t.y1,n=t.x2,s=t.y2,r=t.xCount,o=t.parent,l=this.w;if(!(0===e&&l.globals.skipFirstTimelinelabel||e===r-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({i:e,x1:i,y1:a,x2:n,y2:s,xCount:r,parent:o});var c=0;if(l.globals.hasGroups&&"between"===l.config.xaxis.tickPlacement){var d=l.globals.groups;if(d){for(var h=0,u=0;h2));n++);return!t.globals.isBarHorizontal||this.isRangeBar?(i=this.xaxisLabels.length,this.isRangeBar&&(a=t.globals.labels.length,t.config.xaxis.tickAmount&&t.config.xaxis.labels.formatter&&(i=t.config.xaxis.tickAmount)),this._drawXYLines({xCount:i,tickAmount:a})):(i=a,a=t.globals.xTickAmount,this._drawInvertedXYLines({xCount:i,tickAmount:a})),this.drawGridBands(i,a),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:t.globals.gridWidth/i}}},{key:"drawGridBands",value:function(t,e){var i=this.w;if(void 0!==i.config.grid.row.colors&&i.config.grid.row.colors.length>0)for(var a=0,n=i.globals.gridHeight/e,s=i.globals.gridWidth,r=0,o=0;r=i.config.grid.row.colors.length&&(o=0),this._drawGridBandRect({c:o,x1:0,y1:a,x2:s,y2:n,type:"row"}),a+=i.globals.gridHeight/e;if(void 0!==i.config.grid.column.colors&&i.config.grid.column.colors.length>0)for(var l=i.globals.isBarHorizontal||"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric?t:t-1,c=i.globals.padHorizontal,d=i.globals.padHorizontal+i.globals.gridWidth/l,h=i.globals.gridHeight,u=0,p=0;u=i.config.grid.column.colors.length&&(p=0),this._drawGridBandRect({c:p,x1:c,y1:0,x2:d,y2:h,type:"column"}),c+=i.globals.gridWidth/l}}]),t}(),q=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"niceScale",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0,s=this.w,r=Math.abs(e-t);if("dataPoints"===(i=this._adjustTicksForSmallRange(i,a,r))&&(i=s.globals.dataPoints-1),t===Number.MIN_VALUE&&0===e||!b.isNumber(t)&&!b.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)return t=0,e=i,this.linearScale(t,e,i);t>e?(console.warn("axis.min cannot be greater than axis.max"),e=t+.1):t===e&&(t=0===t?0:t-.5,e=0===e?2:e+.5);var o=[];r<1&&n&&("candlestick"===s.config.chart.type||"candlestick"===s.config.series[a].type||"boxPlot"===s.config.chart.type||"boxPlot"===s.config.series[a].type||s.globals.isRangeData)&&(e*=1.01);var l=i+1;l<2?l=2:l>2&&(l-=2);var c=r/l,d=Math.floor(b.log10(c)),h=Math.pow(10,d),u=Math.round(c/h);u<1&&(u=1);var p=u*h,f=p*Math.floor(t/p),g=p*Math.ceil(e/p),m=f;if(n&&r>2){for(;o.push(m),!((m+=p)>g););return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}var v=t;(o=[]).push(v);for(var x=Math.abs(e-t)/i,y=0;y<=i;y++)v+=x,o.push(v);return o[o.length-2]>=e&&o.pop(),{result:o,niceMin:o[0],niceMax:o[o.length-1]}}},{key:"linearScale",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3?arguments[3]:void 0,n=Math.abs(e-t);"dataPoints"===(i=this._adjustTicksForSmallRange(i,a,n))&&(i=this.w.globals.dataPoints-1);var s=n/i;i===Number.MAX_VALUE&&(i=10,s=1);for(var r=[],o=t;i>=0;)r.push(o),o+=s,i-=1;return{result:r,niceMin:r[0],niceMax:r[r.length-1]}}},{key:"logarithmicScaleNice",value:function(t,e,i){e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i));for(var a=[],n=Math.ceil(Math.log(e)/Math.log(i)+1),s=Math.floor(Math.log(t)/Math.log(i));s5)a.allSeriesCollapsed=!1,a.yAxisScale[t]=this.logarithmicScale(e,i,s.logBase),a.yAxisScale[t]=s.forceNiceScale?this.logarithmicScaleNice(e,i,s.logBase):this.logarithmicScale(e,i,s.logBase);else if(i!==-Number.MAX_VALUE&&b.isNumber(i))if(a.allSeriesCollapsed=!1,void 0===s.min&&void 0===s.max||s.forceNiceScale){var o=void 0===n.yaxis[t].max&&void 0===n.yaxis[t].min||n.yaxis[t].forceNiceScale;a.yAxisScale[t]=this.niceScale(e,i,s.tickAmount?s.tickAmount:r<5&&r>1?r+1:5,t,o)}else a.yAxisScale[t]=this.linearScale(e,i,s.tickAmount,t);else a.yAxisScale[t]=this.linearScale(0,5,5)}},{key:"setXScale",value:function(t,e){var i=this.w,a=i.globals,n=i.config.xaxis,s=Math.abs(e-t);return e!==-Number.MAX_VALUE&&b.isNumber(e)?a.xAxisScale=this.linearScale(t,e,n.tickAmount?n.tickAmount:s<5&&s>1?s+1:5,0):a.xAxisScale=this.linearScale(0,5,5),a.xAxisScale}},{key:"setMultipleYScales",value:function(){var t=this,e=this.w.globals,i=this.w.config,a=e.minYArr.concat([]),n=e.maxYArr.concat([]),s=[];i.yaxis.forEach((function(e,r){var o=r;i.series.forEach((function(t,i){t.name===e.seriesName&&(o=i,r!==i?s.push({index:i,similarIndex:r,alreadyExists:!0}):s.push({index:i}))}));var l=a[o],c=n[o];t.setYScaleForIndex(r,l,c)})),this.sameScaleInMultipleAxes(a,n,s)}},{key:"sameScaleInMultipleAxes",value:function(t,e,i){var a=this,n=this.w.config,s=this.w.globals,r=[];i.forEach((function(t){t.alreadyExists&&(void 0===r[t.index]&&(r[t.index]=[]),r[t.index].push(t.index),r[t.index].push(t.similarIndex))})),s.yAxisSameScaleIndices=r,r.forEach((function(t,e){r.forEach((function(i,a){var n,s;e!==a&&(n=t,s=i,n.filter((function(t){return-1!==s.indexOf(t)}))).length>0&&(r[e]=r[e].concat(r[a]))}))}));var o=r.map((function(t){return t.filter((function(e,i){return t.indexOf(e)===i}))})).map((function(t){return t.sort()}));r=r.filter((function(t){return!!t}));var l=o.slice(),c=l.map((function(t){return JSON.stringify(t)}));l=l.filter((function(t,e){return c.indexOf(JSON.stringify(t))===e}));var d=[],h=[];t.forEach((function(t,i){l.forEach((function(a,n){a.indexOf(i)>-1&&(void 0===d[n]&&(d[n]=[],h[n]=[]),d[n].push({key:i,value:t}),h[n].push({key:i,value:e[i]}))}))}));var u=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,Number.MIN_VALUE),p=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,-Number.MAX_VALUE);d.forEach((function(t,e){t.forEach((function(t,i){u[e]=Math.min(t.value,u[e])}))})),h.forEach((function(t,e){t.forEach((function(t,i){p[e]=Math.max(t.value,p[e])}))})),t.forEach((function(t,e){h.forEach((function(t,i){var r=u[i],o=p[i];n.chart.stacked&&(o=0,t.forEach((function(t,e){t.value!==-Number.MAX_VALUE&&(o+=t.value),r!==Number.MIN_VALUE&&(r+=d[i][e].value)}))),t.forEach((function(i,l){t[l].key===e&&(void 0!==n.yaxis[e].min&&(r="function"==typeof n.yaxis[e].min?n.yaxis[e].min(s.minY):n.yaxis[e].min),void 0!==n.yaxis[e].max&&(o="function"==typeof n.yaxis[e].max?n.yaxis[e].max(s.maxY):n.yaxis[e].max),a.setYScaleForIndex(e,r,o))}))}))}))}},{key:"autoScaleY",value:function(t,e,i){t||(t=this);var a=t.w;if(a.globals.isMultipleYAxis||a.globals.collapsedSeries.length)return console.warn("autoScaleYaxis is not supported in a multi-yaxis chart."),e;var n=a.globals.seriesX[0],s=a.config.chart.stacked;return e.forEach((function(t,r){for(var o=0,l=0;l=i.xaxis.min){o=l;break}var c,d,h=a.globals.minYArr[r],u=a.globals.maxYArr[r],p=a.globals.stackedSeriesTotals;a.globals.series.forEach((function(r,l){var f=r[o];s?(f=p[o],c=d=f,p.forEach((function(t,e){n[e]<=i.xaxis.max&&n[e]>=i.xaxis.min&&(t>d&&null!==t&&(d=t),r[e]=i.xaxis.min){var s=t,r=t;a.globals.series.forEach((function(i,a){null!==t&&(s=Math.min(i[e],s),r=Math.max(i[e],r))})),r>d&&null!==r&&(d=r),sh&&(c=h),e.length>1?(e[l].min=void 0===t.min?c:t.min,e[l].max=void 0===t.max?d:t.max):(e[0].min=void 0===t.min?c:t.min,e[0].max=void 0===t.max?d:t.max)}))})),e}}]),t}(),Z=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.scales=new q(e)}return c(t,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-Number.MAX_VALUE,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this.w.config,s=this.w.globals,r=-Number.MAX_VALUE,o=Number.MIN_VALUE;null===a&&(a=t+1);var l=s.series,c=l,d=l;"candlestick"===n.chart.type?(c=s.seriesCandleL,d=s.seriesCandleH):"boxPlot"===n.chart.type?(c=s.seriesCandleO,d=s.seriesCandleC):s.isRangeData&&(c=s.seriesRangeStart,d=s.seriesRangeEnd);for(var h=t;hc[h][u]&&c[h][u]<0&&(o=c[h][u])):s.hasNullValues=!0}}return"rangeBar"===n.chart.type&&s.seriesRangeStart.length&&s.isBarHorizontal&&(o=e),"bar"===n.chart.type&&(o<0&&r<0&&(r=0),o===Number.MIN_VALUE&&(o=0)),{minY:o,maxY:r,lowestY:e,highestY:i}}},{key:"setYRange",value:function(){var t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;var i=Number.MAX_VALUE;if(t.isMultipleYAxis)for(var a=0;a=0&&i<=10||void 0!==e.yaxis[0].min||void 0!==e.yaxis[0].max)&&(r=0),t.minY=i-5*r/100,i>0&&t.minY<0&&(t.minY=0),t.maxY=t.maxY+5*r/100}return e.yaxis.forEach((function(e,i){void 0!==e.max&&("number"==typeof e.max?t.maxYArr[i]=e.max:"function"==typeof e.max&&(t.maxYArr[i]=e.max(t.isMultipleYAxis?t.maxYArr[i]:t.maxY)),t.maxY=t.maxYArr[i]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[i]=e.min:"function"==typeof e.min&&(t.minYArr[i]=e.min(t.isMultipleYAxis?t.minYArr[i]===Number.MIN_VALUE?0:t.minYArr[i]:t.minY)),t.minY=t.minYArr[i])})),t.isBarHorizontal&&["min","max"].forEach((function(i){void 0!==e.xaxis[i]&&"number"==typeof e.xaxis[i]&&("min"===i?t.minY=e.xaxis[i]:t.maxY=e.xaxis[i])})),t.isMultipleYAxis?(this.scales.setMultipleYScales(),t.minY=i,t.yAxisScale.forEach((function(e,i){t.minYArr[i]=e.niceMin,t.maxYArr[i]=e.niceMax}))):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.yAxisScale[0].niceMin,t.maxYArr[0]=t.yAxisScale[0].niceMax),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}},{key:"setXRange",value:function(){var t=this.w.globals,e=this.w.config,i="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!t.noLabelsProvided||t.noLabelsProvided||t.isXNumeric;if(t.isXNumeric&&function(){for(var e=0;et.dataPoints&&0!==t.dataPoints&&(a=t.dataPoints-1)):"dataPoints"===e.xaxis.tickAmount?(t.series.length>1&&(a=t.series[t.maxValsInArrayIndex].length-1),t.isXNumeric&&(a=t.maxX-t.minX-1)):a=e.xaxis.tickAmount,t.xTickAmount=a,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&&!t.dataFormatXNumeric){for(var n=[],s=t.minX-1;s0&&(t.xAxisScale=this.scales.linearScale(1,t.labels.length,a-1),t.seriesX=t.labels.slice());i&&(t.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&t.labels.length&&(t.xTickAmount=t.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}},{key:"setZRange",value:function(){var t=this.w.globals;if(t.isDataXYZ)for(var e=0;e0){var n=e-a[i-1];n>0&&(t.minXDiff=Math.min(n,t.minXDiff))}})),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}))}},{key:"_setStackedMinMax",value:function(){var t=this.w.globals,e=[],i=[];if(t.series.length)for(var a=0;a0?n=n+parseFloat(t.series[r][a])+1e-4:s+=parseFloat(t.series[r][a])),r===t.series.length-1&&(e.push(n),i.push(s));for(var o=0;o=0;v--)m(v);if(void 0!==i.config.yaxis[t].title.text){var x=a.group({class:"apexcharts-yaxis-title"}),b=0;i.config.yaxis[t].opposite&&(b=i.globals.translateYAxisX[t]);var y=a.drawText({x:b,y:i.globals.gridHeight/2+i.globals.translateY+i.config.yaxis[t].title.offsetY,text:i.config.yaxis[t].title.text,textAnchor:"end",foreColor:i.config.yaxis[t].title.style.color,fontSize:i.config.yaxis[t].title.style.fontSize,fontWeight:i.config.yaxis[t].title.style.fontWeight,fontFamily:i.config.yaxis[t].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+i.config.yaxis[t].title.style.cssClass});x.add(y),l.add(x)}var w=i.config.yaxis[t].axisBorder,S=31+w.offsetX;if(i.config.yaxis[t].opposite&&(S=-31-w.offsetX),w.show){var k=a.drawLine(S,i.globals.translateY+w.offsetY-2,S,i.globals.gridHeight+i.globals.translateY+w.offsetY+2,w.color,0,w.width);l.add(k)}return i.config.yaxis[t].axisTicks.show&&this.axesUtils.drawYAxisTicks(S,d,w,i.config.yaxis[t].axisTicks,t,h,l),l}},{key:"drawYaxisInversed",value:function(t){var e=this.w,i=new C(this.ctx),a=i.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),n=i.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});a.add(n);var s=e.globals.yAxisScale[t].result.length-1,r=e.globals.gridWidth/s+.1,o=r+e.config.xaxis.labels.offsetX,l=e.globals.xLabelFormatter,c=e.globals.yAxisScale[t].result.slice(),d=e.globals.timescaleLabels;d.length>0&&(this.xaxisLabels=d.slice(),s=(c=d.slice()).length),c=this.axesUtils.checkForReversedLabels(t,c);var h=d.length;if(e.config.xaxis.labels.show)for(var u=h?0:s;h?u=0;h?u++:u--){var p=c[u];p=l(p,u,e);var f=e.globals.gridWidth+e.globals.padHorizontal-(o-r+e.config.xaxis.labels.offsetX);if(d.length){var g=this.axesUtils.getLabel(c,d,f,u,this.drawnLabels,this.xaxisFontSize);f=g.x,p=g.text,this.drawnLabels.push(g.text),0===u&&e.globals.skipFirstTimelinelabel&&(p=""),u===c.length-1&&e.globals.skipLastTimelinelabel&&(p="")}var m=i.drawText({x:f,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:p,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label "+e.config.xaxis.labels.style.cssClass});n.add(m),m.tspan(p);var v=document.createElementNS(e.globals.SVGNS,"title");v.textContent=p,m.node.appendChild(v),o+=r}return this.inversedYAxisTitleText(a),this.inversedYAxisBorder(a),a}},{key:"inversedYAxisBorder",value:function(t){var e=this.w,i=new C(this.ctx),a=e.config.xaxis.axisBorder;if(a.show){var n=0;"bar"===e.config.chart.type&&e.globals.isXNumeric&&(n-=15);var s=i.drawLine(e.globals.padHorizontal+n+a.offsetX,this.xAxisoffX,e.globals.gridWidth,this.xAxisoffX,a.color,0,a.height);this.elgrid&&this.elgrid.elGridBorders?this.elgrid.elGridBorders.add(s):t.add(s)}}},{key:"inversedYAxisTitleText",value:function(t){var e=this.w,i=new C(this.ctx);if(void 0!==e.config.xaxis.title.text){var a=i.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),n=i.drawText({x:e.globals.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});a.add(n),t.add(a)}}},{key:"yAxisTitleRotate",value:function(t,e){var i=this.w,a=new C(this.ctx),n={width:0,height:0},s={width:0,height:0},r=i.globals.dom.baseEl.querySelector(" .apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-texts-g"));null!==r&&(n=r.getBoundingClientRect());var o=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-title text"));if(null!==o&&(s=o.getBoundingClientRect()),null!==o){var l=this.xPaddingForYAxisTitle(t,n,s,e);o.setAttribute("x",l.xPos-(e?10:0))}if(null!==o){var c=a.rotateAroundCenter(o);o.setAttribute("transform","rotate(".concat(e?-1*i.config.yaxis[t].title.rotate:i.config.yaxis[t].title.rotate," ").concat(c.x," ").concat(c.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(t,e,i,a){var n=this.w,s=0,r=0,o=10;return void 0===n.config.yaxis[t].title.text||t<0?{xPos:r,padd:0}:(a?(r=e.width+n.config.yaxis[t].title.offsetX+i.width/2+o/2,0===(s+=1)&&(r-=o/2)):(r=-1*e.width+n.config.yaxis[t].title.offsetX+o/2+i.width/2,n.globals.isBarHorizontal&&(o=25,r=-1*e.width-n.config.yaxis[t].title.offsetX-o)),{xPos:r,padd:o})}},{key:"setYAxisXPosition",value:function(t,e){var i=this.w,a=0,n=0,s=18,r=1;i.config.yaxis.length>1&&(this.multipleYs=!0),i.config.yaxis.map((function(o,l){var c=i.globals.ignoreYAxisIndexes.indexOf(l)>-1||!o.show||o.floating||0===t[l].width,d=t[l].width+e[l].width;o.opposite?i.globals.isBarHorizontal?(n=i.globals.gridWidth+i.globals.translateX-1,i.globals.translateYAxisX[l]=n-o.labels.offsetX):(n=i.globals.gridWidth+i.globals.translateX+r,c||(r=r+d+20),i.globals.translateYAxisX[l]=n-o.labels.offsetX+20):(a=i.globals.translateX-s,c||(s=s+d+20),i.globals.translateYAxisX[l]=a+o.labels.offsetX)}))}},{key:"setYAxisTextAlignments",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis");(e=b.listToArray(e)).forEach((function(e,i){var a=t.config.yaxis[i];if(a&&void 0!==a.labels.align){var n=t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-texts-g")),s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-label"));s=b.listToArray(s);var r=n.getBoundingClientRect();"left"===a.labels.align?(s.forEach((function(t,e){t.setAttribute("text-anchor","start")})),a.opposite||n.setAttribute("transform","translate(-".concat(r.width,", 0)"))):"center"===a.labels.align?(s.forEach((function(t,e){t.setAttribute("text-anchor","middle")})),n.setAttribute("transform","translate(".concat(r.width/2*(a.opposite?1:-1),", 0)"))):"right"===a.labels.align&&(s.forEach((function(t,e){t.setAttribute("text-anchor","end")})),a.opposite&&n.setAttribute("transform","translate(".concat(r.width,", 0)")))}}))}}]),t}(),Q=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.documentEvent=b.bind(this.documentEvent,this)}return c(t,[{key:"addEventListener",value:function(t,e){var i=this.w;i.globals.events.hasOwnProperty(t)?i.globals.events[t].push(e):i.globals.events[t]=[e]}},{key:"removeEventListener",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){var a=i.globals.events[t].indexOf(e);-1!==a&&i.globals.events[t].splice(a,1)}}},{key:"fireEvent",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){e&&e.length||(e=[]);for(var a=i.globals.events[t],n=a.length,s=0;s0&&(e=this.w.config.chart.locales.concat(window.Apex.chart.locales));var i=e.filter((function(e){return e.name===t}))[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var a=b.extend(T,i);this.w.globals.locale=a.options}}]),t}(),tt=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"drawAxis",value:function(t,e){var i,a,n=this.w.globals,s=this.w.config,r=new G(this.ctx,e),o=new K(this.ctx,e);n.axisCharts&&"radar"!==t&&(n.isBarHorizontal?(a=o.drawYaxisInversed(0),i=r.drawXaxisInversed(0),n.dom.elGraphical.add(i),n.dom.elGraphical.add(a)):(i=r.drawXaxis(),n.dom.elGraphical.add(i),s.yaxis.map((function(t,e){-1===n.ignoreYAxisIndexes.indexOf(e)&&(a=o.drawYaxis(e),n.dom.Paper.add(a))}))))}}]),t}(),et=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"drawXCrosshairs",value:function(){var t=this.w,e=new C(this.ctx),i=new w(this.ctx),a=t.config.xaxis.crosshairs.fill.gradient,n=t.config.xaxis.crosshairs.dropShadow,s=t.config.xaxis.crosshairs.fill.type,r=a.colorFrom,o=a.colorTo,l=a.opacityFrom,c=a.opacityTo,d=a.stops,h=n.enabled,u=n.left,p=n.top,f=n.blur,g=n.color,m=n.opacity,v=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===s&&(v=e.drawGradient("vertical",r,o,l,c,null,d,null));var x=e.drawRect();1===t.config.xaxis.crosshairs.width&&(x=e.drawLine());var y=t.globals.gridHeight;(!b.isNumber(y)||y<0)&&(y=0);var S=t.config.xaxis.crosshairs.width;(!b.isNumber(S)||S<0)&&(S=0),x.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:y,width:S,height:y,fill:v,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}),h&&(x=i.dropShadow(x,{left:u,top:p,blur:f,color:g,opacity:m})),t.globals.dom.elGraphical.add(x)}}},{key:"drawYCrosshairs",value:function(){var t=this.w,e=new C(this.ctx),i=t.config.yaxis[0].crosshairs,a=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){var n=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,i.stroke.dashArray,i.stroke.width);n.attr({class:"apexcharts-ycrosshairs"}),t.globals.dom.elGraphical.add(n)}var s=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,0,0);s.attr({class:"apexcharts-ycrosshairs-hidden"}),t.globals.dom.elGraphical.add(s)}}]),t}(),it=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"checkResponsiveConfig",value:function(t){var e=this,i=this.w,a=i.config;if(0!==a.responsive.length){var n=a.responsive.slice();n.sort((function(t,e){return t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0})).reverse();var s=new z({}),r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=n[0].breakpoint,r=window.innerWidth>0?window.innerWidth:screen.width;if(r>a){var o=S.extendArrayProps(s,i.globals.initialConfig,i);t=b.extend(o,t),t=b.extend(i.config,t),e.overrideResponsiveOptions(t)}else for(var l=0;l0&&"function"==typeof e.config.colors[0]&&(e.globals.colors=e.config.series.map((function(i,a){var n=e.config.colors[a];return n||(n=e.config.colors[0]),"function"==typeof n?(t.isColorFn=!0,n({value:e.globals.axisCharts?e.globals.series[a][0]?e.globals.series[a][0]:0:e.globals.series[a],seriesIndex:a,dataPointIndex:a,w:e})):n})))),e.globals.seriesColors.map((function(t,i){t&&(e.globals.colors[i]=t)})),e.config.theme.monochrome.enabled){var a=[],n=e.globals.series.length;(this.isBarDistributed||this.isHeatmapDistributed)&&(n=e.globals.series[0].length*e.globals.series.length);for(var s=e.config.theme.monochrome.color,r=1/(n/e.config.theme.monochrome.shadeIntensity),o=e.config.theme.monochrome.shadeTo,l=0,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,n=e||a.globals.series.length;if(null===i&&(i=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===a.config.chart.type&&a.config.plotOptions.heatmap.colorScale.inverse),i&&a.globals.series.length&&(n=a.globals.series[a.globals.maxValsInArrayIndex].length*a.globals.series.length),t.lengtht.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getLargestStringFromMultiArr",value:function(t,e){var i=t;if(this.w.globals.isMultiLineX){var a=e.map((function(t,e){return Array.isArray(t)?t.length:1})),n=Math.max.apply(Math,m(a));i=e[a.indexOf(n)]}return i}}]),t}(),rt=function(){function t(e){o(this,t),this.w=e.w,this.dCtx=e}return c(t,[{key:"getxAxisLabelsCoords",value:function(){var t,e=this.w,i=e.globals.labels.slice();if(e.config.xaxis.convertedCatToNumeric&&0===i.length&&(i=e.globals.categoryLabels),e.globals.timescaleLabels.length>0){var a=this.getxAxisTimeScaleLabelsCoords();t={width:a.width,height:a.height},e.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==e.config.legend.position&&"right"!==e.config.legend.position||e.config.legend.floating?0:this.dCtx.lgRect.width;var n=e.globals.xLabelFormatter,s=b.getLargestStringFromArr(i),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(s,i);e.globals.isBarHorizontal&&(r=s=e.globals.yAxisScale[0].result.reduce((function(t,e){return t.length>e.length?t:e}),0));var o=new B(this.dCtx.ctx),l=s;s=o.xLabelFormat(n,s,l,{i:void 0,dateFormatter:new L(this.dCtx.ctx).formatDate,w:e}),r=o.xLabelFormat(n,r,l,{i:void 0,dateFormatter:new L(this.dCtx.ctx).formatDate,w:e}),(e.config.xaxis.convertedCatToNumeric&&void 0===s||""===String(s).trim())&&(r=s="1");var c=new C(this.dCtx.ctx),d=c.getTextRects(s,e.config.xaxis.labels.style.fontSize),h=d;if(s!==r&&(h=c.getTextRects(r,e.config.xaxis.labels.style.fontSize)),(t={width:d.width>=h.width?d.width:h.width,height:d.height>=h.height?d.height:h.height}).width*i.length>e.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==e.config.xaxis.labels.rotate||e.config.xaxis.labels.rotateAlways){if(!e.globals.isBarHorizontal){e.globals.rotateXLabels=!0;var u=function(t){return c.getTextRects(t,e.config.xaxis.labels.style.fontSize,e.config.xaxis.labels.style.fontFamily,"rotate(".concat(e.config.xaxis.labels.rotate," 0 0)"),!1)};d=u(s),s!==r&&(h=u(r)),t.height=(d.height>h.height?d.height:h.height)/1.5,t.width=d.width>h.width?d.width:h.width}}else e.globals.rotateXLabels=!1}return e.config.xaxis.labels.show||(t={width:0,height:0}),{width:t.width,height:t.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var t,e=this.w;if(!e.globals.hasGroups)return{width:0,height:0};var i,a=(null===(t=e.config.xaxis.group.style)||void 0===t?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,n=e.globals.groups.map((function(t){return t.title})),s=b.getLargestStringFromArr(n),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(s,n),o=new C(this.dCtx.ctx),l=o.getTextRects(s,a),c=l;return s!==r&&(c=o.getTextRects(r,a)),i={width:l.width>=c.width?l.width:c.width,height:l.height>=c.height?l.height:c.height},e.config.xaxis.labels.show||(i={width:0,height:0}),{width:i.width,height:i.height}}},{key:"getxAxisTitleCoords",value:function(){var t=this.w,e=0,i=0;if(void 0!==t.config.xaxis.title.text){var a=new C(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=a.width,i=a.height}return{width:e,height:i}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();var i=this.dCtx.timescaleLabels.map((function(t){return t.value})),a=i.reduce((function(t,e){return void 0===t?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):t.length>e.length?t:e}),0);return 1.05*(t=new C(this.dCtx.ctx).getTextRects(a,e.config.xaxis.labels.style.fontSize)).width*i.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}},{key:"additionalPaddingXLabels",value:function(t){var e=this,i=this.w,a=i.globals,n=i.config,s=n.xaxis.type,r=t.width;a.skipLastTimelinelabel=!1,a.skipFirstTimelinelabel=!1;var o=i.config.yaxis[0].opposite&&i.globals.isBarHorizontal,l=function(t,o){(function(t){return-1!==a.collapsedSeriesIndices.indexOf(t)})(o)||function(t){if(e.dCtx.timescaleLabels&&e.dCtx.timescaleLabels.length){var o=e.dCtx.timescaleLabels[0],l=e.dCtx.timescaleLabels[e.dCtx.timescaleLabels.length-1].position+r/1.75-e.dCtx.yAxisWidthRight,c=o.position-r/1.75+e.dCtx.yAxisWidthLeft,d="right"===i.config.legend.position&&e.dCtx.lgRect.width>0?e.dCtx.lgRect.width:0;l>a.svgWidth-a.translateX-d&&(a.skipLastTimelinelabel=!0),c<-(t.show&&!t.floating||"bar"!==n.chart.type&&"candlestick"!==n.chart.type&&"rangeBar"!==n.chart.type&&"boxPlot"!==n.chart.type?10:r/1.75)&&(a.skipFirstTimelinelabel=!0)}else"datetime"===s?e.dCtx.gridPad.rightString(o.niceMax).length?d:o.niceMax,u=c(h,{seriesIndex:r,dataPointIndex:-1,w:e}),p=u;if(void 0!==u&&0!==u.length||(u=h),e.globals.isBarHorizontal){a=0;var f=e.globals.labels.slice();u=c(u=b.getLargestStringFromArr(f),{seriesIndex:r,dataPointIndex:-1,w:e}),p=t.dCtx.dimHelpers.getLargestStringFromMultiArr(u,f)}var g=new C(t.dCtx.ctx),m="rotate(".concat(s.labels.rotate," 0 0)"),v=g.getTextRects(u,s.labels.style.fontSize,s.labels.style.fontFamily,m,!1),x=v;u!==p&&(x=g.getTextRects(p,s.labels.style.fontSize,s.labels.style.fontFamily,m,!1)),i.push({width:(l>x.width||l>v.width?l:x.width>v.width?x.width:v.width)+a,height:x.height>v.height?x.height:v.height})}else i.push({width:0,height:0})})),i}},{key:"getyAxisTitleCoords",value:function(){var t=this,e=this.w,i=[];return e.config.yaxis.map((function(e,a){if(e.show&&void 0!==e.title.text){var n=new C(t.dCtx.ctx),s="rotate(".concat(e.title.rotate," 0 0)"),r=n.getTextRects(e.title.text,e.title.style.fontSize,e.title.style.fontFamily,s,!1);i.push({width:r.width,height:r.height})}else i.push({width:0,height:0})})),i}},{key:"getTotalYAxisWidth",value:function(){var t=this.w,e=0,i=0,a=0,n=t.globals.yAxisScale.length>1?10:0,s=new W(this.dCtx.ctx),r=function(r,o){var l=t.config.yaxis[o].floating,c=0;r.width>0&&!l?(c=r.width+n,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(o)&&(c=c-r.width-n)):c=l||s.isYAxisHidden(o)?0:5,t.config.yaxis[o].opposite?a+=c:i+=c,e+=c};return t.globals.yLabelsCoords.map((function(t,e){r(t,e)})),t.globals.yTitleCoords.map((function(t,e){r(t,e)})),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.globals.yLabelsCoords[0].width+t.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=i,this.dCtx.yAxisWidthRight=a,e}}]),t}(),lt=function(){function t(e){o(this,t),this.w=e.w,this.dCtx=e}return c(t,[{key:"gridPadForColumnsInNumericAxis",value:function(t){var e=this.w;if(e.globals.noData||e.globals.allSeriesCollapsed)return 0;var i=function(t){return"bar"===t||"rangeBar"===t||"candlestick"===t||"boxPlot"===t},a=e.config.chart.type,n=0,s=i(a)?e.config.series.length:1;if(e.globals.comboBarCount>0&&(s=e.globals.comboBarCount),e.globals.collapsedSeries.forEach((function(t){i(t.type)&&(s-=1)})),e.config.chart.stacked&&(s=1),(i(a)||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&s>0){var r,o,l=Math.abs(e.globals.initialMaxX-e.globals.initialMinX);l<=3&&(l=e.globals.dataPoints),r=l/t,e.globals.minXDiff&&e.globals.minXDiff/r>0&&(o=e.globals.minXDiff/r),o>t/2&&(o/=2),(n=o/s*parseInt(e.config.plotOptions.bar.columnWidth,10)/100)<1&&(n=1),n=n/(s>1?1:1.5)+5,e.globals.barPadForNumericAxis=n}return n}},{key:"gridPadFortitleSubtitle",value:function(){var t=this,e=this.w,i=e.globals,a=this.dCtx.isSparkline||!e.globals.axisCharts?0:10;["title","subtitle"].forEach((function(i){void 0!==e.config[i].text?a+=e.config[i].margin:a+=t.dCtx.isSparkline||!e.globals.axisCharts?0:5})),!e.config.legend.show||"bottom"!==e.config.legend.position||e.config.legend.floating||e.globals.axisCharts||(a+=10);var n=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),s=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");i.gridHeight=i.gridHeight-n.height-s.height-a,i.translateY=i.translateY+n.height+s.height+a}},{key:"setGridXPosForDualYAxis",value:function(t,e){var i=this.w,a=new W(this.dCtx.ctx);i.config.yaxis.map((function(n,s){-1!==i.globals.ignoreYAxisIndexes.indexOf(s)||n.floating||a.isYAxisHidden(s)||(n.opposite&&(i.globals.translateX=i.globals.translateX-(e[s].width+t[s].width)-parseInt(i.config.yaxis[s].labels.style.fontSize,10)/1.2-12),i.globals.translateX<2&&(i.globals.translateX=2))}))}}]),t}(),ct=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,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 st(this),this.dimYAxis=new ot(this),this.dimXAxis=new rt(this),this.dimGrid=new lt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return c(t,[{key:"plotCoords",value:function(){var t=this,e=this.w,i=e.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.isSparkline&&(e.config.markers.discrete.length>0||e.config.markers.size>0)&&Object.entries(this.gridPad).forEach((function(e){var i=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var a,n,s=[],r=!0,o=!1;try{for(i=i.call(t);!(r=(a=i.next()).done)&&(s.push(a.value),!e||s.length!==e);r=!0);}catch(t){o=!0,n=t}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return s}}(t,e)||v(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),a=i[0],n=i[1];t.gridPad[a]=Math.max(n,t.w.globals.markers.largestSize/1.5)})),i.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),i.gridHeight=i.gridHeight-this.gridPad.top-this.gridPad.bottom,i.gridWidth=i.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var a=this.dimGrid.gridPadForColumnsInNumericAxis(i.gridWidth);i.gridWidth=i.gridWidth-2*a,i.translateX=i.translateX+this.gridPad.left+this.xPadLeft+(a>0?a+4:0),i.translateY=i.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var t=this,e=this.w,i=e.globals,a=this.dimYAxis.getyAxisLabelsCoords(),n=this.dimYAxis.getyAxisTitleCoords();e.globals.yLabelsCoords=[],e.globals.yTitleCoords=[],e.config.yaxis.map((function(t,i){e.globals.yLabelsCoords.push({width:a[i].width,index:i}),e.globals.yTitleCoords.push({width:n[i].width,index:i})})),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var s=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisGroupLabelsCoords(),o=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(s,o,r),i.translateXAxisY=e.globals.rotateXLabels?this.xAxisHeight/8:-4,i.translateXAxisX=e.globals.rotateXLabels&&e.globals.isXNumeric&&e.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,e.globals.isBarHorizontal&&(i.rotateXLabels=!1,i.translateXAxisY=parseInt(e.config.xaxis.labels.style.fontSize,10)/1.5*-1),i.translateXAxisY=i.translateXAxisY+e.config.xaxis.labels.offsetY,i.translateXAxisX=i.translateXAxisX+e.config.xaxis.labels.offsetX;var l=this.yAxisWidth,c=this.xAxisHeight;i.xAxisLabelsHeight=this.xAxisHeight-o.height,i.xAxisGroupLabelsHeight=i.xAxisLabelsHeight-s.height,i.xAxisLabelsWidth=this.xAxisWidth,i.xAxisHeight=this.xAxisHeight;var d=10;("radar"===e.config.chart.type||this.isSparkline)&&(l=0,c=i.goldenPadding),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===e.config.chart.type)&&(l=0,c=0,d=0),this.isSparkline||this.dimXAxis.additionalPaddingXLabels(s);var h=function(){i.translateX=l,i.gridHeight=i.svgHeight-t.lgRect.height-c-(t.isSparkline||"treemap"===e.config.chart.type?0:e.globals.rotateXLabels?10:15),i.gridWidth=i.svgWidth-l};switch("top"===e.config.xaxis.position&&(d=i.xAxisHeight-e.config.xaxis.axisTicks.height-5),e.config.legend.position){case"bottom":i.translateY=d,h();break;case"top":i.translateY=this.lgRect.height+d,h();break;case"left":i.translateY=d,i.translateX=this.lgRect.width+l,i.gridHeight=i.svgHeight-c-12,i.gridWidth=i.svgWidth-this.lgRect.width-l;break;case"right":i.translateY=d,i.translateX=l,i.gridHeight=i.svgHeight-c-12,i.gridWidth=i.svgWidth-this.lgRect.width-l-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(n,a),new K(this.ctx).setYAxisXPosition(a,n)}},{key:"setDimensionsForNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=t.config,a=0;t.config.legend.show&&!t.config.legend.floating&&(a=20);var n="pie"===i.chart.type||"polarArea"===i.chart.type||"donut"===i.chart.type?"pie":"radialBar",s=i.plotOptions[n].offsetY,r=i.plotOptions[n].offsetX;if(!i.legend.show||i.legend.floating)return e.gridHeight=e.svgHeight-i.grid.padding.left+i.grid.padding.right,e.gridWidth=e.gridHeight,e.translateY=s,void(e.translateX=r+(e.svgWidth-e.gridWidth)/2);switch(i.legend.position){case"bottom":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.svgWidth,e.translateY=s-10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"top":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.svgWidth,e.translateY=this.lgRect.height+s+10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"left":e.gridWidth=e.svgWidth-this.lgRect.width-a,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=s,e.translateX=r+this.lgRect.width+a;break;case"right":e.gridWidth=e.svgWidth-this.lgRect.width-a-5,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=s,e.translateX=r+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(t,e,i){var a=this.w,n=a.globals.hasGroups?2:1,s=i.height+t.height+e.height,r=a.globals.isMultiLineX?1.2:a.globals.LINE_HEIGHT_RATIO,o=a.globals.rotateXLabels?22:10,l=a.globals.rotateXLabels&&"bottom"===a.config.legend.position?10:0;this.xAxisHeight=s*r+n*o+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>a.config.xaxis.labels.maxHeight&&(this.xAxisHeight=a.config.xaxis.labels.maxHeight),a.config.xaxis.labels.minHeight&&this.xAxisHeightd&&(this.yAxisWidth=d)}}]),t}(),dt=function(){function t(e){o(this,t),this.w=e.w,this.lgCtx=e}return c(t,[{key:"getLegendStyles",value:function(){var t=document.createElement("style");t.setAttribute("type","text/css");var e=document.createTextNode("\t\n \t\n .apexcharts-legend {\t\n display: flex;\t\n overflow: auto;\t\n padding: 0 10px;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\t\n flex-wrap: wrap\t\n }\t\n .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\t\n flex-direction: column;\t\n bottom: 0;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\t\n justify-content: flex-start;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\t\n justify-content: center; \t\n }\t\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\t\n justify-content: flex-end;\t\n }\t\n .apexcharts-legend-series {\t\n cursor: pointer;\t\n line-height: normal;\t\n }\t\n .apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{\t\n display: flex;\t\n align-items: center;\t\n }\t\n .apexcharts-legend-text {\t\n position: relative;\t\n font-size: 14px;\t\n }\t\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\t\n pointer-events: none;\t\n }\t\n .apexcharts-legend-marker {\t\n position: relative;\t\n display: inline-block;\t\n cursor: pointer;\t\n margin-right: 3px;\t\n border-style: solid;\n }\t\n \t\n .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\t\n display: inline-block;\t\n }\t\n .apexcharts-legend-series.apexcharts-no-click {\t\n cursor: auto;\t\n }\t\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\t\n display: none !important;\t\n }\t\n .apexcharts-inactive-legend {\t\n opacity: 0.45;\t\n }");return t.appendChild(e),t}},{key:"getLegendBBox",value:function(){var t=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),e=t.width;return{clwh:t.height,clww:e}}},{key:"appendToForeignObject",value:function(){var t=this.w.globals;t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject");var e=t.dom.elLegendForeign;e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("width",t.svgWidth),e.setAttribute("height",t.svgHeight),t.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),e.appendChild(t.dom.elLegendWrap),e.appendChild(this.getLegendStyles()),t.dom.Paper.node.insertBefore(e,t.dom.elGraphical.node)}},{key:"toggleDataSeries",value:function(t,e){var i=this,a=this.w;if(a.globals.axisCharts||"radialBar"===a.config.chart.type){a.globals.resized=!0;var n=null,s=null;a.globals.risingSeries=[],a.globals.axisCharts?(n=a.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t,"']")),s=parseInt(n.getAttribute("data:realIndex"),10)):(n=a.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(t+1,"']")),s=parseInt(n.getAttribute("rel"),10)-1),e?[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach((function(t){i.riseCollapsedSeries(t.cs,t.csi,s)})):this.hideSeries({seriesEl:n,realIndex:s})}else{var r=a.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(t+1,"'] path")),o=a.config.chart.type;if("pie"===o||"polarArea"===o||"donut"===o){var l=a.config.plotOptions.pie.donut.labels;new C(this.lgCtx.ctx).pathMouseDown(r.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(r.members[0].node,l)}r.fire("click")}}},{key:"hideSeries",value:function(t){var e=t.seriesEl,i=t.realIndex,a=this.w,n=b.clone(a.config.series);if(a.globals.axisCharts){var s=!1;if(a.config.yaxis[i]&&a.config.yaxis[i].show&&a.config.yaxis[i].showAlways&&(s=!0,a.globals.ancillaryCollapsedSeriesIndices.indexOf(i)<0&&(a.globals.ancillaryCollapsedSeries.push({index:i,data:n[i].data.slice(),type:e.parentNode.className.baseVal.split("-")[1]}),a.globals.ancillaryCollapsedSeriesIndices.push(i))),!s){a.globals.collapsedSeries.push({index:i,data:n[i].data.slice(),type:e.parentNode.className.baseVal.split("-")[1]}),a.globals.collapsedSeriesIndices.push(i);var r=a.globals.risingSeries.indexOf(i);a.globals.risingSeries.splice(r,1)}}else a.globals.collapsedSeries.push({index:i,data:n[i]}),a.globals.collapsedSeriesIndices.push(i);for(var o=e.childNodes,l=0;l0){for(var s=0;s-1&&(t[a].data=[])})):t.forEach((function(i,a){e.globals.collapsedSeriesIndices.indexOf(a)>-1&&(t[a]=0)})),t}}]),t}(),ht=function(){function t(e,i){o(this,t),this.ctx=e,this.w=e.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new dt(this)}return c(t,[{key:"init",value:function(){var t=this.w,e=t.globals,i=t.config;if((i.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||e.series.length>1||!e.axisCharts)&&i.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);this.drawLegends(),b.isIE11()?document.getElementsByTagName("head")[0].appendChild(this.legendHelpers.getLegendStyles()):this.legendHelpers.appendToForeignObject(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical()}}},{key:"drawLegends",value:function(){var t=this,e=this.w,i=e.config.legend.fontFamily,a=e.globals.seriesNames,n=e.globals.colors.slice();if("heatmap"===e.config.chart.type){var s=e.config.plotOptions.heatmap.colorScale.ranges;a=s.map((function(t){return t.name?t.name:t.from+" - "+t.to})),n=s.map((function(t){return t.color}))}else this.isBarsDistributed&&(a=e.globals.labels.slice());e.config.legend.customLegendItems.length&&(a=e.config.legend.customLegendItems);for(var r=e.globals.legendFormatter,o=e.config.legend.inverseOrder,l=o?a.length-1:0;o?l>=0:l<=a.length-1;o?l--:l++){var c=r(a[l],{seriesIndex:l,w:e}),d=!1,h=!1;if(e.globals.collapsedSeries.length>0)for(var u=0;u0)for(var p=0;p0?l-10:0)+(c>0?c-10:0)}a.style.position="absolute",s=s+t+i.config.legend.offsetX,r=r+e+i.config.legend.offsetY,a.style.left=s+"px",a.style.top=r+"px","bottom"===i.config.legend.position?(a.style.top="auto",a.style.bottom=5-i.config.legend.offsetY+"px"):"right"===i.config.legend.position&&(a.style.left="auto",a.style.right=25+i.config.legend.offsetX+"px"),["width","height"].forEach((function(t){a.style[t]&&(a.style[t]=parseInt(i.config.legend[t],10)+"px")}))}},{key:"legendAlignHorizontal",value:function(){var t=this.w;t.globals.dom.baseEl.querySelector(".apexcharts-legend").style.right=0;var e=this.legendHelpers.getLegendBBox(),i=new ct(this.ctx),a=i.dimHelpers.getTitleSubtitleCoords("title"),n=i.dimHelpers.getTitleSubtitleCoords("subtitle"),s=0;"bottom"===t.config.legend.position?s=-e.clwh/1.8:"top"===t.config.legend.position&&(s=a.height+n.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,s)}},{key:"legendAlignVertical",value:function(){var t=this.w,e=this.legendHelpers.getLegendBBox(),i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}},{key:"onLegendHovered",value:function(t){var e=this.w,i=t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker");if("heatmap"===e.config.chart.type||this.isBarsDistributed){if(i){var a=parseInt(t.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,a,this.w]),new F(this.ctx).highlightRangeInSeries(t,t.target)}}else!t.target.classList.contains("apexcharts-inactive-legend")&&i&&new F(this.ctx).toggleSeriesOnHover(t,t.target)}},{key:"onLegendClick",value:function(t){var e=this.w;if(!e.config.legend.customLegendItems.length&&(t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))){var i=parseInt(t.target.getAttribute("rel"),10)-1,a="true"===t.target.getAttribute("data:collapsed"),n=this.w.config.chart.events.legendClick;"function"==typeof n&&n(this.ctx,i,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,i,this.w]);var s=this.w.config.legend.markers.onClick;"function"==typeof s&&t.target.classList.contains("apexcharts-legend-marker")&&(s(this.ctx,i,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,i,this.w])),"treemap"!==e.config.chart.type&&"heatmap"!==e.config.chart.type&&!this.isBarsDistributed&&e.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(i,a)}}}]),t}(),ut=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=i.globals.minX,this.maxX=i.globals.maxX}return c(t,[{key:"createToolbar",value:function(){var t=this,e=this.w,i=function(){return document.createElement("div")},a=i();if(a.setAttribute("class","apexcharts-toolbar"),a.style.top=e.config.chart.toolbar.offsetY+"px",a.style.right=3-e.config.chart.toolbar.offsetX+"px",e.globals.dom.elWrap.appendChild(a),this.elZoom=i(),this.elZoomIn=i(),this.elZoomOut=i(),this.elPan=i(),this.elSelection=i(),this.elZoomReset=i(),this.elMenuIcon=i(),this.elMenu=i(),this.elCustomIcons=[],this.t=e.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var n=0;n\n \n \n\n'),r("zoomOut",this.elZoomOut,'\n');var o=function(i){t.t[i]&&e.config.chart[i].enabled&&s.push({el:"zoom"===i?t.elZoom:t.elSelection,icon:"string"==typeof t.t[i]?t.t[i]:"zoom"===i?'':'',title:t.localeValues["zoom"===i?"selectionZoom":"selection"],class:e.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(i,"-icon")})};o("zoom"),o("selection"),this.t.pan&&e.config.chart.zoom.enabled&&s.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'',title:this.localeValues.pan,class:e.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),r("reset",this.elZoomReset,''),this.t.download&&s.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var l=0;l0&&e.height>0&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:t.globals.gridWidth,maxY:t.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}}},{key:"preselectedSelection",value:function(){var t=this.w,e=this.xyRatios;if(!t.globals.zoomEnabled)if(void 0!==t.globals.selection&&null!==t.globals.selection)this.drawSelectionRect(t.globals.selection);else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){var i=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,a={x:i,y:0,width:t.globals.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-i,height:t.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}},{key:"drawSelectionRect",value:function(t){var e=t.x,i=t.y,a=t.width,n=t.height,s=t.translateX,r=void 0===s?0:s,o=t.translateY,l=void 0===o?0:o,c=this.w,d=this.zoomRect,h=this.selectionRect;if(this.dragged||null!==c.globals.selection){var u={transform:"translate("+r+", "+l+")"};c.globals.zoomEnabled&&this.dragged&&(a<0&&(a=1),d.attr({x:e,y:i,width:a,height:n,fill:c.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":c.config.chart.zoom.zoomedArea.fill.opacity,stroke:c.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":c.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":c.config.chart.zoom.zoomedArea.stroke.opacity}),C.setAttrs(d.node,u)),c.globals.selectionEnabled&&(h.attr({x:e,y:i,width:a>0?a:0,height:n>0?n:0,fill:c.config.chart.selection.fill.color,"fill-opacity":c.config.chart.selection.fill.opacity,stroke:c.config.chart.selection.stroke.color,"stroke-width":c.config.chart.selection.stroke.width,"stroke-dasharray":c.config.chart.selection.stroke.dashArray,"stroke-opacity":c.config.chart.selection.stroke.opacity}),C.setAttrs(h.node,u))}}},{key:"hideSelectionRect",value:function(t){t&&t.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(t){var e,i=t.context,a=t.zoomtype,n=this.w,s=i,r=this.gridRect.getBoundingClientRect(),o=s.startX-1,l=s.startY,c=!1,d=!1,h=s.clientX-r.left-o,u=s.clientY-r.top-l;return Math.abs(h+o)>n.globals.gridWidth?h=n.globals.gridWidth-o:s.clientX-r.left<0&&(h=o),o>s.clientX-r.left&&(c=!0,h=Math.abs(h)),l>s.clientY-r.top&&(d=!0,u=Math.abs(u)),e="x"===a?{x:c?o-h:o,y:0,width:h,height:n.globals.gridHeight}:"y"===a?{x:0,y:d?l-u:l,width:n.globals.gridWidth,height:u}:{x:c?o-h:o,y:d?l-u:l,width:h,height:u},s.drawSelectionRect(e),s.selectionDragging("resizing"),e}},{key:"selectionDragging",value:function(t,e){var i=this,a=this.w,n=this.xyRatios,s=this.selectionRect,r=0;"resizing"===t&&(r=30);var o=function(t){return parseFloat(s.node.getAttribute(t))},l={x:o("x"),y:o("y"),width:o("width"),height:o("height")};a.globals.selection=l,"function"==typeof a.config.chart.events.selection&&a.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout((function(){var t=i.gridRect.getBoundingClientRect(),e=s.node.getBoundingClientRect(),r={xaxis:{min:a.globals.xAxisScale.niceMin+(e.left-t.left)*n.xRatio,max:a.globals.xAxisScale.niceMin+(e.right-t.left)*n.xRatio},yaxis:{min:a.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*n.yRatio[0],max:a.globals.yAxisScale[0].niceMax-(e.top-t.top)*n.yRatio[0]}};a.config.chart.events.selection(i.ctx,r),a.config.chart.brush.enabled&&void 0!==a.config.chart.events.brushScrolled&&a.config.chart.events.brushScrolled(i.ctx,r)}),r))}},{key:"selectionDrawn",value:function(t){var e=t.context,i=t.zoomtype,a=this.w,n=e,s=this.xyRatios,r=this.ctx.toolbar;if(n.startX>n.endX){var o=n.startX;n.startX=n.endX,n.endX=o}if(n.startY>n.endY){var l=n.startY;n.startY=n.endY,n.endY=l}var c=void 0,d=void 0;a.globals.isRangeBar?(c=a.globals.yAxisScale[0].niceMin+n.startX*s.invertedYRatio,d=a.globals.yAxisScale[0].niceMin+n.endX*s.invertedYRatio):(c=a.globals.xAxisScale.niceMin+n.startX*s.xRatio,d=a.globals.xAxisScale.niceMin+n.endX*s.xRatio);var h=[],u=[];if(a.config.yaxis.forEach((function(t,e){h.push(a.globals.yAxisScale[e].niceMax-s.yRatio[e]*n.startY),u.push(a.globals.yAxisScale[e].niceMax-s.yRatio[e]*n.endY)})),n.dragged&&(n.dragX>10||n.dragY>10)&&c!==d)if(a.globals.zoomEnabled){var p=b.clone(a.globals.initialConfig.yaxis),f=b.clone(a.globals.initialConfig.xaxis);if(a.globals.zoomed=!0,a.config.xaxis.convertedCatToNumeric&&(c=Math.floor(c),d=Math.floor(d),c<1&&(c=1,d=a.globals.dataPoints),d-c<2&&(d=c+1)),"xy"!==i&&"x"!==i||(f={min:c,max:d}),"xy"!==i&&"y"!==i||p.forEach((function(t,e){p[e].min=u[e],p[e].max=h[e]})),a.config.chart.zoom.autoScaleYaxis){var g=new q(n.ctx);p=g.autoScaleY(n.ctx,p,{xaxis:f})}if(r){var m=r.getBeforeZoomRange(f,p);m&&(f=m.xaxis?m.xaxis:f,p=m.yaxis?m.yaxis:p)}var v={xaxis:f};a.config.chart.group||(v.yaxis=p),n.ctx.updateHelpers._updateOptions(v,!1,n.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof a.config.chart.events.zoomed&&r.zoomCallback(f,p)}else if(a.globals.selectionEnabled){var x,y=null;x={min:c,max:d},"xy"!==i&&"y"!==i||(y=b.clone(a.config.yaxis)).forEach((function(t,e){y[e].min=u[e],y[e].max=h[e]})),a.globals.selection=n.selection,"function"==typeof a.config.chart.events.selection&&a.config.chart.events.selection(n.ctx,{xaxis:x,yaxis:y})}}},{key:"panDragging",value:function(t){var e=t.context,i=this.w,a=e;if(void 0!==i.globals.lastClientPosition.x){var n=i.globals.lastClientPosition.x-a.clientX,s=i.globals.lastClientPosition.y-a.clientY;Math.abs(n)>Math.abs(s)&&n>0?this.moveDirection="left":Math.abs(n)>Math.abs(s)&&n<0?this.moveDirection="right":Math.abs(s)>Math.abs(n)&&s>0?this.moveDirection="up":Math.abs(s)>Math.abs(n)&&s<0&&(this.moveDirection="down")}i.globals.lastClientPosition={x:a.clientX,y:a.clientY};var r=i.globals.isRangeBar?i.globals.minY:i.globals.minX,o=i.globals.isRangeBar?i.globals.maxY:i.globals.maxX;i.config.xaxis.convertedCatToNumeric||a.panScrolled(r,o)}},{key:"delayedPanScrolled",value:function(){var t=this.w,e=t.globals.minX,i=t.globals.maxX,a=(t.globals.maxX-t.globals.minX)/2;"left"===this.moveDirection?(e=t.globals.minX+a,i=t.globals.maxX+a):"right"===this.moveDirection&&(e=t.globals.minX-a,i=t.globals.maxX-a),e=Math.floor(e),i=Math.floor(i),this.updateScrolledChart({xaxis:{min:e,max:i}},e,i)}},{key:"panScrolled",value:function(t,e){var i=this.w,a=this.xyRatios,n=b.clone(i.globals.initialConfig.yaxis),s=a.xRatio,r=i.globals.minX,o=i.globals.maxX;i.globals.isRangeBar&&(s=a.invertedYRatio,r=i.globals.minY,o=i.globals.maxY),"left"===this.moveDirection?(t=r+i.globals.gridWidth/15*s,e=o+i.globals.gridWidth/15*s):"right"===this.moveDirection&&(t=r-i.globals.gridWidth/15*s,e=o-i.globals.gridWidth/15*s),i.globals.isRangeBar||(ti.globals.initialMaxX)&&(t=r,e=o);var l={min:t,max:e};i.config.chart.zoom.autoScaleYaxis&&(n=new q(this.ctx).autoScaleY(this.ctx,n,{xaxis:l}));var c={xaxis:{min:t,max:e}};i.config.chart.group||(c.yaxis=n),this.updateScrolledChart(c,t,e)}},{key:"updateScrolledChart",value:function(t,e,i){var a=this.w;this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof a.config.chart.events.scrolled&&a.config.chart.events.scrolled(this.ctx,{xaxis:{min:e,max:i}})}}]),i}(ut),ft=function(){function t(e){o(this,t),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx}return c(t,[{key:"getNearestValues",value:function(t){var e=t.hoverArea,i=t.elGrid,a=t.clientX,n=t.clientY,s=this.w,r=i.getBoundingClientRect(),o=r.width,l=r.height,c=o/(s.globals.dataPoints-1),d=l/s.globals.dataPoints,h=this.hasBars();!s.globals.comboCharts&&!h||s.config.xaxis.convertedCatToNumeric||(c=o/s.globals.dataPoints);var u=a-r.left-s.globals.barPadForNumericAxis,p=n-r.top;u<0||p<0||u>o||p>l?(e.classList.remove("hovering-zoom"),e.classList.remove("hovering-pan")):s.globals.zoomEnabled?(e.classList.remove("hovering-pan"),e.classList.add("hovering-zoom")):s.globals.panEnabled&&(e.classList.remove("hovering-zoom"),e.classList.add("hovering-pan"));var f=Math.round(u/c),g=Math.floor(p/d);h&&!s.config.xaxis.convertedCatToNumeric&&(f=Math.ceil(u/c),f-=1);var m=null,v=null,x=[],y=[];if(s.globals.seriesXvalues.forEach((function(t){x.push([t[0]+1e-6].concat(t))})),s.globals.seriesYvalues.forEach((function(t){y.push([t[0]+1e-6].concat(t))})),x=x.map((function(t){return t.filter((function(t){return b.isNumber(t)}))})),y=y.map((function(t){return t.filter((function(t){return b.isNumber(t)}))})),s.globals.isXNumeric){var w=this.ttCtx.getElGrid().getBoundingClientRect(),C=u*(w.width/o),S=p*(w.height/l);m=(v=this.closestInMultiArray(C,S,x,y)).index,f=v.j,null!==m&&(x=s.globals.seriesXvalues[m],f=(v=this.closestInArray(C,x)).index)}return s.globals.capturedSeriesIndex=null===m?-1:m,(!f||f<1)&&(f=0),s.globals.isBarHorizontal?s.globals.capturedDataPointIndex=g:s.globals.capturedDataPointIndex=f,{capturedSeries:m,j:s.globals.isBarHorizontal?g:f,hoverX:u,hoverY:p}}},{key:"closestInMultiArray",value:function(t,e,i,a){var n=this.w,s=0,r=null,o=-1;n.globals.series.length>1?s=this.getFirstActiveXArray(i):r=0;var l=i[s][0],c=Math.abs(t-l);if(i.forEach((function(e){e.forEach((function(e,i){var a=Math.abs(t-e);a0?e:-1})),n=0;n0)for(var a=0;ai?-1:0}));var e=[];return t.forEach((function(t){e.push(t.querySelector(".apexcharts-marker"))})),e}},{key:"hasMarkers",value:function(){return this.getElMarkers().length>0}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(t){var e=this.w,i=e.config.markers.hover.size;return void 0===i&&(i=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),i}},{key:"toggleAllTooltipSeriesGroups",value:function(t){var e=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var a=i.allTooltipSeriesGroups,n=0;n";h.forEach((function(i,a){t+=' ').concat(i.attrs.name,"
"),e+="".concat(i.val,"
")})),x.innerHTML=t+"",b.innerHTML=e+""};r?l.globals.seriesGoals[e][i]&&Array.isArray(l.globals.seriesGoals[e][i])?y():(x.innerHTML="",b.innerHTML=""):y()}else x.innerHTML="",b.innerHTML="";null!==f&&(a[e].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title,a[e].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==f?f:""),r&&g[0]&&(null==d||l.globals.ancillaryCollapsedSeriesIndices.indexOf(e)>-1||l.globals.collapsedSeriesIndices.indexOf(e)>-1?g[0].parentNode.style.display="none":g[0].parentNode.style.display=l.config.tooltip.items.display)}},{key:"toggleActiveInactiveSeries",value:function(t){var e=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var i=e.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group");i&&(i.classList.add("apexcharts-active"),i.style.display=e.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(t){var e=t.i,i=t.j,a=this.w,n=this.ctx.series.filteredSeriesX(),s="",r="",o=null,l=null,c={series:a.globals.series,seriesIndex:e,dataPointIndex:i,w:a},d=a.globals.ttZFormatter;null===i?l=a.globals.series[e]:a.globals.isXNumeric&&"treemap"!==a.config.chart.type?(s=n[e][i],0===n[e].length&&(s=n[this.tooltipUtil.getFirstActiveXArray(n)][i])):s=void 0!==a.globals.labels[i]?a.globals.labels[i]:"";var h=s;return s=a.globals.isXNumeric&&"datetime"===a.config.xaxis.type?new B(this.ctx).xLabelFormat(a.globals.ttKeyFormatter,h,h,{i:void 0,dateFormatter:new L(this.ctx).formatDate,w:this.w}):a.globals.isBarHorizontal?a.globals.yLabelFormatters[0](h,c):a.globals.xLabelFormatter(h,c),void 0!==a.config.tooltip.x.formatter&&(s=a.globals.ttKeyFormatter(h,c)),a.globals.seriesZ.length>0&&a.globals.seriesZ[e].length>0&&(o=d(a.globals.seriesZ[e][i],a)),r="function"==typeof a.config.xaxis.tooltip.formatter?a.globals.xaxisTooltipFormatter(h,c):s,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(s)?s.join(" "):s,xAxisTTVal:Array.isArray(r)?r.join(" "):r,zVal:o}}},{key:"handleCustomTooltip",value:function(t){var e=t.i,i=t.j,a=t.y1,n=t.y2,s=t.w,r=this.ttCtx.getElTooltip(),o=s.config.tooltip.custom;Array.isArray(o)&&o[e]&&(o=o[e]),r.innerHTML=o({ctx:this.ctx,series:s.globals.series,seriesIndex:e,dataPointIndex:i,y1:a,y2:n,w:s})}}]),t}(),mt=function(){function t(e){o(this,t),this.ttCtx=e,this.ctx=e.ctx,this.w=e.w}return c(t,[{key:"moveXCrosshairs",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.ttCtx,a=this.w,n=i.getElXCrosshairs(),s=t-i.xcrosshairsWidth/2,r=a.globals.labels.slice().length;if(null!==e&&(s=a.globals.gridWidth/r*e),null===n||a.globals.isBarHorizontal||(n.setAttribute("x",s),n.setAttribute("x1",s),n.setAttribute("x2",s),n.setAttribute("y2",a.globals.gridHeight),n.classList.add("apexcharts-active")),s<0&&(s=0),s>a.globals.gridWidth&&(s=a.globals.gridWidth),i.isXAxisTooltipEnabled){var o=s;"tickWidth"!==a.config.xaxis.crosshairs.width&&"barWidth"!==a.config.xaxis.crosshairs.width||(o=s+i.xcrosshairsWidth/2),this.moveXAxisTooltip(o)}}},{key:"moveYCrosshairs",value:function(t){var e=this.ttCtx;null!==e.ycrosshairs&&C.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&C.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}},{key:"moveXAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx;if(null!==i.xaxisTooltip&&0!==i.xcrosshairsWidth){i.xaxisTooltip.classList.add("apexcharts-active");var a,n=i.xaxisOffY+e.config.xaxis.tooltip.offsetY+e.globals.translateY+1+e.config.xaxis.offsetY;t-=i.xaxisTooltip.getBoundingClientRect().width/2,isNaN(t)||(t+=e.globals.translateX,a=new C(this.ctx).getTextRects(i.xaxisTooltipText.innerHTML),i.xaxisTooltipText.style.minWidth=a.width+"px",i.xaxisTooltip.style.left=t+"px",i.xaxisTooltip.style.top=n+"px")}}},{key:"moveYAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx;null===i.yaxisTTEls&&(i.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var a=parseInt(i.ycrosshairsHidden.getAttribute("y1"),10),n=e.globals.translateY+a,s=i.yaxisTTEls[t].getBoundingClientRect().height,r=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(r-=26),n-=s/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)?(i.yaxisTTEls[t].classList.add("apexcharts-active"),i.yaxisTTEls[t].style.top=n+"px",i.yaxisTTEls[t].style.left=r+e.config.yaxis[t].tooltip.offsetX+"px"):i.yaxisTTEls[t].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,n=this.ttCtx,s=n.getElTooltip(),r=n.tooltipRect,o=null!==i?parseFloat(i):1,l=parseFloat(t)+o+5,c=parseFloat(e)+o/2;if(l>a.globals.gridWidth/2&&(l=l-r.ttWidth-o-10),l>a.globals.gridWidth-r.ttWidth-10&&(l=a.globals.gridWidth-r.ttWidth),l<-20&&(l=-20),a.config.tooltip.followCursor){var d=n.getElGrid().getBoundingClientRect();c=n.e.clientY+a.globals.translateY-d.top-r.ttHeight/2}else a.globals.isBarHorizontal||(r.ttHeight/2+c>a.globals.gridHeight&&(c=a.globals.gridHeight-r.ttHeight+a.globals.translateY),c<0&&(c=0));isNaN(l)||(l+=a.globals.translateX,s.style.left=l+"px",s.style.top=c+"px")}},{key:"moveMarkers",value:function(t,e){var i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0)for(var n=i.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(t,"'] .apexcharts-marker")),s=0;s0&&(c.setAttribute("r",o),c.setAttribute("cx",i),c.setAttribute("cy",a)),this.moveXCrosshairs(i),s.fixedTooltip||this.moveTooltip(i,a,o)}}},{key:"moveDynamicPointsOnHover",value:function(t){var e,i=this.ttCtx,a=i.w,n=0,s=0,r=a.globals.pointsArray;e=new F(this.ctx).getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var o=i.tooltipUtil.getHoverMarkerSize(e);r[e]&&(n=r[e][t][0],s=r[e][t][1]);var l=i.tooltipUtil.getAllMarkers();if(null!==l)for(var c=0;c0?(l[c]&&l[c].setAttribute("r",o),l[c]&&l[c].setAttribute("cy",h)):l[c]&&l[c].setAttribute("r",0)}}if(this.moveXCrosshairs(n),!i.fixedTooltip){var f=s||a.globals.gridHeight;this.moveTooltip(n,f,o)}}},{key:"moveStickyTooltipOverBars",value:function(t){var e=this.w,i=this.ttCtx,a=e.globals.columnSeries?e.globals.columnSeries.length:e.globals.series.length,n=a>=2&&a%2==0?Math.floor(a/2):Math.floor(a/2)+1;e.globals.isBarHorizontal&&(n=new F(this.ctx).getActiveConfigSeriesIndex("desc")+1);var s=e.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(n,"'] path[j='").concat(t,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(n,"'] path[j='").concat(t,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(n,"'] path[j='").concat(t,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(n,"'] path[j='").concat(t,"']")),r=s?parseFloat(s.getAttribute("cx")):0,o=s?parseFloat(s.getAttribute("cy")):0,l=s?parseFloat(s.getAttribute("barWidth")):0,c=s?parseFloat(s.getAttribute("barHeight")):0,d=i.getElGrid().getBoundingClientRect(),h=s.classList.contains("apexcharts-candlestick-area")||s.classList.contains("apexcharts-boxPlot-area");if(e.globals.isXNumeric?(s&&!h&&(r-=a%2!=0?l/2:0),s&&h&&e.globals.comboCharts&&(r-=l/2)):e.globals.isBarHorizontal||(r=i.xAxisTicksPositions[t-1]+i.dataPointsDividedWidth/2,isNaN(r)&&(r=i.xAxisTicksPositions[t]-i.dataPointsDividedWidth/2)),e.globals.isBarHorizontal?(o>e.globals.gridHeight/2&&(o-=i.tooltipRect.ttHeight),(o=o+e.config.grid.padding.top+c/3)+c>e.globals.gridHeight&&(o=e.globals.gridHeight-c)):e.config.tooltip.followCursor?o=i.e.clientY-d.top-i.tooltipRect.ttHeight/2:o+i.tooltipRect.ttHeight+15>e.globals.gridHeight&&(o=e.globals.gridHeight),o<-10&&(o=-10),e.globals.isBarHorizontal||this.moveXCrosshairs(r),!i.fixedTooltip){var u=o||e.globals.gridHeight;this.moveTooltip(r,u)}}}]),t}(),vt=function(){function t(e){o(this,t),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx,this.tooltipPosition=new mt(e)}return c(t,[{key:"drawDynamicPoints",value:function(){var t=this.w,e=new C(this.ctx),i=new H(this.ctx),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");a=m(a),t.config.chart.stacked&&a.sort((function(t,e){return parseFloat(t.getAttribute("data:realIndex"))-parseFloat(e.getAttribute("data:realIndex"))}));for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this.w;"bubble"!==n.config.chart.type&&this.newPointSize(t,e);var s=e.getAttribute("cx"),r=e.getAttribute("cy");if(null!==i&&null!==a&&(s=i,r=a),this.tooltipPosition.moveXCrosshairs(s),!this.fixedTooltip){if("radar"===n.config.chart.type){var o=this.ttCtx.getElGrid().getBoundingClientRect();s=this.ttCtx.e.clientX-o.left}this.tooltipPosition.moveTooltip(s,r,n.config.markers.hover.size)}}},{key:"enlargePoints",value:function(t){for(var e=this.w,i=this,a=this.ttCtx,n=t,s=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),r=e.config.markers.hover.size,o=0;o=0?t[e].setAttribute("r",i):t[e].setAttribute("r",0)}}}]),t}(),xt=function(){function t(e){o(this,t),this.w=e.w,this.ttCtx=e}return c(t,[{key:"getAttr",value:function(t,e){return parseFloat(t.target.getAttribute(e))}},{key:"handleHeatTreeTooltip",value:function(t){var e=t.e,i=t.opt,a=t.x,n=t.y,s=t.type,r=this.ttCtx,o=this.w;if(e.target.classList.contains("apexcharts-".concat(s,"-rect"))){var l=this.getAttr(e,"i"),c=this.getAttr(e,"j"),d=this.getAttr(e,"cx"),h=this.getAttr(e,"cy"),u=this.getAttr(e,"width"),p=this.getAttr(e,"height");if(r.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:l,j:c,shared:!1,e:e}),o.globals.capturedSeriesIndex=l,o.globals.capturedDataPointIndex=c,a=d+r.tooltipRect.ttWidth/2+u,n=h+r.tooltipRect.ttHeight/2-p/2,r.tooltipPosition.moveXCrosshairs(d+u/2),a>o.globals.gridWidth/2&&(a=d-r.tooltipRect.ttWidth/2+u),r.w.config.tooltip.followCursor){var f=o.globals.dom.elWrap.getBoundingClientRect();a=o.globals.clientX-f.left-(a>o.globals.gridWidth/2?r.tooltipRect.ttWidth:0),n=o.globals.clientY-f.top-(n>o.globals.gridHeight/2?r.tooltipRect.ttHeight:0)}}return{x:a,y:n}}},{key:"handleMarkerTooltip",value:function(t){var e,i,a=t.e,n=t.opt,s=t.x,r=t.y,o=this.w,l=this.ttCtx;if(a.target.classList.contains("apexcharts-marker")){var c=parseInt(n.paths.getAttribute("cx"),10),d=parseInt(n.paths.getAttribute("cy"),10),h=parseFloat(n.paths.getAttribute("val"));if(i=parseInt(n.paths.getAttribute("rel"),10),e=parseInt(n.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,l.intersect){var u=b.findAncestor(n.paths,"apexcharts-series");u&&(e=parseInt(u.getAttribute("data:realIndex"),10))}if(l.tooltipLabels.drawSeriesTexts({ttItems:n.ttItems,i:e,j:i,shared:!l.showOnIntersect&&o.config.tooltip.shared,e:a}),"mouseup"===a.type&&l.markerClick(a,e,i),o.globals.capturedSeriesIndex=e,o.globals.capturedDataPointIndex=i,s=c,r=d+o.globals.translateY-1.4*l.tooltipRect.ttHeight,l.w.config.tooltip.followCursor){var p=l.getElGrid().getBoundingClientRect();r=l.e.clientY+o.globals.translateY-p.top}h<0&&(r=d),l.marker.enlargeCurrentPoint(i,n.paths,s,r)}return{x:s,y:r}}},{key:"handleBarTooltip",value:function(t){var e,i,a=t.e,n=t.opt,s=this.w,r=this.ttCtx,o=r.getElTooltip(),l=0,c=0,d=0,h=this.getBarTooltipXY({e:a,opt:n});e=h.i;var u=h.barHeight,p=h.j;s.globals.capturedSeriesIndex=e,s.globals.capturedDataPointIndex=p,s.globals.isBarHorizontal&&r.tooltipUtil.hasBars()||!s.config.tooltip.shared?(c=h.x,d=h.y,i=Array.isArray(s.config.stroke.width)?s.config.stroke.width[e]:s.config.stroke.width,l=c):s.globals.comboCharts||s.config.tooltip.shared||(l/=2),isNaN(d)?d=s.globals.svgHeight-r.tooltipRect.ttHeight:d<0&&(d=0);var f=parseInt(n.paths.parentNode.getAttribute("data:realIndex"),10),g=s.globals.isMultipleYAxis?s.config.yaxis[f]&&s.config.yaxis[f].reversed:s.config.yaxis[0].reversed;if(c+r.tooltipRect.ttWidth>s.globals.gridWidth&&!g?c-=r.tooltipRect.ttWidth:c<0&&(c=0),r.w.config.tooltip.followCursor){var m=r.getElGrid().getBoundingClientRect();d=r.e.clientY-m.top}null===r.tooltip&&(r.tooltip=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(s.globals.comboBarCount>0?r.tooltipPosition.moveXCrosshairs(l+i/2):r.tooltipPosition.moveXCrosshairs(l)),!r.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&r.tooltipUtil.hasBars())&&(g&&(c-=r.tooltipRect.ttWidth)<0&&(c=0),!g||s.globals.isBarHorizontal&&r.tooltipUtil.hasBars()||(d=d+u-2*(s.globals.series[e][p]<0?u:0)),r.tooltipRect.ttHeight+d>s.globals.gridHeight?d=s.globals.gridHeight-r.tooltipRect.ttHeight+s.globals.translateY:(d=d+s.globals.translateY-r.tooltipRect.ttHeight/2)<0&&(d=0),o.style.left=c+s.globals.translateX+"px",o.style.top=d+"px")}},{key:"getBarTooltipXY",value:function(t){var e=t.e,i=t.opt,a=this.w,n=null,s=this.ttCtx,r=0,o=0,l=0,c=0,d=0,h=e.target.classList;if(h.contains("apexcharts-bar-area")||h.contains("apexcharts-candlestick-area")||h.contains("apexcharts-boxPlot-area")||h.contains("apexcharts-rangebar-area")){var u=e.target,p=u.getBoundingClientRect(),f=i.elGrid.getBoundingClientRect(),g=p.height;d=p.height;var m=p.width,v=parseInt(u.getAttribute("cx"),10),x=parseInt(u.getAttribute("cy"),10);c=parseFloat(u.getAttribute("barWidth"));var b="touchmove"===e.type?e.touches[0].clientX:e.clientX;n=parseInt(u.getAttribute("j"),10),r=parseInt(u.parentNode.getAttribute("rel"),10)-1;var y=u.getAttribute("data-range-y1"),w=u.getAttribute("data-range-y2");a.globals.comboCharts&&(r=parseInt(u.parentNode.getAttribute("data:realIndex"),10)),s.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:r,j:n,y1:y?parseInt(y,10):null,y2:w?parseInt(w,10):null,shared:!s.showOnIntersect&&a.config.tooltip.shared,e:e}),a.config.tooltip.followCursor?a.globals.isBarHorizontal?(o=b-f.left+15,l=x-s.dataPointsDividedHeight+g/2-s.tooltipRect.ttHeight/2):(o=a.globals.isXNumeric?v-m/2:v-s.dataPointsDividedWidth+m/2,l=e.clientY-f.top-s.tooltipRect.ttHeight/2-15):a.globals.isBarHorizontal?((o=v)0&&i.setAttribute("width",e.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var t=this.w,e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(t,e,i){var a=this.ttCtx,n=this.w,s=n.globals.yLabelFormatters[t];if(a.yaxisTooltips[t]){var r=a.getElGrid().getBoundingClientRect(),o=(e-r.top)*i.yRatio[t],l=n.globals.maxYArr[t]-n.globals.minYArr[t],c=n.globals.minYArr[t]+(l-o);a.tooltipPosition.moveYCrosshairs(e-r.top),a.yaxisTooltipText[t].innerHTML=s(c),a.tooltipPosition.moveYAxisTooltip(t)}}}]),t}(),yt=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.tConfig=i.config.tooltip,this.tooltipUtil=new ft(this),this.tooltipLabels=new gt(this),this.tooltipPosition=new mt(this),this.marker=new vt(this),this.intersect=new xt(this),this.axesTooltip=new bt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!i.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return c(t,[{key:"getElTooltip",value:function(t){return t||(t=this),t.w.globals.dom.baseEl?t.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(t){var e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map((function(t,i){return!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)})),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);var i=document.createElement("div");if(i.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&i.classList.add(e.config.tooltip.cssClass),i.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),e.globals.dom.elWrap.appendChild(i),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var a=new G(this.ctx);this.xAxisTicksPositions=a.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==e.config.markers.size&&0!==e.globals.markers.largestSize||this.marker.drawDynamicPoints(this),e.globals.collapsedSeries.length!==e.globals.series.length){this.dataPointsDividedHeight=e.globals.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.globals.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));var n=e.globals.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(n=this.showOnIntersect?1:e.globals.series.length),this.legendLabels=e.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(n),this.addSVGEvents()}}},{key:"createTTElements",value:function(t){for(var e=this,i=this.w,a=[],n=this.getElTooltip(),s=function(s){var r=document.createElement("div");r.classList.add("apexcharts-tooltip-series-group"),r.style.order=i.config.tooltip.inverseOrder?t-s:s+1,e.tConfig.shared&&e.tConfig.enabledOnSeries&&Array.isArray(e.tConfig.enabledOnSeries)&&e.tConfig.enabledOnSeries.indexOf(s)<0&&r.classList.add("apexcharts-tooltip-series-group-hidden");var o=document.createElement("span");o.classList.add("apexcharts-tooltip-marker"),o.style.backgroundColor=i.globals.colors[s],r.appendChild(o);var l=document.createElement("div");l.classList.add("apexcharts-tooltip-text"),l.style.fontFamily=e.tConfig.style.fontFamily||i.config.chart.fontFamily,l.style.fontSize=e.tConfig.style.fontSize,["y","goals","z"].forEach((function(t){var e=document.createElement("div");e.classList.add("apexcharts-tooltip-".concat(t,"-group"));var i=document.createElement("span");i.classList.add("apexcharts-tooltip-text-".concat(t,"-label")),e.appendChild(i);var a=document.createElement("span");a.classList.add("apexcharts-tooltip-text-".concat(t,"-value")),e.appendChild(a),l.appendChild(e)})),r.appendChild(l),n.appendChild(r),a.push(r)},r=0;r0&&this.addPathsEventListeners(p,d),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(d)}}},{key:"drawFixedTooltipRect",value:function(){var t=this.w,e=this.getElTooltip(),i=e.getBoundingClientRect(),a=i.width+10,n=i.height+10,s=this.tConfig.fixed.offsetX,r=this.tConfig.fixed.offsetY,o=this.tConfig.fixed.position.toLowerCase();return o.indexOf("right")>-1&&(s=s+t.globals.svgWidth-a+10),o.indexOf("bottom")>-1&&(r=r+t.globals.svgHeight-n-10),e.style.left=s+"px",e.style.top=r+"px",{x:s,y:r,ttWidth:a,ttHeight:n}}},{key:"addDatapointEventsListeners",value:function(t){var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}},{key:"addPathsEventListeners",value:function(t,e){for(var i=this,a=function(a){var n={paths:t[a],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map((function(e){return t[a].addEventListener(e,i.onSeriesHover.bind(i,n),{capture:!1,passive:!0})}))},n=0;n=100?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout((function(){i.seriesHover(t,e)}),100-a))}},{key:"seriesHover",value:function(t,e){var i=this;this.lastHoverTime=Date.now();var a=[],n=this.w;n.config.chart.group&&(a=this.ctx.getGroupedCharts()),n.globals.axisCharts&&(n.globals.minX===-1/0&&n.globals.maxX===1/0||0===n.globals.dataPoints)||(a.length?a.forEach((function(a){var n=i.getElTooltip(a),s={paths:t.paths,tooltipEl:n,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:a.w.globals.tooltip.ttItems};a.w.globals.minX===i.w.globals.minX&&a.w.globals.maxX===i.w.globals.maxX&&a.w.globals.tooltip.seriesHoverByContext({chartCtx:a,ttCtx:a.w.globals.tooltip,opt:s,e:e})})):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}},{key:"seriesHoverByContext",value:function(t){var e=t.chartCtx,i=t.ttCtx,a=t.opt,n=t.e,s=e.w,r=this.getElTooltip();r&&(i.tooltipRect={x:0,y:0,ttWidth:r.getBoundingClientRect().width,ttHeight:r.getBoundingClientRect().height},i.e=n,!i.tooltipUtil.hasBars()||s.globals.comboCharts||i.isBarShared||this.tConfig.onDatasetHover.highlightDataSeries&&new F(e).toggleSeriesOnHover(n,n.target.parentNode),i.fixedTooltip&&i.drawFixedTooltipRect(),s.globals.axisCharts?i.axisChartsTooltips({e:n,opt:a,tooltipRect:i.tooltipRect}):i.nonAxisChartsTooltips({e:n,opt:a,tooltipRect:i.tooltipRect}))}},{key:"axisChartsTooltips",value:function(t){var e,i,a=t.e,n=t.opt,s=this.w,r=n.elGrid.getBoundingClientRect(),o="touchmove"===a.type?a.touches[0].clientX:a.clientX,l="touchmove"===a.type?a.touches[0].clientY:a.clientY;if(this.clientY=l,this.clientX=o,s.globals.capturedSeriesIndex=-1,s.globals.capturedDataPointIndex=-1,lr.top+r.height)this.handleMouseOut(n);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!s.config.tooltip.shared){var c=parseInt(n.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(c)<0)return void this.handleMouseOut(n)}var d=this.getElTooltip(),h=this.getElXCrosshairs(),u=s.globals.xyCharts||"bar"===s.config.chart.type&&!s.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||s.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===a.type||"touchmove"===a.type||"mouseup"===a.type){if(s.globals.collapsedSeries.length+s.globals.ancillaryCollapsedSeries.length===s.globals.series.length)return;null!==h&&h.classList.add("apexcharts-active");var p=this.yaxisTooltips.filter((function(t){return!0===t}));if(null!==this.ycrosshairs&&p.length&&this.ycrosshairs.classList.add("apexcharts-active"),u&&!this.showOnIntersect)this.handleStickyTooltip(a,o,l,n);else if("heatmap"===s.config.chart.type||"treemap"===s.config.chart.type){var f=this.intersect.handleHeatTreeTooltip({e:a,opt:n,x:e,y:i,type:s.config.chart.type});e=f.x,i=f.y,d.style.left=e+"px",d.style.top=i+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:a,opt:n}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:a,opt:n,x:e,y:i});if(this.yaxisTooltips.length)for(var g=0;gl.width?this.handleMouseOut(a):null!==o?this.handleStickyCapturedSeries(t,o,a,r):(this.tooltipUtil.isXoverlap(r)||n.globals.isBarHorizontal)&&this.create(t,this,0,r,a.ttItems)}},{key:"handleStickyCapturedSeries",value:function(t,e,i,a){var n=this.w;this.tConfig.shared||null!==n.globals.series[e][a]?void 0!==n.globals.series[e][a]?this.tConfig.shared&&this.tooltipUtil.isXoverlap(a)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,a,i.ttItems):this.create(t,this,e,a,i.ttItems,!1):this.tooltipUtil.isXoverlap(a)&&this.create(t,this,0,a,i.ttItems):this.handleMouseOut(i)}},{key:"deactivateHoverFilter",value:function(){for(var t=this.w,e=new C(this.ctx),i=t.globals.dom.Paper.select(".apexcharts-bar-area"),a=0;a5&&void 0!==arguments[5]?arguments[5]:null,r=this.w,o=e;"mouseup"===t.type&&this.markerClick(t,i,a),null===s&&(s=this.tConfig.shared);var l=this.tooltipUtil.hasMarkers(),c=this.tooltipUtil.getElBars();if(r.config.legend.tooltipHoverFormatter){var d=r.config.legend.tooltipHoverFormatter,h=Array.from(this.legendLabels);h.forEach((function(t){var e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)}));for(var u=0;u0?o.marker.enlargePoints(a):o.tooltipPosition.moveDynamicPointsOnHover(a)),this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(c),this.barSeriesHeight>0)){var v=new C(this.ctx),x=r.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(a,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(a);for(var b=0;bn.globals.gridHeight&&(p=n.globals.gridHeight-v)),{bcx:c,bcy:l,dataLabelsX:e,dataLabelsY:p,totalDataLabelsX:a,totalDataLabelsY:i,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(t){var e=this.w,i=t.x,a=t.i,n=t.j,s=t.realIndex,r=t.bcy,o=t.barHeight,l=t.barWidth,c=t.textRects,d=t.dataLabelsX,h=t.strokeWidth,u=t.dataLabelsConfig,p=t.barDataLabelsConfig,f=t.barTotalDataLabelsConfig,g=t.offX,m=t.offY,v=e.globals.gridHeight/e.globals.dataPoints;l=Math.abs(l);var x,b,y=r-(this.barCtx.isRangeBar?0:v)+o/2+c.height/2+m-3,w="start",S=this.barCtx.series[a][n]<0,k=i;switch(this.barCtx.isReversed&&(k=i+l-(S?2*l:0),i=e.globals.gridWidth-l),p.position){case"center":d=S?k+l/2-g:Math.max(c.width/2,k-l/2)+g;break;case"bottom":d=S?k+l-h-Math.round(c.width/2)-g:k-l+h+Math.round(c.width/2)+g;break;case"top":d=S?k-h+Math.round(c.width/2)-g:k-h-Math.round(c.width/2)+g}if(this.barCtx.lastActiveBarSerieIndex===s&&f.enabled){var A=new C(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:s,j:n}),u.fontSize);S?(x=k-h+Math.round(A.width/2)-g-f.offsetX-15,w="end"):x=k-h-Math.round(A.width/2)+g+f.offsetX+15,b=y+f.offsetY}return e.config.chart.stacked||(d<0?d=d+c.width+h:d+c.width/2>e.globals.gridWidth&&(d=e.globals.gridWidth-c.width-h)),{bcx:i,bcy:r,dataLabelsX:d,dataLabelsY:y,totalDataLabelsX:x,totalDataLabelsY:b,totalDataLabelsAnchor:w}}},{key:"drawCalculatedDataLabels",value:function(t){var e=t.x,i=t.y,a=t.val,n=t.i,r=t.j,o=t.textRects,l=t.barHeight,c=t.barWidth,d=t.dataLabelsConfig,h=this.w,u="rotate(0)";"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&(u="rotate(-90, ".concat(e,", ").concat(i,")"));var p=new X(this.barCtx.ctx),f=new C(this.barCtx.ctx),g=d.formatter,m=null,v=h.globals.collapsedSeriesIndices.indexOf(n)>-1;if(d.enabled&&!v){m=f.group({class:"apexcharts-data-labels",transform:u});var x="";void 0!==a&&(x=g(a,s(s({},h),{},{seriesIndex:n,dataPointIndex:r,w:h})));var b=h.globals.series[n][r]<0,y=h.config.plotOptions.bar.dataLabels.position;"vertical"===h.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(d.textAnchor=b?"end":"start"),"center"===y&&(d.textAnchor="middle"),"bottom"===y&&(d.textAnchor=b?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&cMath.abs(c)&&(x=""):o.height/1.6>Math.abs(l)&&(x=""));var w=s({},d);this.barCtx.isHorizontal&&a<0&&("start"===d.textAnchor?w.textAnchor="end":"end"===d.textAnchor&&(w.textAnchor="start")),p.plotDataLabelsText({x:e,y:i,text:x,i:n,j:r,parent:m,dataLabelsConfig:w,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return m}},{key:"drawTotalDataLabels",value:function(t){var e,i=t.x,a=t.y,n=t.val,s=t.realIndex,r=t.textAnchor,o=t.barTotalDataLabelsConfig,l=new C(this.barCtx.ctx);return o.enabled&&void 0!==i&&void 0!==a&&this.barCtx.lastActiveBarSerieIndex===s&&(e=l.drawText({x:i,y:a,foreColor:o.style.color,text:n,textAnchor:r,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),e}}]),t}(),Ct=function(){function t(e){o(this,t),this.w=e.w,this.barCtx=e}return c(t,[{key:"initVariables",value:function(t){var e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var i=0;i0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.globals.isXNumeric)for(var a=0;ae.globals.minX&&e.globals.seriesX[i][a]0&&(a=l.globals.minXDiff/h),(s=a/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(s=1)}r=l.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.yaxisIndex]-(this.barCtx.isReversed?l.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.yaxisIndex]:0),t=l.globals.padHorizontal+(a-s*this.barCtx.seriesLen)/2}return{x:t,y:e,yDivision:i,xDivision:a,barHeight:n,barWidth:s,zeroH:r,zeroW:o}}},{key:"getPathFillColor",value:function(t,e,i,a){var n,s,r,o,l=this.w,c=new $(this.barCtx.ctx),d=null,h=this.barCtx.barOptions.distributed?i:e;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map((function(a){t[e][i]>=a.from&&t[e][i]<=a.to&&(d=a.color)})),l.config.series[e].data[i]&&l.config.series[e].data[i].fillColor&&(d=l.config.series[e].data[i].fillColor),c.fillPath({seriesNumber:this.barCtx.barOptions.distributed?h:a,dataPointIndex:i,color:d,value:t[e][i],fillConfig:null===(n=l.config.series[e].data[i])||void 0===n?void 0:n.fill,fillType:null!==(s=l.config.series[e].data[i])&&void 0!==s&&null!==(r=s.fill)&&void 0!==r&&r.type?null===(o=l.config.series[e].data[i])||void 0===o?void 0:o.fill.type:l.config.fill.type})}},{key:"getStrokeWidth",value:function(t,e,i){var a=0,n=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,n.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),a}},{key:"shouldApplyRadius",value:function(t){var e=this.w,i=!1;return e.config.plotOptions.bar.borderRadius>0&&(e.config.chart.stacked&&"last"===e.config.plotOptions.bar.borderRadiusWhenStacked?this.barCtx.lastActiveBarSerieIndex===t&&(i=!0):i=!0),i}},{key:"barBackground",value:function(t){var e=t.j,i=t.i,a=t.x1,n=t.x2,s=t.y1,r=t.y2,o=t.elSeries,l=this.w,c=new C(this.barCtx.ctx),d=new F(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&d===i){e>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(e%=this.barCtx.barOptions.colors.backgroundBarColors.length);var h=this.barCtx.barOptions.colors.backgroundBarColors[e],u=c.drawRect(void 0!==a?a:0,void 0!==s?s:0,void 0!==n?n:l.globals.gridWidth,void 0!==r?r:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,h,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(u),u.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(t){var e,i=t.barWidth,a=t.barXPosition,n=t.y1,s=t.y2,r=t.strokeWidth,o=t.realIndex,l=t.i,c=t.j,d=t.w,h=new C(this.barCtx.ctx);(r=Array.isArray(r)?r[o]:r)||(r=0);var u=i,p=a;null!==(e=d.config.series[o].data[c])&&void 0!==e&&e.columnWidthOffset&&(p=a-d.config.series[o].data[c].columnWidthOffset/2,u=i+d.config.series[o].data[c].columnWidthOffset);var f=p,g=p+u;n+=.001,s+=.001;var m=h.move(f,n),v=h.move(f,n),x=h.line(g-r,n);return d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(o,c,!1)),m=m+h.line(f,s)+h.line(g-r,s)+h.line(g-r,n)+("around"===d.config.plotOptions.bar.borderRadiusApplication?" Z":" z"),v=v+h.line(f,n)+x+x+x+x+x+h.line(f,n)+("around"===d.config.plotOptions.bar.borderRadiusApplication?" Z":" z"),this.shouldApplyRadius(o)&&(m=h.roundPathCorners(m,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked&&(this.barCtx.yArrj.push(s),this.barCtx.yArrjF.push(Math.abs(n-s)),this.barCtx.yArrjVal.push(this.barCtx.series[l][c])),{pathTo:m,pathFrom:v}}},{key:"getBarpaths",value:function(t){var e,i=t.barYPosition,a=t.barHeight,n=t.x1,s=t.x2,r=t.strokeWidth,o=t.realIndex,l=t.i,c=t.j,d=t.w,h=new C(this.barCtx.ctx);(r=Array.isArray(r)?r[o]:r)||(r=0);var u=i,p=a;null!==(e=d.config.series[o].data[c])&&void 0!==e&&e.barHeightOffset&&(u=i-d.config.series[o].data[c].barHeightOffset/2,p=a+d.config.series[o].data[c].barHeightOffset);var f=u,g=u+p;n+=.001,s+=.001;var m=h.move(n,f),v=h.move(n,f);d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(o,c,!1));var x=h.line(n,g-r);return m=m+h.line(s,f)+h.line(s,g-r)+x+("around"===d.config.plotOptions.bar.borderRadiusApplication?" Z":" z"),v=v+h.line(n,f)+x+x+x+x+x+h.line(n,f)+("around"===d.config.plotOptions.bar.borderRadiusApplication?" Z":" z"),this.shouldApplyRadius(o)&&(m=h.roundPathCorners(m,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked&&(this.barCtx.xArrj.push(s),this.barCtx.xArrjF.push(Math.abs(n-s)),this.barCtx.xArrjVal.push(this.barCtx.series[l][c])),{pathTo:m,pathFrom:v}}},{key:"checkZeroSeries",value:function(t){for(var e=t.series,i=this.w,a=0;a=0;r--)this.barCtx.zeroSerieses.indexOf(r)>-1&&r===this.radiusOnSeriesNumber&&(this.barCtx.radiusOnSeriesNumber-=1);for(var o=e.length-1;o>=0;o--)i.globals.collapsedSeriesIndices.indexOf(this.barCtx.radiusOnSeriesNumber)>-1&&(this.barCtx.radiusOnSeriesNumber-=1)}},{key:"getXForValue",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?null:e;return null!=t&&(i=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),i}},{key:"getYForValue",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?null:e;return null!=t&&(i=e-t/this.barCtx.yRatio[this.barCtx.yaxisIndex]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[this.barCtx.yaxisIndex]:0)),i}},{key:"getGoalValues",value:function(t,e,i,a,n){var s=this,r=this.w,o=[];return r.globals.seriesGoals[a]&&r.globals.seriesGoals[a][n]&&Array.isArray(r.globals.seriesGoals[a][n])&&r.globals.seriesGoals[a][n].forEach((function(a){var n;o.push((d(n={},t,"x"===t?s.getXForValue(a.value,e,!1):s.getYForValue(a.value,i,!1)),d(n,"attrs",a),n))})),o}},{key:"drawGoalLine",value:function(t){var e=t.barXPosition,i=t.barYPosition,a=t.goalX,n=t.goalY,s=t.barWidth,r=t.barHeight,o=new C(this.barCtx.ctx),l=o.group({className:"apexcharts-bar-goals-groups"}),c=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach((function(t){var e=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=i+e+r/2;c=o.drawLine(t.x,a-2*e,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(c)})):Array.isArray(n)&&n.forEach((function(t){var i=void 0!==t.attrs.strokeWidth?t.attrs.strokeWidth:s/2,a=e+i+s/2;c=o.drawLine(a-2*i,t.y,a,t.y,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeHeight?t.attrs.strokeHeight:2,t.attrs.strokeLineCap),l.add(c)})),l}}]),t}(),St=function(){function t(e,i){o(this,t),this.ctx=e,this.w=e.w;var a=this.w;this.barOptions=a.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=a.config.stroke.width,this.isNullValue=!1,this.isRangeBar=a.globals.seriesRange.length&&this.isHorizontal,this.xyRatios=i,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.initialXRatio=i.initialXRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.baseLineInvertedY),this.yaxisIndex=0,this.seriesLen=0;var n=new F(this.ctx);this.lastActiveBarSerieIndex=n.getActiveConfigSeriesIndex("desc",["bar","column"]);var s=n.getBarSeriesIndices(),r=new S(this.ctx);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((function(t,e){return-1===s.indexOf(e)?e:-1})).filter((function(t){return-1!==t}))),this.barHelpers=new Ct(this)}return c(t,[{key:"draw",value:function(t,e){var i=this.w,a=new C(this.ctx),n=new S(this.ctx,i);t=n.getLogSeries(t),this.series=t,this.yRatio=n.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);var r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering.");for(var o=0,l=0;o0&&(this.visibleI=this.visibleI+1);var y=0,w=0;this.yRatio.length>1&&(this.yaxisIndex=v),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;var k=this.barHelpers.initialPositions();f=k.y,y=k.barHeight,d=k.yDivision,u=k.zeroW,p=k.x,w=k.barWidth,c=k.xDivision,h=k.zeroH,this.horizontal||m.push(p+w/2);for(var A=a.group({class:"apexcharts-datalabels","data:realIndex":v}),P=a.group({class:"apexcharts-bar-goals-markers",style:"pointer-events: none"}),E=0;E0&&m.push(p+w/2),g.push(f);var I=this.barHelpers.getPathFillColor(t,o,E,v);this.renderSeries({realIndex:v,pathFill:I,j:E,i:o,pathFrom:O.pathFrom,pathTo:O.pathTo,strokeWidth:T,elSeries:x,x:p,y:f,series:t,barHeight:y,barWidth:w,elDataLabelsWrap:A,elGoalsMarkers:P,visibleSeries:this.visibleI,type:"bar"})}i.globals.seriesXvalues[v]=m,i.globals.seriesYvalues[v]=g,r.add(x)}return r}},{key:"renderSeries",value:function(t){var e=t.realIndex,i=t.pathFill,a=t.lineFill,n=t.j,s=t.i,r=t.pathFrom,o=t.pathTo,l=t.strokeWidth,c=t.elSeries,d=t.x,h=t.y,u=t.y1,p=t.y2,f=t.series,g=t.barHeight,m=t.barWidth,v=t.barYPosition,x=t.elDataLabelsWrap,b=t.elGoalsMarkers,y=t.visibleSeries,S=t.type,k=this.w,A=new C(this.ctx);a||(a=this.barOptions.distributed?k.globals.stroke.colors[n]:k.globals.stroke.colors[e]),k.config.series[s].data[n]&&k.config.series[s].data[n].strokeColor&&(a=k.config.series[s].data[n].strokeColor),this.isNullValue&&(i="none");var P=n/k.config.chart.animations.animateGradually.delay*(k.config.chart.animations.speed/k.globals.dataPoints)/2.4,E=A.renderPaths({i:s,j:n,realIndex:e,pathFrom:r,pathTo:o,stroke:a,strokeWidth:l,strokeLineCap:k.config.stroke.lineCap,fill:i,animationDelay:P,initialSpeed:k.config.chart.animations.speed,dataChangeSpeed:k.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(S,"-area")});E.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")"));var T=k.config.forecastDataPoints;T.count>0&&n>=k.globals.dataPoints-T.count&&(E.node.setAttribute("stroke-dasharray",T.dashArray),E.node.setAttribute("stroke-width",T.strokeWidth),E.node.setAttribute("fill-opacity",T.fillOpacity)),void 0!==u&&void 0!==p&&(E.attr("data-range-y1",u),E.attr("data-range-y2",p)),new w(this.ctx).setSelectionFilter(E,e,n),c.add(E);var O=new wt(this).handleBarDataLabels({x:d,y:h,y1:u,y2:p,i:s,j:n,series:f,realIndex:e,barHeight:g,barWidth:m,barYPosition:v,renderedPath:E,visibleSeries:y});return null!==O.dataLabels&&x.add(O.dataLabels),O.totalDataLabels&&x.add(O.totalDataLabels),c.add(x),b&&c.add(b),c}},{key:"drawBarPaths",value:function(t){var e=t.indexes,i=t.barHeight,a=t.strokeWidth,n=t.zeroW,s=t.x,r=t.y,o=t.yDivision,l=t.elSeries,c=this.w,d=e.i,h=e.j;c.globals.isXNumeric&&(r=(c.globals.seriesX[d][h]-c.globals.minX)/this.invertedXRatio-i);var u=r+i*this.visibleI;s=this.barHelpers.getXForValue(this.series[d][h],n);var p=this.barHelpers.getBarpaths({barYPosition:u,barHeight:i,x1:n,x2:s,strokeWidth:a,series:this.series,realIndex:e.realIndex,i:d,j:h,w:c});return c.globals.isXNumeric||(r+=o),this.barHelpers.barBackground({j:h,i:d,y1:u-i*this.visibleI,y2:i*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:s,y:r,goalX:this.barHelpers.getGoalValues("x",n,null,d,h),barYPosition:u}}},{key:"drawColumnPaths",value:function(t){var e=t.indexes,i=t.x,a=t.y,n=t.xDivision,s=t.barWidth,r=t.zeroH,o=t.strokeWidth,l=t.elSeries,c=this.w,d=e.realIndex,h=e.i,u=e.j,p=e.bc;if(c.globals.isXNumeric){var f=d;c.globals.seriesX[d].length||(f=c.globals.maxValsInArrayIndex),i=(c.globals.seriesX[f][u]-c.globals.minX)/this.xRatio-s*this.seriesLen/2}var g=i+s*this.visibleI;a=this.barHelpers.getYForValue(this.series[h][u],r);var m=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:s,y1:r,y2:a,strokeWidth:o,series:this.series,realIndex:e.realIndex,i:h,j:u,w:c});return c.globals.isXNumeric||(i+=n),this.barHelpers.barBackground({bc:p,j:u,i:h,x1:g-o/2-s*this.visibleI,x2:s*this.seriesLen+o/2,elSeries:l}),{pathTo:m.pathTo,pathFrom:m.pathFrom,x:i,y:a,goalY:this.barHelpers.getGoalValues("y",null,r,h,u),barXPosition:g}}},{key:"getPreviousPath",value:function(t,e){for(var i,a=this.w,n=0;n0&&parseInt(s.realIndex,10)===parseInt(t,10)&&void 0!==a.globals.previousPaths[n].paths[e]&&(i=a.globals.previousPaths[n].paths[e].d)}return i}}]),t}(),kt=function(t){h(i,t);var e=g(i);function i(){return o(this,i),e.apply(this,arguments)}return c(i,[{key:"draw",value:function(t,e){var i=this,a=this.w;this.graphics=new C(this.ctx),this.bar=new St(this.ctx,this.xyRatios);var n=new S(this.ctx,a);t=n.getLogSeries(t),this.yRatio=n.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===a.config.chart.stackType&&(t=a.globals.seriesPercent.slice()),this.series=t,this.totalItems=0,this.prevY=[],this.prevX=[],this.prevYF=[],this.prevXF=[],this.prevYVal=[],this.prevXVal=[],this.xArrj=[],this.xArrjF=[],this.xArrjVal=[],this.yArrj=[],this.yArrjF=[],this.yArrjVal=[];for(var r=0;r0&&(this.totalItems+=t[r].length);for(var o=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),l=0,c=0,d=function(n,r){var d=void 0,h=void 0,u=void 0,p=void 0,f=[],g=[],m=a.globals.comboCharts?e[n]:n;i.yRatio.length>1&&(i.yaxisIndex=m),i.isReversed=a.config.yaxis[i.yaxisIndex]&&a.config.yaxis[i.yaxisIndex].reversed;var v=i.graphics.group({class:"apexcharts-series",seriesName:b.escapeString(a.globals.seriesNames[m]),rel:n+1,"data:realIndex":m});i.ctx.series.addCollapsedClassToSeries(v,m);var x=i.graphics.group({class:"apexcharts-datalabels","data:realIndex":m}),y=i.graphics.group({class:"apexcharts-bar-goals-markers",style:"pointer-events: none"}),w=0,C=0,S=i.initialPositions(l,c,d,h,u,p);c=S.y,w=S.barHeight,h=S.yDivision,p=S.zeroW,l=S.x,C=S.barWidth,d=S.xDivision,u=S.zeroH,i.yArrj=[],i.yArrjF=[],i.yArrjVal=[],i.xArrj=[],i.xArrjF=[],i.xArrjVal=[],1===i.prevY.length&&i.prevY[0].every((function(t){return isNaN(t)}))&&(i.prevY[0]=i.prevY[0].map((function(t){return u})),i.prevYF[0]=i.prevYF[0].map((function(t){return 0})));for(var k=0;k1?(i=l.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:o*parseInt(l.config.plotOptions.bar.columnWidth,10)/100,n=l.globals.gridHeight-this.baseLineY[this.yaxisIndex]-(this.isReversed?l.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),t=l.globals.padHorizontal+(i-o)/2),{x:t,y:e,yDivision:a,xDivision:i,barHeight:r,barWidth:o,zeroH:n,zeroW:s}}},{key:"drawStackedBarPaths",value:function(t){for(var e,i=t.indexes,a=t.barHeight,n=t.strokeWidth,s=t.zeroW,r=t.x,o=t.y,l=t.yDivision,c=t.elSeries,d=this.w,h=o,u=i.i,p=i.j,f=0,g=0;g0){var m=s;this.prevXVal[u-1][p]<0?m=this.series[u][p]>=0?this.prevX[u-1][p]+f-2*(this.isReversed?f:0):this.prevX[u-1][p]:this.prevXVal[u-1][p]>=0&&(m=this.series[u][p]>=0?this.prevX[u-1][p]:this.prevX[u-1][p]-f+2*(this.isReversed?f:0)),e=m}else e=s;r=null===this.series[u][p]?e:e+this.series[u][p]/this.invertedYRatio-2*(this.isReversed?this.series[u][p]/this.invertedYRatio:0);var v=this.barHelpers.getBarpaths({barYPosition:h,barHeight:a,x1:e,x2:r,strokeWidth:n,series:this.series,realIndex:i.realIndex,i:u,j:p,w:d});return this.barHelpers.barBackground({j:p,i:u,y1:h,y2:a,elSeries:c}),o+=l,{pathTo:v.pathTo,pathFrom:v.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,u,p),barYPosition:h,x:r,y:o}}},{key:"drawStackedColumnPaths",value:function(t){var e=t.indexes,i=t.x,a=t.y,n=t.xDivision,s=t.barWidth,r=t.zeroH;t.strokeWidth;var o=t.elSeries,l=this.w,c=e.i,d=e.j,h=e.bc;if(l.globals.isXNumeric){var u=l.globals.seriesX[c][d];u||(u=0),i=(u-l.globals.minX)/this.xRatio-s/2}for(var p,f=i,g=0,m=0;m0&&!l.globals.isXNumeric||c>0&&l.globals.isXNumeric&&l.globals.seriesX[c-1][d]===l.globals.seriesX[c][d]){var v,x,b=Math.min(this.yRatio.length+1,c+1);if(void 0!==this.prevY[c-1])for(var y=1;y=0?x-g+2*(this.isReversed?g:0):x;break}if(this.prevYVal[c-w][d]>=0){v=this.series[c][d]>=0?x:x+g-2*(this.isReversed?g:0);break}}void 0===v&&(v=l.globals.gridHeight),p=this.prevYF[0].every((function(t){return 0===t}))&&this.prevYF.slice(1,c).every((function(t){return t.every((function(t){return isNaN(t)}))}))?r:v}else p=r;a=p-this.series[c][d]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[c][d]/this.yRatio[this.yaxisIndex]:0);var C=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:s,y1:p,y2:a,yRatio:this.yRatio[this.yaxisIndex],strokeWidth:this.strokeWidth,series:this.series,realIndex:e.realIndex,i:c,j:d,w:l});return this.barHelpers.barBackground({bc:h,j:d,i:c,x1:f,x2:s,elSeries:o}),i+=n,{pathTo:C.pathTo,pathFrom:C.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,c,d),barXPosition:f,x:l.globals.isXNumeric?i-n:i,y:a}}}]),i}(St),At=function(t){h(i,t);var e=g(i);function i(){return o(this,i),e.apply(this,arguments)}return c(i,[{key:"draw",value:function(t,e){var i=this,a=this.w,n=new C(this.ctx),r=new $(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=a.config.plotOptions.bar.horizontal;var o=new S(this.ctx,a);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);for(var l=n.group({class:"apexcharts-".concat(a.config.chart.type,"-series apexcharts-plot-series")}),c=function(o){i.isBoxPlot="boxPlot"===a.config.chart.type||"boxPlot"===a.config.series[o].type;var c,d,h,u,p,f,g=void 0,m=void 0,v=[],x=[],y=a.globals.comboCharts?e[o]:o,w=n.group({class:"apexcharts-series",seriesName:b.escapeString(a.globals.seriesNames[y]),rel:o+1,"data:realIndex":y});i.ctx.series.addCollapsedClassToSeries(w,y),t[o].length>0&&(i.visibleI=i.visibleI+1),i.yRatio.length>1&&(i.yaxisIndex=y);var C=i.barHelpers.initialPositions();m=C.y,p=C.barHeight,d=C.yDivision,u=C.zeroW,g=C.x,f=C.barWidth,c=C.xDivision,h=C.zeroH,x.push(g+f/2);for(var S=n.group({class:"apexcharts-datalabels","data:realIndex":y}),k=function(e){var n=i.barHelpers.getStrokeWidth(o,e,y),l=null,b={indexes:{i:o,j:e,realIndex:y},x:g,y:m,strokeWidth:n,elSeries:w};l=i.isHorizontal?i.drawHorizontalBoxPaths(s(s({},b),{},{yDivision:d,barHeight:p,zeroW:u})):i.drawVerticalBoxPaths(s(s({},b),{},{xDivision:c,barWidth:f,zeroH:h})),m=l.y,g=l.x,e>0&&x.push(g+f/2),v.push(m),l.pathTo.forEach((function(s,c){var d=!i.isBoxPlot&&i.candlestickOptions.wick.useFillColor?l.color[c]:a.globals.stroke.colors[o],h=r.fillPath({seriesNumber:y,dataPointIndex:e,color:l.color[c],value:t[o][e]});i.renderSeries({realIndex:y,pathFill:h,lineFill:d,j:e,i:o,pathFrom:l.pathFrom,pathTo:s,strokeWidth:n,elSeries:w,x:g,y:m,series:t,barHeight:p,barWidth:f,elDataLabelsWrap:S,visibleSeries:i.visibleI,type:a.config.chart.type})}))},A=0;Av.c&&(h=!1);var y=Math.min(v.o,v.c),w=Math.max(v.o,v.c),S=v.m;o.globals.isXNumeric&&(i=(o.globals.seriesX[m][d]-o.globals.minX)/this.xRatio-n/2);var k=i+n*this.visibleI;void 0===this.series[c][d]||null===this.series[c][d]?(y=s,w=s):(y=s-y/g,w=s-w/g,x=s-v.h/g,b=s-v.l/g,S=s-v.m/g);var A=l.move(k,s),P=l.move(k+n/2,y);return o.globals.previousPaths.length>0&&(P=this.getPreviousPath(m,d,!0)),A=this.isBoxPlot?[l.move(k,y)+l.line(k+n/2,y)+l.line(k+n/2,x)+l.line(k+n/4,x)+l.line(k+n-n/4,x)+l.line(k+n/2,x)+l.line(k+n/2,y)+l.line(k+n,y)+l.line(k+n,S)+l.line(k,S)+l.line(k,y+r/2),l.move(k,S)+l.line(k+n,S)+l.line(k+n,w)+l.line(k+n/2,w)+l.line(k+n/2,b)+l.line(k+n-n/4,b)+l.line(k+n/4,b)+l.line(k+n/2,b)+l.line(k+n/2,w)+l.line(k,w)+l.line(k,S)+"z"]:[l.move(k,w)+l.line(k+n/2,w)+l.line(k+n/2,x)+l.line(k+n/2,w)+l.line(k+n,w)+l.line(k+n,y)+l.line(k+n/2,y)+l.line(k+n/2,b)+l.line(k+n/2,y)+l.line(k,y)+l.line(k,w-r/2)],P+=l.move(k,y),o.globals.isXNumeric||(i+=a),{pathTo:A,pathFrom:P,x:i,y:w,barXPosition:k,color:this.isBoxPlot?f:h?[u]:[p]}}},{key:"drawHorizontalBoxPaths",value:function(t){var e=t.indexes;t.x;var i=t.y,a=t.yDivision,n=t.barHeight,s=t.zeroW,r=t.strokeWidth,o=this.w,l=new C(this.ctx),c=e.i,d=e.j,h=this.boxOptions.colors.lower;this.isBoxPlot&&(h=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var u=this.invertedYRatio,p=e.realIndex,f=this.getOHLCValue(p,d),g=s,m=s,v=Math.min(f.o,f.c),x=Math.max(f.o,f.c),b=f.m;o.globals.isXNumeric&&(i=(o.globals.seriesX[p][d]-o.globals.minX)/this.invertedXRatio-n/2);var y=i+n*this.visibleI;void 0===this.series[c][d]||null===this.series[c][d]?(v=s,x=s):(v=s+v/u,x=s+x/u,g=s+f.h/u,m=s+f.l/u,b=s+f.m/u);var w=l.move(s,y),S=l.move(v,y+n/2);return o.globals.previousPaths.length>0&&(S=this.getPreviousPath(p,d,!0)),w=[l.move(v,y)+l.line(v,y+n/2)+l.line(g,y+n/2)+l.line(g,y+n/2-n/4)+l.line(g,y+n/2+n/4)+l.line(g,y+n/2)+l.line(v,y+n/2)+l.line(v,y+n)+l.line(b,y+n)+l.line(b,y)+l.line(v+r/2,y),l.move(b,y)+l.line(b,y+n)+l.line(x,y+n)+l.line(x,y+n/2)+l.line(m,y+n/2)+l.line(m,y+n-n/4)+l.line(m,y+n/4)+l.line(m,y+n/2)+l.line(x,y+n/2)+l.line(x,y)+l.line(b,y)+"z"],S+=l.move(v,y),o.globals.isXNumeric||(i+=a),{pathTo:w,pathFrom:S,x:x,y:i,barYPosition:y,color:h}}},{key:"getOHLCValue",value:function(t,e){var i=this.w;return{o:this.isBoxPlot?i.globals.seriesCandleH[t][e]:i.globals.seriesCandleO[t][e],h:this.isBoxPlot?i.globals.seriesCandleO[t][e]:i.globals.seriesCandleH[t][e],m:i.globals.seriesCandleM[t][e],l:this.isBoxPlot?i.globals.seriesCandleC[t][e]:i.globals.seriesCandleL[t][e],c:this.isBoxPlot?i.globals.seriesCandleL[t][e]:i.globals.seriesCandleC[t][e]}}}]),i}(St),Pt=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"checkColorRange",value:function(){var t=this.w,e=!1,i=t.config.plotOptions[t.config.chart.type];return i.colorScale.ranges.length>0&&i.colorScale.ranges.map((function(t,i){t.from<=0&&(e=!0)})),e}},{key:"getShadeColor",value:function(t,e,i,a){var n=this.w,s=1,r=n.config.plotOptions[t].shadeIntensity,o=this.determineColor(t,e,i);n.globals.hasNegs||a?s=n.config.plotOptions[t].reverseNegativeShade?o.percent<0?o.percent/100*(1.25*r):(1-o.percent/100)*(1.25*r):o.percent<=0?1-(1+o.percent/100)*r:(1-o.percent/100)*r:(s=1-o.percent/100,"treemap"===t&&(s=(1-o.percent/100)*(1.25*r)));var l=o.color,c=new b;return n.config.plotOptions[t].enableShades&&(l="dark"===this.w.config.theme.mode?b.hexToRgba(c.shadeColor(-1*s,o.color),n.config.fill.opacity):b.hexToRgba(c.shadeColor(s,o.color),n.config.fill.opacity)),{color:l,colorProps:o}}},{key:"determineColor",value:function(t,e,i){var a=this.w,n=a.globals.series[e][i],s=a.config.plotOptions[t],r=s.colorScale.inverse?i:e;s.distributed&&"treemap"===a.config.chart.type&&(r=i);var o=a.globals.colors[r],l=null,c=Math.min.apply(Math,m(a.globals.series[e])),d=Math.max.apply(Math,m(a.globals.series[e]));s.distributed||"heatmap"!==t||(c=a.globals.minY,d=a.globals.maxY),void 0!==s.colorScale.min&&(c=s.colorScale.mina.globals.maxY?s.colorScale.max:a.globals.maxY);var h=Math.abs(d)+Math.abs(c),u=100*n/(0===h?h-1e-6:h);return s.colorScale.ranges.length>0&&s.colorScale.ranges.map((function(t,e){if(n>=t.from&&n<=t.to){o=t.color,l=t.foreColor?t.foreColor:null,c=t.from,d=t.to;var i=Math.abs(d)+Math.abs(c);u=100*n/(0===i?i-1e-6:i)}})),{color:o,foreColor:l,percent:u}}},{key:"calculateDataLabels",value:function(t){var e=t.text,i=t.x,a=t.y,n=t.i,s=t.j,r=t.colorProps,o=t.fontSize,l=this.w.config.dataLabels,c=new C(this.ctx),d=new X(this.ctx),h=null;if(l.enabled){h=c.group({class:"apexcharts-data-labels"});var u=l.offsetX,p=l.offsetY,f=i+u,g=a+parseFloat(l.style.fontSize)/3+p;d.plotDataLabelsText({x:f,y:g,text:e,i:n,j:s,color:r.foreColor,parent:h,fontSize:o,dataLabelsConfig:l})}return h}},{key:"addListeners",value:function(t){var e=new C(this.ctx);t.node.addEventListener("mouseenter",e.pathMouseEnter.bind(this,t)),t.node.addEventListener("mouseleave",e.pathMouseLeave.bind(this,t)),t.node.addEventListener("mousedown",e.pathMouseDown.bind(this,t))}}]),t}(),Et=function(){function t(e,i){o(this,t),this.ctx=e,this.w=e.w,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Pt(e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return c(t,[{key:"draw",value:function(t){var e=this.w,i=new C(this.ctx),a=i.group({class:"apexcharts-heatmap"});a.attr("clip-path","url(#gridRectMask".concat(e.globals.cuid,")"));var n=e.globals.gridWidth/e.globals.dataPoints,s=e.globals.gridHeight/e.globals.series.length,r=0,o=!1;this.negRange=this.helpers.checkColorRange();var l=t.slice();e.config.yaxis[0].reversed&&(o=!0,l.reverse());for(var c=o?0:l.length-1;o?c=0;o?c++:c--){var d=i.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:b.escapeString(e.globals.seriesNames[c]),rel:c+1,"data:realIndex":c});if(this.ctx.series.addCollapsedClassToSeries(d,c),e.config.chart.dropShadow.enabled){var h=e.config.chart.dropShadow;new w(this.ctx).dropShadow(d,h,c)}for(var u=0,p=e.config.plotOptions.heatmap.shadeIntensity,f=0;f-1&&this.pieClicked(h),i.config.dataLabels.enabled){var S=x.x,k=x.y,A=100*p/this.fullAngle+"%";if(0!==p&&i.config.plotOptions.pie.dataLabels.minAngleToShowLabelthis.fullAngle?e.endAngle=e.endAngle-(a+r):a+r=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(o=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(o)>this.fullAngle&&(o-=this.fullAngle);var l=Math.PI*(o-90)/180,c=e.centerX+n*Math.cos(r),d=e.centerY+n*Math.sin(r),h=e.centerX+n*Math.cos(l),u=e.centerY+n*Math.sin(l),p=b.polarToCartesian(e.centerX,e.centerY,e.donutSize,o),f=b.polarToCartesian(e.centerX,e.centerY,e.donutSize,s),g=a>180?1:0,m=["M",c,d,"A",n,n,0,g,1,h,u];return"donut"===e.chartType?[].concat(m,["L",p.x,p.y,"A",e.donutSize,e.donutSize,0,g,0,f.x,f.y,"L",c,d,"z"]).join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[].concat(m,["L",e.centerX,e.centerY,"L",c,d]).join(" "):[].concat(m).join(" ")}},{key:"drawPolarElements",value:function(t){var e=this.w,i=new q(this.ctx),a=new C(this.ctx),n=new Tt(this.ctx),s=a.group(),r=a.group(),o=i.niceScale(0,Math.ceil(this.maxY),e.config.yaxis[0].tickAmount,0,!0),l=o.result.reverse(),c=o.result.length;this.maxY=o.niceMax;for(var d=e.globals.radialSize,h=d/(c-1),u=0;u1&&t.total.show&&(n=t.total.color);var r=s.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=s.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,s),a||"function"!=typeof t.total.formatter||(i=t.total.formatter(s));var l=e===t.total.label;e=t.name.formatter(e,l,s),null!==r&&(r.textContent=e),null!==o&&(o.textContent=i),null!==r&&(r.style.fill=n)}},{key:"printDataLabelsInner",value:function(t,e){var i=this.w,a=t.getAttribute("data:value"),n=i.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.globals.series.length>1&&this.printInnerLabels(e,n,a,t);var s=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==s&&(s.style.opacity=1)}},{key:"drawSpokes",value:function(t){var e=this,i=this.w,a=new C(this.ctx),n=i.config.plotOptions.polarArea.spokes;if(0!==n.strokeWidth){for(var s=[],r=360/i.globals.series.length,o=0;o1)r&&!e.total.showAlways?l({makeSliceOut:!1,printLabel:!0}):this.printInnerLabels(e,e.total.label,e.total.formatter(n));else if(l({makeSliceOut:!1,printLabel:!0}),!r)if(n.globals.selectedDataPoints.length&&n.globals.series.length>1)if(n.globals.selectedDataPoints[0].length>0){var c=n.globals.selectedDataPoints[0],d=n.globals.dom.baseEl.querySelector(".apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(c));this.printDataLabelsInner(d,e)}else s&&n.globals.selectedDataPoints.length&&0===n.globals.selectedDataPoints[0].length&&(s.style.opacity=0);else s&&n.globals.series.length>1&&(s.style.opacity=0)}}]),t}(),Mt=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var i=this.w;this.graphics=new C(this.ctx),this.lineColorArr=void 0!==i.globals.stroke.colors?i.globals.stroke.colors:i.globals.colors,this.defaultSize=i.globals.svgHeight0&&(g=e.getPreviousPath(o));for(var m=0;m=10?t.x>0?(i="start",a+=10):t.x<0&&(i="end",a-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?n-=10:t.y>0&&(n+=10)),{textAnchor:i,newX:a,newY:n}}},{key:"getPreviousPath",value:function(t){for(var e=this.w,i=null,a=0;a0&&parseInt(n.realIndex,10)===parseInt(t,10)&&void 0!==e.globals.previousPaths[a].paths[0]&&(i=e.globals.previousPaths[a].paths[0].d)}return i}},{key:"getDataPointsPos",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dataPointsLen;t=t||[],e=e||[];for(var a=[],n=0;n=360&&(u=360-Math.abs(this.startAngle)-.1);var p=i.drawPath({d:"",stroke:d,strokeWidth:r*parseInt(c.strokeWidth,10)/100,fill:"none",strokeOpacity:c.opacity,classes:"apexcharts-radialbar-area"});if(c.dropShadow.enabled){var f=c.dropShadow;n.dropShadow(p,f)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:h,size:t.size,i:o,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:e.globals.easing})}return a}},{key:"drawArcs",value:function(t){var e=this.w,i=new C(this.ctx),a=new $(this.ctx),n=new w(this.ctx),s=i.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;var o=e.config.plotOptions.radialBar.hollow.background,l=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=l-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(o=this.drawHollowImage(t,s,l,o));var d=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:o||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){var h=e.config.plotOptions.radialBar.hollow.dropShadow;n.dropShadow(d,h)}var u=1;!this.radialDataLabels.total.show&&e.globals.series.length>1&&(u=0);var p=null;this.radialDataLabels.show&&(p=this.renderInnerDataLabels(this.radialDataLabels,{hollowSize:l,centerX:t.centerX,centerY:t.centerY,opacity:u})),"back"===e.config.plotOptions.radialBar.hollow.position&&(s.add(d),p&&s.add(p));var f=!1;e.config.plotOptions.radialBar.inverseOrder&&(f=!0);for(var g=f?t.series.length-1:0;f?g>=0:g100?100:t.series[g])/100,k=Math.round(this.totalAngle*S)+this.startAngle,A=void 0;e.globals.dataChanged&&(y=this.startAngle,A=Math.round(this.totalAngle*b.negToZero(e.globals.previousPaths[g])/100)+y),Math.abs(k)+Math.abs(x)>=360&&(k-=.01),Math.abs(A)+Math.abs(y)>=360&&(A-=.01);var P=k-x,E=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[g]:e.config.stroke.dashArray,T=i.drawPath({d:"",stroke:v,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+g,strokeDashArray:E});if(C.setAttrs(T.node,{"data:angle":P,"data:value":t.series[g]}),e.config.chart.dropShadow.enabled){var O=e.config.chart.dropShadow;n.dropShadow(T,O,g)}n.setSelectionFilter(T,0,g),this.addListeners(T,this.radialDataLabels),m.add(T),T.attr({index:0,j:g});var M=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(M=e.config.chart.animations.speed),e.globals.dataChanged&&(M=e.config.chart.animations.dynamicAnimation.speed),this.animDur=M/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(T,{centerX:t.centerX,centerY:t.centerY,endAngle:k,startAngle:x,prevEndAngle:A,prevStartAngle:y,size:t.size,i:g,totalItems:2,animBeginArr:this.animBeginArr,dur:M,shouldSetPrevPaths:!0,easing:e.globals.easing})}return{g:s,elHollow:d,dataLabels:p}}},{key:"drawHollow",value:function(t){var e=new C(this.ctx).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}},{key:"drawHollowImage",value:function(t,e,i,a){var n=this.w,s=new $(this.ctx),r=b.randomId(),o=n.config.plotOptions.radialBar.hollow.image;if(n.config.plotOptions.radialBar.hollow.imageClipped)s.clippedImgArea({width:i,height:i,image:o,patternID:"pattern".concat(n.globals.cuid).concat(r)}),a="url(#pattern".concat(n.globals.cuid).concat(r,")");else{var l=n.config.plotOptions.radialBar.hollow.imageWidth,c=n.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===l&&void 0===c){var d=n.globals.dom.Paper.image(o).loaded((function(e){this.move(t.centerX-e.width/2+n.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+n.config.plotOptions.radialBar.hollow.imageOffsetY)}));e.add(d)}else{var h=n.globals.dom.Paper.image(o).loaded((function(e){this.move(t.centerX-l/2+n.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-c/2+n.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(l,c)}));e.add(h)}}return a}},{key:"getStrokeWidth",value:function(t){var e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}}]),i}(Ot),It=function(t){h(i,t);var e=g(i);function i(){return o(this,i),e.apply(this,arguments)}return c(i,[{key:"draw",value:function(t,e){var i=this.w,a=new C(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=i.globals.seriesRangeStart,this.seriesRangeEnd=i.globals.seriesRangeEnd,this.barHelpers.initVariables(t);for(var n=a.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),r=0;r0&&(this.visibleI=this.visibleI+1);var g=0,m=0;this.yRatio.length>1&&(this.yaxisIndex=p);var v=this.barHelpers.initialPositions();h=v.y,c=v.zeroW,d=v.x,m=v.barWidth,o=v.xDivision,l=v.zeroH;for(var x=a.group({class:"apexcharts-datalabels","data:realIndex":p}),y=a.group({class:"apexcharts-rangebar-goals-markers",style:"pointer-events: none"}),w=0;w0}));return a=l.config.plotOptions.bar.rangeBarGroupRows?n+r*u:n+s*this.visibleI+r*u,p>-1&&!l.config.plotOptions.bar.rangeBarOverlap&&(c=l.globals.seriesRange[e][p].overlaps).indexOf(d)>-1&&(a=(s=o.barHeight/c.length)*this.visibleI+r*(100-parseInt(this.barOptions.barHeight,10))/100/2+s*(this.visibleI+c.indexOf(d))+r*u),{barYPosition:a,barHeight:s}}},{key:"drawRangeColumnPaths",value:function(t){var e=t.indexes,i=t.x;t.strokeWidth;var a=t.xDivision,n=t.barWidth,s=t.zeroH,r=this.w,o=e.i,l=e.j,c=this.yRatio[this.yaxisIndex],d=e.realIndex,h=this.getRangeValue(d,l),u=Math.min(h.start,h.end),p=Math.max(h.start,h.end);r.globals.isXNumeric&&(i=(r.globals.seriesX[o][l]-r.globals.minX)/this.xRatio-n/2);var f=i+n*this.visibleI;void 0===this.series[o][l]||null===this.series[o][l]?u=s:(u=s-u/c,p=s-p/c);var g=Math.abs(p-u),m=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:n,y1:u,y2:p,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:e.realIndex,i:d,j:l,w:r});return r.globals.isXNumeric||(i+=a),{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:g,x:i,y:p,goalY:this.barHelpers.getGoalValues("y",null,s,o,l),barXPosition:f}}},{key:"drawRangeBarPaths",value:function(t){var e=t.indexes,i=t.y,a=t.y1,n=t.y2,s=t.yDivision,r=t.barHeight,o=t.barYPosition,l=t.zeroW,c=this.w,d=l+a/this.invertedYRatio,h=l+n/this.invertedYRatio,u=Math.abs(h-d),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:d,x2:h,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:e.realIndex,realIndex:e.realIndex,j:e.j,w:c});return c.globals.isXNumeric||(i+=s),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:u,x:h,goalX:this.barHelpers.getGoalValues("x",l,null,e.realIndex,e.j),y:i}}},{key:"getRangeValue",value:function(t,e){var i=this.w;return{start:i.globals.seriesRangeStart[t][e],end:i.globals.seriesRangeEnd[t][e]}}}]),i}(St),_t=function(){function t(e){o(this,t),this.w=e.w,this.lineCtx=e}return c(t,[{key:"sameValueSeriesFix",value:function(t,e){var i=this.w;if(("gradient"===i.config.fill.type||"gradient"===i.config.fill.type[t])&&new S(this.lineCtx.ctx,i).seriesHaveSameValues(t)){var a=e[t].slice();a[a.length-1]=a[a.length-1]+1e-6,e[t]=a}return e}},{key:"calculatePoints",value:function(t){var e=t.series,i=t.realIndex,a=t.x,n=t.y,s=t.i,r=t.j,o=t.prevY,l=this.w,c=[],d=[];if(0===r){var h=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;l.globals.isXNumeric&&(h=(l.globals.seriesX[i][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),c.push(h),d.push(b.isNumber(e[s][0])?o+l.config.markers.offsetY:null),c.push(a+l.config.markers.offsetX),d.push(b.isNumber(e[s][r+1])?n+l.config.markers.offsetY:null)}else c.push(a+l.config.markers.offsetX),d.push(b.isNumber(e[s][r+1])?n+l.config.markers.offsetY:null);return{x:c,y:d}}},{key:"checkPreviousPaths",value:function(t){for(var e=t.pathFromLine,i=t.pathFromArea,a=t.realIndex,n=this.w,s=0;s0&&parseInt(r.realIndex,10)===parseInt(a,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,e=n.globals.previousPaths[s].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,i=n.globals.previousPaths[s].paths[0].d,n.config.stroke.show&&n.globals.previousPaths[s].paths[1]&&(e=n.globals.previousPaths[s].paths[1].d)))}return{pathFromLine:e,pathFromArea:i}}},{key:"determineFirstPrevY",value:function(t){var e,i=t.i,a=t.series,n=t.prevY,s=t.lineYPosition,r=this.w;if(void 0!==(null===(e=a[i])||void 0===e?void 0:e[0]))n=(s=r.config.chart.stacked&&i>0?this.lineCtx.prevSeriesY[i-1][0]:this.lineCtx.zeroY)-a[i][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]+2*(this.lineCtx.isReversed?a[i][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]:0);else if(r.config.chart.stacked&&i>0&&void 0===a[i][0])for(var o=i-1;o>=0;o--)if(null!==a[o][0]&&void 0!==a[o][0]){n=s=this.lineCtx.prevSeriesY[o][0];break}return{prevY:n,lineYPosition:s}}}]),t}(),Dt=function(){function t(e,i,a){o(this,t),this.ctx=e,this.w=e.w,this.xyRatios=i,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||a,this.scatter=new R(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new _t(this),this.markers=new H(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return c(t,[{key:"draw",value:function(t,e,i,a){var n=this.w,r=new C(this.ctx),o=n.globals.comboCharts?e:n.config.chart.type,l=r.group({class:"apexcharts-".concat(o,"-series apexcharts-plot-series")}),c=new S(this.ctx,n);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=c.getLogSeries(t),this.yRatio=c.getLogYRatios(this.yRatio);for(var d=[],h=0;h0&&(g=(n.globals.seriesX[u][0]-n.globals.minX)/this.xRatio),f.push(g);var m,v=g,x=void 0,b=v,y=this.zeroY,w=this.zeroY;y=this.lineHelpers.determineFirstPrevY({i:h,series:t,prevY:y,lineYPosition:0}).prevY,p.push(y),m=y,"rangeArea"===o&&(x=w=this.lineHelpers.determineFirstPrevY({i:h,series:a,prevY:w,lineYPosition:0}).prevY);var k={type:o,series:t,realIndex:u,i:h,x:g,y:1,pX:v,pY:m,pathsFrom:this._calculatePathsFrom({type:o,series:t,i:h,realIndex:u,prevX:b,prevY:y,prevY2:w}),linePaths:[],areaPaths:[],seriesIndex:i,lineYPosition:0,xArrj:f,yArrj:p,seriesRangeEnd:a},A=this._iterateOverDataPoints(s(s({},k),{},{iterations:"rangeArea"===o?t[h].length-1:void 0,isRangeStart:!0}));if("rangeArea"===o){var P=this._calculatePathsFrom({series:a,i:h,realIndex:u,prevX:b,prevY:w}),E=this._iterateOverDataPoints(s(s({},k),{},{series:a,pY:x,pathsFrom:P,iterations:a[h].length-1,isRangeStart:!1}));A.linePaths[0]=E.linePath+A.linePath,A.pathFromLine=E.pathFromLine+A.pathFromLine}this._handlePaths({type:o,realIndex:u,i:h,paths:A}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),d.push(this.elSeries)}if(n.config.chart.stacked)for(var T=d.length;T>0;T--)l.add(d[T-1]);else for(var O=0;O1&&(this.yaxisIndex=i),this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed,this.zeroY=a.globals.gridHeight-this.baseLineY[this.yaxisIndex]-(this.isReversed?a.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),this.areaBottomY=this.zeroY,(this.zeroY>a.globals.gridHeight||"end"===a.config.plotOptions.area.fillTo)&&(this.areaBottomY=a.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=n.group({class:"apexcharts-series",seriesName:b.escapeString(a.globals.seriesNames[i])}),this.elPointsMain=n.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.elDataLabelsWrap=n.group({class:"apexcharts-datalabels","data:realIndex":i});var s=t[e].length===a.globals.dataPoints;this.elSeries.attr({"data:longestSeries":s,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(t){var e,i,a,n,s=t.type,r=t.series,o=t.i,l=t.realIndex,c=t.prevX,d=t.prevY,h=t.prevY2,u=this.w,p=new C(this.ctx);if(null===r[o][0]){for(var f=0;f0){var g=this.lineHelpers.checkPreviousPaths({pathFromLine:a,pathFromArea:n,realIndex:l});a=g.pathFromLine,n=g.pathFromArea}return{prevX:c,prevY:d,linePath:e,areaPath:i,pathFromLine:a,pathFromArea:n}}},{key:"_handlePaths",value:function(t){var e=t.type,i=t.realIndex,a=t.i,n=t.paths,r=this.w,o=new C(this.ctx),l=new $(this.ctx);this.prevSeriesY.push(n.yArrj),r.globals.seriesXvalues[i]=n.xArrj,r.globals.seriesYvalues[i]=n.yArrj;var c=r.config.forecastDataPoints;if(c.count>0&&"rangeArea"!==e){var d=r.globals.seriesXvalues[i][r.globals.seriesXvalues[i].length-c.count-1],h=o.drawRect(d,0,r.globals.gridWidth,r.globals.gridHeight,0);r.globals.dom.elForecastMask.appendChild(h.node);var u=o.drawRect(0,0,d,r.globals.gridHeight,0);r.globals.dom.elNonForecastMask.appendChild(u.node)}this.pointsChart||r.globals.delayedElements.push({el:this.elPointsMain.node,index:i});var p={i:a,realIndex:i,animationDelay:a,initialSpeed:r.config.chart.animations.speed,dataChangeSpeed:r.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(e)};if("area"===e)for(var f=l.fillPath({seriesNumber:i}),g=0;g0&&"rangeArea"!==e){var k=o.renderPaths(w);k.node.setAttribute("stroke-dasharray",c.dashArray),c.strokeWidth&&k.node.setAttribute("stroke-width",c.strokeWidth),this.elSeries.add(k),k.attr("clip-path","url(#forecastMask".concat(r.globals.cuid,")")),S.attr("clip-path","url(#nonForecastMask".concat(r.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(t){var e=t.type,i=t.series,a=t.iterations,n=t.realIndex,s=t.i,r=t.x,o=t.y,l=t.pX,c=t.pY,d=t.pathsFrom,h=t.linePaths,u=t.areaPaths,p=t.seriesIndex,f=t.lineYPosition,g=t.xArrj,m=t.yArrj,v=t.isRangeStart,x=t.seriesRangeEnd,y=this.w,w=new C(this.ctx),S=this.yRatio,k=d.prevY,A=d.linePath,P=d.areaPath,E=d.pathFromLine,T=d.pathFromArea,O=b.isNumber(y.globals.minYArr[n])?y.globals.minYArr[n]:y.globals.minY;a||(a=y.globals.dataPoints>1?y.globals.dataPoints-1:y.globals.dataPoints);for(var M=o,L=0;L0&&y.globals.collapsedSeries.length-1){e--;break}return e>=0?e:0}(s-1)][L+1]:this.zeroY,I?o=f-O/S[this.yaxisIndex]+2*(this.isReversed?O/S[this.yaxisIndex]:0):(o=f-i[s][L+1]/S[this.yaxisIndex]+2*(this.isReversed?i[s][L+1]/S[this.yaxisIndex]:0),"rangeArea"===e&&(M=f-x[s][L+1]/S[this.yaxisIndex]+2*(this.isReversed?x[s][L+1]/S[this.yaxisIndex]:0))),g.push(r),m.push(o);var D=this.lineHelpers.calculatePoints({series:i,x:r,y:o,realIndex:n,i:s,j:L,prevY:k}),z=this._createPaths({type:e,series:i,i:s,realIndex:n,j:L,x:r,y:o,y2:M,pX:l,pY:c,linePath:A,areaPath:P,linePaths:h,areaPaths:u,seriesIndex:p,isRangeStart:v});u=z.areaPaths,h=z.linePaths,l=z.pX,c=z.pY,P=z.areaPath,A=z.linePath,this.appendPathFrom&&(E+=w.line(r,this.zeroY),T+=w.line(r,this.zeroY)),this.handleNullDataPoints(i,D,s,L,n),this._handleMarkersAndLabels({type:e,pointsPos:D,i:s,j:L,realIndex:n,isRangeStart:v})}return{yArrj:m,xArrj:g,pathFromArea:T,areaPaths:u,pathFromLine:E,linePaths:h,linePath:A,areaPath:P}}},{key:"_handleMarkersAndLabels",value:function(t){var e=t.type,i=t.pointsPos,a=t.isRangeStart,n=t.i,s=t.j,r=t.realIndex,o=this.w,l=new X(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,s,{realIndex:r,pointsPos:i,zRatio:this.zRatio,elParent:this.elPointsMain});else{o.globals.series[n].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var c=this.markers.plotChartMarkers(i,r,s+1);null!==c&&this.elPointsMain.add(c)}var d=l.drawDataLabel({type:e,isRangeStart:a,pos:i,i:r,j:s+1});null!==d&&this.elDataLabelsWrap.add(d)}},{key:"_createPaths",value:function(t){var e=t.type,i=t.series,a=t.i,n=t.realIndex,s=t.j,r=t.x,o=t.y,l=t.y2,c=t.pX,d=t.pY,h=t.linePath,u=t.areaPath,p=t.linePaths,f=t.areaPaths,g=t.seriesIndex,m=t.isRangeStart,v=this.w,x=new C(this.ctx),b=v.config.stroke.curve,y=this.areaBottomY;if(Array.isArray(v.config.stroke.curve)&&(b=Array.isArray(g)?v.config.stroke.curve[g[a]]:v.config.stroke.curve[a]),"smooth"===b){var w=.35*(r-c);v.globals.hasNullValues?(null!==i[a][s]&&(null!==i[a][s+1]?(h=x.move(c,d)+x.curve(c+w,d,r-w,o,r+1,o),u=x.move(c+1,d)+x.curve(c+w,d,r-w,o,r+1,o)+x.line(r,y)+x.line(c,y)+"z"):(h=x.move(c,d),u=x.move(c,d)+"z")),p.push(h),f.push(u)):(h+=x.curve(c+w,d,r-w,o,r,o),u+=x.curve(c+w,d,r-w,o,r,o)),c=r,d=o,s===i[a].length-2&&(u=u+x.curve(c,d,r,o,r,y)+x.move(r,o)+"z","rangeArea"===e&&m?h=h+x.curve(c,d,r,o,r,l)+x.move(r,l)+"z":v.globals.hasNullValues||(p.push(h),f.push(u)))}else{if(null===i[a][s+1]){h+=x.move(r,o);var S=v.globals.isXNumeric?(v.globals.seriesX[n][s]-v.globals.minX)/this.xRatio:r-this.xDivision;u=u+x.line(S,y)+x.move(r,o)+"z"}null===i[a][s]&&(h+=x.move(r,o),u+=x.move(r,y)),"stepline"===b?(h=h+x.line(r,null,"H")+x.line(null,o,"V"),u=u+x.line(r,null,"H")+x.line(null,o,"V")):"straight"===b&&(h+=x.line(r,o),u+=x.line(r,o)),s===i[a].length-2&&(u=u+x.line(r,y)+x.move(r,o)+"z","rangeArea"===e&&m?h=h+x.line(r,l)+x.move(r,l)+"z":(p.push(h),f.push(u)))}return{linePaths:p,areaPaths:f,pX:c,pY:d,linePath:h,areaPath:u}}},{key:"handleNullDataPoints",value:function(t,e,i,a,n){var s=this.w;if(null===t[i][a]&&s.config.markers.showNullDataPoints||1===t[i].length){var r=this.markers.plotChartMarkers(e,n,a+1,this.strokeWidth-s.config.markers.strokeWidth/2,!0);null!==r&&this.elPointsMain.add(r)}}}]),t}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function t(e,i,a,n){this.xoffset=e,this.yoffset=i,this.height=n,this.width=a,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(t){var e,i=[],a=this.xoffset,n=this.yoffset,r=s(t)/this.height,o=s(t)/this.width;if(this.width>=this.height)for(e=0;e=this.height){var a=e/this.height,n=this.width-a;i=new t(this.xoffset+a,this.yoffset,n,this.height)}else{var s=e/this.width,r=this.height-s;i=new t(this.xoffset,this.yoffset+s,this.width,r)}return i}}function e(e,a,n,r,o){r=void 0===r?0:r,o=void 0===o?0:o;var l=i(function(t,e){var i,a=[],n=e/s(t);for(i=0;i=a(n,i))}(e,l=t[0],o)?(e.push(l),i(t.slice(1),e,n,r)):(c=n.cutArea(s(e),r),r.push(n.getCoordinates(e)),i(t,[],c,r)),r;r.push(n.getCoordinates(e))}function a(t,e){var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),n=s(t);return Math.max(Math.pow(e,2)*a/Math.pow(n,2),Math.pow(n,2)/(Math.pow(e,2)*i))}function n(t){return t&&t.constructor===Array}function s(t){var e,i=0;for(e=0;es-a&&l.width<=r-n){var c=o.rotateAroundCenter(t.node);t.node.setAttribute("transform","rotate(-90 ".concat(c.x," ").concat(c.y,")"))}}},{key:"animateTreemap",value:function(t,e,i,a){var n=new y(this.ctx);n.animateRect(t,{x:e.x,y:e.y,width:e.width,height:e.height},{x:i.x,y:i.y,width:i.width,height:i.height},a,(function(){n.animationCompleted(t)}))}}]),t}(),$t=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return c(t,[{key:"calculateTimeScaleTicks",value:function(t,e){var i=this,a=this.w;if(a.globals.allSeriesCollapsed)return a.globals.labels=[],a.globals.timescaleLabels=[],[];var n=new L(this.ctx),r=(e-t)/864e5;this.determineInterval(r),a.globals.disableZoomIn=!1,a.globals.disableZoomOut=!1,r<.00011574074074074075?a.globals.disableZoomIn=!0:r>5e4&&(a.globals.disableZoomOut=!0);var o=n.getTimeUnitsfromTimestamp(t,e,this.utc),l=a.globals.gridWidth/r,c=l/24,d=c/60,h=d/60,u=Math.floor(24*r),p=Math.floor(1440*r),f=Math.floor(86400*r),g=Math.floor(r),m=Math.floor(r/30),v=Math.floor(r/365),x={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},b={firstVal:x,currentMillisecond:x.minMillisecond,currentSecond:x.minSecond,currentMinute:x.minMinute,currentHour:x.minHour,currentMonthDate:x.minDate,currentDate:x.minDate,currentMonth:x.minMonth,currentYear:x.minYear,daysWidthOnXAxis:l,hoursWidthOnXAxis:c,minutesWidthOnXAxis:d,secondsWidthOnXAxis:h,numberOfSeconds:f,numberOfMinutes:p,numberOfHours:u,numberOfDays:g,numberOfMonths:m,numberOfYears:v};switch(this.tickInterval){case"years":this.generateYearScale(b);break;case"months":case"half_year":this.generateMonthScale(b);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(b);break;case"hours":this.generateHourScale(b);break;case"minutes_fives":case"minutes":this.generateMinuteScale(b);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(b)}var y=this.timeScaleArray.map((function(t){var 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?s(s({},e),{},{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?s(s({},e),{},{value:t.value}):"minute"===t.unit?s(s({},e),{},{value:t.value,minute:t.value}):"second"===t.unit?s(s({},e),{},{value:t.value,minute:t.minute,second:t.second}):t}));return y.filter((function(t){var e=1,n=Math.ceil(a.globals.gridWidth/120),s=t.value;void 0!==a.config.xaxis.tickAmount&&(n=a.config.xaxis.tickAmount),y.length>n&&(e=Math.floor(y.length/n));var r=!1,o=!1;switch(i.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===s&&(o=!0);break;case"months_days":e=10,"month"===t.unit&&(r=!0),30===s&&(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":s%5!=0&&(o=!0);break;case"seconds_tens":s%10!=0&&(o=!0)}if("hours"===i.tickInterval||"minutes_fives"===i.tickInterval||"seconds_tens"===i.tickInterval||"seconds_fives"===i.tickInterval){if(!o)return!0}else if((s%e==0||r)&&!o)return!0}))}},{key:"recalcDimensionsBasedOnFormat",value:function(t,e){var i=this.w,a=this.formatDates(t),n=this.removeOverlappingTS(a);i.globals.timescaleLabels=n.slice(),new ct(this.ctx).plotCoords()}},{key:"determineInterval",value:function(t){var e=24*t,i=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 i>15:this.tickInterval="minutes_fives";break;case i>5:this.tickInterval="minutes";break;case i>1:this.tickInterval="seconds_tens";break;case 60*i>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(t){var e=t.firstVal,i=t.currentMonth,a=t.currentYear,n=t.daysWidthOnXAxis,s=t.numberOfYears,r=e.minYear,o=0,l=new L(this.ctx),c="year";if(e.minDate>1||e.minMonth>0){var d=l.determineRemainingDaysOfYear(e.minYear,e.minMonth,e.minDate);o=(l.determineDaysOfYear(e.minYear)-d+1)*n,r=e.minYear+1,this.timeScaleArray.push({position:o,value:r,unit:c,year:r,month:b.monthMod(i+1)})}else 1===e.minDate&&0===e.minMonth&&this.timeScaleArray.push({position:o,value:r,unit:c,year:a,month:b.monthMod(i+1)});for(var h=r,u=o,p=0;p1){l=(c.determineDaysOfMonths(a+1,e.minYear)-i+1)*s,o=b.monthMod(a+1);var u=n+h,p=b.monthMod(o),f=o;0===o&&(d="year",f=u,p=1,u+=h+=1),this.timeScaleArray.push({position:l,value:f,unit:d,year:u,month:p})}else this.timeScaleArray.push({position:l,value:o,unit:d,year:n,month:b.monthMod(a)});for(var g=o+1,m=l,v=0,x=1;vr.determineDaysOfMonths(e+1,i)?(c=1,o="month",u=e+=1,e):e},h=(24-e.minHour)*n,u=l,p=d(c,i,a);0===e.minHour&&1===e.minDate?(h=0,u=b.monthMod(e.minMonth),o="month",c=e.minDate,s++):1!==e.minDate&&0===e.minHour&&0===e.minMinute&&(h=0,l=e.minDate,u=l,p=d(c=l,i,a)),this.timeScaleArray.push({position:h,value:u,unit:o,year:this._getYear(a,p,0),month:b.monthMod(p),day:c});for(var f=h,g=0;go.determineDaysOfMonths(e+1,n)&&(g=1,e+=1),{month:e,date:g}},d=function(t,e){return t>o.determineDaysOfMonths(e+1,n)?e+=1:e},h=60-(e.minMinute+e.minSecond/60),u=h*s,p=e.minHour+1,f=p+1;60===h&&(u=0,f=(p=e.minHour)+1);var g=i,m=d(g,a);this.timeScaleArray.push({position:u,value:p,unit:l,day:g,hour:f,year:n,month:b.monthMod(m)});for(var v=u,x=0;x=24&&(f=0,l="day",m=c(g+=1,m).month,m=d(g,m));var y=this._getYear(n,m,0);v=0===f&&0===x?h*s:60*s+v;var w=0===f?g:f;this.timeScaleArray.push({position:v,value:w,unit:l,hour:f,day:g,year:y,month:b.monthMod(m)}),f++}}},{key:"generateMinuteScale",value:function(t){for(var e=t.currentMillisecond,i=t.currentSecond,a=t.currentMinute,n=t.currentHour,s=t.currentDate,r=t.currentMonth,o=t.currentYear,l=t.minutesWidthOnXAxis,c=t.secondsWidthOnXAxis,d=t.numberOfMinutes,h=a+1,u=s,p=r,f=o,g=n,m=(60-i-e/1e3)*c,v=0;v=60&&(h=0,24===(g+=1)&&(g=0)),this.timeScaleArray.push({position:m,value:h,unit:"minute",hour:g,minute:h,day:u,year:this._getYear(f,p,0),month:b.monthMod(p)}),m+=l,h++}},{key:"generateSecondScale",value:function(t){for(var e=t.currentMillisecond,i=t.currentSecond,a=t.currentMinute,n=t.currentHour,s=t.currentDate,r=t.currentMonth,o=t.currentYear,l=t.secondsWidthOnXAxis,c=t.numberOfSeconds,d=i+1,h=a,u=s,p=r,f=o,g=n,m=(1e3-e)/1e3*l,v=0;v=60&&(d=0,++h>=60&&(h=0,24==++g&&(g=0))),this.timeScaleArray.push({position:m,value:d,unit:"second",hour:g,minute:h,second:d,day:u,year:this._getYear(f,p,0),month:b.monthMod(p)}),m+=l,d++}},{key:"createRawDateString",value:function(t,e){var i=t.year;return 0===t.month&&(t.month=1),i+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?i+="day"===t.unit?"-"+("0"+e).slice(-2):"-01":i+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?i+="hour"===t.unit?"T"+("0"+e).slice(-2):"T00":i+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),"minute"===t.unit?i+=":"+("0"+e).slice(-2):i+=":"+(t.minute?("0"+t.minute).slice(-2):"00"),"second"===t.unit?i+=":"+("0"+e).slice(-2):i+=":00",this.utc&&(i+=".000Z"),i}},{key:"formatDates",value:function(t){var e=this,i=this.w;return t.map((function(t){var a=t.value.toString(),n=new L(e.ctx),s=e.createRawDateString(t,a),r=n.getDate(n.parseDate(s));if(e.utc||(r=n.getDate(n.parseDateWithTimezone(s))),void 0===i.config.xaxis.labels.format){var o="dd MMM",l=i.config.xaxis.labels.datetimeFormatter;"year"===t.unit&&(o=l.year),"month"===t.unit&&(o=l.month),"day"===t.unit&&(o=l.day),"hour"===t.unit&&(o=l.hour),"minute"===t.unit&&(o=l.minute),"second"===t.unit&&(o=l.second),a=n.formatDate(r,o)}else a=n.formatDate(r,i.config.xaxis.labels.format);return{dateString:s,position:t.position,value:a,unit:t.unit,year:t.year,month:t.month}}))}},{key:"removeOverlappingTS",value:function(t){var e,i=this,a=new C(this.ctx),n=!1;t.length>0&&t[0].value&&t.every((function(e){return e.value.length===t[0].value.length}))&&(n=!0,e=a.getTextRects(t[0].value).width);var s=0,r=t.map((function(r,o){if(o>0&&i.w.config.xaxis.labels.hideOverlappingLabels){var l=n?e:a.getTextRects(t[s].value).width,c=t[s].position;return r.position>c+l+10?(s=o,r):null}return r}));return r.filter((function(t){return null!==t}))}},{key:"_getYear",value:function(t,e,i){return t+Math.floor(e/12)+i}}]),t}(),Ht=function(){function t(e,i){o(this,t),this.ctx=i,this.w=i.w,this.el=e}return c(t,[{key:"setupElements",value:function(){var t=this.w.globals,e=this.w.config,i=e.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].indexOf(i)>-1,t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].indexOf(i)>-1,t.isBarHorizontal=("bar"===e.chart.type||"rangeBar"===e.chart.type||"boxPlot"===e.chart.type)&&e.plotOptions.bar.horizontal,t.chartClass=".apexcharts"+t.chartID,t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),C.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas "+t.chartClass.substring(1)}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=new window.SVG.Doc(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(e.chart.offsetX,", ").concat(e.chart.offsetY,")")}),t.dom.Paper.node.style.background=e.chart.background,this.setSVGDimensions(),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elAnnotations=t.dom.Paper.group().attr({class:"apexcharts-annotations"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(t,e){var i=this.w,a=i.config,n=i.globals,s={series:[],i:[]},r={series:[],i:[]},o={series:[],i:[]},l={series:[],i:[]},c={series:[],i:[]},d={series:[],i:[]},h={series:[],i:[]},u={series:[],i:[]},p={series:[],seriesRangeEnd:[],i:[]};n.series.map((function(e,f){var g=0;void 0!==t[f].type?("column"===t[f].type||"bar"===t[f].type?(n.series.length>1&&a.plotOptions.bar.horizontal&&console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"),c.series.push(e),c.i.push(f),g++,i.globals.columnSeries=c.series):"area"===t[f].type?(r.series.push(e),r.i.push(f),g++):"line"===t[f].type?(s.series.push(e),s.i.push(f),g++):"scatter"===t[f].type?(o.series.push(e),o.i.push(f)):"bubble"===t[f].type?(l.series.push(e),l.i.push(f),g++):"candlestick"===t[f].type?(d.series.push(e),d.i.push(f),g++):"boxPlot"===t[f].type?(h.series.push(e),h.i.push(f),g++):"rangeBar"===t[f].type?(u.series.push(e),u.i.push(f),g++):"rangeArea"===t[f].type?(p.series.push(n.seriesRangeStart[f]),p.seriesRangeEnd.push(n.seriesRangeEnd[f]),p.i.push(f),g++):console.warn("You have specified an unrecognized chart type. Available types for this property are line/area/column/bar/scatter/bubble"),g>1&&(n.comboCharts=!0)):(s.series.push(e),s.i.push(f))}));var f=new Dt(this.ctx,e),g=new At(this.ctx,e);this.ctx.pie=new Ot(this.ctx);var m=new Lt(this.ctx);this.ctx.rangeBar=new It(this.ctx,e);var v=new Mt(this.ctx),x=[];if(n.comboCharts){if(r.series.length>0&&x.push(f.draw(r.series,"area",r.i)),c.series.length>0)if(i.config.chart.stacked){var b=new kt(this.ctx,e);x.push(b.draw(c.series,c.i))}else this.ctx.bar=new St(this.ctx,e),x.push(this.ctx.bar.draw(c.series,c.i));if(p.series.length>0&&x.push(f.draw(p.series,"rangeArea",p.i,p.seriesRangeEnd)),s.series.length>0&&x.push(f.draw(s.series,"line",s.i)),d.series.length>0&&x.push(g.draw(d.series,d.i)),h.series.length>0&&x.push(g.draw(h.series,h.i)),u.series.length>0&&x.push(this.ctx.rangeBar.draw(u.series,u.i)),o.series.length>0){var y=new Dt(this.ctx,e,!0);x.push(y.draw(o.series,"scatter",o.i))}if(l.series.length>0){var w=new Dt(this.ctx,e,!0);x.push(w.draw(l.series,"bubble",l.i))}}else switch(a.chart.type){case"line":x=f.draw(n.series,"line");break;case"area":x=f.draw(n.series,"area");break;case"bar":a.chart.stacked?x=new kt(this.ctx,e).draw(n.series):(this.ctx.bar=new St(this.ctx,e),x=this.ctx.bar.draw(n.series));break;case"candlestick":case"boxPlot":x=new At(this.ctx,e).draw(n.series);break;case"rangeBar":x=this.ctx.rangeBar.draw(n.series);break;case"rangeArea":x=f.draw(n.seriesRangeStart,"rangeArea",void 0,n.seriesRangeEnd);break;case"heatmap":x=new Et(this.ctx,e).draw(n.series);break;case"treemap":x=new jt(this.ctx,e).draw(n.series);break;case"pie":case"donut":case"polarArea":x=this.ctx.pie.draw(n.series);break;case"radialBar":x=m.draw(n.series);break;case"radar":x=v.draw(n.series);break;default:x=f.draw(n.series)}return x}},{key:"setSVGDimensions",value:function(){var t=this.w.globals,e=this.w.config;t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;var i=b.getDimensions(this.el),a=e.chart.width.toString().split(/[0-9]+/g).pop();"%"===a?b.isNumber(i[0])&&(0===i[0].width&&(i=b.getDimensions(this.el.parentNode)),t.svgWidth=i[0]*parseInt(e.chart.width,10)/100):"px"!==a&&""!==a||(t.svgWidth=parseInt(e.chart.width,10));var n=e.chart.height.toString().split(/[0-9]+/g).pop();if("auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===n){var s=b.getDimensions(this.el.parentNode);t.svgHeight=s[1]*parseInt(e.chart.height,10)/100}else t.svgHeight=parseInt(e.chart.height,10);else t.axisCharts?t.svgHeight=t.svgWidth/1.61:t.svgHeight=t.svgWidth/1.2;if(t.svgWidth<0&&(t.svgWidth=0),t.svgHeight<0&&(t.svgHeight=0),C.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),"%"!==n){var r=e.chart.sparkline.enabled?0:t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=t.svgHeight+r+"px"}t.dom.elWrap.style.width=t.svgWidth+"px",t.dom.elWrap.style.height=t.svgHeight+"px"}},{key:"shiftGraphPosition",value:function(){var t=this.w.globals,e=t.translateY,i={transform:"translate("+t.translateX+", "+e+")"};C.setAttrs(t.dom.elGraphical.node,i)}},{key:"resizeNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=0,a=t.config.chart.sparkline.enabled?1:15;a+=t.config.grid.padding.bottom,"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||!t.config.legend.show||t.config.legend.floating||(i=new ht(this.ctx).legendHelpers.getLegendBBox().clwh+10);var n=t.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),s=2.05*t.globals.radialSize;if(n&&!t.config.chart.sparkline.enabled&&0!==t.config.plotOptions.radialBar.startAngle){var r=b.getBoundingClientRect(n);s=r.bottom;var o=r.bottom-r.top;s=Math.max(2.05*t.globals.radialSize,o)}var l=s+e.translateY+i+a;e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute("height",l),t.config.chart.height&&String(t.config.chart.height).indexOf("%")>0||(e.dom.elWrap.style.height=l+"px",C.setAttrs(e.dom.Paper.node,{height:l}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=l+"px")}},{key:"coreCalculations",value:function(){new Z(this.ctx).init()}},{key:"resetGlobals",value:function(){var t=this,e=function(){return t.w.config.series.map((function(t){return[]}))},i=new N,a=this.w.globals;i.initGlobalVars(a),a.seriesXvalues=e(),a.seriesYvalues=e()}},{key:"isMultipleY",value:function(){if(this.w.config.yaxis.constructor===Array&&this.w.config.yaxis.length>1)return this.w.globals.isMultipleYAxis=!0,!0}},{key:"xySettings",value:function(){var t=null,e=this.w;if(e.globals.axisCharts){if("back"===e.config.xaxis.crosshairs.position&&new et(this.ctx).drawXCrosshairs(),"back"===e.config.yaxis[0].crosshairs.position&&new et(this.ctx).drawYCrosshairs(),"datetime"===e.config.xaxis.type&&void 0===e.config.xaxis.labels.formatter){this.ctx.timeScale=new $t(this.ctx);var i=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(i)}t=new S(this.ctx).getCalculatedRatios()}return t}},{key:"updateSourceChart",value:function(t){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var t=this,e=this.w;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){var i=e.config.chart.brush.targets||[e.config.chart.brush.target];i.forEach((function(e){var i=ApexCharts.getChartByID(e);i.w.globals.brushSource=t.ctx,"function"!=typeof i.w.config.chart.events.zoomed&&(i.w.config.chart.events.zoomed=function(){t.updateSourceChart(i)}),"function"!=typeof i.w.config.chart.events.scrolled&&(i.w.config.chart.events.scrolled=function(){t.updateSourceChart(i)})})),e.config.chart.events.selection=function(t,a){i.forEach((function(t){var i=ApexCharts.getChartByID(t),n=b.clone(e.config.yaxis);if(e.config.chart.brush.autoScaleYaxis&&1===i.w.globals.series.length){var r=new q(i);n=r.autoScaleY(i,n,a)}var o=i.w.config.yaxis.reduce((function(t,e,a){return[].concat(m(t),[s(s({},i.w.config.yaxis[a]),{},{min:n[0].min,max:n[0].max})])}),[]);i.ctx.updateHelpers._updateOptions({xaxis:{min:a.xaxis.min,max:a.xaxis.max},yaxis:o},!1,!1,!1,!1)}))}}}}]),t}(),Rt=function(){function t(e){o(this,t),this.ctx=e,this.w=e.w}return c(t,[{key:"_updateOptions",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(o){var l=[e.ctx];n&&(l=e.ctx.getSyncedCharts()),e.ctx.w.globals.isExecCalled&&(l=[e.ctx],e.ctx.w.globals.isExecCalled=!1),l.forEach((function(n,c){var d=n.w;if(d.globals.shouldAnimate=a,i||(d.globals.resized=!0,d.globals.dataChanged=!0,a&&n.series.getPreviousPaths()),t&&"object"===r(t)&&(n.config=new z(t),t=S.extendArrayProps(n.config,t,d),n.w.globals.chartID!==e.ctx.w.globals.chartID&&delete t.series,d.config=b.extend(d.config,t),s&&(d.globals.lastXAxis=t.xaxis?b.clone(t.xaxis):[],d.globals.lastYAxis=t.yaxis?b.clone(t.yaxis):[],d.globals.initialConfig=b.extend({},d.config),d.globals.initialSeries=b.clone(d.config.series),t.series))){for(var h=0;h2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(n){var s,r=i.w;return r.globals.shouldAnimate=e,r.globals.dataChanged=!0,e&&i.ctx.series.getPreviousPaths(),r.globals.axisCharts?(0===(s=t.map((function(t,e){return i._extendSeries(t,e)}))).length&&(s=[{data:[]}]),r.config.series=s):r.config.series=t.slice(),a&&(r.globals.initialConfig.series=b.clone(r.config.series),r.globals.initialSeries=b.clone(r.config.series)),i.ctx.update().then((function(){n(i.ctx)}))}))}},{key:"_extendSeries",value:function(t,e){var i=this.w,a=i.config.series[e];return s(s({},i.config.series[e]),{},{name:t.name?t.name:a&&a.name,color:t.color?t.color:a&&a.color,type:t.type?t.type:a&&a.type,data:t.data?t.data:a&&a.data})}},{key:"toggleDataPointSelection",value:function(t,e){var i=this.w,a=null,n=".apexcharts-series[data\\:realIndex='".concat(t,"']");return i.globals.axisCharts?a=i.globals.dom.Paper.select("".concat(n," path[j='").concat(e,"'], ").concat(n," circle[j='").concat(e,"'], ").concat(n," rect[j='").concat(e,"']")).members[0]:void 0===e&&(a=i.globals.dom.Paper.select("".concat(n," path[j='").concat(t,"']")).members[0],"pie"!==i.config.chart.type&&"polarArea"!==i.config.chart.type&&"donut"!==i.config.chart.type||this.ctx.pie.pieClicked(t)),a?(new C(this.ctx).pathMouseDown(a,null),a.node?a.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(t){var e=this.w;if(["min","max"].forEach((function(i){void 0!==t.xaxis[i]&&(e.config.xaxis[i]=t.xaxis[i],e.globals.lastXAxis[i]=t.xaxis[i])})),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){var i=new D(t);t=i.convertCatToNumericXaxis(t,this.ctx)}return t}},{key:"forceYAxisUpdate",value:function(t){return t.chart&&t.chart.stacked&&"100%"===t.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})):(t.yaxis.min=0,t.yaxis.max=100)),t}},{key:"revertDefaultAxisMinMax",value:function(t){var e=this,i=this.w,a=i.globals.lastXAxis,n=i.globals.lastYAxis;t&&t.xaxis&&(a=t.xaxis),t&&t.yaxis&&(n=t.yaxis),i.config.xaxis.min=a.min,i.config.xaxis.max=a.max;i.config.yaxis.map((function(t,a){i.globals.zoomed||void 0!==n[a]?function(t){void 0!==n[t]&&(i.config.yaxis[t].min=n[t].min,i.config.yaxis[t].max=n[t].max)}(a):void 0!==e.ctx.opts.yaxis[a]&&(t.min=e.ctx.opts.yaxis[a].min,t.max=e.ctx.opts.yaxis[a].max)}))}}]),t}();zt="undefined"!=typeof window?window:void 0,Nt=function(t,e){var i=(void 0!==this?this:t).SVG=function(t){if(i.supported)return t=new i.Doc(t),i.parser.draw||i.prepare(),t};if(i.ns="http://www.w3.org/2000/svg",i.xmlns="http://www.w3.org/2000/xmlns/",i.xlink="http://www.w3.org/1999/xlink",i.svgjs="http://svgjs.dev",i.supported=!0,!i.supported)return!1;i.did=1e3,i.eid=function(t){return"Svgjs"+h(t)+i.did++},i.create=function(t){var i=e.createElementNS(this.ns,t);return i.setAttribute("id",this.eid(t)),i},i.extend=function(){var t,e;e=(t=[].slice.call(arguments)).pop();for(var a=t.length-1;a>=0;a--)if(t[a])for(var n in e)t[a].prototype[n]=e[n];i.Set&&i.Set.inherit&&i.Set.inherit()},i.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,i.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&i.extend(e,t.extend),t.construct&&i.extend(t.parent||i.Container,t.construct),e},i.adopt=function(e){return e?e.instance?e.instance:((a="svg"==e.nodeName?e.parentNode instanceof t.SVGElement?new i.Nested:new i.Doc:"linearGradient"==e.nodeName?new i.Gradient("linear"):"radialGradient"==e.nodeName?new i.Gradient("radial"):i[h(e.nodeName)]?new(i[h(e.nodeName)]):new i.Element(e)).type=e.nodeName,a.node=e,e.instance=a,a instanceof i.Doc&&a.namespace().defs(),a.setData(JSON.parse(e.getAttribute("svgjs:data"))||{}),a):null;var a},i.prepare=function(){var t=e.getElementsByTagName("body")[0],a=(t?new i.Doc(t):i.adopt(e.documentElement).nested()).size(2,0);i.parser={body:t||e.documentElement,draw:a.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:a.polyline().node,path:a.path().node,native:i.create("svg")}},i.parser={native:i.create("svg")},e.addEventListener("DOMContentLoaded",(function(){i.parser.draw||i.prepare()}),!1),i.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},i.utils={map:function(t,e){for(var i=t.length,a=[],n=0;n1?1:t,new i.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),i.Color.test=function(t){return t+="",i.regex.isHex.test(t)||i.regex.isRgb.test(t)},i.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},i.Color.isColor=function(t){return i.Color.isRgb(t)||i.Color.test(t)},i.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},i.extend(i.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)}}),i.PointArray=function(t,e){i.Array.call(this,t,e||[[0,0]])},i.PointArray.prototype=new i.Array,i.PointArray.prototype.constructor=i.PointArray;for(var a={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,["Z"]}},n="mlhvqtcsaz".split(""),s=0,o=n.length;sl);return s},bbox:function(){return i.parser.draw||i.prepare(),i.parser.path.setAttribute("d",this.toString()),i.parser.path.getBBox()}}),i.Number=i.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(i.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof i.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new i.Number(t),new i.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new i.Number(t),new i.Number(this-t,this.unit||t.unit)},times:function(t){return t=new i.Number(t),new i.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new i.Number(t),new i.Number(this/t,this.unit||t.unit)},to:function(t){var e=new i.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new i.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new i.Number(this.destination).minus(this).times(t).plus(this):this}}}),i.Element=i.invent({create:function(t){this._stroke=i.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=t)&&(this.type=t.nodeName,this.node.instance=this,this._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var a=p(this,t,e);return this.width(new i.Number(a.width)).height(new i.Number(a.height))},clone:function(t){this.writeDataToDom();var e=m(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(i.regex.delimiter)},hasClass:function(t){return-1!=this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!=t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return i.get(this.attr(t))},parent:function(e){var a=this;if(!a.node.parentNode)return null;if(a=i.adopt(a.node.parentNode),!e)return a;for(;a&&a.node instanceof t.SVGElement;){if("string"==typeof e?a.matches(e):a instanceof e)return a;if(!a.node.parentNode||"#document"==a.node.parentNode.nodeName)return null;a=i.adopt(a.node.parentNode)}},doc:function(){return this instanceof i.Doc?this:this.parent(i.Doc)},parents:function(t){var e=[],i=this;do{if(!(i=i.parent(t))||!i.node)break;e.push(i)}while(i.parent);return e},matches:function(t){return function(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,e)}(this.node,t)},native:function(){return this.node},svg:function(t){var a=e.createElement("svg");if(!(t&&this instanceof i.Parent))return a.appendChild(t=e.createElement("svg")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),a.innerHTML.replace(/^