@carbon/charts 1.13.11 → 1.13.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,5 +80,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
80
80
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
81
81
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
82
82
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
83
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:St(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=L(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");L(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,wr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");L(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,wr),n.stopPropagation()}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function i$(e,t){const n=Gr(this._current,e);return r=>(this._current=n(r),t(this._current))}class Om extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(D=>D[a]>0),l=this.computeRadius();this.arc=fi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=fi().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const u=BS().value(D=>D[a]).sort(x(i,"pie","sortFunction")).padAngle(wt.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",st.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,D=>D.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",D=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:D.data[s],originalClassName:"slice"})).style("fill",D=>n.model.getFillColor(D.data[s])).attr("d",this.arc).transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",D=>`${D[a]}, ${pc(D.data[a],o,a)+"%"}`).attrTween("d",function(D){return i$.bind(this)(D,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(D=>D.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",st.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,D=>D.data[s]);y.exit().attr("opacity",0).remove();const b=y.enter().append("text").classed("pie-label",!0),S=[];b.merge(y).style("text-anchor","middle").text(D=>i.pie.labels.formatter?i.pie.labels.formatter({...D,percentageValue:pc(D.data[a],o,a,!0)}):pc(D.data[a],o,a)+"%").datum(function(D){const R=l+7,k=(D.endAngle-D.startAngle)/2+D.startAngle,O=k/Math.PI*180,U=this.getComputedTextLength();return D.textOffsetX=U/2,D.textOffsetY=O>90&&O<270?10:0,D.xPosition=(D.textOffsetX+R)*Math.sin(k),D.yPosition=(D.textOffsetY+R)*-Math.cos(k),D}).attr("transform",function(D,R){const k=v.length,O=(D.endAngle-D.startAngle)*(180/Math.PI);if(R>=k-2&&O<wt.callout.minSliceDegree){let U,P;return D.index===k-1?(U=D.xPosition+wt.callout.offsetX+wt.callout.textMargin+D.textOffsetX,P=D.yPosition-wt.callout.offsetY,D.direction=Ci.RIGHT,S.push(D)):(U=D.xPosition-wt.callout.offsetX-D.textOffsetX-wt.callout.textMargin,P=D.yPosition-wt.callout.offsetY,D.direction=Ci.LEFT,S.push(D)),`translate(${U}, ${P})`}return`translate(${D.xPosition}, ${D.yPosition})`}),this.renderCallouts(S);const _=x(i,"donut")?"donut":"pie",E=x(i,_,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),C=g?wt.xOffset:0,H=g?wt.yOffset:0;let I=l+C;E===It.CENTER?I=M/2:E===It.RIGHT&&(I=M-l-wt.xOffset);let T=l+H;S.length>0&&(T+=wt.yOffsetCallout),r.attr("x",I+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",st.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",st.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Ci.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-wt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+wt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return L(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return L(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOVER,{event:n,element:L(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Pie.SLICE_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+wt.radiusOffset:i}}class s$ extends Om{constructor(){super(...arguments),this.type="donut",this.renderType=Z.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=A.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");A.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(L(this))}),a!==null&&a!==""&&A.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Nu:s=oe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Tm="4,10 8,6 12,10",Mm="12,6 8,10 4,6";class a$ extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=Z.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return fp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Hn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case pa.UP:return Tm;case pa.DOWN:return Mm;default:return t>0?Tm:Mm}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=fi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=fi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),A.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:v}=A.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;g===It.CENTER?m=v/2:g===It.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===Hn.FULL&&!s?d=l(a):r===Hn.SEMI&&s&&(d=-(l(a)+c));const h=A.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=A.appendOrSelect(h,"g.gauge-value-number"),g=x(n,"gauge","numberFormatter"),v=p.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${f}px`).attr("text-anchor","middle").text(M=>g(M));const{width:m}=A.getSVGElementSize(A.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(b),{width:_,height:E}=A.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),d=A.appendOrSelect(n,"g.gauge-numbers"),h=A.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=A.appendOrSelect(h,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:g}=A.getSVGElementSize(A.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=x(r,"gauge","deltaArrow","enabled"),m=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);m.enter().append("svg").merge(m).attr("class","gauge-delta-arrow").attr("x",-l(s)-g/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=L(this);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),m.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOVER,{event:n,element:L(this),datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});return n===Hn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Cm extends nu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Z.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Mi(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Nt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[i])).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,v=f+p,m=this.services.cartesianScales.getRangeAxisPosition({datum:h}),y=this.services.cartesianScales.getValueThroughAxisPosition(m,0),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return jt({x0:g,x1:v,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=oi().domain(t).rangeRound([0,this.getGroupWidth()])}}class o$ extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=Z.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${cn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${cn(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:L(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value))).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=A.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);A.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),A.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),A.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),A.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==_r.OFF&&(t===_r.AUTO&&rg.minCellDividerDimension<=this.xBandwidth&&rg.minCellDividerDimension<=this.yBandwidth||t===_r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=St(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=L(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Ii(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:L(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){const h=L(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class l$ extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>St(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",st.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=St(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let v=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(v-g)>0&&Math.abs(v-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?v+=1:v-=1),jt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=L(this);a.classed("hovered",!0);const o=parseFloat(St(s,"data.x0")),l=parseFloat(St(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("mouseout",function(){L(this).classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class c$ extends Ge{constructor(){super(...arguments),this.type="lollipop",this.renderType=Z.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?nn.weight.unselected:nn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",nn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?nn.opacity.unselected:nn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=sn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Nt.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class u$ extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=Z.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Ht.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Ht.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=A.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const b=x(i,"meter","proportional","total");u=b||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Oe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");A.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Ht.height.proportional:Ht.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Ht.height.proportional:Ht.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?Ht.height.proportional:Ht.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:b[c],originalClassName:g})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const v=x(i,"meter","peak");let m=v;v!==null&&(v>u?m=u:v<a[0].value&&(m=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(m==null?[]:[m]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Ht.height.proportional:Ht.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Am(e){const t=h$(Dm(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Ue.START,dominantBaseline:Be.MIDDLE}:vn(t,[10,80])?{textAnchor:Ue.START,dominantBaseline:Be.HANGING}:vn(t,[80,100])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.HANGING}:vn(t,[100,170])?{textAnchor:Ue.END,dominantBaseline:Be.HANGING}:vn(t,[170,190])?{textAnchor:Ue.END,dominantBaseline:Be.MIDDLE}:vn(t,[190,260])?{textAnchor:Ue.END,dominantBaseline:Be.BASELINE}:vn(t,[260,280])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.BASELINE}:{textAnchor:Ue.START,dominantBaseline:Be.BASELINE}}function h$(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function Dm(e){return e*(180/Math.PI)}function Lt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function d$(e,t){return t*Math.sin(e-Math.PI/2)}class f$ extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=Z.SVG,this.getLabelDimensions=t=>{const n=A.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=A.appendOrSelect(n,"text").text(t),{width:i,height:s}=A.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=ED(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return tt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:tt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Gn.opacity.unselected:Gn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Gn.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Gn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=A.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:v}=Gn;this.uniqueKeys=Array.from(new Set(s.map(V=>V[u]))),this.uniqueGroups=Array.from(new Set(s.map(V=>V[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-y)/2;if(_<=0)return;const E=oi().domain(this.fullDataNormalized.map(V=>V[u])).range([0,2*Math.PI].map(V=>V-Math.PI/2)),M=cn(this.fullDataNormalized.map(V=>V[d])),C=Oe().domain([M>=0?0:M,En(this.fullDataNormalized.map(V=>V[d]))]).range([g,_]).nice(p),H=C.ticks(p),I=V=>this.model.getFillColor(V),T=GS().angle(V=>E(V[u])+Math.PI/2).radius(V=>C(V[d])).curve(ef),D=this.uniqueKeys.map(V=>{const G=this.getLabelDimensions(V).width,$=d$(E(V),_);return G+$}),k={x:En(D)+h,y:i/2},U=A.appendOrSelect(n,"g.y-axes").attr("role",st.GROUP).selectAll("path").data(H,V=>V),P=V=>this.uniqueKeys.map(G=>({[u]:G,[d]:V}));U.join(V=>V.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>T(P($)))),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T(P($)))),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>T(P($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",st.GROUP).selectAll("line").data(this.uniqueKeys,V=>V).join(V=>V.append("line").attr("opacity",0).attr("class",G=>`x-axis-${yr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Lt(E(G),0,k).x).attr("y1",G=>Lt(E(G),0,k).y).attr("x2",G=>Lt(E(G),0,k).x).attr("y2",G=>Lt(E(G),0,k).y).call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-labels").attr("role",st.GROUP).selectAll("text").data(this.uniqueKeys).join(V=>V.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Lt(E(G),C.range()[1]+h,k).x).attr("y",G=>Lt(E(G),C.range()[1]+h,k).y).style("text-anchor",G=>Am(E(G)).textAnchor).style("dominant-baseline",G=>Am(E(G)).dominantBaseline).call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Lt(E($),C.range()[1]+h,k).x).attr("y",$=>Lt(E($),C.range()[1]+h,k).y).end().finally(()=>{const $=x(o,"radar","alignment"),pt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",pt)})),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.blobs").attr("role",st.GROUP).selectAll("path").data(this.groupedDataNormalized,V=>V.name).join(V=>V.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",G=>I(G.name)).style("fill-opacity",Gn.opacity.selected).style("stroke",G=>I(G.name)).call(G=>{const $=G.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),$.attr("opacity",1).attr("d",pt=>T(pt.data))}),V=>(V.attr("class",G=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>I(G.name)).style("stroke",G=>I(G.name)),V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T($.data))),V),V=>V.call(G=>{const $=G.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",st.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(V=>x(V,d)!==null)).join(V=>V.append("circle").attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),V=>V,V=>V.remove()).attr("class",V=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:V[l],originalClassName:yr(V[u])})).attr("cx",V=>Lt(E(V[u]),C(V[d]),k).x).attr("cy",V=>Lt(E(V[u]),C(V[d]),k).y).attr("r",0).attr("opacity",0).style("fill",V=>I(V[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",st.GROUP).selectAll("rect").data(this.uniqueKeys).join(V=>V.append("rect"),V=>V,V=>V.remove()).attr("x",k.x).attr("y",k.y-v/2).attr("width",C.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",V=>`rotate(${Dm(E(V))}, ${k.x}, ${k.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",st.GROUP).selectAll("text").data(be(H)).join(V=>V.append("text").attr("opacity",0).text(G=>G).attr("x",G=>Lt(-Math.PI/2,C(G),k).x+f).attr("y",G=>Lt(-Math.PI/2,C(G),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Lt(-Math.PI/2,C($),k).x+f).attr("y",$=>Lt(-Math.PI/2,C($),k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=A.getSVGElementSize(n,{useBBox:!0}),{width:s}=A.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-i.width)/2):t===It.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=L(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Gn.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=L(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Radar.X_AXIS_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Lm extends nu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,v;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),v=this.services.cartesianScales.getRangeValue(h[1]);else{const b=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,b)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===Nt.VERTICAL||h<0&&a===Nt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return jt({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:L(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class p$ extends Kt{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=A.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=A.appendOrSelect(t,"svg.chart-skeleton.DAII"),A.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Rm extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?en.opacity.unselected:en.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=gl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",en.opacity.selected).attr("d",this.areaGenerator)}}class Im extends nu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const v=c[0]<0&&c[1]<=0;v&&a.length>1?this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=1:g-=1)}return jt({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=L(this);a.classed("hovered",!0),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=L(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);a.classed("hovered",!1),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=A.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class km extends Ge{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Z.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",st.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),v=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[v]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],v=this.services.cartesianScales.getDomainIdentifier(u),m=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[v]:f,[m]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const kr=6;class g$ extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=Z.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=A.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+kr:30-kr},h=ii({name:o,children:a}),f=10,p=r/6,g=E=>{const M=h.descendants().reverse(),C=h.links();let H=h,I=h;h.eachBefore(N=>{N.x<H.x&&(H=N),N.x>I.x&&(I=N)});const T=I.x-H.x,D=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,H.x,r,T].join(" ")),R=_.selectAll("g").data(M,N=>N.id),k=this,O=R.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:N,element:L(this),datum:B})}).on("click",function(N,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),k.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:N,element:L(this),datum:B})}).on("mouseout",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:N,element:L(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",N=>N._children?-kr:kr).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(D).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(D).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=S.selectAll("path").data(C,N=>N.target.id),P=U.enter().append("path").attr("d",()=>{const N={x:E.x0,y:E.y0};return b({source:N,target:N})});U.merge(P).transition(D).attr("d",b),U.exit().transition(D).remove().attr("d",()=>{const N={x:E.x,y:E.y};return b({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===fa.DENDROGRAM?cb().size([i,r-u-m*kr-l]):Zb().nodeSize([f,p]).size([i,r-u-m*kr-l]),b=XS().x(E=>E.y).y(E=>E.x);h.x0=p/2,h.y0=0,h.descendants().forEach((E,M)=>{E.id=M,E._children=E.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var m$="#000000",v$="#ffffff",y$="#fcf4d6",x$="#fddc69",b$="#f1c21b",E$="#d2a106",S$="#b28600",_$="#8e6a00",w$="#684e00",O$="#483700",T$="#302400",M$="#1c1500",C$={10:y$,20:x$,30:b$,40:E$,50:S$,60:_$,70:w$,80:O$,90:T$,100:M$},A$="#fff2e8",D$="#ffd9be",L$="#ffb784",R$="#ff832b",I$="#eb6200",k$="#ba4e00",$$="#8a3800",P$="#5e2900",N$="#3e1a00",U$="#231000",B$={10:A$,20:D$,30:L$,40:R$,50:I$,60:k$,70:$$,80:P$,90:N$,100:U$},V$="#fff1f1",H$="#ffd7d9",G$="#ffb3b8",F$="#ff8389",z$="#fa4d56",W$="#da1e28",Y$="#a2191f",q$="#750e13",X$="#520408",j$="#2d0709",Z$={10:V$,20:H$,30:G$,40:F$,50:z$,60:W$,70:Y$,80:q$,90:X$,100:j$},K$="#fff0f7",Q$="#ffd6e8",J$="#ffafd2",tP="#ff7eb6",eP="#ee5396",nP="#d02670",rP="#9f1853",iP="#740937",sP="#510224",aP="#2a0a18",oP={10:K$,20:Q$,30:J$,40:tP,50:eP,60:nP,70:rP,80:iP,90:sP,100:aP},lP="#f6f2ff",cP="#e8daff",uP="#d4bbff",hP="#be95ff",dP="#a56eff",fP="#8a3ffc",pP="#6929c4",gP="#491d8b",mP="#31135e",vP="#1c0f30",yP={10:lP,20:cP,30:uP,40:hP,50:dP,60:fP,70:pP,80:gP,90:mP,100:vP},xP="#edf5ff",bP="#d0e2ff",EP="#a6c8ff",SP="#78a9ff",_P="#4589ff",wP="#0f62fe",OP="#0043ce",TP="#002d9c",MP="#001d6c",CP="#001141",AP={10:xP,20:bP,30:EP,40:SP,50:_P,60:wP,70:OP,80:TP,90:MP,100:CP},DP="#e5f6ff",LP="#bae6ff",RP="#82cfff",IP="#33b1ff",kP="#1192e8",$P="#0072c3",PP="#00539a",NP="#003a6d",UP="#012749",BP="#061727",VP={10:DP,20:LP,30:RP,40:IP,50:kP,60:$P,70:PP,80:NP,90:UP,100:BP},HP="#d9fbfb",GP="#9ef0f0",FP="#3ddbd9",zP="#08bdba",WP="#009d9a",YP="#007d79",qP="#005d5d",XP="#004144",jP="#022b30",ZP="#081a1c",KP={10:HP,20:GP,30:FP,40:zP,50:WP,60:YP,70:qP,80:XP,90:jP,100:ZP},QP="#defbe6",JP="#a7f0ba",tN="#6fdc8c",eN="#42be65",nN="#24a148",rN="#198038",iN="#0e6027",sN="#044317",aN="#022d0d",oN="#071908",lN={10:QP,20:JP,30:tN,40:eN,50:nN,60:rN,70:iN,80:sN,90:aN,100:oN},cN="#f2f4f8",uN="#dde1e6",hN="#c1c7cd",dN="#a2a9b0",fN="#878d96",pN="#697077",gN="#4d5358",mN="#343a3f",vN="#21272a",yN="#121619",xN={10:cN,20:uN,30:hN,40:dN,50:fN,60:pN,70:gN,80:mN,90:vN,100:yN},bN="#f4f4f4",EN="#e0e0e0",SN="#c6c6c6",_N="#a8a8a8",wN="#8d8d8d",ON="#6f6f6f",TN="#525252",MN="#393939",CN="#262626",AN="#161616",DN={10:bN,20:EN,30:SN,40:_N,50:wN,60:ON,70:TN,80:MN,90:CN,100:AN},LN="#f7f3f2",RN="#e5e0df",IN="#cac5c4",kN="#ada8a8",$N="#8f8b8b",PN="#726e6e",NN="#565151",UN="#3c3838",BN="#272525",VN="#171414",HN={10:LN,20:RN,30:IN,40:kN,50:$N,60:PN,70:NN,80:UN,90:BN,100:VN},$m={black:{100:m$},blue:AP,coolGray:xN,cyan:VP,gray:DN,green:lN,magenta:oP,orange:B$,purple:yP,red:Z$,teal:KP,warmGray:HN,white:{0:v$},yellow:C$};const GN=e=>{if(!e)return null;for(const t of Object.keys($m)){const n=$m[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Pm=function(){const e=L(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Fe(t);let r;if(n&&(r=GN(n?n.hex():null)),r==null){const i=io(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let FN=0;class zN extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=A.getSVGElementSize(n,{useAttrs:!0}),l=ii({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=eE().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>FN++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const v=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=L(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${v}`;return new URL(`#${m}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let v=g;for(;v.depth>1;)v=v.parent;const m=io(this.model.getFillColor(v.data.name));return[{text:g.data.name,color:m.l<.5?"white":"black"}]},g=>g).join(g=>{const v=g.append("text").text(m=>m.text).style("fill",Pm).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=L(this.parentNode).attr("data-uid"),y=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${y}`,s)+""})`}),v},g=>g.text(v=>v.text).style("fill",Pm),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=L(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),Fe(s).darker(.7).toString()}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Treemap.LEAF_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}var WN={value:function(){}};function Nm(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ba(n)}function Ba(e){this._=e}function YN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ba.prototype=Nm.prototype={constructor:Ba,on:function(e,t){var n=this._,r=YN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=qN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Um(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Um(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ba(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function qN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Um(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=WN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const XN=PI(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Nm},Symbol.toStringTag,{value:"Module"}))).dispatch,ru=Math.PI/180,jN={archimedean:Vm,rectangular:aU},Fi=64,Va=2048;var ZN=function(){var e=[256,256],t=KN,n=QN,r=JN,i=Bm,s=Bm,a=tU,o=eU,l=Vm,c=[],u=1/0,d=XN("word","end"),h=null,f=Math.random,p={},g=lU;p.canvas=function(y){return arguments.length?(g=yn(y),p):g},p.start=function(){var y=v(g()),b=oU((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,M=[],C=c.map(function(I,T){return I.text=t.call(this,I,T),I.font=n.call(this,I,T),I.style=i.call(this,I,T),I.weight=s.call(this,I,T),I.rotate=a.call(this,I,T),I.size=~~r.call(this,I,T),I.padding=o.call(this,I,T),I}).sort(function(I,T){return T.size-I.size});return h&&clearInterval(h),h=setInterval(H,0),H(),p;function H(){for(var I=Date.now();Date.now()-I<u&&++E<_&&h;){var T=C[E];T.x=e[0]*(f()+.5)>>1,T.y=e[1]*(f()+.5)>>1,nU(y,T,C,E),T.hasText&&m(b,T,S)&&(M.push(T),d.call("word",p,T),S?iU(S,T):S=[{x:T.x+T.x0,y:T.y+T.y0},{x:T.x+T.x1,y:T.y+T.y1}],T.x-=e[0]>>1,T.y-=e[1]>>1)}E>=_&&(p.stop(),d.call("end",p,M,S))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Fi<<5)/S,y.height=Va/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function m(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),C=l(e),H=f()<.5?1:-1,I=-H,T,D,R;(T=C(I+=H))&&(D=~~T[0],R=~~T[1],!(Math.min(Math.abs(D),Math.abs(R))>=M));)if(b.x=_+D,b.y=E+R,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||sU(b,S))&&!rU(b,y,e[0])){for(var k=b.sprite,O=b.width>>5,U=e[0]>>5,P=b.x-(O<<4),N=P&127,B=32-N,Y=b.y1-b.y0,X=(b.y+b.y0)*U+(P>>5),J,ct=0;ct<Y;ct++){J=0;for(var W=0;W<=O;W++)y[X+W]|=J<<B|(W<O?(J=k[ct*O+W])>>>N:0);X+=U}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=yn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=jN[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=yn(y),p):r},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function KN(e){return e.text}function QN(){return"serif"}function Bm(){return"normal"}function JN(e){return Math.sqrt(e.value)}function tU(){return(~~(random()*6)-3)*30}function eU(){return 1}function nU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Fi<<5)/s,Va/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const T=i.measureText(t.text),D=-Math.floor(T.width/2);let R=(T.width+1)*s,k=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*ru),d=Math.cos(t.rotate*ru),h=R*d,f=R*u,p=k*d,g=k*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,k=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(k>l&&(l=k),a+R>=Fi<<5&&(a=0,o+=l,l=0),o+k>=Va)break;i.translate((a+(R>>1))/s,(o+(k>>1))/s),t.rotate&&i.rotate(t.rotate*ru),i.fillText(t.text,D,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,D,0)),i.restore(),t.width=R,t.height=k,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=k>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Fi<<5)/s,Va/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)m[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,M=-1,C=0;C<S;C++){for(var _=0;_<y;_++){var H=b*C+(_>>5),I=v[(o+C)*(Fi<<5)+(a+_)<<2]?1<<31-_%32:0;m[H]|=I,E|=I}E?M=C:(t.y0++,S--,C--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*b)}}}function rU(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function iU(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function sU(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Vm(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function aU(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function oU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function lU(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}const cU=$I(ZN);class uU extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=A.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=cU().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=A.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const v=g.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);v.exit().attr("opacity",0).remove(),v.enter().append("text").attr("opacity",0).merge(v).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?be(i):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=da(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOVER,{event:s,element:L(this),datum:a}),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.WordCloud.WORD_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);i(null),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class hU extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=Z.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=A.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=Jk(s,Object.values(l)),u=Zk(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=$x().projection(d);A.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=A.appendOrSelect(t,"defs");A.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",pi()([[0,0],[0,10]]));const v=A.appendOrSelect(t,"g.missing-data");A.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case Ve.geoEqualEarth:t=tb();break;case Ve.geoAlbers:t=qx();break;case Ve.geoConicEqualArea:t=nd();break;case Ve.geoConicEquidistant:t=Qx();break;case Ve.geoEquirectangular:t=Zx();break;case Ve.geoMercator:t=Xx();break;case Ve.geoNaturalEarth1:t=eb();break;default:throw new Error("Projection is not supported.")}return t}}class dU extends hU{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",s=>this.model.getColorClassName({value:n[s.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=L(this);t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEMOVE,{event:r,element:L(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(br.CHOROPLETH_CLICK,{event:r,element:L(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=L(this);t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.HIDE,{event:r,hoveredElement:s})})}}class fU extends Le{constructor(t,n){super(t,n),this.model=new Yk(this.services),this.model.setOptions(Ct(Et.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Hi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ar(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Zt(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"choropleth"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Zt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new Xc(this.model,this.services),new ka(this.model,this.services),new Zt(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new dU(this.model,this.services)];return this.getChartComponents(t)}}class pU extends He{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=tt({},t,this.getZoomOptions(t));gc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:tt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:$t.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}}class gU extends Le{constructor(t,n){super(t,n),this.model=new pU(this.services),this.model.setOptions(Ct(Et.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new r$(this.model,this.services)];return this.getChartComponents(t)}}const Hm={[ce.LINE]:[Rr,Ge],[ce.SCATTER]:[Ge],[ce.AREA]:[ym,Rr,Ge],[ce.STACKED_AREA]:[Rm,Rr,km,Ua],[ce.SIMPLE_BAR]:[Lm],[ce.GROUPED_BAR]:[Cm,Ir],[ce.STACKED_BAR]:[Im,Ua]};class mU extends ie{constructor(t,n){super(t,n);const r=Ct(Et.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ce.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Hm).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${DM(i.type)}Chart`;return a=tt({},Et[l],this.model.getOptions(),i.options),i.type===ce.STACKED_AREA&&(o=!0),Hm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=tt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Vf(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===ce.STACKED_BAR||s.type===ce.STACKED_AREA),r=[new se(this.model,this.services),new de(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID}),...n?[]:[new mn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class vU extends He{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(s=>[s[r],s.value===null?"&ndash;":s.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Gm extends Le{constructor(t,n,r=!1){super(t,n),this.model=new vU(this.services),!r&&(this.model.setOptions(Ct(Et.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Om(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}class yU extends Gm{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(Et.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.DONUT})];return this.getChartComponents(t)}}class xU extends He{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(s=>[s[r],s.value===null?"&ndash;":s.value.toLocaleString()])]}}class bU extends Le{constructor(t,n){super(t,n),this.model=new xU(this.services),this.model.setOptions(Ct(Et.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new a$(this.model,this.services)];return this.getChartComponents(t)}}class EU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Cm(this.model,this.services),new Ir(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class SU extends Wn{constructor(t){super(t),this.axisFlavor=Ri.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==j.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==j.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==j.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==j.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),r=>r.value),n=Oe().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ce(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ce(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ce(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(s=>[s[n.identifier]===null?"&ndash;":s[n.identifier],s[r.identifier]===null?"&ndash;":s[r.identifier].toLocaleString(),s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ce(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=el().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Sm(this.getDisplayData(),l)}}class _U extends ie{constructor(t,n){super(t,n),this.model=new SU(this.services),this.model.setOptions(Ct(Et.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Hi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ar(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Zt(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"heatmap"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Zt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new vm(this.model,this.services),new ka(this.model,this.services),new Zt(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new se(this.model,this.services),new o$(this.model,this.services)];return this.getAxisChartComponents(t)}}class wU extends Wn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...r.map(s=>St(s,`0.${n}`))],...St(r,0).map((s,a)=>[`${St(s,"data.x0")} – ${St(s,"data.x1")}`,...r.map(o=>St(o[a],`data.${St(o[a],n)}`))])]}}class OU extends ie{constructor(t,n){super(t,n),this.model=new wU(this.services),this.model.setOptions(Ct(Et.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new e$(this.model,this.services),new l$(this.model,this.services)];return this.getAxisChartComponents(t)}}class TU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Rr(this.model,this.services),new Ge(this.model,this.services,{handleThresholds:!0}),new p$(this.model,this.services),new Ir(this.model,this.services)];return this.getAxisChartComponents(t)}}class MU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new c$(this.model,this.services),new Ge(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class CU extends He{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else{const l=x(s,"total");o=l||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])]}return a}}class AU extends Le{constructor(t,n){var i;super(t,n),this.model=new CU(this.services);const r=(i=n.options.meter)!=null&&i.proportional?tt(tn(Et.proportionalMeterChart),n.options):tt(tn(Et.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new n$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG},{id:"spacer",components:[new ln(this.model,this.services,{size:8})],growth:nt.STRETCH}]:[],{id:"meter-graph",components:[new u$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG}],r=[new Zt(this.model,this.services,n,{direction:bt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:Z.HTML})}}class DU extends Wn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(o=>o[r]);return[["Group",...s],...n.map(o=>[o.name,...s.map((l,c)=>x(o,"data",c,i)!==null?x(o,"data",c,i).toLocaleString():"&ndash;")])]}}class LU extends Le{constructor(t,n){super(t,n),this.model=new DU(this.services),this.model.setOptions(Ct(Et.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new f$(this.model,this.services)];return this.getChartComponents(t)}}class RU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Ge(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class IU extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class kU extends Le{constructor(t,n){super(t,n),this.model=new IU(this.services),this.model.setOptions(Ct(Et.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class $U extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):x(r.name)!==null&&x(r.value)&&n.push(["–",r.name,r.value])}),n}}class PU extends Le{constructor(t,n){super(t,n),this.model=new $U(this.services),this.model.setOptions(Ct(Et.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new zN(this.model,this.services)];return this.getChartComponents(t)}}class NU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Lm(this.model,this.services),new Ir(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class UU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new Rm(this.model,this.services),new Rr(this.model,this.services,{stacked:!0}),new km(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class BU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new Im(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ}),new Ir(this.model,this.services)];return this.getAxisChartComponents(t)}}class VU extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(o=>[o[i],o[s],o[r]])]}}class HU extends Le{constructor(t,n){super(t,n),this.model=new VU(this.services),this.model.setOptions(Ct(Et.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new uU(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}z.Alignments=It,z.AlluvialChart=Tk,z.AreaChart=Nk,z.AreaEvent=ec,z.ArrowDirections=pa,z.AxisEvent=tc,z.AxisFlavor=Ri,z.AxisPositions=F,z.AxisTitleOrientations=ga,z.BarEvent=sc,z.BoxplotChart=Vk,z.BoxplotEvent=ac,z.BubbleChart=Gk,z.BulletChart=Wk,z.CalloutDirections=Ci,z.CanvasZoomEvent=Jl,z.CartesianOrientations=Nt,z.ChartEvent=Xl,z.ChartTheme=fc,z.ChartTypes=ce,z.CirclePackChart=gU,z.ColorClassNameTypes=Q,z.ColorLegendType=Li,z.ComboChart=mU,z.DividerStatus=_r,z.DominantBaseline=Be,z.DonutChart=yU,z.ExperimentalChoroplethChart=fU,z.GaugeChart=bU,z.GaugeEvent=ic,z.GaugeTypes=Hn,z.GroupedBarChart=EU,z.HeatmapChart=_U,z.HistogramChart=OU,z.LayoutAlignItems=Vn,z.LayoutDirection=bt,z.LayoutGrowth=nt,z.LegendItemType=$t,z.LegendOrientations=Sr,z.LegendPositions=Er,z.LineChart=TU,z.LineEvent=lc,z.LollipopChart=MU,z.MeterChart=AU,z.ModalEvent=jl,z.ModelEvent=Zl,z.PieChart=Gm,z.PieEvent=rc,z.Projection=Ve,z.RadarChart=LU,z.RadarEvent=cc,z.RenderTypes=Z,z.ScaleTypes=j,z.ScatterChart=RU,z.ScatterEvent=oc,z.SimpleBarChart=NU,z.Skeletons=kt,z.StackedAreaChart=UU,z.StackedBarChart=BU,z.Statuses=Ai,z.TextAnchor=Ue,z.ThresholdEvent=dc,z.TickRotations=Di,z.ToolbarControlTypes=Mt,z.TooltipEvent=xr,z.TreeChart=kU,z.TreeEvent=uc,z.TreeTypes=fa,z.TreemapChart=PU,z.TreemapEvent=hc,z.TruncationTypes=ve,z.WordCloudChart=HU,z.WordCloudEvent=nc,z.ZoomBarTypes=Ae,z.ZoomDomainEvent=Ql,z.ZoombarEvent=Kl,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
83
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:St(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=L(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");L(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,wr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");L(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,wr),n.stopPropagation()}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function i$(e,t){const n=Gr(this._current,e);return r=>(this._current=n(r),t(this._current))}class Om extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(D=>D[a]>0),l=this.computeRadius();this.arc=fi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=fi().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const u=BS().value(D=>D[a]).sort(x(i,"pie","sortFunction")).padAngle(wt.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",st.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,D=>D.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",D=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:D.data[s],originalClassName:"slice"})).style("fill",D=>n.model.getFillColor(D.data[s])).attr("d",this.arc).transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",D=>`${D[a]}, ${pc(D.data[a],o,a)+"%"}`).attrTween("d",function(D){return i$.bind(this)(D,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(D=>D.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",st.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,D=>D.data[s]);y.exit().attr("opacity",0).remove();const b=y.enter().append("text").classed("pie-label",!0),S=[];b.merge(y).style("text-anchor","middle").text(D=>i.pie.labels.formatter?i.pie.labels.formatter({...D,percentageValue:pc(D.data[a],o,a,!0)}):pc(D.data[a],o,a)+"%").datum(function(D){const R=l+7,k=(D.endAngle-D.startAngle)/2+D.startAngle,O=k/Math.PI*180,U=this.getComputedTextLength();return D.textOffsetX=U/2,D.textOffsetY=O>90&&O<270?10:0,D.xPosition=(D.textOffsetX+R)*Math.sin(k),D.yPosition=(D.textOffsetY+R)*-Math.cos(k),D}).attr("transform",function(D,R){const k=v.length,O=(D.endAngle-D.startAngle)*(180/Math.PI);if(R>=k-2&&O<wt.callout.minSliceDegree){let U,P;return D.index===k-1?(U=D.xPosition+wt.callout.offsetX+wt.callout.textMargin+D.textOffsetX,P=D.yPosition-wt.callout.offsetY,D.direction=Ci.RIGHT,S.push(D)):(U=D.xPosition-wt.callout.offsetX-D.textOffsetX-wt.callout.textMargin,P=D.yPosition-wt.callout.offsetY,D.direction=Ci.LEFT,S.push(D)),`translate(${U}, ${P})`}return`translate(${D.xPosition}, ${D.yPosition})`}),this.renderCallouts(S);const _=x(i,"donut")?"donut":"pie",E=x(i,_,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),C=g?wt.xOffset:0,H=g?wt.yOffset:0;let I=l+C;E===It.CENTER?I=M/2:E===It.RIGHT&&(I=M-l-wt.xOffset);let T=l+H;S.length>0&&(T+=wt.yOffsetCallout),r.attr("x",I+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",st.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",st.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Ci.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-wt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+wt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return L(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return L(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOVER,{event:n,element:L(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Pie.SLICE_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+wt.radiusOffset:i}}class s$ extends Om{constructor(){super(...arguments),this.type="donut",this.renderType=Z.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=A.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");A.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(L(this))}),a!==null&&a!==""&&A.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Nu:s=oe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Tm="4,10 8,6 12,10",Mm="12,6 8,10 4,6";class a$ extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=Z.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return fp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Hn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case pa.UP:return Tm;case pa.DOWN:return Mm;default:return t>0?Tm:Mm}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=fi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=fi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),A.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:v}=A.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;g===It.CENTER?m=v/2:g===It.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===Hn.FULL&&!s?d=l(a):r===Hn.SEMI&&s&&(d=-(l(a)+c));const h=A.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=A.appendOrSelect(h,"g.gauge-value-number"),g=x(n,"gauge","numberFormatter"),v=p.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${f}px`).attr("text-anchor","middle").text(M=>g(M));const{width:m}=A.getSVGElementSize(A.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(b),{width:_,height:E}=A.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),d=A.appendOrSelect(n,"g.gauge-numbers"),h=A.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=A.appendOrSelect(h,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:g}=A.getSVGElementSize(A.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=x(r,"gauge","deltaArrow","enabled"),m=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);m.enter().append("svg").merge(m).attr("class","gauge-delta-arrow").attr("x",-l(s)-g/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=L(this);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),m.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOVER,{event:n,element:L(this),datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});return n===Hn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Cm extends nu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Z.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Mi(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Nt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[i])).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,v=f+p,m=this.services.cartesianScales.getRangeAxisPosition({datum:h}),y=this.services.cartesianScales.getValueThroughAxisPosition(m,0),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return jt({x0:g,x1:v,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=oi().domain(t).rangeRound([0,this.getGroupWidth()])}}class o$ extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=Z.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${cn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${cn(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:L(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value))).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=A.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);A.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),A.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),A.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),A.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==_r.OFF&&(t===_r.AUTO&&rg.minCellDividerDimension<=this.xBandwidth&&rg.minCellDividerDimension<=this.yBandwidth||t===_r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=St(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=L(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Ii(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:L(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){const h=L(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class l$ extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>St(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",st.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=St(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let v=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(v-g)>0&&Math.abs(v-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?v+=1:v-=1),jt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=L(this);a.classed("hovered",!0);const o=parseFloat(St(s,"data.x0")),l=parseFloat(St(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("mouseout",function(){L(this).classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class c$ extends Ge{constructor(){super(...arguments),this.type="lollipop",this.renderType=Z.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?nn.weight.unselected:nn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",nn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?nn.opacity.unselected:nn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=sn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Nt.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class u$ extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=Z.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Ht.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Ht.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=A.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const b=x(i,"meter","proportional","total");u=b||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Oe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");A.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Ht.height.proportional:Ht.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Ht.height.proportional:Ht.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?Ht.height.proportional:Ht.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:b[c],originalClassName:g})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const v=x(i,"meter","peak");let m=v;v!==null&&(v>u?m=u:v<a[0].value&&(m=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(m==null?[]:[m]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Ht.height.proportional:Ht.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Am(e){const t=h$(Dm(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Ue.START,dominantBaseline:Be.MIDDLE}:vn(t,[10,80])?{textAnchor:Ue.START,dominantBaseline:Be.HANGING}:vn(t,[80,100])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.HANGING}:vn(t,[100,170])?{textAnchor:Ue.END,dominantBaseline:Be.HANGING}:vn(t,[170,190])?{textAnchor:Ue.END,dominantBaseline:Be.MIDDLE}:vn(t,[190,260])?{textAnchor:Ue.END,dominantBaseline:Be.BASELINE}:vn(t,[260,280])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.BASELINE}:{textAnchor:Ue.START,dominantBaseline:Be.BASELINE}}function h$(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function Dm(e){return e*(180/Math.PI)}function Lt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function d$(e,t){return t*Math.sin(e-Math.PI/2)}class f$ extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=Z.SVG,this.getLabelDimensions=t=>{const n=A.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=A.appendOrSelect(n,"text").text(t),{width:i,height:s}=A.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=ED(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return tt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:tt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Gn.opacity.unselected:Gn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Gn.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Gn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=A.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:v}=Gn;this.uniqueKeys=Array.from(new Set(s.map(V=>V[u]))),this.uniqueGroups=Array.from(new Set(s.map(V=>V[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-y)/2;if(_<=0)return;const E=oi().domain(this.fullDataNormalized.map(V=>V[u])).range([0,2*Math.PI].map(V=>V-Math.PI/2)),M=cn(this.fullDataNormalized.map(V=>V[d])),C=Oe().domain([M>=0?0:M,En(this.fullDataNormalized.map(V=>V[d]))]).range([g,_]).nice(p),H=C.ticks(p),I=V=>this.model.getFillColor(V),T=GS().angle(V=>E(V[u])+Math.PI/2).radius(V=>C(V[d])).curve(ef),D=this.uniqueKeys.map(V=>{const G=this.getLabelDimensions(V).width,$=d$(E(V),_);return G+$}),k={x:En(D)+h,y:i/2},U=A.appendOrSelect(n,"g.y-axes").attr("role",st.GROUP).selectAll("path").data(H,V=>V),P=V=>this.uniqueKeys.map(G=>({[u]:G,[d]:V}));U.join(V=>V.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>T(P($)))),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T(P($)))),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>T(P($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",st.GROUP).selectAll("line").data(this.uniqueKeys,V=>V).join(V=>V.append("line").attr("opacity",0).attr("class",G=>`x-axis-${yr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Lt(E(G),0,k).x).attr("y1",G=>Lt(E(G),0,k).y).attr("x2",G=>Lt(E(G),0,k).x).attr("y2",G=>Lt(E(G),0,k).y).call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-labels").attr("role",st.GROUP).selectAll("text").data(this.uniqueKeys).join(V=>V.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Lt(E(G),C.range()[1]+h,k).x).attr("y",G=>Lt(E(G),C.range()[1]+h,k).y).style("text-anchor",G=>Am(E(G)).textAnchor).style("dominant-baseline",G=>Am(E(G)).dominantBaseline).call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Lt(E($),C.range()[1]+h,k).x).attr("y",$=>Lt(E($),C.range()[1]+h,k).y).end().finally(()=>{const $=x(o,"radar","alignment"),pt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",pt)})),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.blobs").attr("role",st.GROUP).selectAll("path").data(this.groupedDataNormalized,V=>V.name).join(V=>V.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",G=>I(G.name)).style("fill-opacity",Gn.opacity.selected).style("stroke",G=>I(G.name)).call(G=>{const $=G.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),$.attr("opacity",1).attr("d",pt=>T(pt.data))}),V=>(V.attr("class",G=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>I(G.name)).style("stroke",G=>I(G.name)),V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T($.data))),V),V=>V.call(G=>{const $=G.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",st.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(V=>x(V,d)!==null)).join(V=>V.append("circle").attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),V=>V,V=>V.remove()).attr("class",V=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:V[l],originalClassName:yr(V[u])})).attr("cx",V=>Lt(E(V[u]),C(V[d]),k).x).attr("cy",V=>Lt(E(V[u]),C(V[d]),k).y).attr("r",0).attr("opacity",0).style("fill",V=>I(V[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",st.GROUP).selectAll("rect").data(this.uniqueKeys).join(V=>V.append("rect"),V=>V,V=>V.remove()).attr("x",k.x).attr("y",k.y-v/2).attr("width",C.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",V=>`rotate(${Dm(E(V))}, ${k.x}, ${k.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",st.GROUP).selectAll("text").data(be(H)).join(V=>V.append("text").attr("opacity",0).text(G=>G).attr("x",G=>Lt(-Math.PI/2,C(G),k).x+f).attr("y",G=>Lt(-Math.PI/2,C(G),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Lt(-Math.PI/2,C($),k).x+f).attr("y",$=>Lt(-Math.PI/2,C($),k).y)),V=>V.call(G=>G.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=A.getSVGElementSize(n,{useBBox:!0}),{width:s}=A.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-i.width)/2):t===It.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=L(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Gn.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=L(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Radar.X_AXIS_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Lm extends nu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,v;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),v=this.services.cartesianScales.getRangeValue(h[1]);else{const b=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,b)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===Nt.VERTICAL||h<0&&a===Nt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return jt({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:L(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class p$ extends Kt{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=A.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=A.appendOrSelect(t,"svg.chart-skeleton.DAII"),A.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Rm extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?en.opacity.unselected:en.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=gl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",en.opacity.selected).attr("d",this.areaGenerator)}}class Im extends nu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const v=c[0]<0&&c[1]<=0;v&&a.length>1?this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=1:g-=1)}return jt({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=L(this);a.classed("hovered",!0),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=L(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);a.classed("hovered",!1),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=A.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class km extends Ge{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Z.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",st.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),v=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[v]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],v=this.services.cartesianScales.getDomainIdentifier(u),m=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[v]:f,[m]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const kr=6;class g$ extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=Z.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=A.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+kr:30-kr},h=ii({name:o,children:a}),f=10,p=r/6,g=E=>{const M=h.descendants().reverse(),C=h.links();let H=h,I=h;h.eachBefore(N=>{N.x<H.x&&(H=N),N.x>I.x&&(I=N)});const T=I.x-H.x,D=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,H.x,r,T].join(" ")),R=_.selectAll("g").data(M,N=>N.id),k=this,O=R.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:N,element:L(this),datum:B})}).on("click",function(N,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),k.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:N,element:L(this),datum:B})}).on("mouseout",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:N,element:L(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",N=>N._children?-kr:kr).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(D).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(D).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=S.selectAll("path").data(C,N=>N.target.id),P=U.enter().append("path").attr("d",()=>{const N={x:E.x0,y:E.y0};return b({source:N,target:N})});U.merge(P).transition(D).attr("d",b),U.exit().transition(D).remove().attr("d",()=>{const N={x:E.x,y:E.y};return b({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===fa.DENDROGRAM?cb().size([i,r-u-m*kr-l]):Zb().nodeSize([f,p]).size([i,r-u-m*kr-l]),b=XS().x(E=>E.y).y(E=>E.x);h.x0=p/2,h.y0=0,h.descendants().forEach((E,M)=>{E.id=M,E._children=E.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var m$="#000000",v$="#ffffff",y$="#fcf4d6",x$="#fddc69",b$="#f1c21b",E$="#d2a106",S$="#b28600",_$="#8e6a00",w$="#684e00",O$="#483700",T$="#302400",M$="#1c1500",C$={10:y$,20:x$,30:b$,40:E$,50:S$,60:_$,70:w$,80:O$,90:T$,100:M$},A$="#fff2e8",D$="#ffd9be",L$="#ffb784",R$="#ff832b",I$="#eb6200",k$="#ba4e00",$$="#8a3800",P$="#5e2900",N$="#3e1a00",U$="#231000",B$={10:A$,20:D$,30:L$,40:R$,50:I$,60:k$,70:$$,80:P$,90:N$,100:U$},V$="#fff1f1",H$="#ffd7d9",G$="#ffb3b8",F$="#ff8389",z$="#fa4d56",W$="#da1e28",Y$="#a2191f",q$="#750e13",X$="#520408",j$="#2d0709",Z$={10:V$,20:H$,30:G$,40:F$,50:z$,60:W$,70:Y$,80:q$,90:X$,100:j$},K$="#fff0f7",Q$="#ffd6e8",J$="#ffafd2",tP="#ff7eb6",eP="#ee5396",nP="#d02670",rP="#9f1853",iP="#740937",sP="#510224",aP="#2a0a18",oP={10:K$,20:Q$,30:J$,40:tP,50:eP,60:nP,70:rP,80:iP,90:sP,100:aP},lP="#f6f2ff",cP="#e8daff",uP="#d4bbff",hP="#be95ff",dP="#a56eff",fP="#8a3ffc",pP="#6929c4",gP="#491d8b",mP="#31135e",vP="#1c0f30",yP={10:lP,20:cP,30:uP,40:hP,50:dP,60:fP,70:pP,80:gP,90:mP,100:vP},xP="#edf5ff",bP="#d0e2ff",EP="#a6c8ff",SP="#78a9ff",_P="#4589ff",wP="#0f62fe",OP="#0043ce",TP="#002d9c",MP="#001d6c",CP="#001141",AP={10:xP,20:bP,30:EP,40:SP,50:_P,60:wP,70:OP,80:TP,90:MP,100:CP},DP="#e5f6ff",LP="#bae6ff",RP="#82cfff",IP="#33b1ff",kP="#1192e8",$P="#0072c3",PP="#00539a",NP="#003a6d",UP="#012749",BP="#061727",VP={10:DP,20:LP,30:RP,40:IP,50:kP,60:$P,70:PP,80:NP,90:UP,100:BP},HP="#d9fbfb",GP="#9ef0f0",FP="#3ddbd9",zP="#08bdba",WP="#009d9a",YP="#007d79",qP="#005d5d",XP="#004144",jP="#022b30",ZP="#081a1c",KP={10:HP,20:GP,30:FP,40:zP,50:WP,60:YP,70:qP,80:XP,90:jP,100:ZP},QP="#defbe6",JP="#a7f0ba",tN="#6fdc8c",eN="#42be65",nN="#24a148",rN="#198038",iN="#0e6027",sN="#044317",aN="#022d0d",oN="#071908",lN={10:QP,20:JP,30:tN,40:eN,50:nN,60:rN,70:iN,80:sN,90:aN,100:oN},cN="#f2f4f8",uN="#dde1e6",hN="#c1c7cd",dN="#a2a9b0",fN="#878d96",pN="#697077",gN="#4d5358",mN="#343a3f",vN="#21272a",yN="#121619",xN={10:cN,20:uN,30:hN,40:dN,50:fN,60:pN,70:gN,80:mN,90:vN,100:yN},bN="#f4f4f4",EN="#e0e0e0",SN="#c6c6c6",_N="#a8a8a8",wN="#8d8d8d",ON="#6f6f6f",TN="#525252",MN="#393939",CN="#262626",AN="#161616",DN={10:bN,20:EN,30:SN,40:_N,50:wN,60:ON,70:TN,80:MN,90:CN,100:AN},LN="#f7f3f2",RN="#e5e0df",IN="#cac5c4",kN="#ada8a8",$N="#8f8b8b",PN="#726e6e",NN="#565151",UN="#3c3838",BN="#272525",VN="#171414",HN={10:LN,20:RN,30:IN,40:kN,50:$N,60:PN,70:NN,80:UN,90:BN,100:VN},$m={black:{100:m$},blue:AP,coolGray:xN,cyan:VP,gray:DN,green:lN,magenta:oP,orange:B$,purple:yP,red:Z$,teal:KP,warmGray:HN,white:{0:v$},yellow:C$};const GN=e=>{if(!e)return null;for(const t of Object.keys($m)){const n=$m[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Pm=function(){const e=L(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Fe(t);let r;if(n&&(r=GN(n?n.hex():null)),r==null){const i=io(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let FN=0;class zN extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=A.getSVGElementSize(n,{useAttrs:!0}),l=ii({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=eE().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>FN++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const v=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=L(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${v}`;return new URL(`#${m}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let v=g;for(;v.depth>1;)v=v.parent;const m=io(this.model.getFillColor(v.data.name));return[{text:g.data.name,color:m.l<.5?"white":"black"}]},g=>g).join(g=>{const v=g.append("text").text(m=>m.text).style("fill",Pm).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=L(this.parentNode).attr("data-uid"),y=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${y}`,s)+""})`}),v},g=>g.text(v=>v.text).style("fill",Pm),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=L(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),Fe(s).darker(.7).toString()}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Treemap.LEAF_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}var WN={value:function(){}};function Nm(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ba(n)}function Ba(e){this._=e}function YN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ba.prototype=Nm.prototype={constructor:Ba,on:function(e,t){var n=this._,r=YN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=qN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Um(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Um(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ba(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function qN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Um(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=WN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const XN=PI(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Nm},Symbol.toStringTag,{value:"Module"}))).dispatch,ru=Math.PI/180,jN={archimedean:Vm,rectangular:aU},Fi=64,Va=2048;var ZN=function(){var e=[256,256],t=KN,n=QN,r=JN,i=Bm,s=Bm,a=tU,o=eU,l=Vm,c=[],u=1/0,d=XN("word","end"),h=null,f=Math.random,p={},g=lU;p.canvas=function(y){return arguments.length?(g=yn(y),p):g},p.start=function(){var y=v(g()),b=oU((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,M=[],C=c.map(function(I,T){return I.text=t.call(this,I,T),I.font=n.call(this,I,T),I.style=i.call(this,I,T),I.weight=s.call(this,I,T),I.rotate=a.call(this,I,T),I.size=~~r.call(this,I,T),I.padding=o.call(this,I,T),I}).sort(function(I,T){return T.size-I.size});return h&&clearInterval(h),h=setInterval(H,0),H(),p;function H(){for(var I=Date.now();Date.now()-I<u&&++E<_&&h;){var T=C[E];T.x=e[0]*(f()+.5)>>1,T.y=e[1]*(f()+.5)>>1,nU(y,T,C,E),T.hasText&&m(b,T,S)&&(M.push(T),d.call("word",p,T),S?iU(S,T):S=[{x:T.x+T.x0,y:T.y+T.y0},{x:T.x+T.x1,y:T.y+T.y1}],T.x-=e[0]>>1,T.y-=e[1]>>1)}E>=_&&(p.stop(),d.call("end",p,M,S))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Fi<<5)/S,y.height=Va/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function m(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),C=l(e),H=f()<.5?1:-1,I=-H,T,D,R;(T=C(I+=H))&&(D=~~T[0],R=~~T[1],!(Math.min(Math.abs(D),Math.abs(R))>=M));)if(b.x=_+D,b.y=E+R,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||sU(b,S))&&!rU(b,y,e[0])){for(var k=b.sprite,O=b.width>>5,U=e[0]>>5,P=b.x-(O<<4),N=P&127,B=32-N,Y=b.y1-b.y0,X=(b.y+b.y0)*U+(P>>5),J,ct=0;ct<Y;ct++){J=0;for(var W=0;W<=O;W++)y[X+W]|=J<<B|(W<O?(J=k[ct*O+W])>>>N:0);X+=U}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=yn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=jN[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=yn(y),p):r},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function KN(e){return e.text}function QN(){return"serif"}function Bm(){return"normal"}function JN(e){return Math.sqrt(e.value)}function tU(){return(~~(random()*6)-3)*30}function eU(){return 1}function nU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Fi<<5)/s,Va/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const T=i.measureText(t.text),D=-Math.floor(T.width/2);let R=(T.width+1)*s,k=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*ru),d=Math.cos(t.rotate*ru),h=R*d,f=R*u,p=k*d,g=k*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,k=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(k>l&&(l=k),a+R>=Fi<<5&&(a=0,o+=l,l=0),o+k>=Va)break;i.translate((a+(R>>1))/s,(o+(k>>1))/s),t.rotate&&i.rotate(t.rotate*ru),i.fillText(t.text,D,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,D,0)),i.restore(),t.width=R,t.height=k,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=k>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Fi<<5)/s,Va/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)m[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,M=-1,C=0;C<S;C++){for(var _=0;_<y;_++){var H=b*C+(_>>5),I=v[(o+C)*(Fi<<5)+(a+_)<<2]?1<<31-_%32:0;m[H]|=I,E|=I}E?M=C:(t.y0++,S--,C--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*b)}}}function rU(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function iU(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function sU(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Vm(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function aU(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function oU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function lU(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}const cU=$I(ZN);class uU extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Z.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=A.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=cU().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=A.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const v=g.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);v.exit().attr("opacity",0).remove(),v.enter().append("text").attr("opacity",0).merge(v).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?be(i):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=da(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOVER,{event:s,element:L(this),datum:a}),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.WordCloud.WORD_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);i(null),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class hU extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=Z.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=A.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=Jk(s,Object.values(l)),u=Zk(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=$x().projection(d);A.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=A.appendOrSelect(t,"defs");A.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",pi()([[0,0],[0,10]]));const v=A.appendOrSelect(t,"g.missing-data");A.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case Ve.geoEqualEarth:t=tb();break;case Ve.geoAlbers:t=qx();break;case Ve.geoConicEqualArea:t=nd();break;case Ve.geoConicEquidistant:t=Qx();break;case Ve.geoEquirectangular:t=Zx();break;case Ve.geoMercator:t=Xx();break;case Ve.geoNaturalEarth1:t=eb();break;default:throw new Error("Projection is not supported.")}return t}}class dU extends hU{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",s=>this.model.getColorClassName({value:n[s.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=L(this);t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEMOVE,{event:r,element:L(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(br.CHOROPLETH_CLICK,{event:r,element:L(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=L(this);t.services.events.dispatchEvent(br.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.HIDE,{event:r,hoveredElement:s})})}}class fU extends Le{constructor(t,n){super(t,n),this.model=new Yk(this.services),this.model.setOptions(Ct(Et.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Hi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ar(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Zt(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"choropleth"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Zt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new Xc(this.model,this.services),new ka(this.model,this.services),new Zt(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new dU(this.model,this.services)];return this.getChartComponents(t)}}class pU extends He{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=tt({},t,this.getZoomOptions(t));gc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:tt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:$t.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}}class gU extends Le{constructor(t,n){super(t,n),this.model=new pU(this.services),this.model.setOptions(Ct(Et.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new r$(this.model,this.services)];return this.getChartComponents(t)}}const Hm={[ce.LINE]:[Rr,Ge],[ce.SCATTER]:[Ge],[ce.AREA]:[ym,Rr,Ge],[ce.STACKED_AREA]:[Rm,Rr,km,Ua],[ce.SIMPLE_BAR]:[Lm],[ce.GROUPED_BAR]:[Cm,Ir],[ce.STACKED_BAR]:[Im,Ua]};class mU extends ie{constructor(t,n){super(t,n);const r=Ct(Et.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ce.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Hm).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${DM(i.type)}Chart`;return a=tt({},Et[l],this.model.getOptions(),i.options),i.type===ce.STACKED_AREA&&(o=!0),Hm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=tt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Vf(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===ce.STACKED_BAR||s.type===ce.STACKED_AREA),r=[new se(this.model,this.services),new de(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID}),...n?[]:[new mn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class vU extends He{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie;return[["Group","Value"],...t.map(a=>[a[r],a[i]===null?"&ndash;":a[i].toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Gm extends Le{constructor(t,n,r=!1){super(t,n),this.model=new vU(this.services),!r&&(this.model.setOptions(Ct(Et.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Om(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}class yU extends Gm{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(Et.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.DONUT})];return this.getChartComponents(t)}}class xU extends He{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(s=>[s[r],s.value===null?"&ndash;":s.value.toLocaleString()])]}}class bU extends Le{constructor(t,n){super(t,n),this.model=new xU(this.services),this.model.setOptions(Ct(Et.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new a$(this.model,this.services)];return this.getChartComponents(t)}}class EU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Cm(this.model,this.services),new Ir(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class SU extends Wn{constructor(t){super(t),this.axisFlavor=Ri.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==j.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==j.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==j.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==j.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),r=>r.value),n=Oe().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ce(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ce(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ce(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(s=>[s[n.identifier]===null?"&ndash;":s[n.identifier],s[r.identifier]===null?"&ndash;":s[r.identifier].toLocaleString(),s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ce(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=el().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Sm(this.getDisplayData(),l)}}class _U extends ie{constructor(t,n){super(t,n),this.model=new SU(this.services),this.model.setOptions(Ct(Et.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Hi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ar(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Zt(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"heatmap"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Zt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new vm(this.model,this.services),new ka(this.model,this.services),new Zt(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new se(this.model,this.services),new o$(this.model,this.services)];return this.getAxisChartComponents(t)}}class wU extends Wn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...r.map(s=>St(s,`0.${n}`))],...St(r,0).map((s,a)=>[`${St(s,"data.x0")} – ${St(s,"data.x1")}`,...r.map(o=>St(o[a],`data.${St(o[a],n)}`))])]}}class OU extends ie{constructor(t,n){super(t,n),this.model=new wU(this.services),this.model.setOptions(Ct(Et.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new e$(this.model,this.services),new l$(this.model,this.services)];return this.getAxisChartComponents(t)}}class TU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Rr(this.model,this.services),new Ge(this.model,this.services,{handleThresholds:!0}),new p$(this.model,this.services),new Ir(this.model,this.services)];return this.getAxisChartComponents(t)}}class MU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new c$(this.model,this.services),new Ge(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class CU extends He{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else{const l=x(s,"total");o=l||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])]}return a}}class AU extends Le{constructor(t,n){var i;super(t,n),this.model=new CU(this.services);const r=(i=n.options.meter)!=null&&i.proportional?tt(tn(Et.proportionalMeterChart),n.options):tt(tn(Et.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new n$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG},{id:"spacer",components:[new ln(this.model,this.services,{size:8})],growth:nt.STRETCH}]:[],{id:"meter-graph",components:[new u$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG}],r=[new Zt(this.model,this.services,n,{direction:bt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:Z.HTML})}}class DU extends Wn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(o=>o[r]);return[["Group",...s],...n.map(o=>[o.name,...s.map((l,c)=>x(o,"data",c,i)!==null?x(o,"data",c,i).toLocaleString():"&ndash;")])]}}class LU extends Le{constructor(t,n){super(t,n),this.model=new DU(this.services),this.model.setOptions(Ct(Et.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new f$(this.model,this.services)];return this.getChartComponents(t)}}class RU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Ge(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class IU extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class kU extends Le{constructor(t,n){super(t,n),this.model=new IU(this.services),this.model.setOptions(Ct(Et.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class $U extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):x(r.name)!==null&&x(r.value)&&n.push(["–",r.name,r.value])}),n}}class PU extends Le{constructor(t,n){super(t,n),this.model=new $U(this.services),this.model.setOptions(Ct(Et.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new zN(this.model,this.services)];return this.getChartComponents(t)}}class NU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Lm(this.model,this.services),new Ir(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class UU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new Rm(this.model,this.services),new Rr(this.model,this.services,{stacked:!0}),new km(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Kt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class BU extends ie{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new Im(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ}),new Ir(this.model,this.services)];return this.getAxisChartComponents(t)}}class VU extends He{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(o=>[o[i],o[s],o[r]])]}}class HU extends Le{constructor(t,n){super(t,n),this.model=new VU(this.services),this.model.setOptions(Ct(Et.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new uU(this.model,this.services),new Kt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}z.Alignments=It,z.AlluvialChart=Tk,z.AreaChart=Nk,z.AreaEvent=ec,z.ArrowDirections=pa,z.AxisEvent=tc,z.AxisFlavor=Ri,z.AxisPositions=F,z.AxisTitleOrientations=ga,z.BarEvent=sc,z.BoxplotChart=Vk,z.BoxplotEvent=ac,z.BubbleChart=Gk,z.BulletChart=Wk,z.CalloutDirections=Ci,z.CanvasZoomEvent=Jl,z.CartesianOrientations=Nt,z.ChartEvent=Xl,z.ChartTheme=fc,z.ChartTypes=ce,z.CirclePackChart=gU,z.ColorClassNameTypes=Q,z.ColorLegendType=Li,z.ComboChart=mU,z.DividerStatus=_r,z.DominantBaseline=Be,z.DonutChart=yU,z.ExperimentalChoroplethChart=fU,z.GaugeChart=bU,z.GaugeEvent=ic,z.GaugeTypes=Hn,z.GroupedBarChart=EU,z.HeatmapChart=_U,z.HistogramChart=OU,z.LayoutAlignItems=Vn,z.LayoutDirection=bt,z.LayoutGrowth=nt,z.LegendItemType=$t,z.LegendOrientations=Sr,z.LegendPositions=Er,z.LineChart=TU,z.LineEvent=lc,z.LollipopChart=MU,z.MeterChart=AU,z.ModalEvent=jl,z.ModelEvent=Zl,z.PieChart=Gm,z.PieEvent=rc,z.Projection=Ve,z.RadarChart=LU,z.RadarEvent=cc,z.RenderTypes=Z,z.ScaleTypes=j,z.ScatterChart=RU,z.ScatterEvent=oc,z.SimpleBarChart=NU,z.Skeletons=kt,z.StackedAreaChart=UU,z.StackedBarChart=BU,z.Statuses=Ai,z.TextAnchor=Ue,z.ThresholdEvent=dc,z.TickRotations=Di,z.ToolbarControlTypes=Mt,z.TooltipEvent=xr,z.TreeChart=kU,z.TreeEvent=uc,z.TreeTypes=fa,z.TreemapChart=PU,z.TreemapEvent=hc,z.TruncationTypes=ve,z.WordCloudChart=HU,z.WordCloudEvent=nc,z.ZoomBarTypes=Ae,z.ZoomDomainEvent=Ql,z.ZoombarEvent=Kl,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
84
84
  //# sourceMappingURL=bundle.umd.js.map