/** * Highcharts JS v11.2.0 (2023-10-30) * * Highcharts Drilldown module * * Author: Torstein Honsi * License: www.highcharts.com/license * */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/drilldown",["highcharts"],function(i){return t(i),t.Highcharts=i,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var i=t?t._modules:{};function e(t,i,e,o){t.hasOwnProperty(i)||(t[i]=o.apply(null,e),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:t[i]}})))}e(i,"Extensions/Breadcrumbs/BreadcrumbsDefaults.js",[],function(){return{lang:{mainBreadcrumb:"Main"},options:{buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"#334eff"}},buttonSpacing:5,floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"#666666",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7}}}),e(i,"Extensions/Breadcrumbs/Breadcrumbs.js",[i["Extensions/Breadcrumbs/BreadcrumbsDefaults.js"],i["Core/Chart/Chart.js"],i["Core/Templating.js"],i["Core/Utilities.js"]],function(t,i,e,o){var r=e.format,n=o.addEvent,s=o.defined,l=o.extend,a=o.fireEvent,d=o.isString,p=o.merge,u=o.objectEach,h=o.pick,c=[];function m(){if(this.breadcrumbs){var t=this.resetZoomButton&&this.resetZoomButton.getBBox(),i=this.breadcrumbs.options;t&&"right"===i.position.align&&"plotBox"===i.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-i.buttonSpacing)}}function f(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function v(){var t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){var i=t.options,e=i.buttonTheme,o=(e.height||0)+2*(e.padding||0)+i.buttonSpacing,r=i.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+o,t.yOffset=o):"middle"!==r?(this.plotTop+=o,t.yOffset=-o):t.yOffset=void 0}}function w(){this.breadcrumbs&&this.breadcrumbs.redraw()}function g(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}return function(){function e(t,i){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];var o=p(t.options.drilldown&&t.options.drilldown.drillUpButton,e.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,i);this.chart=t,this.options=o||{}}return e.compose=function(e,r){o.pushUnique(c,e)&&(n(i,"destroy",f),n(i,"afterShowResetZoom",m),n(i,"getMargins",v),n(i,"redraw",w),n(i,"selection",g)),o.pushUnique(c,r)&&l(r.lang,t.lang)},e.prototype.updateProperties=function(t){this.setList(t),this.setLevel(),this.isDirty=!0},e.prototype.setList=function(t){this.list=t},e.prototype.setLevel=function(){this.level=this.list.length&&this.list.length-1},e.prototype.getLevel=function(){return this.level},e.prototype.getButtonText=function(t){var i=this.chart,e=this.options,o=i.options.lang,n=h(e.format,e.showFullPath?"{level.name}":"← {level.name}"),l=o&&h(o.drillUpText,o.mainBreadcrumb),a=e.formatter&&e.formatter(t)||r(n,{level:t.levelOptions},i)||"";return(d(a)&&!a.length||"← "===a)&&s(l)&&(a=e.showFullPath?l:"← "+l),a},e.prototype.redraw=function(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1},e.prototype.render=function(){var t=this.chart,i=this.options;!this.group&&i&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:i.zIndex}).add()),i.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()},e.prototype.renderFullPathButtons=function(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()},e.prototype.renderSingleButton=function(){var t=this.chart,i=this.list,e=this.options.buttonSpacing;this.destroyListElements();var o=this.group?this.group.getBBox().width:e,r=i[i.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,o,e):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())},e.prototype.alignBreadcrumbsGroup=function(t){if(this.group){var i=this.options,e=i.buttonTheme,o=i.position,r="chart"===i.relativeTo||"spacingBox"===i.relativeTo?void 0:"scrollablePlotBox",n=this.group.getBBox(),s=2*(e.padding||0)+i.buttonSpacing;o.width=n.width+s,o.height=n.height+s;var l=p(o);t&&(l.x+=t),this.options.rtl&&(l.x+=o.width),l.y=h(l.y,this.yOffset,0),this.group.align(l,!0,r)}},e.prototype.renderButton=function(t,i,e){var o=this,r=this.chart,n=o.options,s=p(n.buttonTheme),l=r.renderer.button(o.getButtonText(t),i,e,function(i){var e,r=n.events&&n.events.click;r&&(e=r.call(o,i,t)),!1!==e&&(n.showFullPath?i.newLevel=t.level:i.newLevel=o.level-1,a(o,"up",i))},s).addClass("highcharts-breadcrumbs-button").add(o.group);return r.styledMode||l.attr(n.style),l},e.prototype.renderSeparator=function(t,i){var e=this.chart,o=this.options.separator,r=e.renderer.label(o.text,t,i,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return e.styledMode||r.css(o.style),r},e.prototype.update=function(t){p(!0,this.options,t),this.destroy(),this.isDirty=!0},e.prototype.updateSingleButton=function(){var t=this.chart,i=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(i)})},e.prototype.destroy=function(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0},e.prototype.destroyListElements=function(t){var i=this.elementList;u(i,function(e,o){(t||!i[o].updated)&&((e=i[o]).button&&e.button.destroy(),e.separator&&e.separator.destroy(),delete e.button,delete e.separator,delete i[o])}),t&&(this.elementList={})},e.prototype.destroySingleButton=function(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)},e.prototype.resetElementListState=function(){u(this.elementList,function(t){t.updated=!1})},e.prototype.updateListElements=function(){for(var t,i,e=this.elementList,o=this.options.buttonSpacing,r=this.list,n=this.options.rtl,s=n?-1:1,l=function(t,i){return s*t.getBBox().width+s*i},a=function(t,i,e){t.translate(i-t.getBBox().width,e)},d=this.group?l(this.group,o):o,p=0,u=r.length;po.level&&i.push({level:t.levelNumber+1,levelOptions:f({name:t.lowerSeries.name},t.pointOptions)})})),i}var L=function(){function t(t){this.chart=t}return t.prototype.addSeriesAsDrilldown=function(t,i){var e=this.chart||this;if(e.mapView){if(t.series.isDrilling=!0,e.series.forEach(function(t){var i;t.options.inactiveOtherPoints=!0,null===(i=t.dataLabelsGroup)||void 0===i||i.destroy(),delete t.dataLabelsGroup}),e.options.drilldown&&!e.mapView.projection.hasGeoProjection&&r&&!u(h(e.options.drilldown,r).mapZooming)&&(e.options.drilldown.mapZooming=!1),e.options.drilldown&&e.options.drilldown.animation&&e.options.drilldown.mapZooming){e.mapView.allowTransformAnimation=!0;var o=a(e.options.drilldown.animation);if("boolean"!=typeof o){var n=o.complete,s=function(o){o&&o.applyDrilldown&&e.mapView&&(e.addSingleSeriesAsDrilldown(t,i),e.applyDrilldown(),e.mapView.allowTransformAnimation=!1)};o.complete=function(){n&&n.apply(this,arguments),s.apply(this,arguments)}}t.zoomTo(o)}else e.addSingleSeriesAsDrilldown(t,i),e.applyDrilldown()}else e.addSingleSeriesAsDrilldown(t,i),e.applyDrilldown()},t.prototype.addSingleSeriesAsDrilldown=function(t,i){var o=this.chart||this,r=t.series,n=r.xAxis,s=r.yAxis,l=o.styledMode?{colorIndex:w(t.colorIndex,r.colorIndex)}:{color:t.color||r.color},a=r.options._levelNumber||0,p=r.points.indexOf(t);o.drilldownLevels||(o.drilldownLevels=[]),i=c(c({_ddSeriesId:D++},l),i);var u,h=[],m=[];(u=o.drilldownLevels[o.drilldownLevels.length-1])&&u.levelNumber!==a&&(u=void 0),r.chart.series.forEach(function(t){t.xAxis===n&&(t.options._ddSeriesId=t.options._ddSeriesId||D++,t.options.colorIndex=t.colorIndex,t.options._levelNumber=t.options._levelNumber||a,u?(h=u.levelSeries,m=u.levelSeriesOptions):(h.push(t),t.purgedOptions=f({_ddSeriesId:t.options._ddSeriesId,_levelNumber:t.options._levelNumber,selected:t.options.selected},t.userOptions),m.push(t.purgedOptions)))});var v=c({levelNumber:a,seriesOptions:r.options,seriesPurgedOptions:r.purgedOptions,levelSeriesOptions:m,levelSeries:h,shapeArgs:t.shapeArgs,bBox:t.graphic?t.graphic.getBBox():{},color:t.isNull?e.parse(l.color).setOpacity(0).get():l.color,lowerSeriesOptions:i,pointOptions:r.options.data[p],pointIndex:p,oldExtremes:{xMin:n&&n.userMin,xMax:n&&n.userMax,yMin:s&&s.userMin,yMax:s&&s.userMax},resetZoomButton:u&&u.levelNumber===a?void 0:o.resetZoomButton},l);o.drilldownLevels.push(v),n&&n.names&&(n.names.length=0);var g=v.lowerSeries=o.addSeries(i,!1);g.options._levelNumber=a+1,n&&(n.oldPos=n.pos,n.userMin=n.userMax=null,s.userMin=s.userMax=null),g.isDrilling=!0,r.type===g.type&&(g.animate=g.animateDrilldown||d,g.options.animation=!0)},t.prototype.applyDrilldown=function(){var t,i=this.chart||this,e=i.drilldownLevels;e&&e.length>0&&(t=e[e.length-1].levelNumber,i.hasCartesianSeries=e.some(function(t){return t.lowerSeries.isCartesian}),(i.drilldownLevels||[]).forEach(function(e){i.mapView&&i.options.drilldown&&i.options.drilldown.mapZooming&&(i.redraw(),e.lowerSeries.isDrilling=!1,i.mapView.fitToBounds(e.lowerSeries.bounds),e.lowerSeries.isDrilling=!0),e.levelNumber===t&&e.levelSeries.forEach(function(o){if(i.mapView){if(o.options&&o.options._levelNumber===t&&o.group){var r={};i.options.drilldown&&(r=i.options.drilldown.animation),o.group.animate({opacity:0},r,function(){o.remove(!1),e.levelSeries.filter(function(t){return Object.keys(t).length}).length||(i.resetZoomButton&&(i.resetZoomButton.hide(),delete i.resetZoomButton),i.pointer.reset(),m(i,"afterDrilldown"),i.mapView&&(i.series.forEach(function(t){t.isDirtyData=!0,t.isDrilling=!1}),i.mapView.fitToBounds(void 0,void 0)),m(i,"afterApplyDrilldown"))})}}else o.options&&o.options._levelNumber===t&&o.remove(!1)})})),i.mapView||(i.resetZoomButton&&(i.resetZoomButton.hide(),delete i.resetZoomButton),i.pointer.reset(),m(i,"afterDrilldown"),i.hasCartesianSeries||i.axes.forEach(function(t){t.destroy(!0),t.init(i,f(t.userOptions,t.options))}),i.redraw(),m(i,"afterApplyDrilldown"))},t.prototype.drillUp=function(t){var i=this.chart||this;if(i.drilldownLevels&&0!==i.drilldownLevels.length){m(i,"beforeDrillUp");var e,o,r,n=i.drilldownLevels,s=n[n.length-1].levelNumber,l=i.series,a=i.drilldownLevels.length,d=function(t,e){var r;if(l.forEach(function(i){i.options._ddSeriesId===t._ddSeriesId&&(r=i)}),(r=r||i.addSeries(t,!1)).type===e.type&&r.animateDrillupTo&&(r.animate=r.animateDrillupTo),t===o.seriesPurgedOptions)return r},p=function(t){t.remove(!1),i.series.forEach(function(t){t.colorAxis&&(t.isDirtyData=!0),t.options.inactiveOtherPoints=!1}),i.redraw()},u=n.length;for(i.symbolCounter=i.colorCounter=0;u--;)!function(){var h,c;if((o=n[u]).levelNumber===s){if(n.pop(),!(h=o.lowerSeries).chart){for(e=l.length;e--;)if(l[e].options.id===o.lowerSeriesOptions.id&&l[e].options._levelNumber===s+1){h=l[e];break}}h.xData=[],h.xAxis&&h.xAxis.names&&(0===a||u===a)&&(h.xAxis.names.length=0),o.levelSeriesOptions.forEach(function(t){var i=d(t,h);i&&(c=i)}),m(i,"drillup",{seriesOptions:o.seriesPurgedOptions||o.seriesOptions}),c&&(c.type===h.type&&(c.drilldownLevel=o,c.options.animation=i.options.drilldown.animation,h.animateDrillupFrom&&h.chart&&h.animateDrillupFrom(o)),c.options._levelNumber=s);var f=h;if(i.mapView||f.remove(!1),c&&c.xAxis&&(r=o.oldExtremes,c.xAxis.setExtremes(r.xMin,r.xMax,!1),c.yAxis.setExtremes(r.yMin,r.yMax,!1)),o.resetZoomButton&&(i.resetZoomButton=o.resetZoomButton),i.mapView){var v=o.levelNumber===s&&t,w=i.options.drilldown&&i.options.drilldown.animation&&i.options.drilldown.mapZooming;v?h.remove(!1):(h.dataLabelsGroup&&(h.dataLabelsGroup.destroy(),delete h.dataLabelsGroup),i.mapView&&c&&(w&&(h.isDrilling=!0,c.isDrilling=!0,i.redraw(!1),i.mapView.fitToBounds(h.bounds,void 0,!0,!1)),i.mapView.allowTransformAnimation=!0,m(i,"afterDrillUp",{seriesOptions:c?c.userOptions:void 0}),w?i.mapView.setView(void 0,1,!0,{complete:function(){Object.prototype.hasOwnProperty.call(this,"complete")&&p(h)}}):(i.mapView.allowTransformAnimation=!1,h.group?h.group.animate({opacity:0},i.options.drilldown.animation,function(){p(h),i.mapView&&(i.mapView.allowTransformAnimation=!0)}):(p(h),i.mapView.allowTransformAnimation=!0)),c.isDrilling=!1,i.ddDupes&&(i.ddDupes.length=0),m(i,"drillupall")))}else m(i,"afterDrillUp"),i.redraw(),i.ddDupes&&(i.ddDupes.length=0),m(i,"drillupall")}}()}},t.prototype.fadeInGroup=function(t){var i=a(this.chart.options.drilldown.animation);t&&(t.hide(),y(function(){t&&t.added&&t.fadeIn()},Math.max(i.duration-50,0)))},t.prototype.update=function(t,i){var e=this.chart;f(!0,e.options.drilldown,t),w(i,!0)&&e.redraw()},t}();return function(t){var e=[];function o(t){for(var i=this.chart,e=this.getLevel()-t.newLevel,o=e>1,r=0;r=0)||!(l