@carbon/charts-react 1.16.4 → 1.16.6

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/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- (function(J,le){typeof exports=="object"&&typeof module<"u"?le(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],le):(J=typeof globalThis<"u"?globalThis:J||self,le(J.ChartsReact={},J.React))})(this,function(J,le){"use strict";var g3=Object.defineProperty;var v3=(J,le,Fn)=>le in J?g3(J,le,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):J[le]=Fn;var bh=(J,le,Fn)=>(v3(J,typeof le!="symbol"?le+"":le,Fn),Fn);var Fn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Fn||{}),_h=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(_h||{}),wh=(e=>(e.UPDATE="model-update",e))(wh||{}),Sh=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Sh||{}),Oh=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(Oh||{}),Th=(e=>(e.CHANGE="zoom-domain-change",e))(Th||{}),Mh=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Mh||{}),Ch=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Ch||{}),Ah=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Ah||{}),$h=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))($h||{}),Rh=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Rh||{}),Lh=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Lh||{}),kh=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(kh||{}),Dh=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Dh||{}),Ih=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Ih||{}),Nh=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nh||{}),Ph=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Ph||{}),Uh=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Uh||{}),Bh=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Bh||{}),_i=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(_i||{}),Hh=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Hh||{}),Vh=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Vh||{}),Fh=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Fh||{}),zh=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(zh||{}),Gh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Gh||{}),jh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(jh||{}),Ir=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Ir||{});const W0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:zh,Area:Ah,Axis:Ch,Bar:kh,Boxplot:Dh,CanvasZoom:Mh,Chart:Fn,Choropleth:Ir,CirclePack:Fh,Gauge:Lh,Heatmap:jh,Legend:Vh,Line:Nh,Meter:Gh,Modal:_h,Model:wh,Pie:Rh,Radar:Ph,Scatter:Ih,Threshold:Hh,Toolbar:Sh,Tooltip:_i,Tree:Uh,Treemap:Bh,WordCloud:$h,ZoomBar:Oh,ZoomDomain:Th},Symbol.toStringTag,{value:"Module"})),O=W0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),il=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(il||{}),at=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(at||{}),F=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(F||{}),an=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(an||{}),je=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(je||{}),te=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(te||{}),et=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(et||{}),wi=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(wi||{}),Qt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Qt||{}),Si=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Si||{}),sl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(sl||{}),Ut=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Ut||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),Nr=(e=>(e.CENTER="center",e))(Nr||{}),qs=(e=>(e.LEFT="left",e.RIGHT="right",e))(qs||{}),ee=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(ee||{}),yn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(yn||{}),xn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(xn||{}),Pr=(e=>(e.SEMI="semi",e.FULL="full",e))(Pr||{}),al=(e=>(e.UP="up",e.DOWN="down",e))(al||{}),Ys=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ys||{}),Xs=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Xs||{}),Ne=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(Ne||{}),$t=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))($t||{}),ol=(e=>(e.LEFT="left",e.RIGHT="right",e))(ol||{}),ne=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(ne||{}),Zs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Zs||{}),Oi=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Oi||{}),Ks=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ks||{}),bn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(bn||{});function ir(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function q0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ll(e){let t,n,r;e.length!==2?(t=ir,n=(o,l)=>ir(e(o),l),r=(o,l)=>e(o)-l):(t=e===ir||e===q0?e:Y0,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Y0(){return 0}function X0(e){return e===null?NaN:+e}function*Z0(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cl=ll(ir).right;ll(X0).center;function K0(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function We(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class sr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Wh extends Map{constructor(t,n=ty){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(qh(this,t))}has(t){return super.has(qh(this,t))}set(t,n){return super.set(Q0(this,t),n)}delete(t){return super.delete(J0(this,t))}}function qh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Q0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function J0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ty(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ey(e){return e}function ny(e=ir){if(e===ir)return Yh;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Yh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var ry=Array.prototype,iy=ry.slice;function ul(e){return()=>e}const sy=Math.sqrt(50),ay=Math.sqrt(10),oy=Math.sqrt(2);function Qs(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=sy?10:s>=ay?5:s>=oy?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Qs(e,t,n*2):[o,l,c]}function Js(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Qs(t,e,n):Qs(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Ur(e,t,n){return t=+t,e=+e,n=+n,Qs(e,t,n)[2]}function hl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Ur(t,e,n):Ur(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ly(e,t,n){let r;for(;;){const i=Ur(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function cy(e){return Math.max(1,Math.ceil(Math.log(K0(e))/Math.LN2)+1)}function uy(){var e=ey,t=We,n=cy;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const b=h,w=+f;if(t===We&&([d,h]=ly(d,h,w)),f=Js(d,h,w),f[0]<=d&&(l=Ur(d,h,w)),f[f.length-1]>=h)if(b>=h&&t===We){const _=Ur(d,h,w);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else f.pop()}for(var p=f.length,v=0,m=p;f[v]<=d;)++v;for(;f[m-1]>h;)--m;(v||m<p)&&(f=f.slice(v,m),p=m-v);var y=new Array(p+1),g;for(s=0;s<=p;++s)g=y[s]=[],g.x0=s>0?f[s-1]:d,g.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&y[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const b=Math.floor((d-o)*l);y[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&y[cl(f,o,0,p)].push(i[s]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:ul(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:ul([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:ul(Array.isArray(i)?iy.call(i):i),r):n},r}function ar(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function zn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Xh(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Yh:ny(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));Xh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Ti(e,n,t),i(e[r],s)>0&&Ti(e,n,r);a<o;){for(Ti(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Ti(e,n,o):(++o,Ti(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Ti(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dl(e,t,n){if(e=Float64Array.from(Z0(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return zn(e);if(t>=1)return ar(e);var r,i=(r-1)*t,s=Math.floor(i),a=ar(Xh(e,s).subarray(0,s+1)),o=zn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*hy(e){for(const t of e)yield*t}function Zh(e){return Array.from(hy(e))}function dy(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function fy(e){return e}var ta=1,ea=2,fl=3,Mi=4,Kh=1e-6;function py(e){return"translate("+e+",0)"}function my(e){return"translate(0,"+e+")"}function gy(e){return t=>+e(t)}function vy(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function yy(){return!this.__axis}function na(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===ta||e===Mi?-1:1,u=e===Mi||e===ea?"x":"y",d=e===ta||e===fl?py:my;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):fy),m=Math.max(s,0)+o,y=t.range(),g=+y[0]+l,b=+y[y.length-1]+l,w=(t.bandwidth?vy:gy)(t.copy(),l),_=f.selection?f.selection():f,S=_.selectAll(".domain").data([null]),R=_.selectAll(".tick").data(p,t).order(),I=R.exit(),k=R.enter().append("g").attr("class","tick"),L=R.select("line"),M=R.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(k),L=L.merge(k.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(k.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===ta?"0em":e===fl?"0.71em":"0.32em")),f!==_&&(S=S.transition(f),R=R.transition(f),L=L.transition(f),M=M.transition(f),I=I.transition(f).attr("opacity",Kh).attr("transform",function(V){return isFinite(V=w(V))?d(V+l):this.getAttribute("transform")}),k.attr("opacity",Kh).attr("transform",function(V){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(V))?P:w(V))+l)})),I.remove(),S.attr("d",e===Mi||e===ea?a?"M"+c*a+","+g+"H"+l+"V"+b+"H"+c*a:"M"+l+","+g+"V"+b:a?"M"+g+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+g+","+l+"H"+b),R.attr("opacity",1).attr("transform",function(V){return d(w(V)+l)}),L.attr(u+"2",c*s),M.attr(u,c*m).text(v),_.filter(yy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ea?"start":e===Mi?"end":"middle"),_.each(function(){this.__axis=w})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function xy(e){return na(ta,e)}function by(e){return na(ea,e)}function pl(e){return na(fl,e)}function Qh(e){return na(Mi,e)}var Ey={value:()=>{}};function ml(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ra(n)}function ra(e){this._=e}function _y(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ra.prototype=ml.prototype={constructor:ra,on:function(e,t){var n=this._,r=_y(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wy(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Jh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Jh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ra(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function wy(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Jh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ey,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var gl="http://www.w3.org/1999/xhtml";const td={svg:"http://www.w3.org/2000/svg",xhtml:gl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ia(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),td.hasOwnProperty(t)?{space:td[t],local:e}:e}function Sy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===gl&&t.documentElement.namespaceURI===gl?t.createElement(e):t.createElementNS(n,e)}}function Oy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ed(e){var t=ia(e);return(t.local?Oy:Sy)(t)}function Ty(){}function vl(e){return e==null?Ty:function(){return this.querySelector(e)}}function My(e){typeof e!="function"&&(e=vl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Te(r,this._parents)}function Cy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ay(){return[]}function nd(e){return e==null?Ay:function(){return this.querySelectorAll(e)}}function $y(e){return function(){return Cy(e.apply(this,arguments))}}function Ry(e){typeof e=="function"?e=$y(e):e=nd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Te(r,i)}function rd(e){return function(){return this.matches(e)}}function id(e){return function(t){return t.matches(e)}}var Ly=Array.prototype.find;function ky(e){return function(){return Ly.call(this.children,e)}}function Dy(){return this.firstElementChild}function Iy(e){return this.select(e==null?Dy:ky(typeof e=="function"?e:id(e)))}var Ny=Array.prototype.filter;function Py(){return Array.from(this.children)}function Uy(e){return function(){return Ny.call(this.children,e)}}function By(e){return this.selectAll(e==null?Py:Uy(typeof e=="function"?e:id(e)))}function Hy(e){typeof e!="function"&&(e=rd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Te(r,this._parents)}function sd(e){return new Array(e.length)}function Vy(){return new Te(this._enter||this._groups.map(sd),this._parents)}function sa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}sa.prototype={constructor:sa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Fy(e){return function(){return e}}function zy(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new sa(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function Gy(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new sa(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function jy(e){return e.__data__}function Wy(e,t){if(!arguments.length)return Array.from(this,jy);var n=t?Gy:zy,r=this._parents,i=this._groups;typeof e!="function"&&(e=Fy(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=qy(e.call(u,u&&u.__data__,c,r)),p=f.length,v=o[c]=new Array(p),m=a[c]=new Array(p),y=l[c]=new Array(h);n(u,d,v,m,y,f,t);for(var g=0,b=0,w,_;g<p;++g)if(w=v[g]){for(g>=b&&(b=g+1);!(_=m[b])&&++b<p;);w._next=_||null}}return a=new Te(a,r),a._enter=o,a._exit=l,a}function qy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yy(){return new Te(this._exit||this._groups.map(sd),this._parents)}function Xy(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Zy(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new Te(o,this._parents)}function Ky(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Qy(e){e||(e=Jy);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Te(i,this._parents).order()}function Jy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function t1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function e1(){return Array.from(this)}function n1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function r1(){let e=0;for(const t of this)++e;return e}function i1(){return!this.node()}function s1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function a1(e){return function(){this.removeAttribute(e)}}function o1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function l1(e,t){return function(){this.setAttribute(e,t)}}function c1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function u1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function h1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function d1(e,t){var n=ia(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?o1:a1:typeof t=="function"?n.local?h1:u1:n.local?c1:l1)(n,t))}function ad(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function f1(e){return function(){this.style.removeProperty(e)}}function p1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function m1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function g1(e,t,n){return arguments.length>1?this.each((t==null?f1:typeof t=="function"?m1:p1)(e,t,n??"")):Br(this.node(),e)}function Br(e,t){return e.style.getPropertyValue(t)||ad(e).getComputedStyle(e,null).getPropertyValue(t)}function v1(e){return function(){delete this[e]}}function y1(e,t){return function(){this[e]=t}}function x1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function b1(e,t){return arguments.length>1?this.each((t==null?v1:typeof t=="function"?x1:y1)(e,t)):this.node()[e]}function od(e){return e.trim().split(/^|\s+/)}function yl(e){return e.classList||new ld(e)}function ld(e){this._node=e,this._names=od(e.getAttribute("class")||"")}ld.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function cd(e,t){for(var n=yl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function ud(e,t){for(var n=yl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function E1(e){return function(){cd(this,e)}}function _1(e){return function(){ud(this,e)}}function w1(e,t){return function(){(t.apply(this,arguments)?cd:ud)(this,e)}}function S1(e,t){var n=od(e+"");if(arguments.length<2){for(var r=yl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?w1:t?E1:_1)(n,t))}function O1(){this.textContent=""}function T1(e){return function(){this.textContent=e}}function M1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function C1(e){return arguments.length?this.each(e==null?O1:(typeof e=="function"?M1:T1)(e)):this.node().textContent}function A1(){this.innerHTML=""}function $1(e){return function(){this.innerHTML=e}}function R1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function L1(e){return arguments.length?this.each(e==null?A1:(typeof e=="function"?R1:$1)(e)):this.node().innerHTML}function k1(){this.nextSibling&&this.parentNode.appendChild(this)}function D1(){return this.each(k1)}function I1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function N1(){return this.each(I1)}function P1(e){var t=typeof e=="function"?e:ed(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function U1(){return null}function B1(e,t){var n=typeof e=="function"?e:ed(e),r=t==null?U1:typeof t=="function"?t:vl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H1(){var e=this.parentNode;e&&e.removeChild(this)}function V1(){return this.each(H1)}function F1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(e){return this.select(e?z1:F1)}function j1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function W1(e){return function(t){e.call(this,t,this.__data__)}}function q1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Y1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function X1(e,t,n){return function(){var r=this.__on,i,s=W1(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Z1(e,t,n){var r=q1(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?X1:Y1,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function hd(e,t,n){var r=ad(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function K1(e,t){return function(){return hd(this,e,t)}}function Q1(e,t){return function(){return hd(this,e,t.apply(this,arguments))}}function J1(e,t){return this.each((typeof t=="function"?Q1:K1)(e,t))}function*tx(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var dd=[null];function Te(e,t){this._groups=e,this._parents=t}function Ci(){return new Te([[document.documentElement]],dd)}function ex(){return this}Te.prototype=Ci.prototype={constructor:Te,select:My,selectAll:Ry,selectChild:Iy,selectChildren:By,filter:Hy,data:Wy,enter:Vy,exit:Yy,join:Xy,merge:Zy,selection:ex,order:Ky,sort:Qy,call:t1,nodes:e1,node:n1,size:r1,empty:i1,each:s1,attr:d1,style:g1,property:b1,classed:S1,text:C1,html:L1,raise:D1,lower:N1,append:P1,insert:B1,remove:V1,clone:G1,datum:j1,on:Z1,dispatch:J1,[Symbol.iterator]:tx};function D(e){return typeof e=="string"?new Te([[document.querySelector(e)]],[document.documentElement]):new Te([[e]],dd)}function nx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function or(e,t){if(e=nx(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const xl={capture:!0,passive:!1};function bl(e){e.preventDefault(),e.stopImmediatePropagation()}function rx(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",bl,xl);"onselectstart"in t?n.on("selectstart.drag",bl,xl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ix(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",bl,xl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function El(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ai(){}var $i=.7,aa=1/$i,Hr="\\s*([+-]?\\d+)\\s*",Ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",on="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sx=/^#([0-9a-f]{3,8})$/,ax=new RegExp(`^rgb\\(${Hr},${Hr},${Hr}\\)$`),ox=new RegExp(`^rgb\\(${on},${on},${on}\\)$`),lx=new RegExp(`^rgba\\(${Hr},${Hr},${Hr},${Ri}\\)$`),cx=new RegExp(`^rgba\\(${on},${on},${on},${Ri}\\)$`),ux=new RegExp(`^hsl\\(${Ri},${on},${on}\\)$`),hx=new RegExp(`^hsla\\(${Ri},${on},${on},${Ri}\\)$`),pd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(Ai,En,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:md,formatHex:md,formatHex8:dx,formatHsl:fx,formatRgb:gd,toString:gd});function md(){return this.rgb().formatHex()}function dx(){return this.rgb().formatHex8()}function fx(){return Ed(this).formatHsl()}function gd(){return this.rgb().formatRgb()}function En(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vd(t):n===3?new be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?oa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?oa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ax.exec(e))?new be(t[1],t[2],t[3],1):(t=ox.exec(e))?new be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lx.exec(e))?oa(t[1],t[2],t[3],t[4]):(t=cx.exec(e))?oa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ux.exec(e))?bd(t[1],t[2]/100,t[3]/100,1):(t=hx.exec(e))?bd(t[1],t[2]/100,t[3]/100,t[4]):pd.hasOwnProperty(e)?vd(pd[e]):e==="transparent"?new be(NaN,NaN,NaN,0):null}function vd(e){return new be(e>>16&255,e>>8&255,e&255,1)}function oa(e,t,n,r){return r<=0&&(e=t=n=NaN),new be(e,t,n,r)}function px(e){return e instanceof Ai||(e=En(e)),e?(e=e.rgb(),new be(e.r,e.g,e.b,e.opacity)):new be}function _l(e,t,n,r){return arguments.length===1?px(e):new be(e,t,n,r??1)}function be(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}El(be,_l,fd(Ai,{brighter(e){return e=e==null?aa:Math.pow(aa,e),new be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new be(lr(this.r),lr(this.g),lr(this.b),la(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yd,formatHex:yd,formatHex8:mx,formatRgb:xd,toString:xd}));function yd(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}`}function mx(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}${cr((isNaN(this.opacity)?1:this.opacity)*255)}`}function xd(){const e=la(this.opacity);return`${e===1?"rgb(":"rgba("}${lr(this.r)}, ${lr(this.g)}, ${lr(this.b)}${e===1?")":`, ${e})`}`}function la(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cr(e){return e=lr(e),(e<16?"0":"")+e.toString(16)}function bd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qe(e,t,n,r)}function Ed(e){if(e instanceof qe)return new qe(e.h,e.s,e.l,e.opacity);if(e instanceof Ai||(e=En(e)),!e)return new qe;if(e instanceof qe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new qe(a,o,l,e.opacity)}function wl(e,t,n,r){return arguments.length===1?Ed(e):new qe(e,t,n,r??1)}function qe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}El(qe,wl,fd(Ai,{brighter(e){return e=e==null?aa:Math.pow(aa,e),new qe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$i:Math.pow($i,e),new qe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new be(Sl(e>=240?e-240:e+120,i,r),Sl(e,i,r),Sl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new qe(_d(this.h),ca(this.s),ca(this.l),la(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=la(this.opacity);return`${e===1?"hsl(":"hsla("}${_d(this.h)}, ${ca(this.s)*100}%, ${ca(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _d(e){return e=(e||0)%360,e<0?e+360:e}function ca(e){return Math.max(0,Math.min(1,e||0))}function Sl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ol=e=>()=>e;function gx(e,t){return function(n){return e+n*t}}function vx(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function yx(e){return(e=+e)==1?wd:function(t,n){return n-t?vx(t,n,e):Ol(isNaN(t)?n:t)}}function wd(e,t){var n=t-e;return n?gx(e,n):Ol(isNaN(e)?t:e)}const ua=function e(t){var n=yx(t);function r(i,s){var a=n((i=_l(i)).r,(s=_l(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=wd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function xx(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function bx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ex(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Li(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function _x(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Me(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Li(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Tl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ml=new RegExp(Tl.source,"g");function Sx(e){return function(){return e}}function Ox(e){return function(t){return e(t)+""}}function Sd(e,t){var n=Tl.lastIndex=Ml.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Tl.exec(e))&&(i=Ml.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Me(r,i)})),n=Ml.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Ox(l[0].x):Sx(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Li(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ol(t):(n==="number"?Me:n==="string"?(r=En(t))?(t=r,ua):Sd:t instanceof En?ua:t instanceof Date?_x:bx(t)?xx:Array.isArray(t)?Ex:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wx:Me)(e,t)}function Od(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Td=180/Math.PI,Cl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Md(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Td,skewX:Math.atan(l)*Td,scaleX:a,scaleY:o}}var ha;function Tx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cl:Md(t.a,t.b,t.c,t.d,t.e,t.f)}function Mx(e){return e==null||(ha||(ha=document.createElementNS("http://www.w3.org/2000/svg","g")),ha.setAttribute("transform",e),!(e=ha.transform.baseVal.consolidate()))?Cl:(e=e.matrix,Md(e.a,e.b,e.c,e.d,e.e,e.f))}function Cd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var v=f.push("translate(",null,t,null,n);p.push({i:v-4,x:Me(c,d)},{i:v-2,x:Me(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Me(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Me(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var v=f.push(i(f)+"scale(",null,",",null,")");p.push({i:v-4,x:Me(c,d)},{i:v-2,x:Me(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,v=h.length,m;++p<v;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var Cx=Cd(Tx,"px, ","px)","deg)"),Ax=Cd(Mx,", ",")",")");function $x(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Vr=0,ki=0,Di=0,Ad=1e3,da,Ii,fa=0,ur=0,pa=0,Ni=typeof performance=="object"&&performance.now?performance:Date,$d=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Al(){return ur||($d(Rx),ur=Ni.now()+pa)}function Rx(){ur=0}function ma(){this._call=this._time=this._next=null}ma.prototype=Rd.prototype={constructor:ma,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Al():+n)+(t==null?0:+t),!this._next&&Ii!==this&&(Ii?Ii._next=this:da=this,Ii=this),this._call=e,this._time=n,$l()},stop:function(){this._call&&(this._call=null,this._time=1/0,$l())}};function Rd(e,t,n){var r=new ma;return r.restart(e,t,n),r}function Lx(){Al(),++Vr;for(var e=da,t;e;)(t=ur-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vr}function Ld(){ur=(fa=Ni.now())+pa,Vr=ki=0;try{Lx()}finally{Vr=0,Dx(),ur=0}}function kx(){var e=Ni.now(),t=e-fa;t>Ad&&(pa-=t,fa=e)}function Dx(){for(var e,t=da,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:da=n);Ii=e,$l(r)}function $l(e){if(!Vr){ki&&(ki=clearTimeout(ki));var t=e-ur;t>24?(e<1/0&&(ki=setTimeout(Ld,e-Ni.now()-pa)),Di&&(Di=clearInterval(Di))):(Di||(fa=Ni.now(),Di=setInterval(kx,Ad)),Vr=1,$d(Ld))}}function kd(e,t,n){var r=new ma;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ix=ml("start","end","cancel","interrupt"),Nx=[],Dd=0,Id=1,Rl=2,ga=3,Nd=4,Ll=5,va=6;function ya(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Px(e,n,{name:t,index:r,group:i,on:Ix,tween:Nx,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Dd})}function kl(e,t){var n=Ye(e,t);if(n.state>Dd)throw new Error("too late; already scheduled");return n}function ln(e,t){var n=Ye(e,t);if(n.state>ga)throw new Error("too late; already running");return n}function Ye(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Px(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Rd(s,0,n.time);function s(c){n.state=Id,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Id)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===ga)return kd(a);f.state===Nd?(f.state=va,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=va,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(kd(function(){n.state===ga&&(n.state=Nd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Rl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rl){for(n.state=ga,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Ll,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Ll&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=va,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Dl(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Rl&&r.state<Ll,r.state=va,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function Ux(e){return this.each(function(){Dl(this,e)})}function Bx(e,t){var n,r;return function(){var i=ln(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Hx(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=ln(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function Vx(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ye(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Bx:Hx)(n,e,t))}function Il(e,t,n){var r=e._id;return e.each(function(){var i=ln(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ye(i,r).value[t]}}function Pd(e,t){var n;return(typeof t=="number"?Me:t instanceof En?ua:(n=En(t))?(t=n,ua):Sd)(e,t)}function Fx(e){return function(){this.removeAttribute(e)}}function zx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gx(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function jx(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function Wx(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function qx(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Yx(e,t){var n=ia(e),r=n==="transform"?Ax:Pd;return this.attrTween(e,typeof t=="function"?(n.local?qx:Wx)(n,r,Il(this,"attr."+e,t)):t==null?(n.local?zx:Fx)(n):(n.local?jx:Gx)(n,r,t))}function Xx(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Zx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Kx(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Zx(e,s)),n}return i._value=t,i}function Qx(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Xx(e,s)),n}return i._value=t,i}function Jx(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ia(e);return this.tween(n,(r.local?Kx:Qx)(r,t))}function tb(e,t){return function(){kl(this,e).delay=+t.apply(this,arguments)}}function eb(e,t){return t=+t,function(){kl(this,e).delay=t}}function nb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tb:eb)(t,e)):Ye(this.node(),t).delay}function rb(e,t){return function(){ln(this,e).duration=+t.apply(this,arguments)}}function ib(e,t){return t=+t,function(){ln(this,e).duration=t}}function sb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rb:ib)(t,e)):Ye(this.node(),t).duration}function ab(e,t){if(typeof t!="function")throw new Error;return function(){ln(this,e).ease=t}}function ob(e){var t=this._id;return arguments.length?this.each(ab(t,e)):Ye(this.node(),t).ease}function lb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ln(this,e).ease=n}}function cb(e){if(typeof e!="function")throw new Error;return this.each(lb(this._id,e))}function ub(e){typeof e!="function"&&(e=rd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new _n(r,this._parents,this._name,this._id)}function hb(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new _n(a,this._parents,this._name,this._id)}function db(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function fb(e,t,n){var r,i,s=db(t)?kl:ln;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function pb(e,t){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(e):this.each(fb(n,e,t))}function mb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gb(){return this.on("end.remove",mb(this._id))}function vb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,ya(c[h],t,n,h,c,Ye(u,n)));return new _n(s,this._parents,t,n)}function yb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Ye(u,n),v=0,m=h.length;v<m;++v)(f=h[v])&&ya(f,t,n,v,h,p);s.push(h),a.push(u)}return new _n(s,a,t,n)}var xb=Ci.prototype.constructor;function bb(){return new xb(this._groups,this._parents)}function Eb(e,t){var n,r,i;return function(){var s=Br(this,e),a=(this.style.removeProperty(e),Br(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ud(e){return function(){this.style.removeProperty(e)}}function _b(e,t,n){var r,i=n+"",s;return function(){var a=Br(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function wb(e,t,n){var r,i,s;return function(){var a=Br(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Br(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function Sb(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=ln(this,e),c=l.on,u=l.value[s]==null?o||(o=Ud(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function Ob(e,t,n){var r=(e+="")=="transform"?Cx:Pd;return t==null?this.styleTween(e,Eb(e,r)).on("end.style."+e,Ud(e)):typeof t=="function"?this.styleTween(e,wb(e,r,Il(this,"style."+e,t))).each(Sb(this._id,e)):this.styleTween(e,_b(e,r,t),n).on("end.style."+e,null)}function Tb(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Mb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Tb(e,a,n)),r}return s._value=t,s}function Cb(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Mb(e,t,n??""))}function Ab(e){return function(){this.textContent=e}}function $b(e){return function(){var t=e(this);this.textContent=t??""}}function Rb(e){return this.tween("text",typeof e=="function"?$b(Il(this,"text",e)):Ab(e==null?"":e+""))}function Lb(e){return function(t){this.textContent=e.call(this,t)}}function kb(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Lb(i)),t}return r._value=e,r}function Db(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,kb(e))}function Ib(){for(var e=this._name,t=this._id,n=Bd(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Ye(l,t);ya(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _n(r,this._parents,e,n)}function Nb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=ln(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var Pb=0;function _n(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Bd(){return++Pb}var wn=Ci.prototype;_n.prototype={constructor:_n,select:vb,selectAll:yb,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:ub,merge:hb,selection:bb,transition:Ib,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:pb,attr:Yx,attrTween:Jx,style:Ob,styleTween:Cb,text:Rb,textTween:Db,remove:gb,tween:Vx,delay:nb,duration:sb,ease:ob,easeVarying:cb,end:Nb,[Symbol.iterator]:wn[Symbol.iterator]};const Ub=e=>+e;function Hd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bb={time:null,delay:0,duration:250,ease:Hd};function Hb(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Vb(e){var t,n;e instanceof _n?(t=e._id,e=e._name):(t=Bd(),(n=Bb).time=Al(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&ya(l,e,t,c,a,n||Hb(l,t));return new _n(r,this._parents,e,t)}Ci.prototype.interrupt=Ux,Ci.prototype.transition=Vb;const Nl=e=>()=>e;function Fb(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function zb(e){e.stopImmediatePropagation()}function Pl(e){e.preventDefault(),e.stopImmediatePropagation()}var Vd={name:"drag"},Ul={name:"space"},Fr={name:"handle"},zr={name:"center"};const{abs:Fd,max:ce,min:ue}=Math;function zd(e){return[+e[0],+e[1]]}function Gd(e){return[zd(e[0]),zd(e[1])]}var xa={name:"x",handles:["w","e"].map(ba),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Bl={name:"y",handles:["n","s"].map(ba),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Sn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},jd={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Wd={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Gb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ba(e){return{type:e}}function Wb(e){return!e.ctrlKey&&!e.button}function qb(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Yb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hl(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Xb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function qd(){return Zb(xa)}function Zb(e){var t=qb,n=Wb,r=Yb,i=!0,s=ml("start","brush","end"),a=6,o;function l(m){var y=m.property("__brush",v).selectAll(".overlay").data([ba("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Sn.overlay).merge(y).each(function(){var b=Hl(this).extent;D(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),m.selectAll(".selection").data([ba("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Sn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var g=m.selectAll(".handle").data(e.handles,function(b){return b.type});g.exit().remove(),g.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return Sn[b.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,y,g){m.tween?m.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,_=u(b,arguments),S=w.selection,R=e.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),I=Li(S,R);function k(L){w.selection=L===1&&R===null?null:I(L),c.call(b),_.brush()}return S!==null&&R!==null?k:k(1)}):m.each(function(){var b=this,w=arguments,_=b.__brush,S=e.input(typeof y=="function"?y.apply(b,w):y,_.extent),R=u(b,w).beforestart();Dl(b),_.selection=S===null?null:S,c.call(b),R.start(g).brush(g).end(g)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=D(this),y=Hl(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(g){return g.type[g.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(g){return g.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(g){return g.type==="n"||g.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(g){return g.type==="e"||g.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,y,g){var b=m.__brush.emitter;return b&&(!g||!b.clean)?b:new d(m,y,g)}function d(m,y,g){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=g}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,g){var b=D(this.that).datum();s.call(m,this.that,new Fb(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:g,dispatch:s}),b)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,g=m.target.__data__.type,b=(i&&m.metaKey?g="overlay":g)==="selection"?Vd:i&&m.altKey?zr:Fr,w=e===Bl?null:Gb[g],_=e===xa?null:jb[g],S=Hl(y),R=S.extent,I=S.selection,k=R[0][0],L,M,V=R[0][1],P,H,E=R[1][0],A,$,U=R[1][1],B,W,K=0,Q=0,ft,st=w&&_&&i&&m.shiftKey,gt,X,nt=Array.from(m.touches||[m],it=>{const At=it.identifier;return it=or(it,y),it.point0=it.slice(),it.identifier=At,it});Dl(y);var pt=u(y,arguments,!0).beforestart();if(g==="overlay"){I&&(ft=!0);const it=[nt[0],nt[1]||nt[0]];S.selection=I=[[L=e===Bl?k:ue(it[0][0],it[1][0]),P=e===xa?V:ue(it[0][1],it[1][1])],[A=e===Bl?E:ce(it[0][0],it[1][0]),B=e===xa?U:ce(it[0][1],it[1][1])]],nt.length>1&&Mt(m)}else L=I[0][0],P=I[0][1],A=I[1][0],B=I[1][1];M=L,H=P,$=A,W=B;var q=D(y).attr("pointer-events","none"),tt=q.selectAll(".overlay").attr("cursor",Sn[g]);if(m.touches)pt.moved=z,pt.ended=Et;else{var ct=D(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",Et,!0);i&&ct.on("keydown.brush",qt,!0).on("keyup.brush",Nt,!0),rx(m.view)}c.call(y),pt.start(m,b.name);function z(it){for(const At of it.changedTouches||[it])for(const De of nt)De.identifier===At.identifier&&(De.cur=or(At,y));if(st&&!gt&&!X&&nt.length===1){const At=nt[0];Fd(At.cur[0]-At[0])>Fd(At.cur[1]-At[1])?X=!0:gt=!0}for(const At of nt)At.cur&&(At[0]=At.cur[0],At[1]=At.cur[1]);ft=!0,Pl(it),Mt(it)}function Mt(it){const At=nt[0],De=At.point0;var Ie;switch(K=At[0]-De[0],Q=At[1]-De[1],b){case Ul:case Vd:{w&&(K=ce(k-L,ue(E-A,K)),M=L+K,$=A+K),_&&(Q=ce(V-P,ue(U-B,Q)),H=P+Q,W=B+Q);break}case Fr:{nt[1]?(w&&(M=ce(k,ue(E,nt[0][0])),$=ce(k,ue(E,nt[1][0])),w=1),_&&(H=ce(V,ue(U,nt[0][1])),W=ce(V,ue(U,nt[1][1])),_=1)):(w<0?(K=ce(k-L,ue(E-L,K)),M=L+K,$=A):w>0&&(K=ce(k-A,ue(E-A,K)),M=L,$=A+K),_<0?(Q=ce(V-P,ue(U-P,Q)),H=P+Q,W=B):_>0&&(Q=ce(V-B,ue(U-B,Q)),H=P,W=B+Q));break}case zr:{w&&(M=ce(k,ue(E,L-K*w)),$=ce(k,ue(E,A+K*w))),_&&(H=ce(V,ue(U,P-Q*_)),W=ce(V,ue(U,B+Q*_)));break}}$<M&&(w*=-1,Ie=L,L=A,A=Ie,Ie=M,M=$,$=Ie,g in jd&&tt.attr("cursor",Sn[g=jd[g]])),W<H&&(_*=-1,Ie=P,P=B,B=Ie,Ie=H,H=W,W=Ie,g in Wd&&tt.attr("cursor",Sn[g=Wd[g]])),S.selection&&(I=S.selection),gt&&(M=I[0][0],$=I[1][0]),X&&(H=I[0][1],W=I[1][1]),(I[0][0]!==M||I[0][1]!==H||I[1][0]!==$||I[1][1]!==W)&&(S.selection=[[M,H],[$,W]],c.call(y),pt.brush(it,b.name))}function Et(it){if(zb(it),it.touches){if(it.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ix(it.view,ft),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),tt.attr("cursor",Sn.overlay),S.selection&&(I=S.selection),Xb(I)&&(S.selection=null,c.call(y)),pt.end(it,b.name)}function qt(it){switch(it.keyCode){case 16:{st=w&&_;break}case 18:{b===Fr&&(w&&(A=$-K*w,L=M+K*w),_&&(B=W-Q*_,P=H+Q*_),b=zr,Mt(it));break}case 32:{(b===Fr||b===zr)&&(w<0?A=$-K:w>0&&(L=M-K),_<0?B=W-Q:_>0&&(P=H-Q),b=Ul,tt.attr("cursor",Sn.selection),Mt(it));break}default:return}Pl(it)}function Nt(it){switch(it.keyCode){case 16:{st&&(gt=X=st=!1,Mt(it));break}case 18:{b===zr&&(w<0?A=$:w>0&&(L=M),_<0?B=W:_>0&&(P=H),b=Fr,Mt(it));break}case 32:{b===Ul&&(it.altKey?(w&&(A=$-K*w,L=M+K*w),_&&(B=W-Q*_,P=H+Q*_),b=zr):(w<0?A=$:w>0&&(L=M),_<0?B=W:_>0&&(P=H),b=Fr),tt.attr("cursor",Sn[g]),Mt(it));break}default:return}Pl(it)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function v(){var m=this.__brush||{selection:null};return m.extent=Gd(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Nl(Gd(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Nl(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Nl(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const Vl=Math.PI,Fl=2*Vl,hr=1e-6,Kb=Fl-hr;function Yd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Qb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yd;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let zl=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Yd:Qb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>hr)if(!(Math.abs(d*l-c*u)>hr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,v=l*l+c*c,m=f*f+p*p,y=Math.sqrt(v),g=Math.sqrt(h),b=s*Math.tan((Vl-Math.acos((v+h-m)/(2*y*g)))/2),w=b/g,_=b/y;Math.abs(w-1)>hr&&this._append`L${t+w*u},${n+w*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>hr||Math.abs(this._y1-u)>hr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Fl+Fl),h>Kb?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>hr&&this._append`A${r},${r},0,${+(h>=Vl)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Xd(){return new zl}Xd.prototype=zl.prototype;function Jb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ea(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gr(e){return e=Ea(Math.abs(e)),e?e[1]:NaN}function tE(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function eE(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pi(e){if(!(t=nE.exec(e)))throw new Error("invalid format: "+e);var t;return new Gl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Pi.prototype=Gl.prototype;function Gl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Gl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rE(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Zd;function iE(e,t){var n=Ea(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Zd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Ea(e,Math.max(0,t+s-1))[0]}function Kd(e,t){var n=Ea(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Qd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Jb,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Kd(e*100,t),r:Kd,s:iE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jd(e){return e}var tf=Array.prototype.map,ef=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sE(e){var t=e.grouping===void 0||e.thousands===void 0?Jd:tE(tf.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Jd:eE(tf.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Pi(d);var h=d.fill,f=d.align,p=d.sign,v=d.symbol,m=d.zero,y=d.width,g=d.comma,b=d.precision,w=d.trim,_=d.type;_==="n"?(g=!0,_="g"):Qd[_]||(b===void 0&&(b=12),w=!0,_="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var S=v==="$"?n:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",R=v==="$"?r:/[%p]/.test(_)?a:"",I=Qd[_],k=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function L(M){var V=S,P=R,H,E,A;if(_==="c")P=I(M)+P,M="";else{M=+M;var $=M<0||1/M<0;if(M=isNaN(M)?l:I(Math.abs(M),b),w&&(M=rE(M)),$&&+M==0&&p!=="+"&&($=!1),V=($?p==="("?p:o:p==="-"||p==="("?"":p)+V,P=(_==="s"?ef[8+Zd/3]:"")+P+($&&p==="("?")":""),k){for(H=-1,E=M.length;++H<E;)if(A=M.charCodeAt(H),48>A||A>57){P=(A===46?i+M.slice(H+1):M.slice(H))+P,M=M.slice(0,H);break}}}g&&!m&&(M=t(M,1/0));var U=V.length+M.length+P.length,B=U<y?new Array(y-U+1).join(h):"";switch(g&&m&&(M=t(B+M,B.length?y-P.length:1/0),B=""),f){case"<":M=V+M+P+B;break;case"=":M=V+B+M+P;break;case"^":M=B.slice(0,U=B.length>>1)+V+M+P+B.slice(U);break;default:M=B+V+M+P;break}return s(M)}return L.toString=function(){return d+""},L}function u(d,h){var f=c((d=Pi(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Gr(h)/3)))*3,v=Math.pow(10,-p),m=ef[8+p/3];return function(y){return f(v*y)+m}}return{format:c,formatPrefix:u}}var _a,jl,nf;aE({thousands:",",grouping:[3],currency:["$",""]});function aE(e){return _a=sE(e),jl=_a.format,nf=_a.formatPrefix,_a}function oE(e){return Math.max(0,-Gr(Math.abs(e)))}function lE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gr(t)/3)))*3-Gr(Math.abs(e)))}function cE(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gr(t)-Gr(e))+1}var Rt=1e-6,rf=1e-12,yt=Math.PI,Ee=yt/2,sf=yt/4,Ce=yt*2,me=180/yt,Xt=yt/180,Lt=Math.abs,af=Math.atan,dr=Math.atan2,It=Math.cos,uE=Math.exp,hE=Math.log,Ct=Math.sin,Gn=Math.sign||function(e){return e>0?1:e<0?-1:0},Xe=Math.sqrt,dE=Math.tan;function fE(e){return e>1?0:e<-1?yt:Math.acos(e)}function On(e){return e>1?Ee:e<-1?-Ee:Math.asin(e)}function Pe(){}function wa(e,t){e&&lf.hasOwnProperty(e.type)&&lf[e.type](e,t)}var of={Feature:function(e,t){wa(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)wa(n[r].geometry,t)}},lf={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Wl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Wl(n[r],t,0)},Polygon:function(e,t){cf(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)cf(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)wa(n[r],t)}};function Wl(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function cf(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Wl(e[n],t,1);t.polygonEnd()}function jr(e,t){e&&of.hasOwnProperty(e.type)?of[e.type](e,t):wa(e,t)}function ql(e){return[dr(e[1],e[0]),On(e[2])]}function Wr(e){var t=e[0],n=e[1],r=It(n);return[r*It(t),r*Ct(t),Ct(n)]}function Sa(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Oa(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Yl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ta(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Xl(e){var t=Xe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Zl(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Kl(e,t){return Lt(e)>yt&&(e-=Math.round(e/Ce)*Ce),[e,t]}Kl.invert=Kl;function uf(e,t,n){return(e%=Ce)?t||n?Zl(df(e),ff(t,n)):df(e):t||n?ff(t,n):Kl}function hf(e){return function(t,n){return t+=e,Lt(t)>yt&&(t-=Math.round(t/Ce)*Ce),[t,n]}}function df(e){var t=hf(e);return t.invert=hf(-e),t}function ff(e,t){var n=It(e),r=Ct(e),i=It(t),s=Ct(t);function a(o,l){var c=It(l),u=It(o)*c,d=Ct(o)*c,h=Ct(l),f=h*n+u*r;return[dr(d*i-f*s,u*n-h*r),On(f*i+d*s)]}return a.invert=function(o,l){var c=It(l),u=It(o)*c,d=Ct(o)*c,h=Ct(l),f=h*i-d*s;return[dr(d*i+h*s,u*n+f*r),On(f*n-u*r)]},a}function pE(e){e=uf(e[0]*Xt,e[1]*Xt,e.length>2?e[2]*Xt:0);function t(n){return n=e(n[0]*Xt,n[1]*Xt),n[0]*=me,n[1]*=me,n}return t.invert=function(n){return n=e.invert(n[0]*Xt,n[1]*Xt),n[0]*=me,n[1]*=me,n},t}function mE(e,t,n,r,i,s){if(n){var a=It(t),o=Ct(t),l=r*n;i==null?(i=t+r*Ce,s=t-l/2):(i=pf(a,i),s=pf(a,s),(r>0?i<s:i>s)&&(i+=r*Ce));for(var c,u=i;r>0?u>s:u<s;u-=l)c=ql([a,-o*It(u),-o*Ct(u)]),e.point(c[0],c[1])}}function pf(e,t){t=Wr(t),t[0]-=e,Xl(t);var n=fE(-t[1]);return((-t[2]<0?-n:n)+Ce-Rt)%Ce}function mf(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Pe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ma(e,t){return Lt(e[0]-t[0])<Rt&&Lt(e[1]-t[1])<Rt}function Ca(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function gf(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((v=p.length-1)<=0)){var v,m=p[0],y=p[v],g;if(Ma(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}y[0]+=2*Rt}s.push(g=new Ca(m,p,null,!0)),a.push(g.o=new Ca(m,null,g,!1)),s.push(g=new Ca(y,p,null,!1)),a.push(g.o=new Ca(y,null,g,!0))}}),!!s.length){for(a.sort(t),vf(s),vf(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function vf(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Ql(e){return Lt(e[0])<=yt?e[0]:Gn(e[0])*((Lt(e[0])+yt)%Ce-yt)}function gE(e,t){var n=Ql(t),r=t[1],i=Ct(r),s=[Ct(n),-It(n),0],a=0,o=0,l=new sr;i===1?r=Ee+Rt:i===-1&&(r=-Ee-Rt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=Ql(f),v=f[1]/2+sf,m=Ct(v),y=It(v),g=0;g<h;++g,p=w,m=S,y=R,f=b){var b=d[g],w=Ql(b),_=b[1]/2+sf,S=Ct(_),R=It(_),I=w-p,k=I>=0?1:-1,L=k*I,M=L>yt,V=m*S;if(l.add(dr(V*k*Ct(L),y*R+V*It(L))),a+=M?I+k*Ce:I,M^p>=n^w>=n){var P=Oa(Wr(f),Wr(b));Xl(P);var H=Oa(s,P);Xl(H);var E=(M^I>=0?-1:1)*On(H[2]);(r>E||r===E&&(P[0]||P[1]))&&(o+=M^I>=0?1:-1)}}return(a<-Rt||a<Rt&&l<-rf)^o&1}function yf(e,t,n,r){return function(i){var s=t(i),a=mf(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:v,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=g,h.lineEnd=b,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=v,h.lineEnd=m,u=Zh(u);var w=gE(c,r);u.length?(l||(i.polygonStart(),l=!0),gf(u,yE,w,n,i)):w&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(w,_){e(w,_)&&i.point(w,_)}function p(w,_){s.point(w,_)}function v(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function y(w,_){d.push([w,_]),o.point(w,_)}function g(){o.lineStart(),d=[]}function b(){y(d[0][0],d[0][1]),o.lineEnd();var w=o.clean(),_=a.result(),S,R=_.length,I,k,L;if(d.pop(),c.push(d),d=null,!!R){if(w&1){if(k=_[0],(I=k.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<I;++S)i.point((L=k[S])[0],L[1]);i.lineEnd()}return}R>1&&w&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(vE))}}return h}}function vE(e){return e.length>1}function yE(e,t){return((e=e.x)[0]<0?e[1]-Ee-Rt:Ee-e[1])-((t=t.x)[0]<0?t[1]-Ee-Rt:Ee-t[1])}const xf=yf(function(){return!0},xE,EE,[-yt,-Ee]);function xE(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?yt:-yt,l=Lt(s-t);Lt(l-yt)<Rt?(e.point(t,n=(n+a)/2>0?Ee:-Ee),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=yt&&(Lt(t-r)<Rt&&(t-=r*Rt),Lt(s-o)<Rt&&(s-=o*Rt),n=bE(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function bE(e,t,n,r){var i,s,a=Ct(e-n);return Lt(a)>Rt?af((Ct(t)*(s=It(r))*Ct(n)-Ct(r)*(i=It(t))*Ct(e))/(i*s*a)):(t+r)/2}function EE(e,t,n,r){var i;if(e==null)i=n*Ee,r.point(-yt,i),r.point(0,i),r.point(yt,i),r.point(yt,0),r.point(yt,-i),r.point(0,-i),r.point(-yt,-i),r.point(-yt,0),r.point(-yt,i);else if(Lt(e[0]-t[0])>Rt){var s=e[0]<t[0]?yt:-yt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function _E(e){var t=It(e),n=2*Xt,r=t>0,i=Lt(t)>Rt;function s(u,d,h,f){mE(f,e,n,h,u,d)}function a(u,d){return It(u)*It(d)>t}function o(u){var d,h,f,p,v;return{lineStart:function(){p=f=!1,v=1},point:function(m,y){var g=[m,y],b,w=a(m,y),_=r?w?0:c(m,y):w?c(m+(m<0?yt:-yt),y):0;if(!d&&(p=f=w)&&u.lineStart(),w!==f&&(b=l(d,g),(!b||Ma(d,b)||Ma(g,b))&&(g[2]=1)),w!==f)v=0,w?(u.lineStart(),b=l(g,d),u.point(b[0],b[1])):(b=l(d,g),u.point(b[0],b[1],2),u.lineEnd()),d=b;else if(i&&d&&r^w){var S;!(_&h)&&(S=l(g,d,!0))&&(v=0,r?(u.lineStart(),u.point(S[0][0],S[0][1]),u.point(S[1][0],S[1][1]),u.lineEnd()):(u.point(S[1][0],S[1][1]),u.lineEnd(),u.lineStart(),u.point(S[0][0],S[0][1],3)))}w&&(!d||!Ma(d,g))&&u.point(g[0],g[1]),d=g,f=w,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return v|(p&&f)<<1}}}function l(u,d,h){var f=Wr(u),p=Wr(d),v=[1,0,0],m=Oa(f,p),y=Sa(m,m),g=m[0],b=y-g*g;if(!b)return!h&&u;var w=t*y/b,_=-t*g/b,S=Oa(v,m),R=Ta(v,w),I=Ta(m,_);Yl(R,I);var k=S,L=Sa(R,k),M=Sa(k,k),V=L*L-M*(Sa(R,R)-1);if(!(V<0)){var P=Xe(V),H=Ta(k,(-L-P)/M);if(Yl(H,R),H=ql(H),!h)return H;var E=u[0],A=d[0],$=u[1],U=d[1],B;A<E&&(B=E,E=A,A=B);var W=A-E,K=Lt(W-yt)<Rt,Q=K||W<Rt;if(!K&&U<$&&(B=$,$=U,U=B),Q?K?$+U>0^H[1]<(Lt(H[0]-E)<Rt?$:U):$<=H[1]&&H[1]<=U:W>yt^(E<=H[0]&&H[0]<=A)){var ft=Ta(k,(-L+P)/M);return Yl(ft,R),[H,ql(ft)]}}}function c(u,d){var h=r?e:yt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return yf(a,o,s,r?[0,-e]:[-yt,e-yt])}function wE(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var Ui=1e9,Aa=-Ui;function SE(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Lt(c[0]-e)<Rt?u>0?0:3:Lt(c[0]-n)<Rt?u>0?2:1:Lt(c[1]-t)<Rt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=mf(),h,f,p,v,m,y,g,b,w,_,S,R={point:I,lineStart:V,lineEnd:P,polygonStart:L,polygonEnd:M};function I(E,A){i(E,A)&&u.point(E,A)}function k(){for(var E=0,A=0,$=f.length;A<$;++A)for(var U=f[A],B=1,W=U.length,K=U[0],Q,ft,st=K[0],gt=K[1];B<W;++B)Q=st,ft=gt,K=U[B],st=K[0],gt=K[1],ft<=r?gt>r&&(st-Q)*(r-ft)>(gt-ft)*(e-Q)&&++E:gt<=r&&(st-Q)*(r-ft)<(gt-ft)*(e-Q)&&--E;return E}function L(){u=d,h=[],f=[],S=!0}function M(){var E=k(),A=S&&E,$=(h=Zh(h)).length;(A||$)&&(c.polygonStart(),A&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),$&&gf(h,o,E,s,c),c.polygonEnd()),u=c,h=f=p=null}function V(){R.point=H,f&&f.push(p=[]),_=!0,w=!1,g=b=NaN}function P(){h&&(H(v,m),y&&w&&d.rejoin(),h.push(d.result())),R.point=I,w&&u.lineEnd()}function H(E,A){var $=i(E,A);if(f&&p.push([E,A]),_)v=E,m=A,y=$,_=!1,$&&(u.lineStart(),u.point(E,A));else if($&&w)u.point(E,A);else{var U=[g=Math.max(Aa,Math.min(Ui,g)),b=Math.max(Aa,Math.min(Ui,b))],B=[E=Math.max(Aa,Math.min(Ui,E)),A=Math.max(Aa,Math.min(Ui,A))];wE(U,B,e,t,n,r)?(w||(u.lineStart(),u.point(U[0],U[1])),u.point(B[0],B[1]),$||u.lineEnd(),S=!1):$&&(u.lineStart(),u.point(E,A),S=!1)}g=E,b=A,w=$}return R}}const Jl=e=>e;var tc=new sr,ec=new sr,bf,Ef,nc,rc,Tn={point:Pe,lineStart:Pe,lineEnd:Pe,polygonStart:function(){Tn.lineStart=OE,Tn.lineEnd=ME},polygonEnd:function(){Tn.lineStart=Tn.lineEnd=Tn.point=Pe,tc.add(Lt(ec)),ec=new sr},result:function(){var e=tc/2;return tc=new sr,e}};function OE(){Tn.point=TE}function TE(e,t){Tn.point=_f,bf=nc=e,Ef=rc=t}function _f(e,t){ec.add(rc*e-nc*t),nc=e,rc=t}function ME(){_f(bf,Ef)}var qr=1/0,$a=qr,Bi=-qr,Ra=Bi,La={point:CE,lineStart:Pe,lineEnd:Pe,polygonStart:Pe,polygonEnd:Pe,result:function(){var e=[[qr,$a],[Bi,Ra]];return Bi=Ra=-($a=qr=1/0),e}};function CE(e,t){e<qr&&(qr=e),e>Bi&&(Bi=e),t<$a&&($a=t),t>Ra&&(Ra=t)}var ic=0,sc=0,Hi=0,ka=0,Da=0,Yr=0,ac=0,oc=0,Vi=0,wf,Sf,cn,un,Ue={point:fr,lineStart:Of,lineEnd:Tf,polygonStart:function(){Ue.lineStart=RE,Ue.lineEnd=LE},polygonEnd:function(){Ue.point=fr,Ue.lineStart=Of,Ue.lineEnd=Tf},result:function(){var e=Vi?[ac/Vi,oc/Vi]:Yr?[ka/Yr,Da/Yr]:Hi?[ic/Hi,sc/Hi]:[NaN,NaN];return ic=sc=Hi=ka=Da=Yr=ac=oc=Vi=0,e}};function fr(e,t){ic+=e,sc+=t,++Hi}function Of(){Ue.point=AE}function AE(e,t){Ue.point=$E,fr(cn=e,un=t)}function $E(e,t){var n=e-cn,r=t-un,i=Xe(n*n+r*r);ka+=i*(cn+e)/2,Da+=i*(un+t)/2,Yr+=i,fr(cn=e,un=t)}function Tf(){Ue.point=fr}function RE(){Ue.point=kE}function LE(){Mf(wf,Sf)}function kE(e,t){Ue.point=Mf,fr(wf=cn=e,Sf=un=t)}function Mf(e,t){var n=e-cn,r=t-un,i=Xe(n*n+r*r);ka+=i*(cn+e)/2,Da+=i*(un+t)/2,Yr+=i,i=un*e-cn*t,ac+=i*(cn+e),oc+=i*(un+t),Vi+=i*3,fr(cn=e,un=t)}function Cf(e){this._context=e}Cf.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ce);break}}},result:Pe};var lc=new sr,cc,Af,$f,Fi,zi,Gi={point:Pe,lineStart:function(){Gi.point=DE},lineEnd:function(){cc&&Rf(Af,$f),Gi.point=Pe},polygonStart:function(){cc=!0},polygonEnd:function(){cc=null},result:function(){var e=+lc;return lc=new sr,e}};function DE(e,t){Gi.point=Rf,Af=Fi=e,$f=zi=t}function Rf(e,t){Fi-=e,zi-=t,lc.add(Xe(Fi*Fi+zi*zi)),Fi=e,zi=t}let Lf,Ia,kf,Df;class If{constructor(t){this._append=t==null?Nf:IE(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==kf||this._append!==Ia){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,kf=r,Ia=this._append,Df=this._,this._=i}this._+=Df;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Nf(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function IE(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Nf;if(t!==Lf){const n=10**t;Lf=t,Ia=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return Ia}function NE(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),jr(o,i(s))),s.result()}return a.area=function(o){return jr(o,i(Tn)),Tn.result()},a.measure=function(o){return jr(o,i(Gi)),Gi.result()},a.bounds=function(o){return jr(o,i(La)),La.result()},a.centroid=function(o){return jr(o,i(Ue)),Ue.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Jl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new If(n)):new Cf(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new If(n)),a},a.projection(e).digits(n).context(t)}function uc(e){return function(t){var n=new hc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function hc(){}hc.prototype={constructor:hc,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function dc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),jr(n,e.stream(La)),t(La.result()),r!=null&&e.clipExtent(r),e}function Pf(e,t,n){return dc(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function PE(e,t,n){return Pf(e,[[0,0],t],n)}function UE(e,t,n){return dc(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function BE(e,t,n){return dc(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Uf=16,HE=It(30*Xt);function Bf(e,t){return+t?FE(e,t):VE(e)}function VE(e){return uc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function FE(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,v,m){var y=c-r,g=u-i,b=y*y+g*g;if(b>4*t&&v--){var w=a+h,_=o+f,S=l+p,R=Xe(w*w+_*_+S*S),I=On(S/=R),k=Lt(Lt(S)-1)<Rt||Lt(s-d)<Rt?(s+d)/2:dr(_,w),L=e(k,I),M=L[0],V=L[1],P=M-r,H=V-i,E=g*P-y*H;(E*E/b>t||Lt((y*P+g*H)/b-.5)>.3||a*h+o*f+l*p<HE)&&(n(r,i,s,a,o,l,M,V,k,w/=R,_/=R,S,v,m),m.point(M,V),n(M,V,k,w,_,S,c,u,d,h,f,p,v,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,v,m={point:y,lineStart:g,lineEnd:w,polygonStart:function(){r.polygonStart(),m.lineStart=_},polygonEnd:function(){r.polygonEnd(),m.lineStart=g}};function y(I,k){I=e(I,k),r.point(I[0],I[1])}function g(){d=NaN,m.point=b,r.lineStart()}function b(I,k){var L=Wr([I,k]),M=e(I,k);n(d,h,u,f,p,v,d=M[0],h=M[1],u=I,f=L[0],p=L[1],v=L[2],Uf,r),r.point(d,h)}function w(){m.point=y,r.lineEnd()}function _(){g(),m.point=S,m.lineEnd=R}function S(I,k){b(i=I,k),s=d,a=h,o=f,l=p,c=v,m.point=b}function R(){n(d,h,u,f,p,v,s,a,i,o,l,c,Uf,r),m.lineEnd=w,w()}return m}}var zE=uc({point:function(e,t){this.stream.point(e*Xt,t*Xt)}});function GE(e){return uc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function jE(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Hf(e,t,n,r,i,s){if(!s)return jE(e,t,n,r,i);var a=It(s),o=Ct(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(v,m){return v*=r,m*=i,[l*v-c*m+t,n-c*v-l*m]}return p.invert=function(v,m){return[r*(u*v-d*m+h),i*(f-d*v-u*m)]},p}function Na(e){return Vf(function(){return e})()}function Vf(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,v=xf,m=null,y,g,b,w=Jl,_=.5,S,R,I,k,L;function M(E){return I(E[0]*Xt,E[1]*Xt)}function V(E){return E=I.invert(E[0],E[1]),E&&[E[0]*me,E[1]*me]}M.stream=function(E){return k&&L===E?k:k=zE(GE(u)(v(S(w(L=E)))))},M.preclip=function(E){return arguments.length?(v=E,p=void 0,H()):v},M.postclip=function(E){return arguments.length?(w=E,m=y=g=b=null,H()):w},M.clipAngle=function(E){return arguments.length?(v=+E?_E(p=E*Xt):(p=null,xf),H()):p*me},M.clipExtent=function(E){return arguments.length?(w=E==null?(m=y=g=b=null,Jl):SE(m=+E[0][0],y=+E[0][1],g=+E[1][0],b=+E[1][1]),H()):m==null?null:[[m,y],[g,b]]},M.scale=function(E){return arguments.length?(n=+E,P()):n},M.translate=function(E){return arguments.length?(r=+E[0],i=+E[1],P()):[r,i]},M.center=function(E){return arguments.length?(s=E[0]%360*Xt,a=E[1]%360*Xt,P()):[s*me,a*me]},M.rotate=function(E){return arguments.length?(o=E[0]%360*Xt,l=E[1]%360*Xt,c=E.length>2?E[2]%360*Xt:0,P()):[o*me,l*me,c*me]},M.angle=function(E){return arguments.length?(d=E%360*Xt,P()):d*me},M.reflectX=function(E){return arguments.length?(h=E?-1:1,P()):h<0},M.reflectY=function(E){return arguments.length?(f=E?-1:1,P()):f<0},M.precision=function(E){return arguments.length?(S=Bf(R,_=E*E),H()):Xe(_)},M.fitExtent=function(E,A){return Pf(M,E,A)},M.fitSize=function(E,A){return PE(M,E,A)},M.fitWidth=function(E,A){return UE(M,E,A)},M.fitHeight=function(E,A){return BE(M,E,A)};function P(){var E=Hf(n,0,0,h,f,d).apply(null,t(s,a)),A=Hf(n,r-E[0],i-E[1],h,f,d);return u=uf(o,l,c),R=Zl(t,A),I=Zl(u,R),S=Bf(R,_),H()}function H(){return k=L=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&V,P()}}function Ff(e){var t=0,n=yt/3,r=Vf(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Xt,n=s[1]*Xt):[t*me,n*me]},i}function WE(e){var t=It(e);function n(r,i){return[r*t,Ct(i)/t]}return n.invert=function(r,i){return[r/t,On(i*t)]},n}function qE(e,t){var n=Ct(e),r=(n+Ct(t))/2;if(Lt(r)<Rt)return WE(e);var i=1+n*(2*r-n),s=Xe(i)/r;function a(o,l){var c=Xe(i-2*r*Ct(l))/r;return[c*Ct(o*=r),s-c*It(o)]}return a.invert=function(o,l){var c=s-l,u=dr(o,Lt(c))*Gn(c);return c*r<0&&(u-=yt*Gn(o)*Gn(c)),[u/r,On((i-(o*o+c*c)*r*r)/(2*r))]},a}function zf(){return Ff(qE).scale(155.424).center([0,33.6442])}function YE(){return zf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function fc(e,t){return[e,hE(dE((Ee+t)/2))]}fc.invert=function(e,t){return[e,2*af(uE(t))-Ee]};function XE(){return ZE(fc).scale(961/Ce)}function ZE(e){var t=Na(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=yt*r(),h=t(pE(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===fc?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function Pa(e,t){return[e,t]}Pa.invert=Pa;function KE(){return Na(Pa).scale(152.63)}function QE(e,t){var n=It(e),r=e===t?Ct(e):(n-It(t))/(t-e),i=n/r+e;if(Lt(r)<Rt)return Pa;function s(a,o){var l=i-o,c=r*a;return[l*Ct(c),i-l*It(c)]}return s.invert=function(a,o){var l=i-o,c=dr(a,Lt(l))*Gn(l);return l*r<0&&(c-=yt*Gn(a)*Gn(l)),[c/r,i-Gn(r)*Xe(a*a+l*l)]},s}function JE(){return Ff(QE).scale(131.154).center([0,13.9389])}var ji=1.340264,Wi=-.081106,qi=893e-6,Yi=.003796,Ua=Xe(3)/2,t_=12;function Gf(e,t){var n=On(Ua*Ct(t)),r=n*n,i=r*r*r;return[e*It(n)/(Ua*(ji+3*Wi*r+i*(7*qi+9*Yi*r))),n*(ji+Wi*r+i*(qi+Yi*r))]}Gf.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<t_&&(o=n*(ji+Wi*r+i*(qi+Yi*r))-t,l=ji+3*Wi*r+i*(7*qi+9*Yi*r),n-=a=o/l,r=n*n,i=r*r*r,!(Lt(a)<rf));++s);return[Ua*e*(ji+3*Wi*r+i*(7*qi+9*Yi*r))/It(n),On(Ct(n)/Ua)]};function e_(){return Na(Gf).scale(177.158)}function jf(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}jf.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Lt(i)>Rt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function n_(){return Na(jf).scale(175.295)}function r_(e,t){return e.parent===t.parent?1:2}function i_(e){return e.reduce(s_,0)/e.length}function s_(e,t){return e+t.x}function a_(e){return 1+e.reduce(o_,0)}function o_(e,t){return Math.max(e,t.y)}function l_(e){for(var t;t=e.children;)e=t[0];return e}function c_(e){for(var t;t=e.children;)e=t[t.length-1];return e}function u_(){var e=r_,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=i_(f),h.y=a_(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=l_(s),c=c_(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function h_(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function d_(){return this.eachAfter(h_)}function f_(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function p_(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function m_(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function g_(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function v_(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function y_(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function x_(e){for(var t=this,n=b_(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function b_(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function E_(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function __(){return Array.from(this)}function w_(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function S_(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*O_(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function Xi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=C_)):t===void 0&&(t=M_);for(var n=new Zi(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new Zi(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore($_)}function T_(){return Xi(this).eachBefore(A_)}function M_(e){return e.children}function C_(e){return Array.isArray(e)?e[1]:null}function A_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function $_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Zi(e){this.data=e,this.depth=this.height=0,this.parent=null}Zi.prototype=Xi.prototype={constructor:Zi,count:d_,each:f_,eachAfter:m_,eachBefore:p_,find:g_,sum:v_,sort:y_,path:x_,ancestors:E_,descendants:__,leaves:w_,links:S_,copy:T_,[Symbol.iterator]:O_};function R_(e){return e==null?null:Wf(e)}function Wf(e){if(typeof e!="function")throw new Error;return e}function pr(){return 0}function Xr(e){return function(){return e}}const L_=1664525,k_=1013904223,qf=4294967296;function D_(){let e=1;return()=>(e=(L_*e+k_)%qf)/qf}function I_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function N_(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function P_(e,t){for(var n=0,r=(e=N_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Yf(a,s)?++n:(a=B_(i=U_(i,s)),n=0);return a}function U_(e,t){var n,r;if(pc(t,e))return[t];for(n=0;n<e.length;++n)if(Ba(t,e[n])&&pc(Ki(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Ba(Ki(e[n],e[r]),t)&&Ba(Ki(e[n],t),e[r])&&Ba(Ki(e[r],t),e[n])&&pc(Xf(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ba(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Yf(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function pc(e,t){for(var n=0;n<t.length;++n)if(!Yf(e,t[n]))return!1;return!0}function B_(e){switch(e.length){case 1:return H_(e[0]);case 2:return Ki(e[0],e[1]);case 3:return Xf(e[0],e[1],e[2])}}function H_(e){return{x:e.x,y:e.y,r:e.r}}function Ki(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function Xf(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,f=r-c,p=i-o,v=i-u,m=l-s,y=d-s,g=r*r+i*i-s*s,b=g-a*a-o*o+l*l,w=g-c*c-u*u+d*d,_=f*p-h*v,S=(p*w-v*b)/(_*2)-r,R=(v*m-p*y)/_,I=(f*b-h*w)/(_*2)-i,k=(h*y-f*m)/_,L=R*R+k*k-1,M=2*(s+S*R+I*k),V=S*S+I*I-s*s,P=-(Math.abs(L)>1e-6?(M+Math.sqrt(M*M-4*L*V))/(2*L):V/M);return{x:r+S+R*P,y:i+I+k*P,r:P}}function Zf(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function Kf(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Qf(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Ha(e){this._=e,this.next=null,this.previous=null}function V_(e,t){if(!(s=(e=I_(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;Zf(r,n,i=e[2]),n=new Ha(n),r=new Ha(r),i=new Ha(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){Zf(n._,r._,i=e[l]),i=new Ha(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Kf(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Kf(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Qf(n);(i=i.next)!==r;)(o=Qf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=P_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function F_(e){return Math.sqrt(e.value)}function z_(){var e=null,t=1,n=1,r=pr;function i(s){const a=D_();return s.x=t/2,s.y=n/2,e?s.eachBefore(Jf(e)).eachAfter(mc(r,.5,a)).eachBefore(tp(1)):s.eachBefore(Jf(F_)).eachAfter(mc(pr,1,a)).eachAfter(mc(r,s.r/Math.min(t,n),a)).eachBefore(tp(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=R_(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:Xr(+s),i):r},i}function Jf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function mc(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=V_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function tp(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function G_(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function j_(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function W_(e,t){return e.parent===t.parent?1:2}function gc(e){var t=e.children;return t?t[0]:e.t}function vc(e){var t=e.children;return t?t[t.length-1]:e.t}function q_(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Y_(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function X_(e,t,n){return e.a.parent===t.parent?e.a:n}function Va(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Va.prototype=Object.create(Zi.prototype);function Z_(e){for(var t=new Va(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Va(s[a],a)),i.parent=n;return(t.parent=new Va(null,0)).children=[t],t}function K_(){var e=W_,t=1,n=1,r=null;function i(c){var u=Z_(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(g){g.x<d.x&&(d=g),g.x>h.x&&(h=g),g.depth>f.depth&&(f=g)});var p=d===h?1:e(d,h)/2,v=p-d.x,m=t/(h.x+p+v),y=n/(f.depth||1);c.eachBefore(function(g){g.x=(g.x+v)*m,g.y=g.depth*y})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Y_(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,v=h.parent.children[0],m=h.m,y=f.m,g=p.m,b=v.m,w;p=vc(p),h=gc(h),p&&h;)v=gc(v),f=vc(f),f.a=c,w=p.z+g-h.z-m+e(p._,h._),w>0&&(q_(X_(p,c,d),c,w),m+=w,y+=w),g+=p.m,m+=h.m,b+=v.m,y+=f.m;p&&!vc(f)&&(f.t=p,f.m+=g-y),h&&!gc(v)&&(v.t=h,v.m+=m-b,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Q_(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var J_=(1+Math.sqrt(5))/2;function tw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,v=t.value,m,y,g,b,w,_,S;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(y=g=m,_=Math.max(p/f,f/p)/(v*e),S=m*m*_,w=Math.max(g/S,S/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>g&&(g=c),S=m*m*_,b=Math.max(g/S,S/y),b>w){m-=c;break}w=b}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?j_(l,n,r,i,v?r+=p*m/v:s):Q_(l,n,r,v?n+=f*m/v:i,s),v-=m,u=d}return a}const ew=function e(t){function n(r,i,s,a,o){tw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(J_);function nw(){var e=ew,t=!1,n=1,r=1,i=[0],s=pr,a=pr,o=pr,l=pr,c=pr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(G_),h}function d(h){var f=i[h.depth],p=h.x0+f,v=h.y0+f,m=h.x1-f,y=h.y1-f;m<p&&(p=m=(p+m)/2),y<v&&(v=y=(v+y)/2),h.x0=p,h.y0=v,h.x1=m,h.y1=y,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,v+=a(h)-f,m-=o(h)-f,y-=l(h)-f,m<p&&(p=m=(p+m)/2),y<v&&(v=y=(v+y)/2),e(h,p,v,m,y))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Wf(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:Xr(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:Xr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Xr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Xr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Xr(+h),u):c},u}function Zr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ep=Symbol("implicit");function Fa(){var e=new Wh,t=[],n=[],r=ep;function i(s){let a=e.get(s);if(a===void 0){if(r!==ep)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Wh;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Fa(t,n).unknown(r)},Zr.apply(i,arguments),i}function Qi(){var e=Fa().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=i<r,p=f?i:r,v=f?r:i;s=(v-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(v-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var m=dy(h).map(function(y){return p+s*y});return n(f?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Qi(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Zr.apply(d(),arguments)}function rw(e){return function(){return e}}function iw(e){return+e}var np=[0,1];function Kr(e){return e}function yc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:rw(isNaN(t)?NaN:.5)}function sw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function aw(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=yc(i,r),s=n(a,s)):(r=yc(r,i),s=n(s,a)),function(o){return s(r(o))}}function ow(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=yc(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=cl(e,o,1,r)-1;return s[l](i[l](o))}}function xc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function rp(){var e=np,t=np,n=Li,r,i,s,a=Kr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Kr&&(a=sw(e[0],e[h-1])),o=h>2?ow:aw,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),Me)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,iw),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Od,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Kr,u()):a!==Kr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function ip(){return rp()(Kr,Kr)}function lw(e,t,n,r){var i=hl(e,t,n),s;switch(r=Pi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=lE(i,a))&&(r.precision=s),nf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=cE(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=oE(i))&&(r.precision=s-(r.type==="%")*2);break}}return jl(r)}function sp(e){var t=e.domain;return e.ticks=function(n){var r=t();return Js(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return lw(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Ur(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Ze(){var e=ip();return e.copy=function(){return xc(e,Ze())},Zr.apply(e,arguments),sp(e)}function ap(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function op(e){return Math.log(e)}function lp(e){return Math.exp(e)}function cw(e){return-Math.log(-e)}function uw(e){return-Math.exp(-e)}function hw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dw(e){return e===10?hw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function fw(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function cp(e){return(t,n)=>-e(-t,n)}function pw(e){const t=e(op,lp),n=t.domain;let r=10,i,s;function a(){return i=fw(r),s=dw(r),n()[0]<0?(i=cp(i),s=cp(s),e(cw,uw)):e(op,lp),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(v=h<0?p/s(-h):p*s(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=f;++h)for(p=r-1;p>=1;--p)if(v=h>0?p/s(-h):p*s(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=Js(c,u,m))}else y=Js(h,f,Math.min(f-h,m)).map(s);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Pi(l)).precision==null&&(l.trim=!0),l=jl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(ap(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function up(){const e=pw(rp()).domain([1,10]);return e.copy=()=>xc(e,up()).base(e.base()),Zr.apply(e,arguments),e}function bc(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[cl(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return bc().domain([e,t]).range(i).unknown(s)},Zr.apply(sp(a),arguments)}const Ec=new Date,_c=new Date;function re(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>re(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Ec.setTime(+s),_c.setTime(+a),e(Ec),e(_c),Math.floor(n(Ec,_c))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const za=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);za.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):za),za.range;const Mn=1e3,Be=Mn*60,Cn=Be*60,An=Cn*24,wc=An*7,hp=An*30,Sc=An*365,Qr=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getUTCSeconds());Qr.range;const Oc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mn)},(e,t)=>{e.setTime(+e+t*Be)},(e,t)=>(t-e)/Be,e=>e.getMinutes());Oc.range,re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Be)},(e,t)=>(t-e)/Be,e=>e.getUTCMinutes()).range;const Tc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mn-e.getMinutes()*Be)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getHours());Tc.range,re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getUTCHours()).range;const Ji=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Be)/An,e=>e.getDate()-1);Ji.range;const Mc=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>e.getUTCDate()-1);Mc.range,re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>Math.floor(e/An)).range;function mr(e){return re(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Be)/wc)}const Ga=mr(0),ja=mr(1),mw=mr(2),gw=mr(3),Jr=mr(4),vw=mr(5),yw=mr(6);Ga.range,ja.range,mw.range,gw.range,Jr.range,vw.range,yw.range;function gr(e){return re(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/wc)}const dp=gr(0),Wa=gr(1),xw=gr(2),bw=gr(3),ti=gr(4),Ew=gr(5),_w=gr(6);dp.range,Wa.range,xw.range,bw.range,ti.range,Ew.range,_w.range;const Cc=re(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Cc.range,re(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const $n=re(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());$n.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),$n.range;const vr=re(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());vr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),vr.range;function ww(e,t,n,r,i,s){const a=[[Qr,1,Mn],[Qr,5,5*Mn],[Qr,15,15*Mn],[Qr,30,30*Mn],[s,1,Be],[s,5,5*Be],[s,15,15*Be],[s,30,30*Be],[i,1,Cn],[i,3,3*Cn],[i,6,6*Cn],[i,12,12*Cn],[r,1,An],[r,2,2*An],[n,1,wc],[t,1,hp],[t,3,3*hp],[e,1,Sc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=ll(([,,m])=>m).right(a,h);if(f===a.length)return e.every(hl(c/Sc,u/Sc,d));if(f===0)return za.every(Math.max(hl(c,u,d),1));const[p,v]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(v)}return[o,l]}const[Sw,Ow]=ww($n,Cc,Ga,Ji,Tc,Oc);function Ac(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function $c(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ts(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Tw(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=es(i),u=ns(i),d=es(s),h=ns(s),f=es(a),p=ns(a),v=es(o),m=ns(o),y=es(l),g=ns(l),b={a:$,A:U,b:B,B:W,c:null,d:yp,e:yp,f:Xw,g:sS,G:oS,H:Ww,I:qw,j:Yw,L:xp,m:Zw,M:Kw,p:K,q:Q,Q:Op,s:Tp,S:Qw,u:Jw,U:tS,V:eS,w:nS,W:rS,x:null,X:null,y:iS,Y:aS,Z:lS,"%":Sp},w={a:ft,A:st,b:gt,B:X,c:null,d:Ep,e:Ep,f:dS,g:_S,G:SS,H:cS,I:uS,j:hS,L:_p,m:fS,M:pS,p:nt,q:pt,Q:Op,s:Tp,S:mS,u:gS,U:vS,V:yS,w:xS,W:bS,x:null,X:null,y:ES,Y:wS,Z:OS,"%":Sp},_={a:L,A:M,b:V,B:P,c:H,d:gp,e:gp,f:Fw,g:mp,G:pp,H:vp,I:vp,j:Uw,L:Vw,m:Pw,M:Bw,p:k,q:Nw,Q:Gw,s:jw,S:Hw,u:Rw,U:Lw,V:kw,w:$w,W:Dw,x:E,X:A,y:mp,Y:pp,Z:Iw,"%":zw};b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(q,tt){return function(ct){var z=[],Mt=-1,Et=0,qt=q.length,Nt,it,At;for(ct instanceof Date||(ct=new Date(+ct));++Mt<qt;)q.charCodeAt(Mt)===37&&(z.push(q.slice(Et,Mt)),(it=fp[Nt=q.charAt(++Mt)])!=null?Nt=q.charAt(++Mt):it=Nt==="e"?" ":"0",(At=tt[Nt])&&(Nt=At(ct,it)),z.push(Nt),Et=Mt+1);return z.push(q.slice(Et,Mt)),z.join("")}}function R(q,tt){return function(ct){var z=ts(1900,void 0,1),Mt=I(z,q,ct+="",0),Et,qt;if(Mt!=ct.length)return null;if("Q"in z)return new Date(z.Q);if("s"in z)return new Date(z.s*1e3+("L"in z?z.L:0));if(tt&&!("Z"in z)&&(z.Z=0),"p"in z&&(z.H=z.H%12+z.p*12),z.m===void 0&&(z.m="q"in z?z.q:0),"V"in z){if(z.V<1||z.V>53)return null;"w"in z||(z.w=1),"Z"in z?(Et=$c(ts(z.y,0,1)),qt=Et.getUTCDay(),Et=qt>4||qt===0?Wa.ceil(Et):Wa(Et),Et=Mc.offset(Et,(z.V-1)*7),z.y=Et.getUTCFullYear(),z.m=Et.getUTCMonth(),z.d=Et.getUTCDate()+(z.w+6)%7):(Et=Ac(ts(z.y,0,1)),qt=Et.getDay(),Et=qt>4||qt===0?ja.ceil(Et):ja(Et),Et=Ji.offset(Et,(z.V-1)*7),z.y=Et.getFullYear(),z.m=Et.getMonth(),z.d=Et.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),qt="Z"in z?$c(ts(z.y,0,1)).getUTCDay():Ac(ts(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(qt+5)%7:z.w+z.U*7-(qt+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,$c(z)):Ac(z)}}function I(q,tt,ct,z){for(var Mt=0,Et=tt.length,qt=ct.length,Nt,it;Mt<Et;){if(z>=qt)return-1;if(Nt=tt.charCodeAt(Mt++),Nt===37){if(Nt=tt.charAt(Mt++),it=_[Nt in fp?tt.charAt(Mt++):Nt],!it||(z=it(q,ct,z))<0)return-1}else if(Nt!=ct.charCodeAt(z++))return-1}return z}function k(q,tt,ct){var z=c.exec(tt.slice(ct));return z?(q.p=u.get(z[0].toLowerCase()),ct+z[0].length):-1}function L(q,tt,ct){var z=f.exec(tt.slice(ct));return z?(q.w=p.get(z[0].toLowerCase()),ct+z[0].length):-1}function M(q,tt,ct){var z=d.exec(tt.slice(ct));return z?(q.w=h.get(z[0].toLowerCase()),ct+z[0].length):-1}function V(q,tt,ct){var z=y.exec(tt.slice(ct));return z?(q.m=g.get(z[0].toLowerCase()),ct+z[0].length):-1}function P(q,tt,ct){var z=v.exec(tt.slice(ct));return z?(q.m=m.get(z[0].toLowerCase()),ct+z[0].length):-1}function H(q,tt,ct){return I(q,t,tt,ct)}function E(q,tt,ct){return I(q,n,tt,ct)}function A(q,tt,ct){return I(q,r,tt,ct)}function $(q){return a[q.getDay()]}function U(q){return s[q.getDay()]}function B(q){return l[q.getMonth()]}function W(q){return o[q.getMonth()]}function K(q){return i[+(q.getHours()>=12)]}function Q(q){return 1+~~(q.getMonth()/3)}function ft(q){return a[q.getUTCDay()]}function st(q){return s[q.getUTCDay()]}function gt(q){return l[q.getUTCMonth()]}function X(q){return o[q.getUTCMonth()]}function nt(q){return i[+(q.getUTCHours()>=12)]}function pt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var tt=S(q+="",b);return tt.toString=function(){return q},tt},parse:function(q){var tt=R(q+="",!1);return tt.toString=function(){return q},tt},utcFormat:function(q){var tt=S(q+="",w);return tt.toString=function(){return q},tt},utcParse:function(q){var tt=R(q+="",!0);return tt.toString=function(){return q},tt}}}var fp={"-":"",_:" ",0:"0"},se=/^\s*\d+/,Mw=/^%/,Cw=/[\\^$*+?|[\]().{}]/g;function Ot(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Aw(e){return e.replace(Cw,"\\$&")}function es(e){return new RegExp("^(?:"+e.map(Aw).join("|")+")","i")}function ns(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function $w(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Rw(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Lw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Dw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function pp(e,t,n){var r=se.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function mp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Iw(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Nw(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Uw(e,t,n){var r=se.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Hw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Vw(e,t,n){var r=se.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Fw(e,t,n){var r=se.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zw(e,t,n){var r=Mw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Gw(e,t,n){var r=se.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jw(e,t,n){var r=se.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yp(e,t){return Ot(e.getDate(),t,2)}function Ww(e,t){return Ot(e.getHours(),t,2)}function qw(e,t){return Ot(e.getHours()%12||12,t,2)}function Yw(e,t){return Ot(1+Ji.count($n(e),e),t,3)}function xp(e,t){return Ot(e.getMilliseconds(),t,3)}function Xw(e,t){return xp(e,t)+"000"}function Zw(e,t){return Ot(e.getMonth()+1,t,2)}function Kw(e,t){return Ot(e.getMinutes(),t,2)}function Qw(e,t){return Ot(e.getSeconds(),t,2)}function Jw(e){var t=e.getDay();return t===0?7:t}function tS(e,t){return Ot(Ga.count($n(e)-1,e),t,2)}function bp(e){var t=e.getDay();return t>=4||t===0?Jr(e):Jr.ceil(e)}function eS(e,t){return e=bp(e),Ot(Jr.count($n(e),e)+($n(e).getDay()===4),t,2)}function nS(e){return e.getDay()}function rS(e,t){return Ot(ja.count($n(e)-1,e),t,2)}function iS(e,t){return Ot(e.getFullYear()%100,t,2)}function sS(e,t){return e=bp(e),Ot(e.getFullYear()%100,t,2)}function aS(e,t){return Ot(e.getFullYear()%1e4,t,4)}function oS(e,t){var n=e.getDay();return e=n>=4||n===0?Jr(e):Jr.ceil(e),Ot(e.getFullYear()%1e4,t,4)}function lS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ot(t/60|0,"0",2)+Ot(t%60,"0",2)}function Ep(e,t){return Ot(e.getUTCDate(),t,2)}function cS(e,t){return Ot(e.getUTCHours(),t,2)}function uS(e,t){return Ot(e.getUTCHours()%12||12,t,2)}function hS(e,t){return Ot(1+Mc.count(vr(e),e),t,3)}function _p(e,t){return Ot(e.getUTCMilliseconds(),t,3)}function dS(e,t){return _p(e,t)+"000"}function fS(e,t){return Ot(e.getUTCMonth()+1,t,2)}function pS(e,t){return Ot(e.getUTCMinutes(),t,2)}function mS(e,t){return Ot(e.getUTCSeconds(),t,2)}function gS(e){var t=e.getUTCDay();return t===0?7:t}function vS(e,t){return Ot(dp.count(vr(e)-1,e),t,2)}function wp(e){var t=e.getUTCDay();return t>=4||t===0?ti(e):ti.ceil(e)}function yS(e,t){return e=wp(e),Ot(ti.count(vr(e),e)+(vr(e).getUTCDay()===4),t,2)}function xS(e){return e.getUTCDay()}function bS(e,t){return Ot(Wa.count(vr(e)-1,e),t,2)}function ES(e,t){return Ot(e.getUTCFullYear()%100,t,2)}function _S(e,t){return e=wp(e),Ot(e.getUTCFullYear()%100,t,2)}function wS(e,t){return Ot(e.getUTCFullYear()%1e4,t,4)}function SS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ti(e):ti.ceil(e),Ot(e.getUTCFullYear()%1e4,t,4)}function OS(){return"+0000"}function Sp(){return"%"}function Op(e){return+e}function Tp(e){return Math.floor(+e/1e3)}var ei,Mp;TS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function TS(e){return ei=Tw(e),Mp=ei.format,ei.parse,ei.utcFormat,ei.utcParse,ei}function MS(e){return new Date(e)}function CS(e){return e instanceof Date?+e:+new Date(+e)}function Cp(e,t,n,r,i,s,a,o,l,c){var u=ip(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),v=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),g=c("%b %d"),b=c("%B"),w=c("%Y");function _(S){return(l(S)<S?f:o(S)<S?p:a(S)<S?v:s(S)<S?m:r(S)<S?i(S)<S?y:g:n(S)<S?b:w)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,CS)):h().map(MS)},u.ticks=function(S){var R=h();return e(R[0],R[R.length-1],S??10)},u.tickFormat=function(S,R){return R==null?_:c(R)},u.nice=function(S){var R=h();return(!S||typeof S.range!="function")&&(S=t(R[0],R[R.length-1],S??10)),S?h(ap(R,S)):u},u.copy=function(){return xc(u,Cp(e,t,n,r,i,s,a,o,l,c))},u}function Ap(){return Zr.apply(Cp(Sw,Ow,$n,Cc,Ga,Ji,Tc,Oc,Qr,Mp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mt(e){return function(){return e}}const $p=Math.abs,he=Math.atan2,yr=Math.cos,AS=Math.max,Rc=Math.min,hn=Math.sin,ni=Math.sqrt,de=1e-12,rs=Math.PI,qa=rs/2,Ya=2*rs;function $S(e){return e>1?0:e<-1?rs:Math.acos(e)}function Rp(e){return e>=1?qa:e<=-1?-qa:Math.asin(e)}function Xa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new zl(t)}function RS(e){return e.innerRadius}function LS(e){return e.outerRadius}function kS(e){return e.startAngle}function DS(e){return e.endAngle}function IS(e){return e&&e.padAngle}function NS(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<de))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Za(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/ni(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,v=r+d,m=(h+p)/2,y=(f+v)/2,g=p-h,b=v-f,w=g*g+b*b,_=i-s,S=h*v-p*f,R=(b<0?-1:1)*ni(AS(0,_*_*w-S*S)),I=(S*b-g*R)/w,k=(-S*g-b*R)/w,L=(S*b+g*R)/w,M=(-S*g+b*R)/w,V=I-m,P=k-y,H=L-m,E=M-y;return V*V+P*P>H*H+E*E&&(I=L,k=M),{cx:I,cy:k,x01:-u,y01:-d,x11:I*(i/_-1),y11:k*(i/_-1)}}function is(){var e=RS,t=LS,n=mt(0),r=null,i=kS,s=DS,a=IS,o=null,l=Xa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-qa,v=s.apply(this,arguments)-qa,m=$p(v-p),y=v>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>de))o.moveTo(0,0);else if(m>Ya-de)o.moveTo(f*yr(p),f*hn(p)),o.arc(0,0,f,p,v,!y),h>de&&(o.moveTo(h*yr(v),h*hn(v)),o.arc(0,0,h,v,p,y));else{var g=p,b=v,w=p,_=v,S=m,R=m,I=a.apply(this,arguments)/2,k=I>de&&(r?+r.apply(this,arguments):ni(h*h+f*f)),L=Rc($p(f-h)/2,+n.apply(this,arguments)),M=L,V=L,P,H;if(k>de){var E=Rp(k/h*hn(I)),A=Rp(k/f*hn(I));(S-=E*2)>de?(E*=y?1:-1,w+=E,_-=E):(S=0,w=_=(p+v)/2),(R-=A*2)>de?(A*=y?1:-1,g+=A,b-=A):(R=0,g=b=(p+v)/2)}var $=f*yr(g),U=f*hn(g),B=h*yr(_),W=h*hn(_);if(L>de){var K=f*yr(b),Q=f*hn(b),ft=h*yr(w),st=h*hn(w),gt;if(m<rs)if(gt=NS($,U,ft,st,K,Q,B,W)){var X=$-gt[0],nt=U-gt[1],pt=K-gt[0],q=Q-gt[1],tt=1/hn($S((X*pt+nt*q)/(ni(X*X+nt*nt)*ni(pt*pt+q*q)))/2),ct=ni(gt[0]*gt[0]+gt[1]*gt[1]);M=Rc(L,(h-ct)/(tt-1)),V=Rc(L,(f-ct)/(tt+1))}else M=V=0}R>de?V>de?(P=Za(ft,st,$,U,f,V,y),H=Za(K,Q,B,W,f,V,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),V<L?o.arc(P.cx,P.cy,V,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,V,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,f,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),!y),o.arc(H.cx,H.cy,V,he(H.y11,H.x11),he(H.y01,H.x01),!y))):(o.moveTo($,U),o.arc(0,0,f,g,b,!y)):o.moveTo($,U),!(h>de)||!(S>de)?o.lineTo(B,W):M>de?(P=Za(B,W,K,Q,h,-M,y),H=Za($,U,ft,st,h,-M,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),M<L?o.arc(P.cx,P.cy,M,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,M,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,h,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),y),o.arc(H.cx,H.cy,M,he(H.y11,H.x11),he(H.y01,H.x01),!y))):o.arc(0,0,h,_,w,y)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-rs/2;return[yr(d)*u,hn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:mt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:mt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:mt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:mt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:mt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:mt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:mt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var PS=Array.prototype.slice;function Ka(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Lp(e){this._context=e}Lp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Qa(e){return new Lp(e)}function Lc(e){return e[0]}function kc(e){return e[1]}function ss(e,t){var n=mt(!0),r=null,i=Qa,s=null,a=Xa(o);e=typeof e=="function"?e:e===void 0?Lc:mt(e),t=typeof t=="function"?t:t===void 0?kc:mt(t);function o(l){var c,u=(l=Ka(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:mt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:mt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:mt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Dc(e,t,n){var r=null,i=mt(!0),s=null,a=Qa,o=null,l=Xa(c);e=typeof e=="function"?e:e===void 0?Lc:mt(+e),t=typeof t=="function"?t:mt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?kc:mt(+n);function c(d){var h,f,p,v=(d=Ka(d)).length,m,y=!1,g,b=new Array(v),w=new Array(v);for(s==null&&(o=a(g=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===y)if(y=!y)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(b[p],w[p]);o.lineEnd(),o.areaEnd()}y&&(b[h]=+e(m,h,d),w[h]=+t(m,h,d),o.point(r?+r(m,h,d):b[h],n?+n(m,h,d):w[h]))}if(g)return o=null,g+""||null}function u(){return ss().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function US(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function BS(e){return e}function HS(){var e=BS,t=US,n=null,r=mt(0),i=mt(Ya),s=mt(0);function a(o){var l,c=(o=Ka(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ya,Math.max(-Ya,i.apply(this,arguments)-v)),y,g=Math.min(Math.abs(m)/c,s.apply(this,arguments)),b=g*(m<0?-1:1),w;for(l=0;l<c;++l)(w=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=w);for(t!=null?f.sort(function(_,S){return t(p[_],p[S])}):n!=null&&f.sort(function(_,S){return n(o[_],o[S])}),l=0,d=h?(m-c*b)/h:0;l<c;++l,v=y)u=f[l],w=p[u],y=v+(w>0?w*d:0)+b,p[u]={data:o[u],index:l,value:w,startAngle:v,endAngle:y,padAngle:g};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:mt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:mt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:mt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:mt(+o),a):s},a}var VS=Dp(Qa);function kp(e){this._curve=e}kp.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function Dp(e){function t(n){return new kp(e(n))}return t._curve=e,t}function FS(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(Dp(n)):t()._curve},e}function zS(){return FS(ss().curve(VS))}class GS{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function jS(e){return new GS(e,!0)}function WS(e){return e.source}function qS(e){return e.target}function YS(e){let t=WS,n=qS,r=Lc,i=kc,s=null,a=null,o=Xa(l);function l(){let c;const u=PS.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:mt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:mt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function XS(){return YS(jS)}function jn(){}function Ja(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function to(e){this._context=e}to.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ja(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ja(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZS(e){return new to(e)}function Ip(e){this._context=e}Ip.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ja(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KS(e){return new Ip(e)}function Np(e){this._context=e}Np.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ja(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QS(e){return new Np(e)}function Pp(e,t){this._basis=new to(e),this._beta=t}Pp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const JS=function e(t){function n(r){return t===1?new to(r):new Pp(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function eo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ic(e,t){this._context=e,this._k=(1-t)/6}Ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:eo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tO=function e(t){function n(r){return new Ic(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Nc(e,t){this._context=e,this._k=(1-t)/6}Nc.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eO=function e(t){function n(r){return new Nc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Pc(e,t){this._context=e,this._k=(1-t)/6}Pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nO=function e(t){function n(r){return new Pc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Uc(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>de){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>de){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function Up(e,t){this._context=e,this._alpha=t}Up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rO=function e(t){function n(r){return t?new Up(r,t):new Ic(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Bp(e,t){this._context=e,this._alpha=t}Bp.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iO=function e(t){function n(r){return t?new Bp(r,t):new Nc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Hp(e,t){this._context=e,this._alpha=t}Hp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uc(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sO=function e(t){function n(r){return t?new Hp(r,t):new Pc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Vp(e){this._context=e}Vp.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Fp(e){return new Vp(e)}function zp(e){return e<0?-1:1}function Gp(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(zp(s)+zp(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function jp(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Bc(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function no(e){this._context=e}no.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bc(this,this._t0,jp(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bc(this,jp(this,n=Gp(this,e,t)),n);break;default:Bc(this,this._t0,n=Gp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Wp(e){this._context=new qp(e)}(Wp.prototype=Object.create(no.prototype)).point=function(e,t){no.prototype.point.call(this,t,e)};function qp(e){this._context=e}qp.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function aO(e){return new no(e)}function oO(e){return new Wp(e)}function Yp(e){this._context=e}Yp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Xp(e),i=Xp(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Xp(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function lO(e){return new Yp(e)}function ro(e,t){this._context=e,this._t=t}ro.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function cO(e){return new ro(e,.5)}function uO(e){return new ro(e,0)}function hO(e){return new ro(e,1)}function Zp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Kp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dO(e,t){return e[t]}function fO(e){const t=[];return t.key=e,t}function Hc(){var e=mt([]),t=Kp,n=Zp,r=dO;function i(s){var a=Array.from(e.apply(this,arguments),fO),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Ka(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:mt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:mt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Kp:typeof s=="function"?s:mt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Zp,i):n},i}function pO(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function as(e,t,n){this.k=e,this.x=t,this.y=n}as.prototype={constructor:as,scale:function(e){return e===1?this:new as(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new as(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},as.prototype;function Vc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function os(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function ls(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?gO(o,d=>d.test(a)):mO(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function mO(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gO(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vO(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}function Tt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let yO={};function io(){return yO}function cs(e,t){var n,r,i,s;const a=io(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Tt(e),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const xO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bO=(e,t,n)=>{let r;const i=xO[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},EO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_O=(e,t,n,r)=>EO[e],wO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},SO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},TO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},MO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},CO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},AO=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},$O={ordinalNumber:AO,era:os({values:wO,defaultWidth:"wide"}),quarter:os({values:SO,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:OO,defaultWidth:"wide"}),day:os({values:TO,defaultWidth:"wide"}),dayPeriod:os({values:MO,defaultWidth:"wide",formattingValues:CO,defaultFormattingWidth:"wide"})},RO=/^(\d+)(th|st|nd|rd)?/i,LO=/\d+/i,kO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},DO={any:[/^b/i,/^(a|c)/i]},IO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NO={any:[/1/i,/2/i,/3/i,/4/i]},PO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},UO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},BO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},VO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},FO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},zO={ordinalNumber:vO({matchPattern:RO,parsePattern:LO,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:kO,defaultMatchWidth:"wide",parsePatterns:DO,defaultParseWidth:"any"}),quarter:ls({matchPatterns:IO,defaultMatchWidth:"wide",parsePatterns:NO,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:PO,defaultMatchWidth:"wide",parsePatterns:UO,defaultParseWidth:"any"}),day:ls({matchPatterns:BO,defaultMatchWidth:"wide",parsePatterns:HO,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:VO,defaultMatchWidth:"any",parsePatterns:FO,defaultParseWidth:"any"})},GO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qO={date:Vc({formats:GO,defaultWidth:"full"}),time:Vc({formats:jO,defaultWidth:"full"}),dateTime:Vc({formats:WO,defaultWidth:"full"})},Qp={code:"en-US",formatDistance:bO,formatLong:qO,formatRelative:_O,localize:$O,match:zO,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Jp=typeof global=="object"&&global&&global.Object===Object&&global,YO=typeof self=="object"&&self&&self.Object===Object&&self,Ke=Jp||YO||Function("return this")(),He=Ke.Symbol,tm=Object.prototype,XO=tm.hasOwnProperty,ZO=tm.toString,us=He?He.toStringTag:void 0;function KO(e){var t=XO.call(e,us),n=e[us];try{e[us]=void 0;var r=!0}catch{}var i=ZO.call(e);return r&&(t?e[us]=n:delete e[us]),i}var QO=Object.prototype,JO=QO.toString;function tT(e){return JO.call(e)}var eT="[object Null]",nT="[object Undefined]",em=He?He.toStringTag:void 0;function xr(e){return e==null?e===void 0?nT:eT:em&&em in Object(e)?KO(e):tT(e)}function dn(e){return e!=null&&typeof e=="object"}var rT="[object Symbol]";function so(e){return typeof e=="symbol"||dn(e)&&xr(e)==rT}function Fc(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ae=Array.isArray,iT=1/0,nm=He?He.prototype:void 0,rm=nm?nm.toString:void 0;function im(e){if(typeof e=="string")return e;if(ae(e))return Fc(e,im)+"";if(so(e))return rm?rm.call(e):"";var t=e+"";return t=="0"&&1/e==-iT?"-0":t}function Ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function zc(e){return e}var sT="[object AsyncFunction]",aT="[object Function]",oT="[object GeneratorFunction]",lT="[object Proxy]";function Gc(e){if(!Ve(e))return!1;var t=xr(e);return t==aT||t==oT||t==sT||t==lT}var jc=Ke["__core-js_shared__"],sm=function(){var e=/[^.]+$/.exec(jc&&jc.keys&&jc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function cT(e){return!!sm&&sm in e}var uT=Function.prototype,hT=uT.toString;function br(e){if(e!=null){try{return hT.call(e)}catch{}try{return e+""}catch{}}return""}var dT=/[\\^$.*+?()[\]{}|]/g,fT=/^\[object .+?Constructor\]$/,pT=Function.prototype,mT=Object.prototype,gT=pT.toString,vT=mT.hasOwnProperty,yT=RegExp("^"+gT.call(vT).replace(dT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xT(e){if(!Ve(e)||cT(e))return!1;var t=Gc(e)?yT:fT;return t.test(br(e))}function bT(e,t){return e==null?void 0:e[t]}function Er(e,t){var n=bT(e,t);return xT(n)?n:void 0}var Wc=Er(Ke,"WeakMap"),am=Object.create,ET=function(){function e(){}return function(t){if(!Ve(t))return{};if(am)return am(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function _T(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wT(){}function om(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var ST=800,OT=16,TT=Date.now;function MT(e){var t=0,n=0;return function(){var r=TT(),i=OT-(r-n);if(n=r,i>0){if(++t>=ST)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function CT(e){return function(){return e}}var ao=function(){try{var e=Er(Object,"defineProperty");return e({},"",{}),e}catch{}}(),AT=ao?function(e,t){return ao(e,"toString",{configurable:!0,enumerable:!1,value:CT(t),writable:!0})}:zc,lm=MT(AT);function $T(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function RT(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function LT(e){return e!==e}function kT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function DT(e,t,n){return t===t?kT(e,t,n):RT(e,LT,n)}function IT(e,t){var n=e==null?0:e.length;return!!n&&DT(e,t,0)>-1}var NT=9007199254740991,PT=/^(?:0|[1-9]\d*)$/;function qc(e,t){var n=typeof e;return t=t??NT,!!t&&(n=="number"||n!="symbol"&&PT.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){t=="__proto__"&&ao?ao(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hs(e,t){return e===t||e!==e&&t!==t}var UT=Object.prototype,BT=UT.hasOwnProperty;function cm(e,t,n){var r=e[t];(!(BT.call(e,t)&&hs(r,n))||n===void 0&&!(t in e))&&oo(e,t,n)}function ri(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?oo(n,o,l):cm(n,o,l)}return n}var um=Math.max;function hm(e,t,n){return t=um(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=um(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),_T(e,this,o)}}function Yc(e,t){return lm(hm(e,t,zc),e+"")}var HT=9007199254740991;function Xc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=HT}function _r(e){return e!=null&&Xc(e.length)&&!Gc(e)}function VT(e,t,n){if(!Ve(n))return!1;var r=typeof t;return(r=="number"?_r(n)&&qc(t,n.length):r=="string"&&t in n)?hs(n[t],e):!1}function FT(e){return Yc(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&VT(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var zT=Object.prototype;function lo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zT;return e===n}function GT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var jT="[object Arguments]";function dm(e){return dn(e)&&xr(e)==jT}var fm=Object.prototype,WT=fm.hasOwnProperty,qT=fm.propertyIsEnumerable,ii=dm(function(){return arguments}())?dm:function(e){return dn(e)&&WT.call(e,"callee")&&!qT.call(e,"callee")};function YT(){return!1}var pm=typeof J=="object"&&J&&!J.nodeType&&J,mm=pm&&typeof module=="object"&&module&&!module.nodeType&&module,XT=mm&&mm.exports===pm,gm=XT?Ke.Buffer:void 0,ZT=gm?gm.isBuffer:void 0,si=ZT||YT,KT="[object Arguments]",QT="[object Array]",JT="[object Boolean]",tM="[object Date]",eM="[object Error]",nM="[object Function]",rM="[object Map]",iM="[object Number]",sM="[object Object]",aM="[object RegExp]",oM="[object Set]",lM="[object String]",cM="[object WeakMap]",uM="[object ArrayBuffer]",hM="[object DataView]",dM="[object Float32Array]",fM="[object Float64Array]",pM="[object Int8Array]",mM="[object Int16Array]",gM="[object Int32Array]",vM="[object Uint8Array]",yM="[object Uint8ClampedArray]",xM="[object Uint16Array]",bM="[object Uint32Array]",Vt={};Vt[dM]=Vt[fM]=Vt[pM]=Vt[mM]=Vt[gM]=Vt[vM]=Vt[yM]=Vt[xM]=Vt[bM]=!0,Vt[KT]=Vt[QT]=Vt[uM]=Vt[JT]=Vt[hM]=Vt[tM]=Vt[eM]=Vt[nM]=Vt[rM]=Vt[iM]=Vt[sM]=Vt[aM]=Vt[oM]=Vt[lM]=Vt[cM]=!1;function EM(e){return dn(e)&&Xc(e.length)&&!!Vt[xr(e)]}function Zc(e){return function(t){return e(t)}}var vm=typeof J=="object"&&J&&!J.nodeType&&J,ds=vm&&typeof module=="object"&&module&&!module.nodeType&&module,_M=ds&&ds.exports===vm,Kc=_M&&Jp.process,ai=function(){try{var e=ds&&ds.require&&ds.require("util").types;return e||Kc&&Kc.binding&&Kc.binding("util")}catch{}}(),ym=ai&&ai.isTypedArray,co=ym?Zc(ym):EM,wM=Object.prototype,SM=wM.hasOwnProperty;function xm(e,t){var n=ae(e),r=!n&&ii(e),i=!n&&!r&&si(e),s=!n&&!r&&!i&&co(e),a=n||r||i||s,o=a?GT(e.length,String):[],l=o.length;for(var c in e)(t||SM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||qc(c,l)))&&o.push(c);return o}function bm(e,t){return function(n){return e(t(n))}}var OM=bm(Object.keys,Object),TM=Object.prototype,MM=TM.hasOwnProperty;function Em(e){if(!lo(e))return OM(e);var t=[];for(var n in Object(e))MM.call(e,n)&&n!="constructor"&&t.push(n);return t}function fs(e){return _r(e)?xm(e):Em(e)}function CM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var AM=Object.prototype,$M=AM.hasOwnProperty;function RM(e){if(!Ve(e))return CM(e);var t=lo(e),n=[];for(var r in e)r=="constructor"&&(t||!$M.call(e,r))||n.push(r);return n}function ps(e){return _r(e)?xm(e,!0):RM(e)}var LM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kM=/^\w*$/;function Qc(e,t){if(ae(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||so(e)?!0:kM.test(e)||!LM.test(e)||t!=null&&e in Object(t)}var ms=Er(Object,"create");function DM(){this.__data__=ms?ms(null):{},this.size=0}function IM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NM="__lodash_hash_undefined__",PM=Object.prototype,UM=PM.hasOwnProperty;function BM(e){var t=this.__data__;if(ms){var n=t[e];return n===NM?void 0:n}return UM.call(t,e)?t[e]:void 0}var HM=Object.prototype,VM=HM.hasOwnProperty;function FM(e){var t=this.__data__;return ms?t[e]!==void 0:VM.call(t,e)}var zM="__lodash_hash_undefined__";function GM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ms&&t===void 0?zM:t,this}function wr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wr.prototype.clear=DM,wr.prototype.delete=IM,wr.prototype.get=BM,wr.prototype.has=FM,wr.prototype.set=GM;function jM(){this.__data__=[],this.size=0}function uo(e,t){for(var n=e.length;n--;)if(hs(e[n][0],t))return n;return-1}var WM=Array.prototype,qM=WM.splice;function YM(e){var t=this.__data__,n=uo(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qM.call(t,n,1),--this.size,!0}function XM(e){var t=this.__data__,n=uo(t,e);return n<0?void 0:t[n][1]}function ZM(e){return uo(this.__data__,e)>-1}function KM(e,t){var n=this.__data__,r=uo(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Rn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Rn.prototype.clear=jM,Rn.prototype.delete=YM,Rn.prototype.get=XM,Rn.prototype.has=ZM,Rn.prototype.set=KM;var gs=Er(Ke,"Map");function QM(){this.size=0,this.__data__={hash:new wr,map:new(gs||Rn),string:new wr}}function JM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ho(e,t){var n=e.__data__;return JM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function tC(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t}function eC(e){return ho(this,e).get(e)}function nC(e){return ho(this,e).has(e)}function rC(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ln.prototype.clear=QM,Ln.prototype.delete=tC,Ln.prototype.get=eC,Ln.prototype.has=nC,Ln.prototype.set=rC;var iC="Expected a function";function Jc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(iC);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Jc.Cache||Ln),n}Jc.Cache=Ln;var sC=500;function aC(e){var t=Jc(e,function(r){return n.size===sC&&n.clear(),r}),n=t.cache;return t}var oC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lC=/\\(\\)?/g,cC=aC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(oC,function(n,r,i,s){t.push(i?s.replace(lC,"$1"):r||n)}),t});function vs(e){return e==null?"":im(e)}function fo(e,t){return ae(e)?e:Qc(e,t)?[e]:cC(vs(e))}var uC=1/0;function ys(e){if(typeof e=="string"||so(e))return e;var t=e+"";return t=="0"&&1/e==-uC?"-0":t}function tu(e,t){t=fo(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ys(t[n++])];return n&&n==r?e:void 0}function _t(e,t,n){var r=e==null?void 0:tu(e,t);return r===void 0?n:r}function eu(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _m=He?He.isConcatSpreadable:void 0;function hC(e){return ae(e)||ii(e)||!!(_m&&e&&e[_m])}function po(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=hC),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?po(o,t-1,n,r,i):eu(i,o):r||(i[i.length]=o)}return i}var nu=bm(Object.getPrototypeOf,Object),dC="[object Object]",fC=Function.prototype,pC=Object.prototype,wm=fC.toString,mC=pC.hasOwnProperty,gC=wm.call(Object);function Sm(e){if(!dn(e)||xr(e)!=dC)return!1;var t=nu(e);if(t===null)return!0;var n=mC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&wm.call(n)==gC}function vC(){this.__data__=new Rn,this.size=0}function yC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function xC(e){return this.__data__.get(e)}function bC(e){return this.__data__.has(e)}var EC=200;function _C(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!gs||r.length<EC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(r)}return n.set(e,t),this.size=n.size,this}function Qe(e){var t=this.__data__=new Rn(e);this.size=t.size}Qe.prototype.clear=vC,Qe.prototype.delete=yC,Qe.prototype.get=xC,Qe.prototype.has=bC,Qe.prototype.set=_C;function wC(e,t){return e&&ri(t,fs(t),e)}function SC(e,t){return e&&ri(t,ps(t),e)}var Om=typeof J=="object"&&J&&!J.nodeType&&J,Tm=Om&&typeof module=="object"&&module&&!module.nodeType&&module,OC=Tm&&Tm.exports===Om,Mm=OC?Ke.Buffer:void 0,Cm=Mm?Mm.allocUnsafe:void 0;function Am(e,t){if(t)return e.slice();var n=e.length,r=Cm?Cm(n):new e.constructor(n);return e.copy(r),r}function TC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function $m(){return[]}var MC=Object.prototype,CC=MC.propertyIsEnumerable,Rm=Object.getOwnPropertySymbols,ru=Rm?function(e){return e==null?[]:(e=Object(e),TC(Rm(e),function(t){return CC.call(e,t)}))}:$m;function AC(e,t){return ri(e,ru(e),t)}var $C=Object.getOwnPropertySymbols,Lm=$C?function(e){for(var t=[];e;)eu(t,ru(e)),e=nu(e);return t}:$m;function RC(e,t){return ri(e,Lm(e),t)}function km(e,t,n){var r=t(e);return ae(e)?r:eu(r,n(e))}function iu(e){return km(e,fs,ru)}function Dm(e){return km(e,ps,Lm)}var su=Er(Ke,"DataView"),au=Er(Ke,"Promise"),oi=Er(Ke,"Set"),Im="[object Map]",LC="[object Object]",Nm="[object Promise]",Pm="[object Set]",Um="[object WeakMap]",Bm="[object DataView]",kC=br(su),DC=br(gs),IC=br(au),NC=br(oi),PC=br(Wc),Fe=xr;(su&&Fe(new su(new ArrayBuffer(1)))!=Bm||gs&&Fe(new gs)!=Im||au&&Fe(au.resolve())!=Nm||oi&&Fe(new oi)!=Pm||Wc&&Fe(new Wc)!=Um)&&(Fe=function(e){var t=xr(e),n=t==LC?e.constructor:void 0,r=n?br(n):"";if(r)switch(r){case kC:return Bm;case DC:return Im;case IC:return Nm;case NC:return Pm;case PC:return Um}return t});var UC=Object.prototype,BC=UC.hasOwnProperty;function HC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&BC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var mo=Ke.Uint8Array;function ou(e){var t=new e.constructor(e.byteLength);return new mo(t).set(new mo(e)),t}function VC(e,t){var n=t?ou(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var FC=/\w*$/;function zC(e){var t=new e.constructor(e.source,FC.exec(e));return t.lastIndex=e.lastIndex,t}var Hm=He?He.prototype:void 0,Vm=Hm?Hm.valueOf:void 0;function GC(e){return Vm?Object(Vm.call(e)):{}}function Fm(e,t){var n=t?ou(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var jC="[object Boolean]",WC="[object Date]",qC="[object Map]",YC="[object Number]",XC="[object RegExp]",ZC="[object Set]",KC="[object String]",QC="[object Symbol]",JC="[object ArrayBuffer]",tA="[object DataView]",eA="[object Float32Array]",nA="[object Float64Array]",rA="[object Int8Array]",iA="[object Int16Array]",sA="[object Int32Array]",aA="[object Uint8Array]",oA="[object Uint8ClampedArray]",lA="[object Uint16Array]",cA="[object Uint32Array]";function uA(e,t,n){var r=e.constructor;switch(t){case JC:return ou(e);case jC:case WC:return new r(+e);case tA:return VC(e,n);case eA:case nA:case rA:case iA:case sA:case aA:case oA:case lA:case cA:return Fm(e,n);case qC:return new r;case YC:case KC:return new r(e);case XC:return zC(e);case ZC:return new r;case QC:return GC(e)}}function zm(e){return typeof e.constructor=="function"&&!lo(e)?ET(nu(e)):{}}var hA="[object Map]";function dA(e){return dn(e)&&Fe(e)==hA}var Gm=ai&&ai.isMap,fA=Gm?Zc(Gm):dA,pA="[object Set]";function mA(e){return dn(e)&&Fe(e)==pA}var jm=ai&&ai.isSet,gA=jm?Zc(jm):mA,vA=1,yA=2,xA=4,Wm="[object Arguments]",bA="[object Array]",EA="[object Boolean]",_A="[object Date]",wA="[object Error]",qm="[object Function]",SA="[object GeneratorFunction]",OA="[object Map]",TA="[object Number]",Ym="[object Object]",MA="[object RegExp]",CA="[object Set]",AA="[object String]",$A="[object Symbol]",RA="[object WeakMap]",LA="[object ArrayBuffer]",kA="[object DataView]",DA="[object Float32Array]",IA="[object Float64Array]",NA="[object Int8Array]",PA="[object Int16Array]",UA="[object Int32Array]",BA="[object Uint8Array]",HA="[object Uint8ClampedArray]",VA="[object Uint16Array]",FA="[object Uint32Array]",Bt={};Bt[Wm]=Bt[bA]=Bt[LA]=Bt[kA]=Bt[EA]=Bt[_A]=Bt[DA]=Bt[IA]=Bt[NA]=Bt[PA]=Bt[UA]=Bt[OA]=Bt[TA]=Bt[Ym]=Bt[MA]=Bt[CA]=Bt[AA]=Bt[$A]=Bt[BA]=Bt[HA]=Bt[VA]=Bt[FA]=!0,Bt[wA]=Bt[qm]=Bt[RA]=!1;function xs(e,t,n,r,i,s){var a,o=t&vA,l=t&yA,c=t&xA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ve(e))return e;var u=ae(e);if(u){if(a=HC(e),!o)return om(e,a)}else{var d=Fe(e),h=d==qm||d==SA;if(si(e))return Am(e,o);if(d==Ym||d==Wm||h&&!i){if(a=l||h?{}:zm(e),!o)return l?RC(e,SC(a,e)):AC(e,wC(a,e))}else{if(!Bt[d])return i?e:{};a=uA(e,d,o)}}s||(s=new Qe);var f=s.get(e);if(f)return f;s.set(e,a),gA(e)?e.forEach(function(m){a.add(xs(m,t,n,m,e,s))}):fA(e)&&e.forEach(function(m,y){a.set(y,xs(m,t,n,y,e,s))});var p=c?l?Dm:iu:l?ps:fs,v=u?void 0:p(e);return $T(v||e,function(m,y){v&&(y=m,m=e[y]),cm(a,y,xs(m,t,n,y,e,s))}),a}var zA=1,GA=4;function kn(e){return xs(e,zA|GA)}var jA="__lodash_hash_undefined__";function WA(e){return this.__data__.set(e,jA),this}function qA(e){return this.__data__.has(e)}function bs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}bs.prototype.add=bs.prototype.push=WA,bs.prototype.has=qA;function Xm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Zm(e,t){return e.has(t)}var YA=1,XA=2;function Km(e,t,n,r,i,s){var a=n&YA,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&XA?new bs:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],v=t[d];if(r)var m=a?r(v,p,d,t,e,s):r(p,v,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!Xm(t,function(y,g){if(!Zm(f,g)&&(p===y||i(p,y,n,r,s)))return f.push(g)})){h=!1;break}}else if(!(p===v||i(p,v,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function ZA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function lu(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var KA=1,QA=2,JA="[object Boolean]",t2="[object Date]",e2="[object Error]",n2="[object Map]",r2="[object Number]",i2="[object RegExp]",s2="[object Set]",a2="[object String]",o2="[object Symbol]",l2="[object ArrayBuffer]",c2="[object DataView]",Qm=He?He.prototype:void 0,cu=Qm?Qm.valueOf:void 0;function u2(e,t,n,r,i,s,a){switch(n){case c2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case l2:return!(e.byteLength!=t.byteLength||!s(new mo(e),new mo(t)));case JA:case t2:case r2:return hs(+e,+t);case e2:return e.name==t.name&&e.message==t.message;case i2:case a2:return e==t+"";case n2:var o=ZA;case s2:var l=r&KA;if(o||(o=lu),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=QA,a.set(e,t);var u=Km(o(e),o(t),r,i,s,a);return a.delete(e),u;case o2:if(cu)return cu.call(e)==cu.call(t)}return!1}var h2=1,d2=Object.prototype,f2=d2.hasOwnProperty;function p2(e,t,n,r,i,s){var a=n&h2,o=iu(e),l=o.length,c=iu(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:f2.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var y=e[h],g=t[h];if(r)var b=a?r(g,y,h,t,e,s):r(y,g,h,e,t,s);if(!(b===void 0?y===g||i(y,g,n,r,s):b)){v=!1;break}m||(m=h=="constructor")}if(v&&!m){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(v=!1)}return s.delete(e),s.delete(t),v}var m2=1,Jm="[object Arguments]",tg="[object Array]",go="[object Object]",g2=Object.prototype,eg=g2.hasOwnProperty;function v2(e,t,n,r,i,s){var a=ae(e),o=ae(t),l=a?tg:Fe(e),c=o?tg:Fe(t);l=l==Jm?go:l,c=c==Jm?go:c;var u=l==go,d=c==go,h=l==c;if(h&&si(e)){if(!si(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Qe),a||co(e)?Km(e,t,n,r,i,s):u2(e,t,l,n,r,i,s);if(!(n&m2)){var f=u&&eg.call(e,"__wrapped__"),p=d&&eg.call(t,"__wrapped__");if(f||p){var v=f?e.value():e,m=p?t.value():t;return s||(s=new Qe),i(v,m,n,r,s)}}return h?(s||(s=new Qe),p2(e,t,n,r,i,s)):!1}function vo(e,t,n,r,i){return e===t?!0:e==null||t==null||!dn(e)&&!dn(t)?e!==e&&t!==t:v2(e,t,n,r,vo,i)}var y2=1,x2=2;function b2(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Qe,d;if(!(d===void 0?vo(c,l,y2|x2,r,u):d))return!1}}return!0}function ng(e){return e===e&&!Ve(e)}function E2(e){for(var t=fs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ng(i)]}return t}function rg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _2(e){var t=E2(e);return t.length==1&&t[0][2]?rg(t[0][0],t[0][1]):function(n){return n===e||b2(n,e,t)}}function w2(e,t){return e!=null&&t in Object(e)}function S2(e,t,n){t=fo(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ys(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Xc(i)&&qc(a,i)&&(ae(e)||ii(e)))}function O2(e,t){return e!=null&&S2(e,t,w2)}var T2=1,M2=2;function C2(e,t){return Qc(e)&&ng(t)?rg(ys(e),t):function(n){var r=_t(n,e);return r===void 0&&r===t?O2(n,e):vo(t,r,T2|M2)}}function A2(e){return function(t){return t==null?void 0:t[e]}}function $2(e){return function(t){return tu(t,e)}}function R2(e){return Qc(e)?A2(ys(e)):$2(e)}function yo(e){return typeof e=="function"?e:e==null?zc:typeof e=="object"?ae(e)?C2(e[0],e[1]):_2(e):R2(e)}function L2(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var ig=L2();function uu(e,t,n){(n!==void 0&&!hs(e[t],n)||n===void 0&&!(t in e))&&oo(e,t,n)}function hu(e){return dn(e)&&_r(e)}function du(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function k2(e){return ri(e,ps(e))}function D2(e,t,n,r,i,s,a){var o=du(e,n),l=du(t,n),c=a.get(l);if(c){uu(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=ae(l),f=!h&&si(l),p=!h&&!f&&co(l);u=l,h||f||p?ae(o)?u=o:hu(o)?u=om(o):f?(d=!1,u=Am(l,!0)):p?(d=!1,u=Fm(l,!0)):u=[]:Sm(l)||ii(l)?(u=o,ii(o)?u=k2(o):(!Ve(o)||Gc(o))&&(u=zm(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),uu(e,n,u)}function sg(e,t,n,r,i){e!==t&&ig(t,function(s,a){if(i||(i=new Qe),Ve(s))D2(e,t,a,n,sg,r,i);else{var o=r?r(du(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),uu(e,a,o)}},ps)}function ag(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var I2="[object Map]",N2="[object Set]",P2=Object.prototype,U2=P2.hasOwnProperty;function Je(e){if(e==null)return!0;if(_r(e)&&(ae(e)||typeof e=="string"||typeof e.splice=="function"||si(e)||co(e)||ii(e)))return!e.length;var t=Fe(e);if(t==I2||t==N2)return!e.size;if(lo(e))return!Em(e).length;for(var n in e)if(U2.call(e,n))return!1;return!0}var lt=FT(function(e,t,n){sg(e,t,n)}),B2=1/0,H2=oi&&1/lu(new oi([,-0]))[1]==B2?function(e){return new oi(e)}:wT,V2=200;function og(e,t,n){var r=-1,i=IT,s=e.length,a=!0,o=[],l=o;if(s>=V2){var c=t?null:H2(e);if(c)return lu(c);a=!1,i=Zm,l=new bs}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var F2=Yc(function(e){var t=ag(e);return hu(t)&&(t=void 0),og(po(e,1,hu,!0),yo(t))});function Es(e){return e&&e.length?og(e):[]}const _e="cds",Dn={opacity:{unselected:.05,selected:.4}},Wn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},li={duration:1e3,ease:Hd,zoomLevel:3},ci={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},lg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},ze={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},z2={defaultBins:10},Yt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},In={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},oe={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ht={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},Sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},tn={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},cg={minCellDividerDimension:16,chartPadding:.5},ug={default:{size:24}},G2={defaultOffset:4,horizontalOffset:10},hg={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},Ae={height:{[an.GRAPH_VIEW]:32,[an.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},j2=[{type:ne.RADIUS,name:"Radius"},{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}],ui={type:je.END_LINE,threshold:16,numCharacter:14},W2={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},q2={enabled:!0,position:wi.BOTTOM,clickable:!0,truncation:ui,alignment:Qt.LEFT,order:null,additionalItems:[]},Y2={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},X2={enabled:!0},dg={enabled:!0,showTotal:!0,truncation:ui,groupLabel:"Group"},fg={top:{visible:!0,includeZero:!0,truncation:ui},bottom:{visible:!0,includeZero:!0,truncation:ui},left:{visible:!0,includeZero:!0,truncation:ui},right:{visible:!0,includeZero:!0,truncation:ui}},xo={addSpaceOnEdges:1,showDayName:!1,localeObject:Qp,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let pg=!1;try{pg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const fe={width:null,height:null,resizable:!0,theme:il.WHITE,tooltip:dg,legend:q2,locale:W2,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:$t.SHOW_AS_DATATABLE},...pg?[{type:$t.MAKE_FULLSCREEN}]:[],{type:$t.EXPORT_CSV},{type:$t.EXPORT_PNG},{type:$t.EXPORT_JPG}]}},mg=lt({},fe,{thematic:{projection:bn.geoNaturalEarth1}}),_s=lt({},fe,{axes:fg,timeScale:xo,grid:Y2,ruler:X2,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:an.GRAPH_VIEW}}}),Or=lt({},_s,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(xo,{addSpaceOnEdges:1})}),Z2=lt({},Or,{}),K2=lt({},Or,{}),Q2=lt({},Or,{bars:lt({},Or.bars,{dividerSize:1.5})}),J2=lt({},Or,{}),fu=lt({},_s,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),t$=fu,gg=lt({},fu,{points:{radius:3,filled:!1,enabled:!0}}),vg=lt({},gg,{timeScale:lt(xo,{addSpaceOnEdges:0})}),e$=vg,n$=lt({},_s,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:ne.RADIUS,name:"Radius"}]}}),r$=lt({},_s,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}]}}),i$=lt({},Or,{bars:{dividerSize:1.5},timeScale:lt(xo,{addSpaceOnEdges:0})}),s$=lt({},fe,{tooltip:lt({},dg,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),yg=lt({},fe,{pie:{labels:{formatter:null,enabled:!0},alignment:Qt.LEFT,sortFunction:null,valueMapsTo:"value"}}),a$=lt({},fe,{legend:{enabled:!1},gauge:{type:Pr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Qt.LEFT}}),o$=lt({},yg,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:Qt.LEFT}}),xg=lt({},fe,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),l$=lt({},xg,{legend:{enabled:!0}}),c$=lt({},fe,{radar:{axes:{angle:"key",value:"value"},alignment:Qt.LEFT},tooltip:{gridline:{enabled:!0}}}),u$=lt({},Or,{comboChartTypes:[]}),h$=lt({tree:{type:sl.TREE}},fe,{}),d$=lt({},fe,{data:lt(fe.data,{groupMapsTo:"name"})}),f$=lt({},fe,ci,{data:lt(fe.data,{groupMapsTo:"name"})}),p$=lt({},fe,{alluvial:{data:lt(fe.data,{groupMapsTo:"source"}),nodeAlignment:Qt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),m$=lt({},fe,{axes:fg,heatmap:{divider:{state:Oi.AUTO},colorLegend:{type:"linear"}}}),g$=lt({},mg,{choropleth:{colorLegend:{type:"linear"}}}),Pt={alluvialChart:p$,areaChart:vg,axisChart:_s,boxplotChart:J2,bubbleChart:n$,bulletChart:r$,chart:fe,circlePackChart:f$,choroplethChart:g$,comboChart:u$,donutChart:o$,gaugeChart:a$,groupedBarChart:K2,heatmapChart:m$,histogramChart:i$,lineChart:gg,lollipopChart:t$,meterChart:xg,pieChart:yg,proportionalMeterChart:l$,radarChart:c$,scatterChart:fu,simpleBarChart:Z2,stackedAreaChart:e$,stackedBarChart:Q2,thematicChart:mg,treeChart:h$,treemapChart:d$,wordCloudChart:s$};function v$(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=or(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function jt(e,t){var n;const r=kn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===et.TIME?a.mapsTo="date":l===et.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return mu(r,t),lt(r,t)}function Nn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ws(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function pu(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function Ss(e,t,n){if(n>e.length)return e;if(t===je.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===je.FRONT_LINE)return"..."+e.substr(-n);if(t===je.END_LINE)return e.substr(0,n)+"..."}function mu(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=j2.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=F2(a,r,"name")}}const x=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},bg=(e,t)=>t===te.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ge=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=bg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Pn(e,t,n){return n===te.VERTICAL?[e,t]:[t,e]}const Eg=6048e5,y$=864e5,_g=6e4,wg=36e5;function Sg(e){const t=Tt(e);return t.setHours(0,0,0,0),t}function Og(e){const t=Tt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tg(e,t){const n=Sg(e),r=Sg(t),i=+n-Og(n),s=+r-Og(r);return Math.round((i-s)/y$)}function en(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function x$(e){const t=Tt(e),n=en(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function b$(e){const t=Tt(e);return Tg(t,x$(t))+1}function bo(e){return cs(e,{weekStartsOn:1})}function Mg(e){const t=Tt(e),n=t.getFullYear(),r=en(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=bo(r),s=en(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=bo(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function E$(e){const t=Mg(e),n=en(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),bo(n)}function _$(e){const t=Tt(e),n=+bo(t)-+E$(t);return Math.round(n/Eg)+1}function Cg(e,t){var n,r,i,s;const a=Tt(e),o=a.getFullYear(),l=io(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=en(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=cs(u,t),h=en(e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const f=cs(h,t);return a.getTime()>=d.getTime()?o+1:a.getTime()>=f.getTime()?o:o-1}function w$(e,t){var n,r,i,s;const a=io(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Cg(e,t),c=en(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),cs(c,t)}function S$(e,t){const n=Tt(e),r=+cs(n,t)-+w$(n,t);return Math.round(r/Eg)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return kt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return kt(i,t.length)}},hi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ag={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qn.y(e,t)},Y:function(e,t,n,r){const i=Cg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return kt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):kt(s,t.length)},R:function(e,t){const n=Mg(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return kt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return kt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return kt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=S$(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):kt(i,t.length)},I:function(e,t,n){const r=_$(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):kt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qn.d(e,t)},D:function(e,t,n){const r=b$(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):kt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return kt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return kt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return kt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=hi.noon:r===0?i=hi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=hi.evening:r>=12?i=hi.afternoon:r>=4?i=hi.morning:i=hi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qn.s(e,t)},S:function(e,t){return qn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Rg(r);case"XXXX":case"XX":return Tr(r);case"XXXXX":case"XXX":default:return Tr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Rg(r);case"xxxx":case"xx":return Tr(r);case"xxxxx":case"xxx":default:return Tr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$g(r,":");case"OOOO":default:return"GMT"+Tr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$g(r,":");case"zzzz":default:return"GMT"+Tr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return kt(r,t.length)},T:function(e,t,n){const r=e.getTime();return kt(r,t.length)}};function $g(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+kt(s,2)}function Rg(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):Tr(e,t)}function Tr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=kt(Math.trunc(r/60),2),s=kt(r%60,2);return n+i+t+s}const Lg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kg=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},O$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Lg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Lg(r,t)).replace("{{time}}",kg(i,t))},T$={p:kg,P:O$},M$=/^D+$/,C$=/^Y+$/,A$=["D","DD","YY","YYYY"];function $$(e){return M$.test(e)}function R$(e){return C$.test(e)}function L$(e,t,n){const r=k$(e,t,n);if(console.warn(r),A$.includes(e))throw new RangeError(r)}function k$(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function D$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function I$(e){if(!D$(e)&&typeof e!="number")return!1;const t=Tt(e);return!isNaN(Number(t))}const N$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,U$=/^'([^]*?)'?$/,B$=/''/g,H$=/[a-zA-Z]/;function gu(e,t,n){var r,i,s,a,o,l,c,u;const d=io(),h=(n==null?void 0:n.locale)??d.locale??Qp,f=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,p=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,v=Tt(e);if(!I$(v))throw new RangeError("Invalid time value");let m=t.match(P$).map(g=>{const b=g[0];if(b==="p"||b==="P"){const w=T$[b];return w(g,h.formatLong)}return g}).join("").match(N$).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:V$(g)};if(Ag[b])return{isToken:!0,value:g};if(b.match(H$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});h.localize.preprocessor&&(m=h.localize.preprocessor(v,m));const y={firstWeekContainsDate:f,weekStartsOn:p,locale:h};return m.map(g=>{if(!g.isToken)return g.value;const b=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&R$(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&$$(b))&&L$(b,t,String(e));const w=Ag[b[0]];return w(v,b,h.localize,y)}).join("")}function V$(e){const t=e.match(U$);return t?t[1].replace(B$,"'"):e}var Dg=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Dg||{});const vu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Ig(e,t,n,r,i){const s=t===0,a=Number(gu(new Date(e),"c"))===2,o=Number(gu(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||_o(e)||Os(e,l)||Yn(e);case"minute":return s||_o(e)||Os(e,l)||Yn(e);case"30minutes":return s||_o(e)||Os(e,l)||Yn(e);case"hourly":return s||_o(e)||Os(e,l)||Yn(e);case"daily":return i?s||a||Yn(e):s||Os(e,l)||Yn(e);case"weekly":return s||a||Yn(e);case"monthly":return s||Yn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function yu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=x(i,"timeIntervalFormats")[o],u=x(c,"primary"),d=x(c,"secondary"),h=Ig(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:v,optionsObject:m}=s,y=m[r].type,g=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!g){const b=gu(l,f,{locale:p}).split("").map(w=>{let _=Number(w);return w!==" "&&!Number.isNaN(_)?_.toLocaleString(v):w});return s[y](l,v,{},b.join(""))}else return s[y](l,v,g)}function Eo(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function F$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function z$(e){const t=vu.reduce((n,[,r],i)=>{const s=vu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return vu[t][0]}function xu(e,t){if(Dg[t])return t;if(e.length===1)return"15seconds";const n=F$(e),r=zn(n);return z$(r)}function _o(e){const{s:t,m:n,H:r}=Eo(e);return r===0&&n===0&&t===0}function Os(e,t){const n=Eo(e).M,r=Eo(t).M;return n!==r}function Yn(e){const{M:t,d:n,s:r,m:i,H:s}=Eo(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Ng(e){return e===void 0?"":e.toISOString()}function Pg(e){const t=We(e,r=>r.value),n=Ze().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Ug(e,t){const n=x(t,"gradient","colors"),r=!Je(n);let i=x(t,"pairing","option");const s=Pg(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return bc().domain(s).range(o)}var dt=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(dt||{});function G$(e,t){return e&&ig(e,t,fs)}function j$(e,t){return function(n,r){if(n==null)return n;if(!_r(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var bu=j$(G$);function W$(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function q$(e,t,n,r){return bu(e,function(i,s,a){t(r,i,n(i),a)}),r}function Y$(e,t){return function(n,r){var i=ae(n)?W$:q$,s={};return i(n,e,yo(r),s)}}function X$(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var Z$=Object.prototype,K$=Z$.hasOwnProperty,Q$=Y$(function(e,t,n){K$.call(e,n)?e[n].push(t):oo(e,n,[t])});function J$(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}let fn=class{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=x(r,"locale"),o=x(r,"tabularRepModal","tableHeadingFormatter"),l=x(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===et.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(let f in h){let p=h[f];typeof p=="number"&&(h[f]=a(p,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=x(n,"data"),a=x(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===et.LINEAR||c===et.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===et.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Yt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(kn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Yt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Q$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=z2.defaultBins}=s,l=Array.isArray(o),c=uy().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,v=this.aggregateBinDataByGroup(f);d.forEach(m=>{h.push({group:m,key:p,value:v[m]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Hc().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Es(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Ng(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===et.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===et.LOG||o===et.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Ng(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=X$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Hc().offset(pO):Hc()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();mu(n,t),this.set({options:lt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Yt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=x(s,"label");if(c===null){const d=x(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>J$(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
- `),n=this.getOptions();let r="myChart";const i=x(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Yt.items.status,s=this.getOptions(),a=Es(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=x(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=x(t,"option");const i=lg.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=Fa().range(o).domain(this.allDataGroups)}},Mr=class extends fn{constructor(t){super(t),this.axisFlavor=Ks.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:x(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=x(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",F.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",F.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(kn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Es(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(F).forEach(i=>{const s=F[i],a=n.axes[s];if(a&&a.scaleType===et.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{x(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},tR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},eR=class extends Mr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:dl(t,.25),q_50:dl(t,.5),q_75:dl(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(b=>b[o]).sort(ir),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,v=[],m=[];for(const b of l)b<f||b>p?v.push(b):m.push(b);c.outliers=v;const y=zn(m),g=ar(m);c.whiskers={min:y||zn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:g||ar([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=x(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=x(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],x(l,"whiskers","min")!==null?i(x(l,"whiskers","min"),s):"&ndash;",x(l,"quartiles","q_25")!==null?i(x(l,"quartiles","q_25"),s):"&ndash;",x(l,"quartiles","q_50")!==null?i(x(l,"quartiles","q_50"),s):"&ndash;",x(l,"quartiles","q_75")!==null?i(x(l,"quartiles","q_75"),s):"&ndash;",x(l,"whiskers","max")!==null?i(x(l,"whiskers","max"),s):"&ndash;",x(l,"quartiles","q_75")!==null&&x(l,"quartiles","q_25")!==null?(i(x(l,"quartiles","q_75")-x(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"option");const r=lg.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Fa().range(i).domain(this.allDataGroups)}},nR=class extends Mr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=x(n,"locale"),o=x(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),x(u,"marker")===null?"&ndash;":s(u.marker,a),x(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},rR=class extends fn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Je(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Je(n)&&!Je(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Ug(this.getDisplayData(),t)}},iR=class extends fn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=lt({},t,this.getZoomOptions(t));mu(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:lt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:ne.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=x(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},sR=class extends fn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=x(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},aR=class extends fn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=x(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},oR=class extends Mr{constructor(t){super(t),this.axisFlavor=Ks.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==et.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==et.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==et.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==et.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=We(this.getDisplayData(),r=>r.value),n=Ze().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Je(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Je(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Je(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=kn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(kn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Je(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=x(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Je(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=bc().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Ug(this.getDisplayData(),l)}},lR=class extends Mr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=x(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[_t(t,"bins.rangeLabel")||"Range",...s.map(l=>_t(l,`0.${n}`))],o=[..._t(s,0).map((l,c)=>[`${r(Number(_t(l,"data.x0")),i)} – ${r(Number(_t(l,"data.x1")),i)}`,...s.map(u=>r(_t(u[c],`data.${_t(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}},cR=class extends fn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional"),{number:a,code:o}=x(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else u=x(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;let p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})];return super.formatTable({headers:l,cells:c})}},uR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),{number:s,code:a}=x(t,"locale"),o=x(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>x(u,"data",h,i)!==null?s(x(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}},hR=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},dR=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):x(a.name)!==null&&x(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}},fR=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=x(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var pR=/\s/;function mR(e){for(var t=e.length;t--&&pR.test(e.charAt(t)););return t}var gR=/^\s+/;function vR(e){return e&&e.slice(0,mR(e)+1).replace(gR,"")}var Bg=NaN,yR=/^[-+]0x[0-9a-f]+$/i,xR=/^0b[01]+$/i,bR=/^0o[0-7]+$/i,ER=parseInt;function di(e){if(typeof e=="number")return e;if(so(e))return Bg;if(Ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=vR(e);var n=xR.test(e);return n||bR.test(e)?ER(e.slice(2),n?2:8):yR.test(e)?Bg:+e}var Eu=function(){return Ke.Date.now()},_R="Expected a function",wR=Math.max,SR=Math.min;function wo(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(_R);t=di(t)||0,Ve(n)&&(u=!!n.leading,d="maxWait"in n,s=d?wR(di(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,I=i;return r=i=void 0,c=S,a=e.apply(I,R),a}function p(S){return c=S,o=setTimeout(y,t),u?f(S):a}function v(S){var R=S-l,I=S-c,k=t-R;return d?SR(k,s-I):k}function m(S){var R=S-l,I=S-c;return l===void 0||R>=t||R<0||d&&I>=s}function y(){var S=Eu();if(m(S))return g(S);o=setTimeout(y,v(S))}function g(S){return o=void 0,h&&r?f(S):(r=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function w(){return o===void 0?a:g(Eu())}function _(){var S=Eu(),R=m(S);if(r=arguments,i=this,l=S,R){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(y,t),f(l)}return o===void 0&&(o=setTimeout(y,t)),a}return _.cancel=b,_.flush=w,_}function OR(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const TR=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Un(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function So(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function MR(e){const t=So(e,"border-left-width"),n=So(e,"border-right-width");return e.clientWidth+t+n}function CR(e){const t=So(e,"border-top-width"),n=So(e,"border-bottom-width");return e.clientHeight+t+n}function Hg(e,t={}){const n=t.width||MR(e),r=t.height||CR(e);return{width:n,height:r}}function AR(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const $e=16384;function $R(e){(e.width>$e||e.height>$e)&&(e.width>$e&&e.height>$e?e.width>e.height?(e.height*=$e/e.width,e.width=$e):(e.width*=$e/e.height,e.height=$e):e.width>$e?(e.height*=$e/e.width,e.width=$e):(e.width*=$e/e.height,e.height=$e))}function Oo(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function RR(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function LR(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),RR(i)}const we=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||we(n,t)};function kR(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function DR(e){return Un(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function IR(e,t,n){const r=`.${e}:${t}`,i=n.cssText?kR(n):DR(n);return document.createTextNode(`${r}{${i}}`)}function Vg(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=TR();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(IR(s,n,r)),t.appendChild(a)}function NR(e,t){Vg(e,t,":before"),Vg(e,t,":after")}const Fg="application/font-woff",zg="image/jpeg",PR={woff:Fg,woff2:Fg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:zg,jpeg:zg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function UR(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function _u(e){const t=UR(e).toLowerCase();return PR[t]||""}function BR(e){return e.split(/,/)[1]}function wu(e){return e.search(/^(data:)/)!==-1}function HR(e,t){return`data:${t};base64,${e}`}async function Gg(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const Su={};function VR(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ou(e,t,n){const r=VR(e,t,n.includeQueryParams);if(Su[r]!=null)return Su[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Gg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),BR(o)));i=HR(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return Su[r]=i,i}async function FR(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Oo(t)}async function zR(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return Oo(o)}const n=e.poster,r=_u(n),i=await Ou(n,r,t);return Oo(i)}async function GR(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await To(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function jR(e,t){return we(e,HTMLCanvasElement)?FR(e):we(e,HTMLVideoElement)?zR(e,t):we(e,HTMLIFrameElement)?GR(e):e.cloneNode(!1)}const WR=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function qR(e,t,n){var r,i;let s=[];return WR(e)&&e.assignedNodes?s=Un(e.assignedNodes()):we(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Un(e.contentDocument.body.childNodes):s=Un(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||we(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>To(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function YR(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Un(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),we(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function XR(e,t){we(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),we(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ZR(e,t){if(we(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function KR(e,t){return we(t,Element)&&(YR(e,t),NR(e,t),XR(e,t),ZR(e,t)),t}async function QR(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await To(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function To(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>jR(r,t)).then(r=>qR(e,r,t)).then(r=>KR(e,r)).then(r=>QR(r,t))}const jg=/url\((['"]?)([^'"]+?)\1\)/g,JR=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,tL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function eL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function nL(e){const t=[];return e.replace(jg,(n,r,i)=>(t.push(i),n)),t.filter(n=>!wu(n))}async function rL(e,t,n,r,i){try{const s=n?OR(t,n):t,a=_u(t);let o;return i||(o=await Ou(s,a,r)),e.replace(eL(t),`$1${o}$3`)}catch{}return e}function iL(e,{preferredFontFormat:t}){return t?e.replace(tL,n=>{for(;;){const[r,,i]=JR.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Wg(e){return e.search(jg)!==-1}async function qg(e,t,n){if(!Wg(e))return e;const r=iL(e,n);return nL(r).reduce((i,s)=>i.then(a=>rL(a,s,t,n)),Promise.resolve(r))}async function Mo(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await qg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function sL(e,t){await Mo("background",e,t)||await Mo("background-image",e,t),await Mo("mask",e,t)||await Mo("mask-image",e,t)}async function aL(e,t){const n=we(e,HTMLImageElement);if(!(n&&!wu(e.src))&&!(we(e,SVGImageElement)&&!wu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Ou(r,_u(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function oL(e,t){const n=Un(e.childNodes).map(r=>Yg(r,t));await Promise.all(n).then(()=>e)}async function Yg(e,t){we(e,Element)&&(await sL(e,t),await aL(e,t),await oL(e,t))}function lL(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Xg={};async function Zg(e){let t=Xg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Xg[e]=t,t}async function Kg(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),Gg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Qg(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function cL(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Un(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Zg(l).then(u=>Kg(u,t)).then(u=>Qg(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Zg(i.href).then(o=>Kg(o,t)).then(o=>Qg(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Un(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function uL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Wg(t.style.getPropertyValue("src")))}async function hL(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Un(e.ownerDocument.styleSheets),r=await cL(n,t);return uL(r)}async function dL(e,t){const n=await hL(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return qg(r.cssText,i,t)}))).join(`
3
- `)}async function fL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await dL(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function pL(e,t={}){const{width:n,height:r}=Hg(e,t),i=await To(e,t,!0);return await fL(i,t),await Yg(i,t),lL(i,t),await LR(i,n,r)}async function Jg(e,t={}){const{width:n,height:r}=Hg(e,t),i=await pL(e,t),s=await Oo(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||AR(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||$R(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function mL(e,t={}){return(await Jg(e,t)).toDataURL()}async function gL(e,t={}){return(await Jg(e,t)).toDataURL("image/jpeg",t.quality||1)}class Bn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const vL="DONT_STYLE_ME_css_styles_verifier";let N=class Eh extends Bn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=D(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],v=parseFloat(p);p&&v>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=v)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=x(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${_e}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",vL),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),D(this.getHolder()).classed(`${_e}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=D(r);i.classed("filled",!0),gL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=D(r);i.classed("filled",!0),mL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return D(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();D(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Eh.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Eh.getSVGElementSize(D(s),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=wo(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}};class Ts extends Bn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:Ts.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}function tv(e){const t=yL(ev(e),360);return Xn(t,[0,10])||Xn(t,[350,0])?{textAnchor:yn.START,dominantBaseline:xn.MIDDLE}:Xn(t,[10,80])?{textAnchor:yn.START,dominantBaseline:xn.HANGING}:Xn(t,[80,100])?{textAnchor:yn.MIDDLE,dominantBaseline:xn.HANGING}:Xn(t,[100,170])?{textAnchor:yn.END,dominantBaseline:xn.HANGING}:Xn(t,[170,190])?{textAnchor:yn.END,dominantBaseline:xn.MIDDLE}:Xn(t,[190,260])?{textAnchor:yn.END,dominantBaseline:xn.BASELINE}:Xn(t,[260,280])?{textAnchor:yn.MIDDLE,dominantBaseline:xn.BASELINE}:{textAnchor:yn.START,dominantBaseline:xn.BASELINE}}function yL(e,t){return(e%t+t)%t}function Xn(e,[t,n]){return e>=t&&e<=n}function ev(e){return e*(180/Math.PI)}function Zt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function xL(e,t){return t*Math.sin(e-Math.PI/2)}function nv(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bL(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Tu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function EL(e){return e.depth}function _L(e,t){return t-1-e.height}function rv(e,t){return e.sourceLinks.length?e.depth:t-1}function Co(e){return function(){return e}}function iv(e,t){return Ao(e.source,t.source)||e.index-t.index}function sv(e,t){return Ao(e.target,t.target)||e.index-t.index}function Ao(e,t){return e.y0-t.y0}function Mu(e){return e.value}function wL(e){return e.index}function SL(e){return e.nodes}function OL(e){return e.links}function av(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function ov({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function TL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=wL,l=rv,c,u,d=SL,h=OL,f=6;function p(){const E={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(E),m(E),y(E),g(E),_(E),ov(E),E}p.update=function(E){return ov(E),E},p.nodeId=function(E){return arguments.length?(o=typeof E=="function"?E:Co(E),p):o},p.nodeAlign=function(E){return arguments.length?(l=typeof E=="function"?E:Co(E),p):l},p.nodeSort=function(E){return arguments.length?(c=E,p):c},p.nodeWidth=function(E){return arguments.length?(i=+E,p):i},p.nodePadding=function(E){return arguments.length?(s=a=+E,p):s},p.nodes=function(E){return arguments.length?(d=typeof E=="function"?E:Co(E),p):d},p.links=function(E){return arguments.length?(h=typeof E=="function"?E:Co(E),p):h},p.linkSort=function(E){return arguments.length?(u=E,p):u},p.size=function(E){return arguments.length?(e=t=0,n=+E[0],r=+E[1],p):[n-e,r-t]},p.extent=function(E){return arguments.length?(e=+E[0][0],n=+E[1][0],t=+E[0][1],r=+E[1][1],p):[[e,t],[n,r]]},p.iterations=function(E){return arguments.length?(f=+E,p):f};function v({nodes:E,links:A}){for(const[U,B]of E.entries())B.index=U,B.sourceLinks=[],B.targetLinks=[];const $=new Map(E.map((U,B)=>[o(U,B,E),U]));for(const[U,B]of A.entries()){B.index=U;let{source:W,target:K}=B;typeof W!="object"&&(W=B.source=av($,W)),typeof K!="object"&&(K=B.target=av($,K)),W.sourceLinks.push(B),K.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:U,targetLinks:B}of E)U.sort(u),B.sort(u)}function m({nodes:E}){for(const A of E)A.value=A.fixedValue===void 0?Math.max(Tu(A.sourceLinks,Mu),Tu(A.targetLinks,Mu)):A.fixedValue}function y({nodes:E}){const A=E.length;let $=new Set(E),U=new Set,B=0;for(;$.size;){for(const W of $){W.depth=B;for(const{target:K}of W.sourceLinks)U.add(K)}if(++B>A)throw new Error("circular link");$=U,U=new Set}}function g({nodes:E}){const A=E.length;let $=new Set(E),U=new Set,B=0;for(;$.size;){for(const W of $){W.height=B;for(const{source:K}of W.targetLinks)U.add(K)}if(++B>A)throw new Error("circular link");$=U,U=new Set}}function b({nodes:E}){const A=nv(E,B=>B.depth)+1,$=(n-e-i)/(A-1),U=new Array(A);for(const B of E){const W=Math.max(0,Math.min(A-1,Math.floor(l.call(null,B,A))));B.layer=W,B.x0=e+W*$,B.x1=B.x0+i,U[W]?U[W].push(B):U[W]=[B]}if(c)for(const B of U)B.sort(c);return U}function w(E){const A=bL(E,$=>(r-t-($.length-1)*a)/Tu($,Mu));for(const $ of E){let U=t;for(const B of $){B.y0=U,B.y1=U+B.value*A,U=B.y1+a;for(const W of B.sourceLinks)W.width=W.value*A}U=(r-U+a)/($.length+1);for(let B=0;B<$.length;++B){const W=$[B];W.y0+=U*(B+1),W.y1+=U*(B+1)}V($)}}function _(E){const A=b(E);a=Math.min(s,(r-t)/(nv(A,$=>$.length)-1)),w(A);for(let $=0;$<f;++$){const U=Math.pow(.99,$),B=Math.max(1-U,($+1)/f);R(A,U,B),S(A,U,B)}}function S(E,A,$){for(let U=1,B=E.length;U<B;++U){const W=E[U];for(const K of W){let Q=0,ft=0;for(const{source:gt,value:X}of K.targetLinks){let nt=X*(K.layer-gt.layer);Q+=P(gt,K)*nt,ft+=nt}if(!(ft>0))continue;let st=(Q/ft-K.y0)*A;K.y0+=st,K.y1+=st,M(K)}c===void 0&&W.sort(Ao),I(W,$)}}function R(E,A,$){for(let U=E.length,B=U-2;B>=0;--B){const W=E[B];for(const K of W){let Q=0,ft=0;for(const{target:gt,value:X}of K.sourceLinks){let nt=X*(gt.layer-K.layer);Q+=H(K,gt)*nt,ft+=nt}if(!(ft>0))continue;let st=(Q/ft-K.y0)*A;K.y0+=st,K.y1+=st,M(K)}c===void 0&&W.sort(Ao),I(W,$)}}function I(E,A){const $=E.length>>1,U=E[$];L(E,U.y0-a,$-1,A),k(E,U.y1+a,$+1,A),L(E,r,E.length-1,A),k(E,t,0,A)}function k(E,A,$,U){for(;$<E.length;++$){const B=E[$],W=(A-B.y0)*U;W>1e-6&&(B.y0+=W,B.y1+=W),A=B.y1+a}}function L(E,A,$,U){for(;$>=0;--$){const B=E[$],W=(B.y1-A)*U;W>1e-6&&(B.y0-=W,B.y1-=W),A=B.y0-a}}function M({sourceLinks:E,targetLinks:A}){if(u===void 0){for(const{source:{sourceLinks:$}}of A)$.sort(sv);for(const{target:{targetLinks:$}}of E)$.sort(iv)}}function V(E){if(u===void 0)for(const{sourceLinks:A,targetLinks:$}of E)A.sort(sv),$.sort(iv)}function P(E,A){let $=E.y0-(E.sourceLinks.length-1)*a/2;for(const{target:U,width:B}of E.sourceLinks){if(U===A)break;$+=B+a}for(const{source:U,width:B}of A.targetLinks){if(U===E)break;$-=B}return $}function H(E,A){let $=A.y0-(A.targetLinks.length-1)*a/2;for(const{source:U,width:B}of A.targetLinks){if(U===E)break;$+=B+a}for(const{target:U,width:B}of E.sourceLinks){if(U===A)break;$-=B}return $}return p}var Cu=Math.PI,Au=2*Cu,Cr=1e-6,ML=Au-Cr;function $u(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function lv(){return new $u}$u.prototype=lv.prototype={constructor:$u,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>Cr)if(!(Math.abs(u*o-l*c)>Cr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=r-a,p=o*o+l*l,v=h*h+f*f,m=Math.sqrt(p),y=Math.sqrt(d),g=i*Math.tan((Cu-Math.acos((p+d-v)/(2*m*y)))/2),b=g/y,w=g/m;Math.abs(b-1)>Cr&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+w*o)+","+(this._y1=t+w*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Cr||Math.abs(this._y1-c)>Cr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%Au+Au),d>ML?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Cr&&(this._+="A"+n+","+n+",0,"+ +(d>=Cu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function cv(e){return function(){return e}}function CL(e){return e[0]}function AL(e){return e[1]}var $L=Array.prototype.slice;function RL(e){return e.source}function LL(e){return e.target}function kL(e){var t=RL,n=LL,r=CL,i=AL,s=null;function a(){var o,l=$L.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=lv()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:cv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:cv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function DL(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function IL(){return kL(DL)}function NL(e){return[e.source.x1,e.y0]}function PL(e){return[e.target.x0,e.y1]}function UL(){return IL().source(NL).target(PL)}function uv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BL(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var HL={value:function(){}};function hv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new $o(n)}function $o(e){this._=e}function VL(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}$o.prototype=hv.prototype={constructor:$o,on:function(e,t){var n=this._,r=VL(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=FL(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=dv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=dv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new $o(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function FL(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function dv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=HL,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const zL=BL(Object.freeze(Object.defineProperty({__proto__:null,dispatch:hv},Symbol.toStringTag,{value:"Module"}))).dispatch,Ru=Math.PI/180,GL={archimedean:pv,rectangular:ek},Ms=64,Ro=2048;var jL=function(){var e=[256,256],t=WL,n=qL,r=YL,i=fv,s=fv,a=XL,o=ZL,l=pv,c=[],u=1/0,d=zL("word","end"),h=null,f=Math.random,p={},v=rk;p.canvas=function(g){return arguments.length?(v=Zn(g),p):v},p.start=function(){var g=m(v()),b=nk((e[0]>>5)*e[1]),w=null,_=c.length,S=-1,R=[],I=c.map(function(L,M){return L.text=t.call(this,L,M),L.font=n.call(this,L,M),L.style=i.call(this,L,M),L.weight=s.call(this,L,M),L.rotate=a.call(this,L,M),L.size=~~r.call(this,L,M),L.padding=o.call(this,L,M),L}).sort(function(L,M){return M.size-L.size});return h&&clearInterval(h),h=setInterval(k,0),k(),p;function k(){for(var L=Date.now();Date.now()-L<u&&++S<_&&h;){var M=I[S];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,KL(g,M,I,S),M.hasText&&y(b,M,w)&&(R.push(M),d.call("word",p,M),w?JL(w,M):w=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,R,w))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return p};function m(g){const b=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const w=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return g.width=(Ms<<5)/w,g.height=Ro/w,b.fillStyle=b.strokeStyle="red",{context:b,ratio:w}}function y(g,b,w){e[0],e[1];for(var _=b.x,S=b.y,R=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),k=f()<.5?1:-1,L=-k,M,V,P;(M=I(L+=k))&&(V=~~M[0],P=~~M[1],!(Math.min(Math.abs(V),Math.abs(P))>=R));)if(b.x=_+V,b.y=S+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!w||tk(b,w))&&!QL(b,g,e[0])){for(var H=b.sprite,E=b.width>>5,A=e[0]>>5,$=b.x-(E<<4),U=$&127,B=32-U,W=b.y1-b.y0,K=(b.y+b.y0)*A+($>>5),Q,ft=0;ft<W;ft++){Q=0;for(var st=0;st<=E;st++)g[K+st]|=Q<<B|(st<E?(Q=H[ft*E+st])>>>U:0);K+=A}return!0}return!1}return p.timeInterval=function(g){return arguments.length?(u=g??1/0,p):u},p.words=function(g){return arguments.length?(c=g,p):c},p.size=function(g){return arguments.length?(e=[+g[0],+g[1]],p):e},p.font=function(g){return arguments.length?(n=Zn(g),p):n},p.fontStyle=function(g){return arguments.length?(i=Zn(g),p):i},p.fontWeight=function(g){return arguments.length?(s=Zn(g),p):s},p.rotate=function(g){return arguments.length?(a=Zn(g),p):a},p.text=function(g){return arguments.length?(t=Zn(g),p):t},p.spiral=function(g){return arguments.length?(l=GL[g]||g,p):l},p.fontSize=function(g){return arguments.length?(r=Zn(g),p):r},p.padding=function(g){return arguments.length?(o=Zn(g),p):o},p.random=function(g){return arguments.length?(f=g,p):f},p.on=function(){var g=d.on.apply(d,arguments);return g===d?p:g},p};function WL(e){return e.text}function qL(){return"serif"}function fv(){return"normal"}function YL(e){return Math.sqrt(e.value)}function XL(){return(~~(random()*6)-3)*30}function ZL(){return 1}function KL(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Ms<<5)/s,Ro/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const M=i.measureText(t.text),V=-Math.floor(M.width/2);let P=(M.width+1)*s,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Ru),d=Math.cos(t.rotate*Ru),h=P*d,f=P*u,p=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(H>l&&(l=H),a+P>=Ms<<5&&(a=0,o+=l,l=0),o+H>=Ro)break;i.translate((a+(P>>1))/s,(o+(H>>1))/s),t.rotate&&i.rotate(t.rotate*Ru),i.fillText(t.text,V,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,V,0)),i.restore(),t.width=P,t.height=H,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Ms<<5)/s,Ro/s).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,b=g>>5,w=t.y1-t.y0,_=0;_<w*b;_++)y[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,R=-1,I=0;I<w;I++){for(var _=0;_<g;_++){var k=b*I+(_>>5),L=m[(o+I)*(Ms<<5)+(a+_)<<2]?1<<31-_%32:0;y[k]|=L,S|=L}S?R=I:(t.y0++,w--,I--,o++)}t.y1=t.y0+R,t.sprite=y.slice(0,(t.y1-t.y0)*b)}}}function QL(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function JL(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function tk(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function pv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function ek(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function nk(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function rk(){return document.createElement("canvas")}function Zn(e){return typeof e=="function"?e:function(){return e}}const ik=uv(jL);function sk(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function ak(e){return function(t){return e==null?void 0:e[t]}}var ok={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lk=ak(ok),ck=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,uk="\\u0300-\\u036f",hk="\\ufe20-\\ufe2f",dk="\\u20d0-\\u20ff",fk=uk+hk+dk,pk="["+fk+"]",mk=RegExp(pk,"g");function gk(e){return e=vs(e),e&&e.replace(ck,lk).replace(mk,"")}var vk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function yk(e){return e.match(vk)||[]}var xk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function bk(e){return xk.test(e)}var mv="\\ud800-\\udfff",Ek="\\u0300-\\u036f",_k="\\ufe20-\\ufe2f",wk="\\u20d0-\\u20ff",Sk=Ek+_k+wk,gv="\\u2700-\\u27bf",vv="a-z\\xdf-\\xf6\\xf8-\\xff",Ok="\\xac\\xb1\\xd7\\xf7",Tk="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mk="\\u2000-\\u206f",Ck=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yv="A-Z\\xc0-\\xd6\\xd8-\\xde",Ak="\\ufe0e\\ufe0f",xv=Ok+Tk+Mk+Ck,bv="['’]",Ev="["+xv+"]",$k="["+Sk+"]",_v="\\d+",Rk="["+gv+"]",wv="["+vv+"]",Sv="[^"+mv+xv+_v+gv+vv+yv+"]",Lk="\\ud83c[\\udffb-\\udfff]",kk="(?:"+$k+"|"+Lk+")",Dk="[^"+mv+"]",Ov="(?:\\ud83c[\\udde6-\\uddff]){2}",Tv="[\\ud800-\\udbff][\\udc00-\\udfff]",fi="["+yv+"]",Ik="\\u200d",Mv="(?:"+wv+"|"+Sv+")",Nk="(?:"+fi+"|"+Sv+")",Cv="(?:"+bv+"(?:d|ll|m|re|s|t|ve))?",Av="(?:"+bv+"(?:D|LL|M|RE|S|T|VE))?",$v=kk+"?",Rv="["+Ak+"]?",Pk="(?:"+Ik+"(?:"+[Dk,Ov,Tv].join("|")+")"+Rv+$v+")*",Uk="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bk="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hk=Rv+$v+Pk,Vk="(?:"+[Rk,Ov,Tv].join("|")+")"+Hk,Fk=RegExp([fi+"?"+wv+"+"+Cv+"(?="+[Ev,fi,"$"].join("|")+")",Nk+"+"+Av+"(?="+[Ev,fi+Mv,"$"].join("|")+")",fi+"?"+Mv+"+"+Cv,fi+"+"+Av,Bk,Uk,_v,Vk].join("|"),"g");function zk(e){return e.match(Fk)||[]}function Gk(e,t,n){return e=vs(e),t=t,t===void 0?bk(e)?zk(e):yk(e):e.match(t)||[]}var jk="['’]",Wk=RegExp(jk,"g");function Lv(e){return function(t){return sk(Gk(gk(t).replace(Wk,"")),e,"")}}function qk(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function kv(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=di(n),n=n===n?n:0),t!==void 0&&(t=di(t),t=t===t?t:0),qk(di(e),t,n)}var Yk="Expected a function";function Xk(e,t,n){if(typeof e!="function")throw new TypeError(Yk);return setTimeout(function(){e.apply(void 0,n)},t)}var Zk=Yc(function(e,t,n){return Xk(e,di(t)||0,n)});function Kk(e,t){var n=-1,r=_r(e)?Array(e.length):[];return bu(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function Qk(e,t){var n=ae(e)?Fc:Kk;return n(e,yo(t))}var Jk=1/0;function tD(e,t){return po(Qk(e,t),Jk)}function Dv(e,t){return vo(e,t)}var pi=Lv(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function eD(e,t){var n;return bu(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function nD(e,t,n){var r=ae(e)?Xm:eD;return r(e,yo(t))}class xt{constructor(t,n,r){if(this.type="",this.renderType=rt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${_e}--${i}--${this.type}`,!0),r&&r.classed(`${_e}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${_e}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=D(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?lt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */const{entries:Iv,setPrototypeOf:Nv,isFrozen:rD,getPrototypeOf:iD,getOwnPropertyDescriptor:sD}=Object;let{freeze:ve,seal:Ge,create:Pv}=Object,{apply:Lu,construct:ku}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),Ge||(Ge=function(e){return e}),Lu||(Lu=function(e,t,n){return e.apply(t,n)}),ku||(ku=function(e,t){return new e(...t)});const Lo=Re(Array.prototype.forEach),Uv=Re(Array.prototype.pop),Cs=Re(Array.prototype.push),ko=Re(String.prototype.toLowerCase),Du=Re(String.prototype.toString),Bv=Re(String.prototype.match),As=Re(String.prototype.replace),aD=Re(String.prototype.indexOf),oD=Re(String.prototype.trim),nn=Re(Object.prototype.hasOwnProperty),ye=Re(RegExp.prototype.test),$s=lD(TypeError);function Re(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Lu(e,t,r)}}function lD(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ku(e,n)}}function bt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ko;Nv&&Nv(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(rD(t)||(t[r]=s),i=s)}e[i]=!0}return e}function cD(e){for(let t=0;t<e.length;t++)nn(e,t)||(e[t]=null);return e}function Ar(e){const t=Pv(null);for(const[n,r]of Iv(e))nn(e,n)&&(Array.isArray(r)?t[n]=cD(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Ar(r):t[n]=r);return t}function Do(e,t){for(;e!==null;){const r=sD(e,t);if(r){if(r.get)return Re(r.get);if(typeof r.value=="function")return Re(r.value)}e=iD(e)}function n(){return null}return n}const Hv=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Iu=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nu=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),uD=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pu=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hD=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vv=ve(["#text"]),Fv=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Uu=ve(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zv=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Io=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dD=Ge(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fD=Ge(/<%[\w\W]*|[\w\W]*%>/gm),pD=Ge(/\${[\w\W]*}/gm),mD=Ge(/^data-[\-\w.\u00B7-\uFFFF]/),gD=Ge(/^aria-[\-\w]+$/),Gv=Ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vD=Ge(/^(?:\w+script|data):/i),yD=Ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jv=Ge(/^html$/i),xD=Ge(/^[a-z][.\w]*(-[.\w]+)+$/i);var Wv=Object.freeze({__proto__:null,MUSTACHE_EXPR:dD,ERB_EXPR:fD,TMPLIT_EXPR:pD,DATA_ATTR:mD,ARIA_ATTR:gD,IS_ALLOWED_URI:Gv,IS_SCRIPT_OR_DATA:vD,ATTR_WHITESPACE:yD,DOCTYPE_NAME:jv,CUSTOM_ELEMENT:xD});const Rs={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bD=function(){return typeof window>"u"?null:window},ED=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function qv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bD();const t=T=>qv(T);if(t.version="3.1.5",t.removed=[],!e||!e.document||e.document.nodeType!==Rs.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,v=Do(p,"cloneNode"),m=Do(p,"nextSibling"),y=Do(p,"childNodes"),g=Do(p,"parentNode");if(typeof a=="function"){const T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}let b,w="";const{implementation:_,createNodeIterator:S,createDocumentFragment:R,getElementsByTagName:I}=n,{importNode:k}=r;let L={};t.isSupported=typeof Iv=="function"&&typeof g=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:V,TMPLIT_EXPR:P,DATA_ATTR:H,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:U}=Wv;let{IS_ALLOWED_URI:B}=Wv,W=null;const K=bt({},[...Hv,...Iu,...Nu,...Pu,...Vv]);let Q=null;const ft=bt({},[...Fv,...Uu,...zv,...Io]);let st=Object.seal(Pv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),gt=null,X=null,nt=!0,pt=!0,q=!1,tt=!0,ct=!1,z=!0,Mt=!1,Et=!1,qt=!1,Nt=!1,it=!1,At=!1,De=!0,Ie=!1;const gh="user-content-";let Rr=!0,Lr=!1,tr={},Vn=null;const Ps=bt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const qo=bt({},["audio","video","img","source","image","track"]);let bi=null;const Us=bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",Ei="http://www.w3.org/2000/svg",sn="http://www.w3.org/1999/xhtml";let rr=sn,Bs=!1,Hs=null;const vh=bt({},[nr,Ei,sn],Du);let kr=null;const Vs=["application/xhtml+xml","text/html"],Yo="text/html";let zt=null,gn=null;const Fs=n.createElement("form"),zs=function(T){return T instanceof RegExp||T instanceof Function},Gs=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(gn&&gn===T)){if((!T||typeof T!="object")&&(T={}),T=Ar(T),kr=Vs.indexOf(T.PARSER_MEDIA_TYPE)===-1?Yo:T.PARSER_MEDIA_TYPE,zt=kr==="application/xhtml+xml"?Du:ko,W=nn(T,"ALLOWED_TAGS")?bt({},T.ALLOWED_TAGS,zt):K,Q=nn(T,"ALLOWED_ATTR")?bt({},T.ALLOWED_ATTR,zt):ft,Hs=nn(T,"ALLOWED_NAMESPACES")?bt({},T.ALLOWED_NAMESPACES,Du):vh,bi=nn(T,"ADD_URI_SAFE_ATTR")?bt(Ar(Us),T.ADD_URI_SAFE_ATTR,zt):Us,er=nn(T,"ADD_DATA_URI_TAGS")?bt(Ar(qo),T.ADD_DATA_URI_TAGS,zt):qo,Vn=nn(T,"FORBID_CONTENTS")?bt({},T.FORBID_CONTENTS,zt):Ps,gt=nn(T,"FORBID_TAGS")?bt({},T.FORBID_TAGS,zt):{},X=nn(T,"FORBID_ATTR")?bt({},T.FORBID_ATTR,zt):{},tr=nn(T,"USE_PROFILES")?T.USE_PROFILES:!1,nt=T.ALLOW_ARIA_ATTR!==!1,pt=T.ALLOW_DATA_ATTR!==!1,q=T.ALLOW_UNKNOWN_PROTOCOLS||!1,tt=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ct=T.SAFE_FOR_TEMPLATES||!1,z=T.SAFE_FOR_XML!==!1,Mt=T.WHOLE_DOCUMENT||!1,Nt=T.RETURN_DOM||!1,it=T.RETURN_DOM_FRAGMENT||!1,At=T.RETURN_TRUSTED_TYPE||!1,qt=T.FORCE_BODY||!1,De=T.SANITIZE_DOM!==!1,Ie=T.SANITIZE_NAMED_PROPS||!1,Rr=T.KEEP_CONTENT!==!1,Lr=T.IN_PLACE||!1,B=T.ALLOWED_URI_REGEXP||Gv,rr=T.NAMESPACE||sn,st=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&zs(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(st.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&zs(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(st.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ct&&(pt=!1),it&&(Nt=!0),tr&&(W=bt({},Vv),Q=[],tr.html===!0&&(bt(W,Hv),bt(Q,Fv)),tr.svg===!0&&(bt(W,Iu),bt(Q,Uu),bt(Q,Io)),tr.svgFilters===!0&&(bt(W,Nu),bt(Q,Uu),bt(Q,Io)),tr.mathMl===!0&&(bt(W,Pu),bt(Q,zv),bt(Q,Io))),T.ADD_TAGS&&(W===K&&(W=Ar(W)),bt(W,T.ADD_TAGS,zt)),T.ADD_ATTR&&(Q===ft&&(Q=Ar(Q)),bt(Q,T.ADD_ATTR,zt)),T.ADD_URI_SAFE_ATTR&&bt(bi,T.ADD_URI_SAFE_ATTR,zt),T.FORBID_CONTENTS&&(Vn===Ps&&(Vn=Ar(Vn)),bt(Vn,T.FORBID_CONTENTS,zt)),Rr&&(W["#text"]=!0),Mt&&bt(W,["html","head","body"]),W.table&&(bt(W,["tbody"]),delete gt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=T.TRUSTED_TYPES_POLICY,w=b.createHTML("")}else b===void 0&&(b=ED(f,i)),b!==null&&typeof w=="string"&&(w=b.createHTML(""));ve&&ve(T),gn=T}},js=bt({},["mi","mo","mn","ms","mtext"]),Xo=bt({},["foreignobject","annotation-xml"]),Zo=bt({},["title","style","font","a","script"]),Ws=bt({},[...Iu,...Nu,...uD]),Ko=bt({},[...Pu,...hD]),yh=function(T){let G=g(T);(!G||!G.tagName)&&(G={namespaceURI:rr,tagName:"template"});const Y=ko(T.tagName),ot=ko(G.tagName);return Hs[T.namespaceURI]?T.namespaceURI===Ei?G.namespaceURI===sn?Y==="svg":G.namespaceURI===nr?Y==="svg"&&(ot==="annotation-xml"||js[ot]):!!Ws[Y]:T.namespaceURI===nr?G.namespaceURI===sn?Y==="math":G.namespaceURI===Ei?Y==="math"&&Xo[ot]:!!Ko[Y]:T.namespaceURI===sn?G.namespaceURI===Ei&&!Xo[ot]||G.namespaceURI===nr&&!js[ot]?!1:!Ko[Y]&&(Zo[Y]||!Ws[Y]):!!(kr==="application/xhtml+xml"&&Hs[T.namespaceURI]):!1},vn=function(T){Cs(t.removed,{element:T});try{T.parentNode.removeChild(T)}catch{T.remove()}},Dr=function(T,G){try{Cs(t.removed,{attribute:G.getAttributeNode(T),from:G})}catch{Cs(t.removed,{attribute:null,from:G})}if(G.removeAttribute(T),T==="is"&&!Q[T])if(Nt||it)try{vn(G)}catch{}else try{G.setAttribute(T,"")}catch{}},Qo=function(T){let G=null,Y=null;if(qt)T="<remove></remove>"+T;else{const St=Bv(T,/^[\r\n\t ]+/);Y=St&&St[0]}kr==="application/xhtml+xml"&&rr===sn&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ot=b?b.createHTML(T):T;if(rr===sn)try{G=new h().parseFromString(ot,kr)}catch{}if(!G||!G.documentElement){G=_.createDocument(rr,"template",null);try{G.documentElement.innerHTML=Bs?w:ot}catch{}}const vt=G.body||G.documentElement;return T&&Y&&vt.insertBefore(n.createTextNode(Y),vt.childNodes[0]||null),rr===sn?I.call(G,Mt?"html":"body")[0]:Mt?G.documentElement:vt},Jo=function(T){return S.call(T.ownerDocument||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tl=function(T){return T instanceof d&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof u)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},el=function(T){return typeof o=="function"&&T instanceof o},C=function(T,G,Y){L[T]&&Lo(L[T],ot=>{ot.call(t,G,Y,gn)})},j=function(T){let G=null;if(C("beforeSanitizeElements",T,null),tl(T))return vn(T),!0;const Y=zt(T.nodeName);if(C("uponSanitizeElement",T,{tagName:Y,allowedTags:W}),T.hasChildNodes()&&!el(T.firstElementChild)&&ye(/<[/\w]/g,T.innerHTML)&&ye(/<[/\w]/g,T.textContent)||T.nodeType===Rs.progressingInstruction||z&&T.nodeType===Rs.comment&&ye(/<[/\w]/g,T.data))return vn(T),!0;if(!W[Y]||gt[Y]){if(!gt[Y]&&ut(Y)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,Y)||st.tagNameCheck instanceof Function&&st.tagNameCheck(Y)))return!1;if(Rr&&!Vn[Y]){const ot=g(T)||T.parentNode,vt=y(T)||T.childNodes;if(vt&&ot){const St=vt.length;for(let pe=St-1;pe>=0;--pe){const Jt=v(vt[pe],!0);Jt.__removalCount=(T.__removalCount||0)+1,ot.insertBefore(Jt,m(T))}}}return vn(T),!0}return T instanceof l&&!yh(T)||(Y==="noscript"||Y==="noembed"||Y==="noframes")&&ye(/<\/no(script|embed|frames)/i,T.innerHTML)?(vn(T),!0):(ct&&T.nodeType===Rs.text&&(G=T.textContent,Lo([M,V,P],ot=>{G=As(G,ot," ")}),T.textContent!==G&&(Cs(t.removed,{element:T.cloneNode()}),T.textContent=G)),C("afterSanitizeElements",T,null),!1)},Z=function(T,G,Y){if(De&&(G==="id"||G==="name")&&(Y in n||Y in Fs))return!1;if(!(pt&&!X[G]&&ye(H,G))&&!(nt&&ye(E,G))){if(!Q[G]||X[G]){if(!(ut(T)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,T)||st.tagNameCheck instanceof Function&&st.tagNameCheck(T))&&(st.attributeNameCheck instanceof RegExp&&ye(st.attributeNameCheck,G)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(G))||G==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,Y)||st.tagNameCheck instanceof Function&&st.tagNameCheck(Y))))return!1}else if(!bi[G]&&!ye(B,As(Y,$,""))&&!((G==="src"||G==="xlink:href"||G==="href")&&T!=="script"&&aD(Y,"data:")===0&&er[T])&&!(q&&!ye(A,As(Y,$,"")))&&Y)return!1}return!0},ut=function(T){return T!=="annotation-xml"&&Bv(T,U)},wt=function(T){C("beforeSanitizeAttributes",T,null);const{attributes:G}=T;if(!G)return;const Y={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q};let ot=G.length;for(;ot--;){const vt=G[ot],{name:St,namespaceURI:pe,value:Jt}=vt,Gt=zt(St);let ie=St==="value"?Jt:oD(Jt);if(Y.attrName=Gt,Y.attrValue=ie,Y.keepAttr=!0,Y.forceKeepAttr=void 0,C("uponSanitizeAttribute",T,Y),ie=Y.attrValue,Y.forceKeepAttr||(Dr(St,T),!Y.keepAttr))continue;if(!tt&&ye(/\/>/i,ie)){Dr(St,T);continue}if(z&&ye(/((--!?|])>)|<\/(style|title)/i,ie)){Dr(St,T);continue}ct&&Lo([M,V,P],xh=>{ie=As(ie,xh," ")});const nl=zt(T.nodeName);if(Z(nl,Gt,ie)){if(Ie&&(Gt==="id"||Gt==="name")&&(Dr(St,T),ie=gh+ie),b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(nl,Gt)){case"TrustedHTML":{ie=b.createHTML(ie);break}case"TrustedScriptURL":{ie=b.createScriptURL(ie);break}}try{pe?T.setAttributeNS(pe,St,ie):T.setAttribute(St,ie),tl(T)?vn(T):Uv(t.removed)}catch{}}}C("afterSanitizeAttributes",T,null)},Dt=function T(G){let Y=null;const ot=Jo(G);for(C("beforeSanitizeShadowDOM",G,null);Y=ot.nextNode();)C("uponSanitizeShadowNode",Y,null),!j(Y)&&(Y.content instanceof s&&T(Y.content),wt(Y));C("afterSanitizeShadowDOM",G,null)};return t.sanitize=function(T){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,ot=null,vt=null,St=null;if(Bs=!T,Bs&&(T="<!-->"),typeof T!="string"&&!el(T))if(typeof T.toString=="function"){if(T=T.toString(),typeof T!="string")throw $s("dirty is not a string, aborting")}else throw $s("toString is not a function");if(!t.isSupported)return T;if(Et||Gs(G),t.removed=[],typeof T=="string"&&(Lr=!1),Lr){if(T.nodeName){const Gt=zt(T.nodeName);if(!W[Gt]||gt[Gt])throw $s("root node is forbidden and cannot be sanitized in-place")}}else if(T instanceof o)Y=Qo("<!---->"),ot=Y.ownerDocument.importNode(T,!0),ot.nodeType===Rs.element&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Y=ot:Y.appendChild(ot);else{if(!Nt&&!ct&&!Mt&&T.indexOf("<")===-1)return b&&At?b.createHTML(T):T;if(Y=Qo(T),!Y)return Nt?null:At?w:""}Y&&qt&&vn(Y.firstChild);const pe=Jo(Lr?T:Y);for(;vt=pe.nextNode();)j(vt)||(vt.content instanceof s&&Dt(vt.content),wt(vt));if(Lr)return T;if(Nt){if(it)for(St=R.call(Y.ownerDocument);Y.firstChild;)St.appendChild(Y.firstChild);else St=Y;return(Q.shadowroot||Q.shadowrootmode)&&(St=k.call(r,St,!0)),St}let Jt=Mt?Y.outerHTML:Y.innerHTML;return Mt&&W["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&ye(jv,Y.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
4
- `+Jt),ct&&Lo([M,V,P],Gt=>{Jt=As(Jt,Gt," ")}),b&&At?b.createHTML(Jt):Jt},t.setConfig=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gs(T),Et=!0},t.clearConfig=function(){gn=null,Et=!1},t.isValidAttribute=function(T,G,Y){gn||Gs({});const ot=zt(T),vt=zt(G);return Z(ot,vt,Y)},t.addHook=function(T,G){typeof G=="function"&&(L[T]=L[T]||[],Cs(L[T],G))},t.removeHook=function(T){if(L[T])return Uv(L[T])},t.removeHooks=function(T){L[T]&&(L[T]=[])},t.removeAllHooks=function(){L={}},t}var Bu=qv();const No=e=>Bu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),_D=e=>Bu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),pn=e=>Bu.sanitize(e,{ALLOWED_TAGS:[]}),Yv=class G0 extends xt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label","chart toolbar");if(x(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
1
+ (function(V,le){typeof exports=="object"&&typeof module<"u"?le(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],le):(V=typeof globalThis<"u"?globalThis:V||self,le(V.ChartsReact={},V.React))})(this,function(V,le){"use strict";var g3=Object.defineProperty;var v3=(V,le,Fn)=>le in V?g3(V,le,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):V[le]=Fn;var Uh=(V,le,Fn)=>v3(V,typeof le!="symbol"?le+"":le,Fn);var Fn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Fn||{}),ol=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(ol||{}),ll=(e=>(e.UPDATE="model-update",e))(ll||{}),Hh=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Hh||{}),cl=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(cl||{}),ul=(e=>(e.CHANGE="zoom-domain-change",e))(ul||{}),hl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(hl||{}),dl=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(dl||{}),fl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(fl||{}),pl=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(pl||{}),ml=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(ml||{}),gl=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(gl||{}),vl=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(vl||{}),yl=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(yl||{}),xl=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(xl||{}),bl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(bl||{}),El=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(El||{}),_l=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(_l||{}),wl=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(wl||{}),Pr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Pr||{}),Sl=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Sl||{}),Vh=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Vh||{}),Fh=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Fh||{}),zh=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(zh||{}),Gh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Gh||{}),jh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(jh||{}),Ur=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Ur||{});const W0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:zh,Area:fl,Axis:dl,Bar:vl,Boxplot:yl,CanvasZoom:hl,Chart:Fn,Choropleth:Ur,CirclePack:Fh,Gauge:gl,Heatmap:jh,Legend:Vh,Line:bl,Meter:Gh,Modal:ol,Model:ll,Pie:ml,Radar:El,Scatter:xl,Threshold:Sl,Toolbar:Hh,Tooltip:Pr,Tree:_l,Treemap:wl,WordCloud:pl,ZoomBar:cl,ZoomDomain:ul},Symbol.toStringTag,{value:"Module"})),T=W0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),Tl=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Tl||{}),at=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(at||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),We=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(We||{}),Pe=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Pe||{}),Qt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Qt||{}),et=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(et||{}),Br=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Br||{}),Jt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Jt||{}),Hr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Hr||{}),Qs=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Qs||{}),Pt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Pt||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),ir=(e=>(e.CENTER="center",e))(ir||{}),Oi=(e=>(e.LEFT="left",e.RIGHT="right",e))(Oi||{}),te=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(te||{}),on=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(on||{}),ln=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(ln||{}),sr=(e=>(e.SEMI="semi",e.FULL="full",e))(sr||{}),Js=(e=>(e.UP="up",e.DOWN="down",e))(Js||{}),Mi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Mi||{}),Ci=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ci||{}),Oe=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(Oe||{}),Ct=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(Ct||{}),ta=(e=>(e.LEFT="left",e.RIGHT="right",e))(ta||{}),ee=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(ee||{}),Ai=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ai||{}),Vr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Vr||{}),$i=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))($i||{}),cn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(cn||{});function ar(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function q0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ol(e){let t,n,r;e.length!==2?(t=ar,n=(o,l)=>ar(e(o),l),r=(o,l)=>e(o)-l):(t=e===ar||e===q0?e:Y0,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Y0(){return 0}function Z0(e){return e===null?NaN:+e}function*X0(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Ml=Ol(ar).right;Ol(Z0).center;function K0(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function qe(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class or{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Wh extends Map{constructor(t,n=ty){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(qh(this,t))}has(t){return super.has(qh(this,t))}set(t,n){return super.set(Q0(this,t),n)}delete(t){return super.delete(J0(this,t))}}function qh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Q0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function J0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ty(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ey(e){return e}function ny(e=ar){if(e===ar)return Yh;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Yh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var ry=Array.prototype,iy=ry.slice;function Cl(e){return()=>e}const sy=Math.sqrt(50),ay=Math.sqrt(10),oy=Math.sqrt(2);function ea(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=sy?10:s>=ay?5:s>=oy?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?ea(e,t,n*2):[o,l,c]}function na(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?ea(t,e,n):ea(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Fr(e,t,n){return t=+t,e=+e,n=+n,ea(e,t,n)[2]}function Al(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Fr(t,e,n):Fr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ly(e,t,n){let r;for(;;){const i=Fr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function cy(e){return Math.max(1,Math.ceil(Math.log(K0(e))/Math.LN2)+1)}function uy(){var e=ey,t=qe,n=cy;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const b=h,w=+f;if(t===qe&&([d,h]=ly(d,h,w)),f=na(d,h,w),f[0]<=d&&(l=Fr(d,h,w)),f[f.length-1]>=h)if(b>=h&&t===qe){const _=Fr(d,h,w);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else f.pop()}for(var p=f.length,v=0,m=p;f[v]<=d;)++v;for(;f[m-1]>h;)--m;(v||m<p)&&(f=f.slice(v,m),p=m-v);var y=new Array(p+1),g;for(s=0;s<=p;++s)g=y[s]=[],g.x0=s>0?f[s-1]:d,g.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&y[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const b=Math.floor((d-o)*l);y[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&y[Ml(f,o,0,p)].push(i[s]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Cl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Cl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Cl(Array.isArray(i)?iy.call(i):i),r):n},r}function lr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function zn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Zh(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Yh:ny(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));Zh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Li(e,n,t),i(e[r],s)>0&&Li(e,n,r);a<o;){for(Li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Li(e,n,o):(++o,Li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function $l(e,t,n){if(e=Float64Array.from(X0(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return zn(e);if(t>=1)return lr(e);var r,i=(r-1)*t,s=Math.floor(i),a=lr(Zh(e,s).subarray(0,s+1)),o=zn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*hy(e){for(const t of e)yield*t}function Xh(e){return Array.from(hy(e))}function dy(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function fy(e){return e}var ra=1,ia=2,Ll=3,Ri=4,Kh=1e-6;function py(e){return"translate("+e+",0)"}function my(e){return"translate(0,"+e+")"}function gy(e){return t=>+e(t)}function vy(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function yy(){return!this.__axis}function sa(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===ra||e===Ri?-1:1,u=e===Ri||e===ia?"x":"y",d=e===ra||e===Ll?py:my;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):fy),m=Math.max(s,0)+o,y=t.range(),g=+y[0]+l,b=+y[y.length-1]+l,w=(t.bandwidth?vy:gy)(t.copy(),l),_=f.selection?f.selection():f,S=_.selectAll(".domain").data([null]),L=_.selectAll(".tick").data(p,t).order(),I=L.exit(),k=L.enter().append("g").attr("class","tick"),R=L.select("line"),M=L.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),L=L.merge(k),R=R.merge(k.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(k.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===ra?"0em":e===Ll?"0.71em":"0.32em")),f!==_&&(S=S.transition(f),L=L.transition(f),R=R.transition(f),M=M.transition(f),I=I.transition(f).attr("opacity",Kh).attr("transform",function(F){return isFinite(F=w(F))?d(F+l):this.getAttribute("transform")}),k.attr("opacity",Kh).attr("transform",function(F){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(F))?P:w(F))+l)})),I.remove(),S.attr("d",e===Ri||e===ia?a?"M"+c*a+","+g+"H"+l+"V"+b+"H"+c*a:"M"+l+","+g+"V"+b:a?"M"+g+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+g+","+l+"H"+b),L.attr("opacity",1).attr("transform",function(F){return d(w(F)+l)}),R.attr(u+"2",c*s),M.attr(u,c*m).text(v),_.filter(yy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ia?"start":e===Ri?"end":"middle"),_.each(function(){this.__axis=w})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function xy(e){return sa(ra,e)}function by(e){return sa(ia,e)}function Rl(e){return sa(Ll,e)}function Qh(e){return sa(Ri,e)}var Ey={value:()=>{}};function kl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new aa(n)}function aa(e){this._=e}function _y(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}aa.prototype=kl.prototype={constructor:aa,on:function(e,t){var n=this._,r=_y(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wy(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Jh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Jh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new aa(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function wy(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Jh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ey,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Dl="http://www.w3.org/1999/xhtml";const td={svg:"http://www.w3.org/2000/svg",xhtml:Dl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),td.hasOwnProperty(t)?{space:td[t],local:e}:e}function Sy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Dl&&t.documentElement.namespaceURI===Dl?t.createElement(e):t.createElementNS(n,e)}}function Ty(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ed(e){var t=oa(e);return(t.local?Ty:Sy)(t)}function Oy(){}function Il(e){return e==null?Oy:function(){return this.querySelector(e)}}function My(e){typeof e!="function"&&(e=Il(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Me(r,this._parents)}function Cy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ay(){return[]}function nd(e){return e==null?Ay:function(){return this.querySelectorAll(e)}}function $y(e){return function(){return Cy(e.apply(this,arguments))}}function Ly(e){typeof e=="function"?e=$y(e):e=nd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Me(r,i)}function rd(e){return function(){return this.matches(e)}}function id(e){return function(t){return t.matches(e)}}var Ry=Array.prototype.find;function ky(e){return function(){return Ry.call(this.children,e)}}function Dy(){return this.firstElementChild}function Iy(e){return this.select(e==null?Dy:ky(typeof e=="function"?e:id(e)))}var Ny=Array.prototype.filter;function Py(){return Array.from(this.children)}function Uy(e){return function(){return Ny.call(this.children,e)}}function By(e){return this.selectAll(e==null?Py:Uy(typeof e=="function"?e:id(e)))}function Hy(e){typeof e!="function"&&(e=rd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Me(r,this._parents)}function sd(e){return new Array(e.length)}function Vy(){return new Me(this._enter||this._groups.map(sd),this._parents)}function la(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}la.prototype={constructor:la,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Fy(e){return function(){return e}}function zy(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new la(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function Gy(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new la(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function jy(e){return e.__data__}function Wy(e,t){if(!arguments.length)return Array.from(this,jy);var n=t?Gy:zy,r=this._parents,i=this._groups;typeof e!="function"&&(e=Fy(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=qy(e.call(u,u&&u.__data__,c,r)),p=f.length,v=o[c]=new Array(p),m=a[c]=new Array(p),y=l[c]=new Array(h);n(u,d,v,m,y,f,t);for(var g=0,b=0,w,_;g<p;++g)if(w=v[g]){for(g>=b&&(b=g+1);!(_=m[b])&&++b<p;);w._next=_||null}}return a=new Me(a,r),a._enter=o,a._exit=l,a}function qy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yy(){return new Me(this._exit||this._groups.map(sd),this._parents)}function Zy(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Xy(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new Me(o,this._parents)}function Ky(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Qy(e){e||(e=Jy);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Me(i,this._parents).order()}function Jy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function t1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function e1(){return Array.from(this)}function n1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function r1(){let e=0;for(const t of this)++e;return e}function i1(){return!this.node()}function s1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function a1(e){return function(){this.removeAttribute(e)}}function o1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function l1(e,t){return function(){this.setAttribute(e,t)}}function c1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function u1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function h1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function d1(e,t){var n=oa(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?o1:a1:typeof t=="function"?n.local?h1:u1:n.local?c1:l1)(n,t))}function ad(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function f1(e){return function(){this.style.removeProperty(e)}}function p1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function m1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function g1(e,t,n){return arguments.length>1?this.each((t==null?f1:typeof t=="function"?m1:p1)(e,t,n??"")):zr(this.node(),e)}function zr(e,t){return e.style.getPropertyValue(t)||ad(e).getComputedStyle(e,null).getPropertyValue(t)}function v1(e){return function(){delete this[e]}}function y1(e,t){return function(){this[e]=t}}function x1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function b1(e,t){return arguments.length>1?this.each((t==null?v1:typeof t=="function"?x1:y1)(e,t)):this.node()[e]}function od(e){return e.trim().split(/^|\s+/)}function Nl(e){return e.classList||new ld(e)}function ld(e){this._node=e,this._names=od(e.getAttribute("class")||"")}ld.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function cd(e,t){for(var n=Nl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function ud(e,t){for(var n=Nl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function E1(e){return function(){cd(this,e)}}function _1(e){return function(){ud(this,e)}}function w1(e,t){return function(){(t.apply(this,arguments)?cd:ud)(this,e)}}function S1(e,t){var n=od(e+"");if(arguments.length<2){for(var r=Nl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?w1:t?E1:_1)(n,t))}function T1(){this.textContent=""}function O1(e){return function(){this.textContent=e}}function M1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function C1(e){return arguments.length?this.each(e==null?T1:(typeof e=="function"?M1:O1)(e)):this.node().textContent}function A1(){this.innerHTML=""}function $1(e){return function(){this.innerHTML=e}}function L1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function R1(e){return arguments.length?this.each(e==null?A1:(typeof e=="function"?L1:$1)(e)):this.node().innerHTML}function k1(){this.nextSibling&&this.parentNode.appendChild(this)}function D1(){return this.each(k1)}function I1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function N1(){return this.each(I1)}function P1(e){var t=typeof e=="function"?e:ed(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function U1(){return null}function B1(e,t){var n=typeof e=="function"?e:ed(e),r=t==null?U1:typeof t=="function"?t:Il(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H1(){var e=this.parentNode;e&&e.removeChild(this)}function V1(){return this.each(H1)}function F1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(e){return this.select(e?z1:F1)}function j1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function W1(e){return function(t){e.call(this,t,this.__data__)}}function q1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Y1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function Z1(e,t,n){return function(){var r=this.__on,i,s=W1(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function X1(e,t,n){var r=q1(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?Z1:Y1,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function hd(e,t,n){var r=ad(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function K1(e,t){return function(){return hd(this,e,t)}}function Q1(e,t){return function(){return hd(this,e,t.apply(this,arguments))}}function J1(e,t){return this.each((typeof t=="function"?Q1:K1)(e,t))}function*tx(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var dd=[null];function Me(e,t){this._groups=e,this._parents=t}function ki(){return new Me([[document.documentElement]],dd)}function ex(){return this}Me.prototype=ki.prototype={constructor:Me,select:My,selectAll:Ly,selectChild:Iy,selectChildren:By,filter:Hy,data:Wy,enter:Vy,exit:Yy,join:Zy,merge:Xy,selection:ex,order:Ky,sort:Qy,call:t1,nodes:e1,node:n1,size:r1,empty:i1,each:s1,attr:d1,style:g1,property:b1,classed:S1,text:C1,html:R1,raise:D1,lower:N1,append:P1,insert:B1,remove:V1,clone:G1,datum:j1,on:X1,dispatch:J1,[Symbol.iterator]:tx};function D(e){return typeof e=="string"?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],dd)}function nx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function cr(e,t){if(e=nx(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Pl={capture:!0,passive:!1};function Ul(e){e.preventDefault(),e.stopImmediatePropagation()}function rx(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Ul,Pl);"onselectstart"in t?n.on("selectstart.drag",Ul,Pl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ix(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ul,Pl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Bl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Di(){}var Ii=.7,ca=1/Ii,Gr="\\s*([+-]?\\d+)\\s*",Ni="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sx=/^#([0-9a-f]{3,8})$/,ax=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),ox=new RegExp(`^rgb\\(${un},${un},${un}\\)$`),lx=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${Ni}\\)$`),cx=new RegExp(`^rgba\\(${un},${un},${un},${Ni}\\)$`),ux=new RegExp(`^hsl\\(${Ni},${un},${un}\\)$`),hx=new RegExp(`^hsla\\(${Ni},${un},${un},${Ni}\\)$`),pd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bl(Di,En,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:md,formatHex:md,formatHex8:dx,formatHsl:fx,formatRgb:gd,toString:gd});function md(){return this.rgb().formatHex()}function dx(){return this.rgb().formatHex8()}function fx(){return Ed(this).formatHsl()}function gd(){return this.rgb().formatRgb()}function En(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vd(t):n===3?new be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ua(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ua(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ax.exec(e))?new be(t[1],t[2],t[3],1):(t=ox.exec(e))?new be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lx.exec(e))?ua(t[1],t[2],t[3],t[4]):(t=cx.exec(e))?ua(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ux.exec(e))?bd(t[1],t[2]/100,t[3]/100,1):(t=hx.exec(e))?bd(t[1],t[2]/100,t[3]/100,t[4]):pd.hasOwnProperty(e)?vd(pd[e]):e==="transparent"?new be(NaN,NaN,NaN,0):null}function vd(e){return new be(e>>16&255,e>>8&255,e&255,1)}function ua(e,t,n,r){return r<=0&&(e=t=n=NaN),new be(e,t,n,r)}function px(e){return e instanceof Di||(e=En(e)),e?(e=e.rgb(),new be(e.r,e.g,e.b,e.opacity)):new be}function Hl(e,t,n,r){return arguments.length===1?px(e):new be(e,t,n,r??1)}function be(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bl(be,Hl,fd(Di,{brighter(e){return e=e==null?ca:Math.pow(ca,e),new be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new be(ur(this.r),ur(this.g),ur(this.b),ha(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yd,formatHex:yd,formatHex8:mx,formatRgb:xd,toString:xd}));function yd(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}`}function mx(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}${hr((isNaN(this.opacity)?1:this.opacity)*255)}`}function xd(){const e=ha(this.opacity);return`${e===1?"rgb(":"rgba("}${ur(this.r)}, ${ur(this.g)}, ${ur(this.b)}${e===1?")":`, ${e})`}`}function ha(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ur(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hr(e){return e=ur(e),(e<16?"0":"")+e.toString(16)}function bd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ye(e,t,n,r)}function Ed(e){if(e instanceof Ye)return new Ye(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=En(e)),!e)return new Ye;if(e instanceof Ye)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Ye(a,o,l,e.opacity)}function Vl(e,t,n,r){return arguments.length===1?Ed(e):new Ye(e,t,n,r??1)}function Ye(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bl(Ye,Vl,fd(Di,{brighter(e){return e=e==null?ca:Math.pow(ca,e),new Ye(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new Ye(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new be(Fl(e>=240?e-240:e+120,i,r),Fl(e,i,r),Fl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ye(_d(this.h),da(this.s),da(this.l),ha(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ha(this.opacity);return`${e===1?"hsl(":"hsla("}${_d(this.h)}, ${da(this.s)*100}%, ${da(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _d(e){return e=(e||0)%360,e<0?e+360:e}function da(e){return Math.max(0,Math.min(1,e||0))}function Fl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const zl=e=>()=>e;function gx(e,t){return function(n){return e+n*t}}function vx(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function yx(e){return(e=+e)==1?wd:function(t,n){return n-t?vx(t,n,e):zl(isNaN(t)?n:t)}}function wd(e,t){var n=t-e;return n?gx(e,n):zl(isNaN(e)?t:e)}const fa=function e(t){var n=yx(t);function r(i,s){var a=n((i=Hl(i)).r,(s=Hl(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=wd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function xx(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function bx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ex(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function _x(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ce(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Gl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jl=new RegExp(Gl.source,"g");function Sx(e){return function(){return e}}function Tx(e){return function(t){return e(t)+""}}function Sd(e,t){var n=Gl.lastIndex=jl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Gl.exec(e))&&(i=jl.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Ce(r,i)})),n=jl.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Tx(l[0].x):Sx(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?zl(t):(n==="number"?Ce:n==="string"?(r=En(t))?(t=r,fa):Sd:t instanceof En?fa:t instanceof Date?_x:bx(t)?xx:Array.isArray(t)?Ex:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wx:Ce)(e,t)}function Td(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Od=180/Math.PI,Wl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Md(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Od,skewX:Math.atan(l)*Od,scaleX:a,scaleY:o}}var pa;function Ox(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wl:Md(t.a,t.b,t.c,t.d,t.e,t.f)}function Mx(e){return e==null||(pa||(pa=document.createElementNS("http://www.w3.org/2000/svg","g")),pa.setAttribute("transform",e),!(e=pa.transform.baseVal.consolidate()))?Wl:(e=e.matrix,Md(e.a,e.b,e.c,e.d,e.e,e.f))}function Cd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var v=f.push("translate(",null,t,null,n);p.push({i:v-4,x:Ce(c,d)},{i:v-2,x:Ce(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ce(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ce(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var v=f.push(i(f)+"scale(",null,",",null,")");p.push({i:v-4,x:Ce(c,d)},{i:v-2,x:Ce(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,v=h.length,m;++p<v;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var Cx=Cd(Ox,"px, ","px)","deg)"),Ax=Cd(Mx,", ",")",")");function $x(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var jr=0,Ui=0,Bi=0,Ad=1e3,ma,Hi,ga=0,dr=0,va=0,Vi=typeof performance=="object"&&performance.now?performance:Date,$d=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ql(){return dr||($d(Lx),dr=Vi.now()+va)}function Lx(){dr=0}function ya(){this._call=this._time=this._next=null}ya.prototype=Ld.prototype={constructor:ya,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ql():+n)+(t==null?0:+t),!this._next&&Hi!==this&&(Hi?Hi._next=this:ma=this,Hi=this),this._call=e,this._time=n,Yl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yl())}};function Ld(e,t,n){var r=new ya;return r.restart(e,t,n),r}function Rx(){ql(),++jr;for(var e=ma,t;e;)(t=dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--jr}function Rd(){dr=(ga=Vi.now())+va,jr=Ui=0;try{Rx()}finally{jr=0,Dx(),dr=0}}function kx(){var e=Vi.now(),t=e-ga;t>Ad&&(va-=t,ga=e)}function Dx(){for(var e,t=ma,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ma=n);Hi=e,Yl(r)}function Yl(e){if(!jr){Ui&&(Ui=clearTimeout(Ui));var t=e-dr;t>24?(e<1/0&&(Ui=setTimeout(Rd,e-Vi.now()-va)),Bi&&(Bi=clearInterval(Bi))):(Bi||(ga=Vi.now(),Bi=setInterval(kx,Ad)),jr=1,$d(Rd))}}function kd(e,t,n){var r=new ya;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ix=kl("start","end","cancel","interrupt"),Nx=[],Dd=0,Id=1,Zl=2,xa=3,Nd=4,Xl=5,ba=6;function Ea(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Px(e,n,{name:t,index:r,group:i,on:Ix,tween:Nx,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Dd})}function Kl(e,t){var n=Ze(e,t);if(n.state>Dd)throw new Error("too late; already scheduled");return n}function hn(e,t){var n=Ze(e,t);if(n.state>xa)throw new Error("too late; already running");return n}function Ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Px(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ld(s,0,n.time);function s(c){n.state=Id,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Id)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===xa)return kd(a);f.state===Nd?(f.state=ba,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=ba,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(kd(function(){n.state===xa&&(n.state=Nd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Zl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Zl){for(n.state=xa,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Xl,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Xl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ba,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ql(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Zl&&r.state<Xl,r.state=ba,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function Ux(e){return this.each(function(){Ql(this,e)})}function Bx(e,t){var n,r;return function(){var i=hn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Hx(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=hn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function Vx(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ze(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Bx:Hx)(n,e,t))}function Jl(e,t,n){var r=e._id;return e.each(function(){var i=hn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ze(i,r).value[t]}}function Pd(e,t){var n;return(typeof t=="number"?Ce:t instanceof En?fa:(n=En(t))?(t=n,fa):Sd)(e,t)}function Fx(e){return function(){this.removeAttribute(e)}}function zx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gx(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function jx(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function Wx(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function qx(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Yx(e,t){var n=oa(e),r=n==="transform"?Ax:Pd;return this.attrTween(e,typeof t=="function"?(n.local?qx:Wx)(n,r,Jl(this,"attr."+e,t)):t==null?(n.local?zx:Fx)(n):(n.local?jx:Gx)(n,r,t))}function Zx(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Xx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Kx(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Xx(e,s)),n}return i._value=t,i}function Qx(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Zx(e,s)),n}return i._value=t,i}function Jx(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=oa(e);return this.tween(n,(r.local?Kx:Qx)(r,t))}function tb(e,t){return function(){Kl(this,e).delay=+t.apply(this,arguments)}}function eb(e,t){return t=+t,function(){Kl(this,e).delay=t}}function nb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tb:eb)(t,e)):Ze(this.node(),t).delay}function rb(e,t){return function(){hn(this,e).duration=+t.apply(this,arguments)}}function ib(e,t){return t=+t,function(){hn(this,e).duration=t}}function sb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rb:ib)(t,e)):Ze(this.node(),t).duration}function ab(e,t){if(typeof t!="function")throw new Error;return function(){hn(this,e).ease=t}}function ob(e){var t=this._id;return arguments.length?this.each(ab(t,e)):Ze(this.node(),t).ease}function lb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;hn(this,e).ease=n}}function cb(e){if(typeof e!="function")throw new Error;return this.each(lb(this._id,e))}function ub(e){typeof e!="function"&&(e=rd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new _n(r,this._parents,this._name,this._id)}function hb(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new _n(a,this._parents,this._name,this._id)}function db(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function fb(e,t,n){var r,i,s=db(t)?Kl:hn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function pb(e,t){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(e):this.each(fb(n,e,t))}function mb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gb(){return this.on("end.remove",mb(this._id))}function vb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Il(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Ea(c[h],t,n,h,c,Ze(u,n)));return new _n(s,this._parents,t,n)}function yb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Ze(u,n),v=0,m=h.length;v<m;++v)(f=h[v])&&Ea(f,t,n,v,h,p);s.push(h),a.push(u)}return new _n(s,a,t,n)}var xb=ki.prototype.constructor;function bb(){return new xb(this._groups,this._parents)}function Eb(e,t){var n,r,i;return function(){var s=zr(this,e),a=(this.style.removeProperty(e),zr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ud(e){return function(){this.style.removeProperty(e)}}function _b(e,t,n){var r,i=n+"",s;return function(){var a=zr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function wb(e,t,n){var r,i,s;return function(){var a=zr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),zr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function Sb(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=hn(this,e),c=l.on,u=l.value[s]==null?o||(o=Ud(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function Tb(e,t,n){var r=(e+="")=="transform"?Cx:Pd;return t==null?this.styleTween(e,Eb(e,r)).on("end.style."+e,Ud(e)):typeof t=="function"?this.styleTween(e,wb(e,r,Jl(this,"style."+e,t))).each(Sb(this._id,e)):this.styleTween(e,_b(e,r,t),n).on("end.style."+e,null)}function Ob(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Mb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ob(e,a,n)),r}return s._value=t,s}function Cb(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Mb(e,t,n??""))}function Ab(e){return function(){this.textContent=e}}function $b(e){return function(){var t=e(this);this.textContent=t??""}}function Lb(e){return this.tween("text",typeof e=="function"?$b(Jl(this,"text",e)):Ab(e==null?"":e+""))}function Rb(e){return function(t){this.textContent=e.call(this,t)}}function kb(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Rb(i)),t}return r._value=e,r}function Db(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,kb(e))}function Ib(){for(var e=this._name,t=this._id,n=Bd(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Ze(l,t);Ea(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _n(r,this._parents,e,n)}function Nb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=hn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var Pb=0;function _n(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Bd(){return++Pb}var wn=ki.prototype;_n.prototype={constructor:_n,select:vb,selectAll:yb,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:ub,merge:hb,selection:bb,transition:Ib,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:pb,attr:Yx,attrTween:Jx,style:Tb,styleTween:Cb,text:Lb,textTween:Db,remove:gb,tween:Vx,delay:nb,duration:sb,ease:ob,easeVarying:cb,end:Nb,[Symbol.iterator]:wn[Symbol.iterator]};const Ub=e=>+e;function Hd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bb={time:null,delay:0,duration:250,ease:Hd};function Hb(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Vb(e){var t,n;e instanceof _n?(t=e._id,e=e._name):(t=Bd(),(n=Bb).time=ql(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Ea(l,e,t,c,a,n||Hb(l,t));return new _n(r,this._parents,e,t)}ki.prototype.interrupt=Ux,ki.prototype.transition=Vb;const tc=e=>()=>e;function Fb(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function zb(e){e.stopImmediatePropagation()}function ec(e){e.preventDefault(),e.stopImmediatePropagation()}var Vd={name:"drag"},nc={name:"space"},Wr={name:"handle"},qr={name:"center"};const{abs:Fd,max:ce,min:ue}=Math;function zd(e){return[+e[0],+e[1]]}function Gd(e){return[zd(e[0]),zd(e[1])]}var _a={name:"x",handles:["w","e"].map(wa),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},rc={name:"y",handles:["n","s"].map(wa),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Sn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},jd={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Wd={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Gb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wa(e){return{type:e}}function Wb(e){return!e.ctrlKey&&!e.button}function qb(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Yb(){return navigator.maxTouchPoints||"ontouchstart"in this}function ic(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Zb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function qd(){return Xb(_a)}function Xb(e){var t=qb,n=Wb,r=Yb,i=!0,s=kl("start","brush","end"),a=6,o;function l(m){var y=m.property("__brush",v).selectAll(".overlay").data([wa("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Sn.overlay).merge(y).each(function(){var b=ic(this).extent;D(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),m.selectAll(".selection").data([wa("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Sn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var g=m.selectAll(".handle").data(e.handles,function(b){return b.type});g.exit().remove(),g.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return Sn[b.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,y,g){m.tween?m.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,w=b.__brush,_=u(b,arguments),S=w.selection,L=e.input(typeof y=="function"?y.apply(this,arguments):y,w.extent),I=Pi(S,L);function k(R){w.selection=R===1&&L===null?null:I(R),c.call(b),_.brush()}return S!==null&&L!==null?k:k(1)}):m.each(function(){var b=this,w=arguments,_=b.__brush,S=e.input(typeof y=="function"?y.apply(b,w):y,_.extent),L=u(b,w).beforestart();Ql(b),_.selection=S===null?null:S,c.call(b),L.start(g).brush(g).end(g)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=D(this),y=ic(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(g){return g.type[g.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(g){return g.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(g){return g.type==="n"||g.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(g){return g.type==="e"||g.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,y,g){var b=m.__brush.emitter;return b&&(!g||!b.clean)?b:new d(m,y,g)}function d(m,y,g){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=g}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,g){var b=D(this.that).datum();s.call(m,this.that,new Fb(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:g,dispatch:s}),b)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,g=m.target.__data__.type,b=(i&&m.metaKey?g="overlay":g)==="selection"?Vd:i&&m.altKey?qr:Wr,w=e===rc?null:Gb[g],_=e===_a?null:jb[g],S=ic(y),L=S.extent,I=S.selection,k=L[0][0],R,M,F=L[0][1],P,H,E=L[1][0],A,$,U=L[1][1],B,q,Q=0,J=0,ft,st=w&&_&&i&&m.shiftKey,gt,X,nt=Array.from(m.touches||[m],it=>{const $t=it.identifier;return it=cr(it,y),it.point0=it.slice(),it.identifier=$t,it});Ql(y);var pt=u(y,arguments,!0).beforestart();if(g==="overlay"){I&&(ft=!0);const it=[nt[0],nt[1]||nt[0]];S.selection=I=[[R=e===rc?k:ue(it[0][0],it[1][0]),P=e===_a?F:ue(it[0][1],it[1][1])],[A=e===rc?E:ce(it[0][0],it[1][0]),B=e===_a?U:ce(it[0][1],it[1][1])]],nt.length>1&&Mt(m)}else R=I[0][0],P=I[0][1],A=I[1][0],B=I[1][1];M=R,H=P,$=A,q=B;var Y=D(y).attr("pointer-events","none"),tt=Y.selectAll(".overlay").attr("cursor",Sn[g]);if(m.touches)pt.moved=G,pt.ended=Et;else{var ct=D(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",Et,!0);i&&ct.on("keydown.brush",qt,!0).on("keyup.brush",Nt,!0),rx(m.view)}c.call(y),pt.start(m,b.name);function G(it){for(const $t of it.changedTouches||[it])for(const Ie of nt)Ie.identifier===$t.identifier&&(Ie.cur=cr($t,y));if(st&&!gt&&!X&&nt.length===1){const $t=nt[0];Fd($t.cur[0]-$t[0])>Fd($t.cur[1]-$t[1])?X=!0:gt=!0}for(const $t of nt)$t.cur&&($t[0]=$t.cur[0],$t[1]=$t.cur[1]);ft=!0,ec(it),Mt(it)}function Mt(it){const $t=nt[0],Ie=$t.point0;var Ne;switch(Q=$t[0]-Ie[0],J=$t[1]-Ie[1],b){case nc:case Vd:{w&&(Q=ce(k-R,ue(E-A,Q)),M=R+Q,$=A+Q),_&&(J=ce(F-P,ue(U-B,J)),H=P+J,q=B+J);break}case Wr:{nt[1]?(w&&(M=ce(k,ue(E,nt[0][0])),$=ce(k,ue(E,nt[1][0])),w=1),_&&(H=ce(F,ue(U,nt[0][1])),q=ce(F,ue(U,nt[1][1])),_=1)):(w<0?(Q=ce(k-R,ue(E-R,Q)),M=R+Q,$=A):w>0&&(Q=ce(k-A,ue(E-A,Q)),M=R,$=A+Q),_<0?(J=ce(F-P,ue(U-P,J)),H=P+J,q=B):_>0&&(J=ce(F-B,ue(U-B,J)),H=P,q=B+J));break}case qr:{w&&(M=ce(k,ue(E,R-Q*w)),$=ce(k,ue(E,A+Q*w))),_&&(H=ce(F,ue(U,P-J*_)),q=ce(F,ue(U,B+J*_)));break}}$<M&&(w*=-1,Ne=R,R=A,A=Ne,Ne=M,M=$,$=Ne,g in jd&&tt.attr("cursor",Sn[g=jd[g]])),q<H&&(_*=-1,Ne=P,P=B,B=Ne,Ne=H,H=q,q=Ne,g in Wd&&tt.attr("cursor",Sn[g=Wd[g]])),S.selection&&(I=S.selection),gt&&(M=I[0][0],$=I[1][0]),X&&(H=I[0][1],q=I[1][1]),(I[0][0]!==M||I[0][1]!==H||I[1][0]!==$||I[1][1]!==q)&&(S.selection=[[M,H],[$,q]],c.call(y),pt.brush(it,b.name))}function Et(it){if(zb(it),it.touches){if(it.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ix(it.view,ft),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),tt.attr("cursor",Sn.overlay),S.selection&&(I=S.selection),Zb(I)&&(S.selection=null,c.call(y)),pt.end(it,b.name)}function qt(it){switch(it.keyCode){case 16:{st=w&&_;break}case 18:{b===Wr&&(w&&(A=$-Q*w,R=M+Q*w),_&&(B=q-J*_,P=H+J*_),b=qr,Mt(it));break}case 32:{(b===Wr||b===qr)&&(w<0?A=$-Q:w>0&&(R=M-Q),_<0?B=q-J:_>0&&(P=H-J),b=nc,tt.attr("cursor",Sn.selection),Mt(it));break}default:return}ec(it)}function Nt(it){switch(it.keyCode){case 16:{st&&(gt=X=st=!1,Mt(it));break}case 18:{b===qr&&(w<0?A=$:w>0&&(R=M),_<0?B=q:_>0&&(P=H),b=Wr,Mt(it));break}case 32:{b===nc&&(it.altKey?(w&&(A=$-Q*w,R=M+Q*w),_&&(B=q-J*_,P=H+J*_),b=qr):(w<0?A=$:w>0&&(R=M),_<0?B=q:_>0&&(P=H),b=Wr),tt.attr("cursor",Sn[g]),Mt(it));break}default:return}ec(it)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function v(){var m=this.__brush||{selection:null};return m.extent=Gd(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:tc(Gd(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:tc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:tc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const sc=Math.PI,ac=2*sc,fr=1e-6,Kb=ac-fr;function Yd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Qb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yd;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let oc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Yd:Qb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>fr)if(!(Math.abs(d*l-c*u)>fr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,v=l*l+c*c,m=f*f+p*p,y=Math.sqrt(v),g=Math.sqrt(h),b=s*Math.tan((sc-Math.acos((v+h-m)/(2*y*g)))/2),w=b/g,_=b/y;Math.abs(w-1)>fr&&this._append`L${t+w*u},${n+w*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>fr||Math.abs(this._y1-u)>fr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%ac+ac),h>Kb?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>fr&&this._append`A${r},${r},0,${+(h>=sc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Zd(){return new oc}Zd.prototype=oc.prototype;function Jb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Sa(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Yr(e){return e=Sa(Math.abs(e)),e?e[1]:NaN}function tE(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function eE(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fi(e){if(!(t=nE.exec(e)))throw new Error("invalid format: "+e);var t;return new lc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Fi.prototype=lc.prototype;function lc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}lc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rE(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Xd;function iE(e,t){var n=Sa(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Xd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Sa(e,Math.max(0,t+s-1))[0]}function Kd(e,t){var n=Sa(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Qd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Jb,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Kd(e*100,t),r:Kd,s:iE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Jd(e){return e}var tf=Array.prototype.map,ef=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sE(e){var t=e.grouping===void 0||e.thousands===void 0?Jd:tE(tf.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Jd:eE(tf.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Fi(d);var h=d.fill,f=d.align,p=d.sign,v=d.symbol,m=d.zero,y=d.width,g=d.comma,b=d.precision,w=d.trim,_=d.type;_==="n"?(g=!0,_="g"):Qd[_]||(b===void 0&&(b=12),w=!0,_="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var S=v==="$"?n:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",L=v==="$"?r:/[%p]/.test(_)?a:"",I=Qd[_],k=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function R(M){var F=S,P=L,H,E,A;if(_==="c")P=I(M)+P,M="";else{M=+M;var $=M<0||1/M<0;if(M=isNaN(M)?l:I(Math.abs(M),b),w&&(M=rE(M)),$&&+M==0&&p!=="+"&&($=!1),F=($?p==="("?p:o:p==="-"||p==="("?"":p)+F,P=(_==="s"?ef[8+Xd/3]:"")+P+($&&p==="("?")":""),k){for(H=-1,E=M.length;++H<E;)if(A=M.charCodeAt(H),48>A||A>57){P=(A===46?i+M.slice(H+1):M.slice(H))+P,M=M.slice(0,H);break}}}g&&!m&&(M=t(M,1/0));var U=F.length+M.length+P.length,B=U<y?new Array(y-U+1).join(h):"";switch(g&&m&&(M=t(B+M,B.length?y-P.length:1/0),B=""),f){case"<":M=F+M+P+B;break;case"=":M=F+B+M+P;break;case"^":M=B.slice(0,U=B.length>>1)+F+M+P+B.slice(U);break;default:M=B+F+M+P;break}return s(M)}return R.toString=function(){return d+""},R}function u(d,h){var f=c((d=Fi(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Yr(h)/3)))*3,v=Math.pow(10,-p),m=ef[8+p/3];return function(y){return f(v*y)+m}}return{format:c,formatPrefix:u}}var Ta,cc,nf;aE({thousands:",",grouping:[3],currency:["$",""]});function aE(e){return Ta=sE(e),cc=Ta.format,nf=Ta.formatPrefix,Ta}function oE(e){return Math.max(0,-Yr(Math.abs(e)))}function lE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Yr(t)/3)))*3-Yr(Math.abs(e)))}function cE(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Yr(t)-Yr(e))+1}var Lt=1e-6,rf=1e-12,yt=Math.PI,Ee=yt/2,sf=yt/4,Ae=yt*2,me=180/yt,Zt=yt/180,Rt=Math.abs,af=Math.atan,pr=Math.atan2,It=Math.cos,uE=Math.exp,hE=Math.log,At=Math.sin,Gn=Math.sign||function(e){return e>0?1:e<0?-1:0},Xe=Math.sqrt,dE=Math.tan;function fE(e){return e>1?0:e<-1?yt:Math.acos(e)}function Tn(e){return e>1?Ee:e<-1?-Ee:Math.asin(e)}function Ue(){}function Oa(e,t){e&&lf.hasOwnProperty(e.type)&&lf[e.type](e,t)}var of={Feature:function(e,t){Oa(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Oa(n[r].geometry,t)}},lf={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){uc(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)uc(n[r],t,0)},Polygon:function(e,t){cf(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)cf(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Oa(n[r],t)}};function uc(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function cf(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)uc(e[n],t,1);t.polygonEnd()}function Zr(e,t){e&&of.hasOwnProperty(e.type)?of[e.type](e,t):Oa(e,t)}function hc(e){return[pr(e[1],e[0]),Tn(e[2])]}function Xr(e){var t=e[0],n=e[1],r=It(n);return[r*It(t),r*At(t),At(n)]}function Ma(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ca(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function dc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Aa(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function fc(e){var t=Xe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function pc(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function mc(e,t){return Rt(e)>yt&&(e-=Math.round(e/Ae)*Ae),[e,t]}mc.invert=mc;function uf(e,t,n){return(e%=Ae)?t||n?pc(df(e),ff(t,n)):df(e):t||n?ff(t,n):mc}function hf(e){return function(t,n){return t+=e,Rt(t)>yt&&(t-=Math.round(t/Ae)*Ae),[t,n]}}function df(e){var t=hf(e);return t.invert=hf(-e),t}function ff(e,t){var n=It(e),r=At(e),i=It(t),s=At(t);function a(o,l){var c=It(l),u=It(o)*c,d=At(o)*c,h=At(l),f=h*n+u*r;return[pr(d*i-f*s,u*n-h*r),Tn(f*i+d*s)]}return a.invert=function(o,l){var c=It(l),u=It(o)*c,d=At(o)*c,h=At(l),f=h*i-d*s;return[pr(d*i+h*s,u*n+f*r),Tn(f*n-u*r)]},a}function pE(e){e=uf(e[0]*Zt,e[1]*Zt,e.length>2?e[2]*Zt:0);function t(n){return n=e(n[0]*Zt,n[1]*Zt),n[0]*=me,n[1]*=me,n}return t.invert=function(n){return n=e.invert(n[0]*Zt,n[1]*Zt),n[0]*=me,n[1]*=me,n},t}function mE(e,t,n,r,i,s){if(n){var a=It(t),o=At(t),l=r*n;i==null?(i=t+r*Ae,s=t-l/2):(i=pf(a,i),s=pf(a,s),(r>0?i<s:i>s)&&(i+=r*Ae));for(var c,u=i;r>0?u>s:u<s;u-=l)c=hc([a,-o*It(u),-o*At(u)]),e.point(c[0],c[1])}}function pf(e,t){t=Xr(t),t[0]-=e,fc(t);var n=fE(-t[1]);return((-t[2]<0?-n:n)+Ae-Lt)%Ae}function mf(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ue,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function $a(e,t){return Rt(e[0]-t[0])<Lt&&Rt(e[1]-t[1])<Lt}function La(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function gf(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((v=p.length-1)<=0)){var v,m=p[0],y=p[v],g;if($a(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}y[0]+=2*Lt}s.push(g=new La(m,p,null,!0)),a.push(g.o=new La(m,null,g,!1)),s.push(g=new La(y,p,null,!1)),a.push(g.o=new La(y,null,g,!0))}}),!!s.length){for(a.sort(t),vf(s),vf(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function vf(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function gc(e){return Rt(e[0])<=yt?e[0]:Gn(e[0])*((Rt(e[0])+yt)%Ae-yt)}function gE(e,t){var n=gc(t),r=t[1],i=At(r),s=[At(n),-It(n),0],a=0,o=0,l=new or;i===1?r=Ee+Lt:i===-1&&(r=-Ee-Lt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=gc(f),v=f[1]/2+sf,m=At(v),y=It(v),g=0;g<h;++g,p=w,m=S,y=L,f=b){var b=d[g],w=gc(b),_=b[1]/2+sf,S=At(_),L=It(_),I=w-p,k=I>=0?1:-1,R=k*I,M=R>yt,F=m*S;if(l.add(pr(F*k*At(R),y*L+F*It(R))),a+=M?I+k*Ae:I,M^p>=n^w>=n){var P=Ca(Xr(f),Xr(b));fc(P);var H=Ca(s,P);fc(H);var E=(M^I>=0?-1:1)*Tn(H[2]);(r>E||r===E&&(P[0]||P[1]))&&(o+=M^I>=0?1:-1)}}return(a<-Lt||a<Lt&&l<-rf)^o&1}function yf(e,t,n,r){return function(i){var s=t(i),a=mf(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:v,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=g,h.lineEnd=b,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=v,h.lineEnd=m,u=Xh(u);var w=gE(c,r);u.length?(l||(i.polygonStart(),l=!0),gf(u,yE,w,n,i)):w&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(w,_){e(w,_)&&i.point(w,_)}function p(w,_){s.point(w,_)}function v(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function y(w,_){d.push([w,_]),o.point(w,_)}function g(){o.lineStart(),d=[]}function b(){y(d[0][0],d[0][1]),o.lineEnd();var w=o.clean(),_=a.result(),S,L=_.length,I,k,R;if(d.pop(),c.push(d),d=null,!!L){if(w&1){if(k=_[0],(I=k.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<I;++S)i.point((R=k[S])[0],R[1]);i.lineEnd()}return}L>1&&w&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(vE))}}return h}}function vE(e){return e.length>1}function yE(e,t){return((e=e.x)[0]<0?e[1]-Ee-Lt:Ee-e[1])-((t=t.x)[0]<0?t[1]-Ee-Lt:Ee-t[1])}const xf=yf(function(){return!0},xE,EE,[-yt,-Ee]);function xE(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?yt:-yt,l=Rt(s-t);Rt(l-yt)<Lt?(e.point(t,n=(n+a)/2>0?Ee:-Ee),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=yt&&(Rt(t-r)<Lt&&(t-=r*Lt),Rt(s-o)<Lt&&(s-=o*Lt),n=bE(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function bE(e,t,n,r){var i,s,a=At(e-n);return Rt(a)>Lt?af((At(t)*(s=It(r))*At(n)-At(r)*(i=It(t))*At(e))/(i*s*a)):(t+r)/2}function EE(e,t,n,r){var i;if(e==null)i=n*Ee,r.point(-yt,i),r.point(0,i),r.point(yt,i),r.point(yt,0),r.point(yt,-i),r.point(0,-i),r.point(-yt,-i),r.point(-yt,0),r.point(-yt,i);else if(Rt(e[0]-t[0])>Lt){var s=e[0]<t[0]?yt:-yt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function _E(e){var t=It(e),n=2*Zt,r=t>0,i=Rt(t)>Lt;function s(u,d,h,f){mE(f,e,n,h,u,d)}function a(u,d){return It(u)*It(d)>t}function o(u){var d,h,f,p,v;return{lineStart:function(){p=f=!1,v=1},point:function(m,y){var g=[m,y],b,w=a(m,y),_=r?w?0:c(m,y):w?c(m+(m<0?yt:-yt),y):0;if(!d&&(p=f=w)&&u.lineStart(),w!==f&&(b=l(d,g),(!b||$a(d,b)||$a(g,b))&&(g[2]=1)),w!==f)v=0,w?(u.lineStart(),b=l(g,d),u.point(b[0],b[1])):(b=l(d,g),u.point(b[0],b[1],2),u.lineEnd()),d=b;else if(i&&d&&r^w){var S;!(_&h)&&(S=l(g,d,!0))&&(v=0,r?(u.lineStart(),u.point(S[0][0],S[0][1]),u.point(S[1][0],S[1][1]),u.lineEnd()):(u.point(S[1][0],S[1][1]),u.lineEnd(),u.lineStart(),u.point(S[0][0],S[0][1],3)))}w&&(!d||!$a(d,g))&&u.point(g[0],g[1]),d=g,f=w,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return v|(p&&f)<<1}}}function l(u,d,h){var f=Xr(u),p=Xr(d),v=[1,0,0],m=Ca(f,p),y=Ma(m,m),g=m[0],b=y-g*g;if(!b)return!h&&u;var w=t*y/b,_=-t*g/b,S=Ca(v,m),L=Aa(v,w),I=Aa(m,_);dc(L,I);var k=S,R=Ma(L,k),M=Ma(k,k),F=R*R-M*(Ma(L,L)-1);if(!(F<0)){var P=Xe(F),H=Aa(k,(-R-P)/M);if(dc(H,L),H=hc(H),!h)return H;var E=u[0],A=d[0],$=u[1],U=d[1],B;A<E&&(B=E,E=A,A=B);var q=A-E,Q=Rt(q-yt)<Lt,J=Q||q<Lt;if(!Q&&U<$&&(B=$,$=U,U=B),J?Q?$+U>0^H[1]<(Rt(H[0]-E)<Lt?$:U):$<=H[1]&&H[1]<=U:q>yt^(E<=H[0]&&H[0]<=A)){var ft=Aa(k,(-R+P)/M);return dc(ft,L),[H,hc(ft)]}}}function c(u,d){var h=r?e:yt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return yf(a,o,s,r?[0,-e]:[-yt,e-yt])}function wE(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var zi=1e9,Ra=-zi;function SE(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Rt(c[0]-e)<Lt?u>0?0:3:Rt(c[0]-n)<Lt?u>0?2:1:Rt(c[1]-t)<Lt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=mf(),h,f,p,v,m,y,g,b,w,_,S,L={point:I,lineStart:F,lineEnd:P,polygonStart:R,polygonEnd:M};function I(E,A){i(E,A)&&u.point(E,A)}function k(){for(var E=0,A=0,$=f.length;A<$;++A)for(var U=f[A],B=1,q=U.length,Q=U[0],J,ft,st=Q[0],gt=Q[1];B<q;++B)J=st,ft=gt,Q=U[B],st=Q[0],gt=Q[1],ft<=r?gt>r&&(st-J)*(r-ft)>(gt-ft)*(e-J)&&++E:gt<=r&&(st-J)*(r-ft)<(gt-ft)*(e-J)&&--E;return E}function R(){u=d,h=[],f=[],S=!0}function M(){var E=k(),A=S&&E,$=(h=Xh(h)).length;(A||$)&&(c.polygonStart(),A&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),$&&gf(h,o,E,s,c),c.polygonEnd()),u=c,h=f=p=null}function F(){L.point=H,f&&f.push(p=[]),_=!0,w=!1,g=b=NaN}function P(){h&&(H(v,m),y&&w&&d.rejoin(),h.push(d.result())),L.point=I,w&&u.lineEnd()}function H(E,A){var $=i(E,A);if(f&&p.push([E,A]),_)v=E,m=A,y=$,_=!1,$&&(u.lineStart(),u.point(E,A));else if($&&w)u.point(E,A);else{var U=[g=Math.max(Ra,Math.min(zi,g)),b=Math.max(Ra,Math.min(zi,b))],B=[E=Math.max(Ra,Math.min(zi,E)),A=Math.max(Ra,Math.min(zi,A))];wE(U,B,e,t,n,r)?(w||(u.lineStart(),u.point(U[0],U[1])),u.point(B[0],B[1]),$||u.lineEnd(),S=!1):$&&(u.lineStart(),u.point(E,A),S=!1)}g=E,b=A,w=$}return L}}const vc=e=>e;var yc=new or,xc=new or,bf,Ef,bc,Ec,On={point:Ue,lineStart:Ue,lineEnd:Ue,polygonStart:function(){On.lineStart=TE,On.lineEnd=ME},polygonEnd:function(){On.lineStart=On.lineEnd=On.point=Ue,yc.add(Rt(xc)),xc=new or},result:function(){var e=yc/2;return yc=new or,e}};function TE(){On.point=OE}function OE(e,t){On.point=_f,bf=bc=e,Ef=Ec=t}function _f(e,t){xc.add(Ec*e-bc*t),bc=e,Ec=t}function ME(){_f(bf,Ef)}var Kr=1/0,ka=Kr,Gi=-Kr,Da=Gi,Ia={point:CE,lineStart:Ue,lineEnd:Ue,polygonStart:Ue,polygonEnd:Ue,result:function(){var e=[[Kr,ka],[Gi,Da]];return Gi=Da=-(ka=Kr=1/0),e}};function CE(e,t){e<Kr&&(Kr=e),e>Gi&&(Gi=e),t<ka&&(ka=t),t>Da&&(Da=t)}var _c=0,wc=0,ji=0,Na=0,Pa=0,Qr=0,Sc=0,Tc=0,Wi=0,wf,Sf,dn,fn,Be={point:mr,lineStart:Tf,lineEnd:Of,polygonStart:function(){Be.lineStart=LE,Be.lineEnd=RE},polygonEnd:function(){Be.point=mr,Be.lineStart=Tf,Be.lineEnd=Of},result:function(){var e=Wi?[Sc/Wi,Tc/Wi]:Qr?[Na/Qr,Pa/Qr]:ji?[_c/ji,wc/ji]:[NaN,NaN];return _c=wc=ji=Na=Pa=Qr=Sc=Tc=Wi=0,e}};function mr(e,t){_c+=e,wc+=t,++ji}function Tf(){Be.point=AE}function AE(e,t){Be.point=$E,mr(dn=e,fn=t)}function $E(e,t){var n=e-dn,r=t-fn,i=Xe(n*n+r*r);Na+=i*(dn+e)/2,Pa+=i*(fn+t)/2,Qr+=i,mr(dn=e,fn=t)}function Of(){Be.point=mr}function LE(){Be.point=kE}function RE(){Mf(wf,Sf)}function kE(e,t){Be.point=Mf,mr(wf=dn=e,Sf=fn=t)}function Mf(e,t){var n=e-dn,r=t-fn,i=Xe(n*n+r*r);Na+=i*(dn+e)/2,Pa+=i*(fn+t)/2,Qr+=i,i=fn*e-dn*t,Sc+=i*(dn+e),Tc+=i*(fn+t),Wi+=i*3,mr(dn=e,fn=t)}function Cf(e){this._context=e}Cf.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ae);break}}},result:Ue};var Oc=new or,Mc,Af,$f,qi,Yi,Zi={point:Ue,lineStart:function(){Zi.point=DE},lineEnd:function(){Mc&&Lf(Af,$f),Zi.point=Ue},polygonStart:function(){Mc=!0},polygonEnd:function(){Mc=null},result:function(){var e=+Oc;return Oc=new or,e}};function DE(e,t){Zi.point=Lf,Af=qi=e,$f=Yi=t}function Lf(e,t){qi-=e,Yi-=t,Oc.add(Xe(qi*qi+Yi*Yi)),qi=e,Yi=t}let Rf,Ua,kf,Df;class If{constructor(t){this._append=t==null?Nf:IE(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==kf||this._append!==Ua){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,kf=r,Ua=this._append,Df=this._,this._=i}this._+=Df;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Nf(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function IE(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Nf;if(t!==Rf){const n=10**t;Rf=t,Ua=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return Ua}function NE(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),Zr(o,i(s))),s.result()}return a.area=function(o){return Zr(o,i(On)),On.result()},a.measure=function(o){return Zr(o,i(Zi)),Zi.result()},a.bounds=function(o){return Zr(o,i(Ia)),Ia.result()},a.centroid=function(o){return Zr(o,i(Be)),Be.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,vc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new If(n)):new Cf(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new If(n)),a},a.projection(e).digits(n).context(t)}function Cc(e){return function(t){var n=new Ac;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ac(){}Ac.prototype={constructor:Ac,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function $c(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Zr(n,e.stream(Ia)),t(Ia.result()),r!=null&&e.clipExtent(r),e}function Pf(e,t,n){return $c(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function PE(e,t,n){return Pf(e,[[0,0],t],n)}function UE(e,t,n){return $c(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function BE(e,t,n){return $c(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Uf=16,HE=It(30*Zt);function Bf(e,t){return+t?FE(e,t):VE(e)}function VE(e){return Cc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function FE(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,v,m){var y=c-r,g=u-i,b=y*y+g*g;if(b>4*t&&v--){var w=a+h,_=o+f,S=l+p,L=Xe(w*w+_*_+S*S),I=Tn(S/=L),k=Rt(Rt(S)-1)<Lt||Rt(s-d)<Lt?(s+d)/2:pr(_,w),R=e(k,I),M=R[0],F=R[1],P=M-r,H=F-i,E=g*P-y*H;(E*E/b>t||Rt((y*P+g*H)/b-.5)>.3||a*h+o*f+l*p<HE)&&(n(r,i,s,a,o,l,M,F,k,w/=L,_/=L,S,v,m),m.point(M,F),n(M,F,k,w,_,S,c,u,d,h,f,p,v,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,v,m={point:y,lineStart:g,lineEnd:w,polygonStart:function(){r.polygonStart(),m.lineStart=_},polygonEnd:function(){r.polygonEnd(),m.lineStart=g}};function y(I,k){I=e(I,k),r.point(I[0],I[1])}function g(){d=NaN,m.point=b,r.lineStart()}function b(I,k){var R=Xr([I,k]),M=e(I,k);n(d,h,u,f,p,v,d=M[0],h=M[1],u=I,f=R[0],p=R[1],v=R[2],Uf,r),r.point(d,h)}function w(){m.point=y,r.lineEnd()}function _(){g(),m.point=S,m.lineEnd=L}function S(I,k){b(i=I,k),s=d,a=h,o=f,l=p,c=v,m.point=b}function L(){n(d,h,u,f,p,v,s,a,i,o,l,c,Uf,r),m.lineEnd=w,w()}return m}}var zE=Cc({point:function(e,t){this.stream.point(e*Zt,t*Zt)}});function GE(e){return Cc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function jE(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Hf(e,t,n,r,i,s){if(!s)return jE(e,t,n,r,i);var a=It(s),o=At(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(v,m){return v*=r,m*=i,[l*v-c*m+t,n-c*v-l*m]}return p.invert=function(v,m){return[r*(u*v-d*m+h),i*(f-d*v-u*m)]},p}function Ba(e){return Vf(function(){return e})()}function Vf(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,v=xf,m=null,y,g,b,w=vc,_=.5,S,L,I,k,R;function M(E){return I(E[0]*Zt,E[1]*Zt)}function F(E){return E=I.invert(E[0],E[1]),E&&[E[0]*me,E[1]*me]}M.stream=function(E){return k&&R===E?k:k=zE(GE(u)(v(S(w(R=E)))))},M.preclip=function(E){return arguments.length?(v=E,p=void 0,H()):v},M.postclip=function(E){return arguments.length?(w=E,m=y=g=b=null,H()):w},M.clipAngle=function(E){return arguments.length?(v=+E?_E(p=E*Zt):(p=null,xf),H()):p*me},M.clipExtent=function(E){return arguments.length?(w=E==null?(m=y=g=b=null,vc):SE(m=+E[0][0],y=+E[0][1],g=+E[1][0],b=+E[1][1]),H()):m==null?null:[[m,y],[g,b]]},M.scale=function(E){return arguments.length?(n=+E,P()):n},M.translate=function(E){return arguments.length?(r=+E[0],i=+E[1],P()):[r,i]},M.center=function(E){return arguments.length?(s=E[0]%360*Zt,a=E[1]%360*Zt,P()):[s*me,a*me]},M.rotate=function(E){return arguments.length?(o=E[0]%360*Zt,l=E[1]%360*Zt,c=E.length>2?E[2]%360*Zt:0,P()):[o*me,l*me,c*me]},M.angle=function(E){return arguments.length?(d=E%360*Zt,P()):d*me},M.reflectX=function(E){return arguments.length?(h=E?-1:1,P()):h<0},M.reflectY=function(E){return arguments.length?(f=E?-1:1,P()):f<0},M.precision=function(E){return arguments.length?(S=Bf(L,_=E*E),H()):Xe(_)},M.fitExtent=function(E,A){return Pf(M,E,A)},M.fitSize=function(E,A){return PE(M,E,A)},M.fitWidth=function(E,A){return UE(M,E,A)},M.fitHeight=function(E,A){return BE(M,E,A)};function P(){var E=Hf(n,0,0,h,f,d).apply(null,t(s,a)),A=Hf(n,r-E[0],i-E[1],h,f,d);return u=uf(o,l,c),L=pc(t,A),I=pc(u,L),S=Bf(L,_),H()}function H(){return k=R=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&F,P()}}function Ff(e){var t=0,n=yt/3,r=Vf(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Zt,n=s[1]*Zt):[t*me,n*me]},i}function WE(e){var t=It(e);function n(r,i){return[r*t,At(i)/t]}return n.invert=function(r,i){return[r/t,Tn(i*t)]},n}function qE(e,t){var n=At(e),r=(n+At(t))/2;if(Rt(r)<Lt)return WE(e);var i=1+n*(2*r-n),s=Xe(i)/r;function a(o,l){var c=Xe(i-2*r*At(l))/r;return[c*At(o*=r),s-c*It(o)]}return a.invert=function(o,l){var c=s-l,u=pr(o,Rt(c))*Gn(c);return c*r<0&&(u-=yt*Gn(o)*Gn(c)),[u/r,Tn((i-(o*o+c*c)*r*r)/(2*r))]},a}function zf(){return Ff(qE).scale(155.424).center([0,33.6442])}function YE(){return zf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Lc(e,t){return[e,hE(dE((Ee+t)/2))]}Lc.invert=function(e,t){return[e,2*af(uE(t))-Ee]};function ZE(){return XE(Lc).scale(961/Ae)}function XE(e){var t=Ba(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=yt*r(),h=t(pE(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Lc?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function Ha(e,t){return[e,t]}Ha.invert=Ha;function KE(){return Ba(Ha).scale(152.63)}function QE(e,t){var n=It(e),r=e===t?At(e):(n-It(t))/(t-e),i=n/r+e;if(Rt(r)<Lt)return Ha;function s(a,o){var l=i-o,c=r*a;return[l*At(c),i-l*It(c)]}return s.invert=function(a,o){var l=i-o,c=pr(a,Rt(l))*Gn(l);return l*r<0&&(c-=yt*Gn(a)*Gn(l)),[c/r,i-Gn(r)*Xe(a*a+l*l)]},s}function JE(){return Ff(QE).scale(131.154).center([0,13.9389])}var Xi=1.340264,Ki=-.081106,Qi=893e-6,Ji=.003796,Va=Xe(3)/2,t_=12;function Gf(e,t){var n=Tn(Va*At(t)),r=n*n,i=r*r*r;return[e*It(n)/(Va*(Xi+3*Ki*r+i*(7*Qi+9*Ji*r))),n*(Xi+Ki*r+i*(Qi+Ji*r))]}Gf.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<t_&&(o=n*(Xi+Ki*r+i*(Qi+Ji*r))-t,l=Xi+3*Ki*r+i*(7*Qi+9*Ji*r),n-=a=o/l,r=n*n,i=r*r*r,!(Rt(a)<rf));++s);return[Va*e*(Xi+3*Ki*r+i*(7*Qi+9*Ji*r))/It(n),Tn(At(n)/Va)]};function e_(){return Ba(Gf).scale(177.158)}function jf(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}jf.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Rt(i)>Lt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function n_(){return Ba(jf).scale(175.295)}function r_(e,t){return e.parent===t.parent?1:2}function i_(e){return e.reduce(s_,0)/e.length}function s_(e,t){return e+t.x}function a_(e){return 1+e.reduce(o_,0)}function o_(e,t){return Math.max(e,t.y)}function l_(e){for(var t;t=e.children;)e=t[0];return e}function c_(e){for(var t;t=e.children;)e=t[t.length-1];return e}function u_(){var e=r_,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=i_(f),h.y=a_(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=l_(s),c=c_(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function h_(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function d_(){return this.eachAfter(h_)}function f_(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function p_(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function m_(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function g_(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function v_(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function y_(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function x_(e){for(var t=this,n=b_(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function b_(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function E_(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function __(){return Array.from(this)}function w_(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function S_(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*T_(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function ts(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=C_)):t===void 0&&(t=M_);for(var n=new es(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new es(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore($_)}function O_(){return ts(this).eachBefore(A_)}function M_(e){return e.children}function C_(e){return Array.isArray(e)?e[1]:null}function A_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function $_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function es(e){this.data=e,this.depth=this.height=0,this.parent=null}es.prototype=ts.prototype={constructor:es,count:d_,each:f_,eachAfter:m_,eachBefore:p_,find:g_,sum:v_,sort:y_,path:x_,ancestors:E_,descendants:__,leaves:w_,links:S_,copy:O_,[Symbol.iterator]:T_};function L_(e){return e==null?null:Wf(e)}function Wf(e){if(typeof e!="function")throw new Error;return e}function gr(){return 0}function Jr(e){return function(){return e}}const R_=1664525,k_=1013904223,qf=4294967296;function D_(){let e=1;return()=>(e=(R_*e+k_)%qf)/qf}function I_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function N_(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function P_(e,t){for(var n=0,r=(e=N_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Yf(a,s)?++n:(a=B_(i=U_(i,s)),n=0);return a}function U_(e,t){var n,r;if(Rc(t,e))return[t];for(n=0;n<e.length;++n)if(Fa(t,e[n])&&Rc(ns(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Fa(ns(e[n],e[r]),t)&&Fa(ns(e[n],t),e[r])&&Fa(ns(e[r],t),e[n])&&Rc(Zf(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Fa(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Yf(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Rc(e,t){for(var n=0;n<t.length;++n)if(!Yf(e,t[n]))return!1;return!0}function B_(e){switch(e.length){case 1:return H_(e[0]);case 2:return ns(e[0],e[1]);case 3:return Zf(e[0],e[1],e[2])}}function H_(e){return{x:e.x,y:e.y,r:e.r}}function ns(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function Zf(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,f=r-c,p=i-o,v=i-u,m=l-s,y=d-s,g=r*r+i*i-s*s,b=g-a*a-o*o+l*l,w=g-c*c-u*u+d*d,_=f*p-h*v,S=(p*w-v*b)/(_*2)-r,L=(v*m-p*y)/_,I=(f*b-h*w)/(_*2)-i,k=(h*y-f*m)/_,R=L*L+k*k-1,M=2*(s+S*L+I*k),F=S*S+I*I-s*s,P=-(Math.abs(R)>1e-6?(M+Math.sqrt(M*M-4*R*F))/(2*R):F/M);return{x:r+S+L*P,y:i+I+k*P,r:P}}function Xf(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function Kf(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Qf(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function za(e){this._=e,this.next=null,this.previous=null}function V_(e,t){if(!(s=(e=I_(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;Xf(r,n,i=e[2]),n=new za(n),r=new za(r),i=new za(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){Xf(n._,r._,i=e[l]),i=new za(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Kf(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Kf(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Qf(n);(i=i.next)!==r;)(o=Qf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=P_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function F_(e){return Math.sqrt(e.value)}function z_(){var e=null,t=1,n=1,r=gr;function i(s){const a=D_();return s.x=t/2,s.y=n/2,e?s.eachBefore(Jf(e)).eachAfter(kc(r,.5,a)).eachBefore(tp(1)):s.eachBefore(Jf(F_)).eachAfter(kc(gr,1,a)).eachAfter(kc(r,s.r/Math.min(t,n),a)).eachBefore(tp(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=L_(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:Jr(+s),i):r},i}function Jf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function kc(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=V_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function tp(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function G_(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function j_(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function W_(e,t){return e.parent===t.parent?1:2}function Dc(e){var t=e.children;return t?t[0]:e.t}function Ic(e){var t=e.children;return t?t[t.length-1]:e.t}function q_(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Y_(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Z_(e,t,n){return e.a.parent===t.parent?e.a:n}function Ga(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ga.prototype=Object.create(es.prototype);function X_(e){for(var t=new Ga(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Ga(s[a],a)),i.parent=n;return(t.parent=new Ga(null,0)).children=[t],t}function K_(){var e=W_,t=1,n=1,r=null;function i(c){var u=X_(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(g){g.x<d.x&&(d=g),g.x>h.x&&(h=g),g.depth>f.depth&&(f=g)});var p=d===h?1:e(d,h)/2,v=p-d.x,m=t/(h.x+p+v),y=n/(f.depth||1);c.eachBefore(function(g){g.x=(g.x+v)*m,g.y=g.depth*y})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Y_(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,v=h.parent.children[0],m=h.m,y=f.m,g=p.m,b=v.m,w;p=Ic(p),h=Dc(h),p&&h;)v=Dc(v),f=Ic(f),f.a=c,w=p.z+g-h.z-m+e(p._,h._),w>0&&(q_(Z_(p,c,d),c,w),m+=w,y+=w),g+=p.m,m+=h.m,b+=v.m,y+=f.m;p&&!Ic(f)&&(f.t=p,f.m+=g-y),h&&!Dc(v)&&(v.t=h,v.m+=m-b,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Q_(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var J_=(1+Math.sqrt(5))/2;function tw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,v=t.value,m,y,g,b,w,_,S;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(y=g=m,_=Math.max(p/f,f/p)/(v*e),S=m*m*_,w=Math.max(g/S,S/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>g&&(g=c),S=m*m*_,b=Math.max(g/S,S/y),b>w){m-=c;break}w=b}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?j_(l,n,r,i,v?r+=p*m/v:s):Q_(l,n,r,v?n+=f*m/v:i,s),v-=m,u=d}return a}const ew=function e(t){function n(r,i,s,a,o){tw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(J_);function nw(){var e=ew,t=!1,n=1,r=1,i=[0],s=gr,a=gr,o=gr,l=gr,c=gr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(G_),h}function d(h){var f=i[h.depth],p=h.x0+f,v=h.y0+f,m=h.x1-f,y=h.y1-f;m<p&&(p=m=(p+m)/2),y<v&&(v=y=(v+y)/2),h.x0=p,h.y0=v,h.x1=m,h.y1=y,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,v+=a(h)-f,m-=o(h)-f,y-=l(h)-f,m<p&&(p=m=(p+m)/2),y<v&&(v=y=(v+y)/2),e(h,p,v,m,y))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Wf(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:Jr(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:Jr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Jr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Jr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Jr(+h),u):c},u}function ti(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ep=Symbol("implicit");function ja(){var e=new Wh,t=[],n=[],r=ep;function i(s){let a=e.get(s);if(a===void 0){if(r!==ep)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Wh;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ja(t,n).unknown(r)},ti.apply(i,arguments),i}function rs(){var e=ja().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=i<r,p=f?i:r,v=f?r:i;s=(v-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(v-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var m=dy(h).map(function(y){return p+s*y});return n(f?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return rs(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},ti.apply(d(),arguments)}function rw(e){return function(){return e}}function iw(e){return+e}var np=[0,1];function ei(e){return e}function Nc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:rw(isNaN(t)?NaN:.5)}function sw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function aw(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Nc(i,r),s=n(a,s)):(r=Nc(r,i),s=n(s,a)),function(o){return s(r(o))}}function ow(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Nc(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Ml(e,o,1,r)-1;return s[l](i[l](o))}}function Pc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function rp(){var e=np,t=np,n=Pi,r,i,s,a=ei,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==ei&&(a=sw(e[0],e[h-1])),o=h>2?ow:aw,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),Ce)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,iw),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Td,u()},d.clamp=function(h){return arguments.length?(a=h?!0:ei,u()):a!==ei},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function ip(){return rp()(ei,ei)}function lw(e,t,n,r){var i=Al(e,t,n),s;switch(r=Fi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=lE(i,a))&&(r.precision=s),nf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=cE(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=oE(i))&&(r.precision=s-(r.type==="%")*2);break}}return cc(r)}function sp(e){var t=e.domain;return e.ticks=function(n){var r=t();return na(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return lw(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Fr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Ke(){var e=ip();return e.copy=function(){return Pc(e,Ke())},ti.apply(e,arguments),sp(e)}function ap(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function op(e){return Math.log(e)}function lp(e){return Math.exp(e)}function cw(e){return-Math.log(-e)}function uw(e){return-Math.exp(-e)}function hw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dw(e){return e===10?hw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function fw(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function cp(e){return(t,n)=>-e(-t,n)}function pw(e){const t=e(op,lp),n=t.domain;let r=10,i,s;function a(){return i=fw(r),s=dw(r),n()[0]<0?(i=cp(i),s=cp(s),e(cw,uw)):e(op,lp),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(v=h<0?p/s(-h):p*s(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=f;++h)for(p=r-1;p>=1;--p)if(v=h>0?p/s(-h):p*s(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=na(c,u,m))}else y=na(h,f,Math.min(f-h,m)).map(s);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Fi(l)).precision==null&&(l.trim=!0),l=cc(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(ap(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function up(){const e=pw(rp()).domain([1,10]);return e.copy=()=>Pc(e,up()).base(e.base()),ti.apply(e,arguments),e}function Uc(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Ml(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Uc().domain([e,t]).range(i).unknown(s)},ti.apply(sp(a),arguments)}const Bc=new Date,Hc=new Date;function re(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>re(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Bc.setTime(+s),Hc.setTime(+a),e(Bc),e(Hc),Math.floor(n(Bc,Hc))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Wa=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Wa),Wa.range;const Mn=1e3,He=Mn*60,Cn=He*60,An=Cn*24,Vc=An*7,hp=An*30,Fc=An*365,ni=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getUTCSeconds());ni.range;const zc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mn)},(e,t)=>{e.setTime(+e+t*He)},(e,t)=>(t-e)/He,e=>e.getMinutes());zc.range,re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*He)},(e,t)=>(t-e)/He,e=>e.getUTCMinutes()).range;const Gc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mn-e.getMinutes()*He)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getHours());Gc.range,re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getUTCHours()).range;const is=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*He)/An,e=>e.getDate()-1);is.range;const jc=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>e.getUTCDate()-1);jc.range,re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>Math.floor(e/An)).range;function vr(e){return re(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*He)/Vc)}const qa=vr(0),Ya=vr(1),mw=vr(2),gw=vr(3),ri=vr(4),vw=vr(5),yw=vr(6);qa.range,Ya.range,mw.range,gw.range,ri.range,vw.range,yw.range;function yr(e){return re(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Vc)}const dp=yr(0),Za=yr(1),xw=yr(2),bw=yr(3),ii=yr(4),Ew=yr(5),_w=yr(6);dp.range,Za.range,xw.range,bw.range,ii.range,Ew.range,_w.range;const Wc=re(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Wc.range,re(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const $n=re(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());$n.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),$n.range;const xr=re(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),xr.range;function ww(e,t,n,r,i,s){const a=[[ni,1,Mn],[ni,5,5*Mn],[ni,15,15*Mn],[ni,30,30*Mn],[s,1,He],[s,5,5*He],[s,15,15*He],[s,30,30*He],[i,1,Cn],[i,3,3*Cn],[i,6,6*Cn],[i,12,12*Cn],[r,1,An],[r,2,2*An],[n,1,Vc],[t,1,hp],[t,3,3*hp],[e,1,Fc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=Ol(([,,m])=>m).right(a,h);if(f===a.length)return e.every(Al(c/Fc,u/Fc,d));if(f===0)return Wa.every(Math.max(Al(c,u,d),1));const[p,v]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(v)}return[o,l]}const[Sw,Tw]=ww($n,Wc,qa,is,Gc,zc);function qc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Yc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ss(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ow(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=as(i),u=os(i),d=as(s),h=os(s),f=as(a),p=os(a),v=as(o),m=os(o),y=as(l),g=os(l),b={a:$,A:U,b:B,B:q,c:null,d:yp,e:yp,f:Zw,g:sS,G:oS,H:Ww,I:qw,j:Yw,L:xp,m:Xw,M:Kw,p:Q,q:J,Q:Tp,s:Op,S:Qw,u:Jw,U:tS,V:eS,w:nS,W:rS,x:null,X:null,y:iS,Y:aS,Z:lS,"%":Sp},w={a:ft,A:st,b:gt,B:X,c:null,d:Ep,e:Ep,f:dS,g:_S,G:SS,H:cS,I:uS,j:hS,L:_p,m:fS,M:pS,p:nt,q:pt,Q:Tp,s:Op,S:mS,u:gS,U:vS,V:yS,w:xS,W:bS,x:null,X:null,y:ES,Y:wS,Z:TS,"%":Sp},_={a:R,A:M,b:F,B:P,c:H,d:gp,e:gp,f:Fw,g:mp,G:pp,H:vp,I:vp,j:Uw,L:Vw,m:Pw,M:Bw,p:k,q:Nw,Q:Gw,s:jw,S:Hw,u:Lw,U:Rw,V:kw,w:$w,W:Dw,x:E,X:A,y:mp,Y:pp,Z:Iw,"%":zw};b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(Y,tt){return function(ct){var G=[],Mt=-1,Et=0,qt=Y.length,Nt,it,$t;for(ct instanceof Date||(ct=new Date(+ct));++Mt<qt;)Y.charCodeAt(Mt)===37&&(G.push(Y.slice(Et,Mt)),(it=fp[Nt=Y.charAt(++Mt)])!=null?Nt=Y.charAt(++Mt):it=Nt==="e"?" ":"0",($t=tt[Nt])&&(Nt=$t(ct,it)),G.push(Nt),Et=Mt+1);return G.push(Y.slice(Et,Mt)),G.join("")}}function L(Y,tt){return function(ct){var G=ss(1900,void 0,1),Mt=I(G,Y,ct+="",0),Et,qt;if(Mt!=ct.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(tt&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(Et=Yc(ss(G.y,0,1)),qt=Et.getUTCDay(),Et=qt>4||qt===0?Za.ceil(Et):Za(Et),Et=jc.offset(Et,(G.V-1)*7),G.y=Et.getUTCFullYear(),G.m=Et.getUTCMonth(),G.d=Et.getUTCDate()+(G.w+6)%7):(Et=qc(ss(G.y,0,1)),qt=Et.getDay(),Et=qt>4||qt===0?Ya.ceil(Et):Ya(Et),Et=is.offset(Et,(G.V-1)*7),G.y=Et.getFullYear(),G.m=Et.getMonth(),G.d=Et.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),qt="Z"in G?Yc(ss(G.y,0,1)).getUTCDay():qc(ss(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(qt+5)%7:G.w+G.U*7-(qt+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,Yc(G)):qc(G)}}function I(Y,tt,ct,G){for(var Mt=0,Et=tt.length,qt=ct.length,Nt,it;Mt<Et;){if(G>=qt)return-1;if(Nt=tt.charCodeAt(Mt++),Nt===37){if(Nt=tt.charAt(Mt++),it=_[Nt in fp?tt.charAt(Mt++):Nt],!it||(G=it(Y,ct,G))<0)return-1}else if(Nt!=ct.charCodeAt(G++))return-1}return G}function k(Y,tt,ct){var G=c.exec(tt.slice(ct));return G?(Y.p=u.get(G[0].toLowerCase()),ct+G[0].length):-1}function R(Y,tt,ct){var G=f.exec(tt.slice(ct));return G?(Y.w=p.get(G[0].toLowerCase()),ct+G[0].length):-1}function M(Y,tt,ct){var G=d.exec(tt.slice(ct));return G?(Y.w=h.get(G[0].toLowerCase()),ct+G[0].length):-1}function F(Y,tt,ct){var G=y.exec(tt.slice(ct));return G?(Y.m=g.get(G[0].toLowerCase()),ct+G[0].length):-1}function P(Y,tt,ct){var G=v.exec(tt.slice(ct));return G?(Y.m=m.get(G[0].toLowerCase()),ct+G[0].length):-1}function H(Y,tt,ct){return I(Y,t,tt,ct)}function E(Y,tt,ct){return I(Y,n,tt,ct)}function A(Y,tt,ct){return I(Y,r,tt,ct)}function $(Y){return a[Y.getDay()]}function U(Y){return s[Y.getDay()]}function B(Y){return l[Y.getMonth()]}function q(Y){return o[Y.getMonth()]}function Q(Y){return i[+(Y.getHours()>=12)]}function J(Y){return 1+~~(Y.getMonth()/3)}function ft(Y){return a[Y.getUTCDay()]}function st(Y){return s[Y.getUTCDay()]}function gt(Y){return l[Y.getUTCMonth()]}function X(Y){return o[Y.getUTCMonth()]}function nt(Y){return i[+(Y.getUTCHours()>=12)]}function pt(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var tt=S(Y+="",b);return tt.toString=function(){return Y},tt},parse:function(Y){var tt=L(Y+="",!1);return tt.toString=function(){return Y},tt},utcFormat:function(Y){var tt=S(Y+="",w);return tt.toString=function(){return Y},tt},utcParse:function(Y){var tt=L(Y+="",!0);return tt.toString=function(){return Y},tt}}}var fp={"-":"",_:" ",0:"0"},se=/^\s*\d+/,Mw=/^%/,Cw=/[\\^$*+?|[\]().{}]/g;function Tt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Aw(e){return e.replace(Cw,"\\$&")}function as(e){return new RegExp("^(?:"+e.map(Aw).join("|")+")","i")}function os(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function $w(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Lw(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Rw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Dw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function pp(e,t,n){var r=se.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function mp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Iw(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Nw(e,t,n){var r=se.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Uw(e,t,n){var r=se.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vp(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Hw(e,t,n){var r=se.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Vw(e,t,n){var r=se.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Fw(e,t,n){var r=se.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zw(e,t,n){var r=Mw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Gw(e,t,n){var r=se.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jw(e,t,n){var r=se.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yp(e,t){return Tt(e.getDate(),t,2)}function Ww(e,t){return Tt(e.getHours(),t,2)}function qw(e,t){return Tt(e.getHours()%12||12,t,2)}function Yw(e,t){return Tt(1+is.count($n(e),e),t,3)}function xp(e,t){return Tt(e.getMilliseconds(),t,3)}function Zw(e,t){return xp(e,t)+"000"}function Xw(e,t){return Tt(e.getMonth()+1,t,2)}function Kw(e,t){return Tt(e.getMinutes(),t,2)}function Qw(e,t){return Tt(e.getSeconds(),t,2)}function Jw(e){var t=e.getDay();return t===0?7:t}function tS(e,t){return Tt(qa.count($n(e)-1,e),t,2)}function bp(e){var t=e.getDay();return t>=4||t===0?ri(e):ri.ceil(e)}function eS(e,t){return e=bp(e),Tt(ri.count($n(e),e)+($n(e).getDay()===4),t,2)}function nS(e){return e.getDay()}function rS(e,t){return Tt(Ya.count($n(e)-1,e),t,2)}function iS(e,t){return Tt(e.getFullYear()%100,t,2)}function sS(e,t){return e=bp(e),Tt(e.getFullYear()%100,t,2)}function aS(e,t){return Tt(e.getFullYear()%1e4,t,4)}function oS(e,t){var n=e.getDay();return e=n>=4||n===0?ri(e):ri.ceil(e),Tt(e.getFullYear()%1e4,t,4)}function lS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Tt(t/60|0,"0",2)+Tt(t%60,"0",2)}function Ep(e,t){return Tt(e.getUTCDate(),t,2)}function cS(e,t){return Tt(e.getUTCHours(),t,2)}function uS(e,t){return Tt(e.getUTCHours()%12||12,t,2)}function hS(e,t){return Tt(1+jc.count(xr(e),e),t,3)}function _p(e,t){return Tt(e.getUTCMilliseconds(),t,3)}function dS(e,t){return _p(e,t)+"000"}function fS(e,t){return Tt(e.getUTCMonth()+1,t,2)}function pS(e,t){return Tt(e.getUTCMinutes(),t,2)}function mS(e,t){return Tt(e.getUTCSeconds(),t,2)}function gS(e){var t=e.getUTCDay();return t===0?7:t}function vS(e,t){return Tt(dp.count(xr(e)-1,e),t,2)}function wp(e){var t=e.getUTCDay();return t>=4||t===0?ii(e):ii.ceil(e)}function yS(e,t){return e=wp(e),Tt(ii.count(xr(e),e)+(xr(e).getUTCDay()===4),t,2)}function xS(e){return e.getUTCDay()}function bS(e,t){return Tt(Za.count(xr(e)-1,e),t,2)}function ES(e,t){return Tt(e.getUTCFullYear()%100,t,2)}function _S(e,t){return e=wp(e),Tt(e.getUTCFullYear()%100,t,2)}function wS(e,t){return Tt(e.getUTCFullYear()%1e4,t,4)}function SS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ii(e):ii.ceil(e),Tt(e.getUTCFullYear()%1e4,t,4)}function TS(){return"+0000"}function Sp(){return"%"}function Tp(e){return+e}function Op(e){return Math.floor(+e/1e3)}var si,Mp;OS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function OS(e){return si=Ow(e),Mp=si.format,si.parse,si.utcFormat,si.utcParse,si}function MS(e){return new Date(e)}function CS(e){return e instanceof Date?+e:+new Date(+e)}function Cp(e,t,n,r,i,s,a,o,l,c){var u=ip(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),v=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),g=c("%b %d"),b=c("%B"),w=c("%Y");function _(S){return(l(S)<S?f:o(S)<S?p:a(S)<S?v:s(S)<S?m:r(S)<S?i(S)<S?y:g:n(S)<S?b:w)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,CS)):h().map(MS)},u.ticks=function(S){var L=h();return e(L[0],L[L.length-1],S??10)},u.tickFormat=function(S,L){return L==null?_:c(L)},u.nice=function(S){var L=h();return(!S||typeof S.range!="function")&&(S=t(L[0],L[L.length-1],S??10)),S?h(ap(L,S)):u},u.copy=function(){return Pc(u,Cp(e,t,n,r,i,s,a,o,l,c))},u}function Ap(){return ti.apply(Cp(Sw,Tw,$n,Wc,qa,is,Gc,zc,ni,Mp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mt(e){return function(){return e}}const $p=Math.abs,he=Math.atan2,br=Math.cos,AS=Math.max,Zc=Math.min,pn=Math.sin,ai=Math.sqrt,de=1e-12,ls=Math.PI,Xa=ls/2,Ka=2*ls;function $S(e){return e>1?0:e<-1?ls:Math.acos(e)}function Lp(e){return e>=1?Xa:e<=-1?-Xa:Math.asin(e)}function Qa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new oc(t)}function LS(e){return e.innerRadius}function RS(e){return e.outerRadius}function kS(e){return e.startAngle}function DS(e){return e.endAngle}function IS(e){return e&&e.padAngle}function NS(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<de))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Ja(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/ai(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,v=r+d,m=(h+p)/2,y=(f+v)/2,g=p-h,b=v-f,w=g*g+b*b,_=i-s,S=h*v-p*f,L=(b<0?-1:1)*ai(AS(0,_*_*w-S*S)),I=(S*b-g*L)/w,k=(-S*g-b*L)/w,R=(S*b+g*L)/w,M=(-S*g+b*L)/w,F=I-m,P=k-y,H=R-m,E=M-y;return F*F+P*P>H*H+E*E&&(I=R,k=M),{cx:I,cy:k,x01:-u,y01:-d,x11:I*(i/_-1),y11:k*(i/_-1)}}function cs(){var e=LS,t=RS,n=mt(0),r=null,i=kS,s=DS,a=IS,o=null,l=Qa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Xa,v=s.apply(this,arguments)-Xa,m=$p(v-p),y=v>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>de))o.moveTo(0,0);else if(m>Ka-de)o.moveTo(f*br(p),f*pn(p)),o.arc(0,0,f,p,v,!y),h>de&&(o.moveTo(h*br(v),h*pn(v)),o.arc(0,0,h,v,p,y));else{var g=p,b=v,w=p,_=v,S=m,L=m,I=a.apply(this,arguments)/2,k=I>de&&(r?+r.apply(this,arguments):ai(h*h+f*f)),R=Zc($p(f-h)/2,+n.apply(this,arguments)),M=R,F=R,P,H;if(k>de){var E=Lp(k/h*pn(I)),A=Lp(k/f*pn(I));(S-=E*2)>de?(E*=y?1:-1,w+=E,_-=E):(S=0,w=_=(p+v)/2),(L-=A*2)>de?(A*=y?1:-1,g+=A,b-=A):(L=0,g=b=(p+v)/2)}var $=f*br(g),U=f*pn(g),B=h*br(_),q=h*pn(_);if(R>de){var Q=f*br(b),J=f*pn(b),ft=h*br(w),st=h*pn(w),gt;if(m<ls)if(gt=NS($,U,ft,st,Q,J,B,q)){var X=$-gt[0],nt=U-gt[1],pt=Q-gt[0],Y=J-gt[1],tt=1/pn($S((X*pt+nt*Y)/(ai(X*X+nt*nt)*ai(pt*pt+Y*Y)))/2),ct=ai(gt[0]*gt[0]+gt[1]*gt[1]);M=Zc(R,(h-ct)/(tt-1)),F=Zc(R,(f-ct)/(tt+1))}else M=F=0}L>de?F>de?(P=Ja(ft,st,$,U,f,F,y),H=Ja(Q,J,B,q,f,F,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),F<R?o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,f,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),!y),o.arc(H.cx,H.cy,F,he(H.y11,H.x11),he(H.y01,H.x01),!y))):(o.moveTo($,U),o.arc(0,0,f,g,b,!y)):o.moveTo($,U),!(h>de)||!(S>de)?o.lineTo(B,q):M>de?(P=Ja(B,q,Q,J,h,-M,y),H=Ja($,U,ft,st,h,-M,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),M<R?o.arc(P.cx,P.cy,M,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,M,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,h,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),y),o.arc(H.cx,H.cy,M,he(H.y11,H.x11),he(H.y01,H.x01),!y))):o.arc(0,0,h,_,w,y)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-ls/2;return[br(d)*u,pn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:mt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:mt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:mt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:mt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:mt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:mt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:mt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var PS=Array.prototype.slice;function to(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Rp(e){this._context=e}Rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function eo(e){return new Rp(e)}function Xc(e){return e[0]}function Kc(e){return e[1]}function us(e,t){var n=mt(!0),r=null,i=eo,s=null,a=Qa(o);e=typeof e=="function"?e:e===void 0?Xc:mt(e),t=typeof t=="function"?t:t===void 0?Kc:mt(t);function o(l){var c,u=(l=to(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:mt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:mt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:mt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Qc(e,t,n){var r=null,i=mt(!0),s=null,a=eo,o=null,l=Qa(c);e=typeof e=="function"?e:e===void 0?Xc:mt(+e),t=typeof t=="function"?t:mt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Kc:mt(+n);function c(d){var h,f,p,v=(d=to(d)).length,m,y=!1,g,b=new Array(v),w=new Array(v);for(s==null&&(o=a(g=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===y)if(y=!y)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(b[p],w[p]);o.lineEnd(),o.areaEnd()}y&&(b[h]=+e(m,h,d),w[h]=+t(m,h,d),o.point(r?+r(m,h,d):b[h],n?+n(m,h,d):w[h]))}if(g)return o=null,g+""||null}function u(){return us().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function US(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function BS(e){return e}function HS(){var e=BS,t=US,n=null,r=mt(0),i=mt(Ka),s=mt(0);function a(o){var l,c=(o=to(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ka,Math.max(-Ka,i.apply(this,arguments)-v)),y,g=Math.min(Math.abs(m)/c,s.apply(this,arguments)),b=g*(m<0?-1:1),w;for(l=0;l<c;++l)(w=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=w);for(t!=null?f.sort(function(_,S){return t(p[_],p[S])}):n!=null&&f.sort(function(_,S){return n(o[_],o[S])}),l=0,d=h?(m-c*b)/h:0;l<c;++l,v=y)u=f[l],w=p[u],y=v+(w>0?w*d:0)+b,p[u]={data:o[u],index:l,value:w,startAngle:v,endAngle:y,padAngle:g};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:mt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:mt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:mt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:mt(+o),a):s},a}var VS=Dp(eo);function kp(e){this._curve=e}kp.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function Dp(e){function t(n){return new kp(e(n))}return t._curve=e,t}function FS(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(Dp(n)):t()._curve},e}function zS(){return FS(us().curve(VS))}class GS{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function jS(e){return new GS(e,!0)}function WS(e){return e.source}function qS(e){return e.target}function YS(e){let t=WS,n=qS,r=Xc,i=Kc,s=null,a=null,o=Qa(l);function l(){let c;const u=PS.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:mt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:mt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function ZS(){return YS(jS)}function jn(){}function no(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ro(e){this._context=e}ro.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:no(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XS(e){return new ro(e)}function Ip(e){this._context=e}Ip.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KS(e){return new Ip(e)}function Np(e){this._context=e}Np.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:no(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QS(e){return new Np(e)}function Pp(e,t){this._basis=new ro(e),this._beta=t}Pp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const JS=function e(t){function n(r){return t===1?new ro(r):new Pp(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function io(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Jc(e,t){this._context=e,this._k=(1-t)/6}Jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:io(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tT=function e(t){function n(r){return new Jc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tu(e,t){this._context=e,this._k=(1-t)/6}tu.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eT=function e(t){function n(r){return new tu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function eu(e,t){this._context=e,this._k=(1-t)/6}eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:io(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nT=function e(t){function n(r){return new eu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function nu(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>de){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>de){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function Up(e,t){this._context=e,this._alpha=t}Up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:nu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rT=function e(t){function n(r){return t?new Up(r,t):new Jc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Bp(e,t){this._context=e,this._alpha=t}Bp.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:nu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iT=function e(t){function n(r){return t?new Bp(r,t):new tu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Hp(e,t){this._context=e,this._alpha=t}Hp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:nu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sT=function e(t){function n(r){return t?new Hp(r,t):new eu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Vp(e){this._context=e}Vp.prototype={areaStart:jn,areaEnd:jn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Fp(e){return new Vp(e)}function zp(e){return e<0?-1:1}function Gp(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(zp(s)+zp(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function jp(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ru(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function so(e){this._context=e}so.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ru(this,this._t0,jp(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ru(this,jp(this,n=Gp(this,e,t)),n);break;default:ru(this,this._t0,n=Gp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Wp(e){this._context=new qp(e)}(Wp.prototype=Object.create(so.prototype)).point=function(e,t){so.prototype.point.call(this,t,e)};function qp(e){this._context=e}qp.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function aT(e){return new so(e)}function oT(e){return new Wp(e)}function Yp(e){this._context=e}Yp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Zp(e),i=Zp(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Zp(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function lT(e){return new Yp(e)}function ao(e,t){this._context=e,this._t=t}ao.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function cT(e){return new ao(e,.5)}function uT(e){return new ao(e,0)}function hT(e){return new ao(e,1)}function Xp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Kp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dT(e,t){return e[t]}function fT(e){const t=[];return t.key=e,t}function iu(){var e=mt([]),t=Kp,n=Xp,r=dT;function i(s){var a=Array.from(e.apply(this,arguments),fT),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=to(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:mt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:mt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Kp:typeof s=="function"?s:mt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Xp,i):n},i}function pT(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function hs(e,t,n){this.k=e,this.x=t,this.y=n}hs.prototype={constructor:hs,scale:function(e){return e===1?this:new hs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},hs.prototype;function su(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function ds(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function fs(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?gT(o,d=>d.test(a)):mT(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function mT(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function gT(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vT(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}function Ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let yT={};function oo(){return yT}function ps(e,t){var n,r,i,s;const a=oo(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Ot(e),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const xT={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bT=(e,t,n)=>{let r;const i=xT[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},ET={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_T=(e,t,n,r)=>ET[e],wT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ST={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TT={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},OT={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},MT={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},CT={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},AT=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},$T={ordinalNumber:AT,era:ds({values:wT,defaultWidth:"wide"}),quarter:ds({values:ST,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ds({values:TT,defaultWidth:"wide"}),day:ds({values:OT,defaultWidth:"wide"}),dayPeriod:ds({values:MT,defaultWidth:"wide",formattingValues:CT,defaultFormattingWidth:"wide"})},LT=/^(\d+)(th|st|nd|rd)?/i,RT=/\d+/i,kT={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},DT={any:[/^b/i,/^(a|c)/i]},IT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NT={any:[/1/i,/2/i,/3/i,/4/i]},PT={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},UT={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},BT={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HT={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},VT={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},FT={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},zT={ordinalNumber:vT({matchPattern:LT,parsePattern:RT,valueCallback:e=>parseInt(e,10)}),era:fs({matchPatterns:kT,defaultMatchWidth:"wide",parsePatterns:DT,defaultParseWidth:"any"}),quarter:fs({matchPatterns:IT,defaultMatchWidth:"wide",parsePatterns:NT,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fs({matchPatterns:PT,defaultMatchWidth:"wide",parsePatterns:UT,defaultParseWidth:"any"}),day:fs({matchPatterns:BT,defaultMatchWidth:"wide",parsePatterns:HT,defaultParseWidth:"any"}),dayPeriod:fs({matchPatterns:VT,defaultMatchWidth:"any",parsePatterns:FT,defaultParseWidth:"any"})},GT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qT={date:su({formats:GT,defaultWidth:"full"}),time:su({formats:jT,defaultWidth:"full"}),dateTime:su({formats:WT,defaultWidth:"full"})},Qp={code:"en-US",formatDistance:bT,formatLong:qT,formatRelative:_T,localize:$T,match:zT,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Jp=typeof global=="object"&&global&&global.Object===Object&&global,YT=typeof self=="object"&&self&&self.Object===Object&&self,Qe=Jp||YT||Function("return this")(),Ve=Qe.Symbol,tm=Object.prototype,ZT=tm.hasOwnProperty,XT=tm.toString,ms=Ve?Ve.toStringTag:void 0;function KT(e){var t=ZT.call(e,ms),n=e[ms];try{e[ms]=void 0;var r=!0}catch{}var i=XT.call(e);return r&&(t?e[ms]=n:delete e[ms]),i}var QT=Object.prototype,JT=QT.toString;function tO(e){return JT.call(e)}var eO="[object Null]",nO="[object Undefined]",em=Ve?Ve.toStringTag:void 0;function Er(e){return e==null?e===void 0?nO:eO:em&&em in Object(e)?KT(e):tO(e)}function mn(e){return e!=null&&typeof e=="object"}var rO="[object Symbol]";function lo(e){return typeof e=="symbol"||mn(e)&&Er(e)==rO}function au(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ae=Array.isArray,iO=1/0,nm=Ve?Ve.prototype:void 0,rm=nm?nm.toString:void 0;function im(e){if(typeof e=="string")return e;if(ae(e))return au(e,im)+"";if(lo(e))return rm?rm.call(e):"";var t=e+"";return t=="0"&&1/e==-iO?"-0":t}function Fe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ou(e){return e}var sO="[object AsyncFunction]",aO="[object Function]",oO="[object GeneratorFunction]",lO="[object Proxy]";function lu(e){if(!Fe(e))return!1;var t=Er(e);return t==aO||t==oO||t==sO||t==lO}var cu=Qe["__core-js_shared__"],sm=function(){var e=/[^.]+$/.exec(cu&&cu.keys&&cu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function cO(e){return!!sm&&sm in e}var uO=Function.prototype,hO=uO.toString;function _r(e){if(e!=null){try{return hO.call(e)}catch{}try{return e+""}catch{}}return""}var dO=/[\\^$.*+?()[\]{}|]/g,fO=/^\[object .+?Constructor\]$/,pO=Function.prototype,mO=Object.prototype,gO=pO.toString,vO=mO.hasOwnProperty,yO=RegExp("^"+gO.call(vO).replace(dO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xO(e){if(!Fe(e)||cO(e))return!1;var t=lu(e)?yO:fO;return t.test(_r(e))}function bO(e,t){return e==null?void 0:e[t]}function wr(e,t){var n=bO(e,t);return xO(n)?n:void 0}var uu=wr(Qe,"WeakMap"),am=Object.create,EO=function(){function e(){}return function(t){if(!Fe(t))return{};if(am)return am(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function _O(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wO(){}function om(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var SO=800,TO=16,OO=Date.now;function MO(e){var t=0,n=0;return function(){var r=OO(),i=TO-(r-n);if(n=r,i>0){if(++t>=SO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function CO(e){return function(){return e}}var co=function(){try{var e=wr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),AO=co?function(e,t){return co(e,"toString",{configurable:!0,enumerable:!1,value:CO(t),writable:!0})}:ou,lm=MO(AO);function $O(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function LO(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function RO(e){return e!==e}function kO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function DO(e,t,n){return t===t?kO(e,t,n):LO(e,RO,n)}function IO(e,t){var n=e==null?0:e.length;return!!n&&DO(e,t,0)>-1}var NO=9007199254740991,PO=/^(?:0|[1-9]\d*)$/;function hu(e,t){var n=typeof e;return t=t??NO,!!t&&(n=="number"||n!="symbol"&&PO.test(e))&&e>-1&&e%1==0&&e<t}function uo(e,t,n){t=="__proto__"&&co?co(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function gs(e,t){return e===t||e!==e&&t!==t}var UO=Object.prototype,BO=UO.hasOwnProperty;function cm(e,t,n){var r=e[t];(!(BO.call(e,t)&&gs(r,n))||n===void 0&&!(t in e))&&uo(e,t,n)}function oi(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?uo(n,o,l):cm(n,o,l)}return n}var um=Math.max;function hm(e,t,n){return t=um(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=um(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),_O(e,this,o)}}function du(e,t){return lm(hm(e,t,ou),e+"")}var HO=9007199254740991;function fu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=HO}function Sr(e){return e!=null&&fu(e.length)&&!lu(e)}function VO(e,t,n){if(!Fe(n))return!1;var r=typeof t;return(r=="number"?Sr(n)&&hu(t,n.length):r=="string"&&t in n)?gs(n[t],e):!1}function FO(e){return du(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&VO(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var zO=Object.prototype;function ho(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zO;return e===n}function GO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var jO="[object Arguments]";function dm(e){return mn(e)&&Er(e)==jO}var fm=Object.prototype,WO=fm.hasOwnProperty,qO=fm.propertyIsEnumerable,li=dm(function(){return arguments}())?dm:function(e){return mn(e)&&WO.call(e,"callee")&&!qO.call(e,"callee")};function YO(){return!1}var pm=typeof V=="object"&&V&&!V.nodeType&&V,mm=pm&&typeof module=="object"&&module&&!module.nodeType&&module,ZO=mm&&mm.exports===pm,gm=ZO?Qe.Buffer:void 0,XO=gm?gm.isBuffer:void 0,ci=XO||YO,KO="[object Arguments]",QO="[object Array]",JO="[object Boolean]",tM="[object Date]",eM="[object Error]",nM="[object Function]",rM="[object Map]",iM="[object Number]",sM="[object Object]",aM="[object RegExp]",oM="[object Set]",lM="[object String]",cM="[object WeakMap]",uM="[object ArrayBuffer]",hM="[object DataView]",dM="[object Float32Array]",fM="[object Float64Array]",pM="[object Int8Array]",mM="[object Int16Array]",gM="[object Int32Array]",vM="[object Uint8Array]",yM="[object Uint8ClampedArray]",xM="[object Uint16Array]",bM="[object Uint32Array]",Vt={};Vt[dM]=Vt[fM]=Vt[pM]=Vt[mM]=Vt[gM]=Vt[vM]=Vt[yM]=Vt[xM]=Vt[bM]=!0,Vt[KO]=Vt[QO]=Vt[uM]=Vt[JO]=Vt[hM]=Vt[tM]=Vt[eM]=Vt[nM]=Vt[rM]=Vt[iM]=Vt[sM]=Vt[aM]=Vt[oM]=Vt[lM]=Vt[cM]=!1;function EM(e){return mn(e)&&fu(e.length)&&!!Vt[Er(e)]}function pu(e){return function(t){return e(t)}}var vm=typeof V=="object"&&V&&!V.nodeType&&V,vs=vm&&typeof module=="object"&&module&&!module.nodeType&&module,_M=vs&&vs.exports===vm,mu=_M&&Jp.process,ui=function(){try{var e=vs&&vs.require&&vs.require("util").types;return e||mu&&mu.binding&&mu.binding("util")}catch{}}(),ym=ui&&ui.isTypedArray,fo=ym?pu(ym):EM,wM=Object.prototype,SM=wM.hasOwnProperty;function xm(e,t){var n=ae(e),r=!n&&li(e),i=!n&&!r&&ci(e),s=!n&&!r&&!i&&fo(e),a=n||r||i||s,o=a?GO(e.length,String):[],l=o.length;for(var c in e)(t||SM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hu(c,l)))&&o.push(c);return o}function bm(e,t){return function(n){return e(t(n))}}var TM=bm(Object.keys,Object),OM=Object.prototype,MM=OM.hasOwnProperty;function Em(e){if(!ho(e))return TM(e);var t=[];for(var n in Object(e))MM.call(e,n)&&n!="constructor"&&t.push(n);return t}function ys(e){return Sr(e)?xm(e):Em(e)}function CM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var AM=Object.prototype,$M=AM.hasOwnProperty;function LM(e){if(!Fe(e))return CM(e);var t=ho(e),n=[];for(var r in e)r=="constructor"&&(t||!$M.call(e,r))||n.push(r);return n}function xs(e){return Sr(e)?xm(e,!0):LM(e)}var RM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kM=/^\w*$/;function gu(e,t){if(ae(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||lo(e)?!0:kM.test(e)||!RM.test(e)||t!=null&&e in Object(t)}var bs=wr(Object,"create");function DM(){this.__data__=bs?bs(null):{},this.size=0}function IM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NM="__lodash_hash_undefined__",PM=Object.prototype,UM=PM.hasOwnProperty;function BM(e){var t=this.__data__;if(bs){var n=t[e];return n===NM?void 0:n}return UM.call(t,e)?t[e]:void 0}var HM=Object.prototype,VM=HM.hasOwnProperty;function FM(e){var t=this.__data__;return bs?t[e]!==void 0:VM.call(t,e)}var zM="__lodash_hash_undefined__";function GM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=bs&&t===void 0?zM:t,this}function Tr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tr.prototype.clear=DM,Tr.prototype.delete=IM,Tr.prototype.get=BM,Tr.prototype.has=FM,Tr.prototype.set=GM;function jM(){this.__data__=[],this.size=0}function po(e,t){for(var n=e.length;n--;)if(gs(e[n][0],t))return n;return-1}var WM=Array.prototype,qM=WM.splice;function YM(e){var t=this.__data__,n=po(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qM.call(t,n,1),--this.size,!0}function ZM(e){var t=this.__data__,n=po(t,e);return n<0?void 0:t[n][1]}function XM(e){return po(this.__data__,e)>-1}function KM(e,t){var n=this.__data__,r=po(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ln.prototype.clear=jM,Ln.prototype.delete=YM,Ln.prototype.get=ZM,Ln.prototype.has=XM,Ln.prototype.set=KM;var Es=wr(Qe,"Map");function QM(){this.size=0,this.__data__={hash:new Tr,map:new(Es||Ln),string:new Tr}}function JM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function mo(e,t){var n=e.__data__;return JM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function tC(e){var t=mo(this,e).delete(e);return this.size-=t?1:0,t}function eC(e){return mo(this,e).get(e)}function nC(e){return mo(this,e).has(e)}function rC(e,t){var n=mo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Rn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Rn.prototype.clear=QM,Rn.prototype.delete=tC,Rn.prototype.get=eC,Rn.prototype.has=nC,Rn.prototype.set=rC;var iC="Expected a function";function vu(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(iC);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(vu.Cache||Rn),n}vu.Cache=Rn;var sC=500;function aC(e){var t=vu(e,function(r){return n.size===sC&&n.clear(),r}),n=t.cache;return t}var oC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lC=/\\(\\)?/g,cC=aC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(oC,function(n,r,i,s){t.push(i?s.replace(lC,"$1"):r||n)}),t});function _s(e){return e==null?"":im(e)}function go(e,t){return ae(e)?e:gu(e,t)?[e]:cC(_s(e))}var uC=1/0;function ws(e){if(typeof e=="string"||lo(e))return e;var t=e+"";return t=="0"&&1/e==-uC?"-0":t}function yu(e,t){t=go(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ws(t[n++])];return n&&n==r?e:void 0}function _t(e,t,n){var r=e==null?void 0:yu(e,t);return r===void 0?n:r}function xu(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _m=Ve?Ve.isConcatSpreadable:void 0;function hC(e){return ae(e)||li(e)||!!(_m&&e&&e[_m])}function vo(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=hC),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?vo(o,t-1,n,r,i):xu(i,o):r||(i[i.length]=o)}return i}var bu=bm(Object.getPrototypeOf,Object),dC="[object Object]",fC=Function.prototype,pC=Object.prototype,wm=fC.toString,mC=pC.hasOwnProperty,gC=wm.call(Object);function Sm(e){if(!mn(e)||Er(e)!=dC)return!1;var t=bu(e);if(t===null)return!0;var n=mC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&wm.call(n)==gC}function vC(){this.__data__=new Ln,this.size=0}function yC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function xC(e){return this.__data__.get(e)}function bC(e){return this.__data__.has(e)}var EC=200;function _C(e,t){var n=this.__data__;if(n instanceof Ln){var r=n.__data__;if(!Es||r.length<EC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(r)}return n.set(e,t),this.size=n.size,this}function Je(e){var t=this.__data__=new Ln(e);this.size=t.size}Je.prototype.clear=vC,Je.prototype.delete=yC,Je.prototype.get=xC,Je.prototype.has=bC,Je.prototype.set=_C;function wC(e,t){return e&&oi(t,ys(t),e)}function SC(e,t){return e&&oi(t,xs(t),e)}var Tm=typeof V=="object"&&V&&!V.nodeType&&V,Om=Tm&&typeof module=="object"&&module&&!module.nodeType&&module,TC=Om&&Om.exports===Tm,Mm=TC?Qe.Buffer:void 0,Cm=Mm?Mm.allocUnsafe:void 0;function Am(e,t){if(t)return e.slice();var n=e.length,r=Cm?Cm(n):new e.constructor(n);return e.copy(r),r}function OC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function $m(){return[]}var MC=Object.prototype,CC=MC.propertyIsEnumerable,Lm=Object.getOwnPropertySymbols,Eu=Lm?function(e){return e==null?[]:(e=Object(e),OC(Lm(e),function(t){return CC.call(e,t)}))}:$m;function AC(e,t){return oi(e,Eu(e),t)}var $C=Object.getOwnPropertySymbols,Rm=$C?function(e){for(var t=[];e;)xu(t,Eu(e)),e=bu(e);return t}:$m;function LC(e,t){return oi(e,Rm(e),t)}function km(e,t,n){var r=t(e);return ae(e)?r:xu(r,n(e))}function _u(e){return km(e,ys,Eu)}function Dm(e){return km(e,xs,Rm)}var wu=wr(Qe,"DataView"),Su=wr(Qe,"Promise"),hi=wr(Qe,"Set"),Im="[object Map]",RC="[object Object]",Nm="[object Promise]",Pm="[object Set]",Um="[object WeakMap]",Bm="[object DataView]",kC=_r(wu),DC=_r(Es),IC=_r(Su),NC=_r(hi),PC=_r(uu),ze=Er;(wu&&ze(new wu(new ArrayBuffer(1)))!=Bm||Es&&ze(new Es)!=Im||Su&&ze(Su.resolve())!=Nm||hi&&ze(new hi)!=Pm||uu&&ze(new uu)!=Um)&&(ze=function(e){var t=Er(e),n=t==RC?e.constructor:void 0,r=n?_r(n):"";if(r)switch(r){case kC:return Bm;case DC:return Im;case IC:return Nm;case NC:return Pm;case PC:return Um}return t});var UC=Object.prototype,BC=UC.hasOwnProperty;function HC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&BC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var yo=Qe.Uint8Array;function Tu(e){var t=new e.constructor(e.byteLength);return new yo(t).set(new yo(e)),t}function VC(e,t){var n=t?Tu(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var FC=/\w*$/;function zC(e){var t=new e.constructor(e.source,FC.exec(e));return t.lastIndex=e.lastIndex,t}var Hm=Ve?Ve.prototype:void 0,Vm=Hm?Hm.valueOf:void 0;function GC(e){return Vm?Object(Vm.call(e)):{}}function Fm(e,t){var n=t?Tu(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var jC="[object Boolean]",WC="[object Date]",qC="[object Map]",YC="[object Number]",ZC="[object RegExp]",XC="[object Set]",KC="[object String]",QC="[object Symbol]",JC="[object ArrayBuffer]",tA="[object DataView]",eA="[object Float32Array]",nA="[object Float64Array]",rA="[object Int8Array]",iA="[object Int16Array]",sA="[object Int32Array]",aA="[object Uint8Array]",oA="[object Uint8ClampedArray]",lA="[object Uint16Array]",cA="[object Uint32Array]";function uA(e,t,n){var r=e.constructor;switch(t){case JC:return Tu(e);case jC:case WC:return new r(+e);case tA:return VC(e,n);case eA:case nA:case rA:case iA:case sA:case aA:case oA:case lA:case cA:return Fm(e,n);case qC:return new r;case YC:case KC:return new r(e);case ZC:return zC(e);case XC:return new r;case QC:return GC(e)}}function zm(e){return typeof e.constructor=="function"&&!ho(e)?EO(bu(e)):{}}var hA="[object Map]";function dA(e){return mn(e)&&ze(e)==hA}var Gm=ui&&ui.isMap,fA=Gm?pu(Gm):dA,pA="[object Set]";function mA(e){return mn(e)&&ze(e)==pA}var jm=ui&&ui.isSet,gA=jm?pu(jm):mA,vA=1,yA=2,xA=4,Wm="[object Arguments]",bA="[object Array]",EA="[object Boolean]",_A="[object Date]",wA="[object Error]",qm="[object Function]",SA="[object GeneratorFunction]",TA="[object Map]",OA="[object Number]",Ym="[object Object]",MA="[object RegExp]",CA="[object Set]",AA="[object String]",$A="[object Symbol]",LA="[object WeakMap]",RA="[object ArrayBuffer]",kA="[object DataView]",DA="[object Float32Array]",IA="[object Float64Array]",NA="[object Int8Array]",PA="[object Int16Array]",UA="[object Int32Array]",BA="[object Uint8Array]",HA="[object Uint8ClampedArray]",VA="[object Uint16Array]",FA="[object Uint32Array]",Bt={};Bt[Wm]=Bt[bA]=Bt[RA]=Bt[kA]=Bt[EA]=Bt[_A]=Bt[DA]=Bt[IA]=Bt[NA]=Bt[PA]=Bt[UA]=Bt[TA]=Bt[OA]=Bt[Ym]=Bt[MA]=Bt[CA]=Bt[AA]=Bt[$A]=Bt[BA]=Bt[HA]=Bt[VA]=Bt[FA]=!0,Bt[wA]=Bt[qm]=Bt[LA]=!1;function Ss(e,t,n,r,i,s){var a,o=t&vA,l=t&yA,c=t&xA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Fe(e))return e;var u=ae(e);if(u){if(a=HC(e),!o)return om(e,a)}else{var d=ze(e),h=d==qm||d==SA;if(ci(e))return Am(e,o);if(d==Ym||d==Wm||h&&!i){if(a=l||h?{}:zm(e),!o)return l?LC(e,SC(a,e)):AC(e,wC(a,e))}else{if(!Bt[d])return i?e:{};a=uA(e,d,o)}}s||(s=new Je);var f=s.get(e);if(f)return f;s.set(e,a),gA(e)?e.forEach(function(m){a.add(Ss(m,t,n,m,e,s))}):fA(e)&&e.forEach(function(m,y){a.set(y,Ss(m,t,n,y,e,s))});var p=c?l?Dm:_u:l?xs:ys,v=u?void 0:p(e);return $O(v||e,function(m,y){v&&(y=m,m=e[y]),cm(a,y,Ss(m,t,n,y,e,s))}),a}var zA=1,GA=4;function kn(e){return Ss(e,zA|GA)}var jA="__lodash_hash_undefined__";function WA(e){return this.__data__.set(e,jA),this}function qA(e){return this.__data__.has(e)}function Ts(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}Ts.prototype.add=Ts.prototype.push=WA,Ts.prototype.has=qA;function Zm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Xm(e,t){return e.has(t)}var YA=1,ZA=2;function Km(e,t,n,r,i,s){var a=n&YA,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&ZA?new Ts:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],v=t[d];if(r)var m=a?r(v,p,d,t,e,s):r(p,v,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!Zm(t,function(y,g){if(!Xm(f,g)&&(p===y||i(p,y,n,r,s)))return f.push(g)})){h=!1;break}}else if(!(p===v||i(p,v,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function XA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Ou(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var KA=1,QA=2,JA="[object Boolean]",t2="[object Date]",e2="[object Error]",n2="[object Map]",r2="[object Number]",i2="[object RegExp]",s2="[object Set]",a2="[object String]",o2="[object Symbol]",l2="[object ArrayBuffer]",c2="[object DataView]",Qm=Ve?Ve.prototype:void 0,Mu=Qm?Qm.valueOf:void 0;function u2(e,t,n,r,i,s,a){switch(n){case c2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case l2:return!(e.byteLength!=t.byteLength||!s(new yo(e),new yo(t)));case JA:case t2:case r2:return gs(+e,+t);case e2:return e.name==t.name&&e.message==t.message;case i2:case a2:return e==t+"";case n2:var o=XA;case s2:var l=r&KA;if(o||(o=Ou),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=QA,a.set(e,t);var u=Km(o(e),o(t),r,i,s,a);return a.delete(e),u;case o2:if(Mu)return Mu.call(e)==Mu.call(t)}return!1}var h2=1,d2=Object.prototype,f2=d2.hasOwnProperty;function p2(e,t,n,r,i,s){var a=n&h2,o=_u(e),l=o.length,c=_u(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:f2.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var y=e[h],g=t[h];if(r)var b=a?r(g,y,h,t,e,s):r(y,g,h,e,t,s);if(!(b===void 0?y===g||i(y,g,n,r,s):b)){v=!1;break}m||(m=h=="constructor")}if(v&&!m){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(v=!1)}return s.delete(e),s.delete(t),v}var m2=1,Jm="[object Arguments]",tg="[object Array]",xo="[object Object]",g2=Object.prototype,eg=g2.hasOwnProperty;function v2(e,t,n,r,i,s){var a=ae(e),o=ae(t),l=a?tg:ze(e),c=o?tg:ze(t);l=l==Jm?xo:l,c=c==Jm?xo:c;var u=l==xo,d=c==xo,h=l==c;if(h&&ci(e)){if(!ci(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Je),a||fo(e)?Km(e,t,n,r,i,s):u2(e,t,l,n,r,i,s);if(!(n&m2)){var f=u&&eg.call(e,"__wrapped__"),p=d&&eg.call(t,"__wrapped__");if(f||p){var v=f?e.value():e,m=p?t.value():t;return s||(s=new Je),i(v,m,n,r,s)}}return h?(s||(s=new Je),p2(e,t,n,r,i,s)):!1}function bo(e,t,n,r,i){return e===t?!0:e==null||t==null||!mn(e)&&!mn(t)?e!==e&&t!==t:v2(e,t,n,r,bo,i)}var y2=1,x2=2;function b2(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Je,d;if(!(d===void 0?bo(c,l,y2|x2,r,u):d))return!1}}return!0}function ng(e){return e===e&&!Fe(e)}function E2(e){for(var t=ys(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ng(i)]}return t}function rg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _2(e){var t=E2(e);return t.length==1&&t[0][2]?rg(t[0][0],t[0][1]):function(n){return n===e||b2(n,e,t)}}function w2(e,t){return e!=null&&t in Object(e)}function S2(e,t,n){t=go(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ws(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&fu(i)&&hu(a,i)&&(ae(e)||li(e)))}function T2(e,t){return e!=null&&S2(e,t,w2)}var O2=1,M2=2;function C2(e,t){return gu(e)&&ng(t)?rg(ws(e),t):function(n){var r=_t(n,e);return r===void 0&&r===t?T2(n,e):bo(t,r,O2|M2)}}function A2(e){return function(t){return t==null?void 0:t[e]}}function $2(e){return function(t){return yu(t,e)}}function L2(e){return gu(e)?A2(ws(e)):$2(e)}function Eo(e){return typeof e=="function"?e:e==null?ou:typeof e=="object"?ae(e)?C2(e[0],e[1]):_2(e):L2(e)}function R2(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var ig=R2();function Cu(e,t,n){(n!==void 0&&!gs(e[t],n)||n===void 0&&!(t in e))&&uo(e,t,n)}function Au(e){return mn(e)&&Sr(e)}function $u(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function k2(e){return oi(e,xs(e))}function D2(e,t,n,r,i,s,a){var o=$u(e,n),l=$u(t,n),c=a.get(l);if(c){Cu(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=ae(l),f=!h&&ci(l),p=!h&&!f&&fo(l);u=l,h||f||p?ae(o)?u=o:Au(o)?u=om(o):f?(d=!1,u=Am(l,!0)):p?(d=!1,u=Fm(l,!0)):u=[]:Sm(l)||li(l)?(u=o,li(o)?u=k2(o):(!Fe(o)||lu(o))&&(u=zm(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Cu(e,n,u)}function sg(e,t,n,r,i){e!==t&&ig(t,function(s,a){if(i||(i=new Je),Fe(s))D2(e,t,a,n,sg,r,i);else{var o=r?r($u(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Cu(e,a,o)}},xs)}function ag(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var I2="[object Map]",N2="[object Set]",P2=Object.prototype,U2=P2.hasOwnProperty;function tn(e){if(e==null)return!0;if(Sr(e)&&(ae(e)||typeof e=="string"||typeof e.splice=="function"||ci(e)||fo(e)||li(e)))return!e.length;var t=ze(e);if(t==I2||t==N2)return!e.size;if(ho(e))return!Em(e).length;for(var n in e)if(U2.call(e,n))return!1;return!0}var lt=FO(function(e,t,n){sg(e,t,n)}),B2=1/0,H2=hi&&1/Ou(new hi([,-0]))[1]==B2?function(e){return new hi(e)}:wO,V2=200;function og(e,t,n){var r=-1,i=IO,s=e.length,a=!0,o=[],l=o;if(s>=V2){var c=t?null:H2(e);if(c)return Ou(c);a=!1,i=Xm,l=new Ts}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var F2=du(function(e){var t=ag(e);return Au(t)&&(t=void 0),og(vo(e,1,Au,!0),Eo(t))});function Os(e){return e&&e.length?og(e):[]}const _e="cds",Dn={opacity:{unselected:.05,selected:.4}},Wn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},di={duration:1e3,ease:Hd,zoomLevel:3},fi={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},lg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ge={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},z2={defaultBins:10},Yt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},In={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},oe={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ht={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},Or={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},en={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},cg={minCellDividerDimension:16,chartPadding:.5},ug={default:{size:24}},G2={defaultOffset:4,horizontalOffset:10},hg={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},$e={height:{[We.GRAPH_VIEW]:32,[We.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},j2=[{type:ee.RADIUS,name:"Radius"},{type:ee.AREA,name:"Poor area"},{type:ee.AREA,name:"Satisfactory area"},{type:ee.AREA,name:"Great area"},{type:ee.QUARTILE,name:"Quartiles"}],pi={type:Pe.END_LINE,threshold:16,numCharacter:14},W2={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},q2={enabled:!0,position:Br.BOTTOM,clickable:!0,truncation:pi,alignment:Jt.LEFT,order:null,additionalItems:[]},Y2={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},Z2={enabled:!0},dg={enabled:!0,showTotal:!0,truncation:pi,groupLabel:"Group"},fg={top:{visible:!0,includeZero:!0,truncation:pi},bottom:{visible:!0,includeZero:!0,truncation:pi},left:{visible:!0,includeZero:!0,truncation:pi},right:{visible:!0,includeZero:!0,truncation:pi}},_o={addSpaceOnEdges:1,showDayName:!1,localeObject:Qp,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let pg=!1;try{pg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const fe={width:null,height:null,resizable:!0,theme:Tl.WHITE,tooltip:dg,legend:q2,locale:W2,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:Ct.SHOW_AS_DATATABLE},...pg?[{type:Ct.MAKE_FULLSCREEN}]:[],{type:Ct.EXPORT_CSV},{type:Ct.EXPORT_PNG},{type:Ct.EXPORT_JPG}]}},mg=lt({},fe,{thematic:{projection:cn.geoNaturalEarth1}}),Ms=lt({},fe,{axes:fg,timeScale:_o,grid:Y2,ruler:Z2,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:We.GRAPH_VIEW}}}),Mr=lt({},Ms,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(_o,{addSpaceOnEdges:1})}),X2=lt({},Mr,{}),K2=lt({},Mr,{}),Q2=lt({},Mr,{bars:lt({},Mr.bars,{dividerSize:1.5})}),J2=lt({},Mr,{}),Lu=lt({},Ms,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),t$=Lu,gg=lt({},Lu,{points:{radius:3,filled:!1,enabled:!0}}),vg=lt({},gg,{timeScale:lt(_o,{addSpaceOnEdges:0})}),e$=vg,n$=lt({},Ms,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:ee.RADIUS,name:"Radius"}]}}),r$=lt({},Ms,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:ee.AREA,name:"Poor area"},{type:ee.AREA,name:"Satisfactory area"},{type:ee.AREA,name:"Great area"},{type:ee.QUARTILE,name:"Quartiles"}]}}),i$=lt({},Mr,{bars:{dividerSize:1.5},timeScale:lt(_o,{addSpaceOnEdges:0})}),s$=lt({},fe,{tooltip:lt({},dg,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),yg=lt({},fe,{pie:{labels:{formatter:null,enabled:!0},alignment:Jt.LEFT,sortFunction:null,valueMapsTo:"value"}}),a$=lt({},fe,{legend:{enabled:!1},gauge:{type:sr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Jt.LEFT}}),o$=lt({},yg,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:Jt.LEFT}}),xg=lt({},fe,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),l$=lt({},xg,{legend:{enabled:!0}}),c$=lt({},fe,{radar:{axes:{angle:"key",value:"value"},alignment:Jt.LEFT},tooltip:{gridline:{enabled:!0}}}),u$=lt({},Mr,{comboChartTypes:[]}),h$=lt({tree:{type:Qs.TREE}},fe,{}),d$=lt({},fe,{data:lt(fe.data,{groupMapsTo:"name"})}),f$=lt({},fe,fi,{data:lt(fe.data,{groupMapsTo:"name"})}),p$=lt({},fe,{alluvial:{data:lt(fe.data,{groupMapsTo:"source"}),nodeAlignment:Jt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),m$=lt({},fe,{axes:fg,heatmap:{divider:{state:Vr.AUTO},colorLegend:{type:"linear"}}}),g$=lt({},mg,{choropleth:{colorLegend:{type:"linear"}}}),Ut={alluvialChart:p$,areaChart:vg,axisChart:Ms,boxplotChart:J2,bubbleChart:n$,bulletChart:r$,chart:fe,circlePackChart:f$,choroplethChart:g$,comboChart:u$,donutChart:o$,gaugeChart:a$,groupedBarChart:K2,heatmapChart:m$,histogramChart:i$,lineChart:gg,lollipopChart:t$,meterChart:xg,pieChart:yg,proportionalMeterChart:l$,radarChart:c$,scatterChart:Lu,simpleBarChart:X2,stackedAreaChart:e$,stackedBarChart:Q2,thematicChart:mg,treeChart:h$,treemapChart:d$,wordCloudChart:s$};function v$(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=cr(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function jt(e,t){var n;const r=kn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===et.TIME?a.mapsTo="date":l===et.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return ku(r,t),lt(r,t)}function Nn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function Cs(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Ru(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function As(e,t,n){if(n>e.length)return e;if(t===Pe.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Pe.FRONT_LINE)return"..."+e.substr(-n);if(t===Pe.END_LINE)return e.substr(0,n)+"..."}function ku(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=j2.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=F2(a,r,"name")}}const x=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},bg=(e,t)=>t===Qt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ge=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=bg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Pn(e,t,n){return n===Qt.VERTICAL?[e,t]:[t,e]}const Eg=6048e5,y$=864e5,_g=6e4,wg=36e5;function Sg(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function Tg(e){const t=Ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Og(e,t){const n=Sg(e),r=Sg(t),i=+n-Tg(n),s=+r-Tg(r);return Math.round((i-s)/y$)}function nn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function x$(e){const t=Ot(e),n=nn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function b$(e){const t=Ot(e);return Og(t,x$(t))+1}function wo(e){return ps(e,{weekStartsOn:1})}function Mg(e){const t=Ot(e),n=t.getFullYear(),r=nn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=wo(r),s=nn(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=wo(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function E$(e){const t=Mg(e),n=nn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wo(n)}function _$(e){const t=Ot(e),n=+wo(t)-+E$(t);return Math.round(n/Eg)+1}function Cg(e,t){var n,r,i,s;const a=Ot(e),o=a.getFullYear(),l=oo(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=nn(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=ps(u,t),h=nn(e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const f=ps(h,t);return a.getTime()>=d.getTime()?o+1:a.getTime()>=f.getTime()?o:o-1}function w$(e,t){var n,r,i,s;const a=oo(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Cg(e,t),c=nn(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),ps(c,t)}function S$(e,t){const n=Ot(e),r=+ps(n,t)-+w$(n,t);return Math.round(r/Eg)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return kt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return kt(i,t.length)}},mi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ag={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qn.y(e,t)},Y:function(e,t,n,r){const i=Cg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return kt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):kt(s,t.length)},R:function(e,t){const n=Mg(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return kt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return kt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return kt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=S$(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):kt(i,t.length)},I:function(e,t,n){const r=_$(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):kt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qn.d(e,t)},D:function(e,t,n){const r=b$(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):kt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return kt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return kt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return kt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=mi.noon:r===0?i=mi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=mi.evening:r>=12?i=mi.afternoon:r>=4?i=mi.morning:i=mi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qn.s(e,t)},S:function(e,t){return qn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Lg(r);case"XXXX":case"XX":return Cr(r);case"XXXXX":case"XXX":default:return Cr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Lg(r);case"xxxx":case"xx":return Cr(r);case"xxxxx":case"xxx":default:return Cr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$g(r,":");case"OOOO":default:return"GMT"+Cr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$g(r,":");case"zzzz":default:return"GMT"+Cr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return kt(r,t.length)},T:function(e,t,n){const r=e.getTime();return kt(r,t.length)}};function $g(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+kt(s,2)}function Lg(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):Cr(e,t)}function Cr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=kt(Math.trunc(r/60),2),s=kt(r%60,2);return n+i+t+s}const Rg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kg=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},T$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Rg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Rg(r,t)).replace("{{time}}",kg(i,t))},O$={p:kg,P:T$},M$=/^D+$/,C$=/^Y+$/,A$=["D","DD","YY","YYYY"];function $$(e){return M$.test(e)}function L$(e){return C$.test(e)}function R$(e,t,n){const r=k$(e,t,n);if(console.warn(r),A$.includes(e))throw new RangeError(r)}function k$(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function D$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function I$(e){if(!D$(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}const N$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,U$=/^'([^]*?)'?$/,B$=/''/g,H$=/[a-zA-Z]/;function Du(e,t,n){var r,i,s,a,o,l,c,u;const d=oo(),h=(n==null?void 0:n.locale)??d.locale??Qp,f=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,p=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,v=Ot(e);if(!I$(v))throw new RangeError("Invalid time value");let m=t.match(P$).map(g=>{const b=g[0];if(b==="p"||b==="P"){const w=O$[b];return w(g,h.formatLong)}return g}).join("").match(N$).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:V$(g)};if(Ag[b])return{isToken:!0,value:g};if(b.match(H$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});h.localize.preprocessor&&(m=h.localize.preprocessor(v,m));const y={firstWeekContainsDate:f,weekStartsOn:p,locale:h};return m.map(g=>{if(!g.isToken)return g.value;const b=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&L$(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&$$(b))&&R$(b,t,String(e));const w=Ag[b[0]];return w(v,b,h.localize,y)}).join("")}function V$(e){const t=e.match(U$);return t?t[1].replace(B$,"'"):e}var Dg=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Dg||{});const Iu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Ig(e,t,n,r,i){const s=t===0,a=Number(Du(new Date(e),"c"))===2,o=Number(Du(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||To(e)||$s(e,l)||Yn(e);case"minute":return s||To(e)||$s(e,l)||Yn(e);case"30minutes":return s||To(e)||$s(e,l)||Yn(e);case"hourly":return s||To(e)||$s(e,l)||Yn(e);case"daily":return i?s||a||Yn(e):s||$s(e,l)||Yn(e);case"weekly":return s||a||Yn(e);case"monthly":return s||Yn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Nu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=x(i,"timeIntervalFormats")[o],u=x(c,"primary"),d=x(c,"secondary"),h=Ig(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:v,optionsObject:m}=s,y=m[r].type,g=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!g){const b=Du(l,f,{locale:p}).split("").map(w=>{const _=Number(w);return w!==" "&&!Number.isNaN(_)?_.toLocaleString(v):w});return s[y](l,v,{},b.join(""))}else return s[y](l,v,g)}function So(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function F$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function z$(e){const t=Iu.reduce((n,[,r],i)=>{const s=Iu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Iu[t][0]}function Pu(e,t){if(Dg[t])return t;if(e.length===1)return"15seconds";const n=F$(e),r=zn(n);return z$(r)}function To(e){const{s:t,m:n,H:r}=So(e);return r===0&&n===0&&t===0}function $s(e,t){const n=So(e).M,r=So(t).M;return n!==r}function Yn(e){const{M:t,d:n,s:r,m:i,H:s}=So(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Ng(e){return e===void 0?"":e.toISOString()}function Pg(e){const t=qe(e,r=>r.value),n=Ke().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Ug(e,t){const n=x(t,"gradient","colors"),r=!tn(n);let i=x(t,"pairing","option");const s=Pg(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return Uc().domain(s).range(o)}var dt=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(dt||{});function G$(e,t){return e&&ig(e,t,ys)}function j$(e,t){return function(n,r){if(n==null)return n;if(!Sr(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var Uu=j$(G$);function W$(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function q$(e,t,n,r){return Uu(e,function(i,s,a){t(r,i,n(i),a)}),r}function Y$(e,t){return function(n,r){var i=ae(n)?W$:q$,s={};return i(n,e,Eo(r),s)}}function Z$(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var X$=Object.prototype,K$=X$.hasOwnProperty,Q$=Y$(function(e,t,n){K$.call(e,n)?e[n].push(t):uo(e,n,[t])});function J$(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}let gn=class{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=x(r,"locale"),o=x(r,"tabularRepModal","tableHeadingFormatter"),l=x(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===et.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const f in h){const p=h[f];typeof p=="number"&&(h[f]=a(p,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=x(n,"data"),a=x(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===et.LINEAR||c===et.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===et.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Yt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(kn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Yt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Q$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=z2.defaultBins}=s,l=Array.isArray(o),c=uy().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,v=this.aggregateBinDataByGroup(f);d.forEach(m=>{h.push({group:m,key:p,value:v[m]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return iu().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Os(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Ng(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===et.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===et.LOG||o===et.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Ng(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=Z$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?iu().offset(pT):iu()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();ku(n,t),this.set({options:lt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Yt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=x(s,"label");if(c===null){const d=x(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>J$(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
+ `),n=this.getOptions();let r="myChart";const i=x(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Yt.items.status,s=this.getOptions(),a=Os(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=x(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=x(t,"option");const i=lg.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=ja().range(o).domain(this.allDataGroups)}},Ar=class extends gn{constructor(t){super(t),this.axisFlavor=$i.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:x(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=x(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(kn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Os(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===et.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{x(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},tL=class extends Ar{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},eL=class extends Ar{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:$l(t,.25),q_50:$l(t,.5),q_75:$l(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(b=>b[o]).sort(ar),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,v=[],m=[];for(const b of l)b<f||b>p?v.push(b):m.push(b);c.outliers=v;const y=zn(m),g=lr(m);c.whiskers={min:y||zn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:g||lr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=x(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=x(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],x(l,"whiskers","min")!==null?i(x(l,"whiskers","min"),s):"&ndash;",x(l,"quartiles","q_25")!==null?i(x(l,"quartiles","q_25"),s):"&ndash;",x(l,"quartiles","q_50")!==null?i(x(l,"quartiles","q_50"),s):"&ndash;",x(l,"quartiles","q_75")!==null?i(x(l,"quartiles","q_75"),s):"&ndash;",x(l,"whiskers","max")!==null?i(x(l,"whiskers","max"),s):"&ndash;",x(l,"quartiles","q_75")!==null&&x(l,"quartiles","q_25")!==null?(i(x(l,"quartiles","q_75")-x(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"option");const r=lg.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=ja().range(i).domain(this.allDataGroups)}},nL=class extends Ar{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=x(n,"locale"),o=x(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),x(u,"marker")===null?"&ndash;":s(u.marker,a),x(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},rL=class extends gn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(tn(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!tn(n)&&!tn(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Ug(this.getDisplayData(),t)}},iL=class extends gn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=lt({},t,this.getZoomOptions(t));ku(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:lt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:ee.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=x(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},sL=class extends gn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=x(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},aL=class extends gn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=x(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},oL=class extends Ar{constructor(t){super(t),this.axisFlavor=$i.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==et.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==et.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==et.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==et.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=qe(this.getDisplayData(),r=>r.value),n=Ke().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(tn(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(tn(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(tn(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=kn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(kn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){tn(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=x(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!tn(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Uc().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Ug(this.getDisplayData(),l)}},lL=class extends Ar{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=x(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[_t(t,"bins.rangeLabel")||"Range",...s.map(l=>_t(l,`0.${n}`))],o=[..._t(s,0).map((l,c)=>[`${r(Number(_t(l,"data.x0")),i)} – ${r(Number(_t(l,"data.x1")),i)}`,...s.map(u=>r(_t(u[c],`data.${_t(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}},cL=class extends gn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional"),{number:a,code:o}=x(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else u=x(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;let p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})];return super.formatTable({headers:l,cells:c})}},uL=class extends Ar{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),{number:s,code:a}=x(t,"locale"),o=x(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>x(u,"data",h,i)!==null?s(x(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}},hL=class extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},dL=class extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):x(a.name)!==null&&x(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}},fL=class extends gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=x(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var pL=/\s/;function mL(e){for(var t=e.length;t--&&pL.test(e.charAt(t)););return t}var gL=/^\s+/;function vL(e){return e&&e.slice(0,mL(e)+1).replace(gL,"")}var Bg=NaN,yL=/^[-+]0x[0-9a-f]+$/i,xL=/^0b[01]+$/i,bL=/^0o[0-7]+$/i,EL=parseInt;function gi(e){if(typeof e=="number")return e;if(lo(e))return Bg;if(Fe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Fe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=vL(e);var n=xL.test(e);return n||bL.test(e)?EL(e.slice(2),n?2:8):yL.test(e)?Bg:+e}var Bu=function(){return Qe.Date.now()},_L="Expected a function",wL=Math.max,SL=Math.min;function Oo(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(_L);t=gi(t)||0,Fe(n)&&(u=!!n.leading,d="maxWait"in n,s=d?wL(gi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(S){var L=r,I=i;return r=i=void 0,c=S,a=e.apply(I,L),a}function p(S){return c=S,o=setTimeout(y,t),u?f(S):a}function v(S){var L=S-l,I=S-c,k=t-L;return d?SL(k,s-I):k}function m(S){var L=S-l,I=S-c;return l===void 0||L>=t||L<0||d&&I>=s}function y(){var S=Bu();if(m(S))return g(S);o=setTimeout(y,v(S))}function g(S){return o=void 0,h&&r?f(S):(r=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function w(){return o===void 0?a:g(Bu())}function _(){var S=Bu(),L=m(S);if(r=arguments,i=this,l=S,L){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(y,t),f(l)}return o===void 0&&(o=setTimeout(y,t)),a}return _.cancel=b,_.flush=w,_}function TL(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const OL=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Un(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Mo(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function ML(e){const t=Mo(e,"border-left-width"),n=Mo(e,"border-right-width");return e.clientWidth+t+n}function CL(e){const t=Mo(e,"border-top-width"),n=Mo(e,"border-bottom-width");return e.clientHeight+t+n}function Hg(e,t={}){const n=t.width||ML(e),r=t.height||CL(e);return{width:n,height:r}}function AL(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Le=16384;function $L(e){(e.width>Le||e.height>Le)&&(e.width>Le&&e.height>Le?e.width>e.height?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le):e.width>Le?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le))}function Co(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function LL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function RL(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),LL(i)}const we=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||we(n,t)};function kL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function DL(e){return Un(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function IL(e,t,n){const r=`.${e}:${t}`,i=n.cssText?kL(n):DL(n);return document.createTextNode(`${r}{${i}}`)}function Vg(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=OL();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(IL(s,n,r)),t.appendChild(a)}function NL(e,t){Vg(e,t,":before"),Vg(e,t,":after")}const Fg="application/font-woff",zg="image/jpeg",PL={woff:Fg,woff2:Fg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:zg,jpeg:zg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function UL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Hu(e){const t=UL(e).toLowerCase();return PL[t]||""}function BL(e){return e.split(/,/)[1]}function Vu(e){return e.search(/^(data:)/)!==-1}function HL(e,t){return`data:${t};base64,${e}`}async function Gg(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const Fu={};function VL(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function zu(e,t,n){const r=VL(e,t,n.includeQueryParams);if(Fu[r]!=null)return Fu[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Gg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),BL(o)));i=HL(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return Fu[r]=i,i}async function FL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Co(t)}async function zL(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return Co(o)}const n=e.poster,r=Hu(n),i=await zu(n,r,t);return Co(i)}async function GL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Ao(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function jL(e,t){return we(e,HTMLCanvasElement)?FL(e):we(e,HTMLVideoElement)?zL(e,t):we(e,HTMLIFrameElement)?GL(e):e.cloneNode(!1)}const WL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function qL(e,t,n){var r,i;let s=[];return WL(e)&&e.assignedNodes?s=Un(e.assignedNodes()):we(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Un(e.contentDocument.body.childNodes):s=Un(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||we(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Ao(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function YL(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Un(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),we(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function ZL(e,t){we(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),we(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function XL(e,t){if(we(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function KL(e,t){return we(t,Element)&&(YL(e,t),NL(e,t),ZL(e,t),XL(e,t)),t}async function QL(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await Ao(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function Ao(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>jL(r,t)).then(r=>qL(e,r,t)).then(r=>KL(e,r)).then(r=>QL(r,t))}const jg=/url\((['"]?)([^'"]+?)\1\)/g,JL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,tR=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function eR(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function nR(e){const t=[];return e.replace(jg,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Vu(n))}async function rR(e,t,n,r,i){try{const s=n?TL(t,n):t,a=Hu(t);let o;return i||(o=await zu(s,a,r)),e.replace(eR(t),`$1${o}$3`)}catch{}return e}function iR(e,{preferredFontFormat:t}){return t?e.replace(tR,n=>{for(;;){const[r,,i]=JL.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Wg(e){return e.search(jg)!==-1}async function qg(e,t,n){if(!Wg(e))return e;const r=iR(e,n);return nR(r).reduce((i,s)=>i.then(a=>rR(a,s,t,n)),Promise.resolve(r))}async function $o(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await qg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function sR(e,t){await $o("background",e,t)||await $o("background-image",e,t),await $o("mask",e,t)||await $o("mask-image",e,t)}async function aR(e,t){const n=we(e,HTMLImageElement);if(!(n&&!Vu(e.src))&&!(we(e,SVGImageElement)&&!Vu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await zu(r,Hu(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function oR(e,t){const n=Un(e.childNodes).map(r=>Yg(r,t));await Promise.all(n).then(()=>e)}async function Yg(e,t){we(e,Element)&&(await sR(e,t),await aR(e,t),await oR(e,t))}function lR(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Zg={};async function Xg(e){let t=Zg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Zg[e]=t,t}async function Kg(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),Gg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Qg(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function cR(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Un(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Xg(l).then(u=>Kg(u,t)).then(u=>Qg(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Xg(i.href).then(o=>Kg(o,t)).then(o=>Qg(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Un(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function uR(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Wg(t.style.getPropertyValue("src")))}async function hR(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Un(e.ownerDocument.styleSheets),r=await cR(n,t);return uR(r)}async function dR(e,t){const n=await hR(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return qg(r.cssText,i,t)}))).join(`
3
+ `)}async function fR(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await dR(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function pR(e,t={}){const{width:n,height:r}=Hg(e,t),i=await Ao(e,t,!0);return await fR(i,t),await Yg(i,t),lR(i,t),await RL(i,n,r)}async function Jg(e,t={}){const{width:n,height:r}=Hg(e,t),i=await pR(e,t),s=await Co(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||AL(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||$L(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function mR(e,t={}){return(await Jg(e,t)).toDataURL()}async function gR(e,t={}){return(await Jg(e,t)).toDataURL("image/jpeg",t.quality||1)}class Bn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const vR="DONT_STYLE_ME_css_styles_verifier";let N=class Bh extends Bn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=D(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],v=parseFloat(p);p&&v>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=v)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=x(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${_e}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",vR),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),D(this.getHolder()).classed(`${_e}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=D(r);i.classed("filled",!0),gR(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=D(r);i.classed("filled",!0),mR(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=x(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return D(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();D(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Bh.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Bh.getSVGElementSize(D(s),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Oo(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}};class Ls extends Bn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:Ls.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}function tv(e){const t=yR(ev(e),360);return Zn(t,[0,10])||Zn(t,[350,0])?{textAnchor:on.START,dominantBaseline:ln.MIDDLE}:Zn(t,[10,80])?{textAnchor:on.START,dominantBaseline:ln.HANGING}:Zn(t,[80,100])?{textAnchor:on.MIDDLE,dominantBaseline:ln.HANGING}:Zn(t,[100,170])?{textAnchor:on.END,dominantBaseline:ln.HANGING}:Zn(t,[170,190])?{textAnchor:on.END,dominantBaseline:ln.MIDDLE}:Zn(t,[190,260])?{textAnchor:on.END,dominantBaseline:ln.BASELINE}:Zn(t,[260,280])?{textAnchor:on.MIDDLE,dominantBaseline:ln.BASELINE}:{textAnchor:on.START,dominantBaseline:ln.BASELINE}}function yR(e,t){return(e%t+t)%t}function Zn(e,[t,n]){return e>=t&&e<=n}function ev(e){return e*(180/Math.PI)}function Xt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function xR(e,t){return t*Math.sin(e-Math.PI/2)}function nv(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bR(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Gu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function ER(e){return e.depth}function _R(e,t){return t-1-e.height}function rv(e,t){return e.sourceLinks.length?e.depth:t-1}function Lo(e){return function(){return e}}function iv(e,t){return Ro(e.source,t.source)||e.index-t.index}function sv(e,t){return Ro(e.target,t.target)||e.index-t.index}function Ro(e,t){return e.y0-t.y0}function ju(e){return e.value}function wR(e){return e.index}function SR(e){return e.nodes}function TR(e){return e.links}function av(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function ov({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function OR(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=wR,l=rv,c,u,d=SR,h=TR,f=6;function p(){const E={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(E),m(E),y(E),g(E),_(E),ov(E),E}p.update=function(E){return ov(E),E},p.nodeId=function(E){return arguments.length?(o=typeof E=="function"?E:Lo(E),p):o},p.nodeAlign=function(E){return arguments.length?(l=typeof E=="function"?E:Lo(E),p):l},p.nodeSort=function(E){return arguments.length?(c=E,p):c},p.nodeWidth=function(E){return arguments.length?(i=+E,p):i},p.nodePadding=function(E){return arguments.length?(s=a=+E,p):s},p.nodes=function(E){return arguments.length?(d=typeof E=="function"?E:Lo(E),p):d},p.links=function(E){return arguments.length?(h=typeof E=="function"?E:Lo(E),p):h},p.linkSort=function(E){return arguments.length?(u=E,p):u},p.size=function(E){return arguments.length?(e=t=0,n=+E[0],r=+E[1],p):[n-e,r-t]},p.extent=function(E){return arguments.length?(e=+E[0][0],n=+E[1][0],t=+E[0][1],r=+E[1][1],p):[[e,t],[n,r]]},p.iterations=function(E){return arguments.length?(f=+E,p):f};function v({nodes:E,links:A}){for(const[U,B]of E.entries())B.index=U,B.sourceLinks=[],B.targetLinks=[];const $=new Map(E.map((U,B)=>[o(U,B,E),U]));for(const[U,B]of A.entries()){B.index=U;let{source:q,target:Q}=B;typeof q!="object"&&(q=B.source=av($,q)),typeof Q!="object"&&(Q=B.target=av($,Q)),q.sourceLinks.push(B),Q.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:U,targetLinks:B}of E)U.sort(u),B.sort(u)}function m({nodes:E}){for(const A of E)A.value=A.fixedValue===void 0?Math.max(Gu(A.sourceLinks,ju),Gu(A.targetLinks,ju)):A.fixedValue}function y({nodes:E}){const A=E.length;let $=new Set(E),U=new Set,B=0;for(;$.size;){for(const q of $){q.depth=B;for(const{target:Q}of q.sourceLinks)U.add(Q)}if(++B>A)throw new Error("circular link");$=U,U=new Set}}function g({nodes:E}){const A=E.length;let $=new Set(E),U=new Set,B=0;for(;$.size;){for(const q of $){q.height=B;for(const{source:Q}of q.targetLinks)U.add(Q)}if(++B>A)throw new Error("circular link");$=U,U=new Set}}function b({nodes:E}){const A=nv(E,B=>B.depth)+1,$=(n-e-i)/(A-1),U=new Array(A);for(const B of E){const q=Math.max(0,Math.min(A-1,Math.floor(l.call(null,B,A))));B.layer=q,B.x0=e+q*$,B.x1=B.x0+i,U[q]?U[q].push(B):U[q]=[B]}if(c)for(const B of U)B.sort(c);return U}function w(E){const A=bR(E,$=>(r-t-($.length-1)*a)/Gu($,ju));for(const $ of E){let U=t;for(const B of $){B.y0=U,B.y1=U+B.value*A,U=B.y1+a;for(const q of B.sourceLinks)q.width=q.value*A}U=(r-U+a)/($.length+1);for(let B=0;B<$.length;++B){const q=$[B];q.y0+=U*(B+1),q.y1+=U*(B+1)}F($)}}function _(E){const A=b(E);a=Math.min(s,(r-t)/(nv(A,$=>$.length)-1)),w(A);for(let $=0;$<f;++$){const U=Math.pow(.99,$),B=Math.max(1-U,($+1)/f);L(A,U,B),S(A,U,B)}}function S(E,A,$){for(let U=1,B=E.length;U<B;++U){const q=E[U];for(const Q of q){let J=0,ft=0;for(const{source:gt,value:X}of Q.targetLinks){let nt=X*(Q.layer-gt.layer);J+=P(gt,Q)*nt,ft+=nt}if(!(ft>0))continue;let st=(J/ft-Q.y0)*A;Q.y0+=st,Q.y1+=st,M(Q)}c===void 0&&q.sort(Ro),I(q,$)}}function L(E,A,$){for(let U=E.length,B=U-2;B>=0;--B){const q=E[B];for(const Q of q){let J=0,ft=0;for(const{target:gt,value:X}of Q.sourceLinks){let nt=X*(gt.layer-Q.layer);J+=H(Q,gt)*nt,ft+=nt}if(!(ft>0))continue;let st=(J/ft-Q.y0)*A;Q.y0+=st,Q.y1+=st,M(Q)}c===void 0&&q.sort(Ro),I(q,$)}}function I(E,A){const $=E.length>>1,U=E[$];R(E,U.y0-a,$-1,A),k(E,U.y1+a,$+1,A),R(E,r,E.length-1,A),k(E,t,0,A)}function k(E,A,$,U){for(;$<E.length;++$){const B=E[$],q=(A-B.y0)*U;q>1e-6&&(B.y0+=q,B.y1+=q),A=B.y1+a}}function R(E,A,$,U){for(;$>=0;--$){const B=E[$],q=(B.y1-A)*U;q>1e-6&&(B.y0-=q,B.y1-=q),A=B.y0-a}}function M({sourceLinks:E,targetLinks:A}){if(u===void 0){for(const{source:{sourceLinks:$}}of A)$.sort(sv);for(const{target:{targetLinks:$}}of E)$.sort(iv)}}function F(E){if(u===void 0)for(const{sourceLinks:A,targetLinks:$}of E)A.sort(sv),$.sort(iv)}function P(E,A){let $=E.y0-(E.sourceLinks.length-1)*a/2;for(const{target:U,width:B}of E.sourceLinks){if(U===A)break;$+=B+a}for(const{source:U,width:B}of A.targetLinks){if(U===E)break;$-=B}return $}function H(E,A){let $=A.y0-(A.targetLinks.length-1)*a/2;for(const{source:U,width:B}of A.targetLinks){if(U===E)break;$+=B+a}for(const{target:U,width:B}of E.sourceLinks){if(U===A)break;$-=B}return $}return p}var Wu=Math.PI,qu=2*Wu,$r=1e-6,MR=qu-$r;function Yu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function lv(){return new Yu}Yu.prototype=lv.prototype={constructor:Yu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>$r)if(!(Math.abs(u*o-l*c)>$r)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=r-a,p=o*o+l*l,v=h*h+f*f,m=Math.sqrt(p),y=Math.sqrt(d),g=i*Math.tan((Wu-Math.acos((p+d-v)/(2*m*y)))/2),b=g/y,w=g/m;Math.abs(b-1)>$r&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+w*o)+","+(this._y1=t+w*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>$r||Math.abs(this._y1-c)>$r)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%qu+qu),d>MR?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>$r&&(this._+="A"+n+","+n+",0,"+ +(d>=Wu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function cv(e){return function(){return e}}function CR(e){return e[0]}function AR(e){return e[1]}var $R=Array.prototype.slice;function LR(e){return e.source}function RR(e){return e.target}function kR(e){var t=LR,n=RR,r=CR,i=AR,s=null;function a(){var o,l=$R.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=lv()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:cv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:cv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function DR(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function IR(){return kR(DR)}function NR(e){return[e.source.x1,e.y0]}function PR(e){return[e.target.x0,e.y1]}function UR(){return IR().source(NR).target(PR)}function uv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BR(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var HR={value:function(){}};function hv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ko(n)}function ko(e){this._=e}function VR(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ko.prototype=hv.prototype={constructor:ko,on:function(e,t){var n=this._,r=VR(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=FR(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=dv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=dv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ko(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function FR(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function dv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=HR,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const zR=BR(Object.freeze(Object.defineProperty({__proto__:null,dispatch:hv},Symbol.toStringTag,{value:"Module"}))).dispatch,Zu=Math.PI/180,GR={archimedean:pv,rectangular:ek},Rs=64,Do=2048;var jR=function(){var e=[256,256],t=WR,n=qR,r=YR,i=fv,s=fv,a=ZR,o=XR,l=pv,c=[],u=1/0,d=zR("word","end"),h=null,f=Math.random,p={},v=rk;p.canvas=function(g){return arguments.length?(v=Xn(g),p):v},p.start=function(){var g=m(v()),b=nk((e[0]>>5)*e[1]),w=null,_=c.length,S=-1,L=[],I=c.map(function(R,M){return R.text=t.call(this,R,M),R.font=n.call(this,R,M),R.style=i.call(this,R,M),R.weight=s.call(this,R,M),R.rotate=a.call(this,R,M),R.size=~~r.call(this,R,M),R.padding=o.call(this,R,M),R}).sort(function(R,M){return M.size-R.size});return h&&clearInterval(h),h=setInterval(k,0),k(),p;function k(){for(var R=Date.now();Date.now()-R<u&&++S<_&&h;){var M=I[S];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,KR(g,M,I,S),M.hasText&&y(b,M,w)&&(L.push(M),d.call("word",p,M),w?JR(w,M):w=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,L,w))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return p};function m(g){const b=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const w=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return g.width=(Rs<<5)/w,g.height=Do/w,b.fillStyle=b.strokeStyle="red",{context:b,ratio:w}}function y(g,b,w){e[0],e[1];for(var _=b.x,S=b.y,L=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),k=f()<.5?1:-1,R=-k,M,F,P;(M=I(R+=k))&&(F=~~M[0],P=~~M[1],!(Math.min(Math.abs(F),Math.abs(P))>=L));)if(b.x=_+F,b.y=S+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!w||tk(b,w))&&!QR(b,g,e[0])){for(var H=b.sprite,E=b.width>>5,A=e[0]>>5,$=b.x-(E<<4),U=$&127,B=32-U,q=b.y1-b.y0,Q=(b.y+b.y0)*A+($>>5),J,ft=0;ft<q;ft++){J=0;for(var st=0;st<=E;st++)g[Q+st]|=J<<B|(st<E?(J=H[ft*E+st])>>>U:0);Q+=A}return!0}return!1}return p.timeInterval=function(g){return arguments.length?(u=g??1/0,p):u},p.words=function(g){return arguments.length?(c=g,p):c},p.size=function(g){return arguments.length?(e=[+g[0],+g[1]],p):e},p.font=function(g){return arguments.length?(n=Xn(g),p):n},p.fontStyle=function(g){return arguments.length?(i=Xn(g),p):i},p.fontWeight=function(g){return arguments.length?(s=Xn(g),p):s},p.rotate=function(g){return arguments.length?(a=Xn(g),p):a},p.text=function(g){return arguments.length?(t=Xn(g),p):t},p.spiral=function(g){return arguments.length?(l=GR[g]||g,p):l},p.fontSize=function(g){return arguments.length?(r=Xn(g),p):r},p.padding=function(g){return arguments.length?(o=Xn(g),p):o},p.random=function(g){return arguments.length?(f=g,p):f},p.on=function(){var g=d.on.apply(d,arguments);return g===d?p:g},p};function WR(e){return e.text}function qR(){return"serif"}function fv(){return"normal"}function YR(e){return Math.sqrt(e.value)}function ZR(){return(~~(random()*6)-3)*30}function XR(){return 1}function KR(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Rs<<5)/s,Do/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const M=i.measureText(t.text),F=-Math.floor(M.width/2);let P=(M.width+1)*s,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Zu),d=Math.cos(t.rotate*Zu),h=P*d,f=P*u,p=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(H>l&&(l=H),a+P>=Rs<<5&&(a=0,o+=l,l=0),o+H>=Do)break;i.translate((a+(P>>1))/s,(o+(H>>1))/s),t.rotate&&i.rotate(t.rotate*Zu),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Rs<<5)/s,Do/s).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,b=g>>5,w=t.y1-t.y0,_=0;_<w*b;_++)y[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,L=-1,I=0;I<w;I++){for(var _=0;_<g;_++){var k=b*I+(_>>5),R=m[(o+I)*(Rs<<5)+(a+_)<<2]?1<<31-_%32:0;y[k]|=R,S|=R}S?L=I:(t.y0++,w--,I--,o++)}t.y1=t.y0+L,t.sprite=y.slice(0,(t.y1-t.y0)*b)}}}function QR(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function JR(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function tk(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function pv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function ek(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function nk(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function rk(){return document.createElement("canvas")}function Xn(e){return typeof e=="function"?e:function(){return e}}const ik=uv(jR);function sk(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function ak(e){return function(t){return e==null?void 0:e[t]}}var ok={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lk=ak(ok),ck=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,uk="\\u0300-\\u036f",hk="\\ufe20-\\ufe2f",dk="\\u20d0-\\u20ff",fk=uk+hk+dk,pk="["+fk+"]",mk=RegExp(pk,"g");function gk(e){return e=_s(e),e&&e.replace(ck,lk).replace(mk,"")}var vk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function yk(e){return e.match(vk)||[]}var xk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function bk(e){return xk.test(e)}var mv="\\ud800-\\udfff",Ek="\\u0300-\\u036f",_k="\\ufe20-\\ufe2f",wk="\\u20d0-\\u20ff",Sk=Ek+_k+wk,gv="\\u2700-\\u27bf",vv="a-z\\xdf-\\xf6\\xf8-\\xff",Tk="\\xac\\xb1\\xd7\\xf7",Ok="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mk="\\u2000-\\u206f",Ck=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yv="A-Z\\xc0-\\xd6\\xd8-\\xde",Ak="\\ufe0e\\ufe0f",xv=Tk+Ok+Mk+Ck,bv="['’]",Ev="["+xv+"]",$k="["+Sk+"]",_v="\\d+",Lk="["+gv+"]",wv="["+vv+"]",Sv="[^"+mv+xv+_v+gv+vv+yv+"]",Rk="\\ud83c[\\udffb-\\udfff]",kk="(?:"+$k+"|"+Rk+")",Dk="[^"+mv+"]",Tv="(?:\\ud83c[\\udde6-\\uddff]){2}",Ov="[\\ud800-\\udbff][\\udc00-\\udfff]",vi="["+yv+"]",Ik="\\u200d",Mv="(?:"+wv+"|"+Sv+")",Nk="(?:"+vi+"|"+Sv+")",Cv="(?:"+bv+"(?:d|ll|m|re|s|t|ve))?",Av="(?:"+bv+"(?:D|LL|M|RE|S|T|VE))?",$v=kk+"?",Lv="["+Ak+"]?",Pk="(?:"+Ik+"(?:"+[Dk,Tv,Ov].join("|")+")"+Lv+$v+")*",Uk="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bk="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hk=Lv+$v+Pk,Vk="(?:"+[Lk,Tv,Ov].join("|")+")"+Hk,Fk=RegExp([vi+"?"+wv+"+"+Cv+"(?="+[Ev,vi,"$"].join("|")+")",Nk+"+"+Av+"(?="+[Ev,vi+Mv,"$"].join("|")+")",vi+"?"+Mv+"+"+Cv,vi+"+"+Av,Bk,Uk,_v,Vk].join("|"),"g");function zk(e){return e.match(Fk)||[]}function Gk(e,t,n){return e=_s(e),t=t,t===void 0?bk(e)?zk(e):yk(e):e.match(t)||[]}var jk="['’]",Wk=RegExp(jk,"g");function Rv(e){return function(t){return sk(Gk(gk(t).replace(Wk,"")),e,"")}}function qk(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function kv(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=gi(n),n=n===n?n:0),t!==void 0&&(t=gi(t),t=t===t?t:0),qk(gi(e),t,n)}var Yk="Expected a function";function Zk(e,t,n){if(typeof e!="function")throw new TypeError(Yk);return setTimeout(function(){e.apply(void 0,n)},t)}var Xk=du(function(e,t,n){return Zk(e,gi(t)||0,n)});function Kk(e,t){var n=-1,r=Sr(e)?Array(e.length):[];return Uu(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function Qk(e,t){var n=ae(e)?au:Kk;return n(e,Eo(t))}var Jk=1/0;function tD(e,t){return vo(Qk(e,t),Jk)}function Dv(e,t){return bo(e,t)}var yi=Rv(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function eD(e,t){var n;return Uu(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function nD(e,t,n){var r=ae(e)?Zm:eD;return r(e,Eo(t))}class xt{constructor(t,n,r){if(this.type="",this.renderType=rt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${_e}--${i}--${this.type}`,!0),r&&r.classed(`${_e}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${_e}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=D(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?lt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */const{entries:Iv,setPrototypeOf:Nv,isFrozen:rD,getPrototypeOf:iD,getOwnPropertyDescriptor:sD}=Object;let{freeze:ve,seal:je,create:Pv}=Object,{apply:Xu,construct:Ku}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),je||(je=function(e){return e}),Xu||(Xu=function(e,t,n){return e.apply(t,n)}),Ku||(Ku=function(e,t){return new e(...t)});const Io=Re(Array.prototype.forEach),Uv=Re(Array.prototype.pop),ks=Re(Array.prototype.push),No=Re(String.prototype.toLowerCase),Qu=Re(String.prototype.toString),Bv=Re(String.prototype.match),Ds=Re(String.prototype.replace),aD=Re(String.prototype.indexOf),oD=Re(String.prototype.trim),rn=Re(Object.prototype.hasOwnProperty),ye=Re(RegExp.prototype.test),Is=lD(TypeError);function Re(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Xu(e,t,r)}}function lD(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ku(e,n)}}function bt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:No;Nv&&Nv(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(rD(t)||(t[r]=s),i=s)}e[i]=!0}return e}function cD(e){for(let t=0;t<e.length;t++)rn(e,t)||(e[t]=null);return e}function Lr(e){const t=Pv(null);for(const[n,r]of Iv(e))rn(e,n)&&(Array.isArray(r)?t[n]=cD(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Lr(r):t[n]=r);return t}function Po(e,t){for(;e!==null;){const r=sD(e,t);if(r){if(r.get)return Re(r.get);if(typeof r.value=="function")return Re(r.value)}e=iD(e)}function n(){return null}return n}const Hv=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ju=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),th=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),uD=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eh=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hD=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vv=ve(["#text"]),Fv=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),nh=ve(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zv=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Uo=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dD=je(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fD=je(/<%[\w\W]*|[\w\W]*%>/gm),pD=je(/\${[\w\W]*}/gm),mD=je(/^data-[\-\w.\u00B7-\uFFFF]/),gD=je(/^aria-[\-\w]+$/),Gv=je(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vD=je(/^(?:\w+script|data):/i),yD=je(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jv=je(/^html$/i),xD=je(/^[a-z][.\w]*(-[.\w]+)+$/i);var Wv=Object.freeze({__proto__:null,MUSTACHE_EXPR:dD,ERB_EXPR:fD,TMPLIT_EXPR:pD,DATA_ATTR:mD,ARIA_ATTR:gD,IS_ALLOWED_URI:Gv,IS_SCRIPT_OR_DATA:vD,ATTR_WHITESPACE:yD,DOCTYPE_NAME:jv,CUSTOM_ELEMENT:xD});const Ns={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bD=function(){return typeof window>"u"?null:window},ED=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function qv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bD();const t=O=>qv(O);if(t.version="3.1.5",t.removed=[],!e||!e.document||e.document.nodeType!==Ns.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,v=Po(p,"cloneNode"),m=Po(p,"nextSibling"),y=Po(p,"childNodes"),g=Po(p,"parentNode");if(typeof a=="function"){const O=n.createElement("template");O.content&&O.content.ownerDocument&&(n=O.content.ownerDocument)}let b,w="";const{implementation:_,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:I}=n,{importNode:k}=r;let R={};t.isSupported=typeof Iv=="function"&&typeof g=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:F,TMPLIT_EXPR:P,DATA_ATTR:H,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:U}=Wv;let{IS_ALLOWED_URI:B}=Wv,q=null;const Q=bt({},[...Hv,...Ju,...th,...eh,...Vv]);let J=null;const ft=bt({},[...Fv,...nh,...zv,...Uo]);let st=Object.seal(Pv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),gt=null,X=null,nt=!0,pt=!0,Y=!1,tt=!0,ct=!1,G=!0,Mt=!1,Et=!1,qt=!1,Nt=!1,it=!1,$t=!1,Ie=!0,Ne=!1;const Dh="user-content-";let kr=!0,Dr=!1,tr={},Vn=null;const Fs=bt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const Xo=bt({},["audio","video","img","source","image","track"]);let Si=null;const zs=bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",Ti="http://www.w3.org/2000/svg",an="http://www.w3.org/1999/xhtml";let rr=an,Gs=!1,js=null;const Ih=bt({},[nr,Ti,an],Qu);let Ir=null;const Ws=["application/xhtml+xml","text/html"],Ko="text/html";let zt=null,xn=null;const qs=n.createElement("form"),Ys=function(O){return O instanceof RegExp||O instanceof Function},Zs=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xn&&xn===O)){if((!O||typeof O!="object")&&(O={}),O=Lr(O),Ir=Ws.indexOf(O.PARSER_MEDIA_TYPE)===-1?Ko:O.PARSER_MEDIA_TYPE,zt=Ir==="application/xhtml+xml"?Qu:No,q=rn(O,"ALLOWED_TAGS")?bt({},O.ALLOWED_TAGS,zt):Q,J=rn(O,"ALLOWED_ATTR")?bt({},O.ALLOWED_ATTR,zt):ft,js=rn(O,"ALLOWED_NAMESPACES")?bt({},O.ALLOWED_NAMESPACES,Qu):Ih,Si=rn(O,"ADD_URI_SAFE_ATTR")?bt(Lr(zs),O.ADD_URI_SAFE_ATTR,zt):zs,er=rn(O,"ADD_DATA_URI_TAGS")?bt(Lr(Xo),O.ADD_DATA_URI_TAGS,zt):Xo,Vn=rn(O,"FORBID_CONTENTS")?bt({},O.FORBID_CONTENTS,zt):Fs,gt=rn(O,"FORBID_TAGS")?bt({},O.FORBID_TAGS,zt):{},X=rn(O,"FORBID_ATTR")?bt({},O.FORBID_ATTR,zt):{},tr=rn(O,"USE_PROFILES")?O.USE_PROFILES:!1,nt=O.ALLOW_ARIA_ATTR!==!1,pt=O.ALLOW_DATA_ATTR!==!1,Y=O.ALLOW_UNKNOWN_PROTOCOLS||!1,tt=O.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ct=O.SAFE_FOR_TEMPLATES||!1,G=O.SAFE_FOR_XML!==!1,Mt=O.WHOLE_DOCUMENT||!1,Nt=O.RETURN_DOM||!1,it=O.RETURN_DOM_FRAGMENT||!1,$t=O.RETURN_TRUSTED_TYPE||!1,qt=O.FORCE_BODY||!1,Ie=O.SANITIZE_DOM!==!1,Ne=O.SANITIZE_NAMED_PROPS||!1,kr=O.KEEP_CONTENT!==!1,Dr=O.IN_PLACE||!1,B=O.ALLOWED_URI_REGEXP||Gv,rr=O.NAMESPACE||an,st=O.CUSTOM_ELEMENT_HANDLING||{},O.CUSTOM_ELEMENT_HANDLING&&Ys(O.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(st.tagNameCheck=O.CUSTOM_ELEMENT_HANDLING.tagNameCheck),O.CUSTOM_ELEMENT_HANDLING&&Ys(O.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(st.attributeNameCheck=O.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),O.CUSTOM_ELEMENT_HANDLING&&typeof O.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=O.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ct&&(pt=!1),it&&(Nt=!0),tr&&(q=bt({},Vv),J=[],tr.html===!0&&(bt(q,Hv),bt(J,Fv)),tr.svg===!0&&(bt(q,Ju),bt(J,nh),bt(J,Uo)),tr.svgFilters===!0&&(bt(q,th),bt(J,nh),bt(J,Uo)),tr.mathMl===!0&&(bt(q,eh),bt(J,zv),bt(J,Uo))),O.ADD_TAGS&&(q===Q&&(q=Lr(q)),bt(q,O.ADD_TAGS,zt)),O.ADD_ATTR&&(J===ft&&(J=Lr(J)),bt(J,O.ADD_ATTR,zt)),O.ADD_URI_SAFE_ATTR&&bt(Si,O.ADD_URI_SAFE_ATTR,zt),O.FORBID_CONTENTS&&(Vn===Fs&&(Vn=Lr(Vn)),bt(Vn,O.FORBID_CONTENTS,zt)),kr&&(q["#text"]=!0),Mt&&bt(q,["html","head","body"]),q.table&&(bt(q,["tbody"]),delete gt.tbody),O.TRUSTED_TYPES_POLICY){if(typeof O.TRUSTED_TYPES_POLICY.createHTML!="function")throw Is('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof O.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Is('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=O.TRUSTED_TYPES_POLICY,w=b.createHTML("")}else b===void 0&&(b=ED(f,i)),b!==null&&typeof w=="string"&&(w=b.createHTML(""));ve&&ve(O),xn=O}},Xs=bt({},["mi","mo","mn","ms","mtext"]),Qo=bt({},["foreignobject","annotation-xml"]),Jo=bt({},["title","style","font","a","script"]),Ks=bt({},[...Ju,...th,...uD]),tl=bt({},[...eh,...hD]),Nh=function(O){let j=g(O);(!j||!j.tagName)&&(j={namespaceURI:rr,tagName:"template"});const Z=No(O.tagName),ot=No(j.tagName);return js[O.namespaceURI]?O.namespaceURI===Ti?j.namespaceURI===an?Z==="svg":j.namespaceURI===nr?Z==="svg"&&(ot==="annotation-xml"||Xs[ot]):!!Ks[Z]:O.namespaceURI===nr?j.namespaceURI===an?Z==="math":j.namespaceURI===Ti?Z==="math"&&Qo[ot]:!!tl[Z]:O.namespaceURI===an?j.namespaceURI===Ti&&!Qo[ot]||j.namespaceURI===nr&&!Xs[ot]?!1:!tl[Z]&&(Jo[Z]||!Ks[Z]):!!(Ir==="application/xhtml+xml"&&js[O.namespaceURI]):!1},bn=function(O){ks(t.removed,{element:O});try{O.parentNode.removeChild(O)}catch{O.remove()}},Nr=function(O,j){try{ks(t.removed,{attribute:j.getAttributeNode(O),from:j})}catch{ks(t.removed,{attribute:null,from:j})}if(j.removeAttribute(O),O==="is"&&!J[O])if(Nt||it)try{bn(j)}catch{}else try{j.setAttribute(O,"")}catch{}},el=function(O){let j=null,Z=null;if(qt)O="<remove></remove>"+O;else{const St=Bv(O,/^[\r\n\t ]+/);Z=St&&St[0]}Ir==="application/xhtml+xml"&&rr===an&&(O='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+O+"</body></html>");const ot=b?b.createHTML(O):O;if(rr===an)try{j=new h().parseFromString(ot,Ir)}catch{}if(!j||!j.documentElement){j=_.createDocument(rr,"template",null);try{j.documentElement.innerHTML=Gs?w:ot}catch{}}const vt=j.body||j.documentElement;return O&&Z&&vt.insertBefore(n.createTextNode(Z),vt.childNodes[0]||null),rr===an?I.call(j,Mt?"html":"body")[0]:Mt?j.documentElement:vt},nl=function(O){return S.call(O.ownerDocument||O,O,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},rl=function(O){return O instanceof d&&(typeof O.nodeName!="string"||typeof O.textContent!="string"||typeof O.removeChild!="function"||!(O.attributes instanceof u)||typeof O.removeAttribute!="function"||typeof O.setAttribute!="function"||typeof O.namespaceURI!="string"||typeof O.insertBefore!="function"||typeof O.hasChildNodes!="function")},il=function(O){return typeof o=="function"&&O instanceof o},C=function(O,j,Z){R[O]&&Io(R[O],ot=>{ot.call(t,j,Z,xn)})},W=function(O){let j=null;if(C("beforeSanitizeElements",O,null),rl(O))return bn(O),!0;const Z=zt(O.nodeName);if(C("uponSanitizeElement",O,{tagName:Z,allowedTags:q}),O.hasChildNodes()&&!il(O.firstElementChild)&&ye(/<[/\w]/g,O.innerHTML)&&ye(/<[/\w]/g,O.textContent)||O.nodeType===Ns.progressingInstruction||G&&O.nodeType===Ns.comment&&ye(/<[/\w]/g,O.data))return bn(O),!0;if(!q[Z]||gt[Z]){if(!gt[Z]&&ut(Z)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,Z)||st.tagNameCheck instanceof Function&&st.tagNameCheck(Z)))return!1;if(kr&&!Vn[Z]){const ot=g(O)||O.parentNode,vt=y(O)||O.childNodes;if(vt&&ot){const St=vt.length;for(let pe=St-1;pe>=0;--pe){const ne=v(vt[pe],!0);ne.__removalCount=(O.__removalCount||0)+1,ot.insertBefore(ne,m(O))}}}return bn(O),!0}return O instanceof l&&!Nh(O)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&ye(/<\/no(script|embed|frames)/i,O.innerHTML)?(bn(O),!0):(ct&&O.nodeType===Ns.text&&(j=O.textContent,Io([M,F,P],ot=>{j=Ds(j,ot," ")}),O.textContent!==j&&(ks(t.removed,{element:O.cloneNode()}),O.textContent=j)),C("afterSanitizeElements",O,null),!1)},K=function(O,j,Z){if(Ie&&(j==="id"||j==="name")&&(Z in n||Z in qs))return!1;if(!(pt&&!X[j]&&ye(H,j))&&!(nt&&ye(E,j))){if(!J[j]||X[j]){if(!(ut(O)&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,O)||st.tagNameCheck instanceof Function&&st.tagNameCheck(O))&&(st.attributeNameCheck instanceof RegExp&&ye(st.attributeNameCheck,j)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(j))||j==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&ye(st.tagNameCheck,Z)||st.tagNameCheck instanceof Function&&st.tagNameCheck(Z))))return!1}else if(!Si[j]&&!ye(B,Ds(Z,$,""))&&!((j==="src"||j==="xlink:href"||j==="href")&&O!=="script"&&aD(Z,"data:")===0&&er[O])&&!(Y&&!ye(A,Ds(Z,$,"")))&&Z)return!1}return!0},ut=function(O){return O!=="annotation-xml"&&Bv(O,U)},wt=function(O){C("beforeSanitizeAttributes",O,null);const{attributes:j}=O;if(!j)return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J};let ot=j.length;for(;ot--;){const vt=j[ot],{name:St,namespaceURI:pe,value:ne}=vt,Gt=zt(St);let ie=St==="value"?ne:oD(ne);if(Z.attrName=Gt,Z.attrValue=ie,Z.keepAttr=!0,Z.forceKeepAttr=void 0,C("uponSanitizeAttribute",O,Z),ie=Z.attrValue,Z.forceKeepAttr||(Nr(St,O),!Z.keepAttr))continue;if(!tt&&ye(/\/>/i,ie)){Nr(St,O);continue}if(G&&ye(/((--!?|])>)|<\/(style|title)/i,ie)){Nr(St,O);continue}ct&&Io([M,F,P],Ph=>{ie=Ds(ie,Ph," ")});const sl=zt(O.nodeName);if(K(sl,Gt,ie)){if(Ne&&(Gt==="id"||Gt==="name")&&(Nr(St,O),ie=Dh+ie),b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(sl,Gt)){case"TrustedHTML":{ie=b.createHTML(ie);break}case"TrustedScriptURL":{ie=b.createScriptURL(ie);break}}try{pe?O.setAttributeNS(pe,St,ie):O.setAttribute(St,ie),rl(O)?bn(O):Uv(t.removed)}catch{}}}C("afterSanitizeAttributes",O,null)},Dt=function O(j){let Z=null;const ot=nl(j);for(C("beforeSanitizeShadowDOM",j,null);Z=ot.nextNode();)C("uponSanitizeShadowNode",Z,null),!W(Z)&&(Z.content instanceof s&&O(Z.content),wt(Z));C("afterSanitizeShadowDOM",j,null)};return t.sanitize=function(O){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,ot=null,vt=null,St=null;if(Gs=!O,Gs&&(O="<!-->"),typeof O!="string"&&!il(O))if(typeof O.toString=="function"){if(O=O.toString(),typeof O!="string")throw Is("dirty is not a string, aborting")}else throw Is("toString is not a function");if(!t.isSupported)return O;if(Et||Zs(j),t.removed=[],typeof O=="string"&&(Dr=!1),Dr){if(O.nodeName){const Gt=zt(O.nodeName);if(!q[Gt]||gt[Gt])throw Is("root node is forbidden and cannot be sanitized in-place")}}else if(O instanceof o)Z=el("<!---->"),ot=Z.ownerDocument.importNode(O,!0),ot.nodeType===Ns.element&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Z=ot:Z.appendChild(ot);else{if(!Nt&&!ct&&!Mt&&O.indexOf("<")===-1)return b&&$t?b.createHTML(O):O;if(Z=el(O),!Z)return Nt?null:$t?w:""}Z&&qt&&bn(Z.firstChild);const pe=nl(Dr?O:Z);for(;vt=pe.nextNode();)W(vt)||(vt.content instanceof s&&Dt(vt.content),wt(vt));if(Dr)return O;if(Nt){if(it)for(St=L.call(Z.ownerDocument);Z.firstChild;)St.appendChild(Z.firstChild);else St=Z;return(J.shadowroot||J.shadowrootmode)&&(St=k.call(r,St,!0)),St}let ne=Mt?Z.outerHTML:Z.innerHTML;return Mt&&q["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&ye(jv,Z.ownerDocument.doctype.name)&&(ne="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
4
+ `+ne),ct&&Io([M,F,P],Gt=>{ne=Ds(ne,Gt," ")}),b&&$t?b.createHTML(ne):ne},t.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zs(O),Et=!0},t.clearConfig=function(){xn=null,Et=!1},t.isValidAttribute=function(O,j,Z){xn||Zs({});const ot=zt(O),vt=zt(j);return K(ot,vt,Z)},t.addHook=function(O,j){typeof j=="function"&&(R[O]=R[O]||[],ks(R[O],j))},t.removeHook=function(O){if(R[O])return Uv(R[O])},t.removeHooks=function(O){R[O]&&(R[O]=[])},t.removeAllHooks=function(){R={}},t}var rh=qv();const Bo=e=>rh.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),_D=e=>rh.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),vn=e=>rh.sanitize(e,{ALLOWED_TAGS:[]}),Yv=class G0 extends xt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label","chart toolbar");if(x(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
5
5
  <button
6
6
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
- aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${pn(l.id)}`)}" aria-label="${pn(l.title)}">
7
+ aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${vn(l.id)}`)}" aria-label="${vn(l.title)}">
8
8
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
9
9
  ${_D(l.iconSVG.content)}
10
10
  </svg>
11
- </button>`).each(function(l,c){D(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),D(this).select("button").on("mouseover focus",function(u){const d=D(this);d.classed("hovered",!0),o.services.events.dispatchEvent(O.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(O.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>x(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),D(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=D(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=x(this.getOptions(),"toolbar","numberOfIcons")-1,n=x(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===$t.CUSTOM)x(a,"id")===null&&(a.id=`toolbar-button-${G0.buttonID++}`),x(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===$t.MAKE_FULLSCREEN&&l?a.type=$t.EXIT_FULLSCREEN:a.type===$t.EXIT_FULLSCREEN&&!l&&(a.type=$t.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?x(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=x(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
+ </button>`).each(function(l,c){D(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),D(this).select("button").on("mouseover focus",function(u){const d=D(this);d.classed("hovered",!0),o.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>x(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),D(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=D(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=x(this.getOptions(),"toolbar","numberOfIcons")-1,n=x(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===Ct.CUSTOM)x(a,"id")===null&&(a.id=`toolbar-button-${G0.buttonID++}`),x(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===Ct.MAKE_FULLSCREEN&&l?a.type=Ct.EXIT_FULLSCREEN:a.type===Ct.EXIT_FULLSCREEN&&!l&&(a.type=Ct.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?x(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=x(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
12
  <circle cx="16" cy="16" r="2"></circle>
13
- <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=x(i,"locale","translations","toolbar");let p;switch(t){case $t.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case $t.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case $t.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case $t.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case $t.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case $t.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case $t.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case $t.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case $t.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case $t.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case $t.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case $t.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case $t.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case $t.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case $t.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Yv.buttonID=0;let Po=Yv;const Xv=class j0 extends xt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=j0.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=x(r,"growth");return i===ht.PREFERRED||i===ht.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>x(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=N.getHTMLElementSize(n.node()),s=this.configs.direction===Ut.ROW||this.configs.direction===Ut.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${_e}--${a}--layout-row`,this.configs.direction===Ut.ROW).classed(`${_e}--${a}--layout-row-reverse`,this.configs.direction===Ut.ROW_REVERSE).classed(`${_e}--${a}--layout-column`,this.configs.direction===Ut.COLUMN).classed(`${_e}--${a}--layout-column-reverse`,this.configs.direction===Ut.COLUMN_REVERSE).classed(`${_e}--${a}--layout-alignitems-center`,this.configs.alignItems===Nr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const d=D(this),h=x(c,"renderType")===rt.SVG;u.setParent(h?N.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const f=x(c,"growth");(f===ht.PREFERRED||f===ht.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=x(c,"growth"),d=x(c,"renderType")===rt.SVG?N.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(u===ht.PREFERRED){const h=s?d.width:d.height,f=s?r:i;c.size=h/f*100}}),o.exit().remove(),this.children.filter(c=>x(c,"growth")===ht.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);s?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{x(c,"growth")===ht.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};Xv.instanceID=Math.floor(Math.random()*99999999999);let Le=Xv;class Hn extends xt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||ug.default.size}px`).style("height",`${this.configs.size||ug.default.size}px`).attr("opacity",0)}}var wD={prefix:"bx",selectorTabbable:`
13
+ <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=x(i,"locale","translations","toolbar");let p;switch(t){case Ct.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Ct.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Ct.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Ct.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Ct.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Ct.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case Ct.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Ct.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Ct.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case Ct.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Ct.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Ct.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ct.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Ct.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case Ct.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Ct.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ct.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Ct.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Yv.buttonID=0;let Ho=Yv;const Zv=class j0 extends xt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=j0.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=x(r,"growth");return i===ht.PREFERRED||i===ht.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>x(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=N.getHTMLElementSize(n.node()),s=this.configs.direction===Pt.ROW||this.configs.direction===Pt.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${_e}--${a}--layout-row`,this.configs.direction===Pt.ROW).classed(`${_e}--${a}--layout-row-reverse`,this.configs.direction===Pt.ROW_REVERSE).classed(`${_e}--${a}--layout-column`,this.configs.direction===Pt.COLUMN).classed(`${_e}--${a}--layout-column-reverse`,this.configs.direction===Pt.COLUMN_REVERSE).classed(`${_e}--${a}--layout-alignitems-center`,this.configs.alignItems===ir.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const d=D(this),h=x(c,"renderType")===rt.SVG;u.setParent(h?N.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const f=x(c,"growth");(f===ht.PREFERRED||f===ht.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=x(c,"growth"),d=x(c,"renderType")===rt.SVG?N.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(u===ht.PREFERRED){const h=s?d.width:d.height,f=s?r:i;c.size=h/f*100}}),o.exit().remove(),this.children.filter(c=>x(c,"growth")===ht.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);s?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{x(c,"growth")===ht.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};Zv.instanceID=Math.floor(Math.random()*99999999999);let ke=Zv;class Hn extends xt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||ug.default.size}px`).style("height",`${this.configs.size||ug.default.size}px`).attr("opacity",0)}}var wD={prefix:"bx",selectorTabbable:`
16
16
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
17
17
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
18
18
  textarea:not([disabled]):not([tabindex='-1']),
@@ -22,15 +22,15 @@
22
22
  button:not([disabled]),select:not([disabled]),
23
23
  textarea:not([disabled]),
24
24
  iframe, object, embed, *[tabindex], *[contenteditable=true]
25
- `},Hu=wD;function SD(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function OD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TD(e){return $D(e)||AD(e)||CD(e)||MD()}function MD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CD(e,t){if(e){if(typeof e=="string")return Vu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vu(e,t)}}function AD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $D(e){if(Array.isArray(e))return Vu(e)}function Vu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,TD(Zv(n))):t.push(n),t},[])}function RD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zv(t).reduce(function(r,i){return i(r)},function(){function r(){OD(this,r)}return SD(r)}())}function Fu(e){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fu(e)}function LD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kD(e,t,n){return t&&Kv(e.prototype,t),n&&Kv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zu(e,t)}function zu(e,t){return zu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},zu(e,t)}function ID(e){var t=PD();return function(){var n=Uo(e),r;if(t){var i=Uo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ND(this,r)}}function ND(e,t){if(t&&(Fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qv(e)}function Qv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(e)}function UD(e){var t=function(n){DD(i,n);var r=ID(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(LD(this,i),a=r.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,Qv(a)),a}return kD(i,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),i}(e);return t}function Gu(e){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gu(e)}function BD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VD(e,t,n){return t&&HD(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bo(){return typeof Reflect<"u"&&Reflect.get?Bo=Reflect.get:Bo=function(e,t,n){var r=FD(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Bo.apply(this,arguments)}function FD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=mi(e),e!==null););return e}function zD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ju(e,t)}function ju(e,t){return ju=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},ju(e,t)}function GD(e){var t=qD();return function(){var n=mi(e),r;if(t){var i=mi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jD(this,r)}}function jD(e,t){if(t&&(Gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WD(e)}function WD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mi(e){return mi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mi(e)}function YD(e){var t=function(n){zD(i,n);var r=GD(i);function i(){var s;BD(this,i);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return s=r.call.apply(r,[this].concat(o)),s.handles=new Set,s}return VD(i,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),Bo(mi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function Wu(e){"@babel/helpers - typeof";return Wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(e)}function XD(e){return JD(e)||QD(e)||KD(e)||ZD()}function ZD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KD(e,t){if(e){if(typeof e=="string")return qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qu(e,t)}}function QD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JD(e){if(Array.isArray(e))return qu(e)}function qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nI(e,t,n){return t&&eI(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yu(e,t)}function Yu(e,t){return Yu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Yu(e,t)}function iI(e){var t=oI();return function(){var n=Ho(e),r;if(t){var i=Ho(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return sI(this,r)}}function sI(e,t){if(t&&(Wu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aI(e)}function aI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ho(e)}function lI(e){var t=function(n){rI(i,n);var r=iI(i);function i(){return tI(this,i),r.apply(this,arguments)}return nI(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,d=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){d&&d(null,!0);return}var h={group:u&&u.group,state:c},f=[h.group,c].filter(Boolean).join("-").split("-").map(function(b){return b[0].toUpperCase()+b.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),v=u&&u.delegatorNode||this.element,m=!v.dispatchEvent(p);if(m){if(d){var y=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));y.canceled=!0,d(y)}}else{var g=[c,u].filter(Boolean);this._changeState.apply(this,XD(g).concat([function(){v.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function Xu(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function Jv(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function Zu(e){"@babel/helpers - typeof";return Zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(e)}function cI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hI(e,t,n){return t&&uI(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ku(e,t)}function Ku(e,t){return Ku=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Ku(e,t)}function fI(e){var t=gI();return function(){var n=Vo(e),r;if(t){var i=Vo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pI(this,r)}}function pI(e,t){if(t&&(Zu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mI(e)}function mI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(e)}function vI(e){var t=function(n){dI(i,n);var r=fI(i);function i(){return cI(this,i),r.apply(this,arguments)}return hI(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Jv(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Jv(s),a)}}]),i}(e);return t}var yI=[lI,vI];function xI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t0=function(){};process.env.NODE_ENV!=="production"&&(t0=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var bI=t0;const EI=xI(bI);function Qu(e){"@babel/helpers - typeof";return Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(e)}function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SI(e,t,n){return n&&wI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ju(e,t)}function Ju(e,t){return Ju=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Ju(e,t)}function TI(e){var t=AI();return function(){var n=Fo(e),r;if(t){var i=Fo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return MI(this,r)}}function MI(e,t){if(t&&(Qu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CI(e)}function CI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fo(e){return Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Fo(e)}function $I(e){var t=function(n){OI(i,n);var r=TI(i);function i(){return _I(this,i),r.apply(this,arguments)}return SI(i,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return Ls(a,u,function(d){var h=Xu(d,"[".concat(l.attribInitTarget,"]"));if(h){d.delegateTarget=h;var f=h.ownerDocument.querySelectorAll(h.getAttribute(l.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){h.tagName==="A"&&d.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(d)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function RI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function LI(e,t,n){return t&&e0(e.prototype,t),n&&e0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eh(e,t)}function eh(e,t){return eh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},eh(e,t)}function DI(e){var t=PI();return function(){var n=zo(e),r;if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return II(this,r)}}function II(e,t){if(t&&(th(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NI(e)}function NI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},zo(e)}var UI=function(e){kI(n,e);var t=DI(n);function n(r,i){var s;return RI(this,n),s=t.call(this,r,i),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(l){return!Xu(a,l)})&&s.element.querySelector(Hu.selectorTabbable).focus()},s._hookCloseActions(),s}return LI(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,s){var a=this,o,l=function(){if(o&&(o=a.unmanage(o).release()),r==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var d=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(Hu.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&EI(d,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ls(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ls(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ls(this.element,"click",function(i){var s=Xu(i,r.options.selectorModalClose);s&&(i.delegateTarget=s),(s||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ls(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=Hu.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(RD(UD,$I,yI,YD));class Go extends xt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),UI.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=x(n,"locale","translations","tabularRep"),s=x(n,"style","prefix"),a=this.model.getTabularDataArray();return`
25
+ `},ih=wD;function SD(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function TD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OD(e){return $D(e)||AD(e)||CD(e)||MD()}function MD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CD(e,t){if(e){if(typeof e=="string")return sh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sh(e,t)}}function AD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $D(e){if(Array.isArray(e))return sh(e)}function sh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,OD(Xv(n))):t.push(n),t},[])}function LD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Xv(t).reduce(function(r,i){return i(r)},function(){function r(){TD(this,r)}return SD(r)}())}function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function RD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kD(e,t,n){return t&&Kv(e.prototype,t),n&&Kv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oh(e,t)}function oh(e,t){return oh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},oh(e,t)}function ID(e){var t=PD();return function(){var n=Vo(e),r;if(t){var i=Vo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ND(this,r)}}function ND(e,t){if(t&&(ah(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qv(e)}function Qv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(e)}function UD(e){var t=function(n){DD(i,n);var r=ID(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(RD(this,i),a=r.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,Qv(a)),a}return kD(i,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),i}(e);return t}function lh(e){"@babel/helpers - typeof";return lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lh(e)}function BD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VD(e,t,n){return t&&HD(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(){return typeof Reflect<"u"&&Reflect.get?Fo=Reflect.get:Fo=function(e,t,n){var r=FD(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Fo.apply(this,arguments)}function FD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=xi(e),e!==null););return e}function zD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ch(e,t)}function ch(e,t){return ch=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},ch(e,t)}function GD(e){var t=qD();return function(){var n=xi(e),r;if(t){var i=xi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jD(this,r)}}function jD(e,t){if(t&&(lh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WD(e)}function WD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xi(e){return xi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},xi(e)}function YD(e){var t=function(n){zD(i,n);var r=GD(i);function i(){var s;BD(this,i);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return s=r.call.apply(r,[this].concat(o)),s.handles=new Set,s}return VD(i,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),Fo(xi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ps(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function ZD(e){return JD(e)||QD(e)||KD(e)||XD()}function XD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KD(e,t){if(e){if(typeof e=="string")return hh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hh(e,t)}}function QD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JD(e){if(Array.isArray(e))return hh(e)}function hh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nI(e,t,n){return t&&eI(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dh(e,t)}function dh(e,t){return dh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},dh(e,t)}function iI(e){var t=oI();return function(){var n=zo(e),r;if(t){var i=zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return sI(this,r)}}function sI(e,t){if(t&&(uh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aI(e)}function aI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},zo(e)}function lI(e){var t=function(n){rI(i,n);var r=iI(i);function i(){return tI(this,i),r.apply(this,arguments)}return nI(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,d=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){d&&d(null,!0);return}var h={group:u&&u.group,state:c},f=[h.group,c].filter(Boolean).join("-").split("-").map(function(b){return b[0].toUpperCase()+b.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),v=u&&u.delegatorNode||this.element,m=!v.dispatchEvent(p);if(m){if(d){var y=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));y.canceled=!0,d(y)}}else{var g=[c,u].filter(Boolean);this._changeState.apply(this,ZD(g).concat([function(){v.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function fh(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function Jv(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function cI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hI(e,t,n){return t&&uI(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mh(e,t)}function mh(e,t){return mh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},mh(e,t)}function fI(e){var t=gI();return function(){var n=Go(e),r;if(t){var i=Go(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pI(this,r)}}function pI(e,t){if(t&&(ph(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mI(e)}function mI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Go(e)}function vI(e){var t=function(n){dI(i,n);var r=fI(i);function i(){return cI(this,i),r.apply(this,arguments)}return hI(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Jv(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Jv(s),a)}}]),i}(e);return t}var yI=[lI,vI];function xI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t0=function(){};process.env.NODE_ENV!=="production"&&(t0=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var bI=t0;const EI=xI(bI);function gh(e){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gh(e)}function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SI(e,t,n){return n&&wI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vh(e,t)}function vh(e,t){return vh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},vh(e,t)}function OI(e){var t=AI();return function(){var n=jo(e),r;if(t){var i=jo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return MI(this,r)}}function MI(e,t){if(t&&(gh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CI(e)}function CI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jo(e){return jo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jo(e)}function $I(e){var t=function(n){TI(i,n);var r=OI(i);function i(){return _I(this,i),r.apply(this,arguments)}return SI(i,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return Ps(a,u,function(d){var h=fh(d,"[".concat(l.attribInitTarget,"]"));if(h){d.delegateTarget=h;var f=h.ownerDocument.querySelectorAll(h.getAttribute(l.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){h.tagName==="A"&&d.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(d)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function yh(e){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(e)}function LI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function RI(e,t,n){return t&&e0(e.prototype,t),n&&e0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xh(e,t)}function xh(e,t){return xh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},xh(e,t)}function DI(e){var t=PI();return function(){var n=Wo(e),r;if(t){var i=Wo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return II(this,r)}}function II(e,t){if(t&&(yh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NI(e)}function NI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Wo(e)}var UI=function(e){kI(n,e);var t=DI(n);function n(r,i){var s;return LI(this,n),s=t.call(this,r,i),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(l){return!fh(a,l)})&&s.element.querySelector(ih.selectorTabbable).focus()},s._hookCloseActions(),s}return RI(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,s){var a=this,o,l=function(){if(o&&(o=a.unmanage(o).release()),r==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var d=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(ih.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&EI(d,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ps(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ps(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ps(this.element,"click",function(i){var s=fh(i,r.options.selectorModalClose);s&&(i.delegateTarget=s),(s||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ps(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=ih.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(LD(UD,$I,yI,YD));class qo extends xt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),UI.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(T.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(T.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=x(n,"locale","translations","tabularRep"),s=x(n,"style","prefix"),a=this.model.getTabularDataArray();return`
28
28
  <div class="cds--modal-container">
29
29
  <div class="cds--modal-header">
30
30
 
31
31
  <p class="cds--modal-header__label cds--type-delta" id="modal-title">${r}</p>
32
32
 
33
- <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${pn(n.title)}</p>
33
+ <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${vn(n.title)}</p>
34
34
 
35
35
  <button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>
36
36
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">
@@ -44,14 +44,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
44
44
  <thead>
45
45
  <tr>
46
46
  ${_t(a,0).map(o=>`<th scope="col">
47
- <div class="cds--table-header-label">${pn(o)}</div>
47
+ <div class="cds--table-header-label">${vn(o)}</div>
48
48
  </th>`).join("")}
49
49
  </tr>
50
50
  </thead>
51
51
 
52
52
  <tbody>${a.slice(1).map(o=>`
53
53
  <tr>
54
- ${o.map(l=>`<td>${pn(l)}</td>`).join("")}
54
+ ${o.map(l=>`<td>${vn(l)}</td>`).join("")}
55
55
  </tr>`).join("")}
56
56
  </tbody>
57
57
  </table>
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
61
61
  <div class="${_e}--${s}-modal-footer-spacer"></div>
62
62
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
63
63
  </div>
64
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${_e}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class ks extends xt{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=x(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>pn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class nh extends xt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=x(n,"legend"),i=x(r,"alignment"),s=x(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Yt.items.status,l=a.some(g=>g.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Qt.CENTER).classed("right-aligned",i===Qt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",dt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,g=>g.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Yt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",dt.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(g,b)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b}-title`)).attr("aria-checked",({status:g})=>g===Yt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",g=>this.model.getColorClassName({classNameTypes:[at.BACKGROUND],dataGroupName:g.name,originalClassName:"checkbox"})).style("background",g=>g.status===Yt.items.status.ACTIVE?this.model.getFillColor(g.name)||this.model.getStrokeColor(g.name):null).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});v.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const y=x(n,"legend","additionalItems");if(y&&a.length){const g=this,b=u.selectAll("div.additional-item").data(y);b.exit().remove();const w=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(R,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+I}-title`));w.selectAll("*").remove();let _,S=1;w.append("svg").classed("icon",!0).each(function(R){const I=D(this);!_||_!=R.type?(_=R.type,S=1):S++,g.addAdditionalItem(I,R,S)}),w.append("p").merge(w.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Yt.area;if(n.type===ne.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===ne.RADIUS){const{iconData:a,fill:o,stroke:l}=Yt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",dt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===ne.LINE){const a=Yt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",dt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===ne.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",dt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Yt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===ne.SIZE){const{iconData:a,fill:o,stroke:l}=Yt.size;t.attr("fill","none").attr("role",dt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===ne.QUARTILE){const{iconData:a}=Yt.quartile;t.selectAll("rect").attr("role",dt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===ne.ZOOM){const{iconData:a,color:o}=x(Yt,"zoom"),l=t.attr("role",dt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=x(this.getOptions(),"legend","truncation"),r=x(n,"type"),i=x(n,"threshold"),s=x(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==je.NONE?a.html(function(o){const l=pn(o.name);return l.length>i&&l.length!==s?Ss(l,r,s):l}):a.html(o=>pn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=x(r,"legend"),s=x(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==je.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==je.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==je.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class n0 extends xt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class BI extends n0{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var gi,Kt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Kt||(Kt={}));var r0=(gi={},gi[Kt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},gi[Kt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},gi[Kt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},gi[Kt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},gi),i0=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},jo=function(){function e(t){t===void 0&&(t={}),this.positions=r0,this.positions=Object.assign({},r0,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,v=d*h,m=p-v,y=m/p;return{placement:l,weight:y}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:i0.innerHeight,width:i0.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new jo;class rh extends xt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new jo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items;let a;const o=this.formatItems(this.getItems(i));i.detail.content?a=`<div class="title-tooltip"><p>${No(i.detail.content)}</p></div>`:a=No(this.getTooltipHTML(o));const l=N.appendOrSelect(this.tooltip,"div.content-box");if(x(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${No(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${No(this.model.getOptions().tooltip.customHTML(s,a))}</p></div>`);else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const d=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==O.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=x(n,"tooltip","truncation","type"),i=x(n,"tooltip","truncation","threshold"),s=x(n,"tooltip","truncation","numCharacter");return r!==je.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=Ss(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Ss(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
64
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${_e}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Us extends xt{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=x(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>vn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class bh extends xt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=x(n,"legend"),i=x(r,"alignment"),s=x(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Yt.items.status,l=a.some(g=>g.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Jt.CENTER).classed("right-aligned",i===Jt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",dt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,g=>g.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Yt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",dt.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(g,b)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b}-title`)).attr("aria-checked",({status:g})=>g===Yt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",g=>this.model.getColorClassName({classNameTypes:[at.BACKGROUND],dataGroupName:g.name,originalClassName:"checkbox"})).style("background",g=>g.status===Yt.items.status.ACTIVE?this.model.getFillColor(g.name)||this.model.getStrokeColor(g.name):null).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});v.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const y=x(n,"legend","additionalItems");if(y&&a.length){const g=this,b=u.selectAll("div.additional-item").data(y);b.exit().remove();const w=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(L,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+I}-title`));w.selectAll("*").remove();let _,S=1;w.append("svg").classed("icon",!0).each(function(L){const I=D(this);!_||_!=L.type?(_=L.type,S=1):S++,g.addAdditionalItem(I,L,S)}),w.append("p").merge(w.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Yt.area;if(n.type===ee.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===ee.RADIUS){const{iconData:a,fill:o,stroke:l}=Yt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",dt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===ee.LINE){const a=Yt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",dt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===ee.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",dt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Yt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===ee.SIZE){const{iconData:a,fill:o,stroke:l}=Yt.size;t.attr("fill","none").attr("role",dt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===ee.QUARTILE){const{iconData:a}=Yt.quartile;t.selectAll("rect").attr("role",dt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===ee.ZOOM){const{iconData:a,color:o}=x(Yt,"zoom"),l=t.attr("role",dt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=x(this.getOptions(),"legend","truncation"),r=x(n,"type"),i=x(n,"threshold"),s=x(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Pe.NONE?a.html(function(o){const l=vn(o.name);return l.length>i&&l.length!==s?As(l,r,s):l}):a.html(o=>vn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=x(r,"legend"),s=x(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:D(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class n0 extends xt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class BI extends n0{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var bi,Kt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Kt||(Kt={}));var r0=(bi={},bi[Kt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},bi[Kt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},bi[Kt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},bi[Kt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},bi),i0=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Yo=function(){function e(t){t===void 0&&(t={}),this.positions=r0,this.positions=Object.assign({},r0,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,v=d*h,m=p-v,y=m/p;return{placement:l,weight:y}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:i0.innerHeight,width:i0.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new Yo;class Eh extends xt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Yo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items;let a;const o=this.formatItems(this.getItems(i));i.detail.content?a=`<div class="title-tooltip"><p>${Bo(i.detail.content)}</p></div>`:a=Bo(this.getTooltipHTML(o));const l=N.appendOrSelect(this.tooltip,"div.content-box");if(x(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${Bo(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${Bo(this.model.getOptions().tooltip.customHTML(s,a))}</p></div>`);else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const d=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=x(n,"tooltip","truncation","type"),i=x(n,"tooltip","truncation","threshold"),s=x(n,"tooltip","truncation","numCharacter");return r!==Pe.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=As(a.label,r,s)),a.value&&a.value.length>i&&(a.value=As(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
65
65
  <div class="datapoint-tooltip${n.bold?" bold":""}">
66
66
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
67
67
  <div class="label">
@@ -70,19 +70,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
70
70
  </div>
71
71
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
72
72
  </div>
73
- </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=x(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=x(r,"locale");if(i)return i(t,n);if(typeof t.getTime=="function")return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=x(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${_e}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Kt.LEFT?i.left-=r:n==Kt.RIGHT?i.left+=r:n==Kt.TOP?i.top-=r:n==Kt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=x(a,"zoomBar","top","enabled"),l=!!x(t,"detail","noWrap"),c=Array.isArray(x(t,"detail","placements")),u=c?x(t,"detail","placements"):[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.BOTTOM];let d,{horizontalOffset:h,defaultOffset:f}=G2;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=x(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,s,u,()=>({top:0,left:0,width:r,height:i}));let g=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));g=this.addOffsetByPlacement(g,d,f),this.positionService.setElement(s,g);return}let p=x(t,"detail","mousePosition");if(!p)p=or(x(t,"detail","event"),n);else{const m=x(a,"zoomBar","top","type"),y=Ae.height[m];o&&(p[1]+=y+Ae.spacerHeight)}p[0]/r>.9?d=Kt.LEFT:p[0]/r<.1?d=Kt.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Kt.LEFT&&(h*=-1);const v=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,v)}}const s0=class rl extends xt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.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=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===et.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const v=_=>{const S=_[1]-_[0];let R="0,"+S.toString();const I=Math.floor(l/rl.DASH_LENGTH),k=I*rl.DASH_LENGTH;for(let L=0;L<I;L++)R+=","+rl.DASH_LENGTH;R+=","+(l-k),I%2===1&&(R+=",0"),R+=","+S.toString(),R+=","+l.toString(),f.attr("stroke-dasharray",R)},m=_=>{const S=_.selection;S===null||S[0]===S[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),v(S))},y=(_,S)=>{const R=Ap().range([0,o]).domain(p);let I=[R.invert(_),R.invert(S)];I[0].valueOf()===I[1].valueOf()&&(I=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==I[0].valueOf()||p[1].valueOf()!==I[1].valueOf())&&this.services.zoom.handleDomainChange(I)};let g;const b=_=>{const S=_.selection;S!==null&&(y(S[0],S[1]),s.call(g.move,null),f.style("display","none"))};l!=0&&o!=0&&(g=qd().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",b),s.call(g));const w=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const S=this.services.domUtils.getHolder(),R=or(s.node(),S)[0];let I=R-o*w/2;I<0&&(I=0);let k=R+o*w/2;k>o&&(k=o),y(I,k)}})}}};s0.DASH_LENGTH=4;let HI=s0;class VI extends xt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=qd(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",F.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(F.TOP),i=this.services.zoom.isZoomBarLocked(F.TOP),s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=x(this.getOptions(),"axes",F.BOTTOM,"highlights"),o=Ae.height[s],{width:l}=N.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=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Ae.spacerHeight).attr("opacity",1).attr("fill","none"),s===an.GRAPH_VIEW?N.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===an.SLIDER_VIEW&&N.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(),v=h.getMainXScaleType();if(f&&v===et.TIME){let m=this.services.zoom.getZoomBarData();if(Je(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const g=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",F.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(g&&g[0].valueOf()===b[0].valueOf()&&g[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:lt([],b),zoomDomain:b?lt([],b):y},{skipUpdate:!0}):b===null&&g!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(We(m,S=>S.value));const w=this.model.get("zoomDomain");if(s===an.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 S=a.highlightStartMapsTo,R=a.highlightEndMapsTo,I=a.color,k=a.labelMapsTo;a.data.forEach((L,M)=>{N.appendOrSelect(d,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[S])).attr("width",this.xScale(L[R])-this.xScale(L[S])).style("fill",I&&I.scale[L[k]]?I.scale[L[k]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[L[k]]?I.scale[L[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(w,c,l);const _=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(w!==void 0)if(w[0].valueOf()===w[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=w.map(R=>this.xScale(R));S[1]-S[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),_.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=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=Ae.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=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Ae.handleWidth,s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=Ae.height[s],o=-i/2,l=Ae.handleBarWidth,c=s===an.GRAPH_VIEW?Ae.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,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===an.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",F.TOP,"type"),r=Ae.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"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=(y,g,b)=>w=>s.getValueFromScale(y,g,b,w),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",F.TOP,"type"),p=Ae.height[f],v=Dc().x(y=>d(y)).y0(p).y1(y=>p-h(y)),m=N.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.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=kn(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=x(this.model.getOptions(),"zoomBar",F.TOP,"type"),a=Ae.height[s],o=ss()([[n,a],[r,a]]);N.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),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),x(this.getOptions(),"zoomBar",F.TOP,"type")===an.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class FI extends xt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new jo}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(F).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,f=null;c===F.LEFT||c===F.RIGHT?(f=u,h=l.services.cartesianScales.getMainXScale()):(h=u,f=l.services.cartesianScales.getMainYScale());const p=d===et.LABELS,[v,m]=h.range(),[y,g]=f.range(),{cartesianScales:b}=l.services,w=b.getOrientation(),_=L=>b.getDomainValue(L),S=L=>b.getRangeValue(L),[R,I]=Pn(_,S,w),k=D(this);c===F.TOP||c===F.BOTTOM?(k.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",g).attr("y2",y).attr("x1",({datum:L})=>R(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>R(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),k.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-R(L)).attr("width",Math.abs(y-g)).classed("rotate",!0)):(k.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",v).attr("x2",m).attr("y1",({datum:L})=>I(L)+(p?u.step()/2:0)).attr("y2",({datum:L})=>I(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),k.selectAll("rect.threshold-hoverable-area").attr("x",v).attr("y",({datum:L})=>I(L)).attr("width",Math.abs(m-v)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.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}=x(i,"locale");if(s===et.TIME){const l=[F.LEFT,F.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=x(i,"timeScale"),f=xu(d.ticks(),x(h,"timeInterval"));return yu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${_e}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=or(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(pn(`${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,[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.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=x(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(n){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class zI extends xt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new jo,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(F).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,f]=u.range(),[p,v]=d.range(),{cartesianScales:m}=l.services,y=m.getOrientation(),g=R=>m.getDomainValue(R),b=R=>m.getRangeValue(R),[w,_]=Pn(g,b,y),S=D(this);c===F.TOP||c===F.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:t})).attr("y",Math.max(v+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:R,...I})=>w(I[R])).attr("width",({highlightStartMapsTo:R,highlightEndMapsTo:I,...k})=>Math.max(w(k[I])-w(k[R]),0)).style("stroke",({color:R,labelMapsTo:I,...k})=>R&&R.scale[k[I]]?R.scale[k[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:I,...k})=>R&&R.scale[k[I]]?R.scale[k[I]]:null):S.selectAll("rect.highlight-bar").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(f-h,0)).attr("y",({highlightEndMapsTo:R,...I})=>_(I[R])).attr("height",({highlightStartMapsTo:R,highlightEndMapsTo:I,...k})=>Math.max(_(k[R])-_(k[I]),0)).style("stroke",({color:R,labelMapsTo:I,...k})=>R&&R.scale[k[I]]?R.scale[k[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:I,...k})=>R&&R.scale[k[I]]?R.scale[k[I]]:null)})}}class a0 extends rh{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 v=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(v)}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(v=>d.push({label:v.label,value:v.value})),d.push({label:_t(r,"locale.translations.group")||_t(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[at.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:[at.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:_t(r,"locale.translations.total")||_t(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class GI extends xt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(this.getOptions(),"color","gradient","enabled");let l=tn.minNodePadding;s.alluvial.nodePadding>tn.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=rv;c===Qt.LEFT?u=EL:c===Qt.RIGHT&&(u=_L);const d=TL().nodeId(g=>g.name).nodeWidth(tn.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const h={};this.graph.nodes.forEach(g=>{const b=g.x0;g.category&&(h[b]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,b)=>this.services.domUtils.generateElementIDString(`alluvial-category-${b}`)).style("font-size","14px").text(g=>h[g]?h[g]:"").attr("y",20).attr("x",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-category-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0});let S=0;return g+S>=_&&(S=-_+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",b=>`${this.gradient_id}-link-${b.index}`).attr("gradientUnits","userSpaceOnUse").call(b=>b.append("stop").attr("offset","0%").attr("stop-color",w=>g[w.source.name])).call(b=>b.append("stop").attr("offset","100%").attr("stop-color",w=>g[w.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",UL()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name,null,{...g,source:g.source.name,target:g.target.name})).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",tn.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const v=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`)),{code:m,number:y}=x(s,"locale");v.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${y(g.value,m)})`).attr("aria-label",g=>`${g.name} (${g.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let R=g.x1-g.x0;return g.x1>=_?R=R-(_+16):R+=4,`translate(${R}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=x(this.getOptions(),"locale"),s=wo((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(D(a).lower(),l.style("stroke-opacity",tn.opacity.default)):l.style("stroke-opacity",function(){return a===this?(D(this).raise(),tn.opacity.selected):tn.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=D(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:a,element:D(this),datum:o}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:a,element:D(this),datum:o})}).on("mouseout",function(a,o){const l=D(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=wo((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",tn.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(D(this).classed("link-hovered",!0).raise(),tn.opacity.selected):tn.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ws(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ws(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=ws(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",tn.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ws(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
73
+ </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=x(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=x(r,"locale");if(i)return i(t,n);if(typeof t.getTime=="function")return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=x(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${_e}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Kt.LEFT?i.left-=r:n==Kt.RIGHT?i.left+=r:n==Kt.TOP?i.top-=r:n==Kt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=x(a,"zoomBar","top","enabled"),l=!!x(t,"detail","noWrap"),c=Array.isArray(x(t,"detail","placements")),u=c?x(t,"detail","placements"):[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.BOTTOM];let d,{horizontalOffset:h,defaultOffset:f}=G2;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=x(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,s,u,()=>({top:0,left:0,width:r,height:i}));let g=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));g=this.addOffsetByPlacement(g,d,f),this.positionService.setElement(s,g);return}let p=x(t,"detail","mousePosition");if(!p)p=cr(x(t,"detail","event"),n);else{const m=x(a,"zoomBar","top","type"),y=$e.height[m];o&&(p[1]+=y+$e.spacerHeight)}p[0]/r>.9?d=Kt.LEFT:p[0]/r<.1?d=Kt.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Kt.LEFT&&(h*=-1);const v=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,v)}}const s0=class al extends xt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.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=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===et.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const v=_=>{const S=_[1]-_[0];let L="0,"+S.toString();const I=Math.floor(l/al.DASH_LENGTH),k=I*al.DASH_LENGTH;for(let R=0;R<I;R++)L+=","+al.DASH_LENGTH;L+=","+(l-k),I%2===1&&(L+=",0"),L+=","+S.toString(),L+=","+l.toString(),f.attr("stroke-dasharray",L)},m=_=>{const S=_.selection;S===null||S[0]===S[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),v(S))},y=(_,S)=>{const L=Ap().range([0,o]).domain(p);let I=[L.invert(_),L.invert(S)];I[0].valueOf()===I[1].valueOf()&&(I=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==I[0].valueOf()||p[1].valueOf()!==I[1].valueOf())&&this.services.zoom.handleDomainChange(I)};let g;const b=_=>{const S=_.selection;S!==null&&(y(S[0],S[1]),s.call(g.move,null),f.style("display","none"))};l!=0&&o!=0&&(g=qd().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",b),s.call(g));const w=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const S=this.services.domUtils.getHolder(),L=cr(s.node(),S)[0];let I=L-o*w/2;I<0&&(I=0);let k=L+o*w/2;k>o&&(k=o),y(I,k)}})}}};s0.DASH_LENGTH=4;let HI=s0;class VI extends xt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=qd(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=x(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=$e.height[s],{width:l}=N.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=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",$e.spacerHeight).attr("opacity",1).attr("fill","none"),s===We.GRAPH_VIEW?N.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===We.SLIDER_VIEW&&N.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(),v=h.getMainXScaleType();if(f&&v===et.TIME){let m=this.services.zoom.getZoomBarData();if(tn(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const g=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(g&&g[0].valueOf()===b[0].valueOf()&&g[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:lt([],b),zoomDomain:b?lt([],b):y},{skipUpdate:!0}):b===null&&g!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(qe(m,S=>S.value));const w=this.model.get("zoomDomain");if(s===We.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 S=a.highlightStartMapsTo,L=a.highlightEndMapsTo,I=a.color,k=a.labelMapsTo;a.data.forEach((R,M)=>{N.appendOrSelect(d,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[S])).attr("width",this.xScale(R[L])-this.xScale(R[S])).style("fill",I&&I.scale[R[k]]?I.scale[R[k]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[R[k]]?I.scale[R[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(w,c,l);const _=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(w!==void 0)if(w[0].valueOf()===w[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=w.map(L=>this.xScale(L));S[1]-S[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),_.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=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=$e.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=$e.handleWidth,s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=$e.height[s],o=-i/2,l=$e.handleBarWidth,c=s===We.GRAPH_VIEW?$e.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,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===We.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",z.TOP,"type"),r=$e.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"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=(y,g,b)=>w=>s.getValueFromScale(y,g,b,w),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",z.TOP,"type"),p=$e.height[f],v=Qc().x(y=>d(y)).y0(p).y1(y=>p-h(y)),m=N.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.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=kn(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=x(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=$e.height[s],o=us()([[n,a],[r,a]]);N.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),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),x(this.getOptions(),"zoomBar",z.TOP,"type")===We.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 FI extends xt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Yo}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,f=null;c===z.LEFT||c===z.RIGHT?(f=u,h=l.services.cartesianScales.getMainXScale()):(h=u,f=l.services.cartesianScales.getMainYScale());const p=d===et.LABELS,[v,m]=h.range(),[y,g]=f.range(),{cartesianScales:b}=l.services,w=b.getOrientation(),_=R=>b.getDomainValue(R),S=R=>b.getRangeValue(R),[L,I]=Pn(_,S,w),k=D(this);c===z.TOP||c===z.BOTTOM?(k.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",g).attr("y2",y).attr("x1",({datum:R})=>L(R)+(p?u.step()/2:0)).attr("x2",({datum:R})=>L(R)+(p?u.step()/2:0)).style("stroke",({fillColor:R})=>R),k.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-L(R)).attr("width",Math.abs(y-g)).classed("rotate",!0)):(k.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",v).attr("x2",m).attr("y1",({datum:R})=>I(R)+(p?u.step()/2:0)).attr("y2",({datum:R})=>I(R)+(p?u.step()/2:0)).style("stroke",({fillColor:R})=>R),k.selectAll("rect.threshold-hoverable-area").attr("x",v).attr("y",({datum:R})=>I(R)).attr("width",Math.abs(m-v)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.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}=x(i,"locale");if(s===et.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=x(i,"timeScale"),f=Pu(d.ticks(),x(h,"timeInterval"));return Nu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${_e}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=cr(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(vn(`${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,[Kt.RIGHT,Kt.LEFT,Kt.TOP,Kt.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=x(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(n){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class zI extends xt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Yo,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,f]=u.range(),[p,v]=d.range(),{cartesianScales:m}=l.services,y=m.getOrientation(),g=L=>m.getDomainValue(L),b=L=>m.getRangeValue(L),[w,_]=Pn(g,b,y),S=D(this);c===z.TOP||c===z.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"highlight-bar-update",animate:t})).attr("y",Math.max(v+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:L,...I})=>w(I[L])).attr("width",({highlightStartMapsTo:L,highlightEndMapsTo:I,...k})=>Math.max(w(k[I])-w(k[L]),0)).style("stroke",({color:L,labelMapsTo:I,...k})=>L&&L.scale[k[I]]?L.scale[k[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:L,labelMapsTo:I,...k})=>L&&L.scale[k[I]]?L.scale[k[I]]:null):S.selectAll("rect.highlight-bar").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(f-h,0)).attr("y",({highlightEndMapsTo:L,...I})=>_(I[L])).attr("height",({highlightStartMapsTo:L,highlightEndMapsTo:I,...k})=>Math.max(_(k[L])-_(k[I]),0)).style("stroke",({color:L,labelMapsTo:I,...k})=>L&&L.scale[k[I]]?L.scale[k[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:L,labelMapsTo:I,...k})=>L&&L.scale[k[I]]?L.scale[k[I]]:null)})}}class a0 extends Eh{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 v=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(v)}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(v=>d.push({label:v.label,value:v.value})),d.push({label:_t(r,"locale.translations.group")||_t(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[at.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:[at.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:_t(r,"locale.translations.total")||_t(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class GI extends xt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(this.getOptions(),"color","gradient","enabled");let l=en.minNodePadding;s.alluvial.nodePadding>en.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=rv;c===Jt.LEFT?u=ER:c===Jt.RIGHT&&(u=_R);const d=OR().nodeId(g=>g.name).nodeWidth(en.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const h={};this.graph.nodes.forEach(g=>{const b=g.x0;g.category&&(h[b]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,b)=>this.services.domUtils.generateElementIDString(`alluvial-category-${b}`)).style("font-size","14px").text(g=>h[g]?h[g]:"").attr("y",20).attr("x",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-category-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0});let S=0;return g+S>=_&&(S=-_+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",b=>`${this.gradient_id}-link-${b.index}`).attr("gradientUnits","userSpaceOnUse").call(b=>b.append("stop").attr("offset","0%").attr("stop-color",w=>g[w.source.name])).call(b=>b.append("stop").attr("offset","100%").attr("stop-color",w=>g[w.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",UR()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name,null,{...g,source:g.source.name,target:g.target.name})).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",en.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const v=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`)),{code:m,number:y}=x(s,"locale");v.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${y(g.value,m)})`).attr("aria-label",g=>`${g.name} (${g.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(g,b)=>{const w=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=N.getSVGElementSize(D(`text#${w}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let L=g.x1-g.x0;return g.x1>=_?L=L-(_+16):L+=4,`translate(${L}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=x(this.getOptions(),"locale"),s=Oo((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(D(a).lower(),l.style("stroke-opacity",en.opacity.default)):l.style("stroke-opacity",function(){return a===this?(D(this).raise(),en.opacity.selected):en.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=D(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:D(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:D(this),datum:o})}).on("mouseout",function(a,o){const l=D(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Oo((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",en.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(D(this).classed("link-hovered",!0).raise(),en.opacity.selected):en.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Cs(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=Cs(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=Cs(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",en.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Cs(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
74
74
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
75
75
  <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"/>
76
76
  <rect width="32" height="32"/>
77
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class ke extends xt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.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=pl(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Qh(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Nn(u).tx)-Number(Nn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Nn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Nn(o).tx;else if(o)l=+Nn(o).tx-+Nn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+Nn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Nn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.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=N.appendOrSelect(r,"svg.chart-grid-backdrop");const u=N.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 o0 extends xt{constructor(){super(...arguments),this.type="area",this.renderType=rt.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?Dn.opacity.unselected:Dn.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",Dn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Dc().curve(this.services.curves.getD3Curve()).defined(_=>{const S=s.getRangeIdentifier();return _[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(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=(_,S)=>{x(r,"axes",_,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(d),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===te.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const v=x(r,"color","gradient","enabled"),m=l&&l.length===1&&v;l.length>1&&v&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(l,_=>_.name),g=D(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const _=g.select(`path.${this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:l[0].name})}`).node();let S;if(_)S=getComputedStyle(_,null).getPropertyValue("stroke");else{const R=x(this.model.getOptions(),"color","scale");if(R!==null){const I=Object.keys(R);S=R[I[0]]}}Ts.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:Ts.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,w=y.enter().append("path");m?w.merge(y).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:S}=_;return o(S)}):(w.attr("opacity",0).merge(y).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>b.model.getFillColor(_.name,null,_.data)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Dn.opacity.selected).attr("d",_=>{const{data:S}=_;return o(S)}),u&&w.attr("fill-opacity",Dn.opacity.selected).style("stroke",_=>b.model.getStrokeColor(_.name,null,_.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class vi extends xt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?In.opacity.unselected:In.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",In.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=f=>r.getDomainValue(f),a=f=>r.getRangeValue(f),[o,l]=Pn(s,a,r.getOrientation()),c=this.getOptions(),u=ss().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let d=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:p}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(v=>{const m=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:x(v,0,p),data:v.map(g=>({[m]:g.data.sharedStackKey,[p]:g[p],[y]:g[1]})),hidden:!nD(v,g=>g[0]!==g[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,f=>f.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name,null,f.data)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[m]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const l0=5;function jI(e,t){return e>t-l0&&e<t+l0}class Kn extends xt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(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===te.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.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=>jI(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(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const v=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const g=m[0].domainValue,b=Math.abs(u-y.domainValue),w=Math.abs(u-g);return b>w||(b<w?m=[y]:m.push(y)),m},[]);if(v.length>0){const m=v.map(w=>w.originalData).filter(w=>{const _=this.services.cartesianScales.getRangeIdentifier(w);return w[_]!=null}),y=v.map(w=>w.domainValue),g=f.filter(w=>{const _=this.services.cartesianScales.getDomainValue(w);return y.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dv(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const b=v[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.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=or(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=v$(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=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}class mn extends xt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.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(!(x(this.getOptions(),"points","enabled")||x(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,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]=Pn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Pn(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]=Pn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),v=this.model.getIsFilled(f[o],f[p],f,i)?[at.FILL,at.STROKE]:[at.STROKE];return this.model.getColorClassName({classNameTypes:v,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",dt.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 s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class c0 extends xt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[F.LEFT]:!1,[F.RIGHT]:!1,[F.TOP]:!1,[F.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=x(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===F.BOTTOM||n===F.TOP?(c=this.configs.axes[F.LEFT]?this.margins.left:0,u=this.configs.axes[F.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===et.LABELS||this.scaleType===et.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case F.LEFT:h=Qh;break;case F.BOTTOM:h=pl;break;case F.RIGHT:h=by;break;case F.TOP:h=xy;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=N.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${dt.GRAPHICS_OBJECT} ${dt.GROUP}`),p.attr("aria-label",`${n} ticks`));const v=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=x(r,"axes",n),y=this.scaleType===et.TIME||m.scaleType===et.TIME,g=n===F.LEFT||n===F.RIGHT,b=this.model.get("zoomDomain");if(b&&y&&!g&&d.domain(b),!i){p.attr("aria-hidden",!0);return}const w=x(m,"scaleType"),_=x(r,"data","loading"),S=x(m,"ticks","number"),R=x(m,"ticks","values"),I=x(m,"truncation","type"),k=x(m,"truncation","threshold"),L=x(m,"truncation","numCharacter"),M=S!==null,V=x(r,"timeScale"),P=N.appendOrSelect(v,"g.tick"),H=N.appendOrSelect(P,"text").text("0"),E=N.getSVGElementSize(H.node(),{useBBox:!0}).height;P.remove();const A=this.scaleType||m.scaleType||et.LINEAR,$=h(d).tickSizeOuter(0);if(d.ticks){let X;if(M?X=S:(X=Wn.ticks.number,g&&(X=this.getNumberOfFittingTicks(o,E,Wn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(X=0),$.ticks(X),y)if(!d.ticks(X).length)$.tickValues([]);else{const nt=x(r,"timeScale","addSpaceOnEdges"),pt=x(r,"axes",n,"domain"),q=d.copy();nt&&!pt&&q.nice(X);const tt=q.ticks(X);nt&&tt.length>2&&!pt&&(tt.splice(tt.length-1,1),tt.splice(0,1)),$.tickValues(tt)}}let U;const B=x(m,"ticks","formatter"),{code:W,number:K}=x(r,"locale");if(y){const X=xu($.tickValues(),x(r,"timeScale","timeInterval"));B===null?U=(nt,pt)=>yu(nt,pt,$.tickValues(),X,V,r.locale):U=(nt,pt)=>{const q=yu(nt,pt,$.tickValues(),X,V,r.locale);return B(nt,pt,q)}}else B===null?A===et.LINEAR&&(U=X=>K(X,W)):U=B;$.tickFormat(U);const[Q,ft]=this.services.cartesianScales.getScaleByPosition(n).domain();let st;if(R){if(y)R.forEach((X,nt)=>{X.getTime===void 0&&(R[nt]=new Date(X))}),st=R.filter(X=>{const nt=X.getTime();return nt>=new Date(Q).getTime()&&nt<=new Date(ft).getTime()});else if(w===et.LABELS){const X=this.services.cartesianScales.getScaleByPosition(n).domain();st=R.filter(nt=>X.includes(nt))}else st=R.filter(X=>X>=Q&&X<=ft);$.tickValues(st)}switch(n){case F.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case F.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case F.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case F.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const gt=this.model.isDataEmpty();if(m.title){const X=N.appendOrSelect(l,"text.axis-title").html(gt||_?"":pn(m.title)),nt=x(m,"titleOrientation");let pt;switch(n){case F.LEFT:nt===ol.RIGHT?X.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):X.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case F.BOTTOM:X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case F.RIGHT:nt===ol.LEFT?X.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):X.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case F.TOP:pt=N.getSVGElementSize(X,{useBBox:!0}).height,X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(y){const X=xu($.tickValues(),x(r,"timeScale","timeInterval")),nt=V.showDayName,pt=p;t&&(p=p.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t}))),p=p.call($),pt.selectAll(".tick").data($.tickValues(),d).order().select("text").style("font-weight",(q,tt)=>Ig(q,tt,$.tickValues(),X,nt)?"bold":"normal")}else!t||!f?p=p.call($):p=p.transition().call(X=>this.services.transitions.setupTransition({transition:X,name:"axis-update",animate:t})).call($);if(v.call($),n===F.BOTTOM||n===F.TOP){let X=!1;const nt=x(m,"ticks","rotation");if(nt===Xs.ALWAYS)X=!0;else if(nt===Xs.NEVER)X=!1;else if(!nt||nt===Xs.AUTO)if(d.step)X=v.selectAll("g.tick text").nodes().some(pt=>N.getSVGElementSize(pt,{useBBox:!0}).width>=d.step());else{X=!1;const pt=v.append("text").text("A"),q=N.getSVGElementSize(pt.node(),{useBBox:!0}).width;let tt;v.selectAll("g.tick").each(function(){const ct=D(this),z=parseFloat(x(Nn(this),"tx"));z!==null&&tt+ct.text().length*q*.8>=z&&(X=!0),tt=z}),pt.remove()}X?(M||($.ticks(this.getNumberOfFittingTicks(a,E,Wn.ticks.horizontalSpaceRatio)),v.call($),p.call($)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===F.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",X=>X),v.selectAll("g.tick").attr("aria-label",X=>X),I!==je.NONE&&w===et.LABELS&&!R){const X=this.services.cartesianScales.getScaleDomain(n);if(X.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const pt=this;l.selectAll("g.tick text").data(X).text(function(q){return q.length>k?(pt.truncation[n]=!0,Ss(q,I,L)):q}),this.getInvisibleAxisRef().selectAll("g.tick text").data(X).text(function(q){return q.length>k?Ss(q,I,L):q}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(X)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===et.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===et.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===et.LABELS&&l.services.events.dispatchEvent(O.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 kv(i,2,Wn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class WI extends c0{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=D(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case F.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case F.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case F.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case F.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Wn.hover.rectanglePadding).attr("y",p).attr("width",u+Wn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===et.LABELS&&d.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===et.LABELS&&l.services.events.dispatchEvent(O.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(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===F.LEFT||n===F.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;N.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 Se extends xt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(F),i=x(this.getOptions(),"axes");r.forEach(a=>{i[F[a]]&&(n[F[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=F[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Ks.DEFAULT?new c0(this.model,this.services,l):new WI(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===F.LEFT||l===F.RIGHT)&&(h+=5)),l){case F.TOP:s.top=d+h;break;case F.BOTTOM:s.bottom=d+h;break;case F.LEFT:s.left=u+h;break;case F.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(O.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class xe extends xt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===ee.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===ee.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===ee.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===ee.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===te.VERTICAL&&this.drawYGrid(t),n===te.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=Ze().domain([0,1]).range(t),this.yScale=Ze().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=N.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=x(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.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=x(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.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}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=x(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=is().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ht.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=N.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+Ht.xOffset;c===Qt.CENTER?p=s/2:c===Qt.RIGHT&&(p=s-t-Ht.xOffset);const v=t+Ht.yOffset;f.attr("transform",`translate(${p}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Ht.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
77
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class De extends xt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.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=Rl(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Qh(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Nn(u).tx)-Number(Nn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Nn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Nn(o).tx;else if(o)l=+Nn(o).tx-+Nn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+Nn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Nn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.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=N.appendOrSelect(r,"svg.chart-grid-backdrop");const u=N.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 o0 extends xt{constructor(){super(...arguments),this.type="area",this.renderType=rt.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?Dn.opacity.unselected:Dn.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",Dn.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({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Qc().curve(this.services.curves.getD3Curve()).defined(_=>{const S=s.getRangeIdentifier();return _[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(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=(_,S)=>{x(r,"axes",_,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(d),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Qt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const v=x(r,"color","gradient","enabled"),m=l&&l.length===1&&v;l.length>1&&v&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(l,_=>_.name),g=D(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const _=g.select(`path.${this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:l[0].name})}`).node();let S;if(_)S=getComputedStyle(_,null).getPropertyValue("stroke");else{const L=x(this.model.getOptions(),"color","scale");if(L!==null){const I=Object.keys(L);S=L[I[0]]}}Ls.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:Ls.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,w=y.enter().append("path");m?w.merge(y).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:S}=_;return o(S)}):(w.attr("opacity",0).merge(y).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>b.model.getFillColor(_.name,null,_.data)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Dn.opacity.selected).attr("d",_=>{const{data:S}=_;return o(S)}),u&&w.attr("fill-opacity",Dn.opacity.selected).style("stroke",_=>b.model.getStrokeColor(_.name,null,_.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 xt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?In.opacity.unselected:In.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",In.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({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=f=>r.getDomainValue(f),a=f=>r.getRangeValue(f),[o,l]=Pn(s,a,r.getOrientation()),c=this.getOptions(),u=us().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let d=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:p}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(v=>{const m=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:x(v,0,p),data:v.map(g=>({[m]:g.data.sharedStackKey,[p]:g[p],[y]:g[1]})),hidden:!nD(v,g=>g[0]!==g[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,f=>f.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name,null,f.data)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[m]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const l0=5;function jI(e,t){return e>t-l0&&e<t+l0}class Kn extends xt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(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===Qt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.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=>jI(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 v=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const g=m[0].domainValue,b=Math.abs(u-y.domainValue),w=Math.abs(u-g);return b>w||(b<w?m=[y]:m.push(y)),m},[]);if(v.length>0){const m=v.map(w=>w.originalData).filter(w=>{const _=this.services.cartesianScales.getRangeIdentifier(w);return w[_]!=null}),y=v.map(w=>w.domainValue),g=f.filter(w=>{const _=this.services.cartesianScales.getDomainValue(w);return y.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dv(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const b=v[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.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=cr(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=v$(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=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}class yn extends xt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.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(!(x(this.getOptions(),"points","enabled")||x(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,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]=Pn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Pn(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]=Pn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),v=this.model.getIsFilled(f[o],f[p],f,i)?[at.FILL,at.STROKE]:[at.STROKE];return this.model.getColorClassName({classNameTypes:v,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",dt.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 s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.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:D(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class c0 extends xt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.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=x(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.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===et.LABELS||this.scaleType===et.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Qh;break;case z.BOTTOM:h=Rl;break;case z.RIGHT:h=by;break;case z.TOP:h=xy;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=N.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${dt.GRAPHICS_OBJECT} ${dt.GROUP}`),p.attr("aria-label",`${n} ticks`));const v=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=x(r,"axes",n),y=this.scaleType===et.TIME||m.scaleType===et.TIME,g=n===z.LEFT||n===z.RIGHT,b=this.model.get("zoomDomain");if(b&&y&&!g&&d.domain(b),!i){p.attr("aria-hidden",!0);return}const w=x(m,"scaleType"),_=x(r,"data","loading"),S=x(m,"ticks","number"),L=x(m,"ticks","values"),I=x(m,"truncation","type"),k=x(m,"truncation","threshold"),R=x(m,"truncation","numCharacter"),M=S!==null,F=x(r,"timeScale"),P=N.appendOrSelect(v,"g.tick"),H=N.appendOrSelect(P,"text").text("0"),E=N.getSVGElementSize(H.node(),{useBBox:!0}).height;P.remove();const A=this.scaleType||m.scaleType||et.LINEAR,$=h(d).tickSizeOuter(0);if(d.ticks){let X;if(M?X=S:(X=Wn.ticks.number,g&&(X=this.getNumberOfFittingTicks(o,E,Wn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(X=0),$.ticks(X),y)if(!d.ticks(X).length)$.tickValues([]);else{const nt=x(r,"timeScale","addSpaceOnEdges"),pt=x(r,"axes",n,"domain"),Y=d.copy();nt&&!pt&&Y.nice(X);const tt=Y.ticks(X);nt&&tt.length>2&&!pt&&(tt.splice(tt.length-1,1),tt.splice(0,1)),$.tickValues(tt)}}let U;const B=x(m,"ticks","formatter"),{code:q,number:Q}=x(r,"locale");if(y){const X=Pu($.tickValues(),x(r,"timeScale","timeInterval"));B===null?U=(nt,pt)=>Nu(nt,pt,$.tickValues(),X,F,r.locale):U=(nt,pt)=>{const Y=Nu(nt,pt,$.tickValues(),X,F,r.locale);return B(nt,pt,Y)}}else B===null?A===et.LINEAR&&(U=X=>Q(X,q)):U=B;$.tickFormat(U);const[J,ft]=this.services.cartesianScales.getScaleByPosition(n).domain();let st;if(L){if(y)L.forEach((X,nt)=>{X.getTime===void 0&&(L[nt]=new Date(X))}),st=L.filter(X=>{const nt=X.getTime();return nt>=new Date(J).getTime()&&nt<=new Date(ft).getTime()});else if(w===et.LABELS){const X=this.services.cartesianScales.getScaleByPosition(n).domain();st=L.filter(nt=>X.includes(nt))}else st=L.filter(X=>X>=J&&X<=ft);$.tickValues(st)}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 gt=this.model.isDataEmpty();if(m.title){const X=N.appendOrSelect(l,"text.axis-title").html(gt||_?"":vn(m.title)),nt=x(m,"titleOrientation");let pt;switch(n){case z.LEFT:nt===ta.RIGHT?X.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):X.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:X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===ta.LEFT?X.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):X.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:pt=N.getSVGElementSize(X,{useBBox:!0}).height,X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(y){const X=Pu($.tickValues(),x(r,"timeScale","timeInterval")),nt=F.showDayName,pt=p;t&&(p=p.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t}))),p=p.call($),pt.selectAll(".tick").data($.tickValues(),d).order().select("text").style("font-weight",(Y,tt)=>Ig(Y,tt,$.tickValues(),X,nt)?"bold":"normal")}else!t||!f?p=p.call($):p=p.transition().call(X=>this.services.transitions.setupTransition({transition:X,name:"axis-update",animate:t})).call($);if(v.call($),n===z.BOTTOM||n===z.TOP){let X=!1;const nt=x(m,"ticks","rotation");if(nt===Ci.ALWAYS)X=!0;else if(nt===Ci.NEVER)X=!1;else if(!nt||nt===Ci.AUTO)if(d.step)X=v.selectAll("g.tick text").nodes().some(pt=>N.getSVGElementSize(pt,{useBBox:!0}).width>=d.step());else{X=!1;const pt=v.append("text").text("A"),Y=N.getSVGElementSize(pt.node(),{useBBox:!0}).width;let tt;v.selectAll("g.tick").each(function(){const ct=D(this),G=parseFloat(x(Nn(this),"tx"));G!==null&&tt+ct.text().length*Y*.8>=G&&(X=!0),tt=G}),pt.remove()}X?(M||($.ticks(this.getNumberOfFittingTicks(a,E,Wn.ticks.horizontalSpaceRatio)),v.call($),p.call($)),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(_?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",X=>X),v.selectAll("g.tick").attr("aria-label",X=>X),I!==Pe.NONE&&w===et.LABELS&&!L){const X=this.services.cartesianScales.getScaleDomain(n);if(X.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const pt=this;l.selectAll("g.tick text").data(X).text(function(Y){return Y.length>k?(pt.truncation[n]=!0,As(Y,I,R)):Y}),this.getInvisibleAxisRef().selectAll("g.tick text").data(X).text(function(Y){return Y.length>k?As(Y,I,R):Y}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(X)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(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:D(this),datum:u}),a===et.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===et.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:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===et.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 kv(i,2,Wn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class WI extends c0{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=D(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.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-Wn.hover.rectanglePadding).attr("y",p).attr("width",u+Wn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===et.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(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:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===et.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:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(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:D(this),datum:D(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;N.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 Se extends xt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.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=x(this.getOptions(),"axes");r.forEach(a=>{i[z[a]]&&(n[z[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=z[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===$i.DEFAULT?new c0(this.model,this.services,l):new WI(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===z.LEFT||l===z.RIGHT)&&(h+=5)),l){case z.TOP:s.top=d+h;break;case z.BOTTOM:s.bottom=d+h;break;case z.LEFT:s.left=u+h;break;case z.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(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(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class xe extends xt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===te.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===te.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===te.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===te.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===Qt.VERTICAL&&this.drawYGrid(t),n===Qt.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=Ke().domain([0,1]).range(t),this.yScale=Ke().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=N.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=x(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.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=x(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.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}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=x(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=cs().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ht.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=N.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+Ht.xOffset;c===Jt.CENTER?p=s/2:c===Jt.RIGHT&&(p=s-t-Ht.xOffset);const v=t+Ht.yOffset;f.attr("transform",`translate(${p}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Ht.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
78
78
  <stop class="${n}" offset="${a}"></stop>
79
79
  <stop class="${r}" offset="${a+.2}"></stop>
80
80
  <stop class="${n}" offset="${a+2*.2}"></stop>
81
- `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(Ub).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class qI extends xt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,v=p.getOrientation(),m=v===te.VERTICAL,[y,g]=Pn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),v),b=Math.floor((m?h:f)/s.length),w=Math.min(b/2,16),_=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(_);S.exit().remove();const R=S.enter().append("g").attr("class","box-group"),I=S.merge(R);R.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",ze.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),P=V,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.quartiles.q_25);return ge({x0:V,x1:P,y0:H,y1:E},v)}),R.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",ze.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),P=V,H=p.getRangeValue(M.whiskers.max),E=p.getRangeValue(M.quartiles.q_75);return ge({x0:V,x1:P,y0:H,y1:E},v)}),R.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"box"})).attr("fill-opacity",ze.box.opacity.default).attr("stroke-width",ze.strokeWidth.default).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-w/2,P=V+w,H=p.getRangeValue(Math[m?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),E=H+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return ge({x0:V,x1:P,y0:H,y1:E},v)}),R.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const V=p.getDomainValue(M[i])-w/2,P=V+w,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.whiskers.max);return ge({x0:V,x1:P,y0:H,y1:E},v)}),R.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker start"})).attr("stroke-width",ze.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-w/4,P=V+w/2,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.whiskers.min);return ge({x0:V,x1:P,y0:H,y1:E},v)}),R.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-w/2,P=V+w,H=p.getRangeValue(M.quartiles.q_50);return ge({x0:V,x1:P,y0:H,y1:H},v)}),R.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker end"})).attr("stroke-width",ze.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-w/4,P=V+w/2,H=p.getRangeValue(M.whiskers.max),E=p.getRangeValue(M.whiskers.max);return ge({x0:V,x1:P,y0:H,y1:E},v)});const k=I.selectAll("circle.outlier").data(M=>M.outliers.map(V=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:V})));k.exit().remove();const L=k.enter().append("circle");k.merge(L).attr("r",ze.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"outlier"})).attr("fill-opacity",ze.circle.opacity.default).attr("cx",y).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",g),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",ze.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",ze.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0).attr("fill-opacity",ze.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",ze.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class yi extends xt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=bg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());N.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class YI extends mn{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?We(s):[1,1];return Ze().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Pn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class XI extends xt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const v=[];s.forEach(y=>{y.ranges?y.ranges.forEach((g,b)=>{g!=null&&g<u&&v.push({datum:y,value:g,order:b+1})}):v.push({datum:y,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let g,b,w,_;return y.order===1?(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,w=c-2,_=l+1):(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,w=this.services.cartesianScales.getRangeValue(y.value),_=c),ge({x0:g,x1:b,y0:w,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,g=y+8,b=this.services.cartesianScales.getRangeValue(0)+1,w=this.services.cartesianScales.getRangeValue(m);return ge({x0:y,x1:g,y0:b,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const v=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>x(m,"marker")!==null),m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-12,g=y+24,b=this.services.cartesianScales.getRangeValue(m.marker);return ge({x0:y,x1:g,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let v=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const g=y.marker,b=y[o];v=v.concat([{datum:y,value:g*.25,barValue:b},{datum:y,value:g*.5,barValue:b},{datum:y,value:g*.75,barValue:b}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:g})=>{let b=4;y.ranges&&y.ranges.indexOf(g)!==-1&&(b=8);const w=this.services.cartesianScales.getDomainValue(y)-b/2,_=w+b,S=this.services.cartesianScales.getRangeValue(g);return ge({x0:w,x1:_,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=x(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=D(this);c.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=x(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:o,element:D(this),datum:l}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:o,element:D(this),datum:l})}).on("mouseout",function(o,l){const c=D(this);c.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function ZI(e){return e}function KI(e){if(e==null)return ZI;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function QI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function JI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return u0(e,n)})}:u0(e,t)}function u0(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=ih(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function ih(e,t){var n=KI(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&QI(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function tN(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=i[d])if(delete i[f.end],f.push(c),f.end=h,p=r[h]){delete r[p.start];var v=p===f?f:f.concat(p);r[v.start=f.start]=i[v.end=p.end]=v}else r[f.start]=i[f.end]=f;else if(f=r[h])if(delete r[f.start],f.unshift(c),f.start=d,p=i[d]){delete i[p.end];var m=p===f?f:p.concat(f);r[m.start=p.start]=i[m.end=f.end]=m}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=d]=i[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function eN(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function nN(e){return ih(e,rN.apply(this,arguments))}function rN(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return eN(ih(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(v){v.forEach(function(m){m.forEach(function(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=tN(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class iN extends Kn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===te.VERTICAL?n:r),f=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=N.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(_t(m,"data.x0"))<=h&&parseFloat(_t(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dv(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(_t(m,"data.x0")),g=parseFloat(_t(m,"data.x1")),b=this.model.getActiveDataGroupNames(),w=b.reverse().map(_=>({label:_,value:_t(m,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(w.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:_t(s,"bins.rangeLabel")||"Range",value:`${y} – ${g}`},...w,...x(s,"tooltip","showTotal")===!0?[{label:_t(s,"locale.translations.total")||_t(s,"tooltip.totalLabel")||"Total",value:b.reduce((S,R)=>S+parseFloat(_t(m,`data.${R}`)),0)}]:[]]}),f.attr("opacity",1);const _=d((y+g)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",c).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class Wo extends Kn{formatTooltipData(t){return t.reverse()}}const sN=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Xd();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},aN={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},oN={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},lN={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},cN={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},uN={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},hN={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class h0 extends nh{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=N.getSVGElementSize(i,{useAttrs:!0}),a=x(this.getOptions(),"data","loading");if(s>Yt.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=N.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),s=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!Je(s),u=Pg(this.model.getDisplayData()),d=!(i<=Yt.color.barWidth),h=d?Yt.color.barWidth:i,f=N.appendOrSelect(r,"g.legend"),p=N.appendOrSelect(f,"g.legend-axis");if(l){const k=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(k,"text").text(l).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const v=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(c)m=s;else for(let k=1;k<y+1;k++)m.push(a===Zs.LINEAR?`stop-color-${v}-${o}-${k}`:`fill-${v}-${o}-${k}`);const g=Me(u[0],u[1]),b=$x(g,3),w=Ze().domain(u).range([0,h]),_=pl(w).tickSize(0).tickValues(b),{code:S,number:R}=x(n,"locale");_.tickFormat(k=>R(k,S));let I;switch(a){case Zs.LINEAR:this.drawLinear(m,f,h);break;case Zs.QUANTIZE:I=this.drawQuantize(m,v,c,f,h),w.range([I,h]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Yt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);N.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Yt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Qi().domain(t).range([0,s]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Yt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class dN extends ks{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(x(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=N.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=x(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=x(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${f(r,h)} ${s} used (${f(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=N.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),{code:o,number:l}=x(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=N.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-oe.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=N.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=oe.status.indicatorSize/2,a=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=x(this.model.getDisplayData(),0,"value"),{code:n,number:r}=x(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=oe.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=oe.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=x(this.getOptions(),"meter","proportional"),n=N.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=N.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=N.getSVGElementSize(r,{useBBox:!0}).width;return n-i-oe.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=oe.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+oe.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Ys.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Ys.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ys.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class sh extends xt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=N.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=x(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class fN extends xt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:ci.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=Xi({children:s}).sum(p=>p.value).sort((p,v)=>v.value-p.value),d=z_().size([r,i]).padding(p=>p.depth>=1?ci.padding.children+3:ci.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const f=h.enter().append("circle").classed("node",!0);f.merge(h).attr("class",p=>{const v=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName,null,p.data)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName,null,p.data)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",ci.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,li),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",ci.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,li)})}getZoomIcon(){return`
81
+ `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(Ub).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class qI extends xt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,v=p.getOrientation(),m=v===Qt.VERTICAL,[y,g]=Pn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),v),b=Math.floor((m?h:f)/s.length),w=Math.min(b/2,16),_=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(_);S.exit().remove();const L=S.enter().append("g").attr("class","box-group"),I=S.merge(L);L.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ge.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i]),P=F,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.quartiles.q_25);return ge({x0:F,x1:P,y0:H,y1:E},v)}),L.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ge.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i]),P=F,H=p.getRangeValue(M.whiskers.max),E=p.getRangeValue(M.quartiles.q_75);return ge({x0:F,x1:P,y0:H,y1:E},v)}),L.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"box"})).attr("fill-opacity",Ge.box.opacity.default).attr("stroke-width",Ge.strokeWidth.default).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i])-w/2,P=F+w,H=p.getRangeValue(Math[m?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),E=H+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return ge({x0:F,x1:P,y0:H,y1:E},v)}),L.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const F=p.getDomainValue(M[i])-w/2,P=F+w,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.whiskers.max);return ge({x0:F,x1:P,y0:H,y1:E},v)}),L.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ge.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i])-w/4,P=F+w/2,H=p.getRangeValue(M.whiskers.min),E=p.getRangeValue(M.whiskers.min);return ge({x0:F,x1:P,y0:H,y1:E},v)}),L.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i])-w/2,P=F+w,H=p.getRangeValue(M.quartiles.q_50);return ge({x0:F,x1:P,y0:H,y1:H},v)}),L.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ge.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const F=p.getDomainValue(M[i])-w/4,P=F+w/2,H=p.getRangeValue(M.whiskers.max),E=p.getRangeValue(M.whiskers.max);return ge({x0:F,x1:P,y0:H,y1:E},v)});const k=I.selectAll("circle.outlier").data(M=>M.outliers.map(F=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:F})));k.exit().remove();const R=k.enter().append("circle");k.merge(R).attr("r",Ge.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ge.circle.opacity.default).attr("cx",y).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",g),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ge.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ge.box.opacity.default),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0).attr("fill-opacity",Ge.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",Ge.circle.opacity.default),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class _i extends xt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=bg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());N.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class YI extends yn{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?qe(s):[1,1];return Ke().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Pn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class ZI extends xt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const v=[];s.forEach(y=>{y.ranges?y.ranges.forEach((g,b)=>{g!=null&&g<u&&v.push({datum:y,value:g,order:b+1})}):v.push({datum:y,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let g,b,w,_;return y.order===1?(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,w=c-2,_=l+1):(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,b=g+16,w=this.services.cartesianScales.getRangeValue(y.value),_=c),ge({x0:g,x1:b,y0:w,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,g=y+8,b=this.services.cartesianScales.getRangeValue(0)+1,w=this.services.cartesianScales.getRangeValue(m);return ge({x0:y,x1:g,y0:b,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const v=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>x(m,"marker")!==null),m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-12,g=y+24,b=this.services.cartesianScales.getRangeValue(m.marker);return ge({x0:y,x1:g,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let v=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const g=y.marker,b=y[o];v=v.concat([{datum:y,value:g*.25,barValue:b},{datum:y,value:g*.5,barValue:b},{datum:y,value:g*.75,barValue:b}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:g})=>{let b=4;y.ranges&&y.ranges.indexOf(g)!==-1&&(b=8);const w=this.services.cartesianScales.getDomainValue(y)-b/2,_=w+b,S=this.services.cartesianScales.getRangeValue(g);return ge({x0:w,x1:_,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=x(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=D(this);c.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=x(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:x(n,"locale","translations","group")||x(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:o,element:D(this),datum:l}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:o,element:D(this),datum:l})}).on("mouseout",function(o,l){const c=D(this);c.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function XI(e){return e}function KI(e){if(e==null)return XI;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function QI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function JI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return u0(e,n)})}:u0(e,t)}function u0(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=_h(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function _h(e,t){var n=KI(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&QI(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function tN(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=i[d])if(delete i[f.end],f.push(c),f.end=h,p=r[h]){delete r[p.start];var v=p===f?f:f.concat(p);r[v.start=f.start]=i[v.end=p.end]=v}else r[f.start]=i[f.end]=f;else if(f=r[h])if(delete r[f.start],f.unshift(c),f.start=d,p=i[d]){delete i[p.end];var m=p===f?f:p.concat(f);r[m.start=p.start]=i[m.end=f.end]=m}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=d]=i[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function eN(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function nN(e){return _h(e,rN.apply(this,arguments))}function rN(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return eN(_h(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(v){v.forEach(function(m){m.forEach(function(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=tN(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class iN extends Kn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Qt.VERTICAL?n:r),f=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=N.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(_t(m,"data.x0"))<=h&&parseFloat(_t(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dv(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(_t(m,"data.x0")),g=parseFloat(_t(m,"data.x1")),b=this.model.getActiveDataGroupNames(),w=b.reverse().map(_=>({label:_,value:_t(m,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(w.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:_t(s,"bins.rangeLabel")||"Range",value:`${y} – ${g}`},...w,...x(s,"tooltip","showTotal")===!0?[{label:_t(s,"locale.translations.total")||_t(s,"tooltip.totalLabel")||"Total",value:b.reduce((S,L)=>S+parseFloat(_t(m,`data.${L}`)),0)}]:[]]}),f.attr("opacity",1);const _=d((y+g)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",c).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class Zo extends Kn{formatTooltipData(t){return t.reverse()}}const sN=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Zd();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},aN={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},oN={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},lN={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},cN={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},uN={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},hN={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class h0 extends bh{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=N.getSVGElementSize(i,{useAttrs:!0}),a=x(this.getOptions(),"data","loading");if(s>Yt.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=N.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),s=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!tn(s),u=Pg(this.model.getDisplayData()),d=!(i<=Yt.color.barWidth),h=d?Yt.color.barWidth:i,f=N.appendOrSelect(r,"g.legend"),p=N.appendOrSelect(f,"g.legend-axis");if(l){const k=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(k,"text").text(l).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const v=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(c)m=s;else for(let k=1;k<y+1;k++)m.push(a===Ai.LINEAR?`stop-color-${v}-${o}-${k}`:`fill-${v}-${o}-${k}`);const g=Ce(u[0],u[1]),b=$x(g,3),w=Ke().domain(u).range([0,h]),_=Rl(w).tickSize(0).tickValues(b),{code:S,number:L}=x(n,"locale");_.tickFormat(k=>L(k,S));let I;switch(a){case Ai.LINEAR:this.drawLinear(m,f,h);break;case Ai.QUANTIZE:I=this.drawQuantize(m,v,c,f,h),w.range([I,h]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Yt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);N.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Yt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=rs().domain(t).range([0,s]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Yt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class dN extends Us{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(x(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=N.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=x(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=x(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${f(r,h)} ${s} used (${f(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=N.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),{code:o,number:l}=x(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=N.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-oe.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=N.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=oe.status.indicatorSize/2,a=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=x(this.model.getDisplayData(),0,"value"),{code:n,number:r}=x(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=oe.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=oe.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=x(this.getOptions(),"meter","proportional"),n=N.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=N.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=N.getSVGElementSize(r,{useBBox:!0}).width;return n-i-oe.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=oe.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+oe.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Mi.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Mi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Mi.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class wh extends xt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=N.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=x(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class fN extends xt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:fi.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=ts({children:s}).sum(p=>p.value).sort((p,v)=>v.value-p.value),d=z_().size([r,i]).padding(p=>p.depth>=1?fi.padding.children+3:fi.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const f=h.enter().append("circle").classed("node",!0);f.merge(h).attr("class",p=>{const v=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName,null,p.data)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName,null,p.data)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",fi.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,di),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",fi.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,di)})}getZoomIcon(){return`
82
82
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
83
83
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
84
84
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
85
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:_t(f,"locale.translations.total")||_t(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,li)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,li),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function pN(e,t){const n=Li(this._current,e);return r=>(this._current=n(r),t(this._current))}class d0 extends xt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ht.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(k=>k[a]>0),l=this.computeRadius();this.arc=is().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=is().innerRadius(this.getInnerRadius()).outerRadius(l+Ht.hoverArc.outerRadiusOffset);const c=HS().value(k=>k[a]).sort(x(i,"pie","sortFunction")).padAngle(Ht.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",dt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,k=>k.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",k=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:k.data[s],originalClassName:"slice"})).style("fill",k=>n.model.getFillColor(k.data[s],null,k.data)).attr("d",this.arc).transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",k=>`${k[a]}, ${pu(k.data[a],o,a)+"%"}`).attrTween("d",function(k){return pN.bind(this)(k,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=x(i,"locale"),f=i.pie.labels.enabled,p=f?c.filter(k=>k.data[a]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",dt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(p,k=>k.data[s]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(k=>i.pie.labels.formatter?i.pie.labels.formatter({...k,percentageValue:pu(k.data[a],o,a,!0)}):h(pu(k.data[a],o,a),d)+"%").datum(function(k){const L=l+7,M=(k.endAngle-k.startAngle)/2+k.startAngle,V=M/Math.PI*180,P=this.getComputedTextLength();return k.textOffsetX=P/2,k.textOffsetY=V>90&&V<270?10:0,k.xPosition=(k.textOffsetX+L)*Math.sin(M),k.yPosition=(k.textOffsetY+L)*-Math.cos(M),k}).attr("transform",function(k,L){const M=p.length,V=(k.endAngle-k.startAngle)*(180/Math.PI);if(L>=M-2&&V<Ht.callout.minSliceDegree){let P,H;return k.index===M-1?(P=k.xPosition+Ht.callout.offsetX+Ht.callout.textMargin+k.textOffsetX,H=k.yPosition-Ht.callout.offsetY,k.direction=qs.RIGHT,y.push(k)):(P=k.xPosition-Ht.callout.offsetX-k.textOffsetX-Ht.callout.textMargin,H=k.yPosition-Ht.callout.offsetY,k.direction=qs.LEFT,y.push(k)),`translate(${P}, ${H})`}return`translate(${k.xPosition}, ${k.yPosition})`}),this.renderCallouts(y);const g=x(i,"donut")?"donut":"pie",b=x(i,g,"alignment"),{width:w}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),_=f?Ht.xOffset:0,S=f?Ht.yOffset:0;let R=l+_;b===Qt.CENTER?R=w/2:b===Qt.RIGHT&&(R=w-l-Ht.xOffset);let I=l+S;y.length>0&&(I+=Ht.yOffsetCallout),r.attr("x",R+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",dt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",dt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===qs.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Ht.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Ht.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);Zk(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Ht.radiusOffset:i}}class mN extends d0{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Od:s=Me;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const f0="4,10 8,6 12,10",p0="12,6 8,10 4,6";class gN extends xt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return kv(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Pr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case al.UP:return f0;case al.DOWN:return p0;default:return t>0?f0:p0}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=is().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=is().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=x(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;p===Qt.CENTER?m=v/2:p===Qt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===Pr.FULL&&!s?d=l(a):r===Pr.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=x(n,"locale"),y=x(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(k=>{let L;return k!=null?L=Number(k.toFixed(2))%1!==0?k.toFixed(2):k.toFixed():L=0,y?y(L):m(Number(L),v)});const{width:b}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),w=f/2,_=u?"%":"",S=N.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${w}px`).attr("x",b/2).text(_),{width:R,height:I}=N.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${I/2}px`),p.attr("transform",`translate(-${R/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),f=N.appendOrSelect(n,"g.gauge-numbers"),p=N.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(w=>{let _;return w!=null?_=Number(w.toFixed(2))%1!==0?w.toFixed(2):w.toFixed():_=0,c?`${c(_)}${m}`:`${a(Number(_),s)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),b=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);b.enter().append("svg").merge(b).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const w=D(this);N.appendOrSelect(w,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const _=x(r,"gauge","status");N.appendOrSelect(w,"polygon.gauge-delta-arrow").attr("class",_!==null?`gauge-delta-arrow status--${_}`:"").attr("points",t.getArrow(i))}),b.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===Pr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class m0 extends sh{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Es(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===te.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),f=d,p=d+h,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-h/2,w=b+h;if(!this.isOutsideZoomedDomain(b,w))return ge({x0:f,x1:p,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Qi().domain(t).rangeRound([0,this.getGroupWidth()])}}class vN extends xt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const v=this.matrix[r][p].value;if(d===null){d=v,h=v,f=v;return}d+=v,h=v<h?v:h,f=v>f?v:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const v=this.matrix[p][r].value;if(d===null){d=v,h=v,f=v;return}d+=v,h=v<h?v:h,f=v>f?v:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${zn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${zn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[a])}, ${s(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${f})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==Oi.OFF&&(t===Oi.AUTO&&cg.minCellDividerDimension<=this.xBandwidth&&cg.minCellDividerDimension<=this.yBandwidth||t===Oi.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=_t(r,"locale.translations.total")||_t(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const f=ws(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class yN extends xt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>_t(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",dt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=_t(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===te.VERTICAL?m+=1:m-=1),ge({x0:f,x1:p,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=D(this);l.classed("hovered",!0);const c=i(parseFloat(_t(o,"data.x0")),r),u=i(parseFloat(_t(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:_t(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:_t(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){D(this).classed("hovered",!1),s.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xN extends mn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?In.weight.unselected:In.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",In.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?In.opacity.unselected:In.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",In.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=Pn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===te.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class bN extends xt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-oe.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-oe.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=Ze().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?oe.height.proportional:oe.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?oe.height.proportional:oe.height.default));const p=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?oe.height.proportional:oe.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b[c],originalClassName:v})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):Math.max(b.width,2)).style("fill",b=>n.model.getFillColor(b[c],null,b)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const m=x(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<a[0].value&&(y=a[0].value>u?u:a[0].value));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>f||(s?oe.height.proportional:oe.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class EN extends xt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=tD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:lt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Sr.opacity.unselected:Sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Sr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:v,xAxisRectHeight:m}=Sr;this.uniqueKeys=Array.from(new Set(s.map(E=>E[u]))),this.uniqueGroups=Array.from(new Set(s.map(E=>E[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),g=(Math.min(r,i)-y)/2;if(g<=0)return;const b=Qi().domain(this.fullDataNormalized.map(E=>E[u])).range([0,2*Math.PI].map(E=>E-Math.PI/2)),w=zn(this.fullDataNormalized.map(E=>E[d])),_=Ze().domain([w>=0?0:w,ar(this.fullDataNormalized.map(E=>E[d]))]).range([v,g]).nice(p),S=_.ticks(p),R=(E,A,$)=>this.model.getFillColor(E,A,$),I=zS().angle(E=>b(E[u])+Math.PI/2).radius(E=>_(E[d])).curve(Fp),k=this.uniqueKeys.map(E=>{const A=this.getLabelDimensions(E).width,$=xL(b(E),g);return A+$}),L={x:ar(k)+h,y:i/2},M=N.appendOrSelect(n,"g.y-axes").attr("role",dt.GROUP).selectAll("path").data(S,E=>E),V=E=>this.uniqueKeys.map(A=>({[u]:A,[d]:E}));M.join(E=>E.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>I(V($)))),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",$=>I(V($)))),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>I(V($))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",dt.GROUP).selectAll("line").data(this.uniqueKeys,E=>E).join(E=>E.append("line").attr("opacity",0).attr("class",A=>`x-axis-${pi(A)}`).attr("stroke-dasharray","0").attr("x1",A=>Zt(b(A),0,L).x).attr("y1",A=>Zt(b(A),0,L).y).attr("x2",A=>Zt(b(A),0,L).x).attr("y2",A=>Zt(b(A),0,L).y).call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Zt(b($),_.range()[0],L).x).attr("y1",$=>Zt(b($),_.range()[0],L).y).attr("x2",$=>Zt(b($),_.range()[1],L).x).attr("y2",$=>Zt(b($),_.range()[1],L).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Zt(b($),_.range()[0],L).x).attr("y1",$=>Zt(b($),_.range()[0],L).y).attr("x2",$=>Zt(b($),_.range()[1],L).x).attr("y2",$=>Zt(b($),_.range()[1],L).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",dt.GROUP).selectAll("text").data(this.uniqueKeys).join(E=>E.append("text").text(A=>A).attr("opacity",0).attr("x",A=>Zt(b(A),_.range()[1]+h,L).x).attr("y",A=>Zt(b(A),_.range()[1]+h,L).y).style("text-anchor",A=>tv(b(A)).textAnchor).style("dominant-baseline",A=>tv(b(A)).dominantBaseline).call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Zt(b($),_.range()[1]+h,L).x).attr("y",$=>Zt(b($),_.range()[1]+h,L).y).end().finally(()=>{const $=x(o,"radar","alignment"),U=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",U)})),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",dt.GROUP).selectAll("path").data(this.groupedDataNormalized,E=>E.name).join(E=>E.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",A=>R(A.name,null,A.data)).style("fill-opacity",Sr.opacity.selected).style("stroke",A=>R(A.name,null,A.data)).call(A=>{const $=A.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),$.attr("opacity",1).attr("d",U=>I(U.data))}),E=>(E.attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>R(A.name,null,A.data)).style("stroke",A=>R(A.name,null,A.data)),E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",$=>I($.data))),E),E=>E.call(A=>{const $=A.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",dt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(E=>x(E,d)!==null)).join(E=>E.append("circle").attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",A=>A[c]),E=>E,E=>E.remove()).attr("class",E=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E[l],originalClassName:pi(E[u])})).attr("cx",E=>Zt(b(E[u]),_(E[d]),L).x).attr("cy",E=>Zt(b(E[u]),_(E[d]),L).y).attr("r",0).attr("opacity",0).style("fill",E=>R(E[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",dt.GROUP).selectAll("rect").data(this.uniqueKeys).join(E=>E.append("rect"),E=>E,E=>E.remove()).attr("x",L.x).attr("y",L.y-m/2).attr("width",_.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",E=>`rotate(${ev(b(E))}, ${L.x}, ${L.y})`);const{code:P,number:H}=x(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",dt.GROUP).selectAll("text").data(We(S)).join(E=>E.append("text").attr("opacity",0).text(A=>H(A,P)).attr("x",A=>Zt(-Math.PI/2,_(A),L).x+f).attr("y",A=>Zt(-Math.PI/2,_(A),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Zt(-Math.PI/2,_($),L).x+f).attr("y",$=>Zt(-Math.PI/2,_($),L).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Qt.CENTER?a=Math.floor((s-i.width)/2):t===Qt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Sr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class g0 extends sh{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,f=h+u;let p,v;if(Array.isArray(d)&&d.length===2)p=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-p);if(m!==0&&m<2&&(d>0&&a===te.VERTICAL||d<0&&a===te.HORIZONTAL?v=p-2:v=p+2),!this.isOutsideZoomedDomain(h,f))return ge({x0:h,x1:f,y0:p,y1:v},a)}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _N extends xe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class v0 extends xt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?Dn.opacity.unselected:Dn.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",Dn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,f=>x(f,0,s));this.areaGenerator=Dc().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>d(f[0])).y1(f=>d(f[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,f=>x(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(x(f,0,s),null,f)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>x(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Dn.opacity.selected).attr("d",this.areaGenerator)}}class y0 extends sh{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(v-p)>0&&Math.abs(v-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===te.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===te.VERTICAL?v+=1:v-=1)}return ge({x0:h,x1:f,y0:p,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class x0 extends mn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",dt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(v)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[y]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const xi=6;class wN extends xt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+xi:30-xi},h=Xi({name:o,children:a}),f=10,p=r/6,v=S=>{const R=h.descendants().reverse(),I=h.links();let k=h,L=h;h.eachBefore(U=>{U.x<k.x&&(k=U),U.x>L.x&&(L=U)});const M=L.x-k.x,V=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,k.x,r,M].join(" ")),P=_.selectAll("g").data(R,U=>U.id),H=this,E=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});E.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),E.append("text").attr("dy","0.31em").attr("x",U=>U._children?-xi:xi).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(E).transition(V).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(V).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const A=w.selectAll("path").data(I,U=>U.target.id),$=A.enter().append("path").attr("d",()=>{const U={x:S.x0,y:S.y0};return b({source:U,target:U})});A.merge($).transition(V).attr("d",b),A.exit().transition(V).remove().attr("d",()=>{const U={x:S.x,y:S.y};return b({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=x(s,"tree","type")===sl.DENDROGRAM?u_().size([i,r-u-y*xi-l]):K_().nodeSize([f,p]).size([i,r-u-y*xi-l]),b=XS().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,R)=>{S.id=R,S._children=S.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const w=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");v(h)}}var SN="#000000",ON="#ffffff",TN="#fcf4d6",MN="#fddc69",CN="#f1c21b",AN="#d2a106",$N="#b28600",RN="#8e6a00",LN="#684e00",kN="#483700",DN="#302400",IN="#1c1500",NN={10:TN,20:MN,30:CN,40:AN,50:$N,60:RN,70:LN,80:kN,90:DN,100:IN},PN="#fff2e8",UN="#ffd9be",BN="#ffb784",HN="#ff832b",VN="#eb6200",FN="#ba4e00",zN="#8a3800",GN="#5e2900",jN="#3e1a00",WN="#231000",qN={10:PN,20:UN,30:BN,40:HN,50:VN,60:FN,70:zN,80:GN,90:jN,100:WN},YN="#fff1f1",XN="#ffd7d9",ZN="#ffb3b8",KN="#ff8389",QN="#fa4d56",JN="#da1e28",tP="#a2191f",eP="#750e13",nP="#520408",rP="#2d0709",iP={10:YN,20:XN,30:ZN,40:KN,50:QN,60:JN,70:tP,80:eP,90:nP,100:rP},sP="#fff0f7",aP="#ffd6e8",oP="#ffafd2",lP="#ff7eb6",cP="#ee5396",uP="#d02670",hP="#9f1853",dP="#740937",fP="#510224",pP="#2a0a18",mP={10:sP,20:aP,30:oP,40:lP,50:cP,60:uP,70:hP,80:dP,90:fP,100:pP},gP="#f6f2ff",vP="#e8daff",yP="#d4bbff",xP="#be95ff",bP="#a56eff",EP="#8a3ffc",_P="#6929c4",wP="#491d8b",SP="#31135e",OP="#1c0f30",TP={10:gP,20:vP,30:yP,40:xP,50:bP,60:EP,70:_P,80:wP,90:SP,100:OP},MP="#edf5ff",CP="#d0e2ff",AP="#a6c8ff",$P="#78a9ff",RP="#4589ff",LP="#0f62fe",kP="#0043ce",DP="#002d9c",IP="#001d6c",NP="#001141",PP={10:MP,20:CP,30:AP,40:$P,50:RP,60:LP,70:kP,80:DP,90:IP,100:NP},UP="#e5f6ff",BP="#bae6ff",HP="#82cfff",VP="#33b1ff",FP="#1192e8",zP="#0072c3",GP="#00539a",jP="#003a6d",WP="#012749",qP="#061727",YP={10:UP,20:BP,30:HP,40:VP,50:FP,60:zP,70:GP,80:jP,90:WP,100:qP},XP="#d9fbfb",ZP="#9ef0f0",KP="#3ddbd9",QP="#08bdba",JP="#009d9a",tU="#007d79",eU="#005d5d",nU="#004144",rU="#022b30",iU="#081a1c",sU={10:XP,20:ZP,30:KP,40:QP,50:JP,60:tU,70:eU,80:nU,90:rU,100:iU},aU="#defbe6",oU="#a7f0ba",lU="#6fdc8c",cU="#42be65",uU="#24a148",hU="#198038",dU="#0e6027",fU="#044317",pU="#022d0d",mU="#071908",gU={10:aU,20:oU,30:lU,40:cU,50:uU,60:hU,70:dU,80:fU,90:pU,100:mU},vU="#f2f4f8",yU="#dde1e6",xU="#c1c7cd",bU="#a2a9b0",EU="#878d96",_U="#697077",wU="#4d5358",SU="#343a3f",OU="#21272a",TU="#121619",MU={10:vU,20:yU,30:xU,40:bU,50:EU,60:_U,70:wU,80:SU,90:OU,100:TU},CU="#f4f4f4",AU="#e0e0e0",$U="#c6c6c6",RU="#a8a8a8",LU="#8d8d8d",kU="#6f6f6f",DU="#525252",IU="#393939",NU="#262626",PU="#161616",UU={10:CU,20:AU,30:$U,40:RU,50:LU,60:kU,70:DU,80:IU,90:NU,100:PU},BU="#f7f3f2",HU="#e5e0df",VU="#cac5c4",FU="#ada8a8",zU="#8f8b8b",GU="#726e6e",jU="#565151",WU="#3c3838",qU="#272525",YU="#171414",XU={10:BU,20:HU,30:VU,40:FU,50:zU,60:GU,70:jU,80:WU,90:qU,100:YU},b0={black:{100:SN},blue:PP,coolGray:MU,cyan:YP,gray:UU,green:gU,magenta:mP,orange:qN,purple:TP,red:iP,teal:sU,warmGray:XU,white:{0:ON},yellow:NN};const ZU=e=>{if(!e)return null;for(const t of Object.keys(b0)){const n=b0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},E0=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=En(t);let r;if(n&&(r=ZU(n?n.hex():null)),r==null){const i=wl(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let KU=0;class QU extends xt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=Xi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=nw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>KU++).merge(u);d.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const h=d.selectAll("rect.leaf").data(f=>[f]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const f=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name,null,f.data)}),d.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${p}`;return new URL(`#${v}`,s)+""}),f=>null,f=>f.remove()),d.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const v=wl(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:v.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(v=>v.text).style("fill",E0).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",E0),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),En(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}class JU extends xt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=ik().size([u,d]).words(i.map(function(p){const v=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:v,value:v}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?We(i):[1,1];return Ze().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=wo(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:_t(t,"locale.translations.group")||_t(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class tB extends xt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=nN(s,Object.values(l)),u=JI(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=NE().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=N.appendOrSelect(t,"defs");N.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",ss()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case bn.geoEqualEarth:t=e_();break;case bn.geoAlbers:t=YE();break;case bn.geoConicEqualArea:t=zf();break;case bn.geoConicEquidistant:t=JE();break;case bn.geoEquirectangular:t=KE();break;case bn.geoMercator:t=XE();break;case bn.geoNaturalEarth1:t=n_();break;default:throw new Error("Projection is not supported.")}return t}}class eB extends tB{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ir.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(_i.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Ir.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(_i.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Ir.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ir.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(_i.HIDE,{event:r,hoveredElement:s})})}}function ah(e){var t=e==null?0:e.length;return t?po(e,1):[]}function nB(e){return lm(hm(e,void 0,ah),e+"")}function _0(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function rB(e,t){return t.length<2?e:tu(e,_0(t,0,-1))}function iB(e,t){return t=fo(t,e),e=rB(e,t),e==null||delete e[ys(ag(t))]}function sB(e){return Sm(e)?void 0:e}var aB=1,oB=2,lB=4,cB=nB(function(e,t){var n={};if(e==null)return n;var r=!1;t=Fc(t,function(s){return s=fo(s,e),r||(r=s.length>1),s}),ri(e,Dm(e),n),r&&(n=xs(n,aB|oB|lB,sB));for(var i=t.length;i--;)iB(n,t[i]);return n});let uB=class extends Bn{zoomIn(t,n,r){let i,s,a;const o=r||li;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||li;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}};class hB extends Bn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class dB extends Bn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class fB extends Bn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(hg,n,"duration")||hg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ds(e,t){const n=Tt(e),r=Tt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function pB(e,t){const n=Tt(e),r=Tt(t);return n.getFullYear()-r.getFullYear()}function mB(e,t){const n=Tt(e),r=Tt(t),i=Ds(n,r),s=Math.abs(pB(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Ds(n,r)===-i,o=i*(s-+a);return o===0?0:o}function oh(e,t){const n=Tt(e);if(isNaN(t))return en(e,NaN);if(!t)return n;const r=n.getDate(),i=en(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const s=i.getDate();return r>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function w0(e,t){return oh(e,t*12)}function gB(e,t){return w0(e,-t)}function vB(e,t){const n=Tt(e),r=Tt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function yB(e){const t=Tt(e);return t.setHours(23,59,59,999),t}function xB(e){const t=Tt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function bB(e){const t=Tt(e);return+yB(t)==+xB(t)}function EB(e,t){const n=Tt(e),r=Tt(t),i=Ds(n,r),s=Math.abs(vB(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=Ds(n,r)===-i;bB(Tt(e))&&s===1&&Ds(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function _B(e,t){return oh(e,-t)}function wB(e,t){const n=Tt(e),r=Tt(t),i=S0(n,r),s=Math.abs(Tg(n,r));n.setDate(n.getDate()-i*s);const a=+(S0(n,r)===-i),o=i*(s-a);return o===0?0:o}function S0(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 O0(e,t){const n=Tt(e);return isNaN(t)?en(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function SB(e,t){return O0(e,-t)}function lh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function ch(e,t){return+Tt(e)-+Tt(t)}function OB(e,t,n){const r=ch(e,t)/wg;return lh(void 0)(r)}function uh(e,t){const n=+Tt(e);return en(e,n+t)}function T0(e,t){return uh(e,t*wg)}function TB(e,t){return T0(e,-t)}function M0(e,t,n){const r=ch(e,t)/_g;return lh(void 0)(r)}function hh(e,t){return uh(e,t*_g)}function C0(e,t){return hh(e,-t)}function A0(e,t,n){const r=ch(e,t)/1e3;return lh(void 0)(r)}function dh(e,t){return uh(e,t*1e3)}function $0(e,t){return dh(e,-t)}class MB extends Bn{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=x(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=x(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 x(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){return this.getAxisOptions(t).title||(t===F.BOTTOM||t===F.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(F).map(t=>F[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}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===F.LEFT||this.rangeAxisPosition===F.RIGHT)&&(this.domainAxisPosition===F.BOTTOM||this.domainAxisPosition===F.TOP)?this.orientation=te.VERTICAL:this.orientation=te.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[F.LEFT])!=null&&t.correspondingDatasets&&a[F.RIGHT]||(n=a[F.RIGHT])!=null&&n.correspondingDatasets&&a[F.LEFT]||(r=a[F.TOP])!=null&&r.correspondingDatasets&&a[F.BOTTOM]||(i=a[F.BOTTOM])!=null&&i.correspondingDatasets&&a[F.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(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]===et.LINEAR||this.scaleTypes[t]===et.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=[F.BOTTOM,F.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[F.LEFT,F.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(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case et.LABELS:c=t(l)+t.step()/2;break;case et.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}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 x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===et.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return CB(n,s)}else return AB(n,Wn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.LEFT)===null&&x(n,F.RIGHT)!==null||x(n,F.RIGHT,"main")===!0||r&&x(n,F.LEFT,"correspondingDatasets")?{primary:F.RIGHT,secondary:F.LEFT}:{primary:F.LEFT,secondary:F.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.BOTTOM)===null&&x(n,F.TOP)!==null||x(n,F.TOP,"main")===!0||r&&x(n,F.BOTTOM,"correspondingDatasets")?{primary:F.TOP,secondary:F.BOTTOM}:{primary:F.BOTTOM,secondary:F.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||et.LINEAR,o=s.scaleType||et.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===et.LABELS||o===et.TIME)&&a===et.LABELS||a===et.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=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||et.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,ar(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=Wn.ratio;if(r.domain)return a===et.LABELS?r.domain:(a===et.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===et.LABELS)return Es(o.map(y=>y[c]));let p,v;const m=this.model.getDataGroupNames();if(a===et.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[f]}`);if(a===et.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),b=o.filter(_=>!m.includes(_[y])),w=[];g.forEach(_=>{const{...S}=_;let R=0,I=0;Object.values(cB(S,"sharedStackKey")).forEach(k=>{isNaN(k)||(k<0?I+=k:R+=k)}),w.push([I,R])}),v=[...ah(w),...b.map(_=>_[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return a!==et.TIME&&a!==et.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=x(y,"value");g!==null&&v.push(g)}),p=We(v),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||et.LINEAR;this.scaleTypes[t]=i;let s;return i===et.TIME?s=Ap():i===et.LOG?s=up().base(r.base||10):i===et.LABELS||i===et.LABELS_RATIO?s=Qi():s=Ze(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===te.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),x(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=x(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((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===et.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=x(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 CB(e,t){const n=new Date(e[0]),r=new Date(e[1]);return mB(r,n)>1?[gB(n,t),w0(r,t)]:EB(r,n)>1?[_B(n,t),oh(r,t)]:wB(r,n)>1?[SB(n,t),O0(r,t)]:OB(r,n)>1?[TB(n,t),T0(r,t)]:M0(r,n)>30?[C0(n,t*30),hh(r,t*30)]:M0(r,n)>1?[C0(n,t),hh(r,t)]:A0(r,n)>15?[$0(n,t*15),dh(r,t*15)]:A0(r,n)>1?[$0(n,t),dh(r,t)]:[n,r]}function AB([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===et.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let $B=class extends Bn{constructor(){super(...arguments),this.curveTypes={curveLinear:Qa,curveLinearClosed:Fp,curveBasis:ZS,curveBasisClosed:KS,curveBasisOpen:QS,curveBundle:JS,curveCardinal:tO,curveCardinalClosed:eO,curveCardinalOpen:nO,curveCatmullRom:rO,curveCatmullRomClosed:iO,curveCatmullRomOpen:sO,curveMonotoneX:aO,curveMonotoneY:oO,curveNatural:lO,curveStep:cO,curveStepAfter:hO,curveStepBefore:uO}}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}},RB=class extends Bn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===F.BOTTOM&&n===et.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=x(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,We(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(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=Ae.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const f=[s.invert(d),s.invert(h)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}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=x(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 x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}};function LB(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:_0(e,t,n)}var kB="\\ud800-\\udfff",DB="\\u0300-\\u036f",IB="\\ufe20-\\ufe2f",NB="\\u20d0-\\u20ff",PB=DB+IB+NB,UB="\\ufe0e\\ufe0f",BB="\\u200d",HB=RegExp("["+BB+kB+PB+UB+"]");function R0(e){return HB.test(e)}function VB(e){return e.split("")}var L0="\\ud800-\\udfff",FB="\\u0300-\\u036f",zB="\\ufe20-\\ufe2f",GB="\\u20d0-\\u20ff",jB=FB+zB+GB,WB="\\ufe0e\\ufe0f",qB="["+L0+"]",fh="["+jB+"]",ph="\\ud83c[\\udffb-\\udfff]",YB="(?:"+fh+"|"+ph+")",k0="[^"+L0+"]",D0="(?:\\ud83c[\\udde6-\\uddff]){2}",I0="[\\ud800-\\udbff][\\udc00-\\udfff]",XB="\\u200d",N0=YB+"?",P0="["+WB+"]?",ZB="(?:"+XB+"(?:"+[k0,D0,I0].join("|")+")"+P0+N0+")*",KB=P0+N0+ZB,QB="(?:"+[k0+fh+"?",fh,D0,I0,qB].join("|")+")",JB=RegExp(ph+"(?="+ph+")|"+QB+KB,"g");function tH(e){return e.match(JB)||[]}function eH(e){return R0(e)?tH(e):VB(e)}function nH(e){return function(t){t=vs(t);var n=R0(t)?eH(t):void 0,r=n?n[0]:t.charAt(0),i=n?LB(n,1).join(""):t.slice(1);return r[e]()+i}}var rH=nH("toUpperCase");function iH(e){return rH(vs(e).toLowerCase())}var sH=Lv(function(e,t,n){return t=t.toLowerCase(),e+(n?iH(t):t)});class rn{constructor(t,n){this.components=[],this.services={canvasZoom:uB,domUtils:N,events:hB,files:dB,gradientUtils:Ts,transitions:fB},this.model=new fn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new nh(this.model,this.services)],growth:ht.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new BI(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new ks(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new Po(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Le(this.model,this.services,[l,...i?[c]:[]],{direction:Ut.ROW,alignItems:Nr.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:x(n,"graphFrameRenderType")||rt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=Ut.COLUMN;if(h){const y=x(r,"legend","position");y==="left"?(f=Ut.ROW,r.legend.orientation||(r.legend.orientation=Si.VERTICAL)):y==="right"?(f=Ut.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Si.VERTICAL)):y==="bottom"&&(f=Ut.COLUMN_REVERSE)}const p={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Le(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new rh(this.model,this.services),new Go(this.model,this.services),new Le(this.model,this.services,m,{direction:Ut.COLUMN})]}}class Oe extends rn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:MB,curves:$B,zoom:RB}),this.model=new Mr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",F.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===F.BOTTOM&&o===et.TIME,c=this.services.zoom.isZoomBarLocked(F.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new ks(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new Po(this.model,this.services)],growth:ht.PREFERRED},f={id:"header",components:[new Le(this.model,this.services,[d,...s?[h]:[]],{direction:Ut.ROW,alignItems:Nr.CENTER})],growth:ht.PREFERRED},p={id:"legend",components:[new nh(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new n0(this.model,this.services),new HI(this.model,this.services)),t.push(new FI(this.model,this.services)),t.push(new zI(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=Ut.COLUMN;if(m){const S=x(this.model.getOptions(),"legend","position");S===wi.LEFT?(y=Ut.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Si.VERTICAL)):S===wi.RIGHT?(y=Ut.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Si.VERTICAL)):S===wi.BOTTOM&&(y=Ut.COLUMN_REVERSE)}const g={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},b={id:"full-frame",components:[new Le(this.model,this.services,[...m?[p]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},w={id:"zoom-bar",components:[new VI(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},_=[];if(u||s){_.push(f);const S={id:"spacer",components:[new Hn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};_.push(S)}return l&&_.push(w),_.push(b),[new a0(this.model,this.services),new Go(this.model,this.services),new Le(this.model,this.services,_,{direction:Ut.COLUMN})]}}class aH extends rn{constructor(t,n){super(t,n),this.model=new tR(this.services),this.model.setOptions(jt(Pt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new GI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class oH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(kn(Pt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Kn(this.model,this.services),new vi(this.model,this.services),new o0(this.model,this.services),new mn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class lH extends Oe{constructor(t,n){super(t,n),this.model=new eR(this.services),this.model.setOptions(jt(Pt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new qI(this.model,this.services),new yi(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class cH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Kn(this.model,this.services),new YI(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class uH extends Oe{constructor(t,n){super(t,n),this.model=new nR(this.services),this.model.setOptions(jt(Pt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new XI(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class hH extends rn{constructor(t,n){super(t,n),this.model=new rR(this.services),this.model.setOptions(jt(Pt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ks(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Po(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Le(this.model,this.services,[a,...i?[o]:[]],{direction:Ut.ROW,alignItems:Nr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new h0(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ut.COLUMN_REVERSE,f={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new Le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new rh(this.model,this.services),new Go(this.model,this.services),new Le(this.model,this.services,v,{direction:Ut.COLUMN})]}getComponents(){const t=[new eB(this.model,this.services)];return this.getChartComponents(t)}}class dH extends rn{constructor(t,n){super(t,n),this.model=new iR(this.services),this.model.setOptions(jt(Pt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new fN(this.model,this.services)];return this.getChartComponents(t)}}const U0={[Ne.LINE]:[vi,mn],[Ne.SCATTER]:[mn],[Ne.AREA]:[o0,vi,mn],[Ne.STACKED_AREA]:[v0,vi,x0,Wo],[Ne.SIMPLE_BAR]:[g0],[Ne.GROUPED_BAR]:[m0,yi],[Ne.STACKED_BAR]:[y0,Wo]};class fH extends Oe{constructor(t,n){super(t,n);const r=jt(Pt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ne.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(U0).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${sH(i.type)}Chart`;return a=lt({},Pt[l],this.model.getOptions(),i.options),i.type===Ne.STACKED_AREA&&(o=!0),U0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return ah(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Ne.STACKED_BAR||i.type===Ne.STACKED_AREA),r=[new Se(this.model,this.services),new ke(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.GRID}),...n?[]:[new Kn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class B0 extends rn{constructor(t,n,r=!1){super(t,n),this.model=new sR(this.services),!r&&(this.model.setOptions(jt(Pt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new d0(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}class pH extends B0{constructor(t,n){super(t,n,!0),this.model.setOptions(jt(Pt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new mN(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.DONUT})];return this.getChartComponents(t)}}class mH extends rn{constructor(t,n){super(t,n),this.model=new aR(this.services),this.model.setOptions(jt(Pt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new gN(this.model,this.services)];return this.getChartComponents(t)}}class gH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new m0(this.model,this.services),new yi(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class vH extends Oe{constructor(t,n){super(t,n),this.model=new oR(this.services),this.model.setOptions(jt(Pt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ks(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Po(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Le(this.model,this.services,[a,...i?[o]:[]],{direction:Ut.ROW,alignItems:Nr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new h0(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ut.COLUMN_REVERSE,f={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new Le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new a0(this.model,this.services),new Go(this.model,this.services),new Le(this.model,this.services,v,{direction:Ut.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new vN(this.model,this.services)];return this.getAxisChartComponents(t)}}class yH extends Oe{constructor(t,n){super(t,n),this.model=new lR(this.services),this.model.setOptions(jt(Pt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new iN(this.model,this.services),new yN(this.model,this.services)];return this.getAxisChartComponents(t)}}class xH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Kn(this.model,this.services),new vi(this.model,this.services),new mn(this.model,this.services,{handleThresholds:!0}),new _N(this.model,this.services),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class bH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Kn(this.model,this.services),new xN(this.model,this.services),new mn(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class EH extends rn{constructor(t,n){var r;super(t,n),this.model=new cR(this.services);const i=(r=n.options.meter)!=null&&r.proportional?lt(kn(Pt.proportionalMeterChart),n.options):lt(kn(Pt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new dN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Hn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new bN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Le(this.model,this.services,t,{direction:Ut.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class _H extends rn{constructor(t,n){super(t,n),this.model=new uR(this.services),this.model.setOptions(jt(Pt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services)];return this.getChartComponents(t)}}class wH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Kn(this.model,this.services),new mn(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class SH extends rn{constructor(t,n){super(t,n),this.model=new hR(this.services),this.model.setOptions(jt(Pt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new wN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class OH extends rn{constructor(t,n){super(t,n),this.model=new dR(this.services),this.model.setOptions(jt(Pt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new QU(this.model,this.services)];return this.getChartComponents(t)}}class TH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new g0(this.model,this.services),new yi(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class MH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Wo(this.model,this.services),new v0(this.model,this.services),new vi(this.model,this.services,{stacked:!0}),new x0(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new xe(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class CH extends Oe{constructor(t,n){super(t,n),this.model.setOptions(jt(Pt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new ke(this.model,this.services),new Wo(this.model,this.services),new y0(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ}),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class AH extends rn{constructor(t,n){super(t,n),this.model=new fR(this.services),this.model.setOptions(jt(Pt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new JU(this.model,this.services),new xe(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}var mh={exports:{}},Is={};/**
85
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:_t(f,"locale.translations.total")||_t(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,di)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,di),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function pN(e,t){const n=Pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class d0 extends xt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ht.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(k=>k[a]>0),l=this.computeRadius();this.arc=cs().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=cs().innerRadius(this.getInnerRadius()).outerRadius(l+Ht.hoverArc.outerRadiusOffset);const c=HS().value(k=>k[a]).sort(x(i,"pie","sortFunction")).padAngle(Ht.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",dt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,k=>k.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",k=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:k.data[s],originalClassName:"slice"})).style("fill",k=>n.model.getFillColor(k.data[s],null,k.data)).attr("d",this.arc).transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",k=>`${k[a]}, ${Ru(k.data[a],o,a)+"%"}`).attrTween("d",function(k){return pN.bind(this)(k,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=x(i,"locale"),f=i.pie.labels.enabled,p=f?c.filter(k=>k.data[a]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",dt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(p,k=>k.data[s]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(k=>i.pie.labels.formatter?i.pie.labels.formatter({...k,percentageValue:Ru(k.data[a],o,a,!0)}):h(Ru(k.data[a],o,a),d)+"%").datum(function(k){const R=l+7,M=(k.endAngle-k.startAngle)/2+k.startAngle,F=M/Math.PI*180,P=this.getComputedTextLength();return k.textOffsetX=P/2,k.textOffsetY=F>90&&F<270?10:0,k.xPosition=(k.textOffsetX+R)*Math.sin(M),k.yPosition=(k.textOffsetY+R)*-Math.cos(M),k}).attr("transform",function(k,R){const M=p.length,F=(k.endAngle-k.startAngle)*(180/Math.PI);if(R>=M-2&&F<Ht.callout.minSliceDegree){let P,H;return k.index===M-1?(P=k.xPosition+Ht.callout.offsetX+Ht.callout.textMargin+k.textOffsetX,H=k.yPosition-Ht.callout.offsetY,k.direction=Oi.RIGHT,y.push(k)):(P=k.xPosition-Ht.callout.offsetX-k.textOffsetX-Ht.callout.textMargin,H=k.yPosition-Ht.callout.offsetY,k.direction=Oi.LEFT,y.push(k)),`translate(${P}, ${H})`}return`translate(${k.xPosition}, ${k.yPosition})`}),this.renderCallouts(y);const g=x(i,"donut")?"donut":"pie",b=x(i,g,"alignment"),{width:w}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),_=f?Ht.xOffset:0,S=f?Ht.yOffset:0;let L=l+_;b===Jt.CENTER?L=w/2:b===Jt.RIGHT&&(L=w-l-Ht.xOffset);let I=l+S;y.length>0&&(I+=Ht.yOffsetCallout),r.attr("x",L+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",dt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",dt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===Oi.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Ht.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Ht.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);Xk(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Ht.radiusOffset:i}}class mN extends d0{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Td:s=Ce;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const f0="4,10 8,6 12,10",p0="12,6 8,10 4,6";class gN extends xt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return kv(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===sr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case Js.UP:return f0;case Js.DOWN:return p0;default:return t>0?f0:p0}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=cs().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=cs().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=x(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;p===Jt.CENTER?m=v/2:p===Jt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===sr.FULL&&!s?d=l(a):r===sr.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=x(n,"locale"),y=x(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(k=>{let R;return k!=null?R=Number(k.toFixed(2))%1!==0?k.toFixed(2):k.toFixed():R=0,y?y(R):m(Number(R),v)});const{width:b}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),w=f/2,_=u?"%":"",S=N.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${w}px`).attr("x",b/2).text(_),{width:L,height:I}=N.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${I/2}px`),p.attr("transform",`translate(-${L/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),f=N.appendOrSelect(n,"g.gauge-numbers"),p=N.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(w=>{let _;return w!=null?_=Number(w.toFixed(2))%1!==0?w.toFixed(2):w.toFixed():_=0,c?`${c(_)}${m}`:`${a(Number(_),s)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),b=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);b.enter().append("svg").merge(b).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const w=D(this);N.appendOrSelect(w,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const _=x(r,"gauge","status");N.appendOrSelect(w,"polygon.gauge-delta-arrow").attr("class",_!==null?`gauge-delta-arrow status--${_}`:"").attr("points",t.getArrow(i))}),b.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===sr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class m0 extends wh{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Os(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Qt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),f=d,p=d+h,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-h/2,w=b+h;if(!this.isOutsideZoomedDomain(b,w))return ge({x0:f,x1:p,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=rs().domain(t).rangeRound([0,this.getGroupWidth()])}}class vN extends xt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const v=this.matrix[r][p].value;if(d===null){d=v,h=v,f=v;return}d+=v,h=v<h?v:h,f=v>f?v:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const v=this.matrix[p][r].value;if(d===null){d=v,h=v,f=v;return}d+=v,h=v<h?v:h,f=v>f?v:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${zn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${zn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[a])}, ${s(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${f})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==Vr.OFF&&(t===Vr.AUTO&&cg.minCellDividerDimension<=this.xBandwidth&&cg.minCellDividerDimension<=this.yBandwidth||t===Vr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=_t(r,"locale.translations.total")||_t(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const f=Cs(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class yN extends xt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>_t(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",dt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=_t(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1),ge({x0:f,x1:p,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=D(this);l.classed("hovered",!0);const c=i(parseFloat(_t(o,"data.x0")),r),u=i(parseFloat(_t(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:_t(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:_t(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){D(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xN extends yn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?In.weight.unselected:In.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",In.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?In.opacity.unselected:In.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",In.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=Pn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Qt.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class bN extends xt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-oe.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-oe.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=Ke().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?oe.height.proportional:oe.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?oe.height.proportional:oe.height.default));const p=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?oe.height.proportional:oe.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b[c],originalClassName:v})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):Math.max(b.width,2)).style("fill",b=>n.model.getFillColor(b[c],null,b)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const m=x(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<a[0].value&&(y=a[0].value>u?u:a[0].value));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>f||(s?oe.height.proportional:oe.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class EN extends xt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=tD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:lt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Or.opacity.unselected:Or.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Or.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Or.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:v,xAxisRectHeight:m}=Or;this.uniqueKeys=Array.from(new Set(s.map(E=>E[u]))),this.uniqueGroups=Array.from(new Set(s.map(E=>E[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),g=(Math.min(r,i)-y)/2;if(g<=0)return;const b=rs().domain(this.fullDataNormalized.map(E=>E[u])).range([0,2*Math.PI].map(E=>E-Math.PI/2)),w=zn(this.fullDataNormalized.map(E=>E[d])),_=Ke().domain([w>=0?0:w,lr(this.fullDataNormalized.map(E=>E[d]))]).range([v,g]).nice(p),S=_.ticks(p),L=(E,A,$)=>this.model.getFillColor(E,A,$),I=zS().angle(E=>b(E[u])+Math.PI/2).radius(E=>_(E[d])).curve(Fp),k=this.uniqueKeys.map(E=>{const A=this.getLabelDimensions(E).width,$=xR(b(E),g);return A+$}),R={x:lr(k)+h,y:i/2},M=N.appendOrSelect(n,"g.y-axes").attr("role",dt.GROUP).selectAll("path").data(S,E=>E),F=E=>this.uniqueKeys.map(A=>({[u]:A,[d]:E}));M.join(E=>E.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>I(F($)))),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",$=>I(F($)))),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>I(F($))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",dt.GROUP).selectAll("line").data(this.uniqueKeys,E=>E).join(E=>E.append("line").attr("opacity",0).attr("class",A=>`x-axis-${yi(A)}`).attr("stroke-dasharray","0").attr("x1",A=>Xt(b(A),0,R).x).attr("y1",A=>Xt(b(A),0,R).y).attr("x2",A=>Xt(b(A),0,R).x).attr("y2",A=>Xt(b(A),0,R).y).call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Xt(b($),_.range()[0],R).x).attr("y1",$=>Xt(b($),_.range()[0],R).y).attr("x2",$=>Xt(b($),_.range()[1],R).x).attr("y2",$=>Xt(b($),_.range()[1],R).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Xt(b($),_.range()[0],R).x).attr("y1",$=>Xt(b($),_.range()[0],R).y).attr("x2",$=>Xt(b($),_.range()[1],R).x).attr("y2",$=>Xt(b($),_.range()[1],R).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",dt.GROUP).selectAll("text").data(this.uniqueKeys).join(E=>E.append("text").text(A=>A).attr("opacity",0).attr("x",A=>Xt(b(A),_.range()[1]+h,R).x).attr("y",A=>Xt(b(A),_.range()[1]+h,R).y).style("text-anchor",A=>tv(b(A)).textAnchor).style("dominant-baseline",A=>tv(b(A)).dominantBaseline).call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Xt(b($),_.range()[1]+h,R).x).attr("y",$=>Xt(b($),_.range()[1]+h,R).y).end().finally(()=>{const $=x(o,"radar","alignment"),U=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",U)})),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",dt.GROUP).selectAll("path").data(this.groupedDataNormalized,E=>E.name).join(E=>E.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",A=>L(A.name,null,A.data)).style("fill-opacity",Or.opacity.selected).style("stroke",A=>L(A.name,null,A.data)).call(A=>{const $=A.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),$.attr("opacity",1).attr("d",U=>I(U.data))}),E=>(E.attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>L(A.name,null,A.data)).style("stroke",A=>L(A.name,null,A.data)),E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",$=>I($.data))),E),E=>E.call(A=>{const $=A.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",dt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(E=>x(E,d)!==null)).join(E=>E.append("circle").attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",A=>A[c]),E=>E,E=>E.remove()).attr("class",E=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E[l],originalClassName:yi(E[u])})).attr("cx",E=>Xt(b(E[u]),_(E[d]),R).x).attr("cy",E=>Xt(b(E[u]),_(E[d]),R).y).attr("r",0).attr("opacity",0).style("fill",E=>L(E[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",dt.GROUP).selectAll("rect").data(this.uniqueKeys).join(E=>E.append("rect"),E=>E,E=>E.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",_.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",E=>`rotate(${ev(b(E))}, ${R.x}, ${R.y})`);const{code:P,number:H}=x(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",dt.GROUP).selectAll("text").data(qe(S)).join(E=>E.append("text").attr("opacity",0).text(A=>H(A,P)).attr("x",A=>Xt(-Math.PI/2,_(A),R).x+f).attr("y",A=>Xt(-Math.PI/2,_(A),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Xt(-Math.PI/2,_($),R).x+f).attr("y",$=>Xt(-Math.PI/2,_($),R).y)),E=>E.call(A=>A.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Jt.CENTER?a=Math.floor((s-i.width)/2):t===Jt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${yi(i)}`),o=t.parent.selectAll(`.dots circle.${yi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Or.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${yi(i)}`),o=t.parent.selectAll(`.dots circle.${yi(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class g0 extends wh{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,f=h+u;let p,v;if(Array.isArray(d)&&d.length===2)p=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-p);if(m!==0&&m<2&&(d>0&&a===Qt.VERTICAL||d<0&&a===Qt.HORIZONTAL?v=p-2:v=p+2),!this.isOutsideZoomedDomain(h,f))return ge({x0:h,x1:f,y0:p,y1:v},a)}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _N extends xe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class v0 extends xt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?Dn.opacity.unselected:Dn.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",Dn.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({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,f=>x(f,0,s));this.areaGenerator=Qc().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>d(f[0])).y1(f=>d(f[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,f=>x(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(x(f,0,s),null,f)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>x(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Dn.opacity.selected).attr("d",this.areaGenerator)}}class y0 extends wh{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(v-p)>0&&Math.abs(v-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=1:v-=1)}return ge({x0:h,x1:f,y0:p,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class x0 extends yn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",dt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(v)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[y]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const wi=6;class wN extends xt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+wi:30-wi},h=ts({name:o,children:a}),f=10,p=r/6,v=S=>{const L=h.descendants().reverse(),I=h.links();let k=h,R=h;h.eachBefore(U=>{U.x<k.x&&(k=U),U.x>R.x&&(R=U)});const M=R.x-k.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,k.x,r,M].join(" ")),P=_.selectAll("g").data(L,U=>U.id),H=this,E=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});E.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),E.append("text").attr("dy","0.31em").attr("x",U=>U._children?-wi:wi).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(E).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const A=w.selectAll("path").data(I,U=>U.target.id),$=A.enter().append("path").attr("d",()=>{const U={x:S.x0,y:S.y0};return b({source:U,target:U})});A.merge($).transition(F).attr("d",b),A.exit().transition(F).remove().attr("d",()=>{const U={x:S.x,y:S.y};return b({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=x(s,"tree","type")===Qs.DENDROGRAM?u_().size([i,r-u-y*wi-l]):K_().nodeSize([f,p]).size([i,r-u-y*wi-l]),b=ZS().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,L)=>{S.id=L,S._children=S.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const w=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");v(h)}}var SN="#000000",TN="#ffffff",ON="#fcf4d6",MN="#fddc69",CN="#f1c21b",AN="#d2a106",$N="#b28600",LN="#8e6a00",RN="#684e00",kN="#483700",DN="#302400",IN="#1c1500",NN={10:ON,20:MN,30:CN,40:AN,50:$N,60:LN,70:RN,80:kN,90:DN,100:IN},PN="#fff2e8",UN="#ffd9be",BN="#ffb784",HN="#ff832b",VN="#eb6200",FN="#ba4e00",zN="#8a3800",GN="#5e2900",jN="#3e1a00",WN="#231000",qN={10:PN,20:UN,30:BN,40:HN,50:VN,60:FN,70:zN,80:GN,90:jN,100:WN},YN="#fff1f1",ZN="#ffd7d9",XN="#ffb3b8",KN="#ff8389",QN="#fa4d56",JN="#da1e28",tP="#a2191f",eP="#750e13",nP="#520408",rP="#2d0709",iP={10:YN,20:ZN,30:XN,40:KN,50:QN,60:JN,70:tP,80:eP,90:nP,100:rP},sP="#fff0f7",aP="#ffd6e8",oP="#ffafd2",lP="#ff7eb6",cP="#ee5396",uP="#d02670",hP="#9f1853",dP="#740937",fP="#510224",pP="#2a0a18",mP={10:sP,20:aP,30:oP,40:lP,50:cP,60:uP,70:hP,80:dP,90:fP,100:pP},gP="#f6f2ff",vP="#e8daff",yP="#d4bbff",xP="#be95ff",bP="#a56eff",EP="#8a3ffc",_P="#6929c4",wP="#491d8b",SP="#31135e",TP="#1c0f30",OP={10:gP,20:vP,30:yP,40:xP,50:bP,60:EP,70:_P,80:wP,90:SP,100:TP},MP="#edf5ff",CP="#d0e2ff",AP="#a6c8ff",$P="#78a9ff",LP="#4589ff",RP="#0f62fe",kP="#0043ce",DP="#002d9c",IP="#001d6c",NP="#001141",PP={10:MP,20:CP,30:AP,40:$P,50:LP,60:RP,70:kP,80:DP,90:IP,100:NP},UP="#e5f6ff",BP="#bae6ff",HP="#82cfff",VP="#33b1ff",FP="#1192e8",zP="#0072c3",GP="#00539a",jP="#003a6d",WP="#012749",qP="#061727",YP={10:UP,20:BP,30:HP,40:VP,50:FP,60:zP,70:GP,80:jP,90:WP,100:qP},ZP="#d9fbfb",XP="#9ef0f0",KP="#3ddbd9",QP="#08bdba",JP="#009d9a",tU="#007d79",eU="#005d5d",nU="#004144",rU="#022b30",iU="#081a1c",sU={10:ZP,20:XP,30:KP,40:QP,50:JP,60:tU,70:eU,80:nU,90:rU,100:iU},aU="#defbe6",oU="#a7f0ba",lU="#6fdc8c",cU="#42be65",uU="#24a148",hU="#198038",dU="#0e6027",fU="#044317",pU="#022d0d",mU="#071908",gU={10:aU,20:oU,30:lU,40:cU,50:uU,60:hU,70:dU,80:fU,90:pU,100:mU},vU="#f2f4f8",yU="#dde1e6",xU="#c1c7cd",bU="#a2a9b0",EU="#878d96",_U="#697077",wU="#4d5358",SU="#343a3f",TU="#21272a",OU="#121619",MU={10:vU,20:yU,30:xU,40:bU,50:EU,60:_U,70:wU,80:SU,90:TU,100:OU},CU="#f4f4f4",AU="#e0e0e0",$U="#c6c6c6",LU="#a8a8a8",RU="#8d8d8d",kU="#6f6f6f",DU="#525252",IU="#393939",NU="#262626",PU="#161616",UU={10:CU,20:AU,30:$U,40:LU,50:RU,60:kU,70:DU,80:IU,90:NU,100:PU},BU="#f7f3f2",HU="#e5e0df",VU="#cac5c4",FU="#ada8a8",zU="#8f8b8b",GU="#726e6e",jU="#565151",WU="#3c3838",qU="#272525",YU="#171414",ZU={10:BU,20:HU,30:VU,40:FU,50:zU,60:GU,70:jU,80:WU,90:qU,100:YU},b0={black:{100:SN},blue:PP,coolGray:MU,cyan:YP,gray:UU,green:gU,magenta:mP,orange:qN,purple:OP,red:iP,teal:sU,warmGray:ZU,white:{0:TN},yellow:NN};const XU=e=>{if(!e)return null;for(const t of Object.keys(b0)){const n=b0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},E0=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=En(t);let r;if(n&&(r=XU(n?n.hex():null)),r==null){const i=Vl(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let KU=0;class QU extends xt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ts({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=nw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>KU++).merge(u);d.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const h=d.selectAll("rect.leaf").data(f=>[f]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const f=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name,null,f.data)}),d.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${p}`;return new URL(`#${v}`,s)+""}),f=>null,f=>f.remove()),d.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const v=Vl(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:v.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(v=>v.text).style("fill",E0).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",E0),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),En(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}class JU extends xt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=ik().size([u,d]).words(i.map(function(p){const v=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:v,value:v}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?qe(i):[1,1];return Ke().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Oo(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:_t(t,"locale.translations.group")||_t(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class tB extends xt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=nN(s,Object.values(l)),u=JI(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=NE().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=N.appendOrSelect(t,"defs");N.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",us()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case cn.geoEqualEarth:t=e_();break;case cn.geoAlbers:t=YE();break;case cn.geoConicEqualArea:t=zf();break;case cn.geoConicEquidistant:t=JE();break;case cn.geoEquirectangular:t=KE();break;case cn.geoMercator:t=ZE();break;case cn.geoNaturalEarth1:t=n_();break;default:throw new Error("Projection is not supported.")}return t}}class eB extends tB{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ur.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Pr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Ur.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Pr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Ur.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ur.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Pr.HIDE,{event:r,hoveredElement:s})})}}function Sh(e){var t=e==null?0:e.length;return t?vo(e,1):[]}function nB(e){return lm(hm(e,void 0,Sh),e+"")}function _0(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function rB(e,t){return t.length<2?e:yu(e,_0(t,0,-1))}function iB(e,t){return t=go(t,e),e=rB(e,t),e==null||delete e[ws(ag(t))]}function sB(e){return Sm(e)?void 0:e}var aB=1,oB=2,lB=4,cB=nB(function(e,t){var n={};if(e==null)return n;var r=!1;t=au(t,function(s){return s=go(s,e),r||(r=s.length>1),s}),oi(e,Dm(e),n),r&&(n=Ss(n,aB|oB|lB,sB));for(var i=t.length;i--;)iB(n,t[i]);return n});let uB=class extends Bn{zoomIn(t,n,r){let i,s,a;const o=r||di;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||di;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}};class hB extends Bn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class dB extends Bn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class fB extends Bn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(T.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(hg,n,"duration")||hg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Bs(e,t){const n=Ot(e),r=Ot(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function pB(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()-r.getFullYear()}function mB(e,t){const n=Ot(e),r=Ot(t),i=Bs(n,r),s=Math.abs(pB(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Bs(n,r)===-i,o=i*(s-+a);return o===0?0:o}function Th(e,t){const n=Ot(e);if(isNaN(t))return nn(e,NaN);if(!t)return n;const r=n.getDate(),i=nn(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const s=i.getDate();return r>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function w0(e,t){return Th(e,t*12)}function gB(e,t){return w0(e,-t)}function vB(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function yB(e){const t=Ot(e);return t.setHours(23,59,59,999),t}function xB(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function bB(e){const t=Ot(e);return+yB(t)==+xB(t)}function EB(e,t){const n=Ot(e),r=Ot(t),i=Bs(n,r),s=Math.abs(vB(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=Bs(n,r)===-i;bB(Ot(e))&&s===1&&Bs(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function _B(e,t){return Th(e,-t)}function wB(e,t){const n=Ot(e),r=Ot(t),i=S0(n,r),s=Math.abs(Og(n,r));n.setDate(n.getDate()-i*s);const a=+(S0(n,r)===-i),o=i*(s-a);return o===0?0:o}function S0(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 T0(e,t){const n=Ot(e);return isNaN(t)?nn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function SB(e,t){return T0(e,-t)}function Oh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Mh(e,t){return+Ot(e)-+Ot(t)}function TB(e,t,n){const r=Mh(e,t)/wg;return Oh(void 0)(r)}function Ch(e,t){const n=+Ot(e);return nn(e,n+t)}function O0(e,t){return Ch(e,t*wg)}function OB(e,t){return O0(e,-t)}function M0(e,t,n){const r=Mh(e,t)/_g;return Oh(void 0)(r)}function Ah(e,t){return Ch(e,t*_g)}function C0(e,t){return Ah(e,-t)}function A0(e,t,n){const r=Mh(e,t)/1e3;return Oh(void 0)(r)}function $h(e,t){return Ch(e,t*1e3)}function $0(e,t){return $h(e,-t)}class MB extends Bn{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=x(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=x(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 x(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){return this.getAxisOptions(t).title||(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(t=>z[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}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=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[z.LEFT])!=null&&t.correspondingDatasets&&a[z.RIGHT]||(n=a[z.RIGHT])!=null&&n.correspondingDatasets&&a[z.LEFT]||(r=a[z.TOP])!=null&&r.correspondingDatasets&&a[z.BOTTOM]||(i=a[z.BOTTOM])!=null&&i.correspondingDatasets&&a[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(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]===et.LINEAR||this.scaleTypes[t]===et.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(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case et.LABELS:c=t(l)+t.step()/2;break;case et.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}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 x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===et.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return CB(n,s)}else return AB(n,Wn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.LEFT)===null&&x(n,z.RIGHT)!==null||x(n,z.RIGHT,"main")===!0||r&&x(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.BOTTOM)===null&&x(n,z.TOP)!==null||x(n,z.TOP,"main")===!0||r&&x(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=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||et.LINEAR,o=s.scaleType||et.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===et.LABELS||o===et.TIME)&&a===et.LABELS||a===et.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=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||et.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,lr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=Wn.ratio;if(r.domain)return a===et.LABELS?r.domain:(a===et.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===et.LABELS)return Os(o.map(y=>y[c]));let p,v;const m=this.model.getDataGroupNames();if(a===et.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[f]}`);if(a===et.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),b=o.filter(_=>!m.includes(_[y])),w=[];g.forEach(_=>{const{...S}=_;let L=0,I=0;Object.values(cB(S,"sharedStackKey")).forEach(k=>{isNaN(k)||(k<0?I+=k:L+=k)}),w.push([I,L])}),v=[...Sh(w),...b.map(_=>_[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return a!==et.TIME&&a!==et.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=x(y,"value");g!==null&&v.push(g)}),p=qe(v),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||et.LINEAR;this.scaleTypes[t]=i;let s;return i===et.TIME?s=Ap():i===et.LOG?s=up().base(r.base||10):i===et.LABELS||i===et.LABELS_RATIO?s=rs():s=Ke(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Qt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),x(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=x(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((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===et.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=x(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 CB(e,t){const n=new Date(e[0]),r=new Date(e[1]);return mB(r,n)>1?[gB(n,t),w0(r,t)]:EB(r,n)>1?[_B(n,t),Th(r,t)]:wB(r,n)>1?[SB(n,t),T0(r,t)]:TB(r,n)>1?[OB(n,t),O0(r,t)]:M0(r,n)>30?[C0(n,t*30),Ah(r,t*30)]:M0(r,n)>1?[C0(n,t),Ah(r,t)]:A0(r,n)>15?[$0(n,t*15),$h(r,t*15)]:A0(r,n)>1?[$0(n,t),$h(r,t)]:[n,r]}function AB([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===et.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let $B=class extends Bn{constructor(){super(...arguments),this.curveTypes={curveLinear:eo,curveLinearClosed:Fp,curveBasis:XS,curveBasisClosed:KS,curveBasisOpen:QS,curveBundle:JS,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}},LB=class extends Bn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===et.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=x(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,qe(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 x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=$e.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const f=[s.invert(d),s.invert(h)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}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=x(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 x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}};function RB(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:_0(e,t,n)}var kB="\\ud800-\\udfff",DB="\\u0300-\\u036f",IB="\\ufe20-\\ufe2f",NB="\\u20d0-\\u20ff",PB=DB+IB+NB,UB="\\ufe0e\\ufe0f",BB="\\u200d",HB=RegExp("["+BB+kB+PB+UB+"]");function L0(e){return HB.test(e)}function VB(e){return e.split("")}var R0="\\ud800-\\udfff",FB="\\u0300-\\u036f",zB="\\ufe20-\\ufe2f",GB="\\u20d0-\\u20ff",jB=FB+zB+GB,WB="\\ufe0e\\ufe0f",qB="["+R0+"]",Lh="["+jB+"]",Rh="\\ud83c[\\udffb-\\udfff]",YB="(?:"+Lh+"|"+Rh+")",k0="[^"+R0+"]",D0="(?:\\ud83c[\\udde6-\\uddff]){2}",I0="[\\ud800-\\udbff][\\udc00-\\udfff]",ZB="\\u200d",N0=YB+"?",P0="["+WB+"]?",XB="(?:"+ZB+"(?:"+[k0,D0,I0].join("|")+")"+P0+N0+")*",KB=P0+N0+XB,QB="(?:"+[k0+Lh+"?",Lh,D0,I0,qB].join("|")+")",JB=RegExp(Rh+"(?="+Rh+")|"+QB+KB,"g");function tH(e){return e.match(JB)||[]}function eH(e){return L0(e)?tH(e):VB(e)}function nH(e){return function(t){t=_s(t);var n=L0(t)?eH(t):void 0,r=n?n[0]:t.charAt(0),i=n?RB(n,1).join(""):t.slice(1);return r[e]()+i}}var rH=nH("toUpperCase");function iH(e){return rH(_s(e).toLowerCase())}var sH=Rv(function(e,t,n){return t=t.toLowerCase(),e+(n?iH(t):t)});class sn{constructor(t,n){this.components=[],this.services={canvasZoom:uB,domUtils:N,events:hB,files:dB,gradientUtils:Ls,transitions:fB},this.model=new gn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(T.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(T.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(T.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new bh(this.model,this.services)],growth:ht.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new BI(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Us(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new Ho(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new ke(this.model,this.services,[l,...i?[c]:[]],{direction:Pt.ROW,alignItems:ir.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:x(n,"graphFrameRenderType")||rt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=Pt.COLUMN;if(h){const y=x(r,"legend","position");y==="left"?(f=Pt.ROW,r.legend.orientation||(r.legend.orientation=Hr.VERTICAL)):y==="right"?(f=Pt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Hr.VERTICAL)):y==="bottom"&&(f=Pt.COLUMN_REVERSE)}const p={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new ke(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new Eh(this.model,this.services),new qo(this.model,this.services),new ke(this.model,this.services,m,{direction:Pt.COLUMN})]}}class Te extends sn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:MB,curves:$B,zoom:LB}),this.model=new Ar(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",z.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===et.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Us(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new Ho(this.model,this.services)],growth:ht.PREFERRED},f={id:"header",components:[new ke(this.model,this.services,[d,...s?[h]:[]],{direction:Pt.ROW,alignItems:ir.CENTER})],growth:ht.PREFERRED},p={id:"legend",components:[new bh(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new n0(this.model,this.services),new HI(this.model,this.services)),t.push(new FI(this.model,this.services)),t.push(new zI(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=Pt.COLUMN;if(m){const S=x(this.model.getOptions(),"legend","position");S===Br.LEFT?(y=Pt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Hr.VERTICAL)):S===Br.RIGHT?(y=Pt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Hr.VERTICAL)):S===Br.BOTTOM&&(y=Pt.COLUMN_REVERSE)}const g={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},b={id:"full-frame",components:[new ke(this.model,this.services,[...m?[p]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},w={id:"zoom-bar",components:[new VI(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},_=[];if(u||s){_.push(f);const S={id:"spacer",components:[new Hn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};_.push(S)}return l&&_.push(w),_.push(b),[new a0(this.model,this.services),new qo(this.model,this.services),new ke(this.model,this.services,_,{direction:Pt.COLUMN})]}}class aH extends sn{constructor(t,n){super(t,n),this.model=new tL(this.services),this.model.setOptions(jt(Ut.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new GI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class oH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(kn(Ut.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Kn(this.model,this.services),new Ei(this.model,this.services),new o0(this.model,this.services),new yn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class lH extends Te{constructor(t,n){super(t,n),this.model=new eL(this.services),this.model.setOptions(jt(Ut.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new qI(this.model,this.services),new _i(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class cH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Kn(this.model,this.services),new YI(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class uH extends Te{constructor(t,n){super(t,n),this.model=new nL(this.services),this.model.setOptions(jt(Ut.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new ZI(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class hH extends sn{constructor(t,n){super(t,n),this.model=new rL(this.services),this.model.setOptions(jt(Ut.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Us(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Ho(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new ke(this.model,this.services,[a,...i?[o]:[]],{direction:Pt.ROW,alignItems:ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new h0(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Pt.COLUMN_REVERSE,f={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new ke(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new Eh(this.model,this.services),new qo(this.model,this.services),new ke(this.model,this.services,v,{direction:Pt.COLUMN})]}getComponents(){const t=[new eB(this.model,this.services)];return this.getChartComponents(t)}}class dH extends sn{constructor(t,n){super(t,n),this.model=new iL(this.services),this.model.setOptions(jt(Ut.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new fN(this.model,this.services)];return this.getChartComponents(t)}}const U0={[Oe.LINE]:[Ei,yn],[Oe.SCATTER]:[yn],[Oe.AREA]:[o0,Ei,yn],[Oe.STACKED_AREA]:[v0,Ei,x0,Zo],[Oe.SIMPLE_BAR]:[g0],[Oe.GROUPED_BAR]:[m0,_i],[Oe.STACKED_BAR]:[y0,Zo]};class fH extends Te{constructor(t,n){super(t,n);const r=jt(Ut.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Oe.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(U0).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${sH(i.type)}Chart`;return a=lt({},Ut[l],this.model.getOptions(),i.options),i.type===Oe.STACKED_AREA&&(o=!0),U0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Sh(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Oe.STACKED_BAR||i.type===Oe.STACKED_AREA),r=[new Se(this.model,this.services),new De(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID}),...n?[]:[new Kn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class B0 extends sn{constructor(t,n,r=!1){super(t,n),this.model=new sL(this.services),!r&&(this.model.setOptions(jt(Ut.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new d0(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}class pH extends B0{constructor(t,n){super(t,n,!0),this.model.setOptions(jt(Ut.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new mN(this.model,this.services),new xe(this.model,this.services,{skeleton:te.DONUT})];return this.getChartComponents(t)}}class mH extends sn{constructor(t,n){super(t,n),this.model=new aL(this.services),this.model.setOptions(jt(Ut.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new gN(this.model,this.services)];return this.getChartComponents(t)}}class gH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new m0(this.model,this.services),new _i(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class vH extends Te{constructor(t,n){super(t,n),this.model=new oL(this.services),this.model.setOptions(jt(Ut.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Us(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Ho(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new ke(this.model,this.services,[a,...i?[o]:[]],{direction:Pt.ROW,alignItems:ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new h0(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Pt.COLUMN_REVERSE,f={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new ke(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new a0(this.model,this.services),new qo(this.model,this.services),new ke(this.model,this.services,v,{direction:Pt.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new vN(this.model,this.services)];return this.getAxisChartComponents(t)}}class yH extends Te{constructor(t,n){super(t,n),this.model=new lL(this.services),this.model.setOptions(jt(Ut.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new iN(this.model,this.services),new yN(this.model,this.services)];return this.getAxisChartComponents(t)}}class xH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Kn(this.model,this.services),new Ei(this.model,this.services),new yn(this.model,this.services,{handleThresholds:!0}),new _N(this.model,this.services),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class bH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Kn(this.model,this.services),new xN(this.model,this.services),new yn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class EH extends sn{constructor(t,n){var r;super(t,n),this.model=new cL(this.services);const i=(r=n.options.meter)!=null&&r.proportional?lt(kn(Ut.proportionalMeterChart),n.options):lt(kn(Ut.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new dN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Hn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new bN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new ke(this.model,this.services,t,{direction:Pt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class _H extends sn{constructor(t,n){super(t,n),this.model=new uL(this.services),this.model.setOptions(jt(Ut.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services)];return this.getChartComponents(t)}}class wH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Kn(this.model,this.services),new yn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class SH extends sn{constructor(t,n){super(t,n),this.model=new hL(this.services),this.model.setOptions(jt(Ut.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new wN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class TH extends sn{constructor(t,n){super(t,n),this.model=new dL(this.services),this.model.setOptions(jt(Ut.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new QU(this.model,this.services)];return this.getChartComponents(t)}}class OH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new g0(this.model,this.services),new _i(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class MH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Zo(this.model,this.services),new v0(this.model,this.services),new Ei(this.model,this.services,{stacked:!0}),new x0(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class CH extends Te{constructor(t,n){super(t,n),this.model.setOptions(jt(Ut.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new De(this.model,this.services),new Zo(this.model,this.services),new y0(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ}),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class AH extends sn{constructor(t,n){super(t,n),this.model=new fL(this.services),this.model.setOptions(jt(Ut.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new JU(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}var kh={exports:{}},Hs={};/**
86
86
  * @license React
87
87
  * react-jsx-runtime.production.min.js
88
88
  *
@@ -90,7 +90,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
90
90
  *
91
91
  * This source code is licensed under the MIT license found in the
92
92
  * LICENSE file in the root directory of this source tree.
93
- */var H0;function $H(){if(H0)return Is;H0=1;var e=le,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,c){var u,d={},h=null,f=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:o,key:h,ref:f,props:d,_owner:i.current}}return Is.Fragment=n,Is.jsx=a,Is.jsxs=a,Is}var Ns={};/**
93
+ */var H0;function $H(){if(H0)return Hs;H0=1;var e=le,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,c){var u,d={},h=null,f=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:o,key:h,ref:f,props:d,_owner:i.current}}return Hs.Fragment=n,Hs.jsx=a,Hs.jsxs=a,Hs}var Vs={};/**
94
94
  * @license React
95
95
  * react-jsx-runtime.development.js
96
96
  *
@@ -98,22 +98,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
98
98
  *
99
99
  * This source code is licensed under the MIT license found in the
100
100
  * LICENSE file in the root directory of this source tree.
101
- */var V0;function RH(){return V0||(V0=1,process.env.NODE_ENV!=="production"&&function(){var e=le,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function m(C){if(C===null||typeof C!="object")return null;var j=p&&C[p]||C[v];return typeof j=="function"?j:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(C){{for(var j=arguments.length,Z=new Array(j>1?j-1:0),ut=1;ut<j;ut++)Z[ut-1]=arguments[ut];b("error",C,Z)}}function b(C,j,Z){{var ut=y.ReactDebugCurrentFrame,wt=ut.getStackAddendum();wt!==""&&(j+="%s",Z=Z.concat([wt]));var Dt=Z.map(function(T){return String(T)});Dt.unshift("Warning: "+j),Function.prototype.apply.call(console[C],console,Dt)}}var w=!1,_=!1,S=!1,R=!1,I=!1,k;k=Symbol.for("react.module.reference");function L(C){return!!(typeof C=="string"||typeof C=="function"||C===r||C===s||I||C===i||C===c||C===u||R||C===f||w||_||S||typeof C=="object"&&C!==null&&(C.$$typeof===h||C.$$typeof===d||C.$$typeof===a||C.$$typeof===o||C.$$typeof===l||C.$$typeof===k||C.getModuleId!==void 0))}function M(C,j,Z){var ut=C.displayName;if(ut)return ut;var wt=j.displayName||j.name||"";return wt!==""?Z+"("+wt+")":Z}function V(C){return C.displayName||"Context"}function P(C){if(C==null)return null;if(typeof C.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case o:var j=C;return V(j)+".Consumer";case a:var Z=C;return V(Z._context)+".Provider";case l:return M(C,C.render,"ForwardRef");case d:var ut=C.displayName||null;return ut!==null?ut:P(C.type)||"Memo";case h:{var wt=C,Dt=wt._payload,T=wt._init;try{return P(T(Dt))}catch{return null}}}return null}var H=Object.assign,E=0,A,$,U,B,W,K,Q;function ft(){}ft.__reactDisabledLog=!0;function st(){{if(E===0){A=console.log,$=console.info,U=console.warn,B=console.error,W=console.group,K=console.groupCollapsed,Q=console.groupEnd;var C={configurable:!0,enumerable:!0,value:ft,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}E++}}function gt(){{if(E--,E===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},C,{value:A}),info:H({},C,{value:$}),warn:H({},C,{value:U}),error:H({},C,{value:B}),group:H({},C,{value:W}),groupCollapsed:H({},C,{value:K}),groupEnd:H({},C,{value:Q})})}E<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=y.ReactCurrentDispatcher,nt;function pt(C,j,Z){{if(nt===void 0)try{throw Error()}catch(wt){var ut=wt.stack.trim().match(/\n( *(at )?)/);nt=ut&&ut[1]||""}return`
102
- `+nt+C}}var q=!1,tt;{var ct=typeof WeakMap=="function"?WeakMap:Map;tt=new ct}function z(C,j){if(!C||q)return"";{var Z=tt.get(C);if(Z!==void 0)return Z}var ut;q=!0;var wt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Dt;Dt=X.current,X.current=null,st();try{if(j){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(Gt){ut=Gt}Reflect.construct(C,[],T)}else{try{T.call()}catch(Gt){ut=Gt}C.call(T.prototype)}}else{try{throw Error()}catch(Gt){ut=Gt}C()}}catch(Gt){if(Gt&&ut&&typeof Gt.stack=="string"){for(var G=Gt.stack.split(`
103
- `),Y=ut.stack.split(`
104
- `),ot=G.length-1,vt=Y.length-1;ot>=1&&vt>=0&&G[ot]!==Y[vt];)vt--;for(;ot>=1&&vt>=0;ot--,vt--)if(G[ot]!==Y[vt]){if(ot!==1||vt!==1)do if(ot--,vt--,vt<0||G[ot]!==Y[vt]){var St=`
105
- `+G[ot].replace(" at new "," at ");return C.displayName&&St.includes("<anonymous>")&&(St=St.replace("<anonymous>",C.displayName)),typeof C=="function"&&tt.set(C,St),St}while(ot>=1&&vt>=0);break}}}finally{q=!1,X.current=Dt,gt(),Error.prepareStackTrace=wt}var pe=C?C.displayName||C.name:"",Jt=pe?pt(pe):"";return typeof C=="function"&&tt.set(C,Jt),Jt}function Mt(C,j,Z){return z(C,!1)}function Et(C){var j=C.prototype;return!!(j&&j.isReactComponent)}function qt(C,j,Z){if(C==null)return"";if(typeof C=="function")return z(C,Et(C));if(typeof C=="string")return pt(C);switch(C){case c:return pt("Suspense");case u:return pt("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case l:return Mt(C.render);case d:return qt(C.type,j,Z);case h:{var ut=C,wt=ut._payload,Dt=ut._init;try{return qt(Dt(wt),j,Z)}catch{}}}return""}var Nt=Object.prototype.hasOwnProperty,it={},At=y.ReactDebugCurrentFrame;function De(C){if(C){var j=C._owner,Z=qt(C.type,C._source,j?j.type:null);At.setExtraStackFrame(Z)}else At.setExtraStackFrame(null)}function Ie(C,j,Z,ut,wt){{var Dt=Function.call.bind(Nt);for(var T in C)if(Dt(C,T)){var G=void 0;try{if(typeof C[T]!="function"){var Y=Error((ut||"React class")+": "+Z+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}G=C[T](j,T,ut,Z,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ot){G=ot}G&&!(G instanceof Error)&&(De(wt),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ut||"React class",Z,T,typeof G),De(null)),G instanceof Error&&!(G.message in it)&&(it[G.message]=!0,De(wt),g("Failed %s type: %s",Z,G.message),De(null))}}}var gh=Array.isArray;function Rr(C){return gh(C)}function Lr(C){{var j=typeof Symbol=="function"&&Symbol.toStringTag,Z=j&&C[Symbol.toStringTag]||C.constructor.name||"Object";return Z}}function tr(C){try{return Vn(C),!1}catch{return!0}}function Vn(C){return""+C}function Ps(C){if(tr(C))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lr(C)),Vn(C)}var er=y.ReactCurrentOwner,qo={key:!0,ref:!0,__self:!0,__source:!0},bi,Us,nr;nr={};function Ei(C){if(Nt.call(C,"ref")){var j=Object.getOwnPropertyDescriptor(C,"ref").get;if(j&&j.isReactWarning)return!1}return C.ref!==void 0}function sn(C){if(Nt.call(C,"key")){var j=Object.getOwnPropertyDescriptor(C,"key").get;if(j&&j.isReactWarning)return!1}return C.key!==void 0}function rr(C,j){if(typeof C.ref=="string"&&er.current&&j&&er.current.stateNode!==j){var Z=P(er.current.type);nr[Z]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(er.current.type),C.ref),nr[Z]=!0)}}function Bs(C,j){{var Z=function(){bi||(bi=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",j))};Z.isReactWarning=!0,Object.defineProperty(C,"key",{get:Z,configurable:!0})}}function Hs(C,j){{var Z=function(){Us||(Us=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",j))};Z.isReactWarning=!0,Object.defineProperty(C,"ref",{get:Z,configurable:!0})}}var vh=function(C,j,Z,ut,wt,Dt,T){var G={$$typeof:t,type:C,key:j,ref:Z,props:T,_owner:Dt};return G._store={},Object.defineProperty(G._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(G,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ut}),Object.defineProperty(G,"_source",{configurable:!1,enumerable:!1,writable:!1,value:wt}),Object.freeze&&(Object.freeze(G.props),Object.freeze(G)),G};function kr(C,j,Z,ut,wt){{var Dt,T={},G=null,Y=null;Z!==void 0&&(Ps(Z),G=""+Z),sn(j)&&(Ps(j.key),G=""+j.key),Ei(j)&&(Y=j.ref,rr(j,wt));for(Dt in j)Nt.call(j,Dt)&&!qo.hasOwnProperty(Dt)&&(T[Dt]=j[Dt]);if(C&&C.defaultProps){var ot=C.defaultProps;for(Dt in ot)T[Dt]===void 0&&(T[Dt]=ot[Dt])}if(G||Y){var vt=typeof C=="function"?C.displayName||C.name||"Unknown":C;G&&Bs(T,vt),Y&&Hs(T,vt)}return vh(C,G,Y,wt,ut,er.current,T)}}var Vs=y.ReactCurrentOwner,Yo=y.ReactDebugCurrentFrame;function zt(C){if(C){var j=C._owner,Z=qt(C.type,C._source,j?j.type:null);Yo.setExtraStackFrame(Z)}else Yo.setExtraStackFrame(null)}var gn;gn=!1;function Fs(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function zs(){{if(Vs.current){var C=P(Vs.current.type);if(C)return`
101
+ */var V0;function LH(){return V0||(V0=1,process.env.NODE_ENV!=="production"&&function(){var e=le,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function m(C){if(C===null||typeof C!="object")return null;var W=p&&C[p]||C[v];return typeof W=="function"?W:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(C){{for(var W=arguments.length,K=new Array(W>1?W-1:0),ut=1;ut<W;ut++)K[ut-1]=arguments[ut];b("error",C,K)}}function b(C,W,K){{var ut=y.ReactDebugCurrentFrame,wt=ut.getStackAddendum();wt!==""&&(W+="%s",K=K.concat([wt]));var Dt=K.map(function(O){return String(O)});Dt.unshift("Warning: "+W),Function.prototype.apply.call(console[C],console,Dt)}}var w=!1,_=!1,S=!1,L=!1,I=!1,k;k=Symbol.for("react.module.reference");function R(C){return!!(typeof C=="string"||typeof C=="function"||C===r||C===s||I||C===i||C===c||C===u||L||C===f||w||_||S||typeof C=="object"&&C!==null&&(C.$$typeof===h||C.$$typeof===d||C.$$typeof===a||C.$$typeof===o||C.$$typeof===l||C.$$typeof===k||C.getModuleId!==void 0))}function M(C,W,K){var ut=C.displayName;if(ut)return ut;var wt=W.displayName||W.name||"";return wt!==""?K+"("+wt+")":K}function F(C){return C.displayName||"Context"}function P(C){if(C==null)return null;if(typeof C.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case o:var W=C;return F(W)+".Consumer";case a:var K=C;return F(K._context)+".Provider";case l:return M(C,C.render,"ForwardRef");case d:var ut=C.displayName||null;return ut!==null?ut:P(C.type)||"Memo";case h:{var wt=C,Dt=wt._payload,O=wt._init;try{return P(O(Dt))}catch{return null}}}return null}var H=Object.assign,E=0,A,$,U,B,q,Q,J;function ft(){}ft.__reactDisabledLog=!0;function st(){{if(E===0){A=console.log,$=console.info,U=console.warn,B=console.error,q=console.group,Q=console.groupCollapsed,J=console.groupEnd;var C={configurable:!0,enumerable:!0,value:ft,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}E++}}function gt(){{if(E--,E===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},C,{value:A}),info:H({},C,{value:$}),warn:H({},C,{value:U}),error:H({},C,{value:B}),group:H({},C,{value:q}),groupCollapsed:H({},C,{value:Q}),groupEnd:H({},C,{value:J})})}E<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=y.ReactCurrentDispatcher,nt;function pt(C,W,K){{if(nt===void 0)try{throw Error()}catch(wt){var ut=wt.stack.trim().match(/\n( *(at )?)/);nt=ut&&ut[1]||""}return`
102
+ `+nt+C}}var Y=!1,tt;{var ct=typeof WeakMap=="function"?WeakMap:Map;tt=new ct}function G(C,W){if(!C||Y)return"";{var K=tt.get(C);if(K!==void 0)return K}var ut;Y=!0;var wt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Dt;Dt=X.current,X.current=null,st();try{if(W){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(Gt){ut=Gt}Reflect.construct(C,[],O)}else{try{O.call()}catch(Gt){ut=Gt}C.call(O.prototype)}}else{try{throw Error()}catch(Gt){ut=Gt}C()}}catch(Gt){if(Gt&&ut&&typeof Gt.stack=="string"){for(var j=Gt.stack.split(`
103
+ `),Z=ut.stack.split(`
104
+ `),ot=j.length-1,vt=Z.length-1;ot>=1&&vt>=0&&j[ot]!==Z[vt];)vt--;for(;ot>=1&&vt>=0;ot--,vt--)if(j[ot]!==Z[vt]){if(ot!==1||vt!==1)do if(ot--,vt--,vt<0||j[ot]!==Z[vt]){var St=`
105
+ `+j[ot].replace(" at new "," at ");return C.displayName&&St.includes("<anonymous>")&&(St=St.replace("<anonymous>",C.displayName)),typeof C=="function"&&tt.set(C,St),St}while(ot>=1&&vt>=0);break}}}finally{Y=!1,X.current=Dt,gt(),Error.prepareStackTrace=wt}var pe=C?C.displayName||C.name:"",ne=pe?pt(pe):"";return typeof C=="function"&&tt.set(C,ne),ne}function Mt(C,W,K){return G(C,!1)}function Et(C){var W=C.prototype;return!!(W&&W.isReactComponent)}function qt(C,W,K){if(C==null)return"";if(typeof C=="function")return G(C,Et(C));if(typeof C=="string")return pt(C);switch(C){case c:return pt("Suspense");case u:return pt("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case l:return Mt(C.render);case d:return qt(C.type,W,K);case h:{var ut=C,wt=ut._payload,Dt=ut._init;try{return qt(Dt(wt),W,K)}catch{}}}return""}var Nt=Object.prototype.hasOwnProperty,it={},$t=y.ReactDebugCurrentFrame;function Ie(C){if(C){var W=C._owner,K=qt(C.type,C._source,W?W.type:null);$t.setExtraStackFrame(K)}else $t.setExtraStackFrame(null)}function Ne(C,W,K,ut,wt){{var Dt=Function.call.bind(Nt);for(var O in C)if(Dt(C,O)){var j=void 0;try{if(typeof C[O]!="function"){var Z=Error((ut||"React class")+": "+K+" type `"+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[O]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}j=C[O](W,O,ut,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ot){j=ot}j&&!(j instanceof Error)&&(Ie(wt),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ut||"React class",K,O,typeof j),Ie(null)),j instanceof Error&&!(j.message in it)&&(it[j.message]=!0,Ie(wt),g("Failed %s type: %s",K,j.message),Ie(null))}}}var Dh=Array.isArray;function kr(C){return Dh(C)}function Dr(C){{var W=typeof Symbol=="function"&&Symbol.toStringTag,K=W&&C[Symbol.toStringTag]||C.constructor.name||"Object";return K}}function tr(C){try{return Vn(C),!1}catch{return!0}}function Vn(C){return""+C}function Fs(C){if(tr(C))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dr(C)),Vn(C)}var er=y.ReactCurrentOwner,Xo={key:!0,ref:!0,__self:!0,__source:!0},Si,zs,nr;nr={};function Ti(C){if(Nt.call(C,"ref")){var W=Object.getOwnPropertyDescriptor(C,"ref").get;if(W&&W.isReactWarning)return!1}return C.ref!==void 0}function an(C){if(Nt.call(C,"key")){var W=Object.getOwnPropertyDescriptor(C,"key").get;if(W&&W.isReactWarning)return!1}return C.key!==void 0}function rr(C,W){if(typeof C.ref=="string"&&er.current&&W&&er.current.stateNode!==W){var K=P(er.current.type);nr[K]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(er.current.type),C.ref),nr[K]=!0)}}function Gs(C,W){{var K=function(){Si||(Si=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};K.isReactWarning=!0,Object.defineProperty(C,"key",{get:K,configurable:!0})}}function js(C,W){{var K=function(){zs||(zs=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};K.isReactWarning=!0,Object.defineProperty(C,"ref",{get:K,configurable:!0})}}var Ih=function(C,W,K,ut,wt,Dt,O){var j={$$typeof:t,type:C,key:W,ref:K,props:O,_owner:Dt};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ut}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:wt}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function Ir(C,W,K,ut,wt){{var Dt,O={},j=null,Z=null;K!==void 0&&(Fs(K),j=""+K),an(W)&&(Fs(W.key),j=""+W.key),Ti(W)&&(Z=W.ref,rr(W,wt));for(Dt in W)Nt.call(W,Dt)&&!Xo.hasOwnProperty(Dt)&&(O[Dt]=W[Dt]);if(C&&C.defaultProps){var ot=C.defaultProps;for(Dt in ot)O[Dt]===void 0&&(O[Dt]=ot[Dt])}if(j||Z){var vt=typeof C=="function"?C.displayName||C.name||"Unknown":C;j&&Gs(O,vt),Z&&js(O,vt)}return Ih(C,j,Z,wt,ut,er.current,O)}}var Ws=y.ReactCurrentOwner,Ko=y.ReactDebugCurrentFrame;function zt(C){if(C){var W=C._owner,K=qt(C.type,C._source,W?W.type:null);Ko.setExtraStackFrame(K)}else Ko.setExtraStackFrame(null)}var xn;xn=!1;function qs(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function Ys(){{if(Ws.current){var C=P(Ws.current.type);if(C)return`
106
106
 
107
- Check the render method of \``+C+"`."}return""}}function Gs(C){return""}var js={};function Xo(C){{var j=zs();if(!j){var Z=typeof C=="string"?C:C.displayName||C.name;Z&&(j=`
107
+ Check the render method of \``+C+"`."}return""}}function Zs(C){return""}var Xs={};function Qo(C){{var W=Ys();if(!W){var K=typeof C=="string"?C:C.displayName||C.name;K&&(W=`
108
108
 
109
- Check the top-level render call using <`+Z+">.")}return j}}function Zo(C,j){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var Z=Xo(j);if(js[Z])return;js[Z]=!0;var ut="";C&&C._owner&&C._owner!==Vs.current&&(ut=" It was passed a child from "+P(C._owner.type)+"."),zt(C),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Z,ut),zt(null)}}function Ws(C,j){{if(typeof C!="object")return;if(Rr(C))for(var Z=0;Z<C.length;Z++){var ut=C[Z];Fs(ut)&&Zo(ut,j)}else if(Fs(C))C._store&&(C._store.validated=!0);else if(C){var wt=m(C);if(typeof wt=="function"&&wt!==C.entries)for(var Dt=wt.call(C),T;!(T=Dt.next()).done;)Fs(T.value)&&Zo(T.value,j)}}}function Ko(C){{var j=C.type;if(j==null||typeof j=="string")return;var Z;if(typeof j=="function")Z=j.propTypes;else if(typeof j=="object"&&(j.$$typeof===l||j.$$typeof===d))Z=j.propTypes;else return;if(Z){var ut=P(j);Ie(Z,C.props,"prop",ut,C)}else if(j.PropTypes!==void 0&&!gn){gn=!0;var wt=P(j);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",wt||"Unknown")}typeof j.getDefaultProps=="function"&&!j.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yh(C){{for(var j=Object.keys(C.props),Z=0;Z<j.length;Z++){var ut=j[Z];if(ut!=="children"&&ut!=="key"){zt(C),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ut),zt(null);break}}C.ref!==null&&(zt(C),g("Invalid attribute `ref` supplied to `React.Fragment`."),zt(null))}}var vn={};function Dr(C,j,Z,ut,wt,Dt){{var T=L(C);if(!T){var G="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(G+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=Gs();Y?G+=Y:G+=zs();var ot;C===null?ot="null":Rr(C)?ot="array":C!==void 0&&C.$$typeof===t?(ot="<"+(P(C.type)||"Unknown")+" />",G=" Did you accidentally export a JSX literal instead of a component?"):ot=typeof C,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ot,G)}var vt=kr(C,j,Z,wt,Dt);if(vt==null)return vt;if(T){var St=j.children;if(St!==void 0)if(ut)if(Rr(St)){for(var pe=0;pe<St.length;pe++)Ws(St[pe],C);Object.freeze&&Object.freeze(St)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ws(St,C)}if(Nt.call(j,"key")){var Jt=P(C),Gt=Object.keys(j).filter(function(xh){return xh!=="key"}),ie=Gt.length>0?"{key: someKey, "+Gt.join(": ..., ")+": ...}":"{key: someKey}";if(!vn[Jt+ie]){var nl=Gt.length>0?"{"+Gt.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
109
+ Check the top-level render call using <`+K+">.")}return W}}function Jo(C,W){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var K=Qo(W);if(Xs[K])return;Xs[K]=!0;var ut="";C&&C._owner&&C._owner!==Ws.current&&(ut=" It was passed a child from "+P(C._owner.type)+"."),zt(C),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,ut),zt(null)}}function Ks(C,W){{if(typeof C!="object")return;if(kr(C))for(var K=0;K<C.length;K++){var ut=C[K];qs(ut)&&Jo(ut,W)}else if(qs(C))C._store&&(C._store.validated=!0);else if(C){var wt=m(C);if(typeof wt=="function"&&wt!==C.entries)for(var Dt=wt.call(C),O;!(O=Dt.next()).done;)qs(O.value)&&Jo(O.value,W)}}}function tl(C){{var W=C.type;if(W==null||typeof W=="string")return;var K;if(typeof W=="function")K=W.propTypes;else if(typeof W=="object"&&(W.$$typeof===l||W.$$typeof===d))K=W.propTypes;else return;if(K){var ut=P(W);Ne(K,C.props,"prop",ut,C)}else if(W.PropTypes!==void 0&&!xn){xn=!0;var wt=P(W);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",wt||"Unknown")}typeof W.getDefaultProps=="function"&&!W.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nh(C){{for(var W=Object.keys(C.props),K=0;K<W.length;K++){var ut=W[K];if(ut!=="children"&&ut!=="key"){zt(C),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ut),zt(null);break}}C.ref!==null&&(zt(C),g("Invalid attribute `ref` supplied to `React.Fragment`."),zt(null))}}var bn={};function Nr(C,W,K,ut,wt,Dt){{var O=R(C);if(!O){var j="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Z=Zs();Z?j+=Z:j+=Ys();var ot;C===null?ot="null":kr(C)?ot="array":C!==void 0&&C.$$typeof===t?(ot="<"+(P(C.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):ot=typeof C,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ot,j)}var vt=Ir(C,W,K,wt,Dt);if(vt==null)return vt;if(O){var St=W.children;if(St!==void 0)if(ut)if(kr(St)){for(var pe=0;pe<St.length;pe++)Ks(St[pe],C);Object.freeze&&Object.freeze(St)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ks(St,C)}if(Nt.call(W,"key")){var ne=P(C),Gt=Object.keys(W).filter(function(Ph){return Ph!=="key"}),ie=Gt.length>0?"{key: someKey, "+Gt.join(": ..., ")+": ...}":"{key: someKey}";if(!bn[ne+ie]){var sl=Gt.length>0?"{"+Gt.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
110
110
  let props = %s;
111
111
  <%s {...props} />
112
112
  React keys must be passed directly to JSX without using spread:
113
113
  let props = %s;
114
- <%s key={someKey} {...props} />`,ie,Jt,nl,Jt),vn[Jt+ie]=!0}}return C===r?yh(vt):Ko(vt),vt}}function Qo(C,j,Z){return Dr(C,j,Z,!0)}function Jo(C,j,Z){return Dr(C,j,Z,!1)}var tl=Jo,el=Qo;Ns.Fragment=r,Ns.jsx=tl,Ns.jsxs=el}()),Ns}process.env.NODE_ENV==="production"?mh.exports=$H():mh.exports=RH();var Wt=mh.exports;class Ft extends le.PureComponent{constructor(){super(...arguments);bh(this,"chart");bh(this,"chartRef",le.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return Wt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class LH extends Ft{createChart(t,n,r){return new aH(t,{data:n,options:r})}}class kH extends Ft{createChart(t,n,r){return new oH(t,{data:n,options:r})}}class DH extends Ft{createChart(t,n,r){return new lH(t,{data:n,options:r})}}class IH extends Ft{createChart(t,n,r){return new cH(t,{data:n,options:r})}}class NH extends Ft{createChart(t,n,r){return new uH(t,{data:n,options:r})}}class F0 extends Ft{createChart(t,n,r){return new hH(t,{data:n,options:r})}}class PH extends Ft{createChart(t,n,r){return new dH(t,{data:n,options:r})}}class UH extends Ft{createChart(t,n,r){return new fH(t,{data:n,options:r})}}class BH extends Ft{createChart(t,n,r){return new pH(t,{data:n,options:r})}}class HH extends Ft{createChart(t,n,r){return new mH(t,{data:n,options:r})}}class VH extends Ft{createChart(t,n,r){return new gH(t,{data:n,options:r})}}class FH extends Ft{createChart(t,n,r){return new vH(t,{data:n,options:r})}}class zH extends Ft{createChart(t,n,r){return new yH(t,{data:n,options:r})}}class GH extends Ft{createChart(t,n,r){return new xH(t,{data:n,options:r})}}class jH extends Ft{createChart(t,n,r){return new bH(t,{data:n,options:r})}}class WH extends Ft{createChart(t,n,r){return new EH(t,{data:n,options:r})}}class qH extends Ft{createChart(t,n,r){return new B0(t,{data:n,options:r})}}class YH extends Ft{createChart(t,n,r){return new _H(t,{data:n,options:r})}}class XH extends Ft{createChart(t,n,r){return new wH(t,{data:n,options:r})}}class ZH extends Ft{createChart(t,n,r){return new TH(t,{data:n,options:r})}}class KH extends Ft{createChart(t,n,r){return new MH(t,{data:n,options:r})}}class QH extends Ft{createChart(t,n,r){return new CH(t,{data:n,options:r})}}class JH extends Ft{createChart(t,n,r){return new SH(t,{data:n,options:r})}}class t3 extends Ft{createChart(t,n,r){return new OH(t,{data:n,options:r})}}class e3 extends Ft{createChart(t,n,r){return new AH(t,{data:n,options:r})}}var z0={exports:{}};/*!
114
+ <%s key={someKey} {...props} />`,ie,ne,sl,ne),bn[ne+ie]=!0}}return C===r?Nh(vt):tl(vt),vt}}function el(C,W,K){return Nr(C,W,K,!0)}function nl(C,W,K){return Nr(C,W,K,!1)}var rl=nl,il=el;Vs.Fragment=r,Vs.jsx=rl,Vs.jsxs=il}()),Vs}process.env.NODE_ENV==="production"?kh.exports=$H():kh.exports=LH();var Wt=kh.exports;class Ft extends le.PureComponent{constructor(){super(...arguments);Uh(this,"chart");Uh(this,"chartRef",le.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return Wt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class RH extends Ft{createChart(t,n,r){return new aH(t,{data:n,options:r})}}class kH extends Ft{createChart(t,n,r){return new oH(t,{data:n,options:r})}}class DH extends Ft{createChart(t,n,r){return new lH(t,{data:n,options:r})}}class IH extends Ft{createChart(t,n,r){return new cH(t,{data:n,options:r})}}class NH extends Ft{createChart(t,n,r){return new uH(t,{data:n,options:r})}}class F0 extends Ft{createChart(t,n,r){return new hH(t,{data:n,options:r})}}class PH extends Ft{createChart(t,n,r){return new dH(t,{data:n,options:r})}}class UH extends Ft{createChart(t,n,r){return new fH(t,{data:n,options:r})}}class BH extends Ft{createChart(t,n,r){return new pH(t,{data:n,options:r})}}class HH extends Ft{createChart(t,n,r){return new mH(t,{data:n,options:r})}}class VH extends Ft{createChart(t,n,r){return new gH(t,{data:n,options:r})}}class FH extends Ft{createChart(t,n,r){return new vH(t,{data:n,options:r})}}class zH extends Ft{createChart(t,n,r){return new yH(t,{data:n,options:r})}}class GH extends Ft{createChart(t,n,r){return new xH(t,{data:n,options:r})}}class jH extends Ft{createChart(t,n,r){return new bH(t,{data:n,options:r})}}class WH extends Ft{createChart(t,n,r){return new EH(t,{data:n,options:r})}}class qH extends Ft{createChart(t,n,r){return new B0(t,{data:n,options:r})}}class YH extends Ft{createChart(t,n,r){return new _H(t,{data:n,options:r})}}class ZH extends Ft{createChart(t,n,r){return new wH(t,{data:n,options:r})}}class XH extends Ft{createChart(t,n,r){return new OH(t,{data:n,options:r})}}class KH extends Ft{createChart(t,n,r){return new MH(t,{data:n,options:r})}}class QH extends Ft{createChart(t,n,r){return new CH(t,{data:n,options:r})}}class JH extends Ft{createChart(t,n,r){return new SH(t,{data:n,options:r})}}class t3 extends Ft{createChart(t,n,r){return new TH(t,{data:n,options:r})}}class e3 extends Ft{createChart(t,n,r){return new AH(t,{data:n,options:r})}}var z0={exports:{}};/*!
115
115
  Copyright (c) 2018 Jed Watson.
116
116
  Licensed under the MIT License (MIT), see
117
117
  http://jedwatson.github.io/classnames
118
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(z0);var n3=z0.exports;const Qn=uv(n3),Jn="cds",r3=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${Jn}--cc--card-node`,u=Qn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return Wt.jsx(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o,children:n})},i3=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Jn}--cc--card-node`,i=Qn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Wt.jsx("div",{className:i,...n,children:e})},s3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("label",{className:r,...t,children:e})},a3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},o3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},l3=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Jn}--cc--edge`,c=Qn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=sN(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Wt.jsxs("g",{className:c,...o,children:[Wt.jsx("path",{d:u,className:`${l}__container`}),Wt.jsx("path",{d:u,className:`${l}__outer`}),Wt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},$r=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${Jn}--cc--marker`,h=Qn(d,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return Wt.jsx("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:Wt.jsx("path",{d:t,style:{fill:e}})})},c3=e=>Wt.jsx($r,{d:aN.d,...e}),u3=e=>Wt.jsx($r,{d:oN.d,...e}),h3=e=>Wt.jsx($r,{d:lN.d,...e}),d3=e=>Wt.jsx($r,{d:cN.d,...e}),f3=e=>Wt.jsx($r,{d:uN.d,...e}),p3=e=>Wt.jsx($r,{d:hN.d,...e}),m3=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const f=o?"a":h.onClick?"button":t,p=`${Jn}--cc--shape-node`,v=Qn(p,{[`${p}--stacked`]:c,[`${p}--${e}`]:e,[`${p}--${f}`]:f,[r]:r}),m=n?Wt.jsx("div",{className:`${p}__title`,children:n}):null,y=i?Wt.jsx("div",{className:`${p}__subtitle`,children:i}):null,g=s?Wt.jsx("div",{className:`${p}__description`,children:s}):null;return Wt.jsxs(f,{className:v,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[Wt.jsx("div",{className:`${p}__icon`,children:a}),Wt.jsxs("div",{className:`${p}__body`,style:{position:d},children:[m,y,g]})]})};J.Alignments=Qt,J.AlluvialChart=LH,J.AreaChart=kH,J.ArrowLeftMarker=c3,J.ArrowRightMarker=u3,J.BoxplotChart=DH,J.BubbleChart=IH,J.BulletChart=NH,J.CardNode=r3,J.CardNodeColumn=i3,J.CardNodeLabel=s3,J.CardNodeSubtitle=a3,J.CardNodeTitle=o3,J.ChartTheme=il,J.ChoroplethChart=F0,J.CircleMarker=h3,J.CirclePackChart=PH,J.ComboChart=UH,J.DiamondMarker=d3,J.DonutChart=BH,J.Edge=l3,J.ExperimentalChoroplethChart=F0,J.GaugeChart=HH,J.GroupedBarChart=VH,J.HeatmapChart=FH,J.HistogramChart=zH,J.LineChart=GH,J.LollipopChart=jH,J.Marker=$r,J.MeterChart=WH,J.PieChart=qH,J.RadarChart=YH,J.ScaleTypes=et,J.ScatterChart=XH,J.ShapeNode=m3,J.SimpleBarChart=ZH,J.SquareMarker=f3,J.StackedAreaChart=KH,J.StackedBarChart=QH,J.TeeMarker=p3,J.TreeChart=JH,J.TreemapChart=t3,J.WordCloudChart=e3,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
118
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(z0);var n3=z0.exports;const Qn=uv(n3),Jn="cds",r3=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${Jn}--cc--card-node`,u=Qn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return Wt.jsx(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o,children:n})},i3=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Jn}--cc--card-node`,i=Qn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Wt.jsx("div",{className:i,...n,children:e})},s3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("label",{className:r,...t,children:e})},a3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},o3=({children:e,...t})=>{const n=`${Jn}--cc--card-node`,r=Qn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},l3=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Jn}--cc--edge`,c=Qn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=sN(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Wt.jsxs("g",{className:c,...o,children:[Wt.jsx("path",{d:u,className:`${l}__container`}),Wt.jsx("path",{d:u,className:`${l}__outer`}),Wt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Rr=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${Jn}--cc--marker`,h=Qn(d,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return Wt.jsx("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:Wt.jsx("path",{d:t,style:{fill:e}})})},c3=e=>Wt.jsx(Rr,{d:aN.d,...e}),u3=e=>Wt.jsx(Rr,{d:oN.d,...e}),h3=e=>Wt.jsx(Rr,{d:lN.d,...e}),d3=e=>Wt.jsx(Rr,{d:cN.d,...e}),f3=e=>Wt.jsx(Rr,{d:uN.d,...e}),p3=e=>Wt.jsx(Rr,{d:hN.d,...e}),m3=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const f=o?"a":h.onClick?"button":t,p=`${Jn}--cc--shape-node`,v=Qn(p,{[`${p}--stacked`]:c,[`${p}--${e}`]:e,[`${p}--${f}`]:f,[r]:r}),m=n?Wt.jsx("div",{className:`${p}__title`,children:n}):null,y=i?Wt.jsx("div",{className:`${p}__subtitle`,children:i}):null,g=s?Wt.jsx("div",{className:`${p}__description`,children:s}):null;return Wt.jsxs(f,{className:v,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[Wt.jsx("div",{className:`${p}__icon`,children:a}),Wt.jsxs("div",{className:`${p}__body`,style:{position:d},children:[m,y,g]})]})};V.Alignments=Jt,V.AlluvialChart=RH,V.AreaChart=kH,V.AreaEvent=fl,V.ArrowDirections=Js,V.ArrowLeftMarker=c3,V.ArrowRightMarker=u3,V.AxisEvent=dl,V.AxisFlavor=$i,V.AxisPositions=z,V.AxisTitleOrientations=ta,V.BarEvent=vl,V.BoxplotChart=DH,V.BoxplotEvent=yl,V.BubbleChart=IH,V.BulletChart=NH,V.CalloutDirections=Oi,V.CanvasZoomEvent=hl,V.CardNode=r3,V.CardNodeColumn=i3,V.CardNodeLabel=s3,V.CardNodeSubtitle=a3,V.CardNodeTitle=o3,V.CartesianOrientations=Qt,V.ChartEvent=Fn,V.ChartTheme=Tl,V.ChartTypes=Oe,V.ChoroplethChart=F0,V.CircleMarker=h3,V.CirclePackChart=PH,V.ColorClassNameTypes=at,V.ColorLegendType=Ai,V.ComboChart=UH,V.DiamondMarker=d3,V.DividerStatus=Vr,V.DominantBaseline=ln,V.DonutChart=BH,V.Edge=l3,V.ExperimentalChoroplethChart=F0,V.GaugeChart=HH,V.GaugeEvent=gl,V.GaugeTypes=sr,V.GroupedBarChart=VH,V.HeatmapChart=FH,V.HistogramChart=zH,V.LayoutAlignItems=ir,V.LayoutDirection=Pt,V.LayoutGrowth=ht,V.LegendItemType=ee,V.LegendOrientations=Hr,V.LegendPositions=Br,V.LineChart=GH,V.LineEvent=bl,V.LollipopChart=jH,V.Marker=Rr,V.MeterChart=WH,V.ModalEvent=ol,V.ModelEvent=ll,V.PieChart=qH,V.PieEvent=ml,V.Projection=cn,V.RadarChart=YH,V.RadarEvent=El,V.RenderTypes=rt,V.ScaleTypes=et,V.ScatterChart=ZH,V.ScatterEvent=xl,V.ShapeNode=m3,V.SimpleBarChart=XH,V.Skeletons=te,V.SquareMarker=f3,V.StackedAreaChart=KH,V.StackedBarChart=QH,V.Statuses=Mi,V.TeeMarker=p3,V.TextAnchor=on,V.ThresholdEvent=Sl,V.TickRotations=Ci,V.ToolbarControlTypes=Ct,V.TooltipEvent=Pr,V.TreeChart=JH,V.TreeEvent=_l,V.TreeTypes=Qs,V.TreemapChart=t3,V.TreemapEvent=wl,V.TruncationTypes=Pe,V.WordCloudChart=e3,V.WordCloudEvent=pl,V.ZoomBarTypes=We,V.ZoomDomainEvent=ul,V.ZoombarEvent=cl,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
119
119
  //# sourceMappingURL=index.js.map