@carbon/charts 1.23.17 → 1.25.0
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.
- package/CHANGELOG.md +25 -0
- package/dist/{choropleth-CUIYpDaf.mjs → choropleth-BYCZIwGG.mjs} +938 -926
- package/dist/choropleth-BYCZIwGG.mjs.map +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/{index-BILVb6NZ.mjs → index-Bmzree89.mjs} +236 -235
- package/dist/{index-BILVb6NZ.mjs.map → index-Bmzree89.mjs.map} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/interfaces/components.d.ts +4 -0
- package/dist/services/index.mjs +1 -1
- package/dist/services/zoom.d.ts +1 -0
- package/dist/umd/bundle.umd.cjs +2 -2
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +2 -2
- package/package.json +2 -2
- package/dist/choropleth-CUIYpDaf.mjs.map +0 -1
package/dist/umd/bundle.umd.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
64
64
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
65
65
|
<rect width="32" height="32"/>
|
|
66
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ck extends Ze{constructor(t,n){super(t,n),this.model=new ok(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Mk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const rr=class rr extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(r,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();i.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(i,this.frontSelectionSelector);if(d&&u===it.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/rr.DASH_LENGTH),B=D*rr.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+rr.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=Ef().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=Fh().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();r.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=Wn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};rr.DASH_LENGTH=4;let Su=rr;class Ak extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Fh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),i=this.services.zoom.isZoomBarLoading(z.TOP),r=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===it.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}r&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-r/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),i=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(i).attr("d",g);r&&m.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=_n(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Vr()([[n,a],[i,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Dk extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new co}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f?.correspondingDatasets,mapsTo:f?.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===it.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Mn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(i),{code:a,number:o}=y(r,"locale");if(s===it.TIME){const l=[z.LEFT,z.RIGHT].includes(i),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(r,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,r.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=Wn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),l=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=y(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:i,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:i,hoveredElement:I(this),datum:I(this).datum()})})}}class Lk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new co,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Mn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class Zm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,l=r.getDomainLabel();let c=r.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=r.getRangeIdentifier(h);if(a){const g=r.getRangeAxisPosition({datum:h,groups:[h[o]]});c=r.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(i,"locale.translations.group")||yt(i,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[r.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(i,"tooltip","showTotal")===!0)){const h=r.getRangeIdentifier();d.push({label:yt(i,"locale.translations.total")||yt(i,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Ss(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Rk(e,t,n){const[i,r]=hi(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function Ik(e,t,n){const[i,r]=hi(n?.in,e,t),s=Ss(i,r),a=Math.abs(Rk(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Ss(i,r)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const i=$t(e,n?.in);if(isNaN(t))return ke(e,NaN);if(!t)return i;const r=i.getDate(),s=ke(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function jm(e,t,n){return _u(e,t*12,n)}function kk(e,t,n){return jm(e,-t,n)}function Pk(e,t,n){const[i,r]=hi(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function Nk(e,t){const n=$t(e,t?.in);return n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Fk(e,t){const n=$t(e,t?.in);return+Nk(n,t)==+$k(n,t)}function Uk(e,t,n){const[i,r,s]=hi(n?.in,e,e,t),a=Ss(r,s),o=Math.abs(Pk(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let l=Ss(r,s)===-a;Fk(i)&&o===1&&Ss(i,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Bk(e,t,n){return _u(e,-t,n)}function Hk(e,t,n){const[i,r]=hi(n?.in,e,t),s=Km(i,r),a=Math.abs(Jg(i,r));i.setDate(i.getDate()-s*a);const o=+(Km(i,r)===-s),l=s*(a-o);return l===0?0:l}function Km(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Qm(e,t,n){const i=$t(e,n?.in);return isNaN(t)?ke(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Gk(e,t,n){return Qm(e,-t,n)}function Tu(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function Vk(e,t,n){const[i,r]=hi(n?.in,e,t),s=(+i-+r)/Bg;return Tu(n?.roundingMethod)(s)}function Jm(e,t,n){return ke(e,+$t(e)+t)}function tv(e,t,n){return Jm(e,t*Bg)}function zk(e,t,n){return tv(e,-t)}function ev(e,t){return+$t(e)-+$t(t)}function nv(e,t,n){const i=ev(e,t)/Ug;return Tu(n?.roundingMethod)(i)}function Ou(e,t,n){const i=$t(e,n?.in);return i.setTime(i.getTime()+t*Ug),i}function iv(e,t,n){return Ou(e,-t,n)}function rv(e,t,n){const i=ev(e,t)/1e3;return Tu(n?.roundingMethod)(i)}function wu(e,t,n){return Jm(e,t*1e3)}function sv(e,t,n){return wu(e,-t)}class Wk extends An{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=y(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r?.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=y(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s?.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const i=this.getAxisOptions(t).title;return i||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[z.LEFT]?.correspondingDatasets&&n[z.RIGHT]||n[z.RIGHT]?.correspondingDatasets&&n[z.LEFT]||n[z.TOP]?.correspondingDatasets&&n[z.BOTTOM]||n[z.BOTTOM]?.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===it.LINEAR||this.scaleTypes[t]===it.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=y(r,l)!==null?r[l]:r;let u;switch(n){case it.LABELS:u=t(c)+t.step()/2;break;case it.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[r(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=y(i,"axes",t);if(r.scaleType===it.TIME){const s=y(i,"timeScale","addSpaceOnEdges");return Yk(n,s)}else return qk(n,Fn.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||i&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||i&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=y(i,"axes",t.primary),s=y(i,"axes",n.primary),a=r.scaleType||it.LINEAR,o=s.scaleType||it.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===it.LABELS||o===it.TIME)&&a===it.LABELS||a===it.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),i=y(n,"axes",t),r=y(n,"bounds"),{includeZero:s}=i,a=y(i,"scaleType")||it.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,zn(v,S=>S.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=i,{reference:h,compareTo:f}=Fn.ratio;if(i.domain)return a===it.LABELS?i.domain:(a===it.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===it.LABELS)return ns(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===it.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===it.TIME)g=o.map(v=>+new Date(v[c]));else if(r&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[r.upperBoundMapsTo]&&g.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&g.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(nL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==it.TIME&&a!==it.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=y(n,"axes",t);if(!i)return null;const r=y(i,"scaleType")||it.LINEAR;this.scaleTypes[t]=r;let s;return r===it.TIME?s=Ef():r===it.LOG?s=Jd().base(i.base||10):r===it.LABELS||r===it.LABELS_RATIO?s=Nr():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,i=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(i=n[0]),i}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===it.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}}function Yk(e,t){const n=new Date(e[0]),i=new Date(e[1]);return Ik(i,n)>1?[kk(n,t),jm(i,t)]:Uk(i,n)>1?[Bk(n,t),_u(i,t)]:Hk(i,n)>1?[Gk(n,t),Qm(i,t)]:Vk(i,n)>1?[zk(n,t),tv(i,t)]:nv(i,n)>30?[iv(n,t*30),Ou(i,t*30)]:nv(i,n)>1?[iv(n,t),Ou(i,t)]:rv(i,n)>15?[sv(n,t*15),wu(i,t*15)]:rv(i,n)>1?[sv(n,t),wu(i,t)]:[n,i]}function qk([e,t],n,i){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(i===it.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class Xk extends An{constructor(){super(...arguments),this.curveTypes={curveLinear:wa,curveLinearClosed:Rf,curveBasis:K_,curveBasisClosed:Q_,curveBasisOpen:J_,curveBundle:tT,curveCardinal:eT,curveCardinalClosed:nT,curveCardinalOpen:iT,curveCatmullRom:rT,curveCatmullRomClosed:sT,curveCatmullRomOpen:aT,curveMonotoneX:oT,curveMonotoneY:lT,curveNatural:cT,curveStep:uT,curveStepAfter:dT,curveStepBefore:hT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Zk extends An{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===it.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const i=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const a=r.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=i[0]&&new Date(l[a])<=i[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),i=Se.handleWidth,r=this.services.cartesianScales?.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(n[0]),a=r(n[1]);if(a-s<i+1)return;const o=r.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-i/2,d=a-l/2+i/2);const h=[r.invert(u),r.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(r-o,a[0]),c=Math.min(s+o,a[1]),u=[i.invert(l),i.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:Wk,curves:Xk,zoom:Zk}),this.model=new pi(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"zoomBar",z.TOP,"enabled"),s=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(i,"axes",a,"scaleType"),l=r&&a===z.BOTTOM&&o===it.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new xs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new ce(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Fm(this.model,this.services),new Su(this.model,this.services)),t.push(new Dk(this.model,this.services)),t.push(new Lk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yi.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qi.VERTICAL)):_===Yi.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qi.VERTICAL)):_===Yi.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new ce(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ak(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new Zm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),i=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Mo(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Gu(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(wn(u).tx)-Number(wn(d).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+wn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let l;if(!a)l=+wn(o).tx;else if(o)l=+wn(o).tx-+wn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+wn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=wn(this),o={min:Number(a.tx)-i,max:Number(a.tx)+i};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(i,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class av extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Tn.opacity.unselected:Tn.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",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(i,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(i,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),r),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(r=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),r),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(i,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}bs.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:bs.getStops(r,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:Tn.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",Tn.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class er extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=this.model.get("zoomDomain")!==void 0,r=n&&i?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=v=>s.getDomainValue(v),l=v=>s.getRangeValue(v),[c,u]=Mn(o,l,s.getOrientation()),d=this.getOptions(),h=Vr().x(c).y(u).curve(a.getD3Curve()).defined(v=>{const S=s.getRangeIdentifier(v),E=v[S];return E!=null});let f=[];if(this.configs.stacked){const v=Object.keys(d.axes).some(b=>d.axes[b].percentage),{groupMapsTo:S}=d.data;f=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(b=>{const x=this.services.cartesianScales.getDomainIdentifier(b),_=this.services.cartesianScales.getRangeIdentifier(b);return{name:y(b,0,S),data:b.map(C=>({[x]:C.data.sharedStackKey,[S]:C[S],[_]:C[1]})),hidden:!rL(b,C=>C[0]!==C[1])}})}else f=this.model.getGroupedData(this.configs.groups);const p=r.selectAll("path.line").data(f,v=>v.name);p.exit().attr("opacity",0).remove();const m=p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(f,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name,null,v.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:S}=v;return S.map(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]}).join(",")});if(n&&i){const v=s.getMainXScale(),S=s.getMainYScale();if(v&&S){const[E,b]=v.range(),[x,_]=S.range();r.style("overflow","hidden").style("clip",`rect(${_}px, ${b}px, ${x}px, ${E}px)`)}}m.transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:t})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:S}=v;return h(S)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const ov=5;function jk(e,t){return e>t-ov&&e<t+ov}class Hn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?i:n,d=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>jk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Tg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=Wn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=hL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-hover-scatter"})).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>this.services.transitions?.setupTransition({transition:r,name:"legend-hover-scatter"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"legend-mouseout-scatter"})).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=i.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=Mn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,l]=Mn(d=>i.getDomainValue(d),d=>i.getRangeValue(d),r),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Mn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>this.services.transitions?.setupTransition({transition:f,name:"scatter-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,r){const s=I(this);s.classed("hovered",!0).attr("class",a=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:a[n],originalClassName:s.attr("class")})).style("fill",a=>{const o=t.services.cartesianScales?.getDomainIdentifier(a);return t.model.getFillColor(a[n],a[o],a)}).classed("unfilled",!1),t.services.events?.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:s,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:i,element:s,datum:r})}).on("mousemove",function(i,r){const s=I(this);t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events?.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events?.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:a}=t.getOptions().points,o=t.services.cartesianScales?.getDomainIdentifier(r),l=t.model.getIsFilled(r[n],r[o],r,a);s.classed("unfilled",!l).style("fill",c=>l||a?t.model.getFillColor(c[n],c[o],c):null)}t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events?.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class lv extends mt{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=y(i,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===it.LABELS||this.scaleType===it.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Gu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=x0;break;case z.TOP:h=E0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(i,"axes",n),v=this.scaleType===it.TIME||m.scaleType===it.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!r){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(i,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(i,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||it.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=Fn.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,Fn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(i,"timeScale","addSpaceOnEdges"),ht=y(i,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(i,"locale");if(v){const K=nu(F.tickValues(),y(i,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,i.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,i.locale);return U(nt,ht,W)}}else U===null?$===it.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===it.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===Xa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===Xa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(i,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>lm(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ss.ALWAYS)K=!0;else if(nt===ss.NEVER)K=!1;else if(!nt||nt===ss.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(wn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,Fn.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===it.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,cs(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?cs(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return Hp(r,2,Fn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class Kk extends lv{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer({ariaLabel:"axes"}),r=k.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Fn.hover.rectanglePadding).attr("y",p).attr("width",u+Fn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===it.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(z),r=y(this.getOptions(),"axes");i.forEach(o=>{r[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,i.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===os.DEFAULT?new lv(this.model,this.services,c):new Kk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ue extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",i).attr("height",r);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=y(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=k.getSVGElementSize(r,{useAttrs:!0}),o=k.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a).attr("role","presentation"),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Gr().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
66
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ck extends Ze{constructor(t,n){super(t,n),this.model=new ok(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Mk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const rr=class rr extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(r,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();i.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(i,this.frontSelectionSelector);if(d&&u===it.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/rr.DASH_LENGTH),B=D*rr.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+rr.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=Ef().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)],B="manual";D[0].valueOf()===D[1].valueOf()?(D=this.services.zoom.getDefaultZoomBarDomain(),B="reset"):B="manual",(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D,{dispatchEvent:!0,type:B})};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=Fh().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();r.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=Wn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};rr.DASH_LENGTH=4;let Su=rr;class Ak extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Fh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),i=this.services.zoom.isZoomBarLoading(z.TOP),r=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===it.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}r&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){let a="manual";if(n&&n[0]&&n[1]){const l=this.services.zoom.getDefaultZoomBarDomain();s[0].valueOf()===l[0].valueOf()&&s[1].valueOf()===l[1].valueOf()?a="reset":a="manual"}(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1,type:a});let o;t.type==="start"?o=T.ZoomBar.SELECTION_START:t.type==="brush"?o=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(o=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s,type:a})),this.services.events.dispatchEvent(o,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-r/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),i=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(i).attr("d",g);r&&m.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=_n(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Vr()([[n,a],[i,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Dk extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new co}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f?.correspondingDatasets,mapsTo:f?.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===it.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Mn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(i),{code:a,number:o}=y(r,"locale");if(s===it.TIME){const l=[z.LEFT,z.RIGHT].includes(i),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(r,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,r.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=Wn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),l=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=y(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:i,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:i,hoveredElement:I(this),datum:I(this).datum()})})}}class Lk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new co,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Mn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class Zm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,l=r.getDomainLabel();let c=r.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=r.getRangeIdentifier(h);if(a){const g=r.getRangeAxisPosition({datum:h,groups:[h[o]]});c=r.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(i,"locale.translations.group")||yt(i,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[r.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(i,"tooltip","showTotal")===!0)){const h=r.getRangeIdentifier();d.push({label:yt(i,"locale.translations.total")||yt(i,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Ss(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Rk(e,t,n){const[i,r]=hi(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function Ik(e,t,n){const[i,r]=hi(n?.in,e,t),s=Ss(i,r),a=Math.abs(Rk(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Ss(i,r)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const i=$t(e,n?.in);if(isNaN(t))return ke(e,NaN);if(!t)return i;const r=i.getDate(),s=ke(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function jm(e,t,n){return _u(e,t*12,n)}function kk(e,t,n){return jm(e,-t,n)}function Pk(e,t,n){const[i,r]=hi(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function Nk(e,t){const n=$t(e,t?.in);return n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Fk(e,t){const n=$t(e,t?.in);return+Nk(n,t)==+$k(n,t)}function Uk(e,t,n){const[i,r,s]=hi(n?.in,e,e,t),a=Ss(r,s),o=Math.abs(Pk(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let l=Ss(r,s)===-a;Fk(i)&&o===1&&Ss(i,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Bk(e,t,n){return _u(e,-t,n)}function Hk(e,t,n){const[i,r]=hi(n?.in,e,t),s=Km(i,r),a=Math.abs(Jg(i,r));i.setDate(i.getDate()-s*a);const o=+(Km(i,r)===-s),l=s*(a-o);return l===0?0:l}function Km(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Qm(e,t,n){const i=$t(e,n?.in);return isNaN(t)?ke(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Gk(e,t,n){return Qm(e,-t,n)}function Tu(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function Vk(e,t,n){const[i,r]=hi(n?.in,e,t),s=(+i-+r)/Bg;return Tu(n?.roundingMethod)(s)}function Jm(e,t,n){return ke(e,+$t(e)+t)}function tv(e,t,n){return Jm(e,t*Bg)}function zk(e,t,n){return tv(e,-t)}function ev(e,t){return+$t(e)-+$t(t)}function nv(e,t,n){const i=ev(e,t)/Ug;return Tu(n?.roundingMethod)(i)}function Ou(e,t,n){const i=$t(e,n?.in);return i.setTime(i.getTime()+t*Ug),i}function iv(e,t,n){return Ou(e,-t,n)}function rv(e,t,n){const i=ev(e,t)/1e3;return Tu(n?.roundingMethod)(i)}function wu(e,t,n){return Jm(e,t*1e3)}function sv(e,t,n){return wu(e,-t)}class Wk extends An{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=y(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r?.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=y(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s?.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const i=this.getAxisOptions(t).title;return i||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[z.LEFT]?.correspondingDatasets&&n[z.RIGHT]||n[z.RIGHT]?.correspondingDatasets&&n[z.LEFT]||n[z.TOP]?.correspondingDatasets&&n[z.BOTTOM]||n[z.BOTTOM]?.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===it.LINEAR||this.scaleTypes[t]===it.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=y(r,l)!==null?r[l]:r;let u;switch(n){case it.LABELS:u=t(c)+t.step()/2;break;case it.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[r(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=y(i,"axes",t);if(r.scaleType===it.TIME){const s=y(i,"timeScale","addSpaceOnEdges");return Yk(n,s)}else return qk(n,Fn.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||i&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||i&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=y(i,"axes",t.primary),s=y(i,"axes",n.primary),a=r.scaleType||it.LINEAR,o=s.scaleType||it.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===it.LABELS||o===it.TIME)&&a===it.LABELS||a===it.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),i=y(n,"axes",t),r=y(n,"bounds"),{includeZero:s}=i,a=y(i,"scaleType")||it.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,zn(v,S=>S.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=i,{reference:h,compareTo:f}=Fn.ratio;if(i.domain)return a===it.LABELS?i.domain:(a===it.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===it.LABELS)return ns(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===it.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===it.TIME)g=o.map(v=>+new Date(v[c]));else if(r&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[r.upperBoundMapsTo]&&g.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&g.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(nL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==it.TIME&&a!==it.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=y(n,"axes",t);if(!i)return null;const r=y(i,"scaleType")||it.LINEAR;this.scaleTypes[t]=r;let s;return r===it.TIME?s=Ef():r===it.LOG?s=Jd().base(i.base||10):r===it.LABELS||r===it.LABELS_RATIO?s=Nr():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,i=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(i=n[0]),i}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===it.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}}function Yk(e,t){const n=new Date(e[0]),i=new Date(e[1]);return Ik(i,n)>1?[kk(n,t),jm(i,t)]:Uk(i,n)>1?[Bk(n,t),_u(i,t)]:Hk(i,n)>1?[Gk(n,t),Qm(i,t)]:Vk(i,n)>1?[zk(n,t),tv(i,t)]:nv(i,n)>30?[iv(n,t*30),Ou(i,t*30)]:nv(i,n)>1?[iv(n,t),Ou(i,t)]:rv(i,n)>15?[sv(n,t*15),wu(i,t*15)]:rv(i,n)>1?[sv(n,t),wu(i,t)]:[n,i]}function qk([e,t],n,i){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(i===it.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class Xk extends An{constructor(){super(...arguments),this.curveTypes={curveLinear:wa,curveLinearClosed:Rf,curveBasis:K_,curveBasisClosed:Q_,curveBasisOpen:J_,curveBundle:tT,curveCardinal:eT,curveCardinalClosed:nT,curveCardinalOpen:iT,curveCatmullRom:rT,curveCatmullRomClosed:sT,curveCatmullRomOpen:aT,curveMonotoneX:oT,curveMonotoneY:lT,curveNatural:cT,curveStep:uT,curveStepAfter:dT,curveStepBefore:hT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Zk extends An{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===it.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t,type:n.type})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const i=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const a=r.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=i[0]&&new Date(l[a])<=i[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),i=Se.handleWidth,r=this.services.cartesianScales?.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(n[0]),a=r(n[1]);if(a-s<i+1)return;const o=r.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-i/2,d=a-l/2+i/2);const h=[r.invert(u),r.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h,{dispatchEvent:!0,type:"in"})}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(r-o,a[0]),c=Math.min(s+o,a[1]),u=[i.invert(l),i.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u,{dispatchEvent:!0,type:"out"})}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n,{dispatchEvent:!0,type:"reset"})}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:Wk,curves:Xk,zoom:Zk}),this.model=new pi(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"zoomBar",z.TOP,"enabled"),s=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(i,"axes",a,"scaleType"),l=r&&a===z.BOTTOM&&o===it.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new xs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new ce(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Fm(this.model,this.services),new Su(this.model,this.services)),t.push(new Dk(this.model,this.services)),t.push(new Lk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yi.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qi.VERTICAL)):_===Yi.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qi.VERTICAL)):_===Yi.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new ce(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ak(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new Zm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),i=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Mo(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Gu(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(wn(u).tx)-Number(wn(d).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+wn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let l;if(!a)l=+wn(o).tx;else if(o)l=+wn(o).tx-+wn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+wn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=wn(this),o={min:Number(a.tx)-i,max:Number(a.tx)+i};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(i,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class av extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Tn.opacity.unselected:Tn.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",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(i,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(i,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),r),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(r=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),r),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(i,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}bs.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:bs.getStops(r,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:Tn.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",Tn.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class er extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=this.model.get("zoomDomain")!==void 0,r=n&&i?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=v=>s.getDomainValue(v),l=v=>s.getRangeValue(v),[c,u]=Mn(o,l,s.getOrientation()),d=this.getOptions(),h=Vr().x(c).y(u).curve(a.getD3Curve()).defined(v=>{const S=s.getRangeIdentifier(v),E=v[S];return E!=null});let f=[];if(this.configs.stacked){const v=Object.keys(d.axes).some(b=>d.axes[b].percentage),{groupMapsTo:S}=d.data;f=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(b=>{const x=this.services.cartesianScales.getDomainIdentifier(b),_=this.services.cartesianScales.getRangeIdentifier(b);return{name:y(b,0,S),data:b.map(C=>({[x]:C.data.sharedStackKey,[S]:C[S],[_]:C[1]})),hidden:!rL(b,C=>C[0]!==C[1])}})}else f=this.model.getGroupedData(this.configs.groups);const p=r.selectAll("path.line").data(f,v=>v.name);p.exit().attr("opacity",0).remove();const m=p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(f,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name,null,v.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:S}=v;return S.map(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]}).join(",")});if(n&&i){const v=s.getMainXScale(),S=s.getMainYScale();if(v&&S){const[E,b]=v.range(),[x,_]=S.range();r.style("overflow","hidden").style("clip",`rect(${_}px, ${b}px, ${x}px, ${E}px)`)}}m.transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:t})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:S}=v;return h(S)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const ov=5;function jk(e,t){return e>t-ov&&e<t+ov}class Hn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled"),i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=n||i;this.drawBackdrop(),r&&!this.isEventListenerAdded?this.addBackdropEventListeners():!r&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?i:n,d=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>jk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Tg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=Wn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=hL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-hover-scatter"})).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>this.services.transitions?.setupTransition({transition:r,name:"legend-hover-scatter"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"legend-mouseout-scatter"})).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=i.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=Mn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,l]=Mn(d=>i.getDomainValue(d),d=>i.getRangeValue(d),r),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Mn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>this.services.transitions?.setupTransition({transition:f,name:"scatter-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data,i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const r=this.parent.selectAll("circle");i?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{const c=t.services.cartesianScales?.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),i||t.services.events?.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,data:[a],additionalItems:t.getTooltipAdditionalItems(a)}),t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events?.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);if(o.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,c=t.services.cartesianScales?.getDomainIdentifier(a),u=t.model.getIsFilled(a[n],a[c],a,l);o.classed("unfilled",!u).style("fill",d=>u||l?t.model.getFillColor(d[n],d[c],d):null)}t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class lv extends mt{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=y(i,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===it.LABELS||this.scaleType===it.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Gu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=x0;break;case z.TOP:h=E0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(i,"axes",n),v=this.scaleType===it.TIME||m.scaleType===it.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!r){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(i,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(i,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||it.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=Fn.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,Fn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(i,"timeScale","addSpaceOnEdges"),ht=y(i,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(i,"locale");if(v){const K=nu(F.tickValues(),y(i,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,i.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,i.locale);return U(nt,ht,W)}}else U===null?$===it.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===it.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===Xa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===Xa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(i,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>lm(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ss.ALWAYS)K=!0;else if(nt===ss.NEVER)K=!1;else if(!nt||nt===ss.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(wn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,Fn.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===it.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,cs(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?cs(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return Hp(r,2,Fn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class Kk extends lv{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer({ariaLabel:"axes"}),r=k.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Fn.hover.rectanglePadding).attr("y",p).attr("width",u+Fn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===it.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(z),r=y(this.getOptions(),"axes");i.forEach(o=>{r[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,i.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===os.DEFAULT?new lv(this.model,this.services,c):new Kk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ue extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",i).attr("height",r);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=y(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=k.getSVGElementSize(r,{useAttrs:!0}),o=k.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a).attr("role","presentation"),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Gr().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
67
67
|
<stop class="${s}" offset="${c}"></stop>
|
|
68
68
|
<stop class="${a}" offset="${c+.2}"></stop>
|
|
69
69
|
<stop class="${s}" offset="${c+2*.2}"></stop>
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
72
72
|
<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"/>
|
|
73
73
|
<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"/>
|
|
74
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=I(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(i.children){i.depth>1&&o&&(l=!0,r.classed("clickable",!0)),c=i.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:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else d=i.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:h,label:i.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=I(this),s=r.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,Zi),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function E2(e,t){const n=mr(this._current,e);return i=>(this._current=n(i),t(this._current))}class fv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"pie graph"}),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Gr().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Gr().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=H_().value(M=>M[a]).sort(y(r,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(i,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>[M[a],Zc(M.data[a],o,a)+"%",M.data[s]].filter(Boolean).join(", ")).attrTween("d",function(M){return E2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(r,"locale"),v=r.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(i,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,M=>M.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),_=[];x.merge(b).style("text-anchor","middle").text(M=>r.pie.labels.formatter?r.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=is.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=is.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(r,"donut")?"donut":"pie",D=y(r,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),i.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===is.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(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),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(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,i){const r=I(this);t.isRendering||r.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(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);$D(()=>{t.isRendering||r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+Lt.radiusOffset:r}}class x2 extends fv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const i=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=y(r,"donut","center","label");k.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.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(I(this))}),a!==null&&a!==""&&k.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=y(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=mh:s=Ee;const a=s(r,i);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const pv="4,10 8,6 12,10",gv="12,6 8,10 4,6";class b2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){return this.model.getData().find(i=>i.group==="value")?.value??null}getValueRatio(){return Hp(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(i=>i.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===ci.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(y(n,"gauge","deltaArrow","direction")){case qa.UP:return pv;case qa.DOWN:return gv;default:return t>0?pv:gv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),i=this.getOptions(),r=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=Gr().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Gr().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(i,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=y(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;i===ci.FULL&&!s?d=l(a):i===ci.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([r]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta(),{code:s,number:a}=y(i,"locale");if(r){const o=this.computeRadius(),l=r?y(i,"gauge","deltaFontSize"):()=>0,c=r?y(i,"gauge","numberFormatter"):()=>null,u=y(i,"gauge","deltaArrow","size"),d=y(i,"gauge","numberSpacing"),h=y(i,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(r===null?[]:[r]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(i,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(r!==null&&S?[r]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(i,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(r))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===ci.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class mv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ns(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",ft.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()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[r]);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:[lt.FILL],dataGroupName:h[r],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[r],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[r]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return se({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.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,i){const r=I(this);r.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(i=>{const r=this.services.cartesianScales.getDomainIdentifier(i);return i[r].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 i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>s.data?.length>1);if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}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=y(t,"bars","width"),i=y(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Nr().domain(t).rangeRound([0,this.getGroupWidth()])}}class S2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=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[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const g=this.matrix[i][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][i].value=="number"){const g=this.matrix[p][i].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(i)}, ${Pn(c.range())})`):c(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(i)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:i,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(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=r.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(${r(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=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).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,i){const r=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),k.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),k.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xi.OFF&&(t===Xi.AUTO&&Ig.minCellDividerDimension<=this.xBandwidth&&Ig.minCellDividerDimension<=this.yBandwidth||t===Xi.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=yt(i,"locale.translations.total")||yt(i,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ls(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(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:r,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class _2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.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(r,(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:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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 m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),se({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:i,number:r}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=r(parseFloat(yt(o,"data.x0")),i),u=r(parseFloat(yt(o,"data.x1")),i),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class T2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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[r]!==n.datum().name?On.opacity.unselected:On.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",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[r]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[r],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[r],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-i.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class O2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let i=0;return t.map((s,a)=>a!==0?(i+=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:i-n(s.value)}):(i=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"meter lines"}),r=this.getOptions(),s=y(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:c}=r.data;let u;if(y(r,"meter","proportional")===null)u=100;else{const E=y(r,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(r,"meter","height");k.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),k.appendOrSelect(i,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.height.default));const p=i.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",E=>E.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(r,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=i.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function vv(e){const t=w2(yv(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Gn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Gn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Gn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Gn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Gn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Gn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function w2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function yv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function M2(e,t){return t*Math.sin(e-Math.PI/2)}class C2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=k.appendOrSelect(n,"text").text(t),{width:r,height:s}=k.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=HD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[i]:o,[s]:l,[r]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[i]:c,[r]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?ui.opacity.unselected:ui.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?ui.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",ui.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=ui;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(i,r)-S)/2;if(x<=0)return;const _=Nr().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=Pn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,zn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=z_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Rf),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=M2(_(A),x);return G+V}),M={x:zn(H)+h,y:r/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vi(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>vv(_(G)).textAnchor).style("dominant-baseline",G=>vv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",ui.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vi(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${yv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-r.width)/2):t===Gt.RIGHT&&(a=s-r.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Vi(r)}`),o=t.parent.selectAll(`.dots circle.${Vi(r)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(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",ui.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===r&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vi(r)}`),o=t.parent.selectAll(`.dots circle.${Vi(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class Ev extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);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:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[i],c[u],c)}).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,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return se({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.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,i){const r=I(this);r.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class A2 extends ue{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),i=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?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"),i=[100],r=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.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=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class xv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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=>y(s,0,r)!==n.datum().name?Tn.opacity.unselected:Tn.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",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(p=>r.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(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=>y(p,0,s));this.areaGenerator=Yl().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=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>i.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class bv extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.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:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r],c.data.sharedStackKey,c.data)).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)>i.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return se({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.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,i=this;this.parent.selectAll("path.bar").on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),i.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s});let l=i.model.getDisplayData(i.configs.groups).find(c=>{const u=i.services.cartesianScales.getDomainIdentifier(c),d=i.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=i.services.cartesianScales.getDomainIdentifier(),u=i.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,data:[l]})}).on("mousemove",function(r,s){const a=I(this);i.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){i.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),i.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Sv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=i.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.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),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(l=>i.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[r],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=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({[r]:h,[m]:f,[v]: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[r]==l[r]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ir=6;class D2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=k.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+ir:30-ir},h=Ir({name:o,children:a}),f=10,p=i/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,i,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-ir:ir).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Ya.DENDROGRAM?hb().size([r,i-u-v*ir-l]):Qb().nodeSize([f,p]).size([r,i-u-v*ir-l]),E=j_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),S(h),n.attr("viewBox",[-d.left,-0,i,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var L2="#000000",R2="#ffffff",I2="#fcf4d6",k2="#fddc69",P2="#f1c21b",N2="#d2a106",$2="#b28600",F2="#8e6a00",U2="#684e00",B2="#483700",H2="#302400",G2="#1c1500",V2={10:I2,20:k2,30:P2,40:N2,50:$2,60:F2,70:U2,80:B2,90:H2,100:G2},z2="#fff2e8",W2="#ffd9be",Y2="#ffb784",q2="#ff832b",X2="#eb6200",Z2="#ba4e00",j2="#8a3800",K2="#5e2900",Q2="#3e1a00",J2="#231000",tP={10:z2,20:W2,30:Y2,40:q2,50:X2,60:Z2,70:j2,80:K2,90:Q2,100:J2},eP="#fff1f1",nP="#ffd7d9",iP="#ffb3b8",rP="#ff8389",sP="#fa4d56",aP="#da1e28",oP="#a2191f",lP="#750e13",cP="#520408",uP="#2d0709",hP={10:eP,20:nP,30:iP,40:rP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#fff0f7",fP="#ffd6e8",pP="#ffafd2",gP="#ff7eb6",mP="#ee5396",vP="#d02670",yP="#9f1853",EP="#740937",xP="#510224",bP="#2a0a18",SP={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:EP,90:xP,100:bP},_P="#f6f2ff",TP="#e8daff",OP="#d4bbff",wP="#be95ff",MP="#a56eff",CP="#8a3ffc",AP="#6929c4",DP="#491d8b",LP="#31135e",RP="#1c0f30",IP={10:_P,20:TP,30:OP,40:wP,50:MP,60:CP,70:AP,80:DP,90:LP,100:RP},kP="#edf5ff",PP="#d0e2ff",NP="#a6c8ff",$P="#78a9ff",FP="#4589ff",UP="#0f62fe",BP="#0043ce",HP="#002d9c",GP="#001d6c",VP="#001141",zP={10:kP,20:PP,30:NP,40:$P,50:FP,60:UP,70:BP,80:HP,90:GP,100:VP},WP="#e5f6ff",YP="#bae6ff",qP="#82cfff",XP="#33b1ff",ZP="#1192e8",jP="#0072c3",KP="#00539a",QP="#003a6d",JP="#012749",tN="#061727",eN={10:WP,20:YP,30:qP,40:XP,50:ZP,60:jP,70:KP,80:QP,90:JP,100:tN},nN="#d9fbfb",iN="#9ef0f0",rN="#3ddbd9",sN="#08bdba",aN="#009d9a",oN="#007d79",lN="#005d5d",cN="#004144",uN="#022b30",hN="#081a1c",dN={10:nN,20:iN,30:rN,40:sN,50:aN,60:oN,70:lN,80:cN,90:uN,100:hN},fN="#defbe6",pN="#a7f0ba",gN="#6fdc8c",mN="#42be65",vN="#24a148",yN="#198038",EN="#0e6027",xN="#044317",bN="#022d0d",SN="#071908",_N={10:fN,20:pN,30:gN,40:mN,50:vN,60:yN,70:EN,80:xN,90:bN,100:SN},TN="#f2f4f8",ON="#dde1e6",wN="#c1c7cd",MN="#a2a9b0",CN="#878d96",AN="#697077",DN="#4d5358",LN="#343a3f",RN="#21272a",IN="#121619",kN={10:TN,20:ON,30:wN,40:MN,50:CN,60:AN,70:DN,80:LN,90:RN,100:IN},PN="#f4f4f4",NN="#e0e0e0",$N="#c6c6c6",FN="#a8a8a8",UN="#8d8d8d",BN="#6f6f6f",HN="#525252",GN="#393939",VN="#262626",zN="#161616",WN={10:PN,20:NN,30:$N,40:FN,50:UN,60:BN,70:HN,80:GN,90:VN,100:zN},YN="#f7f3f2",qN="#e5e0df",XN="#cac5c4",ZN="#ada8a8",jN="#8f8b8b",KN="#726e6e",QN="#565151",JN="#3c3838",t$="#272525",e$="#171414",n$={10:YN,20:qN,30:XN,40:ZN,50:jN,60:KN,70:QN,80:JN,90:t$,100:e$},_v={black:{100:L2},blue:zP,coolGray:kN,cyan:eN,gray:WN,green:_N,magenta:SP,orange:tP,purple:IP,red:hP,teal:dN,warmGray:n$,white:{0:R2},yellow:V2};const i$=e=>{if(!e)return null;for(const t of Object.keys(_v)){const n=_v[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},Tv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),i=hn(n);let r;if(i&&(r=i$(i?i.hex():null)),r==null){const s=dh(i).l;r=Math.abs(s*100-100)}return r>50?"white":"black"};let r$=0;class s$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Ir({name:r.title||"Treemap",children:i}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=iS().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",()=>r$++).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=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.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,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${r.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Tv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${r.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Tv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.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,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.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,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}}function a$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var l$={value:function(){}};function Ov(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new po(n)}function po(e){this._=e}function c$(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}po.prototype=Ov.prototype={constructor:po,on:function(e,t){var n=this._,i=c$(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=u$(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=wv(n[r],e.name,t);else if(t==null)for(r in n)n[r]=wv(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function u$(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function wv(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=l$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}const h$=o$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Ov},Symbol.toStringTag,{value:"Module"})));var Au,Mv;function d$(){if(Mv)return Au;Mv=1;const e=h$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},i=64,r=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(i<<5)/ut,Y.height=r/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,_s=(Q.y+Q.y0)*Ut+(st>>5),Ts,mi=0;mi<Oe;mi++){Ts=0;for(var je=0;je<=xt;je++)Y[_s+je]|=Ts<<Ne|(je<xt?(Ts=V[mi*xt+je])>>>_t:0);_s+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,_,C){if(!x.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(i<<5)/B,r/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){x=_[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=i<<5&&(P=0,w+=H,H=0),w+V>=r)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,0)),D.restore(),x.width=G,x.height=V,x.xoff=P,x.yoff=w,x.x1=G>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(i<<5)/B,r/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(i<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])return!0;N+=_}return!1}function f(b,x){var _=b[0],C=b[1];x.x+x.x0<_.x&&(_.x=x.x+x.x0),x.y+x.y0<_.y&&(_.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(_){return[x*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var x=4,_=x*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=x;break;case 2:C-=_;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],_=-1;++_<b;)x[_]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var f$=d$();const p$=a$(f$);class g$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(i,{useAttrs:!0});if(u===0||d===0)return;const h=p$().size([u,d]).words(r.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=k.appendOrSelect(i,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(l=>l[i]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?Fe(r):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=Wa(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.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;r(o),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:i.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r(null),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class m$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=p2(s,Object.values(l)),u=h2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=r.fitSize([n,i],u),h=$x().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.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",Vr()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=nb();break;case an.geoAlbers:t=Zx();break;case an.geoConicEqualArea:t=Rd();break;case an.geoConicEquidistant:t=tb();break;case an.geoEquirectangular:t=Qx();break;case an.geoMercator:t=jx();break;case an.geoNaturalEarth1:t=ib();break;default:throw new Error("Projection is not supported.")}return t}}class v$ extends m${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),i=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),r=y(this.getOptions(),"color"),s=y(r,"gradient","colors");i.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEMOVE,{event:i,element:I(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(Wi.CHOROPLETH_CLICK,{event:i,element:I(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=I(this);t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.HIDE,{event:i,hoveredElement:s})})}}class Cv extends Ze{constructor(t,n){super(t,n),this.model=new o2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new xs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new dv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new v$(this.model,this.services)];return this.getChartComponents(t)}}class y$ extends on{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(),i=ct({},t,this.getZoomOptions(t));jc(n,i);const r=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.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:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,i)])}),super.formatTable({headers:r,cells:s})}getChildrenDatums(t,n,i=[],r=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(r+=l.value),u+=this.getChildrenDatums(l.children,c,i,u),i.push([c,s,a(u,o)]),r+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,r+=l.value),i.push([l.name,s,a(d,o)])}}),r}}class E$ extends Ze{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new y2(this.model,this.services)];return this.getChartComponents(t)}}const Av={[be.LINE]:[er,cn],[be.SCATTER]:[cn],[be.AREA]:[av,er,cn],[be.STACKED_AREA]:[xv,er,Sv,fo],[be.SIMPLE_BAR]:[Ev],[be.GROUPED_BAR]:[mv,nr],[be.STACKED_BAR]:[bv,fo]};class x$ extends ge{constructor(t,n){super(t,n);const i=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Av).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${oC(r.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),r.options),r.type===be.STACKED_AREA&&(o=!0),Av[r.type].map(c=>new c(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return fc(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),i=[new me(this.model,this.services),new Te(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Hn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class b$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{valueMapsTo:r}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[i],c[r]===null?"–":s(c[r],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((i,r)=>r.value-i.value)}}class Dv extends Ze{constructor(t,n,i=!1){super(t,n),this.model=new b$(this.services),!i&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new fv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class S$ extends Dv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class _$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{number:r,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[i],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class T$ extends Ze{constructor(t,n){super(t,n),this.model=new _$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services)];return this.getChartComponents(t)}}class O$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new mv(this.model,this.services),new nr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class w$ extends pi{constructor(t){super(t),this.axisFlavor=os.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==it.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==it.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==it.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==it.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),i=>i.value),n=Ge().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(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=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[i]=a,l[r]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains(),{number:r,code:s}=y(this.getOptions(),"locale"),a=[n.label,i.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[i.identifier]===null?"–":l[i.identifier],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),i=!We(n);let r=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=uv(this.getDisplayData(),l)}}class M$ extends ge{constructor(t,n){super(t,n),this.model=new w$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"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 xs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new dv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Zm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class C$ extends pi{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:i,code:r}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${i(Number(yt(l,"data.x0")),r)} – ${i(Number(yt(l,"data.x1")),r)}`,...s.map(u=>i(yt(u[c],`data.${yt(u[c],n)}`),r))])];return super.formatTable({headers:a,cells:o})}}class A$ extends ge{constructor(t,n){super(t,n),this.model=new C$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new m2(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new er(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new A2(this.model,this.services),new nr(this.model,this.services)];return this.getAxisChartComponents(t)}}class L$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new T2(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class R$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((i,r)=>i+r.value,0)}getFillColor(t){const n=this.getOptions(),i=y(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),i=y(this.getDisplayData())?.reduce((a,o)=>a+o.value,0)??0,r=y(t,"meter","proportional")?i:i>100?100:i,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...r?["Status"]:[]],c=[[d[i],d.value===null?"–":a(d.value,o),...r?[r]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[i],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class I$ extends Ze{constructor(t,n){super(t,n),this.model=new R$(this.services);const i=n.options.meter?.proportional?ct(_n(At.proportionalMeterChart),n.options):ct(_n(At.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new v2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new O2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],i=[new ce(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(i,{graphFrameRenderType:at.HTML})}}class k$ extends pi{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[i]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,r)!==null?s(y(u,"data",h,r),a):"–")])];return super.formatTable({headers:l,cells:c})}}class P$ extends Ze{constructor(t,n){super(t,n),this.model=new k$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new C2(this.model,this.services)];return this.getChartComponents(t)}}class N$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class $$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],i=[];return t.forEach(r=>{this.getChildrenDatums(r,i),i.push([r.name,"–"])}),super.formatTable({headers:n,cells:i})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}}class F$ extends Ze{constructor(t,n){super(t,n),this.model=new $$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new D2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class U$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,i)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,i)])}),super.formatTable({headers:r,cells:s})}}class B$ extends Ze{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services)];return this.getChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Ev(this.model,this.services),new nr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new xv(this.model,this.services),new er(this.model,this.services,{stacked:!0}),new Sv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class V$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new bv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new nr(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[r],u[s],o(u[i],a)])];return super.formatTable({headers:l,cells:c})}}class W$ extends Ze{constructor(t,n){super(t,n),this.model=new z$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Ck,q.AreaChart=Qk,q.AreaEvent=Nc,q.ArrowDirections=qa,q.AxisEvent=Pc,q.AxisFlavor=os,q.AxisPositions=z,q.AxisTitleOrientations=Xa,q.BarEvent=Bc,q.BoxplotChart=e2,q.BoxplotEvent=Hc,q.BubbleChart=i2,q.BulletChart=a2,q.CalloutDirections=is,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=Cv,q.CirclePackChart=E$,q.ColorClassNameTypes=lt,q.ColorLegendType=as,q.ComboChart=x$,q.DividerStatus=Xi,q.DominantBaseline=sn,q.DonutChart=S$,q.ExperimentalChoroplethChart=Cv,q.GaugeChart=T$,q.GaugeEvent=Uc,q.GaugeTypes=ci,q.GroupedBarChart=O$,q.HeatmapChart=M$,q.HistogramChart=A$,q.LayoutAlignItems=li,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qi,q.LegendPositions=Yi,q.LineChart=D$,q.LineEvent=Vc,q.LollipopChart=L$,q.MeterChart=I$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Dv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=P$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=it,q.ScatterChart=N$,q.ScatterEvent=Gc,q.SimpleBarChart=H$,q.Skeletons=Vt,q.StackedAreaChart=G$,q.StackedBarChart=V$,q.Statuses=rs,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ss,q.ToolbarControlTypes=St,q.TooltipEvent=zi,q.TreeChart=F$,q.TreeEvent=Wc,q.TreeTypes=Ya,q.TreemapChart=B$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=W$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
74
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=I(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(i.children){i.depth>1&&o&&(l=!0,r.classed("clickable",!0)),c=i.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:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else d=i.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:h,label:i.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=I(this),s=r.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,Zi),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function E2(e,t){const n=mr(this._current,e);return i=>(this._current=n(i),t(this._current))}class fv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"pie graph"}),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Gr().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Gr().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=H_().value(M=>M[a]).sort(y(r,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(i,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>[M[a],Zc(M.data[a],o,a)+"%",M.data[s]].filter(Boolean).join(", ")).attrTween("d",function(M){return E2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(r,"locale"),v=r.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(i,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,M=>M.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),_=[];x.merge(b).style("text-anchor","middle").text(M=>r.pie.labels.formatter?r.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=is.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=is.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(r,"donut")?"donut":"pie",D=y(r,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),i.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===is.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(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),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(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,i){const r=I(this);t.isRendering||r.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(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);$D(()=>{t.isRendering||r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+Lt.radiusOffset:r}}class x2 extends fv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const i=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=y(r,"donut","center","label");k.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.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(I(this))}),a!==null&&a!==""&&k.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=y(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=mh:s=Ee;const a=s(r,i);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const pv="4,10 8,6 12,10",gv="12,6 8,10 4,6";class b2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){return this.model.getData().find(i=>i.group==="value")?.value??null}getValueRatio(){return Hp(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(i=>i.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===ci.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(y(n,"gauge","deltaArrow","direction")){case qa.UP:return pv;case qa.DOWN:return gv;default:return t>0?pv:gv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),i=this.getOptions(),r=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=Gr().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Gr().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(i,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=y(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;i===ci.FULL&&!s?d=l(a):i===ci.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([r]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta(),{code:s,number:a}=y(i,"locale");if(r){const o=this.computeRadius(),l=r?y(i,"gauge","deltaFontSize"):()=>0,c=r?y(i,"gauge","numberFormatter"):()=>null,u=y(i,"gauge","deltaArrow","size"),d=y(i,"gauge","numberSpacing"),h=y(i,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(r===null?[]:[r]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(i,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(r!==null&&S?[r]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(i,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(r))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===ci.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class mv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ns(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",ft.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()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[r]);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:[lt.FILL],dataGroupName:h[r],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[r],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[r]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return se({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){const a=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(i=>{const r=this.services.cartesianScales.getDomainIdentifier(i);return i[r].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 i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>s.data?.length>1);if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}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=y(t,"bars","width"),i=y(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Nr().domain(t).rangeRound([0,this.getGroupWidth()])}}class S2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=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[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const g=this.matrix[i][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][i].value=="number"){const g=this.matrix[p][i].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(i)}, ${Pn(c.range())})`):c(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(i)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:i,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(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=r.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(${r(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=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).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,i){const r=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),k.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),k.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xi.OFF&&(t===Xi.AUTO&&Ig.minCellDividerDimension<=this.xBandwidth&&Ig.minCellDividerDimension<=this.yBandwidth||t===Xi.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=yt(i,"locale.translations.total")||yt(i,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ls(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(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:r,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class _2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.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(r,(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:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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 m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),se({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:i,number:r}=y(t,"locale"),s=y(t,"tooltip","alwaysShowRulerTooltip"),a=this.parent.selectAll("path.bar");s?a.style("pointer-events","none"):a.style("pointer-events",null);const o=this;a.on("mouseover",function(l,c){const u=I(this);u.classed("hovered",!0);const d=r(parseFloat(yt(c,"data.x0")),i),h=r(parseFloat(yt(c,"data.x1")),i),f=o.services.cartesianScales.getRangeAxisPosition(),p=o.services.cartesianScales.getScaleLabel(f);s||o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:u,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${d} – ${h}`},{label:t.tooltip.groupLabel||"Group",value:c[n],class:o.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:c[n]})},{label:p,value:yt(c,`data.${c[n]}`)}]})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){I(this).classed("hovered",!1),o.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class T2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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[r]!==n.datum().name?On.opacity.unselected:On.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",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[r]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[r],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[r],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-i.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class O2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let i=0;return t.map((s,a)=>a!==0?(i+=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:i-n(s.value)}):(i=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"meter lines"}),r=this.getOptions(),s=y(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:c}=r.data;let u;if(y(r,"meter","proportional")===null)u=100;else{const E=y(r,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(r,"meter","height");k.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),k.appendOrSelect(i,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.height.default));const p=i.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",E=>E.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(r,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=i.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function vv(e){const t=w2(yv(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Gn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Gn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Gn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Gn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Gn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Gn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function w2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function yv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function M2(e,t){return t*Math.sin(e-Math.PI/2)}class C2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=k.appendOrSelect(n,"text").text(t),{width:r,height:s}=k.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=HD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[i]:o,[s]:l,[r]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[i]:c,[r]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?ui.opacity.unselected:ui.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?ui.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",ui.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=ui;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(i,r)-S)/2;if(x<=0)return;const _=Nr().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=Pn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,zn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=z_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Rf),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=M2(_(A),x);return G+V}),M={x:zn(H)+h,y:r/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vi(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>vv(_(G)).textAnchor).style("dominant-baseline",G=>vv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",ui.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vi(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${yv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-r.width)/2):t===Gt.RIGHT&&(a=s-r.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Vi(r)}`),o=t.parent.selectAll(`.dots circle.${Vi(r)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(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",ui.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===r&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vi(r)}`),o=t.parent.selectAll(`.dots circle.${Vi(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class Ev extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);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:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[i],c[u],c)}).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,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return se({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:r,element:I(this),datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class A2 extends ue{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),i=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?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"),i=[100],r=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.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=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class xv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.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=>y(s,0,r)!==n.datum().name?Tn.opacity.unselected:Tn.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",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(p=>r.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(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=>y(p,0,s));this.areaGenerator=Yl().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=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>i.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class bv extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.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:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r],c.data.sharedStackKey,c.data)).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)>i.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return se({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.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,i=y(t,"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");i?r.style("pointer-events","none"):r.style("pointer-events",null);const s=this;r.on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:o});let u=s.model.getDisplayData(s.configs.groups).find(d=>{const h=s.services.cartesianScales.getDomainIdentifier(d),f=s.services.cartesianScales.getRangeIdentifier(d);return d[f]===o.data[o[n]]&&d[h].toString()===o.data.sharedStackKey&&d[n]===o[n]});if(u===void 0){const d=s.services.cartesianScales.getDomainIdentifier(),h=s.services.cartesianScales.getRangeIdentifier();u={[d]:o.data.sharedStackKey,[h]:o.data[o[n]],[n]:o[n]}}i||s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,data:[u]})}).on("mousemove",function(a,o){const l=I(this);s.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){s.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);l.classed("hovered",!1),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Sv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=i.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.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),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(l=>i.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[r],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=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({[r]:h,[m]:f,[v]: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[r]==l[r]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ir=6;class D2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=k.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+ir:30-ir},h=Ir({name:o,children:a}),f=10,p=i/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,i,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-ir:ir).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Ya.DENDROGRAM?hb().size([r,i-u-v*ir-l]):Qb().nodeSize([f,p]).size([r,i-u-v*ir-l]),E=j_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),S(h),n.attr("viewBox",[-d.left,-0,i,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var L2="#000000",R2="#ffffff",I2="#fcf4d6",k2="#fddc69",P2="#f1c21b",N2="#d2a106",$2="#b28600",F2="#8e6a00",U2="#684e00",B2="#483700",H2="#302400",G2="#1c1500",V2={10:I2,20:k2,30:P2,40:N2,50:$2,60:F2,70:U2,80:B2,90:H2,100:G2},z2="#fff2e8",W2="#ffd9be",Y2="#ffb784",q2="#ff832b",X2="#eb6200",Z2="#ba4e00",j2="#8a3800",K2="#5e2900",Q2="#3e1a00",J2="#231000",tP={10:z2,20:W2,30:Y2,40:q2,50:X2,60:Z2,70:j2,80:K2,90:Q2,100:J2},eP="#fff1f1",nP="#ffd7d9",iP="#ffb3b8",rP="#ff8389",sP="#fa4d56",aP="#da1e28",oP="#a2191f",lP="#750e13",cP="#520408",uP="#2d0709",hP={10:eP,20:nP,30:iP,40:rP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#fff0f7",fP="#ffd6e8",pP="#ffafd2",gP="#ff7eb6",mP="#ee5396",vP="#d02670",yP="#9f1853",EP="#740937",xP="#510224",bP="#2a0a18",SP={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:EP,90:xP,100:bP},_P="#f6f2ff",TP="#e8daff",OP="#d4bbff",wP="#be95ff",MP="#a56eff",CP="#8a3ffc",AP="#6929c4",DP="#491d8b",LP="#31135e",RP="#1c0f30",IP={10:_P,20:TP,30:OP,40:wP,50:MP,60:CP,70:AP,80:DP,90:LP,100:RP},kP="#edf5ff",PP="#d0e2ff",NP="#a6c8ff",$P="#78a9ff",FP="#4589ff",UP="#0f62fe",BP="#0043ce",HP="#002d9c",GP="#001d6c",VP="#001141",zP={10:kP,20:PP,30:NP,40:$P,50:FP,60:UP,70:BP,80:HP,90:GP,100:VP},WP="#e5f6ff",YP="#bae6ff",qP="#82cfff",XP="#33b1ff",ZP="#1192e8",jP="#0072c3",KP="#00539a",QP="#003a6d",JP="#012749",tN="#061727",eN={10:WP,20:YP,30:qP,40:XP,50:ZP,60:jP,70:KP,80:QP,90:JP,100:tN},nN="#d9fbfb",iN="#9ef0f0",rN="#3ddbd9",sN="#08bdba",aN="#009d9a",oN="#007d79",lN="#005d5d",cN="#004144",uN="#022b30",hN="#081a1c",dN={10:nN,20:iN,30:rN,40:sN,50:aN,60:oN,70:lN,80:cN,90:uN,100:hN},fN="#defbe6",pN="#a7f0ba",gN="#6fdc8c",mN="#42be65",vN="#24a148",yN="#198038",EN="#0e6027",xN="#044317",bN="#022d0d",SN="#071908",_N={10:fN,20:pN,30:gN,40:mN,50:vN,60:yN,70:EN,80:xN,90:bN,100:SN},TN="#f2f4f8",ON="#dde1e6",wN="#c1c7cd",MN="#a2a9b0",CN="#878d96",AN="#697077",DN="#4d5358",LN="#343a3f",RN="#21272a",IN="#121619",kN={10:TN,20:ON,30:wN,40:MN,50:CN,60:AN,70:DN,80:LN,90:RN,100:IN},PN="#f4f4f4",NN="#e0e0e0",$N="#c6c6c6",FN="#a8a8a8",UN="#8d8d8d",BN="#6f6f6f",HN="#525252",GN="#393939",VN="#262626",zN="#161616",WN={10:PN,20:NN,30:$N,40:FN,50:UN,60:BN,70:HN,80:GN,90:VN,100:zN},YN="#f7f3f2",qN="#e5e0df",XN="#cac5c4",ZN="#ada8a8",jN="#8f8b8b",KN="#726e6e",QN="#565151",JN="#3c3838",t$="#272525",e$="#171414",n$={10:YN,20:qN,30:XN,40:ZN,50:jN,60:KN,70:QN,80:JN,90:t$,100:e$},_v={black:{100:L2},blue:zP,coolGray:kN,cyan:eN,gray:WN,green:_N,magenta:SP,orange:tP,purple:IP,red:hP,teal:dN,warmGray:n$,white:{0:R2},yellow:V2};const i$=e=>{if(!e)return null;for(const t of Object.keys(_v)){const n=_v[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},Tv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),i=hn(n);let r;if(i&&(r=i$(i?i.hex():null)),r==null){const s=dh(i).l;r=Math.abs(s*100-100)}return r>50?"white":"black"};let r$=0;class s$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Ir({name:r.title||"Treemap",children:i}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=iS().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",()=>r$++).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=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.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,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${r.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Tv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${r.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Tv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.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,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.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,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}}function a$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var l$={value:function(){}};function Ov(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new po(n)}function po(e){this._=e}function c$(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}po.prototype=Ov.prototype={constructor:po,on:function(e,t){var n=this._,i=c$(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=u$(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=wv(n[r],e.name,t);else if(t==null)for(r in n)n[r]=wv(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function u$(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function wv(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=l$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}const h$=o$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Ov},Symbol.toStringTag,{value:"Module"})));var Au,Mv;function d$(){if(Mv)return Au;Mv=1;const e=h$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},i=64,r=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(i<<5)/ut,Y.height=r/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,_s=(Q.y+Q.y0)*Ut+(st>>5),Ts,mi=0;mi<Oe;mi++){Ts=0;for(var je=0;je<=xt;je++)Y[_s+je]|=Ts<<Ne|(je<xt?(Ts=V[mi*xt+je])>>>_t:0);_s+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,_,C){if(!x.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(i<<5)/B,r/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){x=_[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=i<<5&&(P=0,w+=H,H=0),w+V>=r)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,0)),D.restore(),x.width=G,x.height=V,x.xoff=P,x.yoff=w,x.x1=G>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(i<<5)/B,r/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(i<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])return!0;N+=_}return!1}function f(b,x){var _=b[0],C=b[1];x.x+x.x0<_.x&&(_.x=x.x+x.x0),x.y+x.y0<_.y&&(_.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(_){return[x*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var x=4,_=x*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=x;break;case 2:C-=_;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],_=-1;++_<b;)x[_]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var f$=d$();const p$=a$(f$);class g$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(i,{useAttrs:!0});if(u===0||d===0)return;const h=p$().size([u,d]).words(r.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=k.appendOrSelect(i,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(l=>l[i]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?Fe(r):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=Wa(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.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;r(o),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:i.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r(null),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class m$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=p2(s,Object.values(l)),u=h2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=r.fitSize([n,i],u),h=$x().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.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",Vr()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=nb();break;case an.geoAlbers:t=Zx();break;case an.geoConicEqualArea:t=Rd();break;case an.geoConicEquidistant:t=tb();break;case an.geoEquirectangular:t=Qx();break;case an.geoMercator:t=jx();break;case an.geoNaturalEarth1:t=ib();break;default:throw new Error("Projection is not supported.")}return t}}class v$ extends m${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),i=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),r=y(this.getOptions(),"color"),s=y(r,"gradient","colors");i.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEMOVE,{event:i,element:I(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(Wi.CHOROPLETH_CLICK,{event:i,element:I(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=I(this);t.services.events.dispatchEvent(Wi.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(zi.HIDE,{event:i,hoveredElement:s})})}}class Cv extends Ze{constructor(t,n){super(t,n),this.model=new o2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new xs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new dv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new v$(this.model,this.services)];return this.getChartComponents(t)}}class y$ extends on{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(),i=ct({},t,this.getZoomOptions(t));jc(n,i);const r=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.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:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,i)])}),super.formatTable({headers:r,cells:s})}getChildrenDatums(t,n,i=[],r=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(r+=l.value),u+=this.getChildrenDatums(l.children,c,i,u),i.push([c,s,a(u,o)]),r+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,r+=l.value),i.push([l.name,s,a(d,o)])}}),r}}class E$ extends Ze{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new y2(this.model,this.services)];return this.getChartComponents(t)}}const Av={[be.LINE]:[er,cn],[be.SCATTER]:[cn],[be.AREA]:[av,er,cn],[be.STACKED_AREA]:[xv,er,Sv,fo],[be.SIMPLE_BAR]:[Ev],[be.GROUPED_BAR]:[mv,nr],[be.STACKED_BAR]:[bv,fo]};class x$ extends ge{constructor(t,n){super(t,n);const i=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Av).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${oC(r.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),r.options),r.type===be.STACKED_AREA&&(o=!0),Av[r.type].map(c=>new c(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return fc(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),i=[new me(this.model,this.services),new Te(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Hn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class b$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{valueMapsTo:r}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[i],c[r]===null?"–":s(c[r],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((i,r)=>r.value-i.value)}}class Dv extends Ze{constructor(t,n,i=!1){super(t,n),this.model=new b$(this.services),!i&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new fv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class S$ extends Dv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class _$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{number:r,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[i],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class T$ extends Ze{constructor(t,n){super(t,n),this.model=new _$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services)];return this.getChartComponents(t)}}class O$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new mv(this.model,this.services),new nr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class w$ extends pi{constructor(t){super(t),this.axisFlavor=os.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==it.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==it.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==it.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==it.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),i=>i.value),n=Ge().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(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=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[i]=a,l[r]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains(),{number:r,code:s}=y(this.getOptions(),"locale"),a=[n.label,i.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[i.identifier]===null?"–":l[i.identifier],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),i=!We(n);let r=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=uv(this.getDisplayData(),l)}}class M$ extends ge{constructor(t,n){super(t,n),this.model=new w$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"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 xs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Ji(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:li.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new dv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Zm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class C$ extends pi{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:i,code:r}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${i(Number(yt(l,"data.x0")),r)} – ${i(Number(yt(l,"data.x1")),r)}`,...s.map(u=>i(yt(u[c],`data.${yt(u[c],n)}`),r))])];return super.formatTable({headers:a,cells:o})}}class A$ extends ge{constructor(t,n){super(t,n),this.model=new C$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new m2(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new er(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new A2(this.model,this.services),new nr(this.model,this.services)];return this.getAxisChartComponents(t)}}class L$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new T2(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class R$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((i,r)=>i+r.value,0)}getFillColor(t){const n=this.getOptions(),i=y(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),i=y(this.getDisplayData())?.reduce((a,o)=>a+o.value,0)??0,r=y(t,"meter","proportional")?i:i>100?100:i,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...r?["Status"]:[]],c=[[d[i],d.value===null?"–":a(d.value,o),...r?[r]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[i],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class I$ extends Ze{constructor(t,n){super(t,n),this.model=new R$(this.services);const i=n.options.meter?.proportional?ct(_n(At.proportionalMeterChart),n.options):ct(_n(At.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new v2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new O2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],i=[new ce(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(i,{graphFrameRenderType:at.HTML})}}class k$ extends pi{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[i]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,r)!==null?s(y(u,"data",h,r),a):"–")])];return super.formatTable({headers:l,cells:c})}}class P$ extends Ze{constructor(t,n){super(t,n),this.model=new k$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new C2(this.model,this.services)];return this.getChartComponents(t)}}class N$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class $$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],i=[];return t.forEach(r=>{this.getChildrenDatums(r,i),i.push([r.name,"–"])}),super.formatTable({headers:n,cells:i})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}}class F$ extends Ze{constructor(t,n){super(t,n),this.model=new $$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new D2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class U$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,i)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,i)])}),super.formatTable({headers:r,cells:s})}}class B$ extends Ze{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services)];return this.getChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Ev(this.model,this.services),new nr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new xv(this.model,this.services),new er(this.model,this.services,{stacked:!0}),new Sv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class V$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new bv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new nr(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[r],u[s],o(u[i],a)])];return super.formatTable({headers:l,cells:c})}}class W$ extends Ze{constructor(t,n){super(t,n),this.model=new z$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Ck,q.AreaChart=Qk,q.AreaEvent=Nc,q.ArrowDirections=qa,q.AxisEvent=Pc,q.AxisFlavor=os,q.AxisPositions=z,q.AxisTitleOrientations=Xa,q.BarEvent=Bc,q.BoxplotChart=e2,q.BoxplotEvent=Hc,q.BubbleChart=i2,q.BulletChart=a2,q.CalloutDirections=is,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=Cv,q.CirclePackChart=E$,q.ColorClassNameTypes=lt,q.ColorLegendType=as,q.ComboChart=x$,q.DividerStatus=Xi,q.DominantBaseline=sn,q.DonutChart=S$,q.ExperimentalChoroplethChart=Cv,q.GaugeChart=T$,q.GaugeEvent=Uc,q.GaugeTypes=ci,q.GroupedBarChart=O$,q.HeatmapChart=M$,q.HistogramChart=A$,q.LayoutAlignItems=li,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qi,q.LegendPositions=Yi,q.LineChart=D$,q.LineEvent=Vc,q.LollipopChart=L$,q.MeterChart=I$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Dv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=P$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=it,q.ScatterChart=N$,q.ScatterEvent=Gc,q.SimpleBarChart=H$,q.Skeletons=Vt,q.StackedAreaChart=G$,q.StackedBarChart=V$,q.Statuses=rs,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ss,q.ToolbarControlTypes=St,q.TooltipEvent=zi,q.TreeChart=F$,q.TreeEvent=Wc,q.TreeTypes=Ya,q.TreemapChart=B$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=W$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
75
75
|
//# sourceMappingURL=bundle.umd.cjs.map
|