@carbon/charts 1.23.5 → 1.23.7
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 +22 -0
- package/dist/{choropleth-C0wftO71.mjs → choropleth-YbrQ_iGH.mjs} +2 -2
- package/dist/choropleth-YbrQ_iGH.mjs.map +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/umd/bundle.umd.cjs +1 -1
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +1 -1
- package/package.json +15 -15
- package/dist/choropleth-C0wftO71.mjs.map +0 -1
package/dist/umd/bundle.umd.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
63
63
|
<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"/>
|
|
64
64
|
<rect width="32" height="32"/>
|
|
65
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri 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,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.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/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.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(i.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=vf().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=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(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)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck 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=$h(),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"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=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);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",r).style("stroke",r?`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",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.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(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=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],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),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:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/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,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).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,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.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"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){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(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){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,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,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===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(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:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.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 r=this.services.domUtils.getHolder(),i=zn(t,r),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:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.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(r,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]=Cn(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 qm 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 r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.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(r,"locale.translations.group")||yt(r,"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[i.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(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(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 jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{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:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&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 r=this.getAxisOptions(t).title;return r||(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(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.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(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.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]===rt.LINEAR||this.scaleTypes[t]===rt.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,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,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 r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&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"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.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===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.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(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.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}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.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(eL(_,"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!==rt.TIME&&a!==rt.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(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=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&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){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(r===rt.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 qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{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===rt.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:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.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-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.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 r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.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 r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<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:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(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");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.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 le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(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 qm(this.model,this.services),new oo(this.model,this.services),new le(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"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).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")}, ${r})`);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,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).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,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"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 iv 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(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.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",On.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}),r=this.getOptions();let i=[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(r,"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(r,"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?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"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]]}}ys.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:ys.getStops(i,_)})}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:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.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 ei 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(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.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",wn.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=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn 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,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(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,r]});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&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],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(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).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=>{var n;return(n=this.services.transitions)==null?void 0:n.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=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==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=>{var n;return(n=this.services.transitions)==null?void 0:n.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 r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.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:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),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 r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(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,i)?[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,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))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",i?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(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.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 av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"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===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;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(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"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(r,"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||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.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(r,"timeScale","addSpaceOnEdges"),ht=y(r,"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(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.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===rt.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===qa.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===qa.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(r,"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)=>am(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===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.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(Mn(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,$n.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===rt.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,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(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,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.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===rt.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===rt.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===rt.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,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.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 jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.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-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.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===rt.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===rt.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={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.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===is.DEFAULT?new av(this.model,this.services,c):new jk(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 ce 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(),r=this.computeInnerRadius();this.drawRing(n,r,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:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);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"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);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"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).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",r).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,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),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=Ui().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",r).classed("empty-state-areas",!r).style("fill",r?`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=`
|
|
65
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri 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,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.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/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.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(i.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=vf().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=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(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)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck 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=$h(),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"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=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);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",r).style("stroke",r?`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",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.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(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=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],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),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:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/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,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).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,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.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"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){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(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){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,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,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===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(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:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.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 r=this.services.domUtils.getHolder(),i=zn(t,r),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:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.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(r,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]=Cn(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 qm 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 r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.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(r,"locale.translations.group")||yt(r,"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[i.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(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(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 jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{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:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&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 r=this.getAxisOptions(t).title;return r||(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(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.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(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.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]===rt.LINEAR||this.scaleTypes[t]===rt.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,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,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 r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&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"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.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===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.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(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.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}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.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(eL(_,"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!==rt.TIME&&a!==rt.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(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=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&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){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(r===rt.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 qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{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===rt.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:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.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-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.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 r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.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 r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<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:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(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");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.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 le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(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 qm(this.model,this.services),new oo(this.model,this.services),new le(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"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).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")}, ${r})`);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,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).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,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"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 iv 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(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.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",On.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}),r=this.getOptions();let i=[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(r,"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(r,"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?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"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]]}}ys.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:ys.getStops(i,_)})}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:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.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 ei 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(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.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",wn.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=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn 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,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(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,r]});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&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],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(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).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=>{var n;return(n=this.services.transitions)==null?void 0:n.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=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==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=>{var n;return(n=this.services.transitions)==null?void 0:n.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 r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.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:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),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 r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(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,i)?[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,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))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",i?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(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.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 av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"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===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;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(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"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(r,"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||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.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(r,"timeScale","addSpaceOnEdges"),ht=y(r,"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(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.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===rt.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===qa.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===qa.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(r,"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)=>am(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===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.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(Mn(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,$n.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===rt.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,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(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,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.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===rt.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===rt.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===rt.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,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.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 jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.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-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.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===rt.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===rt.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={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.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===is.DEFAULT?new av(this.model,this.services,c):new jk(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 ce 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(),r=this.computeInnerRadius();this.drawRing(n,r,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:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);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"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);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"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).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",r).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,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"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=Ui().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",r).classed("empty-state-areas",!r).style("fill",r?`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
66
|
<stop class="${s}" offset="${c}"></stop>
|
|
67
67
|
<stop class="${a}" offset="${c+.2}"></stop>
|
|
68
68
|
<stop class="${s}" offset="${c+2*.2}"></stop>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/charts",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.7",
|
|
4
4
|
"description": "Carbon Charts component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"directory": "packages/core"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@carbon/colors": "^11.
|
|
76
|
+
"@carbon/colors": "^11.31.0",
|
|
77
77
|
"@carbon/utils-position": "^1.3.0",
|
|
78
78
|
"@ibm/telemetry-js": "^1.9.1",
|
|
79
79
|
"@types/d3": "^7.4.3",
|
|
@@ -89,26 +89,26 @@
|
|
|
89
89
|
"tslib": "^2.8.1"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@carbon/layout": "^11.
|
|
93
|
-
"@carbon/styles": "^1.
|
|
94
|
-
"@carbon/themes": "^11.
|
|
95
|
-
"@playwright/test": "^1.
|
|
92
|
+
"@carbon/layout": "^11.32.0",
|
|
93
|
+
"@carbon/styles": "^1.79.1",
|
|
94
|
+
"@carbon/themes": "^11.50.0",
|
|
95
|
+
"@playwright/test": "^1.52.0",
|
|
96
96
|
"@rollup/plugin-replace": "^6.0.2",
|
|
97
97
|
"@types/dompurify": "^3.2.0",
|
|
98
98
|
"@types/lodash-es": "^4.17.12",
|
|
99
|
-
"@types/node": "^22.14.
|
|
99
|
+
"@types/node": "^22.14.1",
|
|
100
100
|
"concurrently": "^9.1.2",
|
|
101
101
|
"downlevel-dts": "^0.11.0",
|
|
102
|
-
"eslint": "^9.
|
|
103
|
-
"jsdom": "^26.
|
|
102
|
+
"eslint": "^9.25.1",
|
|
103
|
+
"jsdom": "^26.1.0",
|
|
104
104
|
"prettier": "^3.5.3",
|
|
105
|
-
"publint": "^0.3.
|
|
105
|
+
"publint": "^0.3.12",
|
|
106
106
|
"resize-observer-polyfill": "^1.5.1",
|
|
107
|
-
"sass": "^1.
|
|
108
|
-
"typescript": "^5.8.
|
|
109
|
-
"vite": "^6.2
|
|
107
|
+
"sass": "^1.87.0",
|
|
108
|
+
"typescript": "^5.8.3",
|
|
109
|
+
"vite": "^6.3.2",
|
|
110
110
|
"vite-plugin-dts": "^4.5.3",
|
|
111
|
-
"vitest": "^3.1.
|
|
111
|
+
"vitest": "^3.1.2"
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": {
|
|
114
114
|
"access": "public"
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"url": "https://github.com/theiliad"
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "d5b117f8993a0ae72394daf6510aba72666d1c7e"
|
|
161
161
|
}
|