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