highcharts
Version:
JavaScript charting framework
11 lines • 42.3 kB
JavaScript
!/**
* Highcharts JS v13.0.1 (2026-08-17)
* @module highcharts/modules/sunburst
* @requires highcharts
*
* (c) 2016-2026 Highsoft AS
* Authors: Jon Arild Nygård
*
* A commercial license may be required depending on use,
* see www.highcharts.com/license
*/function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):"function"==typeof define&&define.amd?define("highcharts/modules/sunburst",["highcharts/highcharts"],function(t){return e(t,t.Templating,t.Color,t.SeriesRegistry,t.SVGElement,t.Series)}):"object"==typeof exports?exports["highcharts/modules/sunburst"]=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):t.Highcharts=e(t.Highcharts,t.Highcharts.Templating,t.Highcharts.Color,t.Highcharts.SeriesRegistry,t.Highcharts.SVGElement,t.Highcharts.Series)}("u"<typeof window?this:window,(t,e,i,s,r,o)=>(()=>{"use strict";var a,l,n,h,d,p={620(t){t.exports=i},28(t){t.exports=r},820(t){t.exports=o},512(t){t.exports=s},984(t){t.exports=e},944(e){e.exports=t}};let u={};function c(t){let e=u[t];if(void 0!==e)return e.exports;let i=u[t]={exports:{}};return p[t](i,i.exports,c),i.exports}c.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return c.d(e,{a:e}),e},c.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var s=e[i++],r=e[i++];c.o(t,s)?0===r&&i++:0===r?Object.defineProperty(t,s,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,s,{enumerable:!0,get:r})}else for(var s in e)c.o(e,s)&&!c.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},c.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let g={};c.d(g,{default:()=>tC});var v=c(944),b=c.n(v);let f={mainBreadcrumb:"Main"};var m=c(984);let{format:x}=c.n(m)(),{composed:y}=b();function L(){if(this.breadcrumbs){let t=this.resetZoomButton&&this.resetZoomButton.getBBox(),e=this.breadcrumbs.options;t&&"right"===e.position.align&&"plotBox"===e.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-e.buttonSpacing)}}function P(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function T(){let t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){let e=t.options,i=e.buttonTheme,s=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,r=e.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+s,t.yOffset=s):"middle"!==r?(this.plotTop+=s,t.yOffset=-s):t.yOffset=void 0}}function w(){this.breadcrumbs&&this.breadcrumbs.redraw()}function A(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class O{static compose(t,e){(0,v.pushUnique)(y,"Breadcrumbs")&&((0,v.addEvent)(t,"destroy",P),(0,v.addEvent)(t,"afterShowResetZoom",L),(0,v.addEvent)(t,"getMargins",T),(0,v.addEvent)(t,"redraw",w),(0,v.addEvent)(t,"selection",A),(0,v.extend)(e.lang,f))}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];const i=(0,v.merge)(t.options.drilldown&&t.options.drilldown.drillUpButton,O.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=i||{}}updateProperties(t){this.setList(t),this.setLevel(),this.isDirty=!0}setList(t){this.list=t}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(t){let e=this.chart,i=this.options,s=e.options.lang,r=(0,v.pick)(i.format,i.showFullPath?"{level.name}":"← {level.name}"),o=s&&(0,v.pick)(s.drillUpText,s.mainBreadcrumb),a=i.formatter&&i.formatter(t)||x(r,{level:t.levelOptions},e)||"";return((0,v.isString)(a)&&!a.length||"← "===a)&&(0,v.defined)(o)&&(a=i.showFullPath?o:"← "+o),a}redraw(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1}render(){let t=this.chart,e=this.options;!this.group&&e&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:e.zIndex}).add()),e.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()}renderFullPathButtons(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()}renderSingleButton(){let t=this.chart,e=this.list,i=this.options.buttonSpacing;this.destroyListElements();let s=this.group?this.group.getBBox().width:i,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,s,i):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())}alignBreadcrumbsGroup(t){if(this.group){let e=this.options,i=e.buttonTheme,s=e.position,r="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",o=this.group.getBBox(),a=2*(i.padding||0)+e.buttonSpacing;s.width=o.width+a,s.height=o.height+a;let l=(0,v.merge)(s);t&&(l.x+=t),this.options.rtl&&(l.x+=s.width),l.y=(0,v.pick)(l.y,this.yOffset,0),this.group.align(l,!0,r)}}renderButton(t,e,i){let s=this,r=this.chart,o=s.options,a=(0,v.merge)(o.buttonTheme),l=r.renderer.button(s.getButtonText(t),e,i,function(e){let i,r=o.events&&o.events.click;r&&(i=r.call(s,e,t,s)),!1!==i&&(o.showFullPath?e.newLevel=t.level:e.newLevel=s.level-1,(0,v.fireEvent)(s,"up",e))},a).addClass("highcharts-breadcrumbs-button").add(s.group);return r.styledMode||l.attr(o.style),l}renderSeparator(t,e){let i=this.chart,s=this.options.separator,r=i.renderer.label(s.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(s.style),r}update(t){(0,v.merge)(!0,this.options,t),this.destroy(),this.isDirty=!0}updateSingleButton(){let t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})}destroy(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0}destroyListElements(t){let e=this.elementList;(0,v.objectEach)(e,(i,s)=>{(t||!e[s].updated)&&((i=e[s]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[s])}),t&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){(0,v.objectEach)(this.elementList,t=>{t.updated=!1})}updateListElements(){let t=this.elementList,e=this.options.buttonSpacing,i=this.list,s=this.options.rtl,r=s?-1:1,o=function(t,e){return r*t.getBBox().width+r*e},a=function(t,e,i){t.translate(e-t.getBBox().width,i)},l=this.group?o(this.group,e):e,n,h;for(let d=0,p=i.length;d<p;++d){let u,c,g=d===p-1;t[(h=i[d]).level]?(u=(n=t[h.level]).button,n.separator||g?n.separator&&g&&(n.separator.destroy(),delete n.separator):(l+=r*e,n.separator=this.renderSeparator(l,e),s&&a(n.separator,l,e),l+=o(n.separator,e)),t[h.level].updated=!0):(u=this.renderButton(h,l,e),s&&a(u,l,e),l+=o(u,e),g||(c=this.renderSeparator(l,e),s&&a(c,l,e),l+=o(c,e)),t[h.level]={button:u,separator:c,updated:!0}),u&&u.setState(2*!!g)}}}O.defaultOptions={buttonSpacing:5,buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"var(--highcharts-highlight-color-80)"}},floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"var(--highcharts-neutral-color-60)",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7};var S=c(620),R=c.n(S),C=c(512),M=c.n(C),B=c(28),I=c.n(B);let{column:{prototype:N}}=M().seriesTypes;var E=n||(n={});function k(t){let e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(I())(i,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),t?.state==="hover"?(this.graphic.attr({id:this.id}),e.stateMarkerGraphic.attr({href:`${i.url}#${this.id}`,visibility:"visible"})):e.stateMarkerGraphic.attr({href:""}))}E.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return null!==this.value&&this.value!==1/0&&this.value!==-1/0&&(void 0===this.value||!isNaN(this.value))}},E.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){let e={};return(0,v.defined)(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:N.pointAttribs},E.compose=function(t){let e=t.prototype.pointClass;return(0,v.addEvent)(e,"afterSetState",k),t};let D=n;var H=c(820),G=c.n(H);let z=class{constructor(t,e,i,s){this.height=t,this.width=e,this.plot=s,this.direction=i,this.startDirection=i,this.total=0,this.nW=0,this.lW=0,this.nH=0,this.lH=0,this.elArr=[],this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(t,e){return Math.max(t/e,e/t)}}}addElement(t){this.lP.total=this.elArr[this.elArr.length-1],this.total=this.total+t,0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH)),this.elArr.push(t)}reset(){this.nW=0,this.lW=0,this.elArr=[],this.total=0}},V=class{constructor(){this.childrenTotal=0,this.visible=!1}init(t,e,i,s,r,o,a){return this.id=t,this.i=e,this.children=i,this.height=s,this.level=r,this.series=o,this.parent=a,this}},U=function(t,e){let{animatableAttribs:i,onComplete:s,css:r,renderer:o}=e,a=t.series&&t.series.chart.hasRendered?void 0:t.series&&t.series.options.animation,l=t.graphic;if(e.attribs={...e.attribs,class:t.getClassName()},t.shouldDraw())l||(t.graphic=l="text"===e.shapeType?o.text():"image"===e.shapeType?o.image(e.imageUrl||"").attr(e.shapeArgs||{}):o[e.shapeType](e.shapeArgs||{}),l.add(e.group)),r&&l.css(r),l.attr(e.attribs).animate(i,!e.isNew&&a,s);else if(l){let e=()=>{t.graphic=l=l&&l.destroy(),"function"==typeof s&&s()};Object.keys(i).length?l.animate(i,void 0,()=>e()):e()}},{pie:{prototype:{pointClass:W}},scatter:{prototype:{pointClass:j}}}=M().seriesTypes;class F extends j{constructor(){super(...arguments),this.groupedPointsAmount=0,this.shapeType="rect"}draw(t){U(this,t)}getClassName(){let t=this.series,e=t.options,i=super.getClassName();return this.node.level<=t.nodeMap[t.rootNode].level&&this.node.children.length?i+=" highcharts-above-level":this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(0,v.pick)(e.interactByLeaf,!e.allowTraversingTree)?this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(i+=" highcharts-internal-node"):i+=" highcharts-internal-node-interactive",i}isValid(){return!!(this.id||(0,v.isNumber)(this.value))}setState(t){super.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:+("hover"===t)})}shouldDraw(){return(0,v.isNumber)(this.plotY)&&null!==this.y}}(0,v.extend)(F.prototype,{setVisible:W.prototype.setVisible});let _={allowTraversingTree:!1,animationLimit:250,borderRadius:0,showInLegend:!1,marker:void 0,colorByPoint:!1,dataLabels:{enabled:!0,formatter:function(){let t=this&&this.point?this.point:{};return(0,v.isString)(t.name)?t.name:""},headers:!1,inside:!0,padding:2,verticalAlign:"middle",style:{textOverflow:"ellipsis"}},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}<br/>",clusterFormat:"+ {point.groupedPointsAmount} more...<br/>"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"var(--highcharts-neutral-color-10)",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"var(--highcharts-neutral-color-40)",brightness:.1*!M().seriesTypes.heatmap,halo:!1,opacity:.75,shadow:!1}},legendSymbol:"rectangle",traverseToLeaf:!1,cluster:{className:void 0,color:void 0,enabled:!1,pixelWidth:void 0,pixelHeight:void 0,name:void 0,reductionFactor:void 0,minimumClusterSize:5,layoutAlgorithm:{distance:0,gridSize:0,kmeansThreshold:0},marker:{lineWidth:0,radius:0}}};(h||(h={})).recursive=function t(e,i,s){let r=i.call(s||this,e);!1!==r&&t(r,i,s)};let Y=h,X={getColor:function(t,e){let i,s,r,o,a,l,n=e.index,h=e.mapOptionsToLevel,d=e.parentColor,p=e.parentColorIndex,u=e.series,c=e.colors,g=e.siblings,b=u.points,f=u.chart.options.chart;if(t){let m;i=b[t.i],s=h[t.level]||{},i&&s.colorByPoint&&(o=i.index%(c?c.length:f.colorCount),r=c&&c[o]),u.chart.styledMode||(a=(0,v.pick)(i&&i.options.color,s&&s.color,r,d&&((m=s&&s.colorVariation)&&"brightness"===m.key&&n&&g?R().parse(d).brighten(m.to*(n/g)).get():d),u.color)),l=(0,v.pick)(i&&i.options.colorIndex,s&&s.colorIndex,o,p,e.colorIndex)}return{color:a,colorIndex:l}},getLevelOptions:function(t){let e,i,s,r,o,a,l={};if((0,v.isObject)(t))for(r=(0,v.isNumber)(t.from)?t.from:1,a=t.levels,i={},e=(0,v.isObject)(t.defaults)?t.defaults:{},(0,v.isArray)(a)&&(i=a.reduce((t,i)=>{let s,o,a;return(0,v.isObject)(i)&&(0,v.isNumber)(i.level)&&(a=(0,v.merge)({},i),o=(0,v.pick)(a.levelIsConstant,e.levelIsConstant),delete a.levelIsConstant,delete a.level,s=i.level+(o?0:r-1),(0,v.isObject)(t[s])?(0,v.merge)(!0,t[s],a):t[s]=a),t},{})),o=(0,v.isNumber)(t.to)?t.to:1,s=0;s<=o;s++)l[s]=(0,v.merge)({},e,(0,v.isObject)(i[s])?i[s]:{});return l},getNodeWidth:function(t,e){let{chart:i,options:s}=t,{nodeDistance:r=0,nodeWidth:o=0}=s,{plotSizeX:a=1}=i;if("auto"===o){if("string"==typeof r&&/%$/.test(r))return a/(e+parseFloat(r)/100*(e-1));let t=Number(r);return(a+t)/(e||1)-t}return(0,v.relativeLength)(o,a)},setTreeValues:function t(e,i){let s=i.before,r=i.idRoot,o=i.mapIdToNode[r],a=!1!==i.levelIsConstant,l=i.points[e.i],n=l&&l.options||{},h=[],d=0;e.levelDynamic=e.level-(a?0:o.level),e.name=(0,v.pick)(l&&l.name,""),e.visible=r===e.id||!0===i.visible,"function"==typeof s&&(e=s(e,i)),e.children.forEach((s,r)=>{let o=(0,v.extend)({},i);(0,v.extend)(o,{index:r,siblings:e.children.length,visible:e.visible}),s=t(s,o),h.push(s),s.visible&&(d+=s.val)});let p=(0,v.pick)(n.value,d);return e.visible=p>=0&&(d>0||e.visible),e.children=h,e.childrenTotal=d,e.isLeaf=e.visible&&!d,e.val=p,e},updateRootId:function(t){let e,i;return(0,v.isObject)(t)&&(i=(0,v.isObject)(t.options)?t.options:{},e=(0,v.pick)(t.rootNode,i.rootId,""),(0,v.isObject)(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}},{parse:$}=R(),{composed:q,noop:K}=b(),{column:Z,scatter:J}=M().seriesTypes,{getColor:Q,getLevelOptions:tt,updateRootId:te}=X;G().keepProps.push("simulation","hadOutsideDataLabels");let ti=!1;function ts(){let t=this.xAxis,e=this.yAxis;if(t&&e)if(this.is("treemap")){let i={endOnTick:!1,startOnTick:!1,visible:!1};this.is("treegraph")||(i.min=0,i.max=100,i.tickPositions=[]),(0,v.merge)(!0,t.options,i,t.userOptions),(0,v.merge)(!0,e.options,i,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),ti=!0}else ti&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),ti=!1)}class tr extends J{constructor(){super(...arguments),this.simulation=0}static compose(t){(0,v.pushUnique)(q,"TreemapSeries")&&(0,v.addEvent)(t,"afterBindAxes",ts)}algorithmCalcPoints(t,e,i,s){let r=i.plot,o=i.elArr.length-1,a,l,n,h,d=i.lW,p=i.lH,u,c=0;for(let t of(e?(d=i.nW,p=i.nH):u=i.elArr[o],i.elArr))(e||c<o)&&(0===i.direction?(a=r.x,l=r.y,h=t/(n=d)):(a=r.x,l=r.y,n=t/(h=p)),s.push({x:a,y:l,width:n,height:(0,v.correctFloat)(h)}),0===i.direction?r.y=r.y+h:r.x=r.x+n),c+=1;i.reset(),0===i.direction?i.width=i.width-d:i.height=i.height-p,r.y=r.parent.y+(r.parent.height-i.height),r.x=r.parent.x+(r.parent.width-i.width),t&&(i.direction=1-i.direction),e||i.addElement(u)}algorithmFill(t,e,i){let s=[],r,o=e.direction,a=e.x,l=e.y,n=e.width,h=e.height,d,p,u,c;for(let g of i)r=e.width*e.height*(g.val/e.val),d=a,p=l,0===o?(n-=u=r/(c=h),a+=u):(h-=c=r/(u=n),l+=c),s.push({x:d,y:p,width:u,height:c,direction:0,val:0}),t&&(o=1-o);return s}algorithmLowAspectRatio(t,e,i){let s=[],r={x:e.x,y:e.y,parent:e},o=e.direction,a=i.length-1,l=new z(e.height,e.width,o,r),n,h=0;for(let o of i)n=e.width*e.height*(o.val/e.val),l.addElement(n),l.lP.nR>l.lP.lR&&this.algorithmCalcPoints(t,!1,l,s,r),h===a&&this.algorithmCalcPoints(t,!0,l,s,r),++h;return s}alignDataLabel(t,e,i){Z.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})}applyTreeGrouping(){let t=this,e=t.parentList||{},{cluster:i}=t.options,s=i?.minimumClusterSize||5;if(i?.enabled){let r={},o=t=>{if(t?.point?.shapeArgs){let{width:e=0,height:s=0}=t.point.shapeArgs,{pixelWidth:o=0,pixelHeight:a=0}=i,l=(0,v.defined)(a),n=a?o*a:o*o;(e<o||s<(l?a:o)||e*s<n)&&!t.isGroup&&(0,v.defined)(t.parent)&&(r[t.parent]||(r[t.parent]=[]),r[t.parent].push(t))}t?.children.forEach(t=>{o(t)})};for(let a in o(t.tree),r)r[a]&&r[a].length>s&&r[a].forEach(s=>{let r=e[a].indexOf(s.i);if(-1!==r){e[a].splice(r,1);let o=`highcharts-grouped-treemap-points-${s.parent||"root"}`,l=t.points.find(t=>t.id===o);if(!l){let s=t.pointClass,r=t.points.length;l=new s(t,{className:i.className,color:i.color,id:o,index:r,isGroup:!0,value:0}),(0,v.extend)(l,{formatPrefix:"cluster"}),t.points.push(l),e[a].push(r),e[o]=[]}let n=l.groupedPointsAmount+1,h=t.points[l.index].options.value||0,d=i.name||`+ ${n}`;t.points[l.index].groupedPointsAmount=n,t.points[l.index].options.value=h+(s.point.value||0),t.points[l.index].name=d,e[o].push(s.point.index)}});t.nodeMap={},t.nodeList=[],t.parentList=e;let a=t.buildTree("",-1,0,t.parentList);t.translate(a)}}calculateChildrenAreas(t,e){let i=this.options,s=this.mapOptionsToLevel[t.level+1],r=(0,v.pick)(s?.layoutAlgorithm&&this[s?.layoutAlgorithm]&&s.layoutAlgorithm,i.layoutAlgorithm),o=i.alternateStartingDirection,a=t.children.filter(e=>t.isGroup||!e.ignore),l=s?.groupPadding??i.groupPadding??0,n=this.nodeMap[this.rootNode];if(!r)return;let h=[],d=n.pointValues?.width||0,p=n.pointValues?.height||0;s?.layoutStartingDirection&&(e.direction=+("vertical"!==s.layoutStartingDirection)),h=this[r](e,a);let u=-1;for(let t of a){let i=h[++u];t===n&&(d=d||i.width,p=i.height);let s=l/(this.xAxis.len/p),r=l/(this.yAxis.len/p);if(t.values=(0,v.merge)(i,{val:t.childrenTotal,direction:o?1-e.direction:e.direction}),t.children.length&&t.point.dataLabels?.length){let e=(0,v.arrayMax)(t.point.dataLabels.map(t=>t.options?.headers&&t.height||0))/(this.yAxis.len/p);e<t.values.height/2&&(t.values.y+=e,t.values.height-=e)}if(l){let e=Math.min(s,t.values.width/4),i=Math.min(r,t.values.height/4);t.values.x+=e,t.values.width-=2*e,t.values.y+=i,t.values.height-=2*i}t.pointValues=(0,v.merge)(i,{x:i.x/this.axisRatio,y:100-i.y-i.height,width:i.width/this.axisRatio}),t.children.length&&this.calculateChildrenAreas(t,t.values)}let c=(t,e=[],i=!0)=>(t.children.forEach(t=>{i&&t.isLeaf?e.push(t.point):i||t.isLeaf||e.push(t.point),t.children.length&&c(t,e,i)}),e);if("leaf"===i.nodeSizeBy&&t===n&&this.hasOutsideDataLabels&&!c(n,void 0,!1).some(t=>(0,v.isNumber)(t.options.value))&&!(0,v.isNumber)(n.point?.options.value)){let i=c(n),s=i.map(t=>t.options.value||0),r=i.map(({node:{pointValues:t}})=>t?t.width*t.height:0),o=s.reduce((t,e)=>t+e,0),a=r.reduce((t,e)=>t+e,0)/o,l=0,h=0;i.forEach((t,e)=>{let i=s[e]?r[e]/s[e]:1,o=(0,v.clamp)(i/a,.8,1.4),n=1-o;t.value&&(r[e]<20&&(n*=r[e]/20),n>h&&(h=n),n<l&&(l=n),t.simulatedValue=(t.simulatedValue||t.value)/o)}),(l<-.05||h>.05)&&this.simulation<10?(this.simulation++,this.setTreeValues(t),e.val=t.val,this.calculateChildrenAreas(t,e)):(i.forEach(t=>{delete t.simulatedValue}),this.setTreeValues(t),this.simulation=0)}}createList(t){let e=this.chart,i=e.breadcrumbs,s=[];if(i){let i=0;s.push({level:i,levelOptions:e.series[0]});let r=t.target.nodeMap[t.newRootId],o=[];for(;r.parent||""===r.parent;)o.push(r),r=t.target.nodeMap[r.parent];for(let t of o.reverse())s.push({level:++i,levelOptions:t});s.length<=1&&(s.length=0)}return s}drawDataLabels(){let t=this.mapOptionsToLevel,e=this.points.filter(function(t){return t.node.visible||(0,v.defined)(t.dataLabel)}),i=(0,v.splat)(this.options.dataLabels||{})[0]?.padding,s=e.some(t=>(0,v.isNumber)(t.plotY));for(let r of e){let e={},o={style:e},a=t[r.node.level];if((!r.node.isLeaf&&!r.node.isGroup||r.node.isGroup&&r.node.level<=this.nodeMap[this.rootNode].level)&&(o.enabled=!1),a?.dataLabels&&((0,v.merge)(!0,o,(0,v.splat)(a.dataLabels)[0]),this.hasDataLabels=()=>!0),r.node.isLeaf?o.inside=!0:o.headers&&(o.verticalAlign="top"),r.shapeArgs&&s){let{height:t=0,width:s=0}=r.shapeArgs;if(s>32&&t>16&&r.shouldDraw()){let a=s-2*((0,v.splat)(o.padding)[0]||(0,v.splat)(i)[0]||0);e.width=`${a}px`,e.lineClamp??(e.lineClamp=Math.floor(t/16)),this.options.allowTraversingTree&&(e.visibility="inherit"),r.dataLabel?.attr({width:o.headers?a:void 0})}else e.width=`${s}px`,e.visibility="hidden"}r.dlOptions=(0,v.merge)(o,r.options.dataLabels,{zIndex:void 0}),delete r.dlOptions.zIndex}super.drawDataLabels(e)}drawPoints(t=this.points){let e=this.chart,i=e.renderer,s=e.styledMode,r=this.options,o=s?{}:r.shadow,a=r.borderRadius,l=e.pointCount<r.animationLimit,n=r.allowTraversingTree;for(let e of t){let t={},h={},d={},p="level-group-"+e.node.level,u=!!e.graphic,c=l&&u,g=e.shapeArgs;e.shouldDraw()&&(e.isInside=!0,a&&(h.r=a),(0,v.merge)(!0,c?t:h,u?g:{},s?{}:this.pointAttribs(e,e.selected?"select":void 0)),this.colorAttribs&&s&&(0,v.extend)(d,this.colorAttribs(e)),this[p]||(this[p]=i.g(p).attr({zIndex:-(e.node.level||0)}).add(this.group),this[p].survive=!0)),e.draw({animatableAttribs:t,attribs:h,css:d,group:this[p],imageUrl:e.imageUrl,renderer:i,shadow:o,shapeArgs:g,shapeType:e.shapeType}),n&&e.graphic&&(e.drillId=r.interactByLeaf?this.drillToByLeaf(e):this.drillToByGroup(e))}}drillToByGroup(t){return(!t.node.isLeaf||!!t.node.isGroup)&&t.id}drillToByLeaf(t){let{traverseToLeaf:e}=t.series.options,i=!1,s;if(t.node.parent!==this.rootNode&&t.node.isLeaf)if(e)i=t.id;else for(s=t.node;!i;)void 0!==s.parent&&(s=this.nodeMap[s.parent]),s.parent===this.rootNode&&(i=s.id);return i}drillToNode(t,e){(0,v.error)(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"}),this.setRootNode(t,e)}drillUp(){let t=this.nodeMap[this.rootNode];t&&(0,v.isString)(t.parent)&&this.setRootNode(t.parent,!0,{trigger:"traverseUpButton"})}getExtremes(){let{dataMin:t,dataMax:e}=super.getExtremes(this.colorValueData);return this.valueMin=t,this.valueMax=e,super.getExtremes()}getListOfParents(t,e){let i=(0,v.isArray)(t)?t:[],s=(0,v.isArray)(e)?e:[],r=i.reduce(function(t,e,i){let s=(0,v.pick)(e.parent,"");return void 0===t[s]&&(t[s]=[]),t[s].push(i),t},{"":[]});for(let t of Object.keys(r)){let e=r[t];if(""!==t&&-1===s.indexOf(t)){for(let t of e)r[""].push(t);delete r[t]}}return r}getTree(){let t=this.data.map(function(t){return t.id});return this.parentList=this.getListOfParents(this.data,t),this.nodeMap={},this.nodeList=[],this.buildTree("",-1,0,this.parentList||{})}buildTree(t,e,i,s,r){let o=[],a=this.points[e],l=0,n;for(let e of s[t]||[])l=Math.max((n=this.buildTree(this.points[e].id,e,i+1,s,t)).height+1,l),o.push(n),this.is("treegraph")&&(n.visible=!0);let h=new this.NodeClass().init(t,e,o,l,i,this,r);for(let t of o)t.parentNode=h;return this.nodeMap[h.id]=h,this.nodeList.push(h),a&&(a.node=h,h.point=a,(0,v.defined)(a.options.x)||(a.x=i)),h}hasData(){return!!this.dataTable.rowCount}init(t,e){let i=this,s=(0,v.merge)(e.drillUpButton,e.breadcrumbs),r=(0,v.addEvent)(i,"setOptions",t=>{let e=t.userOptions;(0,v.defined)(e.allowDrillToNode)&&!(0,v.defined)(e.allowTraversingTree)&&(e.allowTraversingTree=e.allowDrillToNode,delete e.allowDrillToNode),(0,v.defined)(e.drillUpButton)&&!(0,v.defined)(e.traverseUpButton)&&(e.traverseUpButton=e.drillUpButton,delete e.drillUpButton);let i=(0,v.splat)(e.dataLabels||{});e.levels?.forEach(t=>{i.push.apply(i,(0,v.splat)(t.dataLabels||{}))}),this.hasOutsideDataLabels=i.some(t=>t.headers)});super.init(t,e),delete i.opacity,i.eventsToUnbind.push(r),i.options.allowTraversingTree&&(i.eventsToUnbind.push((0,v.addEvent)(i,"click",i.onClickDrillToNode)),i.eventsToUnbind.push((0,v.addEvent)(i,"setRootNode",function(t){let e=i.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(i.createList(t))})),i.eventsToUnbind.push((0,v.addEvent)(i,"update",function(t,e){let i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs),this.hadOutsideDataLabels=this.hasOutsideDataLabels})),i.eventsToUnbind.push((0,v.addEvent)(i,"destroy",function(t){let e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),t.breadcrumbs||(t.breadcrumbs=new O(t,s)),i.eventsToUnbind.push((0,v.addEvent)(t.breadcrumbs,"up",function(t){let e=this.level-t.newLevel;for(let t=0;t<e;t++)i.drillUp()}))}onClickDrillToNode(t){let e=t.point,i=e?.drillId;(0,v.isString)(i)&&(e.setState(""),this.setRootNode(i,!0,{trigger:"click"}))}pointAttribs(t,e){let i=(0,v.isObject)(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},s=t?.node&&i[t.node.level]||{},r=this.options,o=e&&r.states&&r.states[e]||{},a=t?.node&&t.getClassName()||"",l={stroke:t&&t.borderColor||s.borderColor||o.borderColor||r.borderColor,"stroke-width":(0,v.pick)(t&&t.borderWidth,s.borderWidth,o.borderWidth,r.borderWidth),dashstyle:t?.borderDashStyle||s.borderDashStyle||o.borderDashStyle||r.borderDashStyle,fill:t?.color||this.color};return -1!==a.indexOf("highcharts-above-level")?(l.fill="none",l["stroke-width"]=0):-1!==a.indexOf("highcharts-internal-node-interactive")?(l["fill-opacity"]=o.opacity??r.opacity??1,l.cursor="pointer"):-1!==a.indexOf("highcharts-internal-node")?l.fill="none":e&&o.brightness&&(l.fill=$(l.fill).brighten(o.brightness).get()),l}setColorRecursive(t,e,i,s,r){let o=this?.chart,a=o?.options?.colors;if(t){let o=Q(t,{colors:a,index:s,mapOptionsToLevel:this.mapOptionsToLevel,parentColor:e,parentColorIndex:i,series:this,siblings:r}),l=this.points[t.i];l&&(l.color=o.color,l.colorIndex=o.colorIndex);let n=-1;for(let e of t.children||[])this.setColorRecursive(e,o.color,o.colorIndex,++n,t.children.length)}}setPointValues(){let t=this,{points:e,xAxis:i,yAxis:s}=t,r=t.chart.styledMode,o=e=>r?0:t.pointAttribs(e)["stroke-width"]||0;for(let t of e){let{pointValues:e,visible:r}=t.node;if(e&&r){let{height:r,width:a,x:l,y:n}=e,h=o(t),d=i.toPixels(l,!0),p=i.toPixels(l+a,!0),u=s.toPixels(n,!0),c=s.toPixels(n+r,!0),g=0===d?h/2:(0,v.crisp)(i.toPixels(l,!0),h,!0),b=p===i.len?i.len-h/2:(0,v.crisp)(i.toPixels(l+a,!0),h,!0),f=u===s.len?s.len-h/2:(0,v.crisp)(s.toPixels(n,!0),h,!0),m=0===c?h/2:(0,v.crisp)(s.toPixels(n+r,!0),h,!0),x={x:Math.min(g,b),y:Math.min(f,m),width:Math.abs(b-g),height:Math.abs(m-f)};t.plotX=x.x+x.width/2,t.plotY=x.y+x.height/2,t.shapeArgs=x}else delete t.plotX,delete t.plotY}}setRootNode(t,e,i){let s=(0,v.extend)({newRootId:t,previousRootId:this.rootNode,redraw:(0,v.pick)(e,!0),series:this},i);(0,v.fireEvent)(this,"setRootNode",s,function(t){let e=t.series;e.idPreviousRoot=t.previousRootId,e.rootNode=t.newRootId,e.isDirty=!0,t.redraw&&e.chart.redraw()})}setState(t){this.options.inactiveOtherPoints=!0,super.setState(t,!1),this.options.inactiveOtherPoints=!1}setTreeValues(t){let e=this.options,i=this.rootNode,s=this.nodeMap[i],r="boolean"!=typeof e.levelIsConstant||e.levelIsConstant,o=[],a=this.points[t.i],l=0;for(let e of t.children)e=this.setTreeValues(e),o.push(e),e.ignore||(l+=e.val);(0,v.stableSort)(o,(t,e)=>(t.sortIndex||0)-(e.sortIndex||0));let n=(0,v.pick)(a?.simulatedValue,a?.options.value,l);return a&&(a.value=n),a?.isGroup&&e.cluster?.reductionFactor&&(n/=e.cluster.reductionFactor),t.parentNode?.point?.isGroup&&this.rootNode!==t.parent&&(t.visible=!1),(0,v.extend)(t,{children:o,childrenTotal:l,ignore:!((0,v.pick)(a?.visible,!0)&&n>0),isLeaf:t.visible&&!("treegraph"===this.type?o.length>0:l),isGroup:a?.isGroup,levelDynamic:t.level-(r?0:s.level),name:(0,v.pick)(a?.name,""),sortIndex:(0,v.pick)(a?.sortIndex,-n),val:n}),t}sliceAndDice(t,e){return this.algorithmFill(!0,t,e)}squarified(t,e){return this.algorithmLowAspectRatio(!0,t,e)}strip(t,e){return this.algorithmLowAspectRatio(!1,t,e)}stripes(t,e){return this.algorithmFill(!1,t,e)}translate(t){let e=this,i=e.options,s=!t,r=te(e),o,a,l,n;t||r.startsWith("highcharts-grouped-treemap-points-")||((this.points||[]).forEach(t=>{t.isGroup&&t.destroy()}),super.translate(),t=e.getTree()),e.tree=t=t||e.tree,o=e.nodeMap[r],""===r||o||(e.setRootNode("",!1),r=e.rootNode,o=e.nodeMap[r]),o.point?.isGroup||(e.mapOptionsToLevel=tt({from:o.level+1,levels:i.levels,to:t.height,defaults:{levelIsConstant:e.options.levelIsConstant,colorByPoint:i.colorByPoint}})),Y.recursive(e.nodeMap[e.rootNode],t=>{let i=t.parent,s=!1;return t.visible=!0,(i||""===i)&&(s=e.nodeMap[i]),s}),Y.recursive(e.nodeMap[e.rootNode].children,t=>{let e=!1;for(let i of t)i.visible=!0,i.children.length&&(e=(e||[]).concat(i.children));return e}),e.setTreeValues(t),e.axisRatio=e.xAxis.len/e.yAxis.len,e.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100},e.nodeMap[""].values=l=(0,v.merge)(a,{width:a.width*e.axisRatio,direction:+("vertical"!==i.layoutStartingDirection),val:t.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),e.calculateChildrenAreas(t,l),e.colorAxis||i.colorByPoint||e.setColorRecursive(e.tree),i.allowTraversingTree&&o.pointValues&&(n=o.pointValues,e.xAxis.setExtremes(n.x,n.x+n.width,!1),e.yAxis.setExtremes(n.y,n.y+n.height,!1),e.xAxis.setScale(),e.yAxis.setScale()),e.setPointValues(),s&&e.applyTreeGrouping()}}tr.defaultOptions=(0,v.merge)(J.defaultOptions,_),(0,v.extend)(tr.prototype,{buildKDTree:K,colorAttribs:D.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:K,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:F,NodeClass:V,trackerGroups:["group","dataLabelsGroup"],utils:Y}),D.compose(tr),M().registerSeriesType("treemap",tr);let{deg2rad:to}=b();(a=d||(d={})).getCenter=function(){let t=this.options,e=this.chart,i=2*(t.slicedOffset||0),s=e.plotWidth-2*i,r=e.plotHeight-2*i,o=t.center,a=Math.min(s,r),l=t.thickness,n,h=t.size,d=t.innerSize||0,p,u;"string"==typeof h&&(h=parseFloat(h)),"string"==typeof d&&(d=parseFloat(d));let c=[(0,v.pick)(o?.[0],"50%"),(0,v.pick)(o?.[1],"50%"),(0,v.pick)(h&&h<0?void 0:t.size,"100%"),(0,v.pick)(d&&d<0?void 0:t.innerSize||0,"0%")];for(p=0;p<4;++p)u=c[p],n=p<2||2===p&&/%$/.test(u),c[p]=(0,v.relativeLength)(u,[s,r,a,c[2]][p])+(n?i:0);return c[3]>c[2]&&(c[3]=c[2]),(0,v.isNumber)(l)&&2*l<c[2]&&l>0&&(c[3]=c[2]-2*l),(0,v.fireEvent)(this,"afterGetCenter",{positions:c}),c},a.getStartAndEndRadians=function(t,e){let i=(0,v.isNumber)(t)?t:0,s=(0,v.isNumber)(e)&&e>i&&e-i<360?e:i+360;return{start:to*(i+-90),end:to*(s+-90)}};let ta=d,{series:{prototype:{pointClass:tl}},seriesTypes:{treemap:{prototype:{pointClass:tn}}}}=M();class th extends tn{getDataLabelPath(t){let e=this.series.chart.renderer,i=this.shapeExisting,s=i.r+(0,v.pInt)(t.options?.distance||0),r=i.start,o=i.end,a=r+(o-r)/2,l=a<0&&a>-Math.PI||a>Math.PI,n;return r===-Math.PI/2&&(0,v.correctFloat)(o)===(0,v.correctFloat)(1.5*Math.PI)&&(r=-Math.PI+Math.PI/360,o=-Math.PI/360,l=!0),o-r>Math.PI&&(l=!1,n=!0,o-r>2*Math.PI-.01&&(r+=.01,o-=.01)),this.dataLabelPath&&(this.dataLabelPath=this.dataLabelPath.destroy()),this.dataLabelPath=e.arc({open:!0,longArc:+!!n}).attr({start:l?r:o,end:l?o:r,clockwise:+l,x:i.x,y:i.y,r:(s+i.innerR)/2}).add(e.defs),this.dataLabelPath}isValid(){return!0}}(0,v.extend)(th.prototype,{getClassName:tl.prototype.getClassName,haloPath:tl.prototype.haloPath,setState:tl.prototype.setState});let{seriesTypes:{treemap:td}}=M();function tp(t,e){let i=[];if((0,v.isNumber)(t)&&(0,v.isNumber)(e)&&t<=e)for(let s=t;s<=e;s++)i.push(s);return i}let tu={calculateLevelSizes:function(t,e){let i=(0,v.isObject)(e)?e:{},s,r=0,o,a,l,n;if((0,v.isObject)(t)){for(let e of(s=(0,v.merge)({},t),a=tp((0,v.isNumber)(i.from)?i.from:0,(0,v.isNumber)(i.to)?i.to:0),l=Object.keys(s).filter(t=>-1===a.indexOf(+t)),o=n=(0,v.isNumber)(i.diffRadius)?i.diffRadius:0,a)){let t=s[e],i=t.levelSize.unit,a=t.levelSize.value;"weight"===i?r+=a:"percentage"===i?(t.levelSize={unit:"pixels",value:a/100*o},n-=t.levelSize.value):"pixels"===i&&(n-=a)}for(let t of a){let e=s[t];if("weight"===e.levelSize.unit){let i=e.levelSize.value;s[t].levelSize={unit:"pixels",value:i/r*n}}}for(let t of l)s[t].levelSize={value:0,unit:"pixels"}}return s},getLevelFromAndTo:function({level:t,height:e}){return{from:t>0?t:1,to:t+e}},range:tp,recursive:td.prototype.utils.recursive},{composed:tc,deg2rad:tg}=b(),{getCenter:tv,getStartAndEndRadians:tb}=ta,{noop:tf}=b(),{column:tm,treemap:tx}=M().seriesTypes,{getColor:ty,getLevelOptions:tL,setTreeValues:tP,updateRootId:tT}=X;l=I(),(0,v.pushUnique)(tc,"TextPath")&&((0,v.addEvent)(l,"afterGetBBox",function(t){let e=t.bBox,i=this.element?.querySelector("textPath");if(i){let t=[],{b:s,h:r}=this.renderer.fontMetrics(this.element),o=r-s,a=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),l=i.innerHTML.replace(a,"").split(/<tspan class="highcharts-br"[^>]*>/),n=l.length,h=(t,e)=>{let{x:r,y:a}=e,l=(i.getRotationOfChar(t)-90)*tg,n=Math.cos(l),h=Math.sin(l);return[[r-o*n,a-o*h],[r+s*n,a+s*h]]};for(let e=0,s=0;s<n;s++){let r=l[s].length;for(let o=0;o<r;o+=5)try{let r=e+o+s,[a,l]=h(r,i.getStartPositionOfChar(r));0===o?(t.push(l),t.push(a)):(0===s&&t.unshift(l),s===n-1&&t.push(a))}catch{break}e+=r-1;try{let r=e+s,o=i.getEndPositionOfChar(r),[a,l]=h(r,o);t.unshift(l),t.unshift(a)}catch{break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}),(0,v.addEvent)(l,"beforeAddingDataLabel",function(t){let e=t.labelOptions,i=t.point,s=e[i.formatPrefix+"TextPath"]||e.textPath;s&&!e.useHTML&&(this.setTextPath(i.getDataLabelPath?.(this)||i.graphic,s),i.dataLabelPath&&!s.enabled&&(i.dataLabelPath=i.dataLabelPath.destroy()))}),l.prototype.setTextPath=l.prototype.setTextPath??function(t,e){let i=this.renderer.url,s=this.text||this,r=s.textPath,{attributes:o,enabled:a}=(0,v.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);if(t=t||r&&r.path,r?.undo(),t&&a){let e=(0,v.addEvent)(s,"afterModifyTree",e=>{if(t&&a){let r=t.attr("id");r||t.attr("id",r=(0,v.uniqueKey)());let a={x:0,y:0};(0,v.defined)(o.dx)&&(a.dx=o.dx,delete o.dx),(0,v.defined)(o.dy)&&(a.dy=o.dy,delete o.dy),s.attr(a),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let l=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,v.extend)(o,{"text-anchor":o.textAnchor,href:`${i}#${r}`}),children:l}}});s.textPath={path:t,undo:e}}else s.attr({dx:0,dy:0}),delete s.textPath;return this.added&&(s.textCache="",this.renderer.buildText(s)),this});let tw=180/Math.PI,tA=function(t,e,i,s){return{x:t+Math.cos(i)*s,y:e+Math.sin(i)*s}};function tO(t,e){let i=e.mapIdToNode,s=t.parent,r=s?i[s]:void 0,o=e.series,a=o.chart,l=o.points[t.i],n=ty(t,{colors:o.options.colors||a&&a.options.colors,colorIndex:o.colorIndex,index:e.index,mapOptionsToLevel:e.mapOptionsToLevel,parentColor:r&&r.color,parentColorIndex:r&&r.colorIndex,series:e.series,siblings:e.siblings});return t.color=n.color,t.colorIndex=n.colorIndex,l&&(l.color=t.color,l.colorIndex=t.colorIndex,t.sliced=t.id!==e.idRoot&&l.sliced),t}class tS extends tx{alignDataLabel(t,e,i){if(!i.textPath||!i.textPath.enabled)return e.placed=!1,super.alignDataLabel.apply(this,arguments)}animate(t){let e,i=this.chart,s=[i.plotWidth/2,i.plotHeight/2],r=i.plotLeft,o=i.plotTop,a=this.group;t?(e={translateX:s[0]+r,translateY:s[1]+o,scaleX:.001,scaleY:.001,rotation:10,opacity:.01},a.attr(e)):(e={translateX:r,translateY:o,scaleX:1,scaleY:1,rotation:0,opacity:1},a.animate(e,this.options.animation))}drawPoints(){let t=this,e=t.mapOptionsToLevel,i=t.shapeRoot,s=t.group,r=t.hasRendered,o=t.rootNode,a=t.idPreviousRoot,l=t.nodeMap,n=l[a],h=n&&n.shapeArgs,d=t.points,p=t.startAndEndRadians,u=t.chart,c=u&&u.options&&u.options.chart||{},g="boolean"!=typeof c.animation||c.animation,b=t.center,f={x:b[0],y:b[1]},m=b[3]/2,x=t.chart.renderer,y=!!(g&&r&&o!==a&&t.dataLabelsGroup),L,P=!1,T=!1;for(let n of(y&&(t.dataLabelsGroup.attr({opacity:0}),L=function(){P=!0,t.dataLabelsGroup.animate({opacity:1,visibility:"inherit"})}),d)){let d,c,b=n.node,y=e[b.level],P=n.shapeExisting||{},w=b.shapeArgs||{},A=!!(b.visible&&b.shapeArgs);w.borderRadius=t.options.borderRadius,d=r&&g?function(t,e){let i=e.point,s=e.radians,r=e.innerR,o=e.idRoot,a=e.idPreviousRoot,l=e.shapeExisting,n=e.shapeRoot,h=e.shapePreviousRoot,d=e.visible,p={},u={end:t.end,start:t.start,innerR:t.innerR,r:t.r,x:t.x,y:t.y};return d?!i.graphic&&h&&((p=o===i.id?{start:s.start,end:s.end}:h.end<=t.start?{start:s.end,end:s.end}:{start:s.start,end:s.start}).innerR=p.r=r):i.graphic&&(a===i.id?u={innerR:r,r:r}:n&&(u=n.end<=l.start?{innerR:r,r:r,start:s.end,end:s.end}:{innerR:r,r:r,start:s.start,end:s.start})),{from:p,to:u}}(w,{center:f,point:n,radians:p,innerR:m,idRoot:o,idPreviousRoot:a,shapeExisting:P,shapeRoot:i,shapePreviousRoot:h,visible:A}):{to:w,from:{}},(0,v.extend)(n,{shapeExisting:w,tooltipPos:[w.plotX,w.plotY],drillId:function(t,e,i){let s;return t.node.isLeaf||(s=e===t.id?i[e].parent:t.id),s}(n,o,l),name:""+(n.name||n.id||n.index),plotX:w.plotX,plotY:w.plotY,value:b.val,isInside:A,isNull:!A}),n.dlOptions={...function(t){let e=t.point,i=(0,v.isObject)(t.shapeArgs)?t.shapeArgs:{},{end:s=0,radius:r=0,start:o=0}=i,a=(0,v.isObject)(t.optionsPoint)?t.optionsPoint.dataLabels:{},l=(0,v.splat)((0,v.isObject)(t.level)?t.level.dataLabels:{})[0],n=(0,v.merge)(l,a),h=n.style=n.style||{},d=(0,v.splat)(n.padding||0),p=d[3%d.length],u=d[1%d.length],{innerArcLength:c=0,outerArcLength:g=0}=e,b,f,m=n.rotationMode,x=(0,v.defined)(h.width)?parseInt(h.width||"0",10):void 0;return(0,v.isNumber)(n.rotation)||(("auto"===m||"circular"===m)&&(n.useHTML&&"circular"===m&&(m="auto"),c<1&&g>r?(b=0,e.dataLabelPath&&"circular"===m&&(n.textPath={enabled:!0}),s-o<Math.PI&&(x=.7*r)):c>1&&g>1.5*r?"circular"===m?n.textPath={enabled:!0,attributes:{dy:5}}:m="parallel":(e.dataLabel?.textPath&&"circular"===m&&(n.textPath={enabled:!1}),m="perpendicular")),"auto"!==m&&"circular"!==m&&(e.dataLabel?.textPath&&(n.textPath={enabled:!1}),b=s-(s-o)/2),"parallel"===m?x=Math.min(2.5*r,(g+c)/2):!(0,v.defined)(x)&&r&&(x=1===e.node.level?2*r:r),"perpendicular"===m&&(g<16?x=1:i.radius&&(h.lineClamp=Math.floor(c/16)||1,x=r-(c<16?(16-c)/(g-c)*r:0))),x=Math.max((x||0)-p-u,1),f=(b||0)*tw%180,"parallel"===m&&(f-=90),f>90?f-=180:f<-90&&(f+=180),n.rotation=f),n.textPath&&(0===e.shapeExisting.innerR&&n.textPath.enabled?(n.rotation=0,n.textPath.enabled=!1,x=Math.max(2*e.shapeExisting.r-p-u,1)):e.dlOptions?.textPath&&!e.dlOptions.textPath.enabled&&"circular"===m&&(n.textPath.enabled=!0),n.textPath.enabled&&(n.rotation=0,x=Math.max((g+c)/2-p-u,1),h.whiteSpace="nowrap")),h.width=x+"px",n}({point:n,level:y,optionsPoint:n.options,shapeArgs:w}),zIndex:void 0},delete n.dlOptions.zIndex,!T&&A&&(T=!0,c=L),n.draw({animatableAttribs:d.to,attribs:(0,v.extend)(d.from,!u.styledMode&&t.pointAttribs(n,n.selected&&"select")),onComplete:c,group:s,renderer:x,shapeType:"arc",shapeArgs:w})}y&&T?(t.hasRendered=!1,t.options.dataLabels.defer=!0,tm.prototype.drawDataLabels.call(t),t.hasRendered=!0,P&&L?.()):tm.prototype.drawDataLabels.call(t),t.idPreviousRoot=o}layoutAlgorithm(t,e,i){let s=t.start,r=t.end-s,o=t.val,a=t.x,l=t.y,n=i&&(0,v.isObject)(i.levelSize)&&(0,v.isNumber)(i.levelSize.value)?i.levelSize.value:0,h=t.r,d=h+n,p=i&&(0,v.isNumber)(i.slicedOffset)?i.slicedOffset:0;return(e||[]).reduce((t,e)=>{let i=1/o*e.val*r,u=tA(a,l,s+i/2,p),c={x:e.sliced?u.x:a,y:e.sliced?u.y:l,innerR:h,r:d,radius:n,start:s,end:s+i};return t.push(c),s=c.end,t},[])}setRootNode(t,e,i){if(1===this.nodeMap[t].level&&1===this.nodeList.filter(t=>1===t.level).length){if(""===this.idPreviousRoot)return;t=""}super.setRootNode(t,e,i)}setShapeArgs(t,e,i){let s=i[t.level+1],r=t.children.filter(function(t){return t.visible}),o=[];o=this.layoutAlgorithm(e,r,s);let a=-1;for(let t of r){let e=o[++a],s=e.start+(e.end-e.start)/2,r=e.innerR+(e.r-e.innerR)/2,l=e.end-e.start,n=0===e.innerR&&l>6.28?{x:e.x,y:e.y}:tA(e.x,e.y,s,r),h=t.val?t.childrenTotal>t.val?t.childrenTotal:t.val:t.childrenTotal;this.points[t.i]&&(this.points[t.i].innerArcLength=l*e.innerR,this.points[t.i].outerArcLength=l*e.r),t.shapeArgs=(0,v.merge)(e,{plotX:n.x,plotY:n.y}),t.values=(0,v.merge)(e,{val:h}),t.children.length&&this.setShapeArgs(t,t.values,i)}}translate(){let t=this.options,e=this.center=this.getCenter(),i=this.startAndEndRadians=tb(t.startAngle,t.endAngle),s=e[3]/2,r=e[2]/2,o=tT(this),a=this.nodeMap,l,n=a&&a[o],h={};this.shapeRoot=n&&n.shapeArgs,this.generatePoints(),(0,v.fireEvent)(this,"afterTranslate");let d=this.tree=this.getTree();n=(a=this.nodeMap)[o];let p=a[(0,v.isString)(n.parent)?n.parent:""],{from:u,to:c}=tu.getLevelFromAndTo(n);l=tL({from:u,levels:this.options.levels,to:c,defaults:{colorByPoint:t.colorByPoint,dataLabels:t.dataLabels,levelIsConstant:t.levelIsConstant,levelSize:t.levelSize,slicedOffset:t.slicedOffset}}),l=tu.calculateLevelSizes(l,{diffRadius:r-s,from:u,to:c}),tP(d,{before:tO,idRoot:o,levelIsConstant:t.levelIsConstant,mapOptionsToLevel:l,mapIdToNode:a,points:this.points,series:this});let g=a[""].shapeArgs={end:i.end,r:s,start:i.start,val:n.val,x:e[0],y:e[1]};for(let t of(this.setShapeArgs(p,g,l),this.mapOptionsToLevel=l,this.points))h[t.id]&&(0,v.error)(31,!1,this.chart),h[t.id]=!0}}tS.defaultOptions=(0,v.merge)(tx.defaultOptions,{center:["50%","50%"],clip:!1,colorByPoint:!1,opacity:1,dataLabels:{allowOverlap:!0,defer:!0,rotationMode:"circular",style:{textOverflow:"ellipsis"}},rootId:void 0,levelIsConstant:!0,levelSize:{value:1,unit:"weight"},slicedOffset:10}),(0,v.extend)(tS.prototype,{axisTypes:[],drawDataLabels:tf,getCenter:tv,isCartesian:!1,onPointSupported:!0,pointAttribs:tm.prototype.pointAttribs,pointClass:th,NodeClass:class extends V{},utils:tu}),M().registerSeriesType("sunburst",tS);let tR=b();tR.Breadcrumbs=tR.Breadcrumbs||O,tR.Breadcrumbs.compose(tR.Chart,tR.defaultOptions),tr.compose(tR.Series);let tC=b();return g.default})());