UNPKG

highcharts

Version:
11 lines 41.3 kB
/** * 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 */import*as t from"../highcharts.js";let e={};e.n=t=>{let i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var r=i[s++],o=i[s++];e.o(t,r)?0===o&&s++:0===o?Object.defineProperty(t,r,{enumerable:!0,value:i[s++]}):Object.defineProperty(t,r,{enumerable:!0,get:o})}else for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var s,r,o,a,l,n=e.n(i);let d={mainBreadcrumb:"Main"},h=t.default.Templating,{format:p}=e.n(h)(),{composed:u}=n();function c(){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 g(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function v(){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 b(){this.breadcrumbs&&this.breadcrumbs.redraw()}function f(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class m{static compose(t,e){(0,i.pushUnique)(u,"Breadcrumbs")&&((0,i.addEvent)(t,"destroy",g),(0,i.addEvent)(t,"afterShowResetZoom",c),(0,i.addEvent)(t,"getMargins",v),(0,i.addEvent)(t,"redraw",b),(0,i.addEvent)(t,"selection",f),(0,i.extend)(e.lang,d))}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];let s=(0,i.merge)(t.options.drilldown&&t.options.drilldown.drillUpButton,m.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=s||{}}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,s=this.options,r=e.options.lang,o=(0,i.pick)(s.format,s.showFullPath?"{level.name}":"← {level.name}"),a=r&&(0,i.pick)(r.drillUpText,r.mainBreadcrumb),l=s.formatter&&s.formatter(t)||p(o,{level:t.levelOptions},e)||"";return((0,i.isString)(l)&&!l.length||"← "===l)&&(0,i.defined)(a)&&(l=s.showFullPath?a:"← "+a),l}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,s=e.buttonTheme,r=e.position,o="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",a=this.group.getBBox(),l=2*(s.padding||0)+e.buttonSpacing;r.width=a.width+l,r.height=a.height+l;let n=(0,i.merge)(r);t&&(n.x+=t),this.options.rtl&&(n.x+=r.width),n.y=(0,i.pick)(n.y,this.yOffset,0),this.group.align(n,!0,o)}}renderButton(t,e,s){let r=this,o=this.chart,a=r.options,l=(0,i.merge)(a.buttonTheme),n=o.renderer.button(r.getButtonText(t),e,s,function(e){let s,o=a.events&&a.events.click;o&&(s=o.call(r,e,t,r)),!1!==s&&(a.showFullPath?e.newLevel=t.level:e.newLevel=r.level-1,(0,i.fireEvent)(r,"up",e))},l).addClass("highcharts-breadcrumbs-button").add(r.group);return o.styledMode||n.attr(a.style),n}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,i.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,i.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,i.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,d;for(let h=0,p=i.length;h<p;++h){let u,c,g=h===p-1;t[(d=i[h]).level]?(u=(n=t[d.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[d.level].updated=!0):(u=this.renderButton(d,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[d.level]={button:u,separator:c,updated:!0}),u&&u.setState(2*!!g)}}}m.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};let x=t.default.Color;var y=e.n(x);let L=t.default.SeriesRegistry;var P=e.n(L);let T=t.default.SVGElement;var w=e.n(T);let{column:{prototype:A}}=P().seriesTypes;var O=o||(o={});function S(t){let e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(w())(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:""}))}O.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))}},O.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){let e={};return(0,i.defined)(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:A.pointAttribs},O.compose=function(t){let e=t.prototype.pointClass;return(0,i.addEvent)(e,"afterSetState",S),t};let R=o,M=t.default.Series;var C=e.n(M);let B=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}},I=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}},N=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:E}},scatter:{prototype:{pointClass:k}}}=P().seriesTypes;class D extends k{constructor(){super(...arguments),this.groupedPointsAmount=0,this.shapeType="rect"}draw(t){N(this,t)}getClassName(){let t=this.series,e=t.options,s=super.getClassName();return this.node.level<=t.nodeMap[t.rootNode].level&&this.node.children.length?s+=" highcharts-above-level":this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(0,i.pick)(e.interactByLeaf,!e.allowTraversingTree)?this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(s+=" highcharts-internal-node"):s+=" highcharts-internal-node-interactive",s}isValid(){return!!(this.id||(0,i.isNumber)(this.value))}setState(t){super.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:+("hover"===t)})}shouldDraw(){return(0,i.isNumber)(this.plotY)&&null!==this.y}}(0,i.extend)(D.prototype,{setVisible:E.prototype.setVisible});let G={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,i.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*!P().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}}};(a||(a={})).recursive=function t(e,i,s){let r=i.call(s||this,e);!1!==r&&t(r,i,s)};let z=a,U={getColor:function(t,e){let s,r,o,a,l,n,d=e.index,h=e.mapOptionsToLevel,p=e.parentColor,u=e.parentColorIndex,c=e.series,g=e.colors,v=e.siblings,b=c.points,f=c.chart.options.chart;if(t){let m;s=b[t.i],r=h[t.level]||{},s&&r.colorByPoint&&(a=s.index%(g?g.length:f.colorCount),o=g&&g[a]),c.chart.styledMode||(l=(0,i.pick)(s&&s.options.color,r&&r.color,o,p&&((m=r&&r.colorVariation)&&"brightness"===m.key&&d&&v?y().parse(p).brighten(m.to*(d/v)).get():p),c.color)),n=(0,i.pick)(s&&s.options.colorIndex,r&&r.colorIndex,a,u,e.colorIndex)}return{color:l,colorIndex:n}},getLevelOptions:function(t){let e,s,r,o,a,l,n={};if((0,i.isObject)(t))for(o=(0,i.isNumber)(t.from)?t.from:1,l=t.levels,s={},e=(0,i.isObject)(t.defaults)?t.defaults:{},(0,i.isArray)(l)&&(s=l.reduce((t,s)=>{let r,a,l;return(0,i.isObject)(s)&&(0,i.isNumber)(s.level)&&(l=(0,i.merge)({},s),a=(0,i.pick)(l.levelIsConstant,e.levelIsConstant),delete l.levelIsConstant,delete l.level,r=s.level+(a?0:o-1),(0,i.isObject)(t[r])?(0,i.merge)(!0,t[r],l):t[r]=l),t},{})),a=(0,i.isNumber)(t.to)?t.to:1,r=0;r<=a;r++)n[r]=(0,i.merge)({},e,(0,i.isObject)(s[r])?s[r]:{});return n},getNodeWidth:function(t,e){let{chart:s,options:r}=t,{nodeDistance:o=0,nodeWidth:a=0}=r,{plotSizeX:l=1}=s;if("auto"===a){if("string"==typeof o&&/%$/.test(o))return l/(e+parseFloat(o)/100*(e-1));let t=Number(o);return(l+t)/(e||1)-t}return(0,i.relativeLength)(a,l)},setTreeValues:function t(e,s){let r=s.before,o=s.idRoot,a=s.mapIdToNode[o],l=!1!==s.levelIsConstant,n=s.points[e.i],d=n&&n.options||{},h=[],p=0;e.levelDynamic=e.level-(l?0:a.level),e.name=(0,i.pick)(n&&n.name,""),e.visible=o===e.id||!0===s.visible,"function"==typeof r&&(e=r(e,s)),e.children.forEach((r,o)=>{let a=(0,i.extend)({},s);(0,i.extend)(a,{index:o,siblings:e.children.length,visible:e.visible}),r=t(r,a),h.push(r),r.visible&&(p+=r.val)});let u=(0,i.pick)(d.value,p);return e.visible=u>=0&&(p>0||e.visible),e.children=h,e.childrenTotal=p,e.isLeaf=e.visible&&!p,e.val=u,e},updateRootId:function(t){let e,s;return(0,i.isObject)(t)&&(s=(0,i.isObject)(t.options)?t.options:{},e=(0,i.pick)(t.rootNode,s.rootId,""),(0,i.isObject)(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}},{parse:V}=y(),{composed:W,noop:H}=n(),{column:F,scatter:j}=P().seriesTypes,{getColor:Y,getLevelOptions:X,updateRootId:$}=U;C().keepProps.push("simulation","hadOutsideDataLabels");let q=!1;function K(){let t=this.xAxis,e=this.yAxis;if(t&&e)if(this.is("treemap")){let s={endOnTick:!1,startOnTick:!1,visible:!1};this.is("treegraph")||(s.min=0,s.max=100,s.tickPositions=[]),(0,i.merge)(!0,t.options,s,t.userOptions),(0,i.merge)(!0,e.options,s,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),q=!0}else q&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),q=!1)}class Z extends j{constructor(){super(...arguments),this.simulation=0}static compose(t){(0,i.pushUnique)(W,"TreemapSeries")&&(0,i.addEvent)(t,"afterBindAxes",K)}algorithmCalcPoints(t,e,s,r){let o=s.plot,a=s.elArr.length-1,l,n,d,h,p=s.lW,u=s.lH,c,g=0;for(let t of(e?(p=s.nW,u=s.nH):c=s.elArr[a],s.elArr))(e||g<a)&&(0===s.direction?(l=o.x,n=o.y,h=t/(d=p)):(l=o.x,n=o.y,d=t/(h=u)),r.push({x:l,y:n,width:d,height:(0,i.correctFloat)(h)}),0===s.direction?o.y=o.y+h:o.x=o.x+d),g+=1;s.reset(),0===s.direction?s.width=s.width-p:s.height=s.height-u,o.y=o.parent.y+(o.parent.height-s.height),o.x=o.parent.x+(o.parent.width-s.width),t&&(s.direction=1-s.direction),e||s.addElement(c)}algorithmFill(t,e,i){let s=[],r,o=e.direction,a=e.x,l=e.y,n=e.width,d=e.height,h,p,u,c;for(let g of i)r=e.width*e.height*(g.val/e.val),h=a,p=l,0===o?(n-=u=r/(c=d),a+=u):(d-=c=r/(u=n),l+=c),s.push({x:h,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 B(e.height,e.width,o,r),n,d=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),d===a&&this.algorithmCalcPoints(t,!0,l,s,r),++d;return s}alignDataLabel(t,e,i){F.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})}applyTreeGrouping(){let t=this,e=t.parentList||{},{cluster:s}=t.options,r=s?.minimumClusterSize||5;if(s?.enabled){let o={},a=t=>{if(t?.point?.shapeArgs){let{width:e=0,height:r=0}=t.point.shapeArgs,{pixelWidth:a=0,pixelHeight:l=0}=s,n=(0,i.defined)(l),d=l?a*l:a*a;(e<a||r<(n?l:a)||e*r<d)&&!t.isGroup&&(0,i.defined)(t.parent)&&(o[t.parent]||(o[t.parent]=[]),o[t.parent].push(t))}t?.children.forEach(t=>{a(t)})};for(let l in a(t.tree),o)o[l]&&o[l].length>r&&o[l].forEach(r=>{let o=e[l].indexOf(r.i);if(-1!==o){e[l].splice(o,1);let a=`highcharts-grouped-treemap-points-${r.parent||"root"}`,n=t.points.find(t=>t.id===a);if(!n){let r=t.pointClass,o=t.points.length;n=new r(t,{className:s.className,color:s.color,id:a,index:o,isGroup:!0,value:0}),(0,i.extend)(n,{formatPrefix:"cluster"}),t.points.push(n),e[l].push(o),e[a]=[]}let d=n.groupedPointsAmount+1,h=t.points[n.index].options.value||0,p=s.name||`+ ${d}`;t.points[n.index].groupedPointsAmount=d,t.points[n.index].options.value=h+(r.point.value||0),t.points[n.index].name=p,e[a].push(r.point.index)}});t.nodeMap={},t.nodeList=[],t.parentList=e;let l=t.buildTree("",-1,0,t.parentList);t.translate(l)}}calculateChildrenAreas(t,e){let s=this.options,r=this.mapOptionsToLevel[t.level+1],o=(0,i.pick)(r?.layoutAlgorithm&&this[r?.layoutAlgorithm]&&r.layoutAlgorithm,s.layoutAlgorithm),a=s.alternateStartingDirection,l=t.children.filter(e=>t.isGroup||!e.ignore),n=r?.groupPadding??s.groupPadding??0,d=this.nodeMap[this.rootNode];if(!o)return;let h=[],p=d.pointValues?.width||0,u=d.pointValues?.height||0;r?.layoutStartingDirection&&(e.direction=+("vertical"!==r.layoutStartingDirection)),h=this[o](e,l);let c=-1;for(let t of l){let s=h[++c];t===d&&(p=p||s.width,u=s.height);let r=n/(this.xAxis.len/u),o=n/(this.yAxis.len/u);if(t.values=(0,i.merge)(s,{val:t.childrenTotal,direction:a?1-e.direction:e.direction}),t.children.length&&t.point.dataLabels?.length){let e=(0,i.arrayMax)(t.point.dataLabels.map(t=>t.options?.headers&&t.height||0))/(this.yAxis.len/u);e<t.values.height/2&&(t.values.y+=e,t.values.height-=e)}if(n){let e=Math.min(r,t.values.width/4),i=Math.min(o,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,i.merge)(s,{x:s.x/this.axisRatio,y:100-s.y-s.height,width:s.width/this.axisRatio}),t.children.length&&this.calculateChildrenAreas(t,t.values)}let g=(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&&g(t,e,i)}),e);if("leaf"===s.nodeSizeBy&&t===d&&this.hasOutsideDataLabels&&!g(d,void 0,!1).some(t=>(0,i.isNumber)(t.options.value))&&!(0,i.isNumber)(d.point?.options.value)){let s=g(d),r=s.map(t=>t.options.value||0),o=s.map(({node:{pointValues:t}})=>t?t.width*t.height:0),a=r.reduce((t,e)=>t+e,0),l=o.reduce((t,e)=>t+e,0)/a,n=0,h=0;s.forEach((t,e)=>{let s=r[e]?o[e]/r[e]:1,a=(0,i.clamp)(s/l,.8,1.4),d=1-a;t.value&&(o[e]<20&&(d*=o[e]/20),d>h&&(h=d),d<n&&(n=d),t.simulatedValue=(t.simulatedValue||t.value)/a)}),(n<-.05||h>.05)&&this.simulation<10?(this.simulation++,this.setTreeValues(t),e.val=t.val,this.calculateChildrenAreas(t,e)):(s.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,i.defined)(t.dataLabel)}),s=(0,i.splat)(this.options.dataLabels||{})[0]?.padding,r=e.some(t=>(0,i.isNumber)(t.plotY));for(let o of e){let e={},a={style:e},l=t[o.node.level];if((!o.node.isLeaf&&!o.node.isGroup||o.node.isGroup&&o.node.level<=this.nodeMap[this.rootNode].level)&&(a.enabled=!1),l?.dataLabels&&((0,i.merge)(!0,a,(0,i.splat)(l.dataLabels)[0]),this.hasDataLabels=()=>!0),o.node.isLeaf?a.inside=!0:a.headers&&(a.verticalAlign="top"),o.shapeArgs&&r){let{height:t=0,width:r=0}=o.shapeArgs;if(r>32&&t>16&&o.shouldDraw()){let l=r-2*((0,i.splat)(a.padding)[0]||(0,i.splat)(s)[0]||0);e.width=`${l}px`,e.lineClamp??(e.lineClamp=Math.floor(t/16)),this.options.allowTraversingTree&&(e.visibility="inherit"),o.dataLabel?.attr({width:a.headers?l:void 0})}else e.width=`${r}px`,e.visibility="hidden"}o.dlOptions=(0,i.merge)(a,o.options.dataLabels,{zIndex:void 0}),delete o.dlOptions.zIndex}super.drawDataLabels(e)}drawPoints(t=this.points){let e=this.chart,s=e.renderer,r=e.styledMode,o=this.options,a=r?{}:o.shadow,l=o.borderRadius,n=e.pointCount<o.animationLimit,d=o.allowTraversingTree;for(let e of t){let t={},h={},p={},u="level-group-"+e.node.level,c=!!e.graphic,g=n&&c,v=e.shapeArgs;e.shouldDraw()&&(e.isInside=!0,l&&(h.r=l),(0,i.merge)(!0,g?t:h,c?v:{},r?{}:this.pointAttribs(e,e.selected?"select":void 0)),this.colorAttribs&&r&&(0,i.extend)(p,this.colorAttribs(e)),this[u]||(this[u]=s.g(u).attr({zIndex:-(e.node.level||0)}).add(this.group),this[u].survive=!0)),e.draw({animatableAttribs:t,attribs:h,css:p,group:this[u],imageUrl:e.imageUrl,renderer:s,shadow:a,shapeArgs:v,shapeType:e.shapeType}),d&&e.graphic&&(e.drillId=o.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,i.error)(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"}),this.setRootNode(t,e)}drillUp(){let t=this.nodeMap[this.rootNode];t&&(0,i.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 s=(0,i.isArray)(t)?t:[],r=(0,i.isArray)(e)?e:[],o=s.reduce(function(t,e,s){let r=(0,i.pick)(e.parent,"");return void 0===t[r]&&(t[r]=[]),t[r].push(s),t},{"":[]});for(let t of Object.keys(o)){let e=o[t];if(""!==t&&-1===r.indexOf(t)){for(let t of e)o[""].push(t);delete o[t]}}return o}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,s,r,o){let a=[],l=this.points[e],n=0,d;for(let e of r[t]||[])n=Math.max((d=this.buildTree(this.points[e].id,e,s+1,r,t)).height+1,n),a.push(d),this.is("treegraph")&&(d.visible=!0);let h=new this.NodeClass().init(t,e,a,n,s,this,o);for(let t of a)t.parentNode=h;return this.nodeMap[h.id]=h,this.nodeList.push(h),l&&(l.node=h,h.point=l,(0,i.defined)(l.options.x)||(l.x=s)),h}hasData(){return!!this.dataTable.rowCount}init(t,e){let s=this,r=(0,i.merge)(e.drillUpButton,e.breadcrumbs),o=(0,i.addEvent)(s,"setOptions",t=>{let e=t.userOptions;(0,i.defined)(e.allowDrillToNode)&&!(0,i.defined)(e.allowTraversingTree)&&(e.allowTraversingTree=e.allowDrillToNode,delete e.allowDrillToNode),(0,i.defined)(e.drillUpButton)&&!(0,i.defined)(e.traverseUpButton)&&(e.traverseUpButton=e.drillUpButton,delete e.drillUpButton);let s=(0,i.splat)(e.dataLabels||{});e.levels?.forEach(t=>{s.push.apply(s,(0,i.splat)(t.dataLabels||{}))}),this.hasOutsideDataLabels=s.some(t=>t.headers)});super.init(t,e),delete s.opacity,s.eventsToUnbind.push(o),s.options.allowTraversingTree&&(s.eventsToUnbind.push((0,i.addEvent)(s,"click",s.onClickDrillToNode)),s.eventsToUnbind.push((0,i.addEvent)(s,"setRootNode",function(t){let e=s.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(s.createList(t))})),s.eventsToUnbind.push((0,i.addEvent)(s,"update",function(t,e){let i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs),this.hadOutsideDataLabels=this.hasOutsideDataLabels})),s.eventsToUnbind.push((0,i.addEvent)(s,"destroy",function(t){let e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),t.breadcrumbs||(t.breadcrumbs=new m(t,r)),s.eventsToUnbind.push((0,i.addEvent)(t.breadcrumbs,"up",function(t){let e=this.level-t.newLevel;for(let t=0;t<e;t++)s.drillUp()}))}onClickDrillToNode(t){let e=t.point,s=e?.drillId;(0,i.isString)(s)&&(e.setState(""),this.setRootNode(s,!0,{trigger:"click"}))}pointAttribs(t,e){let s=(0,i.isObject)(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},r=t?.node&&s[t.node.level]||{},o=this.options,a=e&&o.states&&o.states[e]||{},l=t?.node&&t.getClassName()||"",n={stroke:t&&t.borderColor||r.borderColor||a.borderColor||o.borderColor,"stroke-width":(0,i.pick)(t&&t.borderWidth,r.borderWidth,a.borderWidth,o.borderWidth),dashstyle:t?.borderDashStyle||r.borderDashStyle||a.borderDashStyle||o.borderDashStyle,fill:t?.color||this.color};return -1!==l.indexOf("highcharts-above-level")?(n.fill="none",n["stroke-width"]=0):-1!==l.indexOf("highcharts-internal-node-interactive")?(n["fill-opacity"]=a.opacity??o.opacity??1,n.cursor="pointer"):-1!==l.indexOf("highcharts-internal-node")?n.fill="none":e&&a.brightness&&(n.fill=V(n.fill).brighten(a.brightness).get()),n}setColorRecursive(t,e,i,s,r){let o=this?.chart,a=o?.options?.colors;if(t){let o=Y(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:s,yAxis:r}=t,o=t.chart.styledMode,a=e=>o?0:t.pointAttribs(e)["stroke-width"]||0;for(let t of e){let{pointValues:e,visible:o}=t.node;if(e&&o){let{height:o,width:l,x:n,y:d}=e,h=a(t),p=s.toPixels(n,!0),u=s.toPixels(n+l,!0),c=r.toPixels(d,!0),g=r.toPixels(d+o,!0),v=0===p?h/2:(0,i.crisp)(s.toPixels(n,!0),h,!0),b=u===s.len?s.len-h/2:(0,i.crisp)(s.toPixels(n+l,!0),h,!0),f=c===r.len?r.len-h/2:(0,i.crisp)(r.toPixels(d,!0),h,!0),m=0===g?h/2:(0,i.crisp)(r.toPixels(d+o,!0),h,!0),x={x:Math.min(v,b),y:Math.min(f,m),width:Math.abs(b-v),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,s){let r=(0,i.extend)({newRootId:t,previousRootId:this.rootNode,redraw:(0,i.pick)(e,!0),series:this},s);(0,i.fireEvent)(this,"setRootNode",r,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,s=this.rootNode,r=this.nodeMap[s],o="boolean"!=typeof e.levelIsConstant||e.levelIsConstant,a=[],l=this.points[t.i],n=0;for(let e of t.children)e=this.setTreeValues(e),a.push(e),e.ignore||(n+=e.val);(0,i.stableSort)(a,(t,e)=>(t.sortIndex||0)-(e.sortIndex||0));let d=(0,i.pick)(l?.simulatedValue,l?.options.value,n);return l&&(l.value=d),l?.isGroup&&e.cluster?.reductionFactor&&(d/=e.cluster.reductionFactor),t.parentNode?.point?.isGroup&&this.rootNode!==t.parent&&(t.visible=!1),(0,i.extend)(t,{children:a,childrenTotal:n,ignore:!((0,i.pick)(l?.visible,!0)&&d>0),isLeaf:t.visible&&!("treegraph"===this.type?a.length>0:n),isGroup:l?.isGroup,levelDynamic:t.level-(o?0:r.level),name:(0,i.pick)(l?.name,""),sortIndex:(0,i.pick)(l?.sortIndex,-d),val:d}),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,s=e.options,r=!t,o=$(e),a,l,n,d;t||o.startsWith("highcharts-grouped-treemap-points-")||((this.points||[]).forEach(t=>{t.isGroup&&t.destroy()}),super.translate(),t=e.getTree()),e.tree=t=t||e.tree,a=e.nodeMap[o],""===o||a||(e.setRootNode("",!1),o=e.rootNode,a=e.nodeMap[o]),a.point?.isGroup||(e.mapOptionsToLevel=X({from:a.level+1,levels:s.levels,to:t.height,defaults:{levelIsConstant:e.options.levelIsConstant,colorByPoint:s.colorByPoint}})),z.recursive(e.nodeMap[e.rootNode],t=>{let i=t.parent,s=!1;return t.visible=!0,(i||""===i)&&(s=e.nodeMap[i]),s}),z.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=l={x:0,y:0,width:100,height:100},e.nodeMap[""].values=n=(0,i.merge)(l,{width:l.width*e.axisRatio,direction:+("vertical"!==s.layoutStartingDirection),val:t.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),e.calculateChildrenAreas(t,n),e.colorAxis||s.colorByPoint||e.setColorRecursive(e.tree),s.allowTraversingTree&&a.pointValues&&(d=a.pointValues,e.xAxis.setExtremes(d.x,d.x+d.width,!1),e.yAxis.setExtremes(d.y,d.y+d.height,!1),e.xAxis.setScale(),e.yAxis.setScale()),e.setPointValues(),r&&e.applyTreeGrouping()}}Z.defaultOptions=(0,i.merge)(j.defaultOptions,G),(0,i.extend)(Z.prototype,{buildKDTree:H,colorAttribs:R.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:H,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:D,NodeClass:I,trackerGroups:["group","dataLabelsGroup"],utils:z}),R.compose(Z),P().registerSeriesType("treemap",Z);let{deg2rad:_}=n();(s=l||(l={})).getCenter=function(){let t=this.options,e=this.chart,s=2*(t.slicedOffset||0),r=e.plotWidth-2*s,o=e.plotHeight-2*s,a=t.center,l=Math.min(r,o),n=t.thickness,d,h=t.size,p=t.innerSize||0,u,c;"string"==typeof h&&(h=parseFloat(h)),"string"==typeof p&&(p=parseFloat(p));let g=[(0,i.pick)(a?.[0],"50%"),(0,i.pick)(a?.[1],"50%"),(0,i.pick)(h&&h<0?void 0:t.size,"100%"),(0,i.pick)(p&&p<0?void 0:t.innerSize||0,"0%")];for(u=0;u<4;++u)c=g[u],d=u<2||2===u&&/%$/.test(c),g[u]=(0,i.relativeLength)(c,[r,o,l,g[2]][u])+(d?s:0);return g[3]>g[2]&&(g[3]=g[2]),(0,i.isNumber)(n)&&2*n<g[2]&&n>0&&(g[3]=g[2]-2*n),(0,i.fireEvent)(this,"afterGetCenter",{positions:g}),g},s.getStartAndEndRadians=function(t,e){let s=(0,i.isNumber)(t)?t:0,r=(0,i.isNumber)(e)&&e>s&&e-s<360?e:s+360;return{start:_*(s+-90),end:_*(r+-90)}};let J=l,{series:{prototype:{pointClass:Q}},seriesTypes:{treemap:{prototype:{pointClass:tt}}}}=P();class te extends tt{getDataLabelPath(t){let e=this.series.chart.renderer,s=this.shapeExisting,r=s.r+(0,i.pInt)(t.options?.distance||0),o=s.start,a=s.end,l=o+(a-o)/2,n=l<0&&l>-Math.PI||l>Math.PI,d;return o===-Math.PI/2&&(0,i.correctFloat)(a)===(0,i.correctFloat)(1.5*Math.PI)&&(o=-Math.PI+Math.PI/360,a=-Math.PI/360,n=!0),a-o>Math.PI&&(n=!1,d=!0,a-o>2*Math.PI-.01&&(o+=.01,a-=.01)),this.dataLabelPath&&(this.dataLabelPath=this.dataLabelPath.destroy()),this.dataLabelPath=e.arc({open:!0,longArc:+!!d}).attr({start:n?o:a,end:n?a:o,clockwise:+n,x:s.x,y:s.y,r:(r+s.innerR)/2}).add(e.defs),this.dataLabelPath}isValid(){return!0}}(0,i.extend)(te.prototype,{getClassName:Q.prototype.getClassName,haloPath:Q.prototype.haloPath,setState:Q.prototype.setState});let{seriesTypes:{treemap:ti}}=P();function ts(t,e){let s=[];if((0,i.isNumber)(t)&&(0,i.isNumber)(e)&&t<=e)for(let i=t;i<=e;i++)s.push(i);return s}let tr={calculateLevelSizes:function(t,e){let s=(0,i.isObject)(e)?e:{},r,o=0,a,l,n,d;if((0,i.isObject)(t)){for(let e of(r=(0,i.merge)({},t),l=ts((0,i.isNumber)(s.from)?s.from:0,(0,i.isNumber)(s.to)?s.to:0),n=Object.keys(r).filter(t=>-1===l.indexOf(+t)),a=d=(0,i.isNumber)(s.diffRadius)?s.diffRadius:0,l)){let t=r[e],i=t.levelSize.unit,s=t.levelSize.value;"weight"===i?o+=s:"percentage"===i?(t.levelSize={unit:"pixels",value:s/100*a},d-=t.levelSize.value):"pixels"===i&&(d-=s)}for(let t of l){let e=r[t];if("weight"===e.levelSize.unit){let i=e.levelSize.value;r[t].levelSize={unit:"pixels",value:i/o*d}}}for(let t of n)r[t].levelSize={value:0,unit:"pixels"}}return r},getLevelFromAndTo:function({level:t,height:e}){return{from:t>0?t:1,to:t+e}},range:ts,recursive:ti.prototype.utils.recursive},{composed:to,deg2rad:ta}=n(),{getCenter:tl,getStartAndEndRadians:tn}=J,{noop:td}=n(),{column:th,treemap:tp}=P().seriesTypes,{getColor:tu,getLevelOptions:tc,setTreeValues:tg,updateRootId:tv}=U;r=w(),(0,i.pushUnique)(to,"TextPath")&&((0,i.addEvent)(r,"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,d=(t,e)=>{let{x:r,y:a}=e,l=(i.getRotationOfChar(t)-90)*ta,n=Math.cos(l),d=Math.sin(l);return[[r-o*n,a-o*d],[r+s*n,a+s*d]]};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]=d(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]=d(r,o);t.unshift(l),t.unshift(a)}catch{break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}),(0,i.addEvent)(r,"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()))}),r.prototype.setTextPath=r.prototype.setTextPath??function(t,e){let s=this.renderer.url,r=this.text||this,o=r.textPath,{attributes:a,enabled:l}=(0,i.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);if(t=t||o&&o.path,o?.undo(),t&&l){let e=(0,i.addEvent)(r,"afterModifyTree",e=>{if(t&&l){let o=t.attr("id");o||t.attr("id",o=(0,i.uniqueKey)());let l={x:0,y:0};(0,i.defined)(a.dx)&&(l.dx=a.dx,delete a.dx),(0,i.defined)(a.dy)&&(l.dy=a.dy,delete a.dy),r.attr(l),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let n=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,i.extend)(a,{"text-anchor":a.textAnchor,href:`${s}#${o}`}),children:n}}});r.textPath={path:t,undo:e}}else r.attr({dx:0,dy:0}),delete r.textPath;return this.added&&(r.textCache="",this.renderer.buildText(r)),this});let tb=180/Math.PI,tf=function(t,e,i,s){return{x:t+Math.cos(i)*s,y:e+Math.sin(i)*s}};function tm(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=tu(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 tx extends tp{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,s=t.shapeRoot,r=t.group,o=t.hasRendered,a=t.rootNode,l=t.idPreviousRoot,n=t.nodeMap,d=n[l],h=d&&d.shapeArgs,p=t.points,u=t.startAndEndRadians,c=t.chart,g=c&&c.options&&c.options.chart||{},v="boolean"!=typeof g.animation||g.animation,b=t.center,f={x:b[0],y:b[1]},m=b[3]/2,x=t.chart.renderer,y=!!(v&&o&&a!==l&&t.dataLabelsGroup),L,P=!1,T=!1;for(let d of(y&&(t.dataLabelsGroup.attr({opacity:0}),L=function(){P=!0,t.dataLabelsGroup.animate({opacity:1,visibility:"inherit"})}),p)){let p,g,b=d.node,y=e[b.level],P=d.shapeExisting||{},w=b.shapeArgs||{},A=!!(b.visible&&b.shapeArgs);w.borderRadius=t.options.borderRadius,p=o&&v?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,d=e.shapePreviousRoot,h=e.visible,p={},u={end:t.end,start:t.start,innerR:t.innerR,r:t.r,x:t.x,y:t.y};return h?!i.graphic&&d&&((p=o===i.id?{start:s.start,end:s.end}:d.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:d,radians:u,innerR:m,idRoot:a,idPreviousRoot:l,shapeExisting:P,shapeRoot:s,shapePreviousRoot:h,visible:A}):{to:w,from:{}},(0,i.extend)(d,{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}(d,a,n),name:""+(d.name||d.id||d.index),plotX:w.plotX,plotY:w.plotY,value:b.val,isInside:A,isNull:!A}),d.dlOptions={...function(t){let e=t.point,s=(0,i.isObject)(t.shapeArgs)?t.shapeArgs:{},{end:r=0,radius:o=0,start:a=0}=s,l=(0,i.isObject)(t.optionsPoint)?t.optionsPoint.dataLabels:{},n=(0,i.splat)((0,i.isObject)(t.level)?t.level.dataLabels:{})[0],d=(0,i.merge)(n,l),h=d.style=d.style||{},p=(0,i.splat)(d.padding||0),u=p[3%p.length],c=p[1%p.length],{innerArcLength:g=0,outerArcLength:v=0}=e,b,f,m=d.rotationMode,x=(0,i.defined)(h.width)?parseInt(h.width||"0",10):void 0;return(0,i.isNumber)(d.rotation)||(("auto"===m||"circular"===m)&&(d.useHTML&&"circular"===m&&(m="auto"),g<1&&v>o?(b=0,e.dataLabelPath&&"circular"===m&&(d.textPath={enabled:!0}),r-a<Math.PI&&(x=.7*o)):g>1&&v>1.5*o?"circular"===m?d.textPath={enabled:!0,attributes:{dy:5}}:m="parallel":(e.dataLabel?.textPath&&"circular"===m&&(d.textPath={enabled:!1}),m="perpendicular")),"auto"!==m&&"circular"!==m&&(e.dataLabel?.textPath&&(d.textPath={enabled:!1}),b=r-(r-a)/2),"parallel"===m?x=Math.min(2.5*o,(v+g)/2):!(0,i.defined)(x)&&o&&(x=1===e.node.level?2*o:o),"perpendicular"===m&&(v<16?x=1:s.radius&&(h.lineClamp=Math.floor(g/16)||1,x=o-(g<16?(16-g)/(v-g)*o:0))),x=Math.max((x||0)-u-c,1),f=(b||0)*tb%180,"parallel"===m&&(f-=90),f>90?f-=180:f<-90&&(f+=180),d.rotation=f),d.textPath&&(0===e.shapeExisting.innerR&&d.textPath.enabled?(d.rotation=0,d.textPath.enabled=!1,x=Math.max(2*e.shapeExisting.r-u-c,1)):e.dlOptions?.textPath&&!e.dlOptions.textPath.enabled&&"circular"===m&&(d.textPath.enabled=!0),d.textPath.enabled&&(d.rotation=0,x=Math.max((v+g)/2-u-c,1),h.whiteSpace="nowrap")),h.width=x+"px",d}({point:d,level:y,optionsPoint:d.options,shapeArgs:w}),zIndex:void 0},delete d.dlOptions.zIndex,!T&&A&&(T=!0,g=L),d.draw({animatableAttribs:p.to,attribs:(0,i.extend)(p.from,!c.styledMode&&t.pointAttribs(d,d.selected&&"select")),onComplete:g,group:r,renderer:x,shapeType:"arc",shapeArgs:w})}y&&T?(t.hasRendered=!1,t.options.dataLabels.defer=!0,th.prototype.drawDataLabels.call(t),t.hasRendered=!0,P&&L?.()):th.prototype.drawDataLabels.call(t),t.idPreviousRoot=a}layoutAlgorithm(t,e,s){let r=t.start,o=t.end-r,a=t.val,l=t.x,n=t.y,d=s&&(0,i.isObject)(s.levelSize)&&(0,i.isNumber)(s.levelSize.value)?s.levelSize.value:0,h=t.r,p=h+d,u=s&&(0,i.isNumber)(s.slicedOffset)?s.slicedOffset:0;return(e||[]).reduce((t,e)=>{let i=1/a*e.val*o,s=tf(l,n,r+i/2,u),c={x:e.sliced?s.x:l,y:e.sliced?s.y:n,innerR:h,r:p,radius:d,start:r,end:r+i};return t.push(c),r=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,s){let r=s[t.level+1],o=t.children.filter(function(t){return t.visible}),a=[];a=this.layoutAlgorithm(e,o,r);let l=-1;for(let t of o){let e=a[++l],r=e.start+(e.end-e.start)/2,o=e.innerR+(e.r-e.innerR)/2,n=e.end-e.start,d=0===e.innerR&&n>6.28?{x:e.x,y:e.y}:tf(e.x,e.y,r,o),h=t.val?t.childrenTotal>t.val?t.childrenTotal:t.val:t.childrenTotal;this.points[t.i]&&(this.points[t.i].innerArcLength=n*e.innerR,this.points[t.i].outerArcLength=n*e.r),t.shapeArgs=(0,i.merge)(e,{plotX:d.x,plotY:d.y}),t.values=(0,i.merge)(e,{val:h}),t.children.length&&this.setShapeArgs(t,t.values,s)}}translate(){let t=this.options,e=this.center=this.getCenter(),s=this.startAndEndRadians=tn(t.startAngle,t.endAngle),r=e[3]/2,o=e[2]/2,a=tv(this),l=this.nodeMap,n,d=l&&l[a],h={};this.shapeRoot=d&&d.shapeArgs,this.generatePoints(),(0,i.fireEvent)(this,"afterTranslate");let p=this.tree=this.getTree();d=(l=this.nodeMap)[a];let u=l[(0,i.isString)(d.parent)?d.parent:""],{from:c,to:g}=tr.getLevelFromAndTo(d);n=tc({from:c,levels:this.options.levels,to:g,defaults:{colorByPoint:t.colorByPoint,dataLabels:t.dataLabels,levelIsConstant:t.levelIsConstant,levelSize:t.levelSize,slicedOffset:t.slicedOffset}}),n=tr.calculateLevelSizes(n,{diffRadius:o-r,from:c,to:g}),tg(p,{before:tm,idRoot:a,levelIsConstant:t.levelIsConstant,mapOptionsToLevel:n,mapIdToNode:l,points:this.points,series:this});let v=l[""].shapeArgs={end:s.end,r:r,start:s.start,val:d.val,x:e[0],y:e[1]};for(let t of(this.setShapeArgs(u,v,n),this.mapOptionsToLevel=n,this.points))h[t.id]&&(0,i.error)(31,!1,this.chart),h[t.id]=!0}}tx.defaultOptions=(0,i.merge)(tp.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,i.extend)(tx.prototype,{axisTypes:[],drawDataLabels:td,getCenter:tl,isCartesian:!1,onPointSupported:!0,pointAttribs:th.prototype.pointAttribs,pointClass:te,NodeClass:class extends I{},utils:tr}),P().registerSeriesType("sunburst",tx);let ty=n();ty.Breadcrumbs=ty.Breadcrumbs||m,ty.Breadcrumbs.compose(ty.Chart,ty.defaultOptions),Z.compose(ty.Series);let tL=n();export{tL as default};