UNPKG

apexcharts

Version:

A JavaScript Chart Library

6 lines (5 loc) 38.4 kB
/*! * ApexCharts v5.10.5 * (c) 2018-2026 ApexCharts */ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("apexcharts/core");function h(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const g=h(c),d=g.__apex_Graphics,m=g.__apex_axes_AxesUtils,x=g.__apex_Data,p=g.__apex_Series,u=g.__apex_Utils,f=g.__apex_Environment_Environment;class b{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,o=i.globals.svgHeight*s,a=i.dom.elWrap.cloneNode(!0);a.style.width=n+"px",a.style.height=o+"px";const l=(new XMLSerializer).serializeToString(a);let r="\n .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {\n display: none;\n }\n ";i.config.legend.show&&i.dom.elLegendWrap&&i.dom.elLegendWrap.children.length>0&&(r+=".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\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 {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ");let c=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${o}px;">\n <style type="text/css">\n ${r}\n </style>\n ${l}\n </div>\n </foreignObject>\n </svg>\n `;const h=this.svgStringToNode(c);1!==s&&this.scaleSvgNode(h,s),this.convertImagesToBase64(h).then(()=>{c=(new XMLSerializer).serializeToString(h),e(c.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e=t.getElementsByTagName("image"),i=Array.from(e).map(t=>{const e=t.getAttributeNS("http://www.w3.org/1999/xlink","href");return e&&!e.startsWith("data:")?this.getBase64FromUrl(e).then(e=>{t.setAttributeNS("http://www.w3.org/1999/xlink","href",e)}).catch(t=>{}):Promise.resolve()});return Promise.all(i)}getBase64FromUrl(t){return f.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return f.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const o="transparent"!==i.config.chart.background&&i.config.chart.background?i.config.chart.background:"#fff",a=n.getContext("2d");a&&(a.fillStyle=o,a.fillRect(0,0,n.width*s,n.height*s),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{a.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w;t||(t=n.config.series);let o=[];const a=[];let l="";const r=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():u.isNumber(t)?t:t.split(i).join(""),h=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):t,g=Math.max(...t.map(t=>t.data?t.data.length:0)),d=new x(this.w),f=new m(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),b=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new p(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=f.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),u.isNumber(e)?e:e.split(i).join(""))},v=(e,s)=>{var l;if(o.length&&0===s&&a.push(o.join(i)),e.data){e.data=e.data.length&&e.data||[...Array(g)].map(()=>"");for(let g=0;g<e.data.length;g++){o=[];let m=b(g);if("nullvalue"!==m){if(m||(d.isFormatXY()?m=t[s].data[g].x:d.isFormat2DArray()&&(m=t[s].data[g]?t[s].data[g][0]:"")),0===s){o.push(c(m));for(let e=0;e<n.seriesData.series.length;e++){const i=d.isFormatXY()?null==(l=t[e].data[g])?void 0:l.y:r[e][g];o.push(h(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(o.pop(),o.push(n.candleData.seriesCandleO[s][g]),o.push(n.candleData.seriesCandleH[s][g]),o.push(n.candleData.seriesCandleL[s][g]),o.push(n.candleData.seriesCandleC[s][g])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(o.pop(),o.push(n.candleData.seriesCandleO[s][g]),o.push(n.candleData.seriesCandleH[s][g]),o.push(n.candleData.seriesCandleM[s][g]),o.push(n.candleData.seriesCandleL[s][g]),o.push(n.candleData.seriesCandleC[s][g])),"rangeBar"===n.config.chart.type&&(o.pop(),o.push(n.rangeData.seriesRangeStart[s][g]),o.push(n.rangeData.seriesRangeEnd[s][g])),o.length&&a.push(o.join(i))}}}};o.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(o.push("minimum"),o.push("q1"),o.push("median"),o.push("q3"),o.push("maximum")):"candlestick"===n.config.chart.type?(o.push("open"),o.push("high"),o.push("low"),o.push("close")):"rangeBar"===n.config.chart.type?(o.push("minimum"),o.push("maximum")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&o.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(o.push(n.config.chart.toolbar.export.csv.headerValue),a.push(o.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?v(t,e):(o=[],o.push(c(n.labelData.labels[e])),o.push(h(r[e])),a.push(o.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,n)=>{null==i||i.data.forEach(i=>{let o,a;if(d.isFormatXY())o=i.x,a=i.y;else{if(!d.isFormat2DArray())return;o=i[0],a=i[1]}s[o]||(s[o]=Array(t.length).fill("")),s[o][n]=h(a),e.add(o)})}),o.length&&a.push(o.join(i)),Array.from(e).sort().forEach(t=>{a.push([c(t),s[t].join(i)])})})(),l+=a.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+l),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(f.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}const v=g.__apex_BrowserAPIs_BrowserAPIs;class w{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){const t=this.w,e=()=>v.createElementNS("http://www.w3.org/1999/xhtml","div"),i=e();if(i.setAttribute("class","apexcharts-toolbar"),i.style.top=t.config.chart.toolbar.offsetY+"px",i.style.right=3-t.config.chart.toolbar.offsetX+"px",t.dom.elWrap.appendChild(i),this.elZoom=e(),this.elZoomIn=e(),this.elZoomOut=e(),this.elPan=e(),this.elSelection=e(),this.elZoomReset=e(),this.elMenuIcon=e(),this.elMenu=e(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(e());const s=[],n=(e,i,n)=>{const o=e.toLowerCase();this.t[o]&&t.config.chart.zoom.enabled&&s.push({el:i,icon:"string"==typeof this.t[o]?this.t[o]:n,title:this.localeValues[e],class:`apexcharts-${o}-icon`})};n("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),n("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n');const o=e=>{this.t[e]&&t.config.chart[e].enabled&&s.push({el:"zoom"===e?this.elZoom:this.elSelection,icon:"string"==typeof this.t[e]?this.t[e]:"zoom"===e?'<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n <path d="M0 0h24v24H0V0z" fill="none"/>\n <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:this.localeValues["zoom"===e?"selectionZoom":"selection"],class:`apexcharts-${e}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&s.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <defs>\n <path d="M0 0h24v24H0z" id="a"/>\n </defs>\n <clipPath id="b">\n <use overflow="visible" xlink:href="#a"/>\n </clipPath>\n <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),n("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&s.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)s.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});s.forEach((t,e)=>{t.index&&u.moveIndexInArray(s,e,t.index)});for(let t=0;t<s.length;t++)d.setAttrs(s[t].el,{class:s[t].class,title:s[t].title,tabindex:"0",role:"button","aria-label":s[t].title}),s[t].el.innerHTML=s[t].icon,i.appendChild(s[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!t.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!t.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!t.interact.panEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(i),t.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.interact.panEnabled?this.elPan.classList.add(this.selectedClass):t.interact.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),d.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(v.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,o,a,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMenuIcon)||a.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls();const i="selection"===t?e.ctx.toolbar.elSelection:e.ctx.toolbar.elZoom,s="selection"===t?"selectionEnabled":"zoomEnabled";e.w.globals[s]=!e.w.globals[s],i.classList.contains(e.ctx.toolbar.selectedClass)?i.classList.remove(e.ctx.toolbar.selectedClass):i.classList.add(e.ctx.toolbar.selectedClass),i.setAttribute("aria-pressed",String(e.w.globals[s]))})}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{t.ctx.toolbar.toggleOtherControls(),t.w.interact.panEnabled=!t.w.interact.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass),t.ctx.toolbar.elPan.setAttribute("aria-pressed",String(t.w.interact.panEnabled))})}toggleOtherControls(){const t=this.w;t.interact.panEnabled=!1,t.interact.zoomEnabled=!1,t.interact.selectionEnabled=!1,this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}handleZoomIn(){const t=this.w;t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);const e=(this.minX+this.maxX)/2,i=(this.minX+e)/2,s=(this.maxX+e)/2,n=this._getNewMinXMaxX(i,s);t.interact.disableZoomIn||this.zoomUpdateOptions(n.minX,n.maxX)}handleZoomOut(){const t=this.w;if(t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),"datetime"===t.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)return;const e=(this.minX+this.maxX)/2,i=this.minX-(e-this.minX),s=this.maxX-(e-this.maxX),n=this._getNewMinXMaxX(i,s);t.interact.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=u.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new b(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(u.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}const y=g.__apex_index_Box;c.registerFeatures({toolbar:w,zoomPanSelection:class extends w{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none",this.debounceTimer=null,this.debounceDelay=100,this.wheelDelay=400}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=e.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new y(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),e.config.chart.zoom.enabled&&e.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}svgMouseEvents(t,e){var i;const s=this.w,n=this.ctx.toolbar,o=s.interact.zoomEnabled?s.config.chart.zoom.type:s.config.chart.selection.type,a=s.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,n.enableZoomPanFromToolbar("pan"===a?"zoom":"pan")):this.shiftWasPressed&&(n.enableZoomPanFromToolbar(a),this.shiftWasPressed=!1),!e.target)return;const l=e.target.classList;let r;e.target.parentNode&&null!==e.target.parentNode&&(r=e.target.parentNode.classList);if(!(l.contains("apexcharts-legend-marker")||l.contains("apexcharts-legend-text")||r&&r.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=null==(i=this.gridRect)?void 0:i.getBoundingClientRect();if(!t)return;this.startX=this.clientX-t.left-s.globals.barPadForNumericAxis,this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,s.interact.panEnabled?(s.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:o,xyRatios:t})):(this.w.interact.mousedown&&s.interact.zoomEnabled||this.w.interact.mousedown&&s.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:o}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:o}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var i;const s=this.w,n=null==(i=this.gridRect)?void 0:i.getBoundingClientRect();n&&(this.w.interact.mousedown||e)&&(this.endX=this.clientX-n.left-s.globals.barPadForNumericAxis,this.endY=this.clientY-n.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(s.interact.zoomEnabled||s.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),s.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}mouseWheelEvent(t){const e=this.w;t.preventDefault();const i=Date.now();i-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=i),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{i-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=i)},this.debounceDelay)}executeMouseWheelZoom(t){var e;const i=this.w;this.minX=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,this.maxX=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;const s=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!s)return;const n=(t.clientX-s.left)/s.width,o=this.minX,a=this.maxX,l=a-o;let r,c,h;if(t.deltaY<0){r=.5*l;const t=o+n*l;c=t-r/2,h=t+r/2}else r=1.5*l,c=o-r/2,h=a+r/2;if(!i.axisFlags.isRangeBar){c=Math.max(c,i.globals.initialMinX),h=Math.min(h,i.globals.initialMaxX);const t=.01*(i.globals.initialMaxX-i.globals.initialMinX);if(h-c<t){const e=(c+h)/2;c=e-t/2,h=e+t/2}}const g=this._getNewMinXMaxX(c,h);isNaN(g.minX)||isNaN(g.maxX)||this.zoomUpdateOptions(g.minX,g.maxX)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(r(l({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,s=t.layout.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){var i;const s=this.w,n=t,o=null==(i=this.gridRect)?void 0:i.getBoundingClientRect();if(!o)return;const a=n.startX-1,c=n.startY;let h=!1,g=!1;const d=n.clientX-o.left-s.globals.barPadForNumericAxis,m=n.clientY-o.top;let x=d-a,p=m-c,u={translateX:s.layout.translateX,translateY:s.layout.translateY};return Math.abs(x+a)>s.layout.gridWidth?x=s.layout.gridWidth-a:d<0&&(x=a),a>d&&(h=!0,x=Math.abs(x)),c>m&&(g=!0,p=Math.abs(p)),u="x"===e?{x:h?a-x:a,y:0,width:x,height:s.layout.gridHeight}:"y"===e?{x:0,y:g?c-p:c,width:s.layout.gridWidth,height:p}:{x:h?a-x:a,y:g?c-p:c,width:x,height:p},u=r(l({},u),{translateX:s.layout.translateX,translateY:s.layout.translateY}),n.drawSelectionRect(u),n.selectionDragging("resizing"),u}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.xyRatios,h=this.selectionRect;let g=0;"resizing"===t&&(g=30);const d=t=>parseFloat(h.node.getAttribute(t)),m={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=m,"function"==typeof s.config.chart.events.selection&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{var t;const e=null==(t=this.gridRect)?void 0:t.getBoundingClientRect();if(!e)return;const i=h.node.getBoundingClientRect();let n,o,a,l;if(s.axisFlags.isRangeBar)n=s.globals.yAxisScale[0].niceMin+(i.left-e.left)*c.invertedYRatio,o=s.globals.yAxisScale[0].niceMin+(i.right-e.left)*c.invertedYRatio,a=0,l=1;else{if(!s.globals.xAxisScale)return;n=s.globals.xAxisScale.niceMin+(i.left-e.left)*c.xRatio,o=s.globals.xAxisScale.niceMin+(i.right-e.left)*c.xRatio,a=s.globals.yAxisScale[0].niceMin+(e.bottom-i.bottom)*c.yRatio[0],l=s.globals.yAxisScale[0].niceMax-(i.top-e.top)*c.yRatio[0]}const r={xaxis:{min:n,max:o},yaxis:{min:a,max:l}};s.config.chart.events.selection(this.ctx,r),s.config.chart.brush.enabled&&void 0!==s.config.chart.events.brushScrolled&&s.config.chart.events.brushScrolled(this.ctx,r)},g))}selectionDrawn({context:t,zoomtype:e}){var i,s;const n=this.w,o=t,a=this.xyRatios,l=this.ctx.toolbar,r=n.interact.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),c=o.gridRect.getBoundingClientRect(),h=r.left-c.left-n.globals.barPadForNumericAxis,g=r.right-c.left-n.globals.barPadForNumericAxis,d=r.top-c.top,m=r.bottom-c.top;let x,p;if(n.axisFlags.isRangeBar)x=n.globals.yAxisScale[0].niceMin+h*a.invertedYRatio,p=n.globals.yAxisScale[0].niceMin+g*a.invertedYRatio;else{const t=null!=(s=null==(i=n.globals.xAxisScale)?void 0:i.niceMin)?s:0;x=t+h*a.xRatio,p=t+g*a.xRatio}const f=[],b=[];if(n.config.yaxis.forEach((t,e)=>{const i=n.globals.seriesYAxisMap[e][0],s=n.globals.yAxisScale[e].niceMax-a.yRatio[i]*d,o=n.globals.yAxisScale[e].niceMax-a.yRatio[i]*m;f.push(s),b.push(o)}),o.dragged&&(o.dragX>10||o.dragY>10)&&x!==p)if(n.interact.zoomEnabled){if(!n.globals.initialConfig)return;let t=u.clone(n.globals.initialConfig.yaxis),i=u.clone(n.globals.initialConfig.xaxis);if(n.interact.zoomed=!0,n.config.xaxis.convertedCatToNumeric&&(x=Math.floor(x),p=Math.floor(p),x<1&&(x=1,p=n.globals.dataPoints),p-x<2&&(p=x+1)),"xy"!==e&&"x"!==e||(i={min:x,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=b[i],t[i].max=f[i]}),l){const e=l.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const s={xaxis:i};n.config.chart.group||(s.yaxis=t),o.ctx.updateHelpers._updateOptions(s,!1,o.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof n.config.chart.events.zoomed&&l.zoomCallback(i,t)}else if(n.interact.selectionEnabled){let t=null,i=null;if(i={min:x,max:p},"xy"===e||"y"===e){const e=u.clone(n.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=b[i],e[i].max=f[i]})}n.interact.selection=o.selection,"function"==typeof n.config.chart.events.selection&&n.config.chart.events.selection(o.ctx,{xaxis:i,yaxis:t})}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){const i=this.w,s=this.xyRatios;if(!i.globals.initialConfig)return;const n=u.clone(i.globals.initialConfig.yaxis);let o=s.xRatio,a=i.globals.minX,l=i.globals.maxX;i.axisFlags.isRangeBar&&(o=s.invertedYRatio,a=i.globals.minY,l=i.globals.maxY),"left"===this.moveDirection?(t=a+i.layout.gridWidth/15*o,e=l+i.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=a-i.layout.gridWidth/15*o,e=l-i.layout.gridWidth/15*o),i.axisFlags.isRangeBar||(t<i.globals.initialMinX||e>i.globals.initialMaxX)&&(t=a,e=l);const r={xaxis:{min:t,max:e}};i.config.chart.group||(r.yaxis=n),this.updateScrolledChart(r,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}}}),exports.default=c;