@carbon/charts-react 1.13.19 → 1.13.21

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(Q,ae){typeof exports=="object"&&typeof module<"u"?ae(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ae):(Q=typeof globalThis<"u"?globalThis:Q||self,ae(Q.ChartsReact={},Q.React))})(this,function(Q,ae){"use strict";var zV=Object.defineProperty;var jV=(Q,ae,Hn)=>ae in Q?zV(Q,ae,{enumerable:!0,configurable:!0,writable:!0,value:Hn}):Q[ae]=Hn;var ch=(Q,ae,Hn)=>(jV(Q,typeof ae!="symbol"?ae+"":ae,Hn),Hn);var Hn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Hn||{}),hh=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(hh||{}),dh=(e=>(e.UPDATE="model-update",e))(dh||{}),fh=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(fh||{}),ph=(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))(ph||{}),mh=(e=>(e.CHANGE="zoom-domain-change",e))(mh||{}),gh=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(gh||{}),vh=(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))(vh||{}),yh=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(yh||{}),xh=(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))(xh||{}),bh=(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))(bh||{}),Eh=(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))(Eh||{}),_h=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(_h||{}),wh=(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))(wh||{}),Sh=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Sh||{}),Oh=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Oh||{}),Th=(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))(Th||{}),Mh=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Mh||{}),Ch=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Ch||{}),wi=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(wi||{}),Ah=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Ah||{}),$h=(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))($h||{}),Rh=(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))(Rh||{}),Lh=(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))(Lh||{}),Dh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Dh||{}),kh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(kh||{}),kr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(kr||{});const j0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Lh,Area:yh,Axis:vh,Bar:_h,Boxplot:wh,CanvasZoom:gh,Chart:Hn,Choropleth:kr,CirclePack:Rh,Gauge:Eh,Heatmap:kh,Legend:$h,Line:Oh,Meter:Dh,Modal:hh,Model:dh,Pie:bh,Radar:Th,Scatter:Sh,Threshold:Ah,Toolbar:fh,Tooltip:wi,Tree:Mh,Treemap:Ch,WordCloud:xh,ZoomBar:ph,ZoomDomain:mh},Symbol.toStringTag,{value:"Module"})),O=j0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),Ih=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Ih||{}),ot=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(ot||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),rn=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(rn||{}),Fe=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Fe||{}),ee=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(ee||{}),et=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(et||{}),Si=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Si||{}),Kt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Kt||{}),Oi=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Oi||{}),Qo=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Qo||{}),kt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(kt||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),Ir=(e=>(e.CENTER="center",e))(Ir||{}),Fs=(e=>(e.LEFT="left",e.RIGHT="right",e))(Fs||{}),Qt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Qt||{}),mn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(mn||{}),gn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(gn||{}),Nr=(e=>(e.SEMI="semi",e.FULL="full",e))(Nr||{}),Jo=(e=>(e.UP="up",e.DOWN="down",e))(Jo||{}),Gs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Gs||{}),zs=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(zs||{}),ke=(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))(ke||{}),jt=(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.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(jt||{}),tl=(e=>(e.LEFT="left",e.RIGHT="right",e))(tl||{}),Jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Jt||{}),js=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(js||{}),Ti=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Ti||{}),Ws=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ws||{}),vn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(vn||{});function rr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function W0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function el(e){let t,n,r;e.length!==2?(t=rr,n=(o,l)=>rr(e(o),l),r=(o,l)=>e(o)-l):(t=e===rr||e===W0?e:q0,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 q0(){return 0}function Y0(e){return e===null?NaN:+e}function*Z0(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const X0=el(rr).right;el(Y0).center;const nl=X0;function K0(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function Ge(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 ir{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 Nh 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(Ph(this,t))}has(t){return super.has(Ph(this,t))}set(t,n){return super.set(Q0(this,t),n)}delete(t){return super.delete(J0(this,t))}}function Ph({_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=rr){if(e===rr)return Uh;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 Uh(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 rl(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 Ys(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 Pr(e,t,n){return t=+t,e=+e,n=+n,qs(e,t,n)[2]}function il(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Pr(t,e,n):Pr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ly(e,t,n){let r;for(;;){const i=Pr(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=Ge,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 x=h,w=+f;if(t===Ge&&([d,h]=ly(d,h,w)),f=Ys(d,h,w),f[0]<=d&&(l=Pr(d,h,w)),f[f.length-1]>=h)if(x>=h&&t===Ge){const _=Pr(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 g=new Array(p+1),y;for(s=0;s<=p;++s)y=g[s]=[],y.x0=s>0?f[s-1]:d,y.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&&g[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 x=Math.floor((d-o)*l);g[Math.min(p,x+(f[x]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&g[nl(f,o,0,p)].push(i[s]);return g}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:rl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:rl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:rl(Array.isArray(i)?iy.call(i):i),r):n},r}function sr(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 Vn(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 Bh(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?Uh: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));Bh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Mi(e,n,t),i(e[r],s)>0&&Mi(e,n,r);a<o;){for(Mi(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Mi(e,n,o):(++o,Mi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Mi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function sl(e,t,n){if(e=Float64Array.from(Z0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Vn(e);if(t>=1)return sr(e);var r,i=(r-1)*t,s=Math.floor(i),a=sr(Bh(e,s).subarray(0,s+1)),o=Vn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*hy(e){for(const t of e)yield*t}function Hh(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 Zs=1,Xs=2,al=3,Ci=4,Vh=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 Ks(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===Zs||e===Ci?-1:1,u=e===Ci||e===Xs?"x":"y",d=e===Zs||e===al?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,g=t.range(),y=+g[0]+l,x=+g[g.length-1]+l,w=(t.bandwidth?vy:gy)(t.copy(),l),_=f.selection?f.selection():f,S=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),I=T.exit(),U=T.enter().append("g").attr("class","tick"),L=T.select("line"),A=T.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(U),L=L.merge(U.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),A=A.merge(U.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Zs?"0em":e===al?"0.71em":"0.32em")),f!==_&&(S=S.transition(f),T=T.transition(f),L=L.transition(f),A=A.transition(f),I=I.transition(f).attr("opacity",Vh).attr("transform",function(V){return isFinite(V=w(V))?d(V+l):this.getAttribute("transform")}),U.attr("opacity",Vh).attr("transform",function(V){var M=this.parentNode.__axis;return d((M&&isFinite(M=M(V))?M:w(V))+l)})),I.remove(),S.attr("d",e===Ci||e===Xs?a?"M"+c*a+","+y+"H"+l+"V"+x+"H"+c*a:"M"+l+","+y+"V"+x:a?"M"+y+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+y+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(V){return d(w(V)+l)}),L.attr(u+"2",c*s),A.attr(u,c*m).text(v),_.filter(yy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Xs?"start":e===Ci?"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 Ks(Zs,e)}function by(e){return Ks(Xs,e)}function ol(e){return Ks(al,e)}function Fh(e){return Ks(Ci,e)}var Ey={value:()=>{}};function ll(){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 Qs(n)}function Qs(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}})}Qs.prototype=ll.prototype={constructor:Qs,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]=Gh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Gh(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 Qs(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 Gh(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 cl="http://www.w3.org/1999/xhtml";const zh={svg:"http://www.w3.org/2000/svg",xhtml:cl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Js(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zh.hasOwnProperty(t)?{space:zh[t],local:e}:e}function Sy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cl&&t.documentElement.namespaceURI===cl?t.createElement(e):t.createElementNS(n,e)}}function Oy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jh(e){var t=Js(e);return(t.local?Oy:Sy)(t)}function Ty(){}function ul(e){return e==null?Ty:function(){return this.querySelector(e)}}function My(e){typeof e!="function"&&(e=ul(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 Se(r,this._parents)}function Cy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ay(){return[]}function Wh(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=Wh(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 Se(r,i)}function qh(e){return function(){return this.matches(e)}}function Yh(e){return function(t){return t.matches(e)}}var Ly=Array.prototype.find;function Dy(e){return function(){return Ly.call(this.children,e)}}function ky(){return this.firstElementChild}function Iy(e){return this.select(e==null?ky:Dy(typeof e=="function"?e:Yh(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:Yh(e)))}function Hy(e){typeof e!="function"&&(e=qh(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 Se(r,this._parents)}function Zh(e){return new Array(e.length)}function Vy(){return new Se(this._enter||this._groups.map(Zh),this._parents)}function ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ta.prototype={constructor:ta,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 Gy(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 ta(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function zy(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 ta(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?zy:Gy,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),g=l[c]=new Array(h);n(u,d,v,m,g,f,t);for(var y=0,x=0,w,_;y<p;++y)if(w=v[y]){for(y>=x&&(x=y+1);!(_=m[x])&&++x<p;);w._next=_||null}}return a=new Se(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 Se(this._exit||this._groups.map(Zh),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 Se(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 Se(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=Js(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 Xh(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??"")):Ur(this.node(),e)}function Ur(e,t){return e.style.getPropertyValue(t)||Xh(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 Kh(e){return e.trim().split(/^|\s+/)}function hl(e){return e.classList||new Qh(e)}function Qh(e){this._node=e,this._names=Kh(e.getAttribute("class")||"")}Qh.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 Jh(e,t){for(var n=hl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function td(e,t){for(var n=hl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function E1(e){return function(){Jh(this,e)}}function _1(e){return function(){td(this,e)}}function w1(e,t){return function(){(t.apply(this,arguments)?Jh:td)(this,e)}}function S1(e,t){var n=Kh(e+"");if(arguments.length<2){for(var r=hl(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 D1(){this.nextSibling&&this.parentNode.appendChild(this)}function k1(){return this.each(D1)}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:jh(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:jh(e),r=t==null?U1:typeof t=="function"?t:ul(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 G1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z1(e){return this.select(e?G1: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 ed(e,t,n){var r=Xh(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 ed(this,e,t)}}function Q1(e,t){return function(){return ed(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 nd=[null];function Se(e,t){this._groups=e,this._parents=t}function Ai(){return new Se([[document.documentElement]],nd)}function ex(){return this}Se.prototype=Ai.prototype={constructor:Se,select:My,selectAll:Ry,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:L1,raise:k1,lower:N1,append:P1,insert:B1,remove:V1,clone:z1,datum:j1,on:X1,dispatch:J1,[Symbol.iterator]:tx};function D(e){return typeof e=="string"?new Se([[document.querySelector(e)]],[document.documentElement]):new Se([[e]],nd)}function nx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ar(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 dl={capture:!0,passive:!1};function fl(e){e.preventDefault(),e.stopImmediatePropagation()}function rx(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",fl,dl);"onselectstart"in t?n.on("selectstart.drag",fl,dl):(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",fl,dl),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 pl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function rd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $i(){}var Ri=.7,ea=1/Ri,Br="\\s*([+-]?\\d+)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sx=/^#([0-9a-f]{3,8})$/,ax=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),ox=new RegExp(`^rgb\\(${sn},${sn},${sn}\\)$`),lx=new RegExp(`^rgba\\(${Br},${Br},${Br},${Li}\\)$`),cx=new RegExp(`^rgba\\(${sn},${sn},${sn},${Li}\\)$`),ux=new RegExp(`^hsl\\(${Li},${sn},${sn}\\)$`),hx=new RegExp(`^hsla\\(${Li},${sn},${sn},${Li}\\)$`),id={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};pl($i,yn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sd,formatHex:sd,formatHex8:dx,formatHsl:fx,formatRgb:ad,toString:ad});function sd(){return this.rgb().formatHex()}function dx(){return this.rgb().formatHex8()}function fx(){return hd(this).formatHsl()}function ad(){return this.rgb().formatRgb()}function yn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?od(t):n===3?new ve(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?na(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?na(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 ve(t[1],t[2],t[3],1):(t=ox.exec(e))?new ve(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lx.exec(e))?na(t[1],t[2],t[3],t[4]):(t=cx.exec(e))?na(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ux.exec(e))?ud(t[1],t[2]/100,t[3]/100,1):(t=hx.exec(e))?ud(t[1],t[2]/100,t[3]/100,t[4]):id.hasOwnProperty(e)?od(id[e]):e==="transparent"?new ve(NaN,NaN,NaN,0):null}function od(e){return new ve(e>>16&255,e>>8&255,e&255,1)}function na(e,t,n,r){return r<=0&&(e=t=n=NaN),new ve(e,t,n,r)}function px(e){return e instanceof $i||(e=yn(e)),e?(e=e.rgb(),new ve(e.r,e.g,e.b,e.opacity)):new ve}function ml(e,t,n,r){return arguments.length===1?px(e):new ve(e,t,n,r??1)}function ve(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}pl(ve,ml,rd($i,{brighter(e){return e=e==null?ea:Math.pow(ea,e),new ve(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ve(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ve(or(this.r),or(this.g),or(this.b),ra(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:ld,formatHex:ld,formatHex8:mx,formatRgb:cd,toString:cd}));function ld(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}`}function mx(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}${lr((isNaN(this.opacity)?1:this.opacity)*255)}`}function cd(){const e=ra(this.opacity);return`${e===1?"rgb(":"rgba("}${or(this.r)}, ${or(this.g)}, ${or(this.b)}${e===1?")":`, ${e})`}`}function ra(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function or(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lr(e){return e=or(e),(e<16?"0":"")+e.toString(16)}function ud(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ze(e,t,n,r)}function hd(e){if(e instanceof ze)return new ze(e.h,e.s,e.l,e.opacity);if(e instanceof $i||(e=yn(e)),!e)return new ze;if(e instanceof ze)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 ze(a,o,l,e.opacity)}function gl(e,t,n,r){return arguments.length===1?hd(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}pl(ze,gl,rd($i,{brighter(e){return e=e==null?ea:Math.pow(ea,e),new ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ze(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 ve(vl(e>=240?e-240:e+120,i,r),vl(e,i,r),vl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ze(dd(this.h),ia(this.s),ia(this.l),ra(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=ra(this.opacity);return`${e===1?"hsl(":"hsla("}${dd(this.h)}, ${ia(this.s)*100}%, ${ia(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dd(e){return e=(e||0)%360,e<0?e+360:e}function ia(e){return Math.max(0,Math.min(1,e||0))}function vl(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 yl=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?fd:function(t,n){return n-t?vx(t,n,e):yl(isNaN(t)?n:t)}}function fd(e,t){var n=t-e;return n?gx(e,n):yl(isNaN(e)?t:e)}const sa=function e(t){var n=yx(t);function r(i,s){var a=n((i=ml(i)).r,(s=ml(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fd(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]=Di(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 Oe(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]=Di(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var xl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bl=new RegExp(xl.source,"g");function Sx(e){return function(){return e}}function Ox(e){return function(t){return e(t)+""}}function pd(e,t){var n=xl.lastIndex=bl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=xl.exec(e))&&(i=bl.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:Oe(r,i)})),n=bl.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 Di(e,t){var n=typeof t,r;return t==null||n==="boolean"?yl(t):(n==="number"?Oe:n==="string"?(r=yn(t))?(t=r,sa):pd:t instanceof yn?sa:t instanceof Date?_x:bx(t)?xx:Array.isArray(t)?Ex:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wx:Oe)(e,t)}function md(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var gd=180/Math.PI,El={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vd(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)*gd,skewX:Math.atan(l)*gd,scaleX:a,scaleY:o}}var aa;function Tx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?El:vd(t.a,t.b,t.c,t.d,t.e,t.f)}function Mx(e){return e==null||(aa||(aa=document.createElementNS("http://www.w3.org/2000/svg","g")),aa.setAttribute("transform",e),!(e=aa.transform.baseVal.consolidate()))?El:(e=e.matrix,vd(e.a,e.b,e.c,e.d,e.e,e.f))}function yd(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:Oe(c,d)},{i:v-2,x:Oe(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:Oe(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:Oe(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:Oe(c,d)},{i:v-2,x:Oe(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=yd(Tx,"px, ","px)","deg)"),Ax=yd(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 Hr=0,ki=0,Ii=0,xd=1e3,oa,Ni,la=0,cr=0,ca=0,Pi=typeof performance=="object"&&performance.now?performance:Date,bd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _l(){return cr||(bd(Rx),cr=Pi.now()+ca)}function Rx(){cr=0}function ua(){this._call=this._time=this._next=null}ua.prototype=Ed.prototype={constructor:ua,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_l():+n)+(t==null?0:+t),!this._next&&Ni!==this&&(Ni?Ni._next=this:oa=this,Ni=this),this._call=e,this._time=n,wl()},stop:function(){this._call&&(this._call=null,this._time=1/0,wl())}};function Ed(e,t,n){var r=new ua;return r.restart(e,t,n),r}function Lx(){_l(),++Hr;for(var e=oa,t;e;)(t=cr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hr}function _d(){cr=(la=Pi.now())+ca,Hr=ki=0;try{Lx()}finally{Hr=0,kx(),cr=0}}function Dx(){var e=Pi.now(),t=e-la;t>xd&&(ca-=t,la=e)}function kx(){for(var e,t=oa,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:oa=n);Ni=e,wl(r)}function wl(e){if(!Hr){ki&&(ki=clearTimeout(ki));var t=e-cr;t>24?(e<1/0&&(ki=setTimeout(_d,e-Pi.now()-ca)),Ii&&(Ii=clearInterval(Ii))):(Ii||(la=Pi.now(),Ii=setInterval(Dx,xd)),Hr=1,bd(_d))}}function wd(e,t,n){var r=new ua;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ix=ll("start","end","cancel","interrupt"),Nx=[],Sd=0,Od=1,Sl=2,ha=3,Td=4,Ol=5,da=6;function fa(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:Sd})}function Tl(e,t){var n=je(e,t);if(n.state>Sd)throw new Error("too late; already scheduled");return n}function an(e,t){var n=je(e,t);if(n.state>ha)throw new Error("too late; already running");return n}function je(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=Ed(s,0,n.time);function s(c){n.state=Od,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!==Od)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===ha)return wd(a);f.state===Td?(f.state=da,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=da,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(wd(function(){n.state===ha&&(n.state=Td,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Sl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Sl){for(n.state=ha,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=Ol,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Ol&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=da,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ml(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>Sl&&r.state<Ol,r.state=da,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(){Ml(this,e)})}function Bx(e,t){var n,r;return function(){var i=an(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=an(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=je(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 Cl(e,t,n){var r=e._id;return e.each(function(){var i=an(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return je(i,r).value[t]}}function Md(e,t){var n;return(typeof t=="number"?Oe:t instanceof yn?sa:(n=yn(t))?(t=n,sa):pd)(e,t)}function Fx(e){return function(){this.removeAttribute(e)}}function Gx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zx(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=Js(e),r=n==="transform"?Ax:Md;return this.attrTween(e,typeof t=="function"?(n.local?qx:Wx)(n,r,Cl(this,"attr."+e,t)):t==null?(n.local?Gx:Fx)(n):(n.local?jx:zx)(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=Js(e);return this.tween(n,(r.local?Kx:Qx)(r,t))}function tb(e,t){return function(){Tl(this,e).delay=+t.apply(this,arguments)}}function eb(e,t){return t=+t,function(){Tl(this,e).delay=t}}function nb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tb:eb)(t,e)):je(this.node(),t).delay}function rb(e,t){return function(){an(this,e).duration=+t.apply(this,arguments)}}function ib(e,t){return t=+t,function(){an(this,e).duration=t}}function sb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rb:ib)(t,e)):je(this.node(),t).duration}function ab(e,t){if(typeof t!="function")throw new Error;return function(){an(this,e).ease=t}}function ob(e){var t=this._id;return arguments.length?this.each(ab(t,e)):je(this.node(),t).ease}function lb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;an(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=qh(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 xn(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 xn(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)?Tl:an;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?je(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=ul(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,fa(c[h],t,n,h,c,je(u,n)));return new xn(s,this._parents,t,n)}function yb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wh(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=je(u,n),v=0,m=h.length;v<m;++v)(f=h[v])&&fa(f,t,n,v,h,p);s.push(h),a.push(u)}return new xn(s,a,t,n)}var xb=Ai.prototype.constructor;function bb(){return new xb(this._groups,this._parents)}function Eb(e,t){var n,r,i;return function(){var s=Ur(this,e),a=(this.style.removeProperty(e),Ur(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Cd(e){return function(){this.style.removeProperty(e)}}function _b(e,t,n){var r,i=n+"",s;return function(){var a=Ur(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=Ur(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Ur(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=an(this,e),c=l.on,u=l.value[s]==null?o||(o=Cd(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:Md;return t==null?this.styleTween(e,Eb(e,r)).on("end.style."+e,Cd(e)):typeof t=="function"?this.styleTween(e,wb(e,r,Cl(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(Cl(this,"text",e)):Ab(e==null?"":e+""))}function Lb(e){return function(t){this.textContent=e.call(this,t)}}function Db(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 kb(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,Db(e))}function Ib(){for(var e=this._name,t=this._id,n=Ad(),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=je(l,t);fa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new xn(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=an(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 xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ad(){return++Pb}var bn=Ai.prototype;xn.prototype={constructor:xn,select:vb,selectAll:yb,selectChild:bn.selectChild,selectChildren:bn.selectChildren,filter:ub,merge:hb,selection:bb,transition:Ib,call:bn.call,nodes:bn.nodes,node:bn.node,size:bn.size,empty:bn.empty,each:bn.each,on:pb,attr:Yx,attrTween:Jx,style:Ob,styleTween:Cb,text:Rb,textTween:kb,remove:gb,tween:Vx,delay:nb,duration:sb,ease:ob,easeVarying:cb,end:Nb,[Symbol.iterator]:bn[Symbol.iterator]};const Ub=e=>+e;function $d(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bb={time:null,delay:0,duration:250,ease:$d};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 xn?(t=e._id,e=e._name):(t=Ad(),(n=Bb).time=_l(),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])&&fa(l,e,t,c,a,n||Hb(l,t));return new xn(r,this._parents,e,t)}Ai.prototype.interrupt=Ux,Ai.prototype.transition=Vb;const Al=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 Gb(e){e.stopImmediatePropagation()}function $l(e){e.preventDefault(),e.stopImmediatePropagation()}var Rd={name:"drag"},Rl={name:"space"},Vr={name:"handle"},Fr={name:"center"};const{abs:Ld,max:oe,min:le}=Math;function Dd(e){return[+e[0],+e[1]]}function kd(e){return[Dd(e[0]),Dd(e[1])]}var pa={name:"x",handles:["w","e"].map(ma),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]]}},Ll={name:"y",handles:["n","s"].map(ma),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]]}},En={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"},Id={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nd={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},zb={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 ma(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 Dl(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 Pd(){return Xb(pa)}function Xb(e){var t=qb,n=Wb,r=Yb,i=!0,s=ll("start","brush","end"),a=6,o;function l(m){var g=m.property("__brush",v).selectAll(".overlay").data([ma("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",En.overlay).merge(g).each(function(){var x=Dl(this).extent;D(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([ma("selection")]).enter().append("rect").attr("class","selection").attr("cursor",En.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(x){return x.type});y.exit().remove(),y.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return En[x.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,g,y){m.tween?m.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,w=x.__brush,_=u(x,arguments),S=w.selection,T=e.input(typeof g=="function"?g.apply(this,arguments):g,w.extent),I=Di(S,T);function U(L){w.selection=L===1&&T===null?null:I(L),c.call(x),_.brush()}return S!==null&&T!==null?U:U(1)}):m.each(function(){var x=this,w=arguments,_=x.__brush,S=e.input(typeof g=="function"?g.apply(x,w):g,_.extent),T=u(x,w).beforestart();Ml(x),_.selection=S===null?null:S,c.call(x),T.start(y).brush(y).end(y)})},l.clear=function(m,g){l.move(m,null,g)};function c(){var m=D(this),g=Dl(this).selection;g?(m.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?g[1][0]-a/2:g[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?g[1][1]-a/2:g[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?g[1][0]-g[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?g[1][1]-g[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,g,y){var x=m.__brush.emitter;return x&&(!y||!x.clean)?x:new d(m,g,y)}function d(m,g,y){this.that=m,this.args=g,this.state=m.__brush,this.active=0,this.clean=y}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,g){return this.starting?(this.starting=!1,this.emit("start",m,g)):this.emit("brush",m),this},brush:function(m,g){return this.emit("brush",m,g),this},end:function(m,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,g)),this},emit:function(m,g,y){var x=D(this.that).datum();s.call(m,this.that,new Fb(m,{sourceEvent:g,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),x)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var g=this,y=m.target.__data__.type,x=(i&&m.metaKey?y="overlay":y)==="selection"?Rd:i&&m.altKey?Fr:Vr,w=e===Ll?null:zb[y],_=e===pa?null:jb[y],S=Dl(g),T=S.extent,I=S.selection,U=T[0][0],L,A,V=T[0][1],M,R,E=T[1][0],B,H,P=T[1][1],N,Z,q=0,it=0,nt,Y=w&&_&&i&&m.shiftKey,J,pt,at=Array.from(m.touches||[m],st=>{const Lt=st.identifier;return st=ar(st,g),st.point0=st.slice(),st.identifier=Lt,st});Ml(g);var Tt=u(g,arguments,!0).beforestart();if(y==="overlay"){I&&(nt=!0);const st=[at[0],at[1]||at[0]];S.selection=I=[[L=e===Ll?U:le(st[0][0],st[1][0]),M=e===pa?V:le(st[0][1],st[1][1])],[B=e===Ll?E:oe(st[0][0],st[1][0]),N=e===pa?P:oe(st[0][1],st[1][1])]],at.length>1&&Rt(m)}else L=I[0][0],M=I[0][1],B=I[1][0],N=I[1][1];A=L,R=M,H=B,Z=N;var X=D(g).attr("pointer-events","none"),tt=X.selectAll(".overlay").attr("cursor",En[y]);if(m.touches)Tt.moved=z,Tt.ended=xt;else{var ut=D(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",xt,!0);i&&ut.on("keydown.brush",Ht,!0).on("keyup.brush",Vt,!0),rx(m.view)}c.call(g),Tt.start(m,x.name);function z(st){for(const Lt of st.changedTouches||[st])for(const Ve of at)Ve.identifier===Lt.identifier&&(Ve.cur=ar(Lt,g));if(Y&&!J&&!pt&&at.length===1){const Lt=at[0];Ld(Lt.cur[0]-Lt[0])>Ld(Lt.cur[1]-Lt[1])?pt=!0:J=!0}for(const Lt of at)Lt.cur&&(Lt[0]=Lt.cur[0],Lt[1]=Lt.cur[1]);nt=!0,$l(st),Rt(st)}function Rt(st){const Lt=at[0],Ve=Lt.point0;var we;switch(q=Lt[0]-Ve[0],it=Lt[1]-Ve[1],x){case Rl:case Rd:{w&&(q=oe(U-L,le(E-B,q)),A=L+q,H=B+q),_&&(it=oe(V-M,le(P-N,it)),R=M+it,Z=N+it);break}case Vr:{at[1]?(w&&(A=oe(U,le(E,at[0][0])),H=oe(U,le(E,at[1][0])),w=1),_&&(R=oe(V,le(P,at[0][1])),Z=oe(V,le(P,at[1][1])),_=1)):(w<0?(q=oe(U-L,le(E-L,q)),A=L+q,H=B):w>0&&(q=oe(U-B,le(E-B,q)),A=L,H=B+q),_<0?(it=oe(V-M,le(P-M,it)),R=M+it,Z=N):_>0&&(it=oe(V-N,le(P-N,it)),R=M,Z=N+it));break}case Fr:{w&&(A=oe(U,le(E,L-q*w)),H=oe(U,le(E,B+q*w))),_&&(R=oe(V,le(P,M-it*_)),Z=oe(V,le(P,N+it*_)));break}}H<A&&(w*=-1,we=L,L=B,B=we,we=A,A=H,H=we,y in Id&&tt.attr("cursor",En[y=Id[y]])),Z<R&&(_*=-1,we=M,M=N,N=we,we=R,R=Z,Z=we,y in Nd&&tt.attr("cursor",En[y=Nd[y]])),S.selection&&(I=S.selection),J&&(A=I[0][0],H=I[1][0]),pt&&(R=I[0][1],Z=I[1][1]),(I[0][0]!==A||I[0][1]!==R||I[1][0]!==H||I[1][1]!==Z)&&(S.selection=[[A,R],[H,Z]],c.call(g),Tt.brush(st,x.name))}function xt(st){if(Gb(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ix(st.view,nt),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);X.attr("pointer-events","all"),tt.attr("cursor",En.overlay),S.selection&&(I=S.selection),Zb(I)&&(S.selection=null,c.call(g)),Tt.end(st,x.name)}function Ht(st){switch(st.keyCode){case 16:{Y=w&&_;break}case 18:{x===Vr&&(w&&(B=H-q*w,L=A+q*w),_&&(N=Z-it*_,M=R+it*_),x=Fr,Rt(st));break}case 32:{(x===Vr||x===Fr)&&(w<0?B=H-q:w>0&&(L=A-q),_<0?N=Z-it:_>0&&(M=R-it),x=Rl,tt.attr("cursor",En.selection),Rt(st));break}default:return}$l(st)}function Vt(st){switch(st.keyCode){case 16:{Y&&(J=pt=Y=!1,Rt(st));break}case 18:{x===Fr&&(w<0?B=H:w>0&&(L=A),_<0?N=Z:_>0&&(M=R),x=Vr,Rt(st));break}case 32:{x===Rl&&(st.altKey?(w&&(B=H-q*w,L=A+q*w),_&&(N=Z-it*_,M=R+it*_),x=Fr):(w<0?B=H:w>0&&(L=A),_<0?N=Z:_>0&&(M=R),x=Vr),tt.attr("cursor",En[y]),Rt(st));break}default:return}$l(st)}}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=kd(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Al(kd(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Al(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Al(!!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 kl=Math.PI,Il=2*kl,ur=1e-6,Kb=Il-ur;function Ud(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 Ud;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 Nl=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Ud: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>ur)if(!(Math.abs(d*l-c*u)>ur)||!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,g=Math.sqrt(v),y=Math.sqrt(h),x=s*Math.tan((kl-Math.acos((v+h-m)/(2*g*y)))/2),w=x/y,_=x/g;Math.abs(w-1)>ur&&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)>ur||Math.abs(this._y1-u)>ur)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Il+Il),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>ur&&this._append`A${r},${r},0,${+(h>=kl)},${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 Bd(){return new Nl}Bd.prototype=Nl.prototype;function Jb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ga(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=ga(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 Ui(e){if(!(t=nE.exec(e)))throw new Error("invalid format: "+e);var t;return new Pl({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]})}Ui.prototype=Pl.prototype;function Pl(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+""}Pl.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 Hd;function iE(e,t){var n=ga(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Hd=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")+ga(e,Math.max(0,t+s-1))[0]}function Vd(e,t){var n=ga(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 Fd={"%":(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)=>Vd(e*100,t),r:Vd,s:iE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gd(e){return e}var zd=Array.prototype.map,jd=["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?Gd:tE(zd.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?Gd:eE(zd.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=Ui(d);var h=d.fill,f=d.align,p=d.sign,v=d.symbol,m=d.zero,g=d.width,y=d.comma,x=d.precision,w=d.trim,_=d.type;_==="n"?(y=!0,_="g"):Fd[_]||(x===void 0&&(x=12),w=!0,_="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var S=v==="$"?n:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=v==="$"?r:/[%p]/.test(_)?a:"",I=Fd[_],U=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function L(A){var V=S,M=T,R,E,B;if(_==="c")M=I(A)+M,A="";else{A=+A;var H=A<0||1/A<0;if(A=isNaN(A)?l:I(Math.abs(A),x),w&&(A=rE(A)),H&&+A==0&&p!=="+"&&(H=!1),V=(H?p==="("?p:o:p==="-"||p==="("?"":p)+V,M=(_==="s"?jd[8+Hd/3]:"")+M+(H&&p==="("?")":""),U){for(R=-1,E=A.length;++R<E;)if(B=A.charCodeAt(R),48>B||B>57){M=(B===46?i+A.slice(R+1):A.slice(R))+M,A=A.slice(0,R);break}}}y&&!m&&(A=t(A,1/0));var P=V.length+A.length+M.length,N=P<g?new Array(g-P+1).join(h):"";switch(y&&m&&(A=t(N+A,N.length?g-M.length:1/0),N=""),f){case"<":A=V+A+M+N;break;case"=":A=V+N+A+M;break;case"^":A=N.slice(0,P=N.length>>1)+V+A+M+N.slice(P);break;default:A=N+V+A+M;break}return s(A)}return L.toString=function(){return d+""},L}function u(d,h){var f=c((d=Ui(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Gr(h)/3)))*3,v=Math.pow(10,-p),m=jd[8+p/3];return function(g){return f(v*g)+m}}return{format:c,formatPrefix:u}}var va,Ul,Wd;aE({thousands:",",grouping:[3],currency:["$",""]});function aE(e){return va=sE(e),Ul=va.format,Wd=va.formatPrefix,va}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 Mt=1e-6,qd=1e-12,bt=Math.PI,ye=bt/2,Yd=bt/4,Te=bt*2,fe=180/bt,qt=bt/180,Ct=Math.abs,Zd=Math.atan,hr=Math.atan2,$t=Math.cos,uE=Math.exp,hE=Math.log,Ot=Math.sin,Fn=Math.sign||function(e){return e>0?1:e<0?-1:0},We=Math.sqrt,dE=Math.tan;function fE(e){return e>1?0:e<-1?bt:Math.acos(e)}function _n(e){return e>1?ye:e<-1?-ye:Math.asin(e)}function Ie(){}function ya(e,t){e&&Kd.hasOwnProperty(e.type)&&Kd[e.type](e,t)}var Xd={Feature:function(e,t){ya(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ya(n[r].geometry,t)}},Kd={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){Bl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Bl(n[r],t,0)},Polygon:function(e,t){Qd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Qd(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ya(n[r],t)}};function Bl(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 Qd(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Bl(e[n],t,1);t.polygonEnd()}function zr(e,t){e&&Xd.hasOwnProperty(e.type)?Xd[e.type](e,t):ya(e,t)}function Hl(e){return[hr(e[1],e[0]),_n(e[2])]}function jr(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*Ot(t),Ot(n)]}function xa(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ba(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 Vl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ea(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Fl(e){var t=We(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Gl(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 zl(e,t){return Ct(e)>bt&&(e-=Math.round(e/Te)*Te),[e,t]}zl.invert=zl;function Jd(e,t,n){return(e%=Te)?t||n?Gl(ef(e),nf(t,n)):ef(e):t||n?nf(t,n):zl}function tf(e){return function(t,n){return t+=e,Ct(t)>bt&&(t-=Math.round(t/Te)*Te),[t,n]}}function ef(e){var t=tf(e);return t.invert=tf(-e),t}function nf(e,t){var n=$t(e),r=Ot(e),i=$t(t),s=Ot(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=Ot(o)*c,h=Ot(l),f=h*n+u*r;return[hr(d*i-f*s,u*n-h*r),_n(f*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=Ot(o)*c,h=Ot(l),f=h*i-d*s;return[hr(d*i+h*s,u*n+f*r),_n(f*n-u*r)]},a}function pE(e){e=Jd(e[0]*qt,e[1]*qt,e.length>2?e[2]*qt:0);function t(n){return n=e(n[0]*qt,n[1]*qt),n[0]*=fe,n[1]*=fe,n}return t.invert=function(n){return n=e.invert(n[0]*qt,n[1]*qt),n[0]*=fe,n[1]*=fe,n},t}function mE(e,t,n,r,i,s){if(n){var a=$t(t),o=Ot(t),l=r*n;i==null?(i=t+r*Te,s=t-l/2):(i=rf(a,i),s=rf(a,s),(r>0?i<s:i>s)&&(i+=r*Te));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Hl([a,-o*$t(u),-o*Ot(u)]),e.point(c[0],c[1])}}function rf(e,t){t=jr(t),t[0]-=e,Fl(t);var n=fE(-t[1]);return((-t[2]<0?-n:n)+Te-Mt)%Te}function sf(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ie,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 Ct(e[0]-t[0])<Mt&&Ct(e[1]-t[1])<Mt}function wa(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 af(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],g=p[v],y;if(_a(m,g)){if(!m[2]&&!g[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}g[0]+=2*Mt}s.push(y=new wa(m,p,null,!0)),a.push(y.o=new wa(m,null,y,!1)),s.push(y=new wa(g,p,null,!1)),a.push(y.o=new wa(g,null,y,!0))}}),!!s.length){for(a.sort(t),of(s),of(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 of(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 jl(e){return Ct(e[0])<=bt?e[0]:Fn(e[0])*((Ct(e[0])+bt)%Te-bt)}function gE(e,t){var n=jl(t),r=t[1],i=Ot(r),s=[Ot(n),-$t(n),0],a=0,o=0,l=new ir;i===1?r=ye+Mt:i===-1&&(r=-ye-Mt);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=jl(f),v=f[1]/2+Yd,m=Ot(v),g=$t(v),y=0;y<h;++y,p=w,m=S,g=T,f=x){var x=d[y],w=jl(x),_=x[1]/2+Yd,S=Ot(_),T=$t(_),I=w-p,U=I>=0?1:-1,L=U*I,A=L>bt,V=m*S;if(l.add(hr(V*U*Ot(L),g*T+V*$t(L))),a+=A?I+U*Te:I,A^p>=n^w>=n){var M=ba(jr(f),jr(x));Fl(M);var R=ba(s,M);Fl(R);var E=(A^I>=0?-1:1)*_n(R[2]);(r>E||r===E&&(M[0]||M[1]))&&(o+=A^I>=0?1:-1)}}return(a<-Mt||a<Mt&&l<-qd)^o&1}function lf(e,t,n,r){return function(i){var s=t(i),a=sf(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:v,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=y,h.lineEnd=x,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=v,h.lineEnd=m,u=Hh(u);var w=gE(c,r);u.length?(l||(i.polygonStart(),l=!0),af(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 g(w,_){d.push([w,_]),o.point(w,_)}function y(){o.lineStart(),d=[]}function x(){g(d[0][0],d[0][1]),o.lineEnd();var w=o.clean(),_=a.result(),S,T=_.length,I,U,L;if(d.pop(),c.push(d),d=null,!!T){if(w&1){if(U=_[0],(I=U.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<I;++S)i.point((L=U[S])[0],L[1]);i.lineEnd()}return}T>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]-ye-Mt:ye-e[1])-((t=t.x)[0]<0?t[1]-ye-Mt:ye-t[1])}const cf=lf(function(){return!0},xE,EE,[-bt,-ye]);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?bt:-bt,l=Ct(s-t);Ct(l-bt)<Mt?(e.point(t,n=(n+a)/2>0?ye:-ye),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=bt&&(Ct(t-r)<Mt&&(t-=r*Mt),Ct(s-o)<Mt&&(s-=o*Mt),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=Ot(e-n);return Ct(a)>Mt?Zd((Ot(t)*(s=$t(r))*Ot(n)-Ot(r)*(i=$t(t))*Ot(e))/(i*s*a)):(t+r)/2}function EE(e,t,n,r){var i;if(e==null)i=n*ye,r.point(-bt,i),r.point(0,i),r.point(bt,i),r.point(bt,0),r.point(bt,-i),r.point(0,-i),r.point(-bt,-i),r.point(-bt,0),r.point(-bt,i);else if(Ct(e[0]-t[0])>Mt){var s=e[0]<t[0]?bt:-bt;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=$t(e),n=6*qt,r=t>0,i=Ct(t)>Mt;function s(u,d,h,f){mE(f,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,f,p,v;return{lineStart:function(){p=f=!1,v=1},point:function(m,g){var y=[m,g],x,w=a(m,g),_=r?w?0:c(m,g):w?c(m+(m<0?bt:-bt),g):0;if(!d&&(p=f=w)&&u.lineStart(),w!==f&&(x=l(d,y),(!x||_a(d,x)||_a(y,x))&&(y[2]=1)),w!==f)v=0,w?(u.lineStart(),x=l(y,d),u.point(x[0],x[1])):(x=l(d,y),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(i&&d&&r^w){var S;!(_&h)&&(S=l(y,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,y))&&u.point(y[0],y[1]),d=y,f=w,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return v|(p&&f)<<1}}}function l(u,d,h){var f=jr(u),p=jr(d),v=[1,0,0],m=ba(f,p),g=xa(m,m),y=m[0],x=g-y*y;if(!x)return!h&&u;var w=t*g/x,_=-t*y/x,S=ba(v,m),T=Ea(v,w),I=Ea(m,_);Vl(T,I);var U=S,L=xa(T,U),A=xa(U,U),V=L*L-A*(xa(T,T)-1);if(!(V<0)){var M=We(V),R=Ea(U,(-L-M)/A);if(Vl(R,T),R=Hl(R),!h)return R;var E=u[0],B=d[0],H=u[1],P=d[1],N;B<E&&(N=E,E=B,B=N);var Z=B-E,q=Ct(Z-bt)<Mt,it=q||Z<Mt;if(!q&&P<H&&(N=H,H=P,P=N),it?q?H+P>0^R[1]<(Ct(R[0]-E)<Mt?H:P):H<=R[1]&&R[1]<=P:Z>bt^(E<=R[0]&&R[0]<=B)){var nt=Ea(U,(-L+M)/A);return Vl(nt,T),[R,Hl(nt)]}}}function c(u,d){var h=r?e:bt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return lf(a,o,s,r?[0,-e]:[-bt,e-bt])}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 Bi=1e9,Sa=-Bi;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 Ct(c[0]-e)<Mt?u>0?0:3:Ct(c[0]-n)<Mt?u>0?2:1:Ct(c[1]-t)<Mt?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=sf(),h,f,p,v,m,g,y,x,w,_,S,T={point:I,lineStart:V,lineEnd:M,polygonStart:L,polygonEnd:A};function I(E,B){i(E,B)&&u.point(E,B)}function U(){for(var E=0,B=0,H=f.length;B<H;++B)for(var P=f[B],N=1,Z=P.length,q=P[0],it,nt,Y=q[0],J=q[1];N<Z;++N)it=Y,nt=J,q=P[N],Y=q[0],J=q[1],nt<=r?J>r&&(Y-it)*(r-nt)>(J-nt)*(e-it)&&++E:J<=r&&(Y-it)*(r-nt)<(J-nt)*(e-it)&&--E;return E}function L(){u=d,h=[],f=[],S=!0}function A(){var E=U(),B=S&&E,H=(h=Hh(h)).length;(B||H)&&(c.polygonStart(),B&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),H&&af(h,o,E,s,c),c.polygonEnd()),u=c,h=f=p=null}function V(){T.point=R,f&&f.push(p=[]),_=!0,w=!1,y=x=NaN}function M(){h&&(R(v,m),g&&w&&d.rejoin(),h.push(d.result())),T.point=I,w&&u.lineEnd()}function R(E,B){var H=i(E,B);if(f&&p.push([E,B]),_)v=E,m=B,g=H,_=!1,H&&(u.lineStart(),u.point(E,B));else if(H&&w)u.point(E,B);else{var P=[y=Math.max(Sa,Math.min(Bi,y)),x=Math.max(Sa,Math.min(Bi,x))],N=[E=Math.max(Sa,Math.min(Bi,E)),B=Math.max(Sa,Math.min(Bi,B))];wE(P,N,e,t,n,r)?(w||(u.lineStart(),u.point(P[0],P[1])),u.point(N[0],N[1]),H||u.lineEnd(),S=!1):H&&(u.lineStart(),u.point(E,B),S=!1)}y=E,x=B,w=H}return T}}const Wl=e=>e;var ql=new ir,Yl=new ir,uf,hf,Zl,Xl,Gn={point:Ie,lineStart:Ie,lineEnd:Ie,polygonStart:function(){Gn.lineStart=OE,Gn.lineEnd=ME},polygonEnd:function(){Gn.lineStart=Gn.lineEnd=Gn.point=Ie,ql.add(Ct(Yl)),Yl=new ir},result:function(){var e=ql/2;return ql=new ir,e}};function OE(){Gn.point=TE}function TE(e,t){Gn.point=df,uf=Zl=e,hf=Xl=t}function df(e,t){Yl.add(Xl*e-Zl*t),Zl=e,Xl=t}function ME(){df(uf,hf)}const ff=Gn;var Wr=1/0,Oa=Wr,Hi=-Wr,Ta=Hi,CE={point:AE,lineStart:Ie,lineEnd:Ie,polygonStart:Ie,polygonEnd:Ie,result:function(){var e=[[Wr,Oa],[Hi,Ta]];return Hi=Ta=-(Oa=Wr=1/0),e}};function AE(e,t){e<Wr&&(Wr=e),e>Hi&&(Hi=e),t<Oa&&(Oa=t),t>Ta&&(Ta=t)}const Ma=CE;var Kl=0,Ql=0,Vi=0,Ca=0,Aa=0,qr=0,Jl=0,tc=0,Fi=0,pf,mf,on,ln,qe={point:dr,lineStart:gf,lineEnd:vf,polygonStart:function(){qe.lineStart=LE,qe.lineEnd=DE},polygonEnd:function(){qe.point=dr,qe.lineStart=gf,qe.lineEnd=vf},result:function(){var e=Fi?[Jl/Fi,tc/Fi]:qr?[Ca/qr,Aa/qr]:Vi?[Kl/Vi,Ql/Vi]:[NaN,NaN];return Kl=Ql=Vi=Ca=Aa=qr=Jl=tc=Fi=0,e}};function dr(e,t){Kl+=e,Ql+=t,++Vi}function gf(){qe.point=$E}function $E(e,t){qe.point=RE,dr(on=e,ln=t)}function RE(e,t){var n=e-on,r=t-ln,i=We(n*n+r*r);Ca+=i*(on+e)/2,Aa+=i*(ln+t)/2,qr+=i,dr(on=e,ln=t)}function vf(){qe.point=dr}function LE(){qe.point=kE}function DE(){yf(pf,mf)}function kE(e,t){qe.point=yf,dr(pf=on=e,mf=ln=t)}function yf(e,t){var n=e-on,r=t-ln,i=We(n*n+r*r);Ca+=i*(on+e)/2,Aa+=i*(ln+t)/2,qr+=i,i=ln*e-on*t,Jl+=i*(on+e),tc+=i*(ln+t),Fi+=i*3,dr(on=e,ln=t)}const xf=qe;function bf(e){this._context=e}bf.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,Te);break}}},result:Ie};var ec=new ir,nc,Ef,_f,Gi,zi,$a={point:Ie,lineStart:function(){$a.point=IE},lineEnd:function(){nc&&wf(Ef,_f),$a.point=Ie},polygonStart:function(){nc=!0},polygonEnd:function(){nc=null},result:function(){var e=+ec;return ec=new ir,e}};function IE(e,t){$a.point=wf,Ef=Gi=e,_f=zi=t}function wf(e,t){Gi-=e,zi-=t,ec.add(We(Gi*Gi+zi*zi)),Gi=e,zi=t}const Sf=$a;let Of,Ra,Tf,Mf;class Cf{constructor(t){this._append=t==null?Af:NE(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!==Tf||this._append!==Ra){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`,Tf=r,Ra=this._append,Mf=this._,this._=i}this._+=Mf;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Af(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function NE(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Af;if(t!==Of){const n=10**t;Of=t,Ra=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 Ra}function PE(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(ff)),ff.result()},a.measure=function(o){return zr(o,i(Sf)),Sf.result()},a.bounds=function(o){return zr(o,i(Ma)),Ma.result()},a.centroid=function(o){return zr(o,i(xf)),xf.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Wl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Cf(n)):new bf(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 Cf(n)),a},a.projection(e).digits(n).context(t)}function rc(e){return function(t){var n=new ic;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ic(){}ic.prototype={constructor:ic,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 sc(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(Ma)),t(Ma.result()),r!=null&&e.clipExtent(r),e}function $f(e,t,n){return sc(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 UE(e,t,n){return $f(e,[[0,0],t],n)}function BE(e,t,n){return sc(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 HE(e,t,n){return sc(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 Rf=16,VE=$t(30*qt);function Lf(e,t){return+t?GE(e,t):FE(e)}function FE(e){return rc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function GE(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,v,m){var g=c-r,y=u-i,x=g*g+y*y;if(x>4*t&&v--){var w=a+h,_=o+f,S=l+p,T=We(w*w+_*_+S*S),I=_n(S/=T),U=Ct(Ct(S)-1)<Mt||Ct(s-d)<Mt?(s+d)/2:hr(_,w),L=e(U,I),A=L[0],V=L[1],M=A-r,R=V-i,E=y*M-g*R;(E*E/x>t||Ct((g*M+y*R)/x-.5)>.3||a*h+o*f+l*p<VE)&&(n(r,i,s,a,o,l,A,V,U,w/=T,_/=T,S,v,m),m.point(A,V),n(A,V,U,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:g,lineStart:y,lineEnd:w,polygonStart:function(){r.polygonStart(),m.lineStart=_},polygonEnd:function(){r.polygonEnd(),m.lineStart=y}};function g(I,U){I=e(I,U),r.point(I[0],I[1])}function y(){d=NaN,m.point=x,r.lineStart()}function x(I,U){var L=jr([I,U]),A=e(I,U);n(d,h,u,f,p,v,d=A[0],h=A[1],u=I,f=L[0],p=L[1],v=L[2],Rf,r),r.point(d,h)}function w(){m.point=g,r.lineEnd()}function _(){y(),m.point=S,m.lineEnd=T}function S(I,U){x(i=I,U),s=d,a=h,o=f,l=p,c=v,m.point=x}function T(){n(d,h,u,f,p,v,s,a,i,o,l,c,Rf,r),m.lineEnd=w,w()}return m}}var zE=rc({point:function(e,t){this.stream.point(e*qt,t*qt)}});function jE(e){return rc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function WE(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 Df(e,t,n,r,i,s){if(!s)return WE(e,t,n,r,i);var a=$t(s),o=Ot(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 La(e){return kf(function(){return e})()}function kf(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=cf,m=null,g,y,x,w=Wl,_=.5,S,T,I,U,L;function A(E){return I(E[0]*qt,E[1]*qt)}function V(E){return E=I.invert(E[0],E[1]),E&&[E[0]*fe,E[1]*fe]}A.stream=function(E){return U&&L===E?U:U=zE(jE(u)(v(S(w(L=E)))))},A.preclip=function(E){return arguments.length?(v=E,p=void 0,R()):v},A.postclip=function(E){return arguments.length?(w=E,m=g=y=x=null,R()):w},A.clipAngle=function(E){return arguments.length?(v=+E?_E(p=E*qt):(p=null,cf),R()):p*fe},A.clipExtent=function(E){return arguments.length?(w=E==null?(m=g=y=x=null,Wl):SE(m=+E[0][0],g=+E[0][1],y=+E[1][0],x=+E[1][1]),R()):m==null?null:[[m,g],[y,x]]},A.scale=function(E){return arguments.length?(n=+E,M()):n},A.translate=function(E){return arguments.length?(r=+E[0],i=+E[1],M()):[r,i]},A.center=function(E){return arguments.length?(s=E[0]%360*qt,a=E[1]%360*qt,M()):[s*fe,a*fe]},A.rotate=function(E){return arguments.length?(o=E[0]%360*qt,l=E[1]%360*qt,c=E.length>2?E[2]%360*qt:0,M()):[o*fe,l*fe,c*fe]},A.angle=function(E){return arguments.length?(d=E%360*qt,M()):d*fe},A.reflectX=function(E){return arguments.length?(h=E?-1:1,M()):h<0},A.reflectY=function(E){return arguments.length?(f=E?-1:1,M()):f<0},A.precision=function(E){return arguments.length?(S=Lf(T,_=E*E),R()):We(_)},A.fitExtent=function(E,B){return $f(A,E,B)},A.fitSize=function(E,B){return UE(A,E,B)},A.fitWidth=function(E,B){return BE(A,E,B)},A.fitHeight=function(E,B){return HE(A,E,B)};function M(){var E=Df(n,0,0,h,f,d).apply(null,t(s,a)),B=Df(n,r-E[0],i-E[1],h,f,d);return u=Jd(o,l,c),T=Gl(t,B),I=Gl(u,T),S=Lf(T,_),R()}function R(){return U=L=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&V,M()}}function If(e){var t=0,n=bt/3,r=kf(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*qt,n=s[1]*qt):[t*fe,n*fe]},i}function qE(e){var t=$t(e);function n(r,i){return[r*t,Ot(i)/t]}return n.invert=function(r,i){return[r/t,_n(i*t)]},n}function YE(e,t){var n=Ot(e),r=(n+Ot(t))/2;if(Ct(r)<Mt)return qE(e);var i=1+n*(2*r-n),s=We(i)/r;function a(o,l){var c=We(i-2*r*Ot(l))/r;return[c*Ot(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=hr(o,Ct(c))*Fn(c);return c*r<0&&(u-=bt*Fn(o)*Fn(c)),[u/r,_n((i-(o*o+c*c)*r*r)/(2*r))]},a}function Nf(){return If(YE).scale(155.424).center([0,33.6442])}function ZE(){return Nf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ac(e,t){return[e,hE(dE((ye+t)/2))]}ac.invert=function(e,t){return[e,2*Zd(uE(t))-ye]};function XE(){return KE(ac).scale(961/Te)}function KE(e){var t=La(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=bt*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===ac?[[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 Da(e,t){return[e,t]}Da.invert=Da;function QE(){return La(Da).scale(152.63)}function JE(e,t){var n=$t(e),r=e===t?Ot(e):(n-$t(t))/(t-e),i=n/r+e;if(Ct(r)<Mt)return Da;function s(a,o){var l=i-o,c=r*a;return[l*Ot(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=hr(a,Ct(l))*Fn(l);return l*r<0&&(c-=bt*Fn(a)*Fn(l)),[c/r,i-Fn(r)*We(a*a+l*l)]},s}function t_(){return If(JE).scale(131.154).center([0,13.9389])}var ji=1.340264,Wi=-.081106,qi=893e-6,Yi=.003796,ka=We(3)/2,e_=12;function Pf(e,t){var n=_n(ka*Ot(t)),r=n*n,i=r*r*r;return[e*$t(n)/(ka*(ji+3*Wi*r+i*(7*qi+9*Yi*r))),n*(ji+Wi*r+i*(qi+Yi*r))]}Pf.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<e_&&(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,!(Ct(a)<qd));++s);return[ka*e*(ji+3*Wi*r+i*(7*qi+9*Yi*r))/$t(n),_n(Ot(n)/ka)]};function n_(){return La(Pf).scale(177.158)}function Uf(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)))]}Uf.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(Ct(i)>Mt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function r_(){return La(Uf).scale(175.295)}function i_(e,t){return e.parent===t.parent?1:2}function s_(e){return e.reduce(a_,0)/e.length}function a_(e,t){return e+t.x}function o_(e){return 1+e.reduce(l_,0)}function l_(e,t){return Math.max(e,t.y)}function c_(e){for(var t;t=e.children;)e=t[0];return e}function u_(e){for(var t;t=e.children;)e=t[t.length-1];return e}function h_(){var e=i_,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=s_(f),h.y=o_(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=c_(s),c=u_(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 d_(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 f_(){return this.eachAfter(d_)}function p_(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function m_(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 g_(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 v_(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function y_(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 x_(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function b_(e){for(var t=this,n=E_(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 E_(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 __(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function w_(){return Array.from(this)}function S_(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function O_(){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 Zi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=A_)):t===void 0&&(t=C_);for(var n=new Xi(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 Xi(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(R_)}function M_(){return Zi(this).eachBefore($_)}function C_(e){return e.children}function A_(e){return Array.isArray(e)?e[1]:null}function $_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function R_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Xi(e){this.data=e,this.depth=this.height=0,this.parent=null}Xi.prototype=Zi.prototype={constructor:Xi,count:f_,each:p_,eachAfter:g_,eachBefore:m_,find:v_,sum:y_,sort:x_,path:b_,ancestors:__,descendants:w_,leaves:S_,links:O_,copy:M_,[Symbol.iterator]:T_};function L_(e){return e==null?null:Bf(e)}function Bf(e){if(typeof e!="function")throw new Error;return e}function fr(){return 0}function Yr(e){return function(){return e}}const D_=1664525,k_=1013904223,Hf=4294967296;function I_(){let e=1;return()=>(e=(D_*e+k_)%Hf)/Hf}function N_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function P_(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 U_(e,t){for(var n=0,r=(e=P_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Vf(a,s)?++n:(a=H_(i=B_(i,s)),n=0);return a}function B_(e,t){var n,r;if(oc(t,e))return[t];for(n=0;n<e.length;++n)if(Ia(t,e[n])&&oc(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(Ia(Ki(e[n],e[r]),t)&&Ia(Ki(e[n],t),e[r])&&Ia(Ki(e[r],t),e[n])&&oc(Ff(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ia(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 Vf(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 oc(e,t){for(var n=0;n<t.length;++n)if(!Vf(e,t[n]))return!1;return!0}function H_(e){switch(e.length){case 1:return V_(e[0]);case 2:return Ki(e[0],e[1]);case 3:return Ff(e[0],e[1],e[2])}}function V_(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 Ff(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,g=d-s,y=r*r+i*i-s*s,x=y-a*a-o*o+l*l,w=y-c*c-u*u+d*d,_=f*p-h*v,S=(p*w-v*x)/(_*2)-r,T=(v*m-p*g)/_,I=(f*x-h*w)/(_*2)-i,U=(h*g-f*m)/_,L=T*T+U*U-1,A=2*(s+S*T+I*U),V=S*S+I*I-s*s,M=-(Math.abs(L)>1e-6?(A+Math.sqrt(A*A-4*L*V))/(2*L):V/A);return{x:r+S+T*M,y:i+I+U*M,r:M}}function Gf(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 zf(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 jf(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 Na(e){this._=e,this.next=null,this.previous=null}function F_(e,t){if(!(s=(e=N_(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;Gf(r,n,i=e[2]),n=new Na(n),r=new Na(r),i=new Na(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){Gf(n._,r._,i=e[l]),i=new Na(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(zf(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(zf(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=jf(n);(i=i.next)!==r;)(o=jf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=U_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function G_(e){return Math.sqrt(e.value)}function z_(){var e=null,t=1,n=1,r=fr;function i(s){const a=I_();return s.x=t/2,s.y=n/2,e?s.eachBefore(Wf(e)).eachAfter(lc(r,.5,a)).eachBefore(qf(1)):s.eachBefore(Wf(G_)).eachAfter(lc(fr,1,a)).eachAfter(lc(r,s.r/Math.min(t,n),a)).eachBefore(qf(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:Yr(+s),i):r},i}function Wf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function lc(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=F_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function qf(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 j_(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 W_(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 q_(e,t){return e.parent===t.parent?1:2}function cc(e){var t=e.children;return t?t[0]:e.t}function uc(e){var t=e.children;return t?t[t.length-1]:e.t}function Y_(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 Z_(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 Pa(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}Pa.prototype=Object.create(Xi.prototype);function K_(e){for(var t=new Pa(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 Pa(s[a],a)),i.parent=n;return(t.parent=new Pa(null,0)).children=[t],t}function Q_(){var e=q_,t=1,n=1,r=null;function i(c){var u=K_(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(y){y.x<d.x&&(d=y),y.x>h.x&&(h=y),y.depth>f.depth&&(f=y)});var p=d===h?1:e(d,h)/2,v=p-d.x,m=t/(h.x+p+v),g=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+v)*m,y.y=y.depth*g})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Z_(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,g=f.m,y=p.m,x=v.m,w;p=uc(p),h=cc(h),p&&h;)v=cc(v),f=uc(f),f.a=c,w=p.z+y-h.z-m+e(p._,h._),w>0&&(Y_(X_(p,c,d),c,w),m+=w,g+=w),y+=p.m,m+=h.m,x+=v.m,g+=f.m;p&&!uc(f)&&(f.t=p,f.m+=y-g),h&&!cc(v)&&(v.t=h,v.m+=m-x,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 J_(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 tw=(1+Math.sqrt(5))/2;function ew(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,g,y,x,w,_,S;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(g=y=m,_=Math.max(p/f,f/p)/(v*e),S=m*m*_,w=Math.max(y/S,S/g);d<h;++d){if(m+=c=o[d].value,c<g&&(g=c),c>y&&(y=c),S=m*m*_,x=Math.max(y/S,S/g),x>w){m-=c;break}w=x}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?W_(l,n,r,i,v?r+=p*m/v:s):J_(l,n,r,v?n+=f*m/v:i,s),v-=m,u=d}return a}const nw=function e(t){function n(r,i,s,a,o){ew(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(tw);function rw(){var e=nw,t=!1,n=1,r=1,i=[0],s=fr,a=fr,o=fr,l=fr,c=fr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(j_),h}function d(h){var f=i[h.depth],p=h.x0+f,v=h.y0+f,m=h.x1-f,g=h.y1-f;m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),h.x0=p,h.y0=v,h.x1=m,h.y1=g,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,v+=a(h)-f,m-=o(h)-f,g-=l(h)-f,m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),e(h,p,v,m,g))}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=Bf(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:Yr(+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:Yr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Yr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Yr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Yr(+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 Yf=Symbol("implicit");function Ua(){var e=new Nh,t=[],n=[],r=Yf;function i(s){let a=e.get(s);if(a===void 0){if(r!==Yf)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 Nh;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 Ua(t,n).unknown(r)},Zr.apply(i,arguments),i}function Qi(){var e=Ua().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(g){return p+s*g});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 iw(e){return function(){return e}}function sw(e){return+e}var Zf=[0,1];function Xr(e){return e}function hc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:iw(isNaN(t)?NaN:.5)}function aw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ow(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=hc(i,r),s=n(a,s)):(r=hc(r,i),s=n(s,a)),function(o){return s(r(o))}}function lw(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]=hc(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=nl(e,o,1,r)-1;return s[l](i[l](o))}}function dc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xf(){var e=Zf,t=Zf,n=Di,r,i,s,a=Xr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Xr&&(a=aw(e[0],e[h-1])),o=h>2?lw:ow,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),Oe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,sw),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=md,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Xr,u()):a!==Xr},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 Kf(){return Xf()(Xr,Xr)}function cw(e,t,n,r){var i=il(e,t,n),s;switch(r=Ui(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),Wd(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 Ul(r)}function Qf(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ys(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return cw(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=Pr(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 Ye(){var e=Kf();return e.copy=function(){return dc(e,Ye())},Zr.apply(e,arguments),Qf(e)}function Jf(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 tp(e){return Math.log(e)}function ep(e){return Math.exp(e)}function uw(e){return-Math.log(-e)}function hw(e){return-Math.exp(-e)}function dw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function fw(e){return e===10?dw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function pw(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 np(e){return(t,n)=>-e(-t,n)}function mw(e){const t=e(tp,ep),n=t.domain;let r=10,i,s;function a(){return i=pw(r),s=fw(r),n()[0]<0?(i=np(i),s=np(s),e(uw,hw)):e(tp,ep),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 g=[];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;g.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;g.push(v)}g.length*2<m&&(g=Ys(c,u,m))}else g=Ys(h,f,Math.min(f-h,m)).map(s);return d?g.reverse():g},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ui(l)).precision==null&&(l.trim=!0),l=Ul(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(Jf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function rp(){const e=mw(Xf()).domain([1,10]);return e.copy=()=>dc(e,rp()).base(e.base()),Zr.apply(e,arguments),e}function fc(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[nl(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 fc().domain([e,t]).range(i).unknown(s)},Zr.apply(Qf(a),arguments)}const pc=new Date,mc=new Date;function te(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=>te(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)=>(pc.setTime(+s),mc.setTime(+a),e(pc),e(mc),Math.floor(n(pc,mc))),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 Ba=te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ba.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ba),Ba.range;const wn=1e3,Ne=wn*60,Sn=Ne*60,On=Sn*24,gc=On*7,ip=On*30,vc=On*365,Kr=te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*wn)},(e,t)=>(t-e)/wn,e=>e.getUTCSeconds());Kr.range;const yc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wn)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getMinutes());yc.range,te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getUTCMinutes()).range;const xc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wn-e.getMinutes()*Ne)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getHours());xc.range,te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCHours()).range;const Ji=te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ne)/On,e=>e.getDate()-1);Ji.range;const bc=te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/On,e=>e.getUTCDate()-1);bc.range,te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/On,e=>Math.floor(e/On)).range;function pr(e){return te(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())*Ne)/gc)}const Ha=pr(0),Va=pr(1),gw=pr(2),vw=pr(3),Qr=pr(4),yw=pr(5),xw=pr(6);Ha.range,Va.range,gw.range,vw.range,Qr.range,yw.range,xw.range;function mr(e){return te(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)/gc)}const sp=mr(0),Fa=mr(1),bw=mr(2),Ew=mr(3),Jr=mr(4),_w=mr(5),ww=mr(6);sp.range,Fa.range,bw.range,Ew.range,Jr.range,_w.range,ww.range;const Ec=te(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());Ec.range,te(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 Tn=te(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());Tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(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)}),Tn.range;const gr=te(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());gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(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)}),gr.range;function Sw(e,t,n,r,i,s){const a=[[Kr,1,wn],[Kr,5,5*wn],[Kr,15,15*wn],[Kr,30,30*wn],[s,1,Ne],[s,5,5*Ne],[s,15,15*Ne],[s,30,30*Ne],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,On],[r,2,2*On],[n,1,gc],[t,1,ip],[t,3,3*ip],[e,1,vc]];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=el(([,,m])=>m).right(a,h);if(f===a.length)return e.every(il(c/vc,u/vc,d));if(f===0)return Ba.every(Math.max(il(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[Ow,Tw]=Sw(Tn,Ec,Ha,Ji,xc,yc);function _c(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 wc(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 Mw(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),g=es(l),y=ns(l),x={a:H,A:P,b:N,B:Z,c:null,d:hp,e:hp,f:Xw,g:aS,G:lS,H:qw,I:Yw,j:Zw,L:dp,m:Kw,M:Qw,p:q,q:it,Q:yp,s:xp,S:Jw,u:tS,U:eS,V:nS,w:rS,W:iS,x:null,X:null,y:sS,Y:oS,Z:cS,"%":vp},w={a:nt,A:Y,b:J,B:pt,c:null,d:pp,e:pp,f:fS,g:wS,G:OS,H:uS,I:hS,j:dS,L:mp,m:pS,M:mS,p:at,q:Tt,Q:yp,s:xp,S:gS,u:vS,U:yS,V:xS,w:bS,W:ES,x:null,X:null,y:_S,Y:SS,Z:TS,"%":vp},_={a:L,A,b:V,B:M,c:R,d:cp,e:cp,f:Gw,g:lp,G:op,H:up,I:up,j:Bw,L:Fw,m:Uw,M:Hw,p:U,q:Pw,Q:jw,s:Ww,S:Vw,u:Lw,U:Dw,V:kw,w:Rw,W:Iw,x:E,X:B,y:lp,Y:op,Z:Nw,"%":zw};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(X,tt){return function(ut){var z=[],Rt=-1,xt=0,Ht=X.length,Vt,st,Lt;for(ut instanceof Date||(ut=new Date(+ut));++Rt<Ht;)X.charCodeAt(Rt)===37&&(z.push(X.slice(xt,Rt)),(st=ap[Vt=X.charAt(++Rt)])!=null?Vt=X.charAt(++Rt):st=Vt==="e"?" ":"0",(Lt=tt[Vt])&&(Vt=Lt(ut,st)),z.push(Vt),xt=Rt+1);return z.push(X.slice(xt,Rt)),z.join("")}}function T(X,tt){return function(ut){var z=ts(1900,void 0,1),Rt=I(z,X,ut+="",0),xt,Ht;if(Rt!=ut.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?(xt=wc(ts(z.y,0,1)),Ht=xt.getUTCDay(),xt=Ht>4||Ht===0?Fa.ceil(xt):Fa(xt),xt=bc.offset(xt,(z.V-1)*7),z.y=xt.getUTCFullYear(),z.m=xt.getUTCMonth(),z.d=xt.getUTCDate()+(z.w+6)%7):(xt=_c(ts(z.y,0,1)),Ht=xt.getDay(),xt=Ht>4||Ht===0?Va.ceil(xt):Va(xt),xt=Ji.offset(xt,(z.V-1)*7),z.y=xt.getFullYear(),z.m=xt.getMonth(),z.d=xt.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),Ht="Z"in z?wc(ts(z.y,0,1)).getUTCDay():_c(ts(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Ht+5)%7:z.w+z.U*7-(Ht+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,wc(z)):_c(z)}}function I(X,tt,ut,z){for(var Rt=0,xt=tt.length,Ht=ut.length,Vt,st;Rt<xt;){if(z>=Ht)return-1;if(Vt=tt.charCodeAt(Rt++),Vt===37){if(Vt=tt.charAt(Rt++),st=_[Vt in ap?tt.charAt(Rt++):Vt],!st||(z=st(X,ut,z))<0)return-1}else if(Vt!=ut.charCodeAt(z++))return-1}return z}function U(X,tt,ut){var z=c.exec(tt.slice(ut));return z?(X.p=u.get(z[0].toLowerCase()),ut+z[0].length):-1}function L(X,tt,ut){var z=f.exec(tt.slice(ut));return z?(X.w=p.get(z[0].toLowerCase()),ut+z[0].length):-1}function A(X,tt,ut){var z=d.exec(tt.slice(ut));return z?(X.w=h.get(z[0].toLowerCase()),ut+z[0].length):-1}function V(X,tt,ut){var z=g.exec(tt.slice(ut));return z?(X.m=y.get(z[0].toLowerCase()),ut+z[0].length):-1}function M(X,tt,ut){var z=v.exec(tt.slice(ut));return z?(X.m=m.get(z[0].toLowerCase()),ut+z[0].length):-1}function R(X,tt,ut){return I(X,t,tt,ut)}function E(X,tt,ut){return I(X,n,tt,ut)}function B(X,tt,ut){return I(X,r,tt,ut)}function H(X){return a[X.getDay()]}function P(X){return s[X.getDay()]}function N(X){return l[X.getMonth()]}function Z(X){return o[X.getMonth()]}function q(X){return i[+(X.getHours()>=12)]}function it(X){return 1+~~(X.getMonth()/3)}function nt(X){return a[X.getUTCDay()]}function Y(X){return s[X.getUTCDay()]}function J(X){return l[X.getUTCMonth()]}function pt(X){return o[X.getUTCMonth()]}function at(X){return i[+(X.getUTCHours()>=12)]}function Tt(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var tt=S(X+="",x);return tt.toString=function(){return X},tt},parse:function(X){var tt=T(X+="",!1);return tt.toString=function(){return X},tt},utcFormat:function(X){var tt=S(X+="",w);return tt.toString=function(){return X},tt},utcParse:function(X){var tt=T(X+="",!0);return tt.toString=function(){return X},tt}}}var ap={"-":"",_:" ",0:"0"},ne=/^\s*\d+/,Cw=/^%/,Aw=/[\\^$*+?|[\]().{}]/g;function wt(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 $w(e){return e.replace(Aw,"\\$&")}function es(e){return new RegExp("^(?:"+e.map($w).join("|")+")","i")}function ns(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Rw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Lw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Iw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function op(e,t,n){var r=ne.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lp(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nw(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 Pw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Uw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cp(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Bw(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function up(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Hw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Fw(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Gw(e,t,n){var r=ne.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=Cw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function jw(e,t,n){var r=ne.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ww(e,t,n){var r=ne.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hp(e,t){return wt(e.getDate(),t,2)}function qw(e,t){return wt(e.getHours(),t,2)}function Yw(e,t){return wt(e.getHours()%12||12,t,2)}function Zw(e,t){return wt(1+Ji.count(Tn(e),e),t,3)}function dp(e,t){return wt(e.getMilliseconds(),t,3)}function Xw(e,t){return dp(e,t)+"000"}function Kw(e,t){return wt(e.getMonth()+1,t,2)}function Qw(e,t){return wt(e.getMinutes(),t,2)}function Jw(e,t){return wt(e.getSeconds(),t,2)}function tS(e){var t=e.getDay();return t===0?7:t}function eS(e,t){return wt(Ha.count(Tn(e)-1,e),t,2)}function fp(e){var t=e.getDay();return t>=4||t===0?Qr(e):Qr.ceil(e)}function nS(e,t){return e=fp(e),wt(Qr.count(Tn(e),e)+(Tn(e).getDay()===4),t,2)}function rS(e){return e.getDay()}function iS(e,t){return wt(Va.count(Tn(e)-1,e),t,2)}function sS(e,t){return wt(e.getFullYear()%100,t,2)}function aS(e,t){return e=fp(e),wt(e.getFullYear()%100,t,2)}function oS(e,t){return wt(e.getFullYear()%1e4,t,4)}function lS(e,t){var n=e.getDay();return e=n>=4||n===0?Qr(e):Qr.ceil(e),wt(e.getFullYear()%1e4,t,4)}function cS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+wt(t/60|0,"0",2)+wt(t%60,"0",2)}function pp(e,t){return wt(e.getUTCDate(),t,2)}function uS(e,t){return wt(e.getUTCHours(),t,2)}function hS(e,t){return wt(e.getUTCHours()%12||12,t,2)}function dS(e,t){return wt(1+bc.count(gr(e),e),t,3)}function mp(e,t){return wt(e.getUTCMilliseconds(),t,3)}function fS(e,t){return mp(e,t)+"000"}function pS(e,t){return wt(e.getUTCMonth()+1,t,2)}function mS(e,t){return wt(e.getUTCMinutes(),t,2)}function gS(e,t){return wt(e.getUTCSeconds(),t,2)}function vS(e){var t=e.getUTCDay();return t===0?7:t}function yS(e,t){return wt(sp.count(gr(e)-1,e),t,2)}function gp(e){var t=e.getUTCDay();return t>=4||t===0?Jr(e):Jr.ceil(e)}function xS(e,t){return e=gp(e),wt(Jr.count(gr(e),e)+(gr(e).getUTCDay()===4),t,2)}function bS(e){return e.getUTCDay()}function ES(e,t){return wt(Fa.count(gr(e)-1,e),t,2)}function _S(e,t){return wt(e.getUTCFullYear()%100,t,2)}function wS(e,t){return e=gp(e),wt(e.getUTCFullYear()%100,t,2)}function SS(e,t){return wt(e.getUTCFullYear()%1e4,t,4)}function OS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Jr(e):Jr.ceil(e),wt(e.getUTCFullYear()%1e4,t,4)}function TS(){return"+0000"}function vp(){return"%"}function yp(e){return+e}function xp(e){return Math.floor(+e/1e3)}var ti,bp;MS({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 MS(e){return ti=Mw(e),bp=ti.format,ti.parse,ti.utcFormat,ti.utcParse,ti}function CS(e){return new Date(e)}function AS(e){return e instanceof Date?+e:+new Date(+e)}function Ep(e,t,n,r,i,s,a,o,l,c){var u=Kf(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),v=c("%I:%M"),m=c("%I %p"),g=c("%a %d"),y=c("%b %d"),x=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?g:y:n(S)<S?x:w)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,AS)):h().map(CS)},u.ticks=function(S){var T=h();return e(T[0],T[T.length-1],S??10)},u.tickFormat=function(S,T){return T==null?_:c(T)},u.nice=function(S){var T=h();return(!S||typeof S.range!="function")&&(S=t(T[0],T[T.length-1],S??10)),S?h(Jf(T,S)):u},u.copy=function(){return dc(u,Ep(e,t,n,r,i,s,a,o,l,c))},u}function _p(){return Zr.apply(Ep(Ow,Tw,Tn,Ec,Ha,Ji,xc,yc,Kr,bp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function vt(e){return function(){return e}}const wp=Math.abs,ce=Math.atan2,vr=Math.cos,$S=Math.max,Sc=Math.min,cn=Math.sin,ei=Math.sqrt,ue=1e-12,rs=Math.PI,Ga=rs/2,za=2*rs;function RS(e){return e>1?0:e<-1?rs:Math.acos(e)}function Sp(e){return e>=1?Ga:e<=-1?-Ga:Math.asin(e)}function ja(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 Nl(t)}function LS(e){return e.innerRadius}function DS(e){return e.outerRadius}function kS(e){return e.startAngle}function IS(e){return e.endAngle}function NS(e){return e&&e.padAngle}function PS(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<ue))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Wa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/ei(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,g=(f+v)/2,y=p-h,x=v-f,w=y*y+x*x,_=i-s,S=h*v-p*f,T=(x<0?-1:1)*ei($S(0,_*_*w-S*S)),I=(S*x-y*T)/w,U=(-S*y-x*T)/w,L=(S*x+y*T)/w,A=(-S*y+x*T)/w,V=I-m,M=U-g,R=L-m,E=A-g;return V*V+M*M>R*R+E*E&&(I=L,U=A),{cx:I,cy:U,x01:-u,y01:-d,x11:I*(i/_-1),y11:U*(i/_-1)}}function is(){var e=LS,t=DS,n=vt(0),r=null,i=kS,s=IS,a=NS,o=null,l=ja(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Ga,v=s.apply(this,arguments)-Ga,m=wp(v-p),g=v>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>ue))o.moveTo(0,0);else if(m>za-ue)o.moveTo(f*vr(p),f*cn(p)),o.arc(0,0,f,p,v,!g),h>ue&&(o.moveTo(h*vr(v),h*cn(v)),o.arc(0,0,h,v,p,g));else{var y=p,x=v,w=p,_=v,S=m,T=m,I=a.apply(this,arguments)/2,U=I>ue&&(r?+r.apply(this,arguments):ei(h*h+f*f)),L=Sc(wp(f-h)/2,+n.apply(this,arguments)),A=L,V=L,M,R;if(U>ue){var E=Sp(U/h*cn(I)),B=Sp(U/f*cn(I));(S-=E*2)>ue?(E*=g?1:-1,w+=E,_-=E):(S=0,w=_=(p+v)/2),(T-=B*2)>ue?(B*=g?1:-1,y+=B,x-=B):(T=0,y=x=(p+v)/2)}var H=f*vr(y),P=f*cn(y),N=h*vr(_),Z=h*cn(_);if(L>ue){var q=f*vr(x),it=f*cn(x),nt=h*vr(w),Y=h*cn(w),J;if(m<rs)if(J=PS(H,P,nt,Y,q,it,N,Z)){var pt=H-J[0],at=P-J[1],Tt=q-J[0],X=it-J[1],tt=1/cn(RS((pt*Tt+at*X)/(ei(pt*pt+at*at)*ei(Tt*Tt+X*X)))/2),ut=ei(J[0]*J[0]+J[1]*J[1]);A=Sc(L,(h-ut)/(tt-1)),V=Sc(L,(f-ut)/(tt+1))}else A=V=0}T>ue?V>ue?(M=Wa(nt,Y,H,P,f,V,g),R=Wa(q,it,N,Z,f,V,g),o.moveTo(M.cx+M.x01,M.cy+M.y01),V<L?o.arc(M.cx,M.cy,V,ce(M.y01,M.x01),ce(R.y01,R.x01),!g):(o.arc(M.cx,M.cy,V,ce(M.y01,M.x01),ce(M.y11,M.x11),!g),o.arc(0,0,f,ce(M.cy+M.y11,M.cx+M.x11),ce(R.cy+R.y11,R.cx+R.x11),!g),o.arc(R.cx,R.cy,V,ce(R.y11,R.x11),ce(R.y01,R.x01),!g))):(o.moveTo(H,P),o.arc(0,0,f,y,x,!g)):o.moveTo(H,P),!(h>ue)||!(S>ue)?o.lineTo(N,Z):A>ue?(M=Wa(N,Z,q,it,h,-A,g),R=Wa(H,P,nt,Y,h,-A,g),o.lineTo(M.cx+M.x01,M.cy+M.y01),A<L?o.arc(M.cx,M.cy,A,ce(M.y01,M.x01),ce(R.y01,R.x01),!g):(o.arc(M.cx,M.cy,A,ce(M.y01,M.x01),ce(M.y11,M.x11),!g),o.arc(0,0,h,ce(M.cy+M.y11,M.cx+M.x11),ce(R.cy+R.y11,R.cx+R.x11),g),o.arc(R.cx,R.cy,A,ce(R.y11,R.x11),ce(R.y01,R.x01),!g))):o.arc(0,0,h,_,w,g)}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[vr(d)*u,cn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:vt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:vt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:vt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:vt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:vt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:vt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:vt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var US=Array.prototype.slice;function qa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Op(e){this._context=e}Op.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 Ya(e){return new Op(e)}function Oc(e){return e[0]}function Tc(e){return e[1]}function ss(e,t){var n=vt(!0),r=null,i=Ya,s=null,a=ja(o);e=typeof e=="function"?e:e===void 0?Oc:vt(e),t=typeof t=="function"?t:t===void 0?Tc:vt(t);function o(l){var c,u=(l=qa(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:vt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:vt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:vt(!!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 Mc(e,t,n){var r=null,i=vt(!0),s=null,a=Ya,o=null,l=ja(c);e=typeof e=="function"?e:e===void 0?Oc:vt(+e),t=typeof t=="function"?t:vt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Tc:vt(+n);function c(d){var h,f,p,v=(d=qa(d)).length,m,g=!1,y,x=new Array(v),w=new Array(v);for(s==null&&(o=a(y=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===g)if(g=!g)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(x[p],w[p]);o.lineEnd(),o.areaEnd()}g&&(x[h]=+e(m,h,d),w[h]=+t(m,h,d),o.point(r?+r(m,h,d):x[h],n?+n(m,h,d):w[h]))}if(y)return o=null,y+""||null}function u(){return ss().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:vt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:vt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:vt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:vt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:vt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:vt(+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:vt(!!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 BS(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function HS(e){return e}function VS(){var e=HS,t=BS,n=null,r=vt(0),i=vt(za),s=vt(0);function a(o){var l,c=(o=qa(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),v=+r.apply(this,arguments),m=Math.min(za,Math.max(-za,i.apply(this,arguments)-v)),g,y=Math.min(Math.abs(m)/c,s.apply(this,arguments)),x=y*(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*x)/h:0;l<c;++l,v=g)u=f[l],w=p[u],g=v+(w>0?w*d:0)+x,p[u]={data:o[u],index:l,value:w,startAngle:v,endAngle:g,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:vt(+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:vt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:vt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:vt(+o),a):s},a}var FS=Mp(Ya);function Tp(e){this._curve=e}Tp.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 Mp(e){function t(n){return new Tp(e(n))}return t._curve=e,t}function GS(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(Mp(n)):t()._curve},e}function zS(){return GS(ss().curve(FS))}class jS{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 WS(e){return new jS(e,!0)}function qS(e){return e.source}function YS(e){return e.target}function ZS(e){let t=qS,n=YS,r=Oc,i=Tc,s=null,a=null,o=ja(l);function l(){let c;const u=US.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:vt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:vt(+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 ZS(WS)}function zn(){}function Za(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 Xa(e){this._context=e}Xa.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:Za(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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KS(e){return new Xa(e)}function Cp(e){this._context=e}Cp.prototype={areaStart:zn,areaEnd:zn,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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QS(e){return new Cp(e)}function Ap(e){this._context=e}Ap.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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JS(e){return new Ap(e)}function $p(e,t){this._basis=new Xa(e),this._beta=t}$p.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 tO=function e(t){function n(r){return t===1?new Xa(r):new $p(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ka(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 Cc(e,t){this._context=e,this._k=(1-t)/6}Cc.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:Ka(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:Ka(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 Cc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ac(e,t){this._context=e,this._k=(1-t)/6}Ac.prototype={areaStart:zn,areaEnd:zn,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:Ka(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 Ac(r,t)}return n.tension=function(r){return e(+r)},n}(0);function $c(e,t){this._context=e,this._k=(1-t)/6}$c.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:Ka(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 rO=function e(t){function n(r){return new $c(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Rc(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ue){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>ue){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 Rp(e,t){this._context=e,this._alpha=t}Rp.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:Rc(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 Rp(r,t):new Cc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Lp(e,t){this._context=e,this._alpha=t}Lp.prototype={areaStart:zn,areaEnd:zn,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:Rc(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 Lp(r,t):new Ac(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Dp(e,t){this._context=e,this._alpha=t}Dp.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:Rc(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 aO=function e(t){function n(r){return t?new Dp(r,t):new $c(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function kp(e){this._context=e}kp.prototype={areaStart:zn,areaEnd:zn,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 Ip(e){return new kp(e)}function Np(e){return e<0?-1:1}function Pp(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(Np(s)+Np(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Up(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Lc(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 Qa(e){this._context=e}Qa.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:Lc(this,this._t0,Up(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,Lc(this,Up(this,n=Pp(this,e,t)),n);break;default:Lc(this,this._t0,n=Pp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Bp(e){this._context=new Hp(e)}(Bp.prototype=Object.create(Qa.prototype)).point=function(e,t){Qa.prototype.point.call(this,t,e)};function Hp(e){this._context=e}Hp.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 oO(e){return new Qa(e)}function lO(e){return new Bp(e)}function Vp(e){this._context=e}Vp.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=Fp(e),i=Fp(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 Fp(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 cO(e){return new Vp(e)}function Ja(e,t){this._context=e,this._t=t}Ja.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 uO(e){return new Ja(e,.5)}function hO(e){return new Ja(e,0)}function dO(e){return new Ja(e,1)}function Gp(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 zp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function fO(e,t){return e[t]}function pO(e){const t=[];return t.key=e,t}function Dc(){var e=vt([]),t=zp,n=Gp,r=fO;function i(s){var a=Array.from(e.apply(this,arguments),pO),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=qa(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:vt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:vt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?zp:typeof s=="function"?s:vt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Gp,i):n},i}function mO(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 kc(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)?vO(o,d=>d.test(a)):gO(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 gO(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vO(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yO(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 St(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 xO={};function to(){return xO}function cs(e,t){var n,r,i,s;const a=to(),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=St(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 bO={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"}},EO=(e,t,n)=>{let r;const i=bO[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},_O={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wO=(e,t,n,r)=>_O[e],SO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},OO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TO={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"]},MO={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"]},CO={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"}},AO={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"}},$O=(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"},RO={ordinalNumber:$O,era:os({values:SO,defaultWidth:"wide"}),quarter:os({values:OO,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:TO,defaultWidth:"wide"}),day:os({values:MO,defaultWidth:"wide"}),dayPeriod:os({values:CO,defaultWidth:"wide",formattingValues:AO,defaultFormattingWidth:"wide"})},LO=/^(\d+)(th|st|nd|rd)?/i,DO=/\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},IO={any:[/^b/i,/^(a|c)/i]},NO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PO={any:[/1/i,/2/i,/3/i,/4/i]},UO={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},BO={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]},HO={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},VO={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]},FO={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},GO={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:yO({matchPattern:LO,parsePattern:DO,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:kO,defaultMatchWidth:"wide",parsePatterns:IO,defaultParseWidth:"any"}),quarter:ls({matchPatterns:NO,defaultMatchWidth:"wide",parsePatterns:PO,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:UO,defaultMatchWidth:"wide",parsePatterns:BO,defaultParseWidth:"any"}),day:ls({matchPatterns:HO,defaultMatchWidth:"wide",parsePatterns:VO,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:FO,defaultMatchWidth:"any",parsePatterns:GO,defaultParseWidth:"any"})},jO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},WO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},YO={date:kc({formats:jO,defaultWidth:"full"}),time:kc({formats:WO,defaultWidth:"full"}),dateTime:kc({formats:qO,defaultWidth:"full"})},jp={code:"en-US",formatDistance:EO,formatLong:YO,formatRelative:wO,localize:RO,match:zO,options:{weekStartsOn:0,firstWeekContainsDate:1}};var ZO=typeof global=="object"&&global&&global.Object===Object&&global;const Wp=ZO;var XO=typeof self=="object"&&self&&self.Object===Object&&self,KO=Wp||XO||Function("return this")();const Ze=KO;var QO=Ze.Symbol;const Pe=QO;var qp=Object.prototype,JO=qp.hasOwnProperty,tT=qp.toString,us=Pe?Pe.toStringTag:void 0;function eT(e){var t=JO.call(e,us),n=e[us];try{e[us]=void 0;var r=!0}catch{}var i=tT.call(e);return r&&(t?e[us]=n:delete e[us]),i}var nT=Object.prototype,rT=nT.toString;function iT(e){return rT.call(e)}var sT="[object Null]",aT="[object Undefined]",Yp=Pe?Pe.toStringTag:void 0;function yr(e){return e==null?e===void 0?aT:sT:Yp&&Yp in Object(e)?eT(e):iT(e)}function un(e){return e!=null&&typeof e=="object"}var oT="[object Symbol]";function eo(e){return typeof e=="symbol"||un(e)&&yr(e)==oT}function Zp(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 lT=Array.isArray;const re=lT;var cT=1/0,Xp=Pe?Pe.prototype:void 0,Kp=Xp?Xp.toString:void 0;function Qp(e){if(typeof e=="string")return e;if(re(e))return Zp(e,Qp)+"";if(eo(e))return Kp?Kp.call(e):"";var t=e+"";return t=="0"&&1/e==-cT?"-0":t}function Ue(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ic(e){return e}var uT="[object AsyncFunction]",hT="[object Function]",dT="[object GeneratorFunction]",fT="[object Proxy]";function Nc(e){if(!Ue(e))return!1;var t=yr(e);return t==hT||t==dT||t==uT||t==fT}var pT=Ze["__core-js_shared__"];const Pc=pT;var Jp=function(){var e=/[^.]+$/.exec(Pc&&Pc.keys&&Pc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mT(e){return!!Jp&&Jp in e}var gT=Function.prototype,vT=gT.toString;function xr(e){if(e!=null){try{return vT.call(e)}catch{}try{return e+""}catch{}}return""}var yT=/[\\^$.*+?()[\]{}|]/g,xT=/^\[object .+?Constructor\]$/,bT=Function.prototype,ET=Object.prototype,_T=bT.toString,wT=ET.hasOwnProperty,ST=RegExp("^"+_T.call(wT).replace(yT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OT(e){if(!Ue(e)||mT(e))return!1;var t=Nc(e)?ST:xT;return t.test(xr(e))}function TT(e,t){return e==null?void 0:e[t]}function br(e,t){var n=TT(e,t);return OT(n)?n:void 0}var MT=br(Ze,"WeakMap");const Uc=MT;var tm=Object.create,CT=function(){function e(){}return function(t){if(!Ue(t))return{};if(tm)return tm(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const AT=CT;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 RT(){}function em(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var LT=800,DT=16,kT=Date.now;function IT(e){var t=0,n=0;return function(){var r=kT(),i=DT-(r-n);if(n=r,i>0){if(++t>=LT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function NT(e){return function(){return e}}var PT=function(){try{var e=br(Object,"defineProperty");return e({},"",{}),e}catch{}}();const no=PT;var UT=no?function(e,t){return no(e,"toString",{configurable:!0,enumerable:!1,value:NT(t),writable:!0})}:Ic,BT=IT(UT);const HT=BT;function VT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function FT(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function GT(e){return e!==e}function zT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function jT(e,t,n){return t===t?zT(e,t,n):FT(e,GT,n)}function WT(e,t){var n=e==null?0:e.length;return!!n&&jT(e,t,0)>-1}var qT=9007199254740991,YT=/^(?:0|[1-9]\d*)$/;function Bc(e,t){var n=typeof e;return t=t??qT,!!t&&(n=="number"||n!="symbol"&&YT.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){t=="__proto__"&&no?no(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 ZT=Object.prototype,XT=ZT.hasOwnProperty;function nm(e,t,n){var r=e[t];(!(XT.call(e,t)&&hs(r,n))||n===void 0&&!(t in e))&&ro(e,t,n)}function ds(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?ro(n,o,l):nm(n,o,l)}return n}var rm=Math.max;function KT(e,t,n){return t=rm(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=rm(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 im(e,t){return HT(KT(e,t,Ic),e+"")}var QT=9007199254740991;function Hc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QT}function Er(e){return e!=null&&Hc(e.length)&&!Nc(e)}function sm(e,t,n){if(!Ue(n))return!1;var r=typeof t;return(r=="number"?Er(n)&&Bc(t,n.length):r=="string"&&t in n)?hs(n[t],e):!1}function JT(e){return im(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&&sm(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 tM=Object.prototype;function io(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||tM;return e===n}function eM(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nM="[object Arguments]";function am(e){return un(e)&&yr(e)==nM}var om=Object.prototype,rM=om.hasOwnProperty,iM=om.propertyIsEnumerable,sM=am(function(){return arguments}())?am:function(e){return un(e)&&rM.call(e,"callee")&&!iM.call(e,"callee")};const ni=sM;function aM(){return!1}var lm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,cm=lm&&typeof module=="object"&&module&&!module.nodeType&&module,oM=cm&&cm.exports===lm,um=oM?Ze.Buffer:void 0,lM=um?um.isBuffer:void 0,cM=lM||aM;const ri=cM;var uM="[object Arguments]",hM="[object Array]",dM="[object Boolean]",fM="[object Date]",pM="[object Error]",mM="[object Function]",gM="[object Map]",vM="[object Number]",yM="[object Object]",xM="[object RegExp]",bM="[object Set]",EM="[object String]",_M="[object WeakMap]",wM="[object ArrayBuffer]",SM="[object DataView]",OM="[object Float32Array]",TM="[object Float64Array]",MM="[object Int8Array]",CM="[object Int16Array]",AM="[object Int32Array]",$M="[object Uint8Array]",RM="[object Uint8ClampedArray]",LM="[object Uint16Array]",DM="[object Uint32Array]",Ut={};Ut[OM]=Ut[TM]=Ut[MM]=Ut[CM]=Ut[AM]=Ut[$M]=Ut[RM]=Ut[LM]=Ut[DM]=!0,Ut[uM]=Ut[hM]=Ut[wM]=Ut[dM]=Ut[SM]=Ut[fM]=Ut[pM]=Ut[mM]=Ut[gM]=Ut[vM]=Ut[yM]=Ut[xM]=Ut[bM]=Ut[EM]=Ut[_M]=!1;function kM(e){return un(e)&&Hc(e.length)&&!!Ut[yr(e)]}function Vc(e){return function(t){return e(t)}}var hm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,fs=hm&&typeof module=="object"&&module&&!module.nodeType&&module,IM=fs&&fs.exports===hm,Fc=IM&&Wp.process,NM=function(){try{var e=fs&&fs.require&&fs.require("util").types;return e||Fc&&Fc.binding&&Fc.binding("util")}catch{}}();const ii=NM;var dm=ii&&ii.isTypedArray,PM=dm?Vc(dm):kM;const so=PM;var UM=Object.prototype,BM=UM.hasOwnProperty;function fm(e,t){var n=re(e),r=!n&&ni(e),i=!n&&!r&&ri(e),s=!n&&!r&&!i&&so(e),a=n||r||i||s,o=a?eM(e.length,String):[],l=o.length;for(var c in e)(t||BM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Bc(c,l)))&&o.push(c);return o}function pm(e,t){return function(n){return e(t(n))}}var HM=pm(Object.keys,Object);const VM=HM;var FM=Object.prototype,GM=FM.hasOwnProperty;function mm(e){if(!io(e))return VM(e);var t=[];for(var n in Object(e))GM.call(e,n)&&n!="constructor"&&t.push(n);return t}function ps(e){return Er(e)?fm(e):mm(e)}function zM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var jM=Object.prototype,WM=jM.hasOwnProperty;function qM(e){if(!Ue(e))return zM(e);var t=io(e),n=[];for(var r in e)r=="constructor"&&(t||!WM.call(e,r))||n.push(r);return n}function ms(e){return Er(e)?fm(e,!0):qM(e)}var YM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZM=/^\w*$/;function Gc(e,t){if(re(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||eo(e)?!0:ZM.test(e)||!YM.test(e)||t!=null&&e in Object(t)}var XM=br(Object,"create");const gs=XM;function KM(){this.__data__=gs?gs(null):{},this.size=0}function QM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var JM="__lodash_hash_undefined__",tC=Object.prototype,eC=tC.hasOwnProperty;function nC(e){var t=this.__data__;if(gs){var n=t[e];return n===JM?void 0:n}return eC.call(t,e)?t[e]:void 0}var rC=Object.prototype,iC=rC.hasOwnProperty;function sC(e){var t=this.__data__;return gs?t[e]!==void 0:iC.call(t,e)}var aC="__lodash_hash_undefined__";function oC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gs&&t===void 0?aC:t,this}function _r(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])}}_r.prototype.clear=KM,_r.prototype.delete=QM,_r.prototype.get=nC,_r.prototype.has=sC,_r.prototype.set=oC;function lC(){this.__data__=[],this.size=0}function ao(e,t){for(var n=e.length;n--;)if(hs(e[n][0],t))return n;return-1}var cC=Array.prototype,uC=cC.splice;function hC(e){var t=this.__data__,n=ao(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():uC.call(t,n,1),--this.size,!0}function dC(e){var t=this.__data__,n=ao(t,e);return n<0?void 0:t[n][1]}function fC(e){return ao(this.__data__,e)>-1}function pC(e,t){var n=this.__data__,r=ao(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Mn(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])}}Mn.prototype.clear=lC,Mn.prototype.delete=hC,Mn.prototype.get=dC,Mn.prototype.has=fC,Mn.prototype.set=pC;var mC=br(Ze,"Map");const vs=mC;function gC(){this.size=0,this.__data__={hash:new _r,map:new(vs||Mn),string:new _r}}function vC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function oo(e,t){var n=e.__data__;return vC(t)?n[typeof t=="string"?"string":"hash"]:n.map}function yC(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t}function xC(e){return oo(this,e).get(e)}function bC(e){return oo(this,e).has(e)}function EC(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Cn(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])}}Cn.prototype.clear=gC,Cn.prototype.delete=yC,Cn.prototype.get=xC,Cn.prototype.has=bC,Cn.prototype.set=EC;var _C="Expected a function";function zc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_C);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(zc.Cache||Cn),n}zc.Cache=Cn;var wC=500;function SC(e){var t=zc(e,function(r){return n.size===wC&&n.clear(),r}),n=t.cache;return t}var OC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TC=/\\(\\)?/g,MC=SC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(OC,function(n,r,i,s){t.push(i?s.replace(TC,"$1"):r||n)}),t});const CC=MC;function ys(e){return e==null?"":Qp(e)}function gm(e,t){return re(e)?e:Gc(e,t)?[e]:CC(ys(e))}var AC=1/0;function lo(e){if(typeof e=="string"||eo(e))return e;var t=e+"";return t=="0"&&1/e==-AC?"-0":t}function vm(e,t){t=gm(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lo(t[n++])];return n&&n==r?e:void 0}function It(e,t,n){var r=e==null?void 0:vm(e,t);return r===void 0?n:r}function jc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ym=Pe?Pe.isConcatSpreadable:void 0;function $C(e){return re(e)||ni(e)||!!(ym&&e&&e[ym])}function co(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=$C),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?co(o,t-1,n,r,i):jc(i,o):r||(i[i.length]=o)}return i}var RC=pm(Object.getPrototypeOf,Object);const Wc=RC;var LC="[object Object]",DC=Function.prototype,kC=Object.prototype,xm=DC.toString,IC=kC.hasOwnProperty,NC=xm.call(Object);function PC(e){if(!un(e)||yr(e)!=LC)return!1;var t=Wc(e);if(t===null)return!0;var n=IC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&xm.call(n)==NC}function UC(){this.__data__=new Mn,this.size=0}function BC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function HC(e){return this.__data__.get(e)}function VC(e){return this.__data__.has(e)}var FC=200;function GC(e,t){var n=this.__data__;if(n instanceof Mn){var r=n.__data__;if(!vs||r.length<FC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Cn(r)}return n.set(e,t),this.size=n.size,this}function Xe(e){var t=this.__data__=new Mn(e);this.size=t.size}Xe.prototype.clear=UC,Xe.prototype.delete=BC,Xe.prototype.get=HC,Xe.prototype.has=VC,Xe.prototype.set=GC;function zC(e,t){return e&&ds(t,ps(t),e)}function jC(e,t){return e&&ds(t,ms(t),e)}var bm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,Em=bm&&typeof module=="object"&&module&&!module.nodeType&&module,WC=Em&&Em.exports===bm,_m=WC?Ze.Buffer:void 0,wm=_m?_m.allocUnsafe:void 0;function Sm(e,t){if(t)return e.slice();var n=e.length,r=wm?wm(n):new e.constructor(n);return e.copy(r),r}function qC(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 Om(){return[]}var YC=Object.prototype,ZC=YC.propertyIsEnumerable,Tm=Object.getOwnPropertySymbols,XC=Tm?function(e){return e==null?[]:(e=Object(e),qC(Tm(e),function(t){return ZC.call(e,t)}))}:Om;const qc=XC;function KC(e,t){return ds(e,qc(e),t)}var QC=Object.getOwnPropertySymbols,JC=QC?function(e){for(var t=[];e;)jc(t,qc(e)),e=Wc(e);return t}:Om;const Mm=JC;function tA(e,t){return ds(e,Mm(e),t)}function Cm(e,t,n){var r=t(e);return re(e)?r:jc(r,n(e))}function Yc(e){return Cm(e,ps,qc)}function eA(e){return Cm(e,ms,Mm)}var nA=br(Ze,"DataView");const Zc=nA;var rA=br(Ze,"Promise");const Xc=rA;var iA=br(Ze,"Set");const si=iA;var Am="[object Map]",sA="[object Object]",$m="[object Promise]",Rm="[object Set]",Lm="[object WeakMap]",Dm="[object DataView]",aA=xr(Zc),oA=xr(vs),lA=xr(Xc),cA=xr(si),uA=xr(Uc),wr=yr;(Zc&&wr(new Zc(new ArrayBuffer(1)))!=Dm||vs&&wr(new vs)!=Am||Xc&&wr(Xc.resolve())!=$m||si&&wr(new si)!=Rm||Uc&&wr(new Uc)!=Lm)&&(wr=function(e){var t=yr(e),n=t==sA?e.constructor:void 0,r=n?xr(n):"";if(r)switch(r){case aA:return Dm;case oA:return Am;case lA:return $m;case cA:return Rm;case uA:return Lm}return t});const ai=wr;var hA=Object.prototype,dA=hA.hasOwnProperty;function fA(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dA.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var pA=Ze.Uint8Array;const uo=pA;function Kc(e){var t=new e.constructor(e.byteLength);return new uo(t).set(new uo(e)),t}function mA(e,t){var n=t?Kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gA=/\w*$/;function vA(e){var t=new e.constructor(e.source,gA.exec(e));return t.lastIndex=e.lastIndex,t}var km=Pe?Pe.prototype:void 0,Im=km?km.valueOf:void 0;function yA(e){return Im?Object(Im.call(e)):{}}function Nm(e,t){var n=t?Kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var xA="[object Boolean]",bA="[object Date]",EA="[object Map]",_A="[object Number]",wA="[object RegExp]",SA="[object Set]",OA="[object String]",TA="[object Symbol]",MA="[object ArrayBuffer]",CA="[object DataView]",AA="[object Float32Array]",$A="[object Float64Array]",RA="[object Int8Array]",LA="[object Int16Array]",DA="[object Int32Array]",kA="[object Uint8Array]",IA="[object Uint8ClampedArray]",NA="[object Uint16Array]",PA="[object Uint32Array]";function UA(e,t,n){var r=e.constructor;switch(t){case MA:return Kc(e);case xA:case bA:return new r(+e);case CA:return mA(e,n);case AA:case $A:case RA:case LA:case DA:case kA:case IA:case NA:case PA:return Nm(e,n);case EA:return new r;case _A:case OA:return new r(e);case wA:return vA(e);case SA:return new r;case TA:return yA(e)}}function Pm(e){return typeof e.constructor=="function"&&!io(e)?AT(Wc(e)):{}}var BA="[object Map]";function HA(e){return un(e)&&ai(e)==BA}var Um=ii&&ii.isMap,VA=Um?Vc(Um):HA;const FA=VA;var GA="[object Set]";function zA(e){return un(e)&&ai(e)==GA}var Bm=ii&&ii.isSet,jA=Bm?Vc(Bm):zA;const WA=jA;var qA=1,YA=2,ZA=4,Hm="[object Arguments]",XA="[object Array]",KA="[object Boolean]",QA="[object Date]",JA="[object Error]",Vm="[object Function]",t2="[object GeneratorFunction]",e2="[object Map]",n2="[object Number]",Fm="[object Object]",r2="[object RegExp]",i2="[object Set]",s2="[object String]",a2="[object Symbol]",o2="[object WeakMap]",l2="[object ArrayBuffer]",c2="[object DataView]",u2="[object Float32Array]",h2="[object Float64Array]",d2="[object Int8Array]",f2="[object Int16Array]",p2="[object Int32Array]",m2="[object Uint8Array]",g2="[object Uint8ClampedArray]",v2="[object Uint16Array]",y2="[object Uint32Array]",Nt={};Nt[Hm]=Nt[XA]=Nt[l2]=Nt[c2]=Nt[KA]=Nt[QA]=Nt[u2]=Nt[h2]=Nt[d2]=Nt[f2]=Nt[p2]=Nt[e2]=Nt[n2]=Nt[Fm]=Nt[r2]=Nt[i2]=Nt[s2]=Nt[a2]=Nt[m2]=Nt[g2]=Nt[v2]=Nt[y2]=!0,Nt[JA]=Nt[Vm]=Nt[o2]=!1;function ho(e,t,n,r,i,s){var a,o=t&qA,l=t&YA,c=t&ZA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ue(e))return e;var u=re(e);if(u){if(a=fA(e),!o)return em(e,a)}else{var d=ai(e),h=d==Vm||d==t2;if(ri(e))return Sm(e,o);if(d==Fm||d==Hm||h&&!i){if(a=l||h?{}:Pm(e),!o)return l?tA(e,jC(a,e)):KC(e,zC(a,e))}else{if(!Nt[d])return i?e:{};a=UA(e,d,o)}}s||(s=new Xe);var f=s.get(e);if(f)return f;s.set(e,a),WA(e)?e.forEach(function(m){a.add(ho(m,t,n,m,e,s))}):FA(e)&&e.forEach(function(m,g){a.set(g,ho(m,t,n,g,e,s))});var p=c?l?eA:Yc:l?ms:ps,v=u?void 0:p(e);return VT(v||e,function(m,g){v&&(g=m,m=e[g]),nm(a,g,ho(m,t,n,g,e,s))}),a}var x2=1,b2=4;function An(e){return ho(e,x2|b2)}var E2="__lodash_hash_undefined__";function _2(e){return this.__data__.set(e,E2),this}function w2(e){return this.__data__.has(e)}function xs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Cn;++t<n;)this.add(e[t])}xs.prototype.add=xs.prototype.push=_2,xs.prototype.has=w2;function Gm(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 S2=1,O2=2;function jm(e,t,n,r,i,s){var a=n&S2,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&O2?new xs: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(!Gm(t,function(g,y){if(!zm(f,y)&&(p===g||i(p,g,n,r,s)))return f.push(y)})){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 T2(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Qc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var M2=1,C2=2,A2="[object Boolean]",$2="[object Date]",R2="[object Error]",L2="[object Map]",D2="[object Number]",k2="[object RegExp]",I2="[object Set]",N2="[object String]",P2="[object Symbol]",U2="[object ArrayBuffer]",B2="[object DataView]",Wm=Pe?Pe.prototype:void 0,Jc=Wm?Wm.valueOf:void 0;function H2(e,t,n,r,i,s,a){switch(n){case B2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case U2:return!(e.byteLength!=t.byteLength||!s(new uo(e),new uo(t)));case A2:case $2:case D2:return hs(+e,+t);case R2:return e.name==t.name&&e.message==t.message;case k2:case N2:return e==t+"";case L2:var o=T2;case I2:var l=r&M2;if(o||(o=Qc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=C2,a.set(e,t);var u=jm(o(e),o(t),r,i,s,a);return a.delete(e),u;case P2:if(Jc)return Jc.call(e)==Jc.call(t)}return!1}var V2=1,F2=Object.prototype,G2=F2.hasOwnProperty;function z2(e,t,n,r,i,s){var a=n&V2,o=Yc(e),l=o.length,c=Yc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:G2.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 g=e[h],y=t[h];if(r)var x=a?r(y,g,h,t,e,s):r(g,y,h,e,t,s);if(!(x===void 0?g===y||i(g,y,n,r,s):x)){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 j2=1,qm="[object Arguments]",Ym="[object Array]",fo="[object Object]",W2=Object.prototype,Zm=W2.hasOwnProperty;function q2(e,t,n,r,i,s){var a=re(e),o=re(t),l=a?Ym:ai(e),c=o?Ym:ai(t);l=l==qm?fo:l,c=c==qm?fo:c;var u=l==fo,d=c==fo,h=l==c;if(h&&ri(e)){if(!ri(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Xe),a||so(e)?jm(e,t,n,r,i,s):H2(e,t,l,n,r,i,s);if(!(n&j2)){var f=u&&Zm.call(e,"__wrapped__"),p=d&&Zm.call(t,"__wrapped__");if(f||p){var v=f?e.value():e,m=p?t.value():t;return s||(s=new Xe),i(v,m,n,r,s)}}return h?(s||(s=new Xe),z2(e,t,n,r,i,s)):!1}function po(e,t,n,r,i){return e===t?!0:e==null||t==null||!un(e)&&!un(t)?e!==e&&t!==t:q2(e,t,n,r,po,i)}var Y2=1,Z2=2;function X2(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Xe;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?po(u,c,Y2|Z2,r,d):h))return!1}}return!0}function Xm(e){return e===e&&!Ue(e)}function K2(e){for(var t=ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xm(i)]}return t}function Km(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Q2(e){var t=K2(e);return t.length==1&&t[0][2]?Km(t[0][0],t[0][1]):function(n){return n===e||X2(n,e,t)}}function J2(e,t){return e!=null&&t in Object(e)}function t$(e,t,n){t=gm(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=lo(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&&Hc(i)&&Bc(a,i)&&(re(e)||ni(e)))}function e$(e,t){return e!=null&&t$(e,t,J2)}var n$=1,r$=2;function i$(e,t){return Gc(e)&&Xm(t)?Km(lo(e),t):function(n){var r=It(n,e);return r===void 0&&r===t?e$(n,e):po(t,r,n$|r$)}}function s$(e){return function(t){return t==null?void 0:t[e]}}function a$(e){return function(t){return vm(t,e)}}function o$(e){return Gc(e)?s$(lo(e)):a$(e)}function mo(e){return typeof e=="function"?e:e==null?Ic:typeof e=="object"?re(e)?i$(e[0],e[1]):Q2(e):o$(e)}function l$(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var c$=l$();const Qm=c$;function tu(e,t,n){(n!==void 0&&!hs(e[t],n)||n===void 0&&!(t in e))&&ro(e,t,n)}function eu(e){return un(e)&&Er(e)}function nu(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function u$(e){return ds(e,ms(e))}function h$(e,t,n,r,i,s,a){var o=nu(e,n),l=nu(t,n),c=a.get(l);if(c){tu(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=re(l),f=!h&&ri(l),p=!h&&!f&&so(l);u=l,h||f||p?re(o)?u=o:eu(o)?u=em(o):f?(d=!1,u=Sm(l,!0)):p?(d=!1,u=Nm(l,!0)):u=[]:PC(l)||ni(l)?(u=o,ni(o)?u=u$(o):(!Ue(o)||Nc(o))&&(u=Pm(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),tu(e,n,u)}function Jm(e,t,n,r,i){e!==t&&Qm(t,function(s,a){if(i||(i=new Xe),Ue(s))h$(e,t,a,n,Jm,r,i);else{var o=r?r(nu(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),tu(e,a,o)}},ms)}function d$(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function f$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var p$="[object Map]",m$="[object Set]",g$=Object.prototype,v$=g$.hasOwnProperty;function Ke(e){if(e==null)return!0;if(Er(e)&&(re(e)||typeof e=="string"||typeof e.splice=="function"||ri(e)||so(e)||ni(e)))return!e.length;var t=ai(e);if(t==p$||t==m$)return!e.size;if(io(e))return!mm(e).length;for(var n in e)if(v$.call(e,n))return!1;return!0}var y$=JT(function(e,t,n){Jm(e,t,n)});const lt=y$;var x$=1/0,b$=si&&1/Qc(new si([,-0]))[1]==x$?function(e){return new si(e)}:RT;const E$=b$;var _$=200;function tg(e,t,n){var r=-1,i=WT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=d$;else if(s>=_$){var c=t?null:E$(e);if(c)return Qc(c);a=!1,i=zm,l=new xs}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=n||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 w$=im(function(e){var t=f$(e);return eu(t)&&(t=void 0),tg(co(e,1,eu,!0),mo(t))});const S$=w$;function bs(e){return e&&e.length?tg(e):[]}const xe="cds",$n={opacity:{unselected:.05,selected:.4}},jn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},oi={duration:1e3,ease:$d,zoomLevel:3},li={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},eg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Be={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},O$={defaultBins:10},Wt={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}},Rn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},ie={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Pt={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},Qe={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},ng={minCellDividerDimension:16,chartPadding:.5},rg={default:{size:24}},T$={horizontalOffset:10},ig={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},Me={height:{[rn.GRAPH_VIEW]:32,[rn.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},M$=[{type:Jt.RADIUS,name:"Radius"},{type:Jt.AREA,name:"Poor area"},{type:Jt.AREA,name:"Satisfactory area"},{type:Jt.AREA,name:"Great area"},{type:Jt.QUARTILE,name:"Quartiles"}],ci={type:Fe.END_LINE,threshold:16,numCharacter:14},C$={enabled:!0,position:Si.BOTTOM,clickable:!0,truncation:ci,alignment:Kt.LEFT,order:null,additionalItems:[]},A$={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},$$={enabled:!0},sg={enabled:!0,showTotal:!0,truncation:ci,groupLabel:"Group"},ag={top:{visible:!0,includeZero:!0,truncation:ci},bottom:{visible:!0,includeZero:!0,truncation:ci},left:{visible:!0,includeZero:!0,truncation:ci},right:{visible:!0,includeZero:!0,truncation:ci}},go={addSpaceOnEdges:1,showDayName:!1,localeObject:jp,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"}}},R$=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),he={width:null,height:null,resizable:!0,theme:Ih.WHITE,tooltip:sg,legend:C$,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:jt.SHOW_AS_DATATABLE},...R$?[{type:jt.MAKE_FULLSCREEN}]:[],{type:jt.EXPORT_CSV},{type:jt.EXPORT_PNG},{type:jt.EXPORT_JPG}]}},og=lt({},he,{thematic:{projection:vn.geoNaturalEarth1}}),Es=lt({},he,{axes:ag,timeScale:go,grid:A$,ruler:$$,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:rn.GRAPH_VIEW}}}),Or=lt({},Es,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(go,{addSpaceOnEdges:1})}),L$=lt({},Or,{}),D$=lt({},Or,{}),k$=lt({},Or,{bars:lt({},Or.bars,{dividerSize:1.5})}),I$=lt({},Or,{}),ru=lt({},Es,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),N$=ru,lg=lt({},ru,{points:{radius:3,filled:!1,enabled:!0}}),cg=lt({},lg,{timeScale:lt(go,{addSpaceOnEdges:0})}),P$=cg,U$=lt({},Es,{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:Jt.RADIUS,name:"Radius"}]}}),B$=lt({},Es,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Jt.AREA,name:"Poor area"},{type:Jt.AREA,name:"Satisfactory area"},{type:Jt.AREA,name:"Great area"},{type:Jt.QUARTILE,name:"Quartiles"}]}}),H$=lt({},Or,{bars:{dividerSize:1.5},timeScale:lt(go,{addSpaceOnEdges:0})}),V$=lt({},he,{tooltip:lt({},sg,{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"}}),ug=lt({},he,{pie:{labels:{formatter:null,enabled:!0},alignment:Kt.LEFT,sortFunction:null,valueMapsTo:"value"}}),F$=lt({},he,{legend:{enabled:!1},gauge:{type:Nr.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,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:Kt.LEFT}}),G$=lt({},ug,{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),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:Kt.LEFT}}),hg=lt({},he,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),z$=lt({},hg,{legend:{enabled:!0}}),j$=lt({},he,{radar:{axes:{angle:"key",value:"value"},alignment:Kt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),W$=lt({},Or,{comboChartTypes:[]}),q$=lt({tree:{type:Qo.TREE}},he,{}),Y$=lt({},he,{data:lt(he.data,{groupMapsTo:"name"})}),Z$=lt({},he,li,{data:lt(he.data,{groupMapsTo:"name"})}),X$=lt({},he,{alluvial:{data:lt(he.data,{groupMapsTo:"source"}),nodeAlignment:Kt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),K$=lt({},he,{axes:ag,heatmap:{divider:{state:Ti.AUTO},colorLegend:{type:"linear"}}}),Q$=lt({},og,{choropleth:{colorLegend:{type:"linear"}}}),Dt={alluvialChart:X$,areaChart:cg,axisChart:Es,boxplotChart:I$,bubbleChart:U$,bulletChart:B$,chart:he,circlePackChart:Z$,choroplethChart:Q$,comboChart:W$,donutChart:G$,gaugeChart:F$,groupedBarChart:D$,heatmapChart:K$,histogramChart:H$,lineChart:lg,lollipopChart:N$,meterChart:hg,pieChart:ug,proportionalMeterChart:z$,radarChart:j$,scatterChart:ru,simpleBarChart:L$,stackedAreaChart:P$,stackedBarChart:k$,thematicChart:og,treeChart:q$,treemapChart:Y$,wordCloudChart:V$};function J$(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=ar(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Ft(e,t){var n;const r=An(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 su(r,t),lt(r,t)}function Ln(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 _s(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 iu(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 ws(e,t,n){if(n>e.length)return e;if(t===Fe.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Fe.FRONT_LINE)return"..."+e.substr(-n);if(t===Fe.END_LINE)return e.substr(0,n)+"..."}function su(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=M$.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=S$(a,r,"name")}}const b=(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},dg=(e,t)=>t===ee.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,pe=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=dg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Dn(e,t,n){return n===ee.VERTICAL?[e,t]:[t,e]}function tR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function eR(e){if(!tR(e)&&typeof e!="number")return!1;const t=St(e);return!isNaN(Number(t))}const fg=6048e5,nR=864e5,pg=6e4,mg=36e5;function gg(e){const t=St(e);return t.setHours(0,0,0,0),t}function vg(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function yg(e,t){const n=gg(e),r=gg(t),i=n.getTime()-vg(n),s=r.getTime()-vg(r);return Math.round((i-s)/nR)}function Je(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function rR(e){const t=St(e),n=Je(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function iR(e){const t=St(e);return yg(t,rR(t))+1}function vo(e){return cs(e,{weekStartsOn:1})}function xg(e){const t=St(e),n=t.getFullYear(),r=Je(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=vo(r),s=Je(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=vo(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function sR(e){const t=xg(e),n=Je(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),vo(n)}function aR(e){const t=St(e),n=vo(t).getTime()-sR(t).getTime();return Math.round(n/fg)+1}function bg(e,t){var n,r,i,s;const a=St(e),o=a.getFullYear(),l=to(),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=Je(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=cs(u,t),h=Je(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 oR(e,t){var n,r,i,s;const a=to(),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=bg(e,t),c=Je(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),cs(c,t)}function lR(e,t){const n=St(e),r=cs(n,t).getTime()-oR(n,t).getTime();return Math.round(r/fg)+1}function At(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Wn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return At(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):At(n+1,2)},d(e,t){return At(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 At(e.getHours()%12||12,t.length)},H(e,t){return At(e.getHours(),t.length)},m(e,t){return At(e.getMinutes(),t.length)},s(e,t){return At(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return At(i,t.length)}},ui={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cR={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 Wn.y(e,t)},Y:function(e,t,n,r){const i=bg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return At(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):At(s,t.length)},R:function(e,t){const n=xg(e);return At(n,t.length)},u:function(e,t){const n=e.getFullYear();return At(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 At(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 At(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 Wn.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 At(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=lR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):At(i,t.length)},I:function(e,t,n){const r=aR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):At(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Wn.d(e,t)},D:function(e,t,n){const r=iR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):At(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 At(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 At(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 At(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=ui.noon:r===0?i=ui.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=ui.evening:r>=12?i=ui.afternoon:r>=4?i=ui.morning:i=ui.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 Wn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Wn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Wn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Wn.s(e,t)},S:function(e,t){return Wn.S(e,t)},X:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return _g(i);case"XXXX":case"XX":return Tr(i);case"XXXXX":case"XXX":default:return Tr(i,":")}},x:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return _g(i);case"xxxx":case"xx":return Tr(i);case"xxxxx":case"xxx":default:return Tr(i,":")}},O:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Eg(i,":");case"OOOO":default:return"GMT"+Tr(i,":")}},z:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Eg(i,":");case"zzzz":default:return"GMT"+Tr(i,":")}},t:function(e,t,n,r){const i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return At(s,t.length)},T:function(e,t,n,r){const i=(r._originalDate||e).getTime();return At(i,t.length)}};function Eg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+At(s,2)}function _g(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):Tr(e,t)}function Tr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=At(Math.floor(r/60),2),s=At(r%60,2);return n+i+t+s}const wg=(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"})}},Sg=(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"})}},uR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return wg(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}}",wg(r,t)).replace("{{time}}",Sg(i,t))},hR={p:Sg,P:uR},dR=["D","DD"],fR=["YY","YYYY"];function pR(e){return dR.indexOf(e)!==-1}function mR(e){return fR.indexOf(e)!==-1}function Og(e,t,n){if(e==="YYYY")throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${t}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="YY")throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${t}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="D")throw new RangeError(`Use \`d\` instead of \`D\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="DD")throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const gR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yR=/^'([^]*?)'?$/,xR=/''/g,bR=/[a-zA-Z]/;function hi(e,t,n){var r,i,s,a,o,l,c,u;const d=to(),h=(n==null?void 0:n.locale)??d.locale??jp,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=St(e);if(!eR(v))throw new RangeError("Invalid time value");const m={firstWeekContainsDate:f,weekStartsOn:p,locale:h,_originalDate:v};return t.match(vR).map(function(g){const y=g[0];if(y==="p"||y==="P"){const x=hR[y];return x(g,h.formatLong)}return g}).join("").match(gR).map(function(g){if(g==="''")return"'";const y=g[0];if(y==="'")return ER(g);const x=cR[y];if(x)return!(n!=null&&n.useAdditionalWeekYearTokens)&&mR(g)&&Og(g,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&pR(g)&&Og(g,t,String(e)),x(v,g,h.localize,m);if(y.match(bR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return g}).join("")}function ER(e){const t=e.match(yR);return t?t[1].replace(xR,"'"):e}var Tg=(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))(Tg||{});const au=[["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 Mg(e,t,n,r,i){const s=t===0,a=Number(hi(new Date(e),"c"))===2,o=Number(hi(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||xo(e)||Ss(e,l)||qn(e);case"minute":return s||xo(e)||Ss(e,l)||qn(e);case"30minutes":return s||xo(e)||Ss(e,l)||qn(e);case"hourly":return s||xo(e)||Ss(e,l)||qn(e);case"daily":return i?s||a||qn(e):s||Ss(e,l)||qn(e);case"weekly":return s||a||qn(e);case"monthly":return s||qn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function ou(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=b(i,"timeIntervalFormats")[a],c=b(l,"primary"),u=b(l,"secondary");let d=Mg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(d=d.replace("pp","h:mm:ss.SSS a"));const h=i.localeObject;return hi(o,d,{locale:h})}function yo(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function _R(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function wR(e){const t=au.reduce((n,[,r],i)=>{const s=au[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return au[t][0]}function lu(e,t){if(Tg[t])return t;if(e.length===1)return"15seconds";const n=_R(e),r=Vn(n);return wR(r)}function xo(e){const{s:t,m:n,H:r}=yo(e);return r===0&&n===0&&t===0}function Ss(e,t){const n=yo(e).M,r=yo(t).M;return n!==r}function qn(e){const{M:t,d:n,s:r,m:i,H:s}=yo(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Cg(e){return e===void 0?"":e.toISOString()}function Ag(e){const t=Ge(e,r=>r.value),n=Ye().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 $g(e,t){const n=b(t,"gradient","colors"),r=!Ke(n);let i=b(t,"pairing","option");const s=Ag(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 fc().domain(s).range(o)}var ft=(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))(ft||{});function SR(e,t){return e&&Qm(e,t,ps)}function OR(e,t){return function(n,r){if(n==null)return n;if(!Er(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var TR=OR(SR);const cu=TR;function MR(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 CR(e,t,n,r){return cu(e,function(i,s,a){t(r,i,n(i),a)}),r}function AR(e,t){return function(n,r){var i=re(n)?MR:CR,s=t?t():{};return i(n,e,mo(r),s)}}function $R(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 RR=Object.prototype,LR=RR.hasOwnProperty,DR=AR(function(e,t,n){LR.call(e,n)?e[n].push(t):ro(e,n,[t])});const kR=DR;function IR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class hn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=b(n,"data"),a=b(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}=Wt.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(An(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Wt.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 kR(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=O$.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 Dc().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=bs(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Cg(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?Cg(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=$R(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?Dc().offset(mO):Dc()).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();su(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}=Wt.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=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=b(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=b(s,"label");if(c===null){const d=b(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=>IR(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
- `),n=this.getOptions();let r="myChart";const i=b(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}=Wt.items.status,s=this.getOptions(),a=bs(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=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=eg.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=Ua().range(o).domain(this.allDataGroups)}}let Mr=class extends hn{constructor(t){super(t),this.axisFlavor=Ws.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:b(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:l}=this.assignRangeAndDomains(),c=i.getDomainAxisScaleType();let u;return c===et.TIME&&(u=d=>hi(d,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(d=>[d[r],d[s.identifier]===null?"&ndash;":u?u(d[s.identifier]):d[s.identifier],d[a.identifier]===null||isNaN(d[a.identifier])?"&ndash;":d[a.identifier].toLocaleString(),...o?[d[o.identifier]===null?"&ndash;":d[o.identifier]]:[],...l?[d[l.identifier]===null||isNaN(d[l.identifier])?"&ndash;":d[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(An(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=bs(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(G).forEach(i=>{const s=G[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=>{b(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},NR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,r)=>n.source.localeCompare(r.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},PR=class extends Mr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:sl(t,.25),q_50:sl(t,.5),q_75:sl(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(x=>x[o]).sort(rr),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 x of l)x<f||x>p?v.push(x):m.push(x);c.outliers=v;const g=Vn(m),y=sr(m);c.whiskers={min:g||Vn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||sr([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();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...r.map(i=>{let s=b(i,"outliers");return(s===null||s.length===0)&&(s=["&ndash;"]),[i[n],b(i,"whiskers","min")!==null?b(i,"whiskers","min").toLocaleString():"&ndash;",b(i,"quartiles","q_25")!==null?b(i,"quartiles","q_25").toLocaleString():"&ndash;",b(i,"quartiles","q_50")!==null?b(i,"quartiles","q_50").toLocaleString():"&ndash;",b(i,"quartiles","q_75")!==null?b(i,"quartiles","q_75").toLocaleString():"&ndash;",b(i,"whiskers","max")!==null?b(i,"whiskers","max").toLocaleString():"&ndash;",b(i,"quartiles","q_75")!==null&&b(i,"quartiles","q_25")!==null?(b(i,"quartiles","q_75")-b(i,"quartiles","q_25")).toLocaleString():"&ndash;",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const r=eg.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Ua().range(i).domain(this.allDataGroups)}},UR=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(),s=b(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[r],a.value===null?"&ndash;":a.value,b(a,"marker")===null?"&ndash;":a.marker,b(a,"marker")===null?"&ndash;":`${Math.floor(a[i]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},BR=class extends hn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ke(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ke(n)&&!Ke(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();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"&ndash;":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=$g(this.getDisplayData(),t)}},HR=class extends hn{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));su(n,r);const i=this.getHierarchyLevel(),s=b(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&&b(n,0,"children")?b(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}),b(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Jt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}},VR=class extends hn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie;return[["Group","Value"],...t.map(s=>[s[r],s[i]===null?"&ndash;":s[i].toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},FR=class extends hn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"&ndash;":i.value.toLocaleString()])]}},GR=class extends Mr{constructor(t){super(t),this.axisFlavor=Ws.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==et.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==et.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==et.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==et.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ge(this.getDisplayData(),r=>r.value),n=Ye().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(Ke(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(Ke(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(Ke(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]=An(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(An(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ke(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(i=>[i[n.identifier]===null?"&ndash;":i[n.identifier],i[r.identifier]===null?"&ndash;":i[r.identifier].toLocaleString(),i.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!Ke(n);let i=b(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=fc().domain(s).range(o);const l=b(this.getOptions(),"color");this._colorScale=$g(this.getDisplayData(),l)}},zR=class extends Mr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[It(t,"bins.rangeLabel")||"Range",...r.map(i=>It(i,`0.${n}`))],...It(r,0).map((i,s)=>[`${It(i,"data.x0")} – ${It(i,"data.x1")}`,...r.map(a=>It(a[s],`data.${It(a[s],n)}`))])]}},jR=class extends hn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,s=b(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=b(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else o=b(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])];return a}},WR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),s=b(n,"0","data").map(a=>a[r]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>b(a,"data",l,i)!==null?b(a,"data",l,i).toLocaleString():"&ndash;")])]}},qR=class extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},YR=class extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):b(r.name)!==null&&b(r.value)&&n.push(["–",r.name,r.value])}),n}},ZR=class extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[i],a[s],a[r]])]}};var XR=/\s/;function KR(e){for(var t=e.length;t--&&XR.test(e.charAt(t)););return t}var QR=/^\s+/;function JR(e){return e&&e.slice(0,KR(e)+1).replace(QR,"")}var Rg=NaN,tL=/^[-+]0x[0-9a-f]+$/i,eL=/^0b[01]+$/i,nL=/^0o[0-7]+$/i,rL=parseInt;function Os(e){if(typeof e=="number")return e;if(eo(e))return Rg;if(Ue(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ue(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=JR(e);var n=eL.test(e);return n||nL.test(e)?rL(e.slice(2),n?2:8):tL.test(e)?Rg:+e}var iL=function(){return Ze.Date.now()};const uu=iL;var sL="Expected a function",aL=Math.max,oL=Math.min;function bo(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(sL);t=Os(t)||0,Ue(n)&&(u=!!n.leading,d="maxWait"in n,s=d?aL(Os(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(S){var T=r,I=i;return r=i=void 0,c=S,a=e.apply(I,T),a}function p(S){return c=S,o=setTimeout(g,t),u?f(S):a}function v(S){var T=S-l,I=S-c,U=t-T;return d?oL(U,s-I):U}function m(S){var T=S-l,I=S-c;return l===void 0||T>=t||T<0||d&&I>=s}function g(){var S=uu();if(m(S))return y(S);o=setTimeout(g,v(S))}function y(S){return o=void 0,h&&r?f(S):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function w(){return o===void 0?a:y(uu())}function _(){var S=uu(),T=m(S);if(r=arguments,i=this,l=S,T){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(g,t),f(l)}return o===void 0&&(o=setTimeout(g,t)),a}return _.cancel=x,_.flush=w,_}function lL(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 cL=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function kn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Eo(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function uL(e){const t=Eo(e,"border-left-width"),n=Eo(e,"border-right-width");return e.clientWidth+t+n}function hL(e){const t=Eo(e,"border-top-width"),n=Eo(e,"border-bottom-width");return e.clientHeight+t+n}function Lg(e,t={}){const n=t.width||uL(e),r=t.height||hL(e);return{width:n,height:r}}function dL(){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 Ce=16384;function fL(e){(e.width>Ce||e.height>Ce)&&(e.width>Ce&&e.height>Ce?e.width>e.height?(e.height*=Ce/e.width,e.width=Ce):(e.width*=Ce/e.height,e.height=Ce):e.width>Ce?(e.height*=Ce/e.width,e.width=Ce):(e.width*=Ce/e.height,e.height=Ce))}function _o(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 pL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function mL(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),pL(i)}const be=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||be(n,t)};function gL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function vL(e){return kn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function yL(e,t,n){const r=`.${e}:${t}`,i=n.cssText?gL(n):vL(n);return document.createTextNode(`${r}{${i}}`)}function Dg(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=cL();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(yL(s,n,r)),t.appendChild(a)}function xL(e,t){Dg(e,t,":before"),Dg(e,t,":after")}const kg="application/font-woff",Ig="image/jpeg",bL={woff:kg,woff2:kg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ig,jpeg:Ig,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function EL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function hu(e){const t=EL(e).toLowerCase();return bL[t]||""}function _L(e){return e.split(/,/)[1]}function du(e){return e.search(/^(data:)/)!==-1}function Ng(e,t){return`data:${t};base64,${e}`}async function Pg(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 wL(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 pu(e,t,n){const r=wL(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 Pg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),_L(o)));i=Ng(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 SL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_o(t)}async function OL(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 _o(o)}const n=e.poster,r=hu(n),i=await pu(n,r,t);return _o(i)}async function TL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await wo(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function ML(e,t){return be(e,HTMLCanvasElement)?SL(e):be(e,HTMLVideoElement)?OL(e,t):be(e,HTMLIFrameElement)?TL(e):e.cloneNode(!1)}const CL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function AL(e,t,n){var r,i;let s=[];return CL(e)&&e.assignedNodes?s=kn(e.assignedNodes()):be(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=kn(e.contentDocument.body.childNodes):s=kn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||be(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>wo(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function $L(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):kn(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`),be(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 RL(e,t){be(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),be(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function LL(e,t){if(be(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function DL(e,t){return be(t,Element)&&($L(e,t),xL(e,t),RL(e,t),LL(e,t)),t}async function kL(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 wo(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 wo(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>ML(r,t)).then(r=>AL(e,r,t)).then(r=>DL(e,r)).then(r=>kL(r,t))}const Ug=/url\((['"]?)([^'"]+?)\1\)/g,IL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,NL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function PL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function UL(e){const t=[];return e.replace(Ug,(n,r,i)=>(t.push(i),n)),t.filter(n=>!du(n))}async function BL(e,t,n,r,i){try{const s=n?lL(t,n):t,a=hu(t);let o;if(i){const l=await i(s);o=Ng(l,a)}else o=await pu(s,a,r);return e.replace(PL(t),`$1${o}$3`)}catch{}return e}function HL(e,{preferredFontFormat:t}){return t?e.replace(NL,n=>{for(;;){const[r,,i]=IL.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Bg(e){return e.search(Ug)!==-1}async function Hg(e,t,n){if(!Bg(e))return e;const r=HL(e,n);return UL(r).reduce((i,s)=>i.then(a=>BL(a,s,t,n)),Promise.resolve(r))}async function So(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Hg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function VL(e,t){await So("background",e,t)||await So("background-image",e,t),await So("mask",e,t)||await So("mask-image",e,t)}async function FL(e,t){const n=be(e,HTMLImageElement);if(!(n&&!du(e.src))&&!(be(e,SVGImageElement)&&!du(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await pu(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 GL(e,t){const n=kn(e.childNodes).map(r=>Vg(r,t));await Promise.all(n).then(()=>e)}async function Vg(e,t){be(e,Element)&&(await VL(e,t),await FL(e,t),await GL(e,t))}function zL(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 Fg={};async function Gg(e){let t=Fg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Fg[e]=t,t}async function zg(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),Pg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function jg(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 jL(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{kn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Gg(l).then(u=>zg(u,t)).then(u=>jg(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(Gg(i.href).then(o=>zg(o,t)).then(o=>jg(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{kn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function WL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Bg(t.style.getPropertyValue("src")))}async function qL(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=kn(e.ownerDocument.styleSheets),r=await jL(n,t);return WL(r)}async function YL(e,t){const n=await qL(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Hg(r.cssText,i,t)}))).join(`
3
- `)}async function ZL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await YL(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 XL(e,t={}){const{width:n,height:r}=Lg(e,t),i=await wo(e,t,!0);return await ZL(i,t),await Vg(i,t),zL(i,t),await mL(i,n,r)}async function Wg(e,t={}){const{width:n,height:r}=Lg(e,t),i=await XL(e,t),s=await _o(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||dL(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||fL(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 KL(e,t={}){return(await Wg(e,t)).toDataURL()}async function QL(e,t={}){return(await Wg(e,t)).toDataURL("image/jpeg",t.quality||1)}class In{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const JL="DONT_STYLE_ME_css_styles_verifier";let k=class uh extends In{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:b(t.node(),"width","baseVal","value"),height:b(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}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=b(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${xe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",JL),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(`${xe}--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),QL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=b(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),KL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=b(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)})}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}=uh.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(uh.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=bo(()=>{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)}},mu=class F0 extends In{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:F0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function qg(e){const t=tD(Yg(e),360);return Yn(t,[0,10])||Yn(t,[350,0])?{textAnchor:mn.START,dominantBaseline:gn.MIDDLE}:Yn(t,[10,80])?{textAnchor:mn.START,dominantBaseline:gn.HANGING}:Yn(t,[80,100])?{textAnchor:mn.MIDDLE,dominantBaseline:gn.HANGING}:Yn(t,[100,170])?{textAnchor:mn.END,dominantBaseline:gn.HANGING}:Yn(t,[170,190])?{textAnchor:mn.END,dominantBaseline:gn.MIDDLE}:Yn(t,[190,260])?{textAnchor:mn.END,dominantBaseline:gn.BASELINE}:Yn(t,[260,280])?{textAnchor:mn.MIDDLE,dominantBaseline:gn.BASELINE}:{textAnchor:mn.START,dominantBaseline:gn.BASELINE}}function tD(e,t){return(e%t+t)%t}function Yn(e,[t,n]){return e>=t&&e<=n}function Yg(e){return e*(180/Math.PI)}function Yt(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 eD(e,t){return t*Math.sin(e-Math.PI/2)}function Zg(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 nD(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 rD(e){return e.depth}function iD(e,t){return t-1-e.height}function Xg(e,t){return e.sourceLinks.length?e.depth:t-1}function Oo(e){return function(){return e}}function Kg(e,t){return To(e.source,t.source)||e.index-t.index}function Qg(e,t){return To(e.target,t.target)||e.index-t.index}function To(e,t){return e.y0-t.y0}function vu(e){return e.value}function sD(e){return e.index}function aD(e){return e.nodes}function oD(e){return e.links}function Jg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function tv({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 lD(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=sD,l=Xg,c,u,d=aD,h=oD,f=6;function p(){const E={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(E),m(E),g(E),y(E),_(E),tv(E),E}p.update=function(E){return tv(E),E},p.nodeId=function(E){return arguments.length?(o=typeof E=="function"?E:Oo(E),p):o},p.nodeAlign=function(E){return arguments.length?(l=typeof E=="function"?E:Oo(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:Oo(E),p):d},p.links=function(E){return arguments.length?(h=typeof E=="function"?E:Oo(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:B}){for(const[P,N]of E.entries())N.index=P,N.sourceLinks=[],N.targetLinks=[];const H=new Map(E.map((P,N)=>[o(P,N,E),P]));for(const[P,N]of B.entries()){N.index=P;let{source:Z,target:q}=N;typeof Z!="object"&&(Z=N.source=Jg(H,Z)),typeof q!="object"&&(q=N.target=Jg(H,q)),Z.sourceLinks.push(N),q.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:P,targetLinks:N}of E)P.sort(u),N.sort(u)}function m({nodes:E}){for(const B of E)B.value=B.fixedValue===void 0?Math.max(gu(B.sourceLinks,vu),gu(B.targetLinks,vu)):B.fixedValue}function g({nodes:E}){const B=E.length;let H=new Set(E),P=new Set,N=0;for(;H.size;){for(const Z of H){Z.depth=N;for(const{target:q}of Z.sourceLinks)P.add(q)}if(++N>B)throw new Error("circular link");H=P,P=new Set}}function y({nodes:E}){const B=E.length;let H=new Set(E),P=new Set,N=0;for(;H.size;){for(const Z of H){Z.height=N;for(const{source:q}of Z.targetLinks)P.add(q)}if(++N>B)throw new Error("circular link");H=P,P=new Set}}function x({nodes:E}){const B=Zg(E,N=>N.depth)+1,H=(n-e-i)/(B-1),P=new Array(B);for(const N of E){const Z=Math.max(0,Math.min(B-1,Math.floor(l.call(null,N,B))));N.layer=Z,N.x0=e+Z*H,N.x1=N.x0+i,P[Z]?P[Z].push(N):P[Z]=[N]}if(c)for(const N of P)N.sort(c);return P}function w(E){const B=nD(E,H=>(r-t-(H.length-1)*a)/gu(H,vu));for(const H of E){let P=t;for(const N of H){N.y0=P,N.y1=P+N.value*B,P=N.y1+a;for(const Z of N.sourceLinks)Z.width=Z.value*B}P=(r-P+a)/(H.length+1);for(let N=0;N<H.length;++N){const Z=H[N];Z.y0+=P*(N+1),Z.y1+=P*(N+1)}V(H)}}function _(E){const B=x(E);a=Math.min(s,(r-t)/(Zg(B,H=>H.length)-1)),w(B);for(let H=0;H<f;++H){const P=Math.pow(.99,H),N=Math.max(1-P,(H+1)/f);T(B,P,N),S(B,P,N)}}function S(E,B,H){for(let P=1,N=E.length;P<N;++P){const Z=E[P];for(const q of Z){let it=0,nt=0;for(const{source:J,value:pt}of q.targetLinks){let at=pt*(q.layer-J.layer);it+=M(J,q)*at,nt+=at}if(!(nt>0))continue;let Y=(it/nt-q.y0)*B;q.y0+=Y,q.y1+=Y,A(q)}c===void 0&&Z.sort(To),I(Z,H)}}function T(E,B,H){for(let P=E.length,N=P-2;N>=0;--N){const Z=E[N];for(const q of Z){let it=0,nt=0;for(const{target:J,value:pt}of q.sourceLinks){let at=pt*(J.layer-q.layer);it+=R(q,J)*at,nt+=at}if(!(nt>0))continue;let Y=(it/nt-q.y0)*B;q.y0+=Y,q.y1+=Y,A(q)}c===void 0&&Z.sort(To),I(Z,H)}}function I(E,B){const H=E.length>>1,P=E[H];L(E,P.y0-a,H-1,B),U(E,P.y1+a,H+1,B),L(E,r,E.length-1,B),U(E,t,0,B)}function U(E,B,H,P){for(;H<E.length;++H){const N=E[H],Z=(B-N.y0)*P;Z>1e-6&&(N.y0+=Z,N.y1+=Z),B=N.y1+a}}function L(E,B,H,P){for(;H>=0;--H){const N=E[H],Z=(N.y1-B)*P;Z>1e-6&&(N.y0-=Z,N.y1-=Z),B=N.y0-a}}function A({sourceLinks:E,targetLinks:B}){if(u===void 0){for(const{source:{sourceLinks:H}}of B)H.sort(Qg);for(const{target:{targetLinks:H}}of E)H.sort(Kg)}}function V(E){if(u===void 0)for(const{sourceLinks:B,targetLinks:H}of E)B.sort(Qg),H.sort(Kg)}function M(E,B){let H=E.y0-(E.sourceLinks.length-1)*a/2;for(const{target:P,width:N}of E.sourceLinks){if(P===B)break;H+=N+a}for(const{source:P,width:N}of B.targetLinks){if(P===E)break;H-=N}return H}function R(E,B){let H=B.y0-(B.targetLinks.length-1)*a/2;for(const{source:P,width:N}of B.targetLinks){if(P===E)break;H+=N+a}for(const{target:P,width:N}of E.sourceLinks){if(P===B)break;H-=N}return H}return p}var yu=Math.PI,xu=2*yu,Cr=1e-6,cD=xu-Cr;function bu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ev(){return new bu}bu.prototype=ev.prototype={constructor:bu,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),g=Math.sqrt(d),y=i*Math.tan((yu-Math.acos((p+d-v)/(2*m*g)))/2),x=y/g,w=y/m;Math.abs(x-1)>Cr&&(this._+="L"+(e+x*c)+","+(t+x*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%xu+xu),d>cD?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>=yu)+","+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 nv(e){return function(){return e}}function uD(e){return e[0]}function hD(e){return e[1]}var dD=Array.prototype.slice;function fD(e){return e.source}function pD(e){return e.target}function mD(e){var t=fD,n=pD,r=uD,i=hD,s=null;function a(){var o,l=dD.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=ev()),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:nv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:nv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function gD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function vD(){return mD(gD)}function yD(e){return[e.source.x1,e.y0]}function xD(e){return[e.target.x0,e.y1]}function bD(){return vD().source(yD).target(xD)}function rv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ED(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 _D={value:function(){}};function iv(){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 Mo(n)}function Mo(e){this._=e}function wD(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}})}Mo.prototype=iv.prototype={constructor:Mo,on:function(e,t){var n=this._,r=wD(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=SD(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]=sv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=sv(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 Mo(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 SD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function sv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=_D,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const OD=ED(Object.freeze(Object.defineProperty({__proto__:null,dispatch:iv},Symbol.toStringTag,{value:"Module"}))).dispatch,Eu=Math.PI/180,TD={archimedean:ov,rectangular:PD},Ts=64,Co=2048;var MD=function(){var e=[256,256],t=CD,n=AD,r=$D,i=av,s=av,a=RD,o=LD,l=ov,c=[],u=1/0,d=OD("word","end"),h=null,f=Math.random,p={},v=BD;p.canvas=function(y){return arguments.length?(v=Zn(y),p):v},p.start=function(){var y=m(v()),x=UD((e[0]>>5)*e[1]),w=null,_=c.length,S=-1,T=[],I=c.map(function(L,A){return L.text=t.call(this,L,A),L.font=n.call(this,L,A),L.style=i.call(this,L,A),L.weight=s.call(this,L,A),L.rotate=a.call(this,L,A),L.size=~~r.call(this,L,A),L.padding=o.call(this,L,A),L}).sort(function(L,A){return A.size-L.size});return h&&clearInterval(h),h=setInterval(U,0),U(),p;function U(){for(var L=Date.now();Date.now()-L<u&&++S<_&&h;){var A=I[S];A.x=e[0]*(f()+.5)>>1,A.y=e[1]*(f()+.5)>>1,DD(y,A,I,S),A.hasText&&g(x,A,w)&&(T.push(A),d.call("word",p,A),w?ID(w,A):w=[{x:A.x+A.x0,y:A.y+A.y0},{x:A.x+A.x1,y:A.y+A.y1}],A.x-=e[0]>>1,A.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,T,w))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function m(y){const x=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const w=Math.sqrt(x.getImageData(0,0,1,1).data.length>>2);return y.width=(Ts<<5)/w,y.height=Co/w,x.fillStyle=x.strokeStyle="red",{context:x,ratio:w}}function g(y,x,w){e[0],e[1];for(var _=x.x,S=x.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),U=f()<.5?1:-1,L=-U,A,V,M;(A=I(L+=U))&&(V=~~A[0],M=~~A[1],!(Math.min(Math.abs(V),Math.abs(M))>=T));)if(x.x=_+V,x.y=S+M,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!w||ND(x,w))&&!kD(x,y,e[0])){for(var R=x.sprite,E=x.width>>5,B=e[0]>>5,H=x.x-(E<<4),P=H&127,N=32-P,Z=x.y1-x.y0,q=(x.y+x.y0)*B+(H>>5),it,nt=0;nt<Z;nt++){it=0;for(var Y=0;Y<=E;Y++)y[q+Y]|=it<<N|(Y<E?(it=R[nt*E+Y])>>>P:0);q+=B}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=Zn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=Zn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=Zn(y),p):s},p.rotate=function(y){return arguments.length?(a=Zn(y),p):a},p.text=function(y){return arguments.length?(t=Zn(y),p):t},p.spiral=function(y){return arguments.length?(l=TD[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=Zn(y),p):r},p.padding=function(y){return arguments.length?(o=Zn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function CD(e){return e.text}function AD(){return"serif"}function av(){return"normal"}function $D(e){return Math.sqrt(e.value)}function RD(){return(~~(random()*6)-3)*30}function LD(){return 1}function DD(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Ts<<5)/s,Co/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 A=i.measureText(t.text),V=-Math.floor(A.width/2);let M=(A.width+1)*s,R=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Eu),d=Math.cos(t.rotate*Eu),h=M*d,f=M*u,p=R*d,v=R*u;M=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,R=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else M=M+31>>5<<5;if(R>l&&(l=R),a+M>=Ts<<5&&(a=0,o+=l,l=0),o+R>=Co)break;i.translate((a+(M>>1))/s,(o+(R>>1))/s),t.rotate&&i.rotate(t.rotate*Eu),i.fillText(t.text,V,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,V,0)),i.restore(),t.width=M,t.height=R,t.xoff=a,t.yoff=o,t.x1=M>>1,t.y1=R>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=M}for(var m=i.getImageData(0,0,(Ts<<5)/s,Co/s).data,g=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,x=y>>5,w=t.y1-t.y0,_=0;_<w*x;_++)g[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,T=-1,I=0;I<w;I++){for(var _=0;_<y;_++){var U=x*I+(_>>5),L=m[(o+I)*(Ts<<5)+(a+_)<<2]?1<<31-_%32:0;g[U]|=L,S|=L}S?T=I:(t.y0++,w--,I--,o++)}t.y1=t.y0+T,t.sprite=g.slice(0,(t.y1-t.y0)*x)}}}function kD(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 ID(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 ND(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 ov(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function PD(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 UD(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function BD(){return document.createElement("canvas")}function Zn(e){return typeof e=="function"?e:function(){return e}}const HD=rv(MD);function VD(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function FD(e){return function(t){return e==null?void 0:e[t]}}var GD={À:"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"},zD=FD(GD);const jD=zD;var WD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qD="\\u0300-\\u036f",YD="\\ufe20-\\ufe2f",ZD="\\u20d0-\\u20ff",XD=qD+YD+ZD,KD="["+XD+"]",QD=RegExp(KD,"g");function JD(e){return e=ys(e),e&&e.replace(WD,jD).replace(QD,"")}var tk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ek(e){return e.match(tk)||[]}var nk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function rk(e){return nk.test(e)}var lv="\\ud800-\\udfff",ik="\\u0300-\\u036f",sk="\\ufe20-\\ufe2f",ak="\\u20d0-\\u20ff",ok=ik+sk+ak,cv="\\u2700-\\u27bf",uv="a-z\\xdf-\\xf6\\xf8-\\xff",lk="\\xac\\xb1\\xd7\\xf7",ck="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uk="\\u2000-\\u206f",hk=" \\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",hv="A-Z\\xc0-\\xd6\\xd8-\\xde",dk="\\ufe0e\\ufe0f",dv=lk+ck+uk+hk,fv="['’]",pv="["+dv+"]",fk="["+ok+"]",mv="\\d+",pk="["+cv+"]",gv="["+uv+"]",vv="[^"+lv+dv+mv+cv+uv+hv+"]",mk="\\ud83c[\\udffb-\\udfff]",gk="(?:"+fk+"|"+mk+")",vk="[^"+lv+"]",yv="(?:\\ud83c[\\udde6-\\uddff]){2}",xv="[\\ud800-\\udbff][\\udc00-\\udfff]",di="["+hv+"]",yk="\\u200d",bv="(?:"+gv+"|"+vv+")",xk="(?:"+di+"|"+vv+")",Ev="(?:"+fv+"(?:d|ll|m|re|s|t|ve))?",_v="(?:"+fv+"(?:D|LL|M|RE|S|T|VE))?",wv=gk+"?",Sv="["+dk+"]?",bk="(?:"+yk+"(?:"+[vk,yv,xv].join("|")+")"+Sv+wv+")*",Ek="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_k="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wk=Sv+wv+bk,Sk="(?:"+[pk,yv,xv].join("|")+")"+wk,Ok=RegExp([di+"?"+gv+"+"+Ev+"(?="+[pv,di,"$"].join("|")+")",xk+"+"+_v+"(?="+[pv,di+bv,"$"].join("|")+")",di+"?"+bv+"+"+Ev,di+"+"+_v,_k,Ek,mv,Sk].join("|"),"g");function Tk(e){return e.match(Ok)||[]}function Mk(e,t,n){return e=ys(e),t=n?void 0:t,t===void 0?rk(e)?Tk(e):ek(e):e.match(t)||[]}var Ck="['’]",Ak=RegExp(Ck,"g");function Ov(e){return function(t){return VD(Mk(JD(t).replace(Ak,"")),e,"")}}function $k(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Tv(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Os(n),n=n===n?n:0),t!==void 0&&(t=Os(t),t=t===t?t:0),$k(Os(e),t,n)}function Rk(e,t){var n=-1,r=Er(e)?Array(e.length):[];return cu(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function Lk(e,t){var n=re(e)?Zp:Rk;return n(e,mo(t))}var Dk=1/0;function kk(e,t){return co(Lk(e,t),Dk)}function Mv(e,t){return po(e,t)}var Ik=Ov(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const fi=Ik;function Nk(e,t){var n;return cu(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function Pk(e,t,n){var r=re(e)?Gm:Nk;return n&&sm(e,t,n)&&(t=void 0),r(e,mo(t))}let Et=class{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=b(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=b(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${xe}--${i}--${this.type}`,!0),r&&r.classed(`${xe}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${xe}--${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.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:Cv,setPrototypeOf:Av,isFrozen:Uk,getPrototypeOf:Bk,getOwnPropertyDescriptor:$v}=Object;let{freeze:me,seal:tn,create:Rv}=Object,{apply:_u,construct:wu}=typeof Reflect<"u"&&Reflect;me||(me=function(e){return e}),tn||(tn=function(e){return e}),_u||(_u=function(e,t,n){return e.apply(t,n)}),wu||(wu=function(e,t){return new e(...t)});const Ao=He(Array.prototype.forEach),Lv=He(Array.prototype.pop),Ms=He(Array.prototype.push),$o=He(String.prototype.toLowerCase),Su=He(String.prototype.toString),Hk=He(String.prototype.match),Cs=He(String.prototype.replace),Vk=He(String.prototype.indexOf),Fk=He(String.prototype.trim),Ae=He(RegExp.prototype.test),As=Gk(TypeError);function He(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 _u(e,t,r)}}function Gk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return wu(e,n)}}function mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$o;Av&&Av(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(Uk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function pi(e){const t=Rv(null);for(const[n,r]of Cv(e))$v(e,n)!==void 0&&(t[n]=r);return t}function Ro(e,t){for(;e!==null;){const r=$v(e,t);if(r){if(r.get)return He(r.get);if(typeof r.value=="function")return He(r.value)}e=Bk(e)}function n(r){return console.warn("fallback value for",r),null}return n}const Dv=me(["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"]),Ou=me(["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"]),Tu=me(["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"]),zk=me(["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"]),Mu=me(["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"]),jk=me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kv=me(["#text"]),Iv=me(["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","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","xmlns","slot"]),Cu=me(["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"]),Nv=me(["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"]),Lo=me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wk=tn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qk=tn(/<%[\w\W]*|[\w\W]*%>/gm),Yk=tn(/\${[\w\W]*}/gm),Zk=tn(/^data-[\-\w.\u00B7-\uFFFF]/),Xk=tn(/^aria-[\-\w]+$/),Pv=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Kk=tn(/^(?:\w+script|data):/i),Qk=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Uv=tn(/^html$/i);var Bv=Object.freeze({__proto__:null,MUSTACHE_EXPR:Wk,ERB_EXPR:qk,TMPLIT_EXPR:Yk,DATA_ATTR:Zk,ARIA_ATTR:Xk,IS_ALLOWED_URI:Pv,IS_SCRIPT_OR_DATA:Kk,ATTR_WHITESPACE:Qk,DOCTYPE_NAME:Uv});const Jk=function(){return typeof window>"u"?null:window},tI=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 Hv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jk();const t=C=>Hv(C);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)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=Ro(p,"cloneNode"),m=Ro(p,"nextSibling"),g=Ro(p,"childNodes"),y=Ro(p,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let x,w="";const{implementation:_,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:I}=n,{importNode:U}=r;let L={};t.isSupported=typeof Cv=="function"&&typeof y=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:V,TMPLIT_EXPR:M,DATA_ATTR:R,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:H}=Bv;let{IS_ALLOWED_URI:P}=Bv,N=null;const Z=mt({},[...Dv,...Ou,...Tu,...Mu,...kv]);let q=null;const it=mt({},[...Iv,...Cu,...Nv,...Lo]);let nt=Object.seal(Rv(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}})),Y=null,J=null,pt=!0,at=!0,Tt=!1,X=!0,tt=!1,ut=!1,z=!1,Rt=!1,xt=!1,Ht=!1,Vt=!1,st=!0,Lt=!1;const Ve="user-content-";let we=!0,$r=!1,pn={},Jn=null;const zo=mt({},["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 Is=null;const Ns=mt({},["audio","video","img","source","image","track"]);let Pn=null;const jo=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rr="http://www.w3.org/1998/Math/MathML",Lr="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let tr=Le,Ps=!1,Us=null;const sh=mt({},[Rr,Lr,Le],Su);let Un=null;const ah=["application/xhtml+xml","text/html"],oh="text/html";let Zt=null,Bn=null;const er=n.createElement("form"),bi=function(C){return C instanceof RegExp||C instanceof Function},Dr=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bn&&Bn===C)){if((!C||typeof C!="object")&&(C={}),C=pi(C),Un=ah.indexOf(C.PARSER_MEDIA_TYPE)===-1?Un=oh:Un=C.PARSER_MEDIA_TYPE,Zt=Un==="application/xhtml+xml"?Su:$o,N="ALLOWED_TAGS"in C?mt({},C.ALLOWED_TAGS,Zt):Z,q="ALLOWED_ATTR"in C?mt({},C.ALLOWED_ATTR,Zt):it,Us="ALLOWED_NAMESPACES"in C?mt({},C.ALLOWED_NAMESPACES,Su):sh,Pn="ADD_URI_SAFE_ATTR"in C?mt(pi(jo),C.ADD_URI_SAFE_ATTR,Zt):jo,Is="ADD_DATA_URI_TAGS"in C?mt(pi(Ns),C.ADD_DATA_URI_TAGS,Zt):Ns,Jn="FORBID_CONTENTS"in C?mt({},C.FORBID_CONTENTS,Zt):zo,Y="FORBID_TAGS"in C?mt({},C.FORBID_TAGS,Zt):{},J="FORBID_ATTR"in C?mt({},C.FORBID_ATTR,Zt):{},pn="USE_PROFILES"in C?C.USE_PROFILES:!1,pt=C.ALLOW_ARIA_ATTR!==!1,at=C.ALLOW_DATA_ATTR!==!1,Tt=C.ALLOW_UNKNOWN_PROTOCOLS||!1,X=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,tt=C.SAFE_FOR_TEMPLATES||!1,ut=C.WHOLE_DOCUMENT||!1,xt=C.RETURN_DOM||!1,Ht=C.RETURN_DOM_FRAGMENT||!1,Vt=C.RETURN_TRUSTED_TYPE||!1,Rt=C.FORCE_BODY||!1,st=C.SANITIZE_DOM!==!1,Lt=C.SANITIZE_NAMED_PROPS||!1,we=C.KEEP_CONTENT!==!1,$r=C.IN_PLACE||!1,P=C.ALLOWED_URI_REGEXP||Pv,tr=C.NAMESPACE||Le,nt=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&bi(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&bi(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),tt&&(at=!1),Ht&&(xt=!0),pn&&(N=mt({},[...kv]),q=[],pn.html===!0&&(mt(N,Dv),mt(q,Iv)),pn.svg===!0&&(mt(N,Ou),mt(q,Cu),mt(q,Lo)),pn.svgFilters===!0&&(mt(N,Tu),mt(q,Cu),mt(q,Lo)),pn.mathMl===!0&&(mt(N,Mu),mt(q,Nv),mt(q,Lo))),C.ADD_TAGS&&(N===Z&&(N=pi(N)),mt(N,C.ADD_TAGS,Zt)),C.ADD_ATTR&&(q===it&&(q=pi(q)),mt(q,C.ADD_ATTR,Zt)),C.ADD_URI_SAFE_ATTR&&mt(Pn,C.ADD_URI_SAFE_ATTR,Zt),C.FORBID_CONTENTS&&(Jn===zo&&(Jn=pi(Jn)),mt(Jn,C.FORBID_CONTENTS,Zt)),we&&(N["#text"]=!0),ut&&mt(N,["html","head","body"]),N.table&&(mt(N,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=C.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else x===void 0&&(x=tI(f,i)),x!==null&&typeof w=="string"&&(w=x.createHTML(""));me&&me(C),Bn=C}},Bs=mt({},["mi","mo","mn","ms","mtext"]),Wo=mt({},["foreignobject","desc","title","annotation-xml"]),qo=mt({},["title","style","font","a","script"]),Ei=mt({},Ou);mt(Ei,Tu),mt(Ei,zk);const _i=mt({},Mu);mt(_i,jk);const Yo=function(C){let j=y(C);(!j||!j.tagName)&&(j={namespaceURI:tr,tagName:"template"});const F=$o(C.tagName),dt=$o(j.tagName);return Us[C.namespaceURI]?C.namespaceURI===Lr?j.namespaceURI===Le?F==="svg":j.namespaceURI===Rr?F==="svg"&&(dt==="annotation-xml"||Bs[dt]):!!Ei[F]:C.namespaceURI===Rr?j.namespaceURI===Le?F==="math":j.namespaceURI===Lr?F==="math"&&Wo[dt]:!!_i[F]:C.namespaceURI===Le?j.namespaceURI===Lr&&!Wo[dt]||j.namespaceURI===Rr&&!Bs[dt]?!1:!_i[F]&&(qo[F]||!Ei[F]):!!(Un==="application/xhtml+xml"&&Us[C.namespaceURI]):!1},nr=function(C){Ms(t.removed,{element:C});try{C.parentNode.removeChild(C)}catch{C.remove()}},Hs=function(C,j){try{Ms(t.removed,{attribute:j.getAttributeNode(C),from:j})}catch{Ms(t.removed,{attribute:null,from:j})}if(j.removeAttribute(C),C==="is"&&!q[C])if(xt||Ht)try{nr(j)}catch{}else try{j.setAttribute(C,"")}catch{}},Vs=function(C){let j=null,F=null;if(Rt)C="<remove></remove>"+C;else{const gt=Hk(C,/^[\r\n\t ]+/);F=gt&&gt[0]}Un==="application/xhtml+xml"&&tr===Le&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const dt=x?x.createHTML(C):C;if(tr===Le)try{j=new h().parseFromString(dt,Un)}catch{}if(!j||!j.documentElement){j=_.createDocument(tr,"template",null);try{j.documentElement.innerHTML=Ps?w:dt}catch{}}const yt=j.body||j.documentElement;return C&&F&&yt.insertBefore(n.createTextNode(F),yt.childNodes[0]||null),tr===Le?I.call(j,ut?"html":"body")[0]:ut?j.documentElement:yt},Zo=function(C){return S.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},lh=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Xo=function(C){return typeof o=="function"&&C instanceof o},nn=function(C,j,F){L[C]&&Ao(L[C],dt=>{dt.call(t,j,F,Bn)})},$=function(C){let j=null;if(nn("beforeSanitizeElements",C,null),lh(C))return nr(C),!0;const F=Zt(C.nodeName);if(nn("uponSanitizeElement",C,{tagName:F,allowedTags:N}),C.hasChildNodes()&&!Xo(C.firstElementChild)&&Ae(/<[/\w]/g,C.innerHTML)&&Ae(/<[/\w]/g,C.textContent))return nr(C),!0;if(!N[F]||Y[F]){if(!Y[F]&&K(F)&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,F)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(F)))return!1;if(we&&!Jn[F]){const dt=y(C)||C.parentNode,yt=g(C)||C.childNodes;if(yt&&dt){const gt=yt.length;for(let Xt=gt-1;Xt>=0;--Xt)dt.insertBefore(v(yt[Xt],!0),m(C))}}return nr(C),!0}return C instanceof l&&!Yo(C)||(F==="noscript"||F==="noembed"||F==="noframes")&&Ae(/<\/no(script|embed|frames)/i,C.innerHTML)?(nr(C),!0):(tt&&C.nodeType===3&&(j=C.textContent,Ao([A,V,M],dt=>{j=Cs(j,dt," ")}),C.textContent!==j&&(Ms(t.removed,{element:C.cloneNode()}),C.textContent=j)),nn("afterSanitizeElements",C,null),!1)},W=function(C,j,F){if(st&&(j==="id"||j==="name")&&(F in n||F in er))return!1;if(!(at&&!J[j]&&Ae(R,j))&&!(pt&&Ae(E,j))){if(!q[j]||J[j]){if(!(K(C)&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,C)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(C))&&(nt.attributeNameCheck instanceof RegExp&&Ae(nt.attributeNameCheck,j)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(j))||j==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,F)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(F))))return!1}else if(!Pn[j]&&!Ae(P,Cs(F,H,""))&&!((j==="src"||j==="xlink:href"||j==="href")&&C!=="script"&&Vk(F,"data:")===0&&Is[C])&&!(Tt&&!Ae(B,Cs(F,H,"")))&&F)return!1}return!0},K=function(C){return C.indexOf("-")>0},ct=function(C){nn("beforeSanitizeAttributes",C,null);const{attributes:j}=C;if(!j)return;const F={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q};let dt=j.length;for(;dt--;){const yt=j[dt],{name:gt,namespaceURI:Xt,value:de}=yt,De=Zt(gt);let zt=gt==="value"?de:Fk(de);if(F.attrName=De,F.attrValue=zt,F.keepAttr=!0,F.forceKeepAttr=void 0,nn("uponSanitizeAttribute",C,F),zt=F.attrValue,F.forceKeepAttr||(Hs(gt,C),!F.keepAttr))continue;if(!X&&Ae(/\/>/i,zt)){Hs(gt,C);continue}tt&&Ao([A,V,M],GV=>{zt=Cs(zt,GV," ")});const V0=Zt(C.nodeName);if(W(V0,De,zt)){if(Lt&&(De==="id"||De==="name")&&(Hs(gt,C),zt=Ve+zt),x&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Xt)switch(f.getAttributeType(V0,De)){case"TrustedHTML":{zt=x.createHTML(zt);break}case"TrustedScriptURL":{zt=x.createScriptURL(zt);break}}try{Xt?C.setAttributeNS(Xt,gt,zt):C.setAttribute(gt,zt),Lv(t.removed)}catch{}}}nn("afterSanitizeAttributes",C,null)},_t=function C(j){let F=null;const dt=Zo(j);for(nn("beforeSanitizeShadowDOM",j,null);F=dt.nextNode();)nn("uponSanitizeShadowNode",F,null),!$(F)&&(F.content instanceof s&&C(F.content),ct(F));nn("afterSanitizeShadowDOM",j,null)};return t.sanitize=function(C){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,dt=null,yt=null,gt=null;if(Ps=!C,Ps&&(C="<!-->"),typeof C!="string"&&!Xo(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw As("dirty is not a string, aborting")}else throw As("toString is not a function");if(!t.isSupported)return C;if(z||Dr(j),t.removed=[],typeof C=="string"&&($r=!1),$r){if(C.nodeName){const De=Zt(C.nodeName);if(!N[De]||Y[De])throw As("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)F=Vs("<!---->"),dt=F.ownerDocument.importNode(C,!0),dt.nodeType===1&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?F=dt:F.appendChild(dt);else{if(!xt&&!tt&&!ut&&C.indexOf("<")===-1)return x&&Vt?x.createHTML(C):C;if(F=Vs(C),!F)return xt?null:Vt?w:""}F&&Rt&&nr(F.firstChild);const Xt=Zo($r?C:F);for(;yt=Xt.nextNode();)$(yt)||(yt.content instanceof s&&_t(yt.content),ct(yt));if($r)return C;if(xt){if(Ht)for(gt=T.call(F.ownerDocument);F.firstChild;)gt.appendChild(F.firstChild);else gt=F;return(q.shadowroot||q.shadowrootmode)&&(gt=U.call(r,gt,!0)),gt}let de=ut?F.outerHTML:F.innerHTML;return ut&&N["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Ae(Uv,F.ownerDocument.doctype.name)&&(de="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
4
- `+de),tt&&Ao([A,V,M],De=>{de=Cs(de,De," ")}),x&&Vt?x.createHTML(de):de},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dr(C),z=!0},t.clearConfig=function(){Bn=null,z=!1},t.isValidAttribute=function(C,j,F){Bn||Dr({});const dt=Zt(C),yt=Zt(j);return W(dt,yt,F)},t.addHook=function(C,j){typeof j=="function"&&(L[C]=L[C]||[],Ms(L[C],j))},t.removeHook=function(C){if(L[C])return Lv(L[C])},t.removeHooks=function(C){L[C]&&(L[C]=[])},t.removeAllHooks=function(){L={}},t}var Au=Hv();const Do=e=>Au.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),eI=e=>Au.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),dn=e=>Au.sanitize(e,{ALLOWED_TAGS:[]}),Vv=class G0 extends Et{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-${this.services.domUtils.getChartID()} toolbar`);if(b(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("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
1
+ (function(Q,ae){typeof exports=="object"&&typeof module<"u"?ae(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ae):(Q=typeof globalThis<"u"?globalThis:Q||self,ae(Q.ChartsReact={},Q.React))})(this,function(Q,ae){"use strict";var GV=Object.defineProperty;var jV=(Q,ae,Hn)=>ae in Q?GV(Q,ae,{enumerable:!0,configurable:!0,writable:!0,value:Hn}):Q[ae]=Hn;var ch=(Q,ae,Hn)=>(jV(Q,typeof ae!="symbol"?ae+"":ae,Hn),Hn);var Hn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Hn||{}),hh=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(hh||{}),dh=(e=>(e.UPDATE="model-update",e))(dh||{}),fh=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(fh||{}),ph=(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))(ph||{}),mh=(e=>(e.CHANGE="zoom-domain-change",e))(mh||{}),gh=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(gh||{}),vh=(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))(vh||{}),yh=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(yh||{}),xh=(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))(xh||{}),bh=(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))(bh||{}),Eh=(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))(Eh||{}),_h=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(_h||{}),wh=(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))(wh||{}),Sh=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Sh||{}),Th=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Th||{}),Oh=(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))(Oh||{}),Mh=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Mh||{}),Ch=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Ch||{}),wi=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(wi||{}),Ah=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Ah||{}),$h=(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))($h||{}),Rh=(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))(Rh||{}),Lh=(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))(Lh||{}),Dh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Dh||{}),kh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(kh||{}),kr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(kr||{});const j0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Lh,Area:yh,Axis:vh,Bar:_h,Boxplot:wh,CanvasZoom:gh,Chart:Hn,Choropleth:kr,CirclePack:Rh,Gauge:Eh,Heatmap:kh,Legend:$h,Line:Th,Meter:Dh,Modal:hh,Model:dh,Pie:bh,Radar:Oh,Scatter:Sh,Threshold:Ah,Toolbar:fh,Tooltip:wi,Tree:Mh,Treemap:Ch,WordCloud:xh,ZoomBar:ph,ZoomDomain:mh},Symbol.toStringTag,{value:"Module"})),T=j0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),Ih=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Ih||{}),ot=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(ot||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),rn=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(rn||{}),Fe=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Fe||{}),ee=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(ee||{}),et=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(et||{}),Si=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Si||{}),Kt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Kt||{}),Ti=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Ti||{}),Qo=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Qo||{}),kt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(kt||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),Ir=(e=>(e.CENTER="center",e))(Ir||{}),Fs=(e=>(e.LEFT="left",e.RIGHT="right",e))(Fs||{}),Qt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Qt||{}),mn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(mn||{}),gn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(gn||{}),Nr=(e=>(e.SEMI="semi",e.FULL="full",e))(Nr||{}),Jo=(e=>(e.UP="up",e.DOWN="down",e))(Jo||{}),zs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(zs||{}),Gs=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Gs||{}),ke=(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))(ke||{}),jt=(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.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(jt||{}),tl=(e=>(e.LEFT="left",e.RIGHT="right",e))(tl||{}),Jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Jt||{}),js=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(js||{}),Oi=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Oi||{}),Ws=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ws||{}),vn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(vn||{});function rr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function W0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function el(e){let t,n,r;e.length!==2?(t=rr,n=(o,l)=>rr(e(o),l),r=(o,l)=>e(o)-l):(t=e===rr||e===W0?e:q0,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 q0(){return 0}function Y0(e){return e===null?NaN:+e}function*Z0(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const X0=el(rr).right;el(Y0).center;const nl=X0;function K0(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function ze(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 ir{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 Nh 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(Ph(this,t))}has(t){return super.has(Ph(this,t))}set(t,n){return super.set(Q0(this,t),n)}delete(t){return super.delete(J0(this,t))}}function Ph({_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=rr){if(e===rr)return Uh;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 Uh(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 rl(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 Ys(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 Pr(e,t,n){return t=+t,e=+e,n=+n,qs(e,t,n)[2]}function il(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Pr(t,e,n):Pr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ly(e,t,n){let r;for(;;){const i=Pr(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=ze,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 x=h,w=+f;if(t===ze&&([d,h]=ly(d,h,w)),f=Ys(d,h,w),f[0]<=d&&(l=Pr(d,h,w)),f[f.length-1]>=h)if(x>=h&&t===ze){const _=Pr(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 g=new Array(p+1),y;for(s=0;s<=p;++s)y=g[s]=[],y.x0=s>0?f[s-1]:d,y.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&&g[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 x=Math.floor((d-o)*l);g[Math.min(p,x+(f[x]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&g[nl(f,o,0,p)].push(i[s]);return g}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:rl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:rl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:rl(Array.isArray(i)?iy.call(i):i),r):n},r}function sr(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 Vn(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 Bh(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?Uh: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));Bh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Mi(e,n,t),i(e[r],s)>0&&Mi(e,n,r);a<o;){for(Mi(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Mi(e,n,o):(++o,Mi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Mi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function sl(e,t,n){if(e=Float64Array.from(Z0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Vn(e);if(t>=1)return sr(e);var r,i=(r-1)*t,s=Math.floor(i),a=sr(Bh(e,s).subarray(0,s+1)),o=Vn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*hy(e){for(const t of e)yield*t}function Hh(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 Zs=1,Xs=2,al=3,Ci=4,Vh=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 Ks(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===Zs||e===Ci?-1:1,u=e===Ci||e===Xs?"x":"y",d=e===Zs||e===al?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,g=t.range(),y=+g[0]+l,x=+g[g.length-1]+l,w=(t.bandwidth?vy:gy)(t.copy(),l),_=f.selection?f.selection():f,S=_.selectAll(".domain").data([null]),O=_.selectAll(".tick").data(p,t).order(),I=O.exit(),U=O.enter().append("g").attr("class","tick"),L=O.select("line"),A=O.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(U),L=L.merge(U.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),A=A.merge(U.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Zs?"0em":e===al?"0.71em":"0.32em")),f!==_&&(S=S.transition(f),O=O.transition(f),L=L.transition(f),A=A.transition(f),I=I.transition(f).attr("opacity",Vh).attr("transform",function(V){return isFinite(V=w(V))?d(V+l):this.getAttribute("transform")}),U.attr("opacity",Vh).attr("transform",function(V){var M=this.parentNode.__axis;return d((M&&isFinite(M=M(V))?M:w(V))+l)})),I.remove(),S.attr("d",e===Ci||e===Xs?a?"M"+c*a+","+y+"H"+l+"V"+x+"H"+c*a:"M"+l+","+y+"V"+x:a?"M"+y+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+y+","+l+"H"+x),O.attr("opacity",1).attr("transform",function(V){return d(w(V)+l)}),L.attr(u+"2",c*s),A.attr(u,c*m).text(v),_.filter(yy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Xs?"start":e===Ci?"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 Ks(Zs,e)}function by(e){return Ks(Xs,e)}function ol(e){return Ks(al,e)}function Fh(e){return Ks(Ci,e)}var Ey={value:()=>{}};function ll(){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 Qs(n)}function Qs(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}})}Qs.prototype=ll.prototype={constructor:Qs,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]=zh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=zh(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 Qs(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 zh(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 cl="http://www.w3.org/1999/xhtml";const Gh={svg:"http://www.w3.org/2000/svg",xhtml:cl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Js(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gh.hasOwnProperty(t)?{space:Gh[t],local:e}:e}function Sy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cl&&t.documentElement.namespaceURI===cl?t.createElement(e):t.createElementNS(n,e)}}function Ty(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jh(e){var t=Js(e);return(t.local?Ty:Sy)(t)}function Oy(){}function ul(e){return e==null?Oy:function(){return this.querySelector(e)}}function My(e){typeof e!="function"&&(e=ul(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 Se(r,this._parents)}function Cy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ay(){return[]}function Wh(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=Wh(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 Se(r,i)}function qh(e){return function(){return this.matches(e)}}function Yh(e){return function(t){return t.matches(e)}}var Ly=Array.prototype.find;function Dy(e){return function(){return Ly.call(this.children,e)}}function ky(){return this.firstElementChild}function Iy(e){return this.select(e==null?ky:Dy(typeof e=="function"?e:Yh(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:Yh(e)))}function Hy(e){typeof e!="function"&&(e=qh(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 Se(r,this._parents)}function Zh(e){return new Array(e.length)}function Vy(){return new Se(this._enter||this._groups.map(Zh),this._parents)}function ta(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ta.prototype={constructor:ta,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 ta(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 ta(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),g=l[c]=new Array(h);n(u,d,v,m,g,f,t);for(var y=0,x=0,w,_;y<p;++y)if(w=v[y]){for(y>=x&&(x=y+1);!(_=m[x])&&++x<p;);w._next=_||null}}return a=new Se(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 Se(this._exit||this._groups.map(Zh),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 Se(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 Se(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=Js(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 Xh(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??"")):Ur(this.node(),e)}function Ur(e,t){return e.style.getPropertyValue(t)||Xh(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 Kh(e){return e.trim().split(/^|\s+/)}function hl(e){return e.classList||new Qh(e)}function Qh(e){this._node=e,this._names=Kh(e.getAttribute("class")||"")}Qh.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 Jh(e,t){for(var n=hl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function td(e,t){for(var n=hl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function E1(e){return function(){Jh(this,e)}}function _1(e){return function(){td(this,e)}}function w1(e,t){return function(){(t.apply(this,arguments)?Jh:td)(this,e)}}function S1(e,t){var n=Kh(e+"");if(arguments.length<2){for(var r=hl(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 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 D1(){this.nextSibling&&this.parentNode.appendChild(this)}function k1(){return this.each(D1)}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:jh(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:jh(e),r=t==null?U1:typeof t=="function"?t:ul(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 ed(e,t,n){var r=Xh(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 ed(this,e,t)}}function Q1(e,t){return function(){return ed(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 nd=[null];function Se(e,t){this._groups=e,this._parents=t}function Ai(){return new Se([[document.documentElement]],nd)}function ex(){return this}Se.prototype=Ai.prototype={constructor:Se,select:My,selectAll:Ry,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:L1,raise:k1,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 Se([[document.querySelector(e)]],[document.documentElement]):new Se([[e]],nd)}function nx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ar(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 dl={capture:!0,passive:!1};function fl(e){e.preventDefault(),e.stopImmediatePropagation()}function rx(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",fl,dl);"onselectstart"in t?n.on("selectstart.drag",fl,dl):(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",fl,dl),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 pl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function rd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $i(){}var Ri=.7,ea=1/Ri,Br="\\s*([+-]?\\d+)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sx=/^#([0-9a-f]{3,8})$/,ax=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),ox=new RegExp(`^rgb\\(${sn},${sn},${sn}\\)$`),lx=new RegExp(`^rgba\\(${Br},${Br},${Br},${Li}\\)$`),cx=new RegExp(`^rgba\\(${sn},${sn},${sn},${Li}\\)$`),ux=new RegExp(`^hsl\\(${Li},${sn},${sn}\\)$`),hx=new RegExp(`^hsla\\(${Li},${sn},${sn},${Li}\\)$`),id={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};pl($i,yn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sd,formatHex:sd,formatHex8:dx,formatHsl:fx,formatRgb:ad,toString:ad});function sd(){return this.rgb().formatHex()}function dx(){return this.rgb().formatHex8()}function fx(){return hd(this).formatHsl()}function ad(){return this.rgb().formatRgb()}function yn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?od(t):n===3?new ve(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?na(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?na(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 ve(t[1],t[2],t[3],1):(t=ox.exec(e))?new ve(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lx.exec(e))?na(t[1],t[2],t[3],t[4]):(t=cx.exec(e))?na(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ux.exec(e))?ud(t[1],t[2]/100,t[3]/100,1):(t=hx.exec(e))?ud(t[1],t[2]/100,t[3]/100,t[4]):id.hasOwnProperty(e)?od(id[e]):e==="transparent"?new ve(NaN,NaN,NaN,0):null}function od(e){return new ve(e>>16&255,e>>8&255,e&255,1)}function na(e,t,n,r){return r<=0&&(e=t=n=NaN),new ve(e,t,n,r)}function px(e){return e instanceof $i||(e=yn(e)),e?(e=e.rgb(),new ve(e.r,e.g,e.b,e.opacity)):new ve}function ml(e,t,n,r){return arguments.length===1?px(e):new ve(e,t,n,r??1)}function ve(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}pl(ve,ml,rd($i,{brighter(e){return e=e==null?ea:Math.pow(ea,e),new ve(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ve(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ve(or(this.r),or(this.g),or(this.b),ra(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:ld,formatHex:ld,formatHex8:mx,formatRgb:cd,toString:cd}));function ld(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}`}function mx(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}${lr((isNaN(this.opacity)?1:this.opacity)*255)}`}function cd(){const e=ra(this.opacity);return`${e===1?"rgb(":"rgba("}${or(this.r)}, ${or(this.g)}, ${or(this.b)}${e===1?")":`, ${e})`}`}function ra(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function or(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lr(e){return e=or(e),(e<16?"0":"")+e.toString(16)}function ud(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ge(e,t,n,r)}function hd(e){if(e instanceof Ge)return new Ge(e.h,e.s,e.l,e.opacity);if(e instanceof $i||(e=yn(e)),!e)return new Ge;if(e instanceof Ge)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 Ge(a,o,l,e.opacity)}function gl(e,t,n,r){return arguments.length===1?hd(e):new Ge(e,t,n,r??1)}function Ge(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}pl(Ge,gl,rd($i,{brighter(e){return e=e==null?ea:Math.pow(ea,e),new Ge(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new Ge(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 ve(vl(e>=240?e-240:e+120,i,r),vl(e,i,r),vl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ge(dd(this.h),ia(this.s),ia(this.l),ra(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=ra(this.opacity);return`${e===1?"hsl(":"hsla("}${dd(this.h)}, ${ia(this.s)*100}%, ${ia(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dd(e){return e=(e||0)%360,e<0?e+360:e}function ia(e){return Math.max(0,Math.min(1,e||0))}function vl(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 yl=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?fd:function(t,n){return n-t?vx(t,n,e):yl(isNaN(t)?n:t)}}function fd(e,t){var n=t-e;return n?gx(e,n):yl(isNaN(e)?t:e)}const sa=function e(t){var n=yx(t);function r(i,s){var a=n((i=ml(i)).r,(s=ml(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fd(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]=Di(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 Te(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]=Di(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var xl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bl=new RegExp(xl.source,"g");function Sx(e){return function(){return e}}function Tx(e){return function(t){return e(t)+""}}function pd(e,t){var n=xl.lastIndex=bl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=xl.exec(e))&&(i=bl.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:Te(r,i)})),n=bl.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 Di(e,t){var n=typeof t,r;return t==null||n==="boolean"?yl(t):(n==="number"?Te:n==="string"?(r=yn(t))?(t=r,sa):pd:t instanceof yn?sa:t instanceof Date?_x:bx(t)?xx:Array.isArray(t)?Ex:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wx:Te)(e,t)}function md(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var gd=180/Math.PI,El={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vd(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)*gd,skewX:Math.atan(l)*gd,scaleX:a,scaleY:o}}var aa;function Ox(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?El:vd(t.a,t.b,t.c,t.d,t.e,t.f)}function Mx(e){return e==null||(aa||(aa=document.createElementNS("http://www.w3.org/2000/svg","g")),aa.setAttribute("transform",e),!(e=aa.transform.baseVal.consolidate()))?El:(e=e.matrix,vd(e.a,e.b,e.c,e.d,e.e,e.f))}function yd(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:Te(c,d)},{i:v-2,x:Te(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:Te(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:Te(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:Te(c,d)},{i:v-2,x:Te(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=yd(Ox,"px, ","px)","deg)"),Ax=yd(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 Hr=0,ki=0,Ii=0,xd=1e3,oa,Ni,la=0,cr=0,ca=0,Pi=typeof performance=="object"&&performance.now?performance:Date,bd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _l(){return cr||(bd(Rx),cr=Pi.now()+ca)}function Rx(){cr=0}function ua(){this._call=this._time=this._next=null}ua.prototype=Ed.prototype={constructor:ua,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_l():+n)+(t==null?0:+t),!this._next&&Ni!==this&&(Ni?Ni._next=this:oa=this,Ni=this),this._call=e,this._time=n,wl()},stop:function(){this._call&&(this._call=null,this._time=1/0,wl())}};function Ed(e,t,n){var r=new ua;return r.restart(e,t,n),r}function Lx(){_l(),++Hr;for(var e=oa,t;e;)(t=cr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hr}function _d(){cr=(la=Pi.now())+ca,Hr=ki=0;try{Lx()}finally{Hr=0,kx(),cr=0}}function Dx(){var e=Pi.now(),t=e-la;t>xd&&(ca-=t,la=e)}function kx(){for(var e,t=oa,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:oa=n);Ni=e,wl(r)}function wl(e){if(!Hr){ki&&(ki=clearTimeout(ki));var t=e-cr;t>24?(e<1/0&&(ki=setTimeout(_d,e-Pi.now()-ca)),Ii&&(Ii=clearInterval(Ii))):(Ii||(la=Pi.now(),Ii=setInterval(Dx,xd)),Hr=1,bd(_d))}}function wd(e,t,n){var r=new ua;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ix=ll("start","end","cancel","interrupt"),Nx=[],Sd=0,Td=1,Sl=2,ha=3,Od=4,Tl=5,da=6;function fa(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:Sd})}function Ol(e,t){var n=je(e,t);if(n.state>Sd)throw new Error("too late; already scheduled");return n}function an(e,t){var n=je(e,t);if(n.state>ha)throw new Error("too late; already running");return n}function je(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=Ed(s,0,n.time);function s(c){n.state=Td,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!==Td)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===ha)return wd(a);f.state===Od?(f.state=da,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=da,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(wd(function(){n.state===ha&&(n.state=Od,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Sl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Sl){for(n.state=ha,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=Tl,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Tl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=da,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ml(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>Sl&&r.state<Tl,r.state=da,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(){Ml(this,e)})}function Bx(e,t){var n,r;return function(){var i=an(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=an(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=je(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 Cl(e,t,n){var r=e._id;return e.each(function(){var i=an(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return je(i,r).value[t]}}function Md(e,t){var n;return(typeof t=="number"?Te:t instanceof yn?sa:(n=yn(t))?(t=n,sa):pd)(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=Js(e),r=n==="transform"?Ax:Md;return this.attrTween(e,typeof t=="function"?(n.local?qx:Wx)(n,r,Cl(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=Js(e);return this.tween(n,(r.local?Kx:Qx)(r,t))}function tb(e,t){return function(){Ol(this,e).delay=+t.apply(this,arguments)}}function eb(e,t){return t=+t,function(){Ol(this,e).delay=t}}function nb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tb:eb)(t,e)):je(this.node(),t).delay}function rb(e,t){return function(){an(this,e).duration=+t.apply(this,arguments)}}function ib(e,t){return t=+t,function(){an(this,e).duration=t}}function sb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rb:ib)(t,e)):je(this.node(),t).duration}function ab(e,t){if(typeof t!="function")throw new Error;return function(){an(this,e).ease=t}}function ob(e){var t=this._id;return arguments.length?this.each(ab(t,e)):je(this.node(),t).ease}function lb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;an(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=qh(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 xn(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 xn(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)?Ol:an;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?je(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=ul(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,fa(c[h],t,n,h,c,je(u,n)));return new xn(s,this._parents,t,n)}function yb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wh(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=je(u,n),v=0,m=h.length;v<m;++v)(f=h[v])&&fa(f,t,n,v,h,p);s.push(h),a.push(u)}return new xn(s,a,t,n)}var xb=Ai.prototype.constructor;function bb(){return new xb(this._groups,this._parents)}function Eb(e,t){var n,r,i;return function(){var s=Ur(this,e),a=(this.style.removeProperty(e),Ur(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Cd(e){return function(){this.style.removeProperty(e)}}function _b(e,t,n){var r,i=n+"",s;return function(){var a=Ur(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=Ur(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Ur(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=an(this,e),c=l.on,u=l.value[s]==null?o||(o=Cd(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:Md;return t==null?this.styleTween(e,Eb(e,r)).on("end.style."+e,Cd(e)):typeof t=="function"?this.styleTween(e,wb(e,r,Cl(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 Rb(e){return this.tween("text",typeof e=="function"?$b(Cl(this,"text",e)):Ab(e==null?"":e+""))}function Lb(e){return function(t){this.textContent=e.call(this,t)}}function Db(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 kb(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,Db(e))}function Ib(){for(var e=this._name,t=this._id,n=Ad(),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=je(l,t);fa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new xn(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=an(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 xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ad(){return++Pb}var bn=Ai.prototype;xn.prototype={constructor:xn,select:vb,selectAll:yb,selectChild:bn.selectChild,selectChildren:bn.selectChildren,filter:ub,merge:hb,selection:bb,transition:Ib,call:bn.call,nodes:bn.nodes,node:bn.node,size:bn.size,empty:bn.empty,each:bn.each,on:pb,attr:Yx,attrTween:Jx,style:Tb,styleTween:Cb,text:Rb,textTween:kb,remove:gb,tween:Vx,delay:nb,duration:sb,ease:ob,easeVarying:cb,end:Nb,[Symbol.iterator]:bn[Symbol.iterator]};const Ub=e=>+e;function $d(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bb={time:null,delay:0,duration:250,ease:$d};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 xn?(t=e._id,e=e._name):(t=Ad(),(n=Bb).time=_l(),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])&&fa(l,e,t,c,a,n||Hb(l,t));return new xn(r,this._parents,e,t)}Ai.prototype.interrupt=Ux,Ai.prototype.transition=Vb;const Al=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 $l(e){e.preventDefault(),e.stopImmediatePropagation()}var Rd={name:"drag"},Rl={name:"space"},Vr={name:"handle"},Fr={name:"center"};const{abs:Ld,max:oe,min:le}=Math;function Dd(e){return[+e[0],+e[1]]}function kd(e){return[Dd(e[0]),Dd(e[1])]}var pa={name:"x",handles:["w","e"].map(ma),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]]}},Ll={name:"y",handles:["n","s"].map(ma),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]]}},En={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"},Id={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nd={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 ma(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 Dl(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 Pd(){return Xb(pa)}function Xb(e){var t=qb,n=Wb,r=Yb,i=!0,s=ll("start","brush","end"),a=6,o;function l(m){var g=m.property("__brush",v).selectAll(".overlay").data([ma("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",En.overlay).merge(g).each(function(){var x=Dl(this).extent;D(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([ma("selection")]).enter().append("rect").attr("class","selection").attr("cursor",En.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(x){return x.type});y.exit().remove(),y.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return En[x.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,g,y){m.tween?m.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,w=x.__brush,_=u(x,arguments),S=w.selection,O=e.input(typeof g=="function"?g.apply(this,arguments):g,w.extent),I=Di(S,O);function U(L){w.selection=L===1&&O===null?null:I(L),c.call(x),_.brush()}return S!==null&&O!==null?U:U(1)}):m.each(function(){var x=this,w=arguments,_=x.__brush,S=e.input(typeof g=="function"?g.apply(x,w):g,_.extent),O=u(x,w).beforestart();Ml(x),_.selection=S===null?null:S,c.call(x),O.start(y).brush(y).end(y)})},l.clear=function(m,g){l.move(m,null,g)};function c(){var m=D(this),g=Dl(this).selection;g?(m.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?g[1][0]-a/2:g[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?g[1][1]-a/2:g[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?g[1][0]-g[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?g[1][1]-g[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,g,y){var x=m.__brush.emitter;return x&&(!y||!x.clean)?x:new d(m,g,y)}function d(m,g,y){this.that=m,this.args=g,this.state=m.__brush,this.active=0,this.clean=y}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,g){return this.starting?(this.starting=!1,this.emit("start",m,g)):this.emit("brush",m),this},brush:function(m,g){return this.emit("brush",m,g),this},end:function(m,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,g)),this},emit:function(m,g,y){var x=D(this.that).datum();s.call(m,this.that,new Fb(m,{sourceEvent:g,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),x)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var g=this,y=m.target.__data__.type,x=(i&&m.metaKey?y="overlay":y)==="selection"?Rd:i&&m.altKey?Fr:Vr,w=e===Ll?null:Gb[y],_=e===pa?null:jb[y],S=Dl(g),O=S.extent,I=S.selection,U=O[0][0],L,A,V=O[0][1],M,R,E=O[1][0],B,H,P=O[1][1],N,Z,q=0,it=0,nt,Y=w&&_&&i&&m.shiftKey,J,pt,at=Array.from(m.touches||[m],st=>{const Lt=st.identifier;return st=ar(st,g),st.point0=st.slice(),st.identifier=Lt,st});Ml(g);var Ot=u(g,arguments,!0).beforestart();if(y==="overlay"){I&&(nt=!0);const st=[at[0],at[1]||at[0]];S.selection=I=[[L=e===Ll?U:le(st[0][0],st[1][0]),M=e===pa?V:le(st[0][1],st[1][1])],[B=e===Ll?E:oe(st[0][0],st[1][0]),N=e===pa?P:oe(st[0][1],st[1][1])]],at.length>1&&Rt(m)}else L=I[0][0],M=I[0][1],B=I[1][0],N=I[1][1];A=L,R=M,H=B,Z=N;var X=D(g).attr("pointer-events","none"),tt=X.selectAll(".overlay").attr("cursor",En[y]);if(m.touches)Ot.moved=G,Ot.ended=xt;else{var ut=D(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",xt,!0);i&&ut.on("keydown.brush",Ht,!0).on("keyup.brush",Vt,!0),rx(m.view)}c.call(g),Ot.start(m,x.name);function G(st){for(const Lt of st.changedTouches||[st])for(const Ve of at)Ve.identifier===Lt.identifier&&(Ve.cur=ar(Lt,g));if(Y&&!J&&!pt&&at.length===1){const Lt=at[0];Ld(Lt.cur[0]-Lt[0])>Ld(Lt.cur[1]-Lt[1])?pt=!0:J=!0}for(const Lt of at)Lt.cur&&(Lt[0]=Lt.cur[0],Lt[1]=Lt.cur[1]);nt=!0,$l(st),Rt(st)}function Rt(st){const Lt=at[0],Ve=Lt.point0;var we;switch(q=Lt[0]-Ve[0],it=Lt[1]-Ve[1],x){case Rl:case Rd:{w&&(q=oe(U-L,le(E-B,q)),A=L+q,H=B+q),_&&(it=oe(V-M,le(P-N,it)),R=M+it,Z=N+it);break}case Vr:{at[1]?(w&&(A=oe(U,le(E,at[0][0])),H=oe(U,le(E,at[1][0])),w=1),_&&(R=oe(V,le(P,at[0][1])),Z=oe(V,le(P,at[1][1])),_=1)):(w<0?(q=oe(U-L,le(E-L,q)),A=L+q,H=B):w>0&&(q=oe(U-B,le(E-B,q)),A=L,H=B+q),_<0?(it=oe(V-M,le(P-M,it)),R=M+it,Z=N):_>0&&(it=oe(V-N,le(P-N,it)),R=M,Z=N+it));break}case Fr:{w&&(A=oe(U,le(E,L-q*w)),H=oe(U,le(E,B+q*w))),_&&(R=oe(V,le(P,M-it*_)),Z=oe(V,le(P,N+it*_)));break}}H<A&&(w*=-1,we=L,L=B,B=we,we=A,A=H,H=we,y in Id&&tt.attr("cursor",En[y=Id[y]])),Z<R&&(_*=-1,we=M,M=N,N=we,we=R,R=Z,Z=we,y in Nd&&tt.attr("cursor",En[y=Nd[y]])),S.selection&&(I=S.selection),J&&(A=I[0][0],H=I[1][0]),pt&&(R=I[0][1],Z=I[1][1]),(I[0][0]!==A||I[0][1]!==R||I[1][0]!==H||I[1][1]!==Z)&&(S.selection=[[A,R],[H,Z]],c.call(g),Ot.brush(st,x.name))}function xt(st){if(zb(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ix(st.view,nt),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);X.attr("pointer-events","all"),tt.attr("cursor",En.overlay),S.selection&&(I=S.selection),Zb(I)&&(S.selection=null,c.call(g)),Ot.end(st,x.name)}function Ht(st){switch(st.keyCode){case 16:{Y=w&&_;break}case 18:{x===Vr&&(w&&(B=H-q*w,L=A+q*w),_&&(N=Z-it*_,M=R+it*_),x=Fr,Rt(st));break}case 32:{(x===Vr||x===Fr)&&(w<0?B=H-q:w>0&&(L=A-q),_<0?N=Z-it:_>0&&(M=R-it),x=Rl,tt.attr("cursor",En.selection),Rt(st));break}default:return}$l(st)}function Vt(st){switch(st.keyCode){case 16:{Y&&(J=pt=Y=!1,Rt(st));break}case 18:{x===Fr&&(w<0?B=H:w>0&&(L=A),_<0?N=Z:_>0&&(M=R),x=Vr,Rt(st));break}case 32:{x===Rl&&(st.altKey?(w&&(B=H-q*w,L=A+q*w),_&&(N=Z-it*_,M=R+it*_),x=Fr):(w<0?B=H:w>0&&(L=A),_<0?N=Z:_>0&&(M=R),x=Vr),tt.attr("cursor",En[y]),Rt(st));break}default:return}$l(st)}}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=kd(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Al(kd(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Al(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Al(!!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 kl=Math.PI,Il=2*kl,ur=1e-6,Kb=Il-ur;function Ud(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 Ud;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 Nl=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Ud: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>ur)if(!(Math.abs(d*l-c*u)>ur)||!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,g=Math.sqrt(v),y=Math.sqrt(h),x=s*Math.tan((kl-Math.acos((v+h-m)/(2*g*y)))/2),w=x/y,_=x/g;Math.abs(w-1)>ur&&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)>ur||Math.abs(this._y1-u)>ur)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Il+Il),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>ur&&this._append`A${r},${r},0,${+(h>=kl)},${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 Bd(){return new Nl}Bd.prototype=Nl.prototype;function Jb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ga(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 zr(e){return e=ga(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 Ui(e){if(!(t=nE.exec(e)))throw new Error("invalid format: "+e);var t;return new Pl({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]})}Ui.prototype=Pl.prototype;function Pl(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+""}Pl.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 Hd;function iE(e,t){var n=ga(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Hd=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")+ga(e,Math.max(0,t+s-1))[0]}function Vd(e,t){var n=ga(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 Fd={"%":(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)=>Vd(e*100,t),r:Vd,s:iE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zd(e){return e}var Gd=Array.prototype.map,jd=["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?zd:tE(Gd.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?zd:eE(Gd.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=Ui(d);var h=d.fill,f=d.align,p=d.sign,v=d.symbol,m=d.zero,g=d.width,y=d.comma,x=d.precision,w=d.trim,_=d.type;_==="n"?(y=!0,_="g"):Fd[_]||(x===void 0&&(x=12),w=!0,_="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var S=v==="$"?n:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",O=v==="$"?r:/[%p]/.test(_)?a:"",I=Fd[_],U=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function L(A){var V=S,M=O,R,E,B;if(_==="c")M=I(A)+M,A="";else{A=+A;var H=A<0||1/A<0;if(A=isNaN(A)?l:I(Math.abs(A),x),w&&(A=rE(A)),H&&+A==0&&p!=="+"&&(H=!1),V=(H?p==="("?p:o:p==="-"||p==="("?"":p)+V,M=(_==="s"?jd[8+Hd/3]:"")+M+(H&&p==="("?")":""),U){for(R=-1,E=A.length;++R<E;)if(B=A.charCodeAt(R),48>B||B>57){M=(B===46?i+A.slice(R+1):A.slice(R))+M,A=A.slice(0,R);break}}}y&&!m&&(A=t(A,1/0));var P=V.length+A.length+M.length,N=P<g?new Array(g-P+1).join(h):"";switch(y&&m&&(A=t(N+A,N.length?g-M.length:1/0),N=""),f){case"<":A=V+A+M+N;break;case"=":A=V+N+A+M;break;case"^":A=N.slice(0,P=N.length>>1)+V+A+M+N.slice(P);break;default:A=N+V+A+M;break}return s(A)}return L.toString=function(){return d+""},L}function u(d,h){var f=c((d=Ui(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(zr(h)/3)))*3,v=Math.pow(10,-p),m=jd[8+p/3];return function(g){return f(v*g)+m}}return{format:c,formatPrefix:u}}var va,Ul,Wd;aE({thousands:",",grouping:[3],currency:["$",""]});function aE(e){return va=sE(e),Ul=va.format,Wd=va.formatPrefix,va}function oE(e){return Math.max(0,-zr(Math.abs(e)))}function lE(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zr(t)/3)))*3-zr(Math.abs(e)))}function cE(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zr(t)-zr(e))+1}var Mt=1e-6,qd=1e-12,bt=Math.PI,ye=bt/2,Yd=bt/4,Oe=bt*2,fe=180/bt,qt=bt/180,Ct=Math.abs,Zd=Math.atan,hr=Math.atan2,$t=Math.cos,uE=Math.exp,hE=Math.log,Tt=Math.sin,Fn=Math.sign||function(e){return e>0?1:e<0?-1:0},We=Math.sqrt,dE=Math.tan;function fE(e){return e>1?0:e<-1?bt:Math.acos(e)}function _n(e){return e>1?ye:e<-1?-ye:Math.asin(e)}function Ie(){}function ya(e,t){e&&Kd.hasOwnProperty(e.type)&&Kd[e.type](e,t)}var Xd={Feature:function(e,t){ya(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ya(n[r].geometry,t)}},Kd={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){Bl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Bl(n[r],t,0)},Polygon:function(e,t){Qd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Qd(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ya(n[r],t)}};function Bl(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 Qd(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Bl(e[n],t,1);t.polygonEnd()}function Gr(e,t){e&&Xd.hasOwnProperty(e.type)?Xd[e.type](e,t):ya(e,t)}function Hl(e){return[hr(e[1],e[0]),_n(e[2])]}function jr(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*Tt(t),Tt(n)]}function xa(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ba(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 Vl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ea(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Fl(e){var t=We(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 Gl(e,t){return Ct(e)>bt&&(e-=Math.round(e/Oe)*Oe),[e,t]}Gl.invert=Gl;function Jd(e,t,n){return(e%=Oe)?t||n?zl(ef(e),nf(t,n)):ef(e):t||n?nf(t,n):Gl}function tf(e){return function(t,n){return t+=e,Ct(t)>bt&&(t-=Math.round(t/Oe)*Oe),[t,n]}}function ef(e){var t=tf(e);return t.invert=tf(-e),t}function nf(e,t){var n=$t(e),r=Tt(e),i=$t(t),s=Tt(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=Tt(o)*c,h=Tt(l),f=h*n+u*r;return[hr(d*i-f*s,u*n-h*r),_n(f*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=Tt(o)*c,h=Tt(l),f=h*i-d*s;return[hr(d*i+h*s,u*n+f*r),_n(f*n-u*r)]},a}function pE(e){e=Jd(e[0]*qt,e[1]*qt,e.length>2?e[2]*qt:0);function t(n){return n=e(n[0]*qt,n[1]*qt),n[0]*=fe,n[1]*=fe,n}return t.invert=function(n){return n=e.invert(n[0]*qt,n[1]*qt),n[0]*=fe,n[1]*=fe,n},t}function mE(e,t,n,r,i,s){if(n){var a=$t(t),o=Tt(t),l=r*n;i==null?(i=t+r*Oe,s=t-l/2):(i=rf(a,i),s=rf(a,s),(r>0?i<s:i>s)&&(i+=r*Oe));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Hl([a,-o*$t(u),-o*Tt(u)]),e.point(c[0],c[1])}}function rf(e,t){t=jr(t),t[0]-=e,Fl(t);var n=fE(-t[1]);return((-t[2]<0?-n:n)+Oe-Mt)%Oe}function sf(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ie,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 Ct(e[0]-t[0])<Mt&&Ct(e[1]-t[1])<Mt}function wa(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 af(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],g=p[v],y;if(_a(m,g)){if(!m[2]&&!g[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}g[0]+=2*Mt}s.push(y=new wa(m,p,null,!0)),a.push(y.o=new wa(m,null,y,!1)),s.push(y=new wa(g,p,null,!1)),a.push(y.o=new wa(g,null,y,!0))}}),!!s.length){for(a.sort(t),of(s),of(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 of(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 jl(e){return Ct(e[0])<=bt?e[0]:Fn(e[0])*((Ct(e[0])+bt)%Oe-bt)}function gE(e,t){var n=jl(t),r=t[1],i=Tt(r),s=[Tt(n),-$t(n),0],a=0,o=0,l=new ir;i===1?r=ye+Mt:i===-1&&(r=-ye-Mt);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=jl(f),v=f[1]/2+Yd,m=Tt(v),g=$t(v),y=0;y<h;++y,p=w,m=S,g=O,f=x){var x=d[y],w=jl(x),_=x[1]/2+Yd,S=Tt(_),O=$t(_),I=w-p,U=I>=0?1:-1,L=U*I,A=L>bt,V=m*S;if(l.add(hr(V*U*Tt(L),g*O+V*$t(L))),a+=A?I+U*Oe:I,A^p>=n^w>=n){var M=ba(jr(f),jr(x));Fl(M);var R=ba(s,M);Fl(R);var E=(A^I>=0?-1:1)*_n(R[2]);(r>E||r===E&&(M[0]||M[1]))&&(o+=A^I>=0?1:-1)}}return(a<-Mt||a<Mt&&l<-qd)^o&1}function lf(e,t,n,r){return function(i){var s=t(i),a=sf(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:v,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=y,h.lineEnd=x,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=v,h.lineEnd=m,u=Hh(u);var w=gE(c,r);u.length?(l||(i.polygonStart(),l=!0),af(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 g(w,_){d.push([w,_]),o.point(w,_)}function y(){o.lineStart(),d=[]}function x(){g(d[0][0],d[0][1]),o.lineEnd();var w=o.clean(),_=a.result(),S,O=_.length,I,U,L;if(d.pop(),c.push(d),d=null,!!O){if(w&1){if(U=_[0],(I=U.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<I;++S)i.point((L=U[S])[0],L[1]);i.lineEnd()}return}O>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]-ye-Mt:ye-e[1])-((t=t.x)[0]<0?t[1]-ye-Mt:ye-t[1])}const cf=lf(function(){return!0},xE,EE,[-bt,-ye]);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?bt:-bt,l=Ct(s-t);Ct(l-bt)<Mt?(e.point(t,n=(n+a)/2>0?ye:-ye),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=bt&&(Ct(t-r)<Mt&&(t-=r*Mt),Ct(s-o)<Mt&&(s-=o*Mt),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=Tt(e-n);return Ct(a)>Mt?Zd((Tt(t)*(s=$t(r))*Tt(n)-Tt(r)*(i=$t(t))*Tt(e))/(i*s*a)):(t+r)/2}function EE(e,t,n,r){var i;if(e==null)i=n*ye,r.point(-bt,i),r.point(0,i),r.point(bt,i),r.point(bt,0),r.point(bt,-i),r.point(0,-i),r.point(-bt,-i),r.point(-bt,0),r.point(-bt,i);else if(Ct(e[0]-t[0])>Mt){var s=e[0]<t[0]?bt:-bt;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=$t(e),n=6*qt,r=t>0,i=Ct(t)>Mt;function s(u,d,h,f){mE(f,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,f,p,v;return{lineStart:function(){p=f=!1,v=1},point:function(m,g){var y=[m,g],x,w=a(m,g),_=r?w?0:c(m,g):w?c(m+(m<0?bt:-bt),g):0;if(!d&&(p=f=w)&&u.lineStart(),w!==f&&(x=l(d,y),(!x||_a(d,x)||_a(y,x))&&(y[2]=1)),w!==f)v=0,w?(u.lineStart(),x=l(y,d),u.point(x[0],x[1])):(x=l(d,y),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(i&&d&&r^w){var S;!(_&h)&&(S=l(y,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,y))&&u.point(y[0],y[1]),d=y,f=w,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return v|(p&&f)<<1}}}function l(u,d,h){var f=jr(u),p=jr(d),v=[1,0,0],m=ba(f,p),g=xa(m,m),y=m[0],x=g-y*y;if(!x)return!h&&u;var w=t*g/x,_=-t*y/x,S=ba(v,m),O=Ea(v,w),I=Ea(m,_);Vl(O,I);var U=S,L=xa(O,U),A=xa(U,U),V=L*L-A*(xa(O,O)-1);if(!(V<0)){var M=We(V),R=Ea(U,(-L-M)/A);if(Vl(R,O),R=Hl(R),!h)return R;var E=u[0],B=d[0],H=u[1],P=d[1],N;B<E&&(N=E,E=B,B=N);var Z=B-E,q=Ct(Z-bt)<Mt,it=q||Z<Mt;if(!q&&P<H&&(N=H,H=P,P=N),it?q?H+P>0^R[1]<(Ct(R[0]-E)<Mt?H:P):H<=R[1]&&R[1]<=P:Z>bt^(E<=R[0]&&R[0]<=B)){var nt=Ea(U,(-L+M)/A);return Vl(nt,O),[R,Hl(nt)]}}}function c(u,d){var h=r?e:bt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return lf(a,o,s,r?[0,-e]:[-bt,e-bt])}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 Bi=1e9,Sa=-Bi;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 Ct(c[0]-e)<Mt?u>0?0:3:Ct(c[0]-n)<Mt?u>0?2:1:Ct(c[1]-t)<Mt?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=sf(),h,f,p,v,m,g,y,x,w,_,S,O={point:I,lineStart:V,lineEnd:M,polygonStart:L,polygonEnd:A};function I(E,B){i(E,B)&&u.point(E,B)}function U(){for(var E=0,B=0,H=f.length;B<H;++B)for(var P=f[B],N=1,Z=P.length,q=P[0],it,nt,Y=q[0],J=q[1];N<Z;++N)it=Y,nt=J,q=P[N],Y=q[0],J=q[1],nt<=r?J>r&&(Y-it)*(r-nt)>(J-nt)*(e-it)&&++E:J<=r&&(Y-it)*(r-nt)<(J-nt)*(e-it)&&--E;return E}function L(){u=d,h=[],f=[],S=!0}function A(){var E=U(),B=S&&E,H=(h=Hh(h)).length;(B||H)&&(c.polygonStart(),B&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),H&&af(h,o,E,s,c),c.polygonEnd()),u=c,h=f=p=null}function V(){O.point=R,f&&f.push(p=[]),_=!0,w=!1,y=x=NaN}function M(){h&&(R(v,m),g&&w&&d.rejoin(),h.push(d.result())),O.point=I,w&&u.lineEnd()}function R(E,B){var H=i(E,B);if(f&&p.push([E,B]),_)v=E,m=B,g=H,_=!1,H&&(u.lineStart(),u.point(E,B));else if(H&&w)u.point(E,B);else{var P=[y=Math.max(Sa,Math.min(Bi,y)),x=Math.max(Sa,Math.min(Bi,x))],N=[E=Math.max(Sa,Math.min(Bi,E)),B=Math.max(Sa,Math.min(Bi,B))];wE(P,N,e,t,n,r)?(w||(u.lineStart(),u.point(P[0],P[1])),u.point(N[0],N[1]),H||u.lineEnd(),S=!1):H&&(u.lineStart(),u.point(E,B),S=!1)}y=E,x=B,w=H}return O}}const Wl=e=>e;var ql=new ir,Yl=new ir,uf,hf,Zl,Xl,zn={point:Ie,lineStart:Ie,lineEnd:Ie,polygonStart:function(){zn.lineStart=TE,zn.lineEnd=ME},polygonEnd:function(){zn.lineStart=zn.lineEnd=zn.point=Ie,ql.add(Ct(Yl)),Yl=new ir},result:function(){var e=ql/2;return ql=new ir,e}};function TE(){zn.point=OE}function OE(e,t){zn.point=df,uf=Zl=e,hf=Xl=t}function df(e,t){Yl.add(Xl*e-Zl*t),Zl=e,Xl=t}function ME(){df(uf,hf)}const ff=zn;var Wr=1/0,Ta=Wr,Hi=-Wr,Oa=Hi,CE={point:AE,lineStart:Ie,lineEnd:Ie,polygonStart:Ie,polygonEnd:Ie,result:function(){var e=[[Wr,Ta],[Hi,Oa]];return Hi=Oa=-(Ta=Wr=1/0),e}};function AE(e,t){e<Wr&&(Wr=e),e>Hi&&(Hi=e),t<Ta&&(Ta=t),t>Oa&&(Oa=t)}const Ma=CE;var Kl=0,Ql=0,Vi=0,Ca=0,Aa=0,qr=0,Jl=0,tc=0,Fi=0,pf,mf,on,ln,qe={point:dr,lineStart:gf,lineEnd:vf,polygonStart:function(){qe.lineStart=LE,qe.lineEnd=DE},polygonEnd:function(){qe.point=dr,qe.lineStart=gf,qe.lineEnd=vf},result:function(){var e=Fi?[Jl/Fi,tc/Fi]:qr?[Ca/qr,Aa/qr]:Vi?[Kl/Vi,Ql/Vi]:[NaN,NaN];return Kl=Ql=Vi=Ca=Aa=qr=Jl=tc=Fi=0,e}};function dr(e,t){Kl+=e,Ql+=t,++Vi}function gf(){qe.point=$E}function $E(e,t){qe.point=RE,dr(on=e,ln=t)}function RE(e,t){var n=e-on,r=t-ln,i=We(n*n+r*r);Ca+=i*(on+e)/2,Aa+=i*(ln+t)/2,qr+=i,dr(on=e,ln=t)}function vf(){qe.point=dr}function LE(){qe.point=kE}function DE(){yf(pf,mf)}function kE(e,t){qe.point=yf,dr(pf=on=e,mf=ln=t)}function yf(e,t){var n=e-on,r=t-ln,i=We(n*n+r*r);Ca+=i*(on+e)/2,Aa+=i*(ln+t)/2,qr+=i,i=ln*e-on*t,Jl+=i*(on+e),tc+=i*(ln+t),Fi+=i*3,dr(on=e,ln=t)}const xf=qe;function bf(e){this._context=e}bf.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,Oe);break}}},result:Ie};var ec=new ir,nc,Ef,_f,zi,Gi,$a={point:Ie,lineStart:function(){$a.point=IE},lineEnd:function(){nc&&wf(Ef,_f),$a.point=Ie},polygonStart:function(){nc=!0},polygonEnd:function(){nc=null},result:function(){var e=+ec;return ec=new ir,e}};function IE(e,t){$a.point=wf,Ef=zi=e,_f=Gi=t}function wf(e,t){zi-=e,Gi-=t,ec.add(We(zi*zi+Gi*Gi)),zi=e,Gi=t}const Sf=$a;let Tf,Ra,Of,Mf;class Cf{constructor(t){this._append=t==null?Af:NE(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!==Of||this._append!==Ra){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`,Of=r,Ra=this._append,Mf=this._,this._=i}this._+=Mf;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Af(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function NE(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Af;if(t!==Tf){const n=10**t;Tf=t,Ra=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 Ra}function PE(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),Gr(o,i(s))),s.result()}return a.area=function(o){return Gr(o,i(ff)),ff.result()},a.measure=function(o){return Gr(o,i(Sf)),Sf.result()},a.bounds=function(o){return Gr(o,i(Ma)),Ma.result()},a.centroid=function(o){return Gr(o,i(xf)),xf.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Wl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Cf(n)):new bf(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 Cf(n)),a},a.projection(e).digits(n).context(t)}function rc(e){return function(t){var n=new ic;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ic(){}ic.prototype={constructor:ic,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 sc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Gr(n,e.stream(Ma)),t(Ma.result()),r!=null&&e.clipExtent(r),e}function $f(e,t,n){return sc(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 UE(e,t,n){return $f(e,[[0,0],t],n)}function BE(e,t,n){return sc(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 HE(e,t,n){return sc(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 Rf=16,VE=$t(30*qt);function Lf(e,t){return+t?zE(e,t):FE(e)}function FE(e){return rc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function zE(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,v,m){var g=c-r,y=u-i,x=g*g+y*y;if(x>4*t&&v--){var w=a+h,_=o+f,S=l+p,O=We(w*w+_*_+S*S),I=_n(S/=O),U=Ct(Ct(S)-1)<Mt||Ct(s-d)<Mt?(s+d)/2:hr(_,w),L=e(U,I),A=L[0],V=L[1],M=A-r,R=V-i,E=y*M-g*R;(E*E/x>t||Ct((g*M+y*R)/x-.5)>.3||a*h+o*f+l*p<VE)&&(n(r,i,s,a,o,l,A,V,U,w/=O,_/=O,S,v,m),m.point(A,V),n(A,V,U,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:g,lineStart:y,lineEnd:w,polygonStart:function(){r.polygonStart(),m.lineStart=_},polygonEnd:function(){r.polygonEnd(),m.lineStart=y}};function g(I,U){I=e(I,U),r.point(I[0],I[1])}function y(){d=NaN,m.point=x,r.lineStart()}function x(I,U){var L=jr([I,U]),A=e(I,U);n(d,h,u,f,p,v,d=A[0],h=A[1],u=I,f=L[0],p=L[1],v=L[2],Rf,r),r.point(d,h)}function w(){m.point=g,r.lineEnd()}function _(){y(),m.point=S,m.lineEnd=O}function S(I,U){x(i=I,U),s=d,a=h,o=f,l=p,c=v,m.point=x}function O(){n(d,h,u,f,p,v,s,a,i,o,l,c,Rf,r),m.lineEnd=w,w()}return m}}var GE=rc({point:function(e,t){this.stream.point(e*qt,t*qt)}});function jE(e){return rc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function WE(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 Df(e,t,n,r,i,s){if(!s)return WE(e,t,n,r,i);var a=$t(s),o=Tt(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 La(e){return kf(function(){return e})()}function kf(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=cf,m=null,g,y,x,w=Wl,_=.5,S,O,I,U,L;function A(E){return I(E[0]*qt,E[1]*qt)}function V(E){return E=I.invert(E[0],E[1]),E&&[E[0]*fe,E[1]*fe]}A.stream=function(E){return U&&L===E?U:U=GE(jE(u)(v(S(w(L=E)))))},A.preclip=function(E){return arguments.length?(v=E,p=void 0,R()):v},A.postclip=function(E){return arguments.length?(w=E,m=g=y=x=null,R()):w},A.clipAngle=function(E){return arguments.length?(v=+E?_E(p=E*qt):(p=null,cf),R()):p*fe},A.clipExtent=function(E){return arguments.length?(w=E==null?(m=g=y=x=null,Wl):SE(m=+E[0][0],g=+E[0][1],y=+E[1][0],x=+E[1][1]),R()):m==null?null:[[m,g],[y,x]]},A.scale=function(E){return arguments.length?(n=+E,M()):n},A.translate=function(E){return arguments.length?(r=+E[0],i=+E[1],M()):[r,i]},A.center=function(E){return arguments.length?(s=E[0]%360*qt,a=E[1]%360*qt,M()):[s*fe,a*fe]},A.rotate=function(E){return arguments.length?(o=E[0]%360*qt,l=E[1]%360*qt,c=E.length>2?E[2]%360*qt:0,M()):[o*fe,l*fe,c*fe]},A.angle=function(E){return arguments.length?(d=E%360*qt,M()):d*fe},A.reflectX=function(E){return arguments.length?(h=E?-1:1,M()):h<0},A.reflectY=function(E){return arguments.length?(f=E?-1:1,M()):f<0},A.precision=function(E){return arguments.length?(S=Lf(O,_=E*E),R()):We(_)},A.fitExtent=function(E,B){return $f(A,E,B)},A.fitSize=function(E,B){return UE(A,E,B)},A.fitWidth=function(E,B){return BE(A,E,B)},A.fitHeight=function(E,B){return HE(A,E,B)};function M(){var E=Df(n,0,0,h,f,d).apply(null,t(s,a)),B=Df(n,r-E[0],i-E[1],h,f,d);return u=Jd(o,l,c),O=zl(t,B),I=zl(u,O),S=Lf(O,_),R()}function R(){return U=L=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&V,M()}}function If(e){var t=0,n=bt/3,r=kf(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*qt,n=s[1]*qt):[t*fe,n*fe]},i}function qE(e){var t=$t(e);function n(r,i){return[r*t,Tt(i)/t]}return n.invert=function(r,i){return[r/t,_n(i*t)]},n}function YE(e,t){var n=Tt(e),r=(n+Tt(t))/2;if(Ct(r)<Mt)return qE(e);var i=1+n*(2*r-n),s=We(i)/r;function a(o,l){var c=We(i-2*r*Tt(l))/r;return[c*Tt(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=hr(o,Ct(c))*Fn(c);return c*r<0&&(u-=bt*Fn(o)*Fn(c)),[u/r,_n((i-(o*o+c*c)*r*r)/(2*r))]},a}function Nf(){return If(YE).scale(155.424).center([0,33.6442])}function ZE(){return Nf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ac(e,t){return[e,hE(dE((ye+t)/2))]}ac.invert=function(e,t){return[e,2*Zd(uE(t))-ye]};function XE(){return KE(ac).scale(961/Oe)}function KE(e){var t=La(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=bt*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===ac?[[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 Da(e,t){return[e,t]}Da.invert=Da;function QE(){return La(Da).scale(152.63)}function JE(e,t){var n=$t(e),r=e===t?Tt(e):(n-$t(t))/(t-e),i=n/r+e;if(Ct(r)<Mt)return Da;function s(a,o){var l=i-o,c=r*a;return[l*Tt(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=hr(a,Ct(l))*Fn(l);return l*r<0&&(c-=bt*Fn(a)*Fn(l)),[c/r,i-Fn(r)*We(a*a+l*l)]},s}function t_(){return If(JE).scale(131.154).center([0,13.9389])}var ji=1.340264,Wi=-.081106,qi=893e-6,Yi=.003796,ka=We(3)/2,e_=12;function Pf(e,t){var n=_n(ka*Tt(t)),r=n*n,i=r*r*r;return[e*$t(n)/(ka*(ji+3*Wi*r+i*(7*qi+9*Yi*r))),n*(ji+Wi*r+i*(qi+Yi*r))]}Pf.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<e_&&(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,!(Ct(a)<qd));++s);return[ka*e*(ji+3*Wi*r+i*(7*qi+9*Yi*r))/$t(n),_n(Tt(n)/ka)]};function n_(){return La(Pf).scale(177.158)}function Uf(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)))]}Uf.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(Ct(i)>Mt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function r_(){return La(Uf).scale(175.295)}function i_(e,t){return e.parent===t.parent?1:2}function s_(e){return e.reduce(a_,0)/e.length}function a_(e,t){return e+t.x}function o_(e){return 1+e.reduce(l_,0)}function l_(e,t){return Math.max(e,t.y)}function c_(e){for(var t;t=e.children;)e=t[0];return e}function u_(e){for(var t;t=e.children;)e=t[t.length-1];return e}function h_(){var e=i_,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=s_(f),h.y=o_(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=c_(s),c=u_(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 d_(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 f_(){return this.eachAfter(d_)}function p_(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function m_(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 g_(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 v_(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function y_(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 x_(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function b_(e){for(var t=this,n=E_(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 E_(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 __(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function w_(){return Array.from(this)}function S_(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function T_(){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 Zi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=A_)):t===void 0&&(t=C_);for(var n=new Xi(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 Xi(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(R_)}function M_(){return Zi(this).eachBefore($_)}function C_(e){return e.children}function A_(e){return Array.isArray(e)?e[1]:null}function $_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function R_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Xi(e){this.data=e,this.depth=this.height=0,this.parent=null}Xi.prototype=Zi.prototype={constructor:Xi,count:f_,each:p_,eachAfter:g_,eachBefore:m_,find:v_,sum:y_,sort:x_,path:b_,ancestors:__,descendants:w_,leaves:S_,links:T_,copy:M_,[Symbol.iterator]:O_};function L_(e){return e==null?null:Bf(e)}function Bf(e){if(typeof e!="function")throw new Error;return e}function fr(){return 0}function Yr(e){return function(){return e}}const D_=1664525,k_=1013904223,Hf=4294967296;function I_(){let e=1;return()=>(e=(D_*e+k_)%Hf)/Hf}function N_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function P_(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 U_(e,t){for(var n=0,r=(e=P_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Vf(a,s)?++n:(a=H_(i=B_(i,s)),n=0);return a}function B_(e,t){var n,r;if(oc(t,e))return[t];for(n=0;n<e.length;++n)if(Ia(t,e[n])&&oc(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(Ia(Ki(e[n],e[r]),t)&&Ia(Ki(e[n],t),e[r])&&Ia(Ki(e[r],t),e[n])&&oc(Ff(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ia(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 Vf(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 oc(e,t){for(var n=0;n<t.length;++n)if(!Vf(e,t[n]))return!1;return!0}function H_(e){switch(e.length){case 1:return V_(e[0]);case 2:return Ki(e[0],e[1]);case 3:return Ff(e[0],e[1],e[2])}}function V_(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 Ff(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,g=d-s,y=r*r+i*i-s*s,x=y-a*a-o*o+l*l,w=y-c*c-u*u+d*d,_=f*p-h*v,S=(p*w-v*x)/(_*2)-r,O=(v*m-p*g)/_,I=(f*x-h*w)/(_*2)-i,U=(h*g-f*m)/_,L=O*O+U*U-1,A=2*(s+S*O+I*U),V=S*S+I*I-s*s,M=-(Math.abs(L)>1e-6?(A+Math.sqrt(A*A-4*L*V))/(2*L):V/A);return{x:r+S+O*M,y:i+I+U*M,r:M}}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 Gf(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 jf(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 Na(e){this._=e,this.next=null,this.previous=null}function F_(e,t){if(!(s=(e=N_(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 Na(n),r=new Na(r),i=new Na(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 Na(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Gf(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Gf(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=jf(n);(i=i.next)!==r;)(o=jf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=U_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function z_(e){return Math.sqrt(e.value)}function G_(){var e=null,t=1,n=1,r=fr;function i(s){const a=I_();return s.x=t/2,s.y=n/2,e?s.eachBefore(Wf(e)).eachAfter(lc(r,.5,a)).eachBefore(qf(1)):s.eachBefore(Wf(z_)).eachAfter(lc(fr,1,a)).eachAfter(lc(r,s.r/Math.min(t,n),a)).eachBefore(qf(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:Yr(+s),i):r},i}function Wf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function lc(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=F_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function qf(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 j_(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 W_(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 q_(e,t){return e.parent===t.parent?1:2}function cc(e){var t=e.children;return t?t[0]:e.t}function uc(e){var t=e.children;return t?t[t.length-1]:e.t}function Y_(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 Z_(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 Pa(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}Pa.prototype=Object.create(Xi.prototype);function K_(e){for(var t=new Pa(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 Pa(s[a],a)),i.parent=n;return(t.parent=new Pa(null,0)).children=[t],t}function Q_(){var e=q_,t=1,n=1,r=null;function i(c){var u=K_(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(y){y.x<d.x&&(d=y),y.x>h.x&&(h=y),y.depth>f.depth&&(f=y)});var p=d===h?1:e(d,h)/2,v=p-d.x,m=t/(h.x+p+v),g=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+v)*m,y.y=y.depth*g})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Z_(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,g=f.m,y=p.m,x=v.m,w;p=uc(p),h=cc(h),p&&h;)v=cc(v),f=uc(f),f.a=c,w=p.z+y-h.z-m+e(p._,h._),w>0&&(Y_(X_(p,c,d),c,w),m+=w,g+=w),y+=p.m,m+=h.m,x+=v.m,g+=f.m;p&&!uc(f)&&(f.t=p,f.m+=y-g),h&&!cc(v)&&(v.t=h,v.m+=m-x,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 J_(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 tw=(1+Math.sqrt(5))/2;function ew(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,g,y,x,w,_,S;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(g=y=m,_=Math.max(p/f,f/p)/(v*e),S=m*m*_,w=Math.max(y/S,S/g);d<h;++d){if(m+=c=o[d].value,c<g&&(g=c),c>y&&(y=c),S=m*m*_,x=Math.max(y/S,S/g),x>w){m-=c;break}w=x}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?W_(l,n,r,i,v?r+=p*m/v:s):J_(l,n,r,v?n+=f*m/v:i,s),v-=m,u=d}return a}const nw=function e(t){function n(r,i,s,a,o){ew(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(tw);function rw(){var e=nw,t=!1,n=1,r=1,i=[0],s=fr,a=fr,o=fr,l=fr,c=fr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(j_),h}function d(h){var f=i[h.depth],p=h.x0+f,v=h.y0+f,m=h.x1-f,g=h.y1-f;m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),h.x0=p,h.y0=v,h.x1=m,h.y1=g,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,v+=a(h)-f,m-=o(h)-f,g-=l(h)-f,m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),e(h,p,v,m,g))}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=Bf(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:Yr(+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:Yr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Yr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Yr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Yr(+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 Yf=Symbol("implicit");function Ua(){var e=new Nh,t=[],n=[],r=Yf;function i(s){let a=e.get(s);if(a===void 0){if(r!==Yf)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 Nh;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 Ua(t,n).unknown(r)},Zr.apply(i,arguments),i}function Qi(){var e=Ua().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(g){return p+s*g});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 iw(e){return function(){return e}}function sw(e){return+e}var Zf=[0,1];function Xr(e){return e}function hc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:iw(isNaN(t)?NaN:.5)}function aw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ow(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=hc(i,r),s=n(a,s)):(r=hc(r,i),s=n(s,a)),function(o){return s(r(o))}}function lw(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]=hc(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=nl(e,o,1,r)-1;return s[l](i[l](o))}}function dc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xf(){var e=Zf,t=Zf,n=Di,r,i,s,a=Xr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Xr&&(a=aw(e[0],e[h-1])),o=h>2?lw:ow,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),Te)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,sw),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=md,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Xr,u()):a!==Xr},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 Kf(){return Xf()(Xr,Xr)}function cw(e,t,n,r){var i=il(e,t,n),s;switch(r=Ui(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),Wd(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 Ul(r)}function Qf(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ys(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return cw(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=Pr(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 Ye(){var e=Kf();return e.copy=function(){return dc(e,Ye())},Zr.apply(e,arguments),Qf(e)}function Jf(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 tp(e){return Math.log(e)}function ep(e){return Math.exp(e)}function uw(e){return-Math.log(-e)}function hw(e){return-Math.exp(-e)}function dw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function fw(e){return e===10?dw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function pw(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 np(e){return(t,n)=>-e(-t,n)}function mw(e){const t=e(tp,ep),n=t.domain;let r=10,i,s;function a(){return i=pw(r),s=fw(r),n()[0]<0?(i=np(i),s=np(s),e(uw,hw)):e(tp,ep),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 g=[];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;g.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;g.push(v)}g.length*2<m&&(g=Ys(c,u,m))}else g=Ys(h,f,Math.min(f-h,m)).map(s);return d?g.reverse():g},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ui(l)).precision==null&&(l.trim=!0),l=Ul(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(Jf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function rp(){const e=mw(Xf()).domain([1,10]);return e.copy=()=>dc(e,rp()).base(e.base()),Zr.apply(e,arguments),e}function fc(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[nl(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 fc().domain([e,t]).range(i).unknown(s)},Zr.apply(Qf(a),arguments)}const pc=new Date,mc=new Date;function te(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=>te(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)=>(pc.setTime(+s),mc.setTime(+a),e(pc),e(mc),Math.floor(n(pc,mc))),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 Ba=te(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ba.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?te(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ba),Ba.range;const wn=1e3,Ne=wn*60,Sn=Ne*60,Tn=Sn*24,gc=Tn*7,ip=Tn*30,vc=Tn*365,Kr=te(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*wn)},(e,t)=>(t-e)/wn,e=>e.getUTCSeconds());Kr.range;const yc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wn)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getMinutes());yc.range,te(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getUTCMinutes()).range;const xc=te(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wn-e.getMinutes()*Ne)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getHours());xc.range,te(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCHours()).range;const Ji=te(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ne)/Tn,e=>e.getDate()-1);Ji.range;const bc=te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Tn,e=>e.getUTCDate()-1);bc.range,te(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Tn,e=>Math.floor(e/Tn)).range;function pr(e){return te(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())*Ne)/gc)}const Ha=pr(0),Va=pr(1),gw=pr(2),vw=pr(3),Qr=pr(4),yw=pr(5),xw=pr(6);Ha.range,Va.range,gw.range,vw.range,Qr.range,yw.range,xw.range;function mr(e){return te(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)/gc)}const sp=mr(0),Fa=mr(1),bw=mr(2),Ew=mr(3),Jr=mr(4),_w=mr(5),ww=mr(6);sp.range,Fa.range,bw.range,Ew.range,Jr.range,_w.range,ww.range;const Ec=te(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());Ec.range,te(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 On=te(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());On.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(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)}),On.range;const gr=te(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());gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:te(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)}),gr.range;function Sw(e,t,n,r,i,s){const a=[[Kr,1,wn],[Kr,5,5*wn],[Kr,15,15*wn],[Kr,30,30*wn],[s,1,Ne],[s,5,5*Ne],[s,15,15*Ne],[s,30,30*Ne],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,Tn],[r,2,2*Tn],[n,1,gc],[t,1,ip],[t,3,3*ip],[e,1,vc]];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=el(([,,m])=>m).right(a,h);if(f===a.length)return e.every(il(c/vc,u/vc,d));if(f===0)return Ba.every(Math.max(il(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[Tw,Ow]=Sw(On,Ec,Ha,Ji,xc,yc);function _c(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 wc(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 Mw(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),g=es(l),y=ns(l),x={a:H,A:P,b:N,B:Z,c:null,d:hp,e:hp,f:Xw,g:aS,G:lS,H:qw,I:Yw,j:Zw,L:dp,m:Kw,M:Qw,p:q,q:it,Q:yp,s:xp,S:Jw,u:tS,U:eS,V:nS,w:rS,W:iS,x:null,X:null,y:sS,Y:oS,Z:cS,"%":vp},w={a:nt,A:Y,b:J,B:pt,c:null,d:pp,e:pp,f:fS,g:wS,G:TS,H:uS,I:hS,j:dS,L:mp,m:pS,M:mS,p:at,q:Ot,Q:yp,s:xp,S:gS,u:vS,U:yS,V:xS,w:bS,W:ES,x:null,X:null,y:_S,Y:SS,Z:OS,"%":vp},_={a:L,A,b:V,B:M,c:R,d:cp,e:cp,f:zw,g:lp,G:op,H:up,I:up,j:Bw,L:Fw,m:Uw,M:Hw,p:U,q:Pw,Q:jw,s:Ww,S:Vw,u:Lw,U:Dw,V:kw,w:Rw,W:Iw,x:E,X:B,y:lp,Y:op,Z:Nw,"%":Gw};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(X,tt){return function(ut){var G=[],Rt=-1,xt=0,Ht=X.length,Vt,st,Lt;for(ut instanceof Date||(ut=new Date(+ut));++Rt<Ht;)X.charCodeAt(Rt)===37&&(G.push(X.slice(xt,Rt)),(st=ap[Vt=X.charAt(++Rt)])!=null?Vt=X.charAt(++Rt):st=Vt==="e"?" ":"0",(Lt=tt[Vt])&&(Vt=Lt(ut,st)),G.push(Vt),xt=Rt+1);return G.push(X.slice(xt,Rt)),G.join("")}}function O(X,tt){return function(ut){var G=ts(1900,void 0,1),Rt=I(G,X,ut+="",0),xt,Ht;if(Rt!=ut.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?(xt=wc(ts(G.y,0,1)),Ht=xt.getUTCDay(),xt=Ht>4||Ht===0?Fa.ceil(xt):Fa(xt),xt=bc.offset(xt,(G.V-1)*7),G.y=xt.getUTCFullYear(),G.m=xt.getUTCMonth(),G.d=xt.getUTCDate()+(G.w+6)%7):(xt=_c(ts(G.y,0,1)),Ht=xt.getDay(),xt=Ht>4||Ht===0?Va.ceil(xt):Va(xt),xt=Ji.offset(xt,(G.V-1)*7),G.y=xt.getFullYear(),G.m=xt.getMonth(),G.d=xt.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),Ht="Z"in G?wc(ts(G.y,0,1)).getUTCDay():_c(ts(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(Ht+5)%7:G.w+G.U*7-(Ht+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,wc(G)):_c(G)}}function I(X,tt,ut,G){for(var Rt=0,xt=tt.length,Ht=ut.length,Vt,st;Rt<xt;){if(G>=Ht)return-1;if(Vt=tt.charCodeAt(Rt++),Vt===37){if(Vt=tt.charAt(Rt++),st=_[Vt in ap?tt.charAt(Rt++):Vt],!st||(G=st(X,ut,G))<0)return-1}else if(Vt!=ut.charCodeAt(G++))return-1}return G}function U(X,tt,ut){var G=c.exec(tt.slice(ut));return G?(X.p=u.get(G[0].toLowerCase()),ut+G[0].length):-1}function L(X,tt,ut){var G=f.exec(tt.slice(ut));return G?(X.w=p.get(G[0].toLowerCase()),ut+G[0].length):-1}function A(X,tt,ut){var G=d.exec(tt.slice(ut));return G?(X.w=h.get(G[0].toLowerCase()),ut+G[0].length):-1}function V(X,tt,ut){var G=g.exec(tt.slice(ut));return G?(X.m=y.get(G[0].toLowerCase()),ut+G[0].length):-1}function M(X,tt,ut){var G=v.exec(tt.slice(ut));return G?(X.m=m.get(G[0].toLowerCase()),ut+G[0].length):-1}function R(X,tt,ut){return I(X,t,tt,ut)}function E(X,tt,ut){return I(X,n,tt,ut)}function B(X,tt,ut){return I(X,r,tt,ut)}function H(X){return a[X.getDay()]}function P(X){return s[X.getDay()]}function N(X){return l[X.getMonth()]}function Z(X){return o[X.getMonth()]}function q(X){return i[+(X.getHours()>=12)]}function it(X){return 1+~~(X.getMonth()/3)}function nt(X){return a[X.getUTCDay()]}function Y(X){return s[X.getUTCDay()]}function J(X){return l[X.getUTCMonth()]}function pt(X){return o[X.getUTCMonth()]}function at(X){return i[+(X.getUTCHours()>=12)]}function Ot(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var tt=S(X+="",x);return tt.toString=function(){return X},tt},parse:function(X){var tt=O(X+="",!1);return tt.toString=function(){return X},tt},utcFormat:function(X){var tt=S(X+="",w);return tt.toString=function(){return X},tt},utcParse:function(X){var tt=O(X+="",!0);return tt.toString=function(){return X},tt}}}var ap={"-":"",_:" ",0:"0"},ne=/^\s*\d+/,Cw=/^%/,Aw=/[\\^$*+?|[\]().{}]/g;function wt(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 $w(e){return e.replace(Aw,"\\$&")}function es(e){return new RegExp("^(?:"+e.map($w).join("|")+")","i")}function ns(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Rw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Lw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Iw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function op(e,t,n){var r=ne.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lp(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nw(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 Pw(e,t,n){var r=ne.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Uw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cp(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Bw(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function up(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Hw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vw(e,t,n){var r=ne.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Fw(e,t,n){var r=ne.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zw(e,t,n){var r=ne.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Gw(e,t,n){var r=Cw.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function jw(e,t,n){var r=ne.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ww(e,t,n){var r=ne.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hp(e,t){return wt(e.getDate(),t,2)}function qw(e,t){return wt(e.getHours(),t,2)}function Yw(e,t){return wt(e.getHours()%12||12,t,2)}function Zw(e,t){return wt(1+Ji.count(On(e),e),t,3)}function dp(e,t){return wt(e.getMilliseconds(),t,3)}function Xw(e,t){return dp(e,t)+"000"}function Kw(e,t){return wt(e.getMonth()+1,t,2)}function Qw(e,t){return wt(e.getMinutes(),t,2)}function Jw(e,t){return wt(e.getSeconds(),t,2)}function tS(e){var t=e.getDay();return t===0?7:t}function eS(e,t){return wt(Ha.count(On(e)-1,e),t,2)}function fp(e){var t=e.getDay();return t>=4||t===0?Qr(e):Qr.ceil(e)}function nS(e,t){return e=fp(e),wt(Qr.count(On(e),e)+(On(e).getDay()===4),t,2)}function rS(e){return e.getDay()}function iS(e,t){return wt(Va.count(On(e)-1,e),t,2)}function sS(e,t){return wt(e.getFullYear()%100,t,2)}function aS(e,t){return e=fp(e),wt(e.getFullYear()%100,t,2)}function oS(e,t){return wt(e.getFullYear()%1e4,t,4)}function lS(e,t){var n=e.getDay();return e=n>=4||n===0?Qr(e):Qr.ceil(e),wt(e.getFullYear()%1e4,t,4)}function cS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+wt(t/60|0,"0",2)+wt(t%60,"0",2)}function pp(e,t){return wt(e.getUTCDate(),t,2)}function uS(e,t){return wt(e.getUTCHours(),t,2)}function hS(e,t){return wt(e.getUTCHours()%12||12,t,2)}function dS(e,t){return wt(1+bc.count(gr(e),e),t,3)}function mp(e,t){return wt(e.getUTCMilliseconds(),t,3)}function fS(e,t){return mp(e,t)+"000"}function pS(e,t){return wt(e.getUTCMonth()+1,t,2)}function mS(e,t){return wt(e.getUTCMinutes(),t,2)}function gS(e,t){return wt(e.getUTCSeconds(),t,2)}function vS(e){var t=e.getUTCDay();return t===0?7:t}function yS(e,t){return wt(sp.count(gr(e)-1,e),t,2)}function gp(e){var t=e.getUTCDay();return t>=4||t===0?Jr(e):Jr.ceil(e)}function xS(e,t){return e=gp(e),wt(Jr.count(gr(e),e)+(gr(e).getUTCDay()===4),t,2)}function bS(e){return e.getUTCDay()}function ES(e,t){return wt(Fa.count(gr(e)-1,e),t,2)}function _S(e,t){return wt(e.getUTCFullYear()%100,t,2)}function wS(e,t){return e=gp(e),wt(e.getUTCFullYear()%100,t,2)}function SS(e,t){return wt(e.getUTCFullYear()%1e4,t,4)}function TS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Jr(e):Jr.ceil(e),wt(e.getUTCFullYear()%1e4,t,4)}function OS(){return"+0000"}function vp(){return"%"}function yp(e){return+e}function xp(e){return Math.floor(+e/1e3)}var ti,bp;MS({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 MS(e){return ti=Mw(e),bp=ti.format,ti.parse,ti.utcFormat,ti.utcParse,ti}function CS(e){return new Date(e)}function AS(e){return e instanceof Date?+e:+new Date(+e)}function Ep(e,t,n,r,i,s,a,o,l,c){var u=Kf(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),v=c("%I:%M"),m=c("%I %p"),g=c("%a %d"),y=c("%b %d"),x=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?g:y:n(S)<S?x:w)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,AS)):h().map(CS)},u.ticks=function(S){var O=h();return e(O[0],O[O.length-1],S??10)},u.tickFormat=function(S,O){return O==null?_:c(O)},u.nice=function(S){var O=h();return(!S||typeof S.range!="function")&&(S=t(O[0],O[O.length-1],S??10)),S?h(Jf(O,S)):u},u.copy=function(){return dc(u,Ep(e,t,n,r,i,s,a,o,l,c))},u}function _p(){return Zr.apply(Ep(Tw,Ow,On,Ec,Ha,Ji,xc,yc,Kr,bp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function vt(e){return function(){return e}}const wp=Math.abs,ce=Math.atan2,vr=Math.cos,$S=Math.max,Sc=Math.min,cn=Math.sin,ei=Math.sqrt,ue=1e-12,rs=Math.PI,za=rs/2,Ga=2*rs;function RS(e){return e>1?0:e<-1?rs:Math.acos(e)}function Sp(e){return e>=1?za:e<=-1?-za:Math.asin(e)}function ja(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 Nl(t)}function LS(e){return e.innerRadius}function DS(e){return e.outerRadius}function kS(e){return e.startAngle}function IS(e){return e.endAngle}function NS(e){return e&&e.padAngle}function PS(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<ue))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Wa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/ei(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,g=(f+v)/2,y=p-h,x=v-f,w=y*y+x*x,_=i-s,S=h*v-p*f,O=(x<0?-1:1)*ei($S(0,_*_*w-S*S)),I=(S*x-y*O)/w,U=(-S*y-x*O)/w,L=(S*x+y*O)/w,A=(-S*y+x*O)/w,V=I-m,M=U-g,R=L-m,E=A-g;return V*V+M*M>R*R+E*E&&(I=L,U=A),{cx:I,cy:U,x01:-u,y01:-d,x11:I*(i/_-1),y11:U*(i/_-1)}}function is(){var e=LS,t=DS,n=vt(0),r=null,i=kS,s=IS,a=NS,o=null,l=ja(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-za,v=s.apply(this,arguments)-za,m=wp(v-p),g=v>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>ue))o.moveTo(0,0);else if(m>Ga-ue)o.moveTo(f*vr(p),f*cn(p)),o.arc(0,0,f,p,v,!g),h>ue&&(o.moveTo(h*vr(v),h*cn(v)),o.arc(0,0,h,v,p,g));else{var y=p,x=v,w=p,_=v,S=m,O=m,I=a.apply(this,arguments)/2,U=I>ue&&(r?+r.apply(this,arguments):ei(h*h+f*f)),L=Sc(wp(f-h)/2,+n.apply(this,arguments)),A=L,V=L,M,R;if(U>ue){var E=Sp(U/h*cn(I)),B=Sp(U/f*cn(I));(S-=E*2)>ue?(E*=g?1:-1,w+=E,_-=E):(S=0,w=_=(p+v)/2),(O-=B*2)>ue?(B*=g?1:-1,y+=B,x-=B):(O=0,y=x=(p+v)/2)}var H=f*vr(y),P=f*cn(y),N=h*vr(_),Z=h*cn(_);if(L>ue){var q=f*vr(x),it=f*cn(x),nt=h*vr(w),Y=h*cn(w),J;if(m<rs)if(J=PS(H,P,nt,Y,q,it,N,Z)){var pt=H-J[0],at=P-J[1],Ot=q-J[0],X=it-J[1],tt=1/cn(RS((pt*Ot+at*X)/(ei(pt*pt+at*at)*ei(Ot*Ot+X*X)))/2),ut=ei(J[0]*J[0]+J[1]*J[1]);A=Sc(L,(h-ut)/(tt-1)),V=Sc(L,(f-ut)/(tt+1))}else A=V=0}O>ue?V>ue?(M=Wa(nt,Y,H,P,f,V,g),R=Wa(q,it,N,Z,f,V,g),o.moveTo(M.cx+M.x01,M.cy+M.y01),V<L?o.arc(M.cx,M.cy,V,ce(M.y01,M.x01),ce(R.y01,R.x01),!g):(o.arc(M.cx,M.cy,V,ce(M.y01,M.x01),ce(M.y11,M.x11),!g),o.arc(0,0,f,ce(M.cy+M.y11,M.cx+M.x11),ce(R.cy+R.y11,R.cx+R.x11),!g),o.arc(R.cx,R.cy,V,ce(R.y11,R.x11),ce(R.y01,R.x01),!g))):(o.moveTo(H,P),o.arc(0,0,f,y,x,!g)):o.moveTo(H,P),!(h>ue)||!(S>ue)?o.lineTo(N,Z):A>ue?(M=Wa(N,Z,q,it,h,-A,g),R=Wa(H,P,nt,Y,h,-A,g),o.lineTo(M.cx+M.x01,M.cy+M.y01),A<L?o.arc(M.cx,M.cy,A,ce(M.y01,M.x01),ce(R.y01,R.x01),!g):(o.arc(M.cx,M.cy,A,ce(M.y01,M.x01),ce(M.y11,M.x11),!g),o.arc(0,0,h,ce(M.cy+M.y11,M.cx+M.x11),ce(R.cy+R.y11,R.cx+R.x11),g),o.arc(R.cx,R.cy,A,ce(R.y11,R.x11),ce(R.y01,R.x01),!g))):o.arc(0,0,h,_,w,g)}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[vr(d)*u,cn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:vt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:vt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:vt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:vt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:vt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:vt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:vt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var US=Array.prototype.slice;function qa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Tp(e){this._context=e}Tp.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 Ya(e){return new Tp(e)}function Tc(e){return e[0]}function Oc(e){return e[1]}function ss(e,t){var n=vt(!0),r=null,i=Ya,s=null,a=ja(o);e=typeof e=="function"?e:e===void 0?Tc:vt(e),t=typeof t=="function"?t:t===void 0?Oc:vt(t);function o(l){var c,u=(l=qa(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:vt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:vt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:vt(!!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 Mc(e,t,n){var r=null,i=vt(!0),s=null,a=Ya,o=null,l=ja(c);e=typeof e=="function"?e:e===void 0?Tc:vt(+e),t=typeof t=="function"?t:vt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Oc:vt(+n);function c(d){var h,f,p,v=(d=qa(d)).length,m,g=!1,y,x=new Array(v),w=new Array(v);for(s==null&&(o=a(y=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===g)if(g=!g)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(x[p],w[p]);o.lineEnd(),o.areaEnd()}g&&(x[h]=+e(m,h,d),w[h]=+t(m,h,d),o.point(r?+r(m,h,d):x[h],n?+n(m,h,d):w[h]))}if(y)return o=null,y+""||null}function u(){return ss().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:vt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:vt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:vt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:vt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:vt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:vt(+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:vt(!!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 BS(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function HS(e){return e}function VS(){var e=HS,t=BS,n=null,r=vt(0),i=vt(Ga),s=vt(0);function a(o){var l,c=(o=qa(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ga,Math.max(-Ga,i.apply(this,arguments)-v)),g,y=Math.min(Math.abs(m)/c,s.apply(this,arguments)),x=y*(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*x)/h:0;l<c;++l,v=g)u=f[l],w=p[u],g=v+(w>0?w*d:0)+x,p[u]={data:o[u],index:l,value:w,startAngle:v,endAngle:g,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:vt(+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:vt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:vt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:vt(+o),a):s},a}var FS=Mp(Ya);function Op(e){this._curve=e}Op.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 Mp(e){function t(n){return new Op(e(n))}return t._curve=e,t}function zS(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(Mp(n)):t()._curve},e}function GS(){return zS(ss().curve(FS))}class jS{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 WS(e){return new jS(e,!0)}function qS(e){return e.source}function YS(e){return e.target}function ZS(e){let t=qS,n=YS,r=Tc,i=Oc,s=null,a=null,o=ja(l);function l(){let c;const u=US.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:vt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:vt(+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 ZS(WS)}function Gn(){}function Za(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 Xa(e){this._context=e}Xa.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:Za(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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KS(e){return new Xa(e)}function Cp(e){this._context=e}Cp.prototype={areaStart:Gn,areaEnd:Gn,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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QS(e){return new Cp(e)}function Ap(e){this._context=e}Ap.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:Za(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JS(e){return new Ap(e)}function $p(e,t){this._basis=new Xa(e),this._beta=t}$p.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 tT=function e(t){function n(r){return t===1?new Xa(r):new $p(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ka(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 Cc(e,t){this._context=e,this._k=(1-t)/6}Cc.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:Ka(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:Ka(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 Cc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ac(e,t){this._context=e,this._k=(1-t)/6}Ac.prototype={areaStart:Gn,areaEnd:Gn,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:Ka(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 Ac(r,t)}return n.tension=function(r){return e(+r)},n}(0);function $c(e,t){this._context=e,this._k=(1-t)/6}$c.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:Ka(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 rT=function e(t){function n(r){return new $c(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Rc(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ue){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>ue){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 Rp(e,t){this._context=e,this._alpha=t}Rp.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:Rc(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 Rp(r,t):new Cc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Lp(e,t){this._context=e,this._alpha=t}Lp.prototype={areaStart:Gn,areaEnd:Gn,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:Rc(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 Lp(r,t):new Ac(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Dp(e,t){this._context=e,this._alpha=t}Dp.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:Rc(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 aT=function e(t){function n(r){return t?new Dp(r,t):new $c(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function kp(e){this._context=e}kp.prototype={areaStart:Gn,areaEnd:Gn,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 Ip(e){return new kp(e)}function Np(e){return e<0?-1:1}function Pp(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(Np(s)+Np(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Up(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Lc(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 Qa(e){this._context=e}Qa.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:Lc(this,this._t0,Up(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,Lc(this,Up(this,n=Pp(this,e,t)),n);break;default:Lc(this,this._t0,n=Pp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Bp(e){this._context=new Hp(e)}(Bp.prototype=Object.create(Qa.prototype)).point=function(e,t){Qa.prototype.point.call(this,t,e)};function Hp(e){this._context=e}Hp.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 oT(e){return new Qa(e)}function lT(e){return new Bp(e)}function Vp(e){this._context=e}Vp.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=Fp(e),i=Fp(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 Fp(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 cT(e){return new Vp(e)}function Ja(e,t){this._context=e,this._t=t}Ja.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 uT(e){return new Ja(e,.5)}function hT(e){return new Ja(e,0)}function dT(e){return new Ja(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 Gp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function fT(e,t){return e[t]}function pT(e){const t=[];return t.key=e,t}function Dc(){var e=vt([]),t=Gp,n=zp,r=fT;function i(s){var a=Array.from(e.apply(this,arguments),pT),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=qa(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:vt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:vt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Gp:typeof s=="function"?s:vt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??zp,i):n},i}function mT(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 kc(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)?vT(o,d=>d.test(a)):gT(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 gT(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vT(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yT(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 St(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 xT={};function to(){return xT}function cs(e,t){var n,r,i,s;const a=to(),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=St(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 bT={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"}},ET=(e,t,n)=>{let r;const i=bT[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},_T={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wT=(e,t,n,r)=>_T[e],ST={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},TT={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OT={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"]},MT={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"]},CT={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"}},AT={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"}},$T=(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"},RT={ordinalNumber:$T,era:os({values:ST,defaultWidth:"wide"}),quarter:os({values:TT,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:OT,defaultWidth:"wide"}),day:os({values:MT,defaultWidth:"wide"}),dayPeriod:os({values:CT,defaultWidth:"wide",formattingValues:AT,defaultFormattingWidth:"wide"})},LT=/^(\d+)(th|st|nd|rd)?/i,DT=/\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},IT={any:[/^b/i,/^(a|c)/i]},NT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PT={any:[/1/i,/2/i,/3/i,/4/i]},UT={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},BT={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]},HT={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},VT={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]},FT={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},zT={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}},GT={ordinalNumber:yT({matchPattern:LT,parsePattern:DT,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:kT,defaultMatchWidth:"wide",parsePatterns:IT,defaultParseWidth:"any"}),quarter:ls({matchPatterns:NT,defaultMatchWidth:"wide",parsePatterns:PT,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:UT,defaultMatchWidth:"wide",parsePatterns:BT,defaultParseWidth:"any"}),day:ls({matchPatterns:HT,defaultMatchWidth:"wide",parsePatterns:VT,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:FT,defaultMatchWidth:"any",parsePatterns:zT,defaultParseWidth:"any"})},jT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},WT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},YT={date:kc({formats:jT,defaultWidth:"full"}),time:kc({formats:WT,defaultWidth:"full"}),dateTime:kc({formats:qT,defaultWidth:"full"})},jp={code:"en-US",formatDistance:ET,formatLong:YT,formatRelative:wT,localize:RT,match:GT,options:{weekStartsOn:0,firstWeekContainsDate:1}};var ZT=typeof global=="object"&&global&&global.Object===Object&&global;const Wp=ZT;var XT=typeof self=="object"&&self&&self.Object===Object&&self,KT=Wp||XT||Function("return this")();const Ze=KT;var QT=Ze.Symbol;const Pe=QT;var qp=Object.prototype,JT=qp.hasOwnProperty,tO=qp.toString,us=Pe?Pe.toStringTag:void 0;function eO(e){var t=JT.call(e,us),n=e[us];try{e[us]=void 0;var r=!0}catch{}var i=tO.call(e);return r&&(t?e[us]=n:delete e[us]),i}var nO=Object.prototype,rO=nO.toString;function iO(e){return rO.call(e)}var sO="[object Null]",aO="[object Undefined]",Yp=Pe?Pe.toStringTag:void 0;function yr(e){return e==null?e===void 0?aO:sO:Yp&&Yp in Object(e)?eO(e):iO(e)}function un(e){return e!=null&&typeof e=="object"}var oO="[object Symbol]";function eo(e){return typeof e=="symbol"||un(e)&&yr(e)==oO}function Zp(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 lO=Array.isArray;const re=lO;var cO=1/0,Xp=Pe?Pe.prototype:void 0,Kp=Xp?Xp.toString:void 0;function Qp(e){if(typeof e=="string")return e;if(re(e))return Zp(e,Qp)+"";if(eo(e))return Kp?Kp.call(e):"";var t=e+"";return t=="0"&&1/e==-cO?"-0":t}function Ue(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ic(e){return e}var uO="[object AsyncFunction]",hO="[object Function]",dO="[object GeneratorFunction]",fO="[object Proxy]";function Nc(e){if(!Ue(e))return!1;var t=yr(e);return t==hO||t==dO||t==uO||t==fO}var pO=Ze["__core-js_shared__"];const Pc=pO;var Jp=function(){var e=/[^.]+$/.exec(Pc&&Pc.keys&&Pc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mO(e){return!!Jp&&Jp in e}var gO=Function.prototype,vO=gO.toString;function xr(e){if(e!=null){try{return vO.call(e)}catch{}try{return e+""}catch{}}return""}var yO=/[\\^$.*+?()[\]{}|]/g,xO=/^\[object .+?Constructor\]$/,bO=Function.prototype,EO=Object.prototype,_O=bO.toString,wO=EO.hasOwnProperty,SO=RegExp("^"+_O.call(wO).replace(yO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function TO(e){if(!Ue(e)||mO(e))return!1;var t=Nc(e)?SO:xO;return t.test(xr(e))}function OO(e,t){return e==null?void 0:e[t]}function br(e,t){var n=OO(e,t);return TO(n)?n:void 0}var MO=br(Ze,"WeakMap");const Uc=MO;var tm=Object.create,CO=function(){function e(){}return function(t){if(!Ue(t))return{};if(tm)return tm(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const AO=CO;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 RO(){}function em(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var LO=800,DO=16,kO=Date.now;function IO(e){var t=0,n=0;return function(){var r=kO(),i=DO-(r-n);if(n=r,i>0){if(++t>=LO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function NO(e){return function(){return e}}var PO=function(){try{var e=br(Object,"defineProperty");return e({},"",{}),e}catch{}}();const no=PO;var UO=no?function(e,t){return no(e,"toString",{configurable:!0,enumerable:!1,value:NO(t),writable:!0})}:Ic,BO=IO(UO);const HO=BO;function VO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function FO(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function zO(e){return e!==e}function GO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function jO(e,t,n){return t===t?GO(e,t,n):FO(e,zO,n)}function WO(e,t){var n=e==null?0:e.length;return!!n&&jO(e,t,0)>-1}var qO=9007199254740991,YO=/^(?:0|[1-9]\d*)$/;function Bc(e,t){var n=typeof e;return t=t??qO,!!t&&(n=="number"||n!="symbol"&&YO.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){t=="__proto__"&&no?no(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 ZO=Object.prototype,XO=ZO.hasOwnProperty;function nm(e,t,n){var r=e[t];(!(XO.call(e,t)&&hs(r,n))||n===void 0&&!(t in e))&&ro(e,t,n)}function ds(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?ro(n,o,l):nm(n,o,l)}return n}var rm=Math.max;function KO(e,t,n){return t=rm(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=rm(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 im(e,t){return HO(KO(e,t,Ic),e+"")}var QO=9007199254740991;function Hc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QO}function Er(e){return e!=null&&Hc(e.length)&&!Nc(e)}function sm(e,t,n){if(!Ue(n))return!1;var r=typeof t;return(r=="number"?Er(n)&&Bc(t,n.length):r=="string"&&t in n)?hs(n[t],e):!1}function JO(e){return im(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&&sm(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 tM=Object.prototype;function io(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||tM;return e===n}function eM(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nM="[object Arguments]";function am(e){return un(e)&&yr(e)==nM}var om=Object.prototype,rM=om.hasOwnProperty,iM=om.propertyIsEnumerable,sM=am(function(){return arguments}())?am:function(e){return un(e)&&rM.call(e,"callee")&&!iM.call(e,"callee")};const ni=sM;function aM(){return!1}var lm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,cm=lm&&typeof module=="object"&&module&&!module.nodeType&&module,oM=cm&&cm.exports===lm,um=oM?Ze.Buffer:void 0,lM=um?um.isBuffer:void 0,cM=lM||aM;const ri=cM;var uM="[object Arguments]",hM="[object Array]",dM="[object Boolean]",fM="[object Date]",pM="[object Error]",mM="[object Function]",gM="[object Map]",vM="[object Number]",yM="[object Object]",xM="[object RegExp]",bM="[object Set]",EM="[object String]",_M="[object WeakMap]",wM="[object ArrayBuffer]",SM="[object DataView]",TM="[object Float32Array]",OM="[object Float64Array]",MM="[object Int8Array]",CM="[object Int16Array]",AM="[object Int32Array]",$M="[object Uint8Array]",RM="[object Uint8ClampedArray]",LM="[object Uint16Array]",DM="[object Uint32Array]",Ut={};Ut[TM]=Ut[OM]=Ut[MM]=Ut[CM]=Ut[AM]=Ut[$M]=Ut[RM]=Ut[LM]=Ut[DM]=!0,Ut[uM]=Ut[hM]=Ut[wM]=Ut[dM]=Ut[SM]=Ut[fM]=Ut[pM]=Ut[mM]=Ut[gM]=Ut[vM]=Ut[yM]=Ut[xM]=Ut[bM]=Ut[EM]=Ut[_M]=!1;function kM(e){return un(e)&&Hc(e.length)&&!!Ut[yr(e)]}function Vc(e){return function(t){return e(t)}}var hm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,fs=hm&&typeof module=="object"&&module&&!module.nodeType&&module,IM=fs&&fs.exports===hm,Fc=IM&&Wp.process,NM=function(){try{var e=fs&&fs.require&&fs.require("util").types;return e||Fc&&Fc.binding&&Fc.binding("util")}catch{}}();const ii=NM;var dm=ii&&ii.isTypedArray,PM=dm?Vc(dm):kM;const so=PM;var UM=Object.prototype,BM=UM.hasOwnProperty;function fm(e,t){var n=re(e),r=!n&&ni(e),i=!n&&!r&&ri(e),s=!n&&!r&&!i&&so(e),a=n||r||i||s,o=a?eM(e.length,String):[],l=o.length;for(var c in e)(t||BM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Bc(c,l)))&&o.push(c);return o}function pm(e,t){return function(n){return e(t(n))}}var HM=pm(Object.keys,Object);const VM=HM;var FM=Object.prototype,zM=FM.hasOwnProperty;function mm(e){if(!io(e))return VM(e);var t=[];for(var n in Object(e))zM.call(e,n)&&n!="constructor"&&t.push(n);return t}function ps(e){return Er(e)?fm(e):mm(e)}function GM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var jM=Object.prototype,WM=jM.hasOwnProperty;function qM(e){if(!Ue(e))return GM(e);var t=io(e),n=[];for(var r in e)r=="constructor"&&(t||!WM.call(e,r))||n.push(r);return n}function ms(e){return Er(e)?fm(e,!0):qM(e)}var YM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZM=/^\w*$/;function zc(e,t){if(re(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||eo(e)?!0:ZM.test(e)||!YM.test(e)||t!=null&&e in Object(t)}var XM=br(Object,"create");const gs=XM;function KM(){this.__data__=gs?gs(null):{},this.size=0}function QM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var JM="__lodash_hash_undefined__",tC=Object.prototype,eC=tC.hasOwnProperty;function nC(e){var t=this.__data__;if(gs){var n=t[e];return n===JM?void 0:n}return eC.call(t,e)?t[e]:void 0}var rC=Object.prototype,iC=rC.hasOwnProperty;function sC(e){var t=this.__data__;return gs?t[e]!==void 0:iC.call(t,e)}var aC="__lodash_hash_undefined__";function oC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gs&&t===void 0?aC:t,this}function _r(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])}}_r.prototype.clear=KM,_r.prototype.delete=QM,_r.prototype.get=nC,_r.prototype.has=sC,_r.prototype.set=oC;function lC(){this.__data__=[],this.size=0}function ao(e,t){for(var n=e.length;n--;)if(hs(e[n][0],t))return n;return-1}var cC=Array.prototype,uC=cC.splice;function hC(e){var t=this.__data__,n=ao(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():uC.call(t,n,1),--this.size,!0}function dC(e){var t=this.__data__,n=ao(t,e);return n<0?void 0:t[n][1]}function fC(e){return ao(this.__data__,e)>-1}function pC(e,t){var n=this.__data__,r=ao(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Mn(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])}}Mn.prototype.clear=lC,Mn.prototype.delete=hC,Mn.prototype.get=dC,Mn.prototype.has=fC,Mn.prototype.set=pC;var mC=br(Ze,"Map");const vs=mC;function gC(){this.size=0,this.__data__={hash:new _r,map:new(vs||Mn),string:new _r}}function vC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function oo(e,t){var n=e.__data__;return vC(t)?n[typeof t=="string"?"string":"hash"]:n.map}function yC(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t}function xC(e){return oo(this,e).get(e)}function bC(e){return oo(this,e).has(e)}function EC(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Cn(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])}}Cn.prototype.clear=gC,Cn.prototype.delete=yC,Cn.prototype.get=xC,Cn.prototype.has=bC,Cn.prototype.set=EC;var _C="Expected a function";function Gc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(_C);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(Gc.Cache||Cn),n}Gc.Cache=Cn;var wC=500;function SC(e){var t=Gc(e,function(r){return n.size===wC&&n.clear(),r}),n=t.cache;return t}var TC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OC=/\\(\\)?/g,MC=SC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(TC,function(n,r,i,s){t.push(i?s.replace(OC,"$1"):r||n)}),t});const CC=MC;function ys(e){return e==null?"":Qp(e)}function gm(e,t){return re(e)?e:zc(e,t)?[e]:CC(ys(e))}var AC=1/0;function lo(e){if(typeof e=="string"||eo(e))return e;var t=e+"";return t=="0"&&1/e==-AC?"-0":t}function vm(e,t){t=gm(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lo(t[n++])];return n&&n==r?e:void 0}function It(e,t,n){var r=e==null?void 0:vm(e,t);return r===void 0?n:r}function jc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ym=Pe?Pe.isConcatSpreadable:void 0;function $C(e){return re(e)||ni(e)||!!(ym&&e&&e[ym])}function co(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=$C),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?co(o,t-1,n,r,i):jc(i,o):r||(i[i.length]=o)}return i}var RC=pm(Object.getPrototypeOf,Object);const Wc=RC;var LC="[object Object]",DC=Function.prototype,kC=Object.prototype,xm=DC.toString,IC=kC.hasOwnProperty,NC=xm.call(Object);function PC(e){if(!un(e)||yr(e)!=LC)return!1;var t=Wc(e);if(t===null)return!0;var n=IC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&xm.call(n)==NC}function UC(){this.__data__=new Mn,this.size=0}function BC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function HC(e){return this.__data__.get(e)}function VC(e){return this.__data__.has(e)}var FC=200;function zC(e,t){var n=this.__data__;if(n instanceof Mn){var r=n.__data__;if(!vs||r.length<FC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Cn(r)}return n.set(e,t),this.size=n.size,this}function Xe(e){var t=this.__data__=new Mn(e);this.size=t.size}Xe.prototype.clear=UC,Xe.prototype.delete=BC,Xe.prototype.get=HC,Xe.prototype.has=VC,Xe.prototype.set=zC;function GC(e,t){return e&&ds(t,ps(t),e)}function jC(e,t){return e&&ds(t,ms(t),e)}var bm=typeof Q=="object"&&Q&&!Q.nodeType&&Q,Em=bm&&typeof module=="object"&&module&&!module.nodeType&&module,WC=Em&&Em.exports===bm,_m=WC?Ze.Buffer:void 0,wm=_m?_m.allocUnsafe:void 0;function Sm(e,t){if(t)return e.slice();var n=e.length,r=wm?wm(n):new e.constructor(n);return e.copy(r),r}function qC(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 Tm(){return[]}var YC=Object.prototype,ZC=YC.propertyIsEnumerable,Om=Object.getOwnPropertySymbols,XC=Om?function(e){return e==null?[]:(e=Object(e),qC(Om(e),function(t){return ZC.call(e,t)}))}:Tm;const qc=XC;function KC(e,t){return ds(e,qc(e),t)}var QC=Object.getOwnPropertySymbols,JC=QC?function(e){for(var t=[];e;)jc(t,qc(e)),e=Wc(e);return t}:Tm;const Mm=JC;function tA(e,t){return ds(e,Mm(e),t)}function Cm(e,t,n){var r=t(e);return re(e)?r:jc(r,n(e))}function Yc(e){return Cm(e,ps,qc)}function eA(e){return Cm(e,ms,Mm)}var nA=br(Ze,"DataView");const Zc=nA;var rA=br(Ze,"Promise");const Xc=rA;var iA=br(Ze,"Set");const si=iA;var Am="[object Map]",sA="[object Object]",$m="[object Promise]",Rm="[object Set]",Lm="[object WeakMap]",Dm="[object DataView]",aA=xr(Zc),oA=xr(vs),lA=xr(Xc),cA=xr(si),uA=xr(Uc),wr=yr;(Zc&&wr(new Zc(new ArrayBuffer(1)))!=Dm||vs&&wr(new vs)!=Am||Xc&&wr(Xc.resolve())!=$m||si&&wr(new si)!=Rm||Uc&&wr(new Uc)!=Lm)&&(wr=function(e){var t=yr(e),n=t==sA?e.constructor:void 0,r=n?xr(n):"";if(r)switch(r){case aA:return Dm;case oA:return Am;case lA:return $m;case cA:return Rm;case uA:return Lm}return t});const ai=wr;var hA=Object.prototype,dA=hA.hasOwnProperty;function fA(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dA.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var pA=Ze.Uint8Array;const uo=pA;function Kc(e){var t=new e.constructor(e.byteLength);return new uo(t).set(new uo(e)),t}function mA(e,t){var n=t?Kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gA=/\w*$/;function vA(e){var t=new e.constructor(e.source,gA.exec(e));return t.lastIndex=e.lastIndex,t}var km=Pe?Pe.prototype:void 0,Im=km?km.valueOf:void 0;function yA(e){return Im?Object(Im.call(e)):{}}function Nm(e,t){var n=t?Kc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var xA="[object Boolean]",bA="[object Date]",EA="[object Map]",_A="[object Number]",wA="[object RegExp]",SA="[object Set]",TA="[object String]",OA="[object Symbol]",MA="[object ArrayBuffer]",CA="[object DataView]",AA="[object Float32Array]",$A="[object Float64Array]",RA="[object Int8Array]",LA="[object Int16Array]",DA="[object Int32Array]",kA="[object Uint8Array]",IA="[object Uint8ClampedArray]",NA="[object Uint16Array]",PA="[object Uint32Array]";function UA(e,t,n){var r=e.constructor;switch(t){case MA:return Kc(e);case xA:case bA:return new r(+e);case CA:return mA(e,n);case AA:case $A:case RA:case LA:case DA:case kA:case IA:case NA:case PA:return Nm(e,n);case EA:return new r;case _A:case TA:return new r(e);case wA:return vA(e);case SA:return new r;case OA:return yA(e)}}function Pm(e){return typeof e.constructor=="function"&&!io(e)?AO(Wc(e)):{}}var BA="[object Map]";function HA(e){return un(e)&&ai(e)==BA}var Um=ii&&ii.isMap,VA=Um?Vc(Um):HA;const FA=VA;var zA="[object Set]";function GA(e){return un(e)&&ai(e)==zA}var Bm=ii&&ii.isSet,jA=Bm?Vc(Bm):GA;const WA=jA;var qA=1,YA=2,ZA=4,Hm="[object Arguments]",XA="[object Array]",KA="[object Boolean]",QA="[object Date]",JA="[object Error]",Vm="[object Function]",t2="[object GeneratorFunction]",e2="[object Map]",n2="[object Number]",Fm="[object Object]",r2="[object RegExp]",i2="[object Set]",s2="[object String]",a2="[object Symbol]",o2="[object WeakMap]",l2="[object ArrayBuffer]",c2="[object DataView]",u2="[object Float32Array]",h2="[object Float64Array]",d2="[object Int8Array]",f2="[object Int16Array]",p2="[object Int32Array]",m2="[object Uint8Array]",g2="[object Uint8ClampedArray]",v2="[object Uint16Array]",y2="[object Uint32Array]",Nt={};Nt[Hm]=Nt[XA]=Nt[l2]=Nt[c2]=Nt[KA]=Nt[QA]=Nt[u2]=Nt[h2]=Nt[d2]=Nt[f2]=Nt[p2]=Nt[e2]=Nt[n2]=Nt[Fm]=Nt[r2]=Nt[i2]=Nt[s2]=Nt[a2]=Nt[m2]=Nt[g2]=Nt[v2]=Nt[y2]=!0,Nt[JA]=Nt[Vm]=Nt[o2]=!1;function ho(e,t,n,r,i,s){var a,o=t&qA,l=t&YA,c=t&ZA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ue(e))return e;var u=re(e);if(u){if(a=fA(e),!o)return em(e,a)}else{var d=ai(e),h=d==Vm||d==t2;if(ri(e))return Sm(e,o);if(d==Fm||d==Hm||h&&!i){if(a=l||h?{}:Pm(e),!o)return l?tA(e,jC(a,e)):KC(e,GC(a,e))}else{if(!Nt[d])return i?e:{};a=UA(e,d,o)}}s||(s=new Xe);var f=s.get(e);if(f)return f;s.set(e,a),WA(e)?e.forEach(function(m){a.add(ho(m,t,n,m,e,s))}):FA(e)&&e.forEach(function(m,g){a.set(g,ho(m,t,n,g,e,s))});var p=c?l?eA:Yc:l?ms:ps,v=u?void 0:p(e);return VO(v||e,function(m,g){v&&(g=m,m=e[g]),nm(a,g,ho(m,t,n,g,e,s))}),a}var x2=1,b2=4;function An(e){return ho(e,x2|b2)}var E2="__lodash_hash_undefined__";function _2(e){return this.__data__.set(e,E2),this}function w2(e){return this.__data__.has(e)}function xs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Cn;++t<n;)this.add(e[t])}xs.prototype.add=xs.prototype.push=_2,xs.prototype.has=w2;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 Gm(e,t){return e.has(t)}var S2=1,T2=2;function jm(e,t,n,r,i,s){var a=n&S2,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&T2?new xs: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(g,y){if(!Gm(f,y)&&(p===g||i(p,g,n,r,s)))return f.push(y)})){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 O2(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Qc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var M2=1,C2=2,A2="[object Boolean]",$2="[object Date]",R2="[object Error]",L2="[object Map]",D2="[object Number]",k2="[object RegExp]",I2="[object Set]",N2="[object String]",P2="[object Symbol]",U2="[object ArrayBuffer]",B2="[object DataView]",Wm=Pe?Pe.prototype:void 0,Jc=Wm?Wm.valueOf:void 0;function H2(e,t,n,r,i,s,a){switch(n){case B2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case U2:return!(e.byteLength!=t.byteLength||!s(new uo(e),new uo(t)));case A2:case $2:case D2:return hs(+e,+t);case R2:return e.name==t.name&&e.message==t.message;case k2:case N2:return e==t+"";case L2:var o=O2;case I2:var l=r&M2;if(o||(o=Qc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=C2,a.set(e,t);var u=jm(o(e),o(t),r,i,s,a);return a.delete(e),u;case P2:if(Jc)return Jc.call(e)==Jc.call(t)}return!1}var V2=1,F2=Object.prototype,z2=F2.hasOwnProperty;function G2(e,t,n,r,i,s){var a=n&V2,o=Yc(e),l=o.length,c=Yc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:z2.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 g=e[h],y=t[h];if(r)var x=a?r(y,g,h,t,e,s):r(g,y,h,e,t,s);if(!(x===void 0?g===y||i(g,y,n,r,s):x)){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 j2=1,qm="[object Arguments]",Ym="[object Array]",fo="[object Object]",W2=Object.prototype,Zm=W2.hasOwnProperty;function q2(e,t,n,r,i,s){var a=re(e),o=re(t),l=a?Ym:ai(e),c=o?Ym:ai(t);l=l==qm?fo:l,c=c==qm?fo:c;var u=l==fo,d=c==fo,h=l==c;if(h&&ri(e)){if(!ri(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Xe),a||so(e)?jm(e,t,n,r,i,s):H2(e,t,l,n,r,i,s);if(!(n&j2)){var f=u&&Zm.call(e,"__wrapped__"),p=d&&Zm.call(t,"__wrapped__");if(f||p){var v=f?e.value():e,m=p?t.value():t;return s||(s=new Xe),i(v,m,n,r,s)}}return h?(s||(s=new Xe),G2(e,t,n,r,i,s)):!1}function po(e,t,n,r,i){return e===t?!0:e==null||t==null||!un(e)&&!un(t)?e!==e&&t!==t:q2(e,t,n,r,po,i)}var Y2=1,Z2=2;function X2(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Xe;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?po(u,c,Y2|Z2,r,d):h))return!1}}return!0}function Xm(e){return e===e&&!Ue(e)}function K2(e){for(var t=ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xm(i)]}return t}function Km(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Q2(e){var t=K2(e);return t.length==1&&t[0][2]?Km(t[0][0],t[0][1]):function(n){return n===e||X2(n,e,t)}}function J2(e,t){return e!=null&&t in Object(e)}function t$(e,t,n){t=gm(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=lo(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&&Hc(i)&&Bc(a,i)&&(re(e)||ni(e)))}function e$(e,t){return e!=null&&t$(e,t,J2)}var n$=1,r$=2;function i$(e,t){return zc(e)&&Xm(t)?Km(lo(e),t):function(n){var r=It(n,e);return r===void 0&&r===t?e$(n,e):po(t,r,n$|r$)}}function s$(e){return function(t){return t==null?void 0:t[e]}}function a$(e){return function(t){return vm(t,e)}}function o$(e){return zc(e)?s$(lo(e)):a$(e)}function mo(e){return typeof e=="function"?e:e==null?Ic:typeof e=="object"?re(e)?i$(e[0],e[1]):Q2(e):o$(e)}function l$(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var c$=l$();const Qm=c$;function tu(e,t,n){(n!==void 0&&!hs(e[t],n)||n===void 0&&!(t in e))&&ro(e,t,n)}function eu(e){return un(e)&&Er(e)}function nu(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function u$(e){return ds(e,ms(e))}function h$(e,t,n,r,i,s,a){var o=nu(e,n),l=nu(t,n),c=a.get(l);if(c){tu(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=re(l),f=!h&&ri(l),p=!h&&!f&&so(l);u=l,h||f||p?re(o)?u=o:eu(o)?u=em(o):f?(d=!1,u=Sm(l,!0)):p?(d=!1,u=Nm(l,!0)):u=[]:PC(l)||ni(l)?(u=o,ni(o)?u=u$(o):(!Ue(o)||Nc(o))&&(u=Pm(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),tu(e,n,u)}function Jm(e,t,n,r,i){e!==t&&Qm(t,function(s,a){if(i||(i=new Xe),Ue(s))h$(e,t,a,n,Jm,r,i);else{var o=r?r(nu(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),tu(e,a,o)}},ms)}function d$(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function f$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var p$="[object Map]",m$="[object Set]",g$=Object.prototype,v$=g$.hasOwnProperty;function Ke(e){if(e==null)return!0;if(Er(e)&&(re(e)||typeof e=="string"||typeof e.splice=="function"||ri(e)||so(e)||ni(e)))return!e.length;var t=ai(e);if(t==p$||t==m$)return!e.size;if(io(e))return!mm(e).length;for(var n in e)if(v$.call(e,n))return!1;return!0}var y$=JO(function(e,t,n){Jm(e,t,n)});const lt=y$;var x$=1/0,b$=si&&1/Qc(new si([,-0]))[1]==x$?function(e){return new si(e)}:RO;const E$=b$;var _$=200;function tg(e,t,n){var r=-1,i=WO,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=d$;else if(s>=_$){var c=t?null:E$(e);if(c)return Qc(c);a=!1,i=Gm,l=new xs}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=n||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 w$=im(function(e){var t=f$(e);return eu(t)&&(t=void 0),tg(co(e,1,eu,!0),mo(t))});const S$=w$;function bs(e){return e&&e.length?tg(e):[]}const xe="cds",$n={opacity:{unselected:.05,selected:.4}},jn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},oi={duration:1e3,ease:$d,zoomLevel:3},li={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},eg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Be={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},T$={defaultBins:10},Wt={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}},Rn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},ie={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Pt={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},Qe={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},ng={minCellDividerDimension:16,chartPadding:.5},rg={default:{size:24}},O$={horizontalOffset:10},ig={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},Me={height:{[rn.GRAPH_VIEW]:32,[rn.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},M$=[{type:Jt.RADIUS,name:"Radius"},{type:Jt.AREA,name:"Poor area"},{type:Jt.AREA,name:"Satisfactory area"},{type:Jt.AREA,name:"Great area"},{type:Jt.QUARTILE,name:"Quartiles"}],ci={type:Fe.END_LINE,threshold:16,numCharacter:14},C$={enabled:!0,position:Si.BOTTOM,clickable:!0,truncation:ci,alignment:Kt.LEFT,order:null,additionalItems:[]},A$={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},$$={enabled:!0},sg={enabled:!0,showTotal:!0,truncation:ci,groupLabel:"Group"},ag={top:{visible:!0,includeZero:!0,truncation:ci},bottom:{visible:!0,includeZero:!0,truncation:ci},left:{visible:!0,includeZero:!0,truncation:ci},right:{visible:!0,includeZero:!0,truncation:ci}},go={addSpaceOnEdges:1,showDayName:!1,localeObject:jp,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"}}},R$=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),he={width:null,height:null,resizable:!0,theme:Ih.WHITE,tooltip:sg,legend:C$,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:jt.SHOW_AS_DATATABLE},...R$?[{type:jt.MAKE_FULLSCREEN}]:[],{type:jt.EXPORT_CSV},{type:jt.EXPORT_PNG},{type:jt.EXPORT_JPG}]}},og=lt({},he,{thematic:{projection:vn.geoNaturalEarth1}}),Es=lt({},he,{axes:ag,timeScale:go,grid:A$,ruler:$$,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:rn.GRAPH_VIEW}}}),Tr=lt({},Es,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(go,{addSpaceOnEdges:1})}),L$=lt({},Tr,{}),D$=lt({},Tr,{}),k$=lt({},Tr,{bars:lt({},Tr.bars,{dividerSize:1.5})}),I$=lt({},Tr,{}),ru=lt({},Es,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),N$=ru,lg=lt({},ru,{points:{radius:3,filled:!1,enabled:!0}}),cg=lt({},lg,{timeScale:lt(go,{addSpaceOnEdges:0})}),P$=cg,U$=lt({},Es,{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:Jt.RADIUS,name:"Radius"}]}}),B$=lt({},Es,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Jt.AREA,name:"Poor area"},{type:Jt.AREA,name:"Satisfactory area"},{type:Jt.AREA,name:"Great area"},{type:Jt.QUARTILE,name:"Quartiles"}]}}),H$=lt({},Tr,{bars:{dividerSize:1.5},timeScale:lt(go,{addSpaceOnEdges:0})}),V$=lt({},he,{tooltip:lt({},sg,{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"}}),ug=lt({},he,{pie:{labels:{formatter:null,enabled:!0},alignment:Kt.LEFT,sortFunction:null,valueMapsTo:"value"}}),F$=lt({},he,{legend:{enabled:!1},gauge:{type:Nr.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,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:Kt.LEFT}}),z$=lt({},ug,{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),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:Kt.LEFT}}),hg=lt({},he,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),G$=lt({},hg,{legend:{enabled:!0}}),j$=lt({},he,{radar:{axes:{angle:"key",value:"value"},alignment:Kt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),W$=lt({},Tr,{comboChartTypes:[]}),q$=lt({tree:{type:Qo.TREE}},he,{}),Y$=lt({},he,{data:lt(he.data,{groupMapsTo:"name"})}),Z$=lt({},he,li,{data:lt(he.data,{groupMapsTo:"name"})}),X$=lt({},he,{alluvial:{data:lt(he.data,{groupMapsTo:"source"}),nodeAlignment:Kt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),K$=lt({},he,{axes:ag,heatmap:{divider:{state:Oi.AUTO},colorLegend:{type:"linear"}}}),Q$=lt({},og,{choropleth:{colorLegend:{type:"linear"}}}),Dt={alluvialChart:X$,areaChart:cg,axisChart:Es,boxplotChart:I$,bubbleChart:U$,bulletChart:B$,chart:he,circlePackChart:Z$,choroplethChart:Q$,comboChart:W$,donutChart:z$,gaugeChart:F$,groupedBarChart:D$,heatmapChart:K$,histogramChart:H$,lineChart:lg,lollipopChart:N$,meterChart:hg,pieChart:ug,proportionalMeterChart:G$,radarChart:j$,scatterChart:ru,simpleBarChart:L$,stackedAreaChart:P$,stackedBarChart:k$,thematicChart:og,treeChart:q$,treemapChart:Y$,wordCloudChart:V$};function J$(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=ar(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Ft(e,t){var n;const r=An(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 su(r,t),lt(r,t)}function Ln(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 _s(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 iu(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 ws(e,t,n){if(n>e.length)return e;if(t===Fe.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Fe.FRONT_LINE)return"..."+e.substr(-n);if(t===Fe.END_LINE)return e.substr(0,n)+"..."}function su(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=M$.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=S$(a,r,"name")}}const b=(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},dg=(e,t)=>t===ee.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,pe=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=dg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Dn(e,t,n){return n===ee.VERTICAL?[e,t]:[t,e]}function Je(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const fg=6048e5,tR=864e5,pg=6e4,mg=36e5;function vo(e){return cs(e,{weekStartsOn:1})}function gg(e){const t=St(e),n=t.getFullYear(),r=Je(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=vo(r),s=Je(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=vo(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function vg(e){const t=St(e);return t.setHours(0,0,0,0),t}function yg(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function xg(e,t){const n=vg(e),r=vg(t),i=n.getTime()-yg(n),s=r.getTime()-yg(r);return Math.round((i-s)/tR)}function eR(e){const t=gg(e),n=Je(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),vo(n)}function nR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function rR(e){if(!nR(e)&&typeof e!="number")return!1;const t=St(e);return!isNaN(Number(t))}function iR(e){const t=St(e),n=Je(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function sR(e){const t=St(e);return xg(t,iR(t))+1}function aR(e){const t=St(e),n=vo(t).getTime()-eR(t).getTime();return Math.round(n/fg)+1}function bg(e,t){var n,r,i,s;const a=St(e),o=a.getFullYear(),l=to(),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=Je(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=cs(u,t),h=Je(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 oR(e,t){var n,r,i,s;const a=to(),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=bg(e,t),c=Je(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),cs(c,t)}function lR(e,t){const n=St(e),r=cs(n,t).getTime()-oR(n,t).getTime();return Math.round(r/fg)+1}function At(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Wn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return At(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):At(n+1,2)},d(e,t){return At(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 At(e.getHours()%12||12,t.length)},H(e,t){return At(e.getHours(),t.length)},m(e,t){return At(e.getMinutes(),t.length)},s(e,t){return At(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return At(i,t.length)}},ui={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cR={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 Wn.y(e,t)},Y:function(e,t,n,r){const i=bg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return At(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):At(s,t.length)},R:function(e,t){const n=gg(e);return At(n,t.length)},u:function(e,t){const n=e.getFullYear();return At(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 At(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 At(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 Wn.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 At(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=lR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):At(i,t.length)},I:function(e,t,n){const r=aR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):At(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Wn.d(e,t)},D:function(e,t,n){const r=sR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):At(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 At(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 At(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 At(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=ui.noon:r===0?i=ui.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=ui.evening:r>=12?i=ui.afternoon:r>=4?i=ui.morning:i=ui.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 Wn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Wn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Wn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Wn.s(e,t)},S:function(e,t){return Wn.S(e,t)},X:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return _g(i);case"XXXX":case"XX":return Or(i);case"XXXXX":case"XXX":default:return Or(i,":")}},x:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return _g(i);case"xxxx":case"xx":return Or(i);case"xxxxx":case"xxx":default:return Or(i,":")}},O:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Eg(i,":");case"OOOO":default:return"GMT"+Or(i,":")}},z:function(e,t,n,r){const i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Eg(i,":");case"zzzz":default:return"GMT"+Or(i,":")}},t:function(e,t,n,r){const i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return At(s,t.length)},T:function(e,t,n,r){const i=(r._originalDate||e).getTime();return At(i,t.length)}};function Eg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+At(s,2)}function _g(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):Or(e,t)}function Or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=At(Math.floor(r/60),2),s=At(r%60,2);return n+i+t+s}const wg=(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"})}},Sg=(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"})}},uR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return wg(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}}",wg(r,t)).replace("{{time}}",Sg(i,t))},hR={p:Sg,P:uR},dR=["D","DD"],fR=["YY","YYYY"];function pR(e){return dR.indexOf(e)!==-1}function mR(e){return fR.indexOf(e)!==-1}function Tg(e,t,n){if(e==="YYYY")throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${t}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="YY")throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${t}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="D")throw new RangeError(`Use \`d\` instead of \`D\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(e==="DD")throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const gR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yR=/^'([^]*?)'?$/,xR=/''/g,bR=/[a-zA-Z]/;function hi(e,t,n){var r,i,s,a,o,l,c,u;const d=to(),h=(n==null?void 0:n.locale)??d.locale??jp,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=St(e);if(!rR(v))throw new RangeError("Invalid time value");const m={firstWeekContainsDate:f,weekStartsOn:p,locale:h,_originalDate:v};return t.match(vR).map(function(g){const y=g[0];if(y==="p"||y==="P"){const x=hR[y];return x(g,h.formatLong)}return g}).join("").match(gR).map(function(g){if(g==="''")return"'";const y=g[0];if(y==="'")return ER(g);const x=cR[y];if(x)return!(n!=null&&n.useAdditionalWeekYearTokens)&&mR(g)&&Tg(g,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&pR(g)&&Tg(g,t,String(e)),x(v,g,h.localize,m);if(y.match(bR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return g}).join("")}function ER(e){const t=e.match(yR);return t?t[1].replace(xR,"'"):e}var Og=(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))(Og||{});const au=[["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 Mg(e,t,n,r,i){const s=t===0,a=Number(hi(new Date(e),"c"))===2,o=Number(hi(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||xo(e)||Ss(e,l)||qn(e);case"minute":return s||xo(e)||Ss(e,l)||qn(e);case"30minutes":return s||xo(e)||Ss(e,l)||qn(e);case"hourly":return s||xo(e)||Ss(e,l)||qn(e);case"daily":return i?s||a||qn(e):s||Ss(e,l)||qn(e);case"weekly":return s||a||qn(e);case"monthly":return s||qn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function ou(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=b(i,"timeIntervalFormats")[a],c=b(l,"primary"),u=b(l,"secondary");let d=Mg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(d=d.replace("pp","h:mm:ss.SSS a"));const h=i.localeObject;return hi(o,d,{locale:h})}function yo(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function _R(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function wR(e){const t=au.reduce((n,[,r],i)=>{const s=au[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return au[t][0]}function lu(e,t){if(Og[t])return t;if(e.length===1)return"15seconds";const n=_R(e),r=Vn(n);return wR(r)}function xo(e){const{s:t,m:n,H:r}=yo(e);return r===0&&n===0&&t===0}function Ss(e,t){const n=yo(e).M,r=yo(t).M;return n!==r}function qn(e){const{M:t,d:n,s:r,m:i,H:s}=yo(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Cg(e){return e===void 0?"":e.toISOString()}function Ag(e){const t=ze(e,r=>r.value),n=Ye().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 $g(e,t){const n=b(t,"gradient","colors"),r=!Ke(n);let i=b(t,"pairing","option");const s=Ag(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 fc().domain(s).range(o)}var ft=(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))(ft||{});function SR(e,t){return e&&Qm(e,t,ps)}function TR(e,t){return function(n,r){if(n==null)return n;if(!Er(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var OR=TR(SR);const cu=OR;function MR(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 CR(e,t,n,r){return cu(e,function(i,s,a){t(r,i,n(i),a)}),r}function AR(e,t){return function(n,r){var i=re(n)?MR:CR,s=t?t():{};return i(n,e,mo(r),s)}}function $R(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 RR=Object.prototype,LR=RR.hasOwnProperty,DR=AR(function(e,t,n){LR.call(e,n)?e[n].push(t):ro(e,n,[t])});const kR=DR;function IR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}let hn=class{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),i=b(r,"tabularRepModal","tableHeadingFormatter"),s=b(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:a}=this.services,o=a==null?void 0:a.getDomainAxisScaleType();let l;return o===et.TIME&&(l=c=>hi(c,"MMM d, yyyy")),[typeof i=="function"?i(t):t,...typeof s=="function"?s(n):n.map(c=>(l&&(c[1]=l(c[1])),c))]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=b(n,"data"),a=b(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}=Wt.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(An(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Wt.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 kR(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=T$.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 Dc().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=bs(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Cg(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?Cg(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=$R(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?Dc().offset(mT):Dc()).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();su(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}=Wt.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=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=b(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=b(s,"label");if(c===null){const d=b(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=>IR(o)).join("")}"`)).map(s=>s.join(",")).join(`
2
+ `),n=this.getOptions();let r="myChart";const i=b(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}=Wt.items.status,s=this.getOptions(),a=bs(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=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=eg.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=Ua().range(o).domain(this.allDataGroups)}},Mr=class extends hn{constructor(t){super(t),this.axisFlavor=Ws.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:b(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(),l=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],c=t.map(u=>[u[r],u[i.identifier]===null?"&ndash;":u[i.identifier],u[s.identifier]===null||isNaN(u[s.identifier])?"&ndash;":u[s.identifier].toLocaleString(),...a?[u[a.identifier]===null?"&ndash;":u[a.identifier]]:[],...o?[u[o.identifier]===null||isNaN(u[o.identifier])?"&ndash;":u[o.identifier]]:[]]);return super.formatTable({headers:l,cells:c})}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(An(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=bs(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=>{b(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},NR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();t.sort((i,s)=>i.source.localeCompare(s.source));const n=["Source","Target","Value"],r=[...t.map(i=>[i.source,i.target,i.value])];return super.formatTable({headers:n,cells:r})}},PR=class extends Mr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:sl(t,.25),q_50:sl(t,.5),q_75:sl(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(x=>x[o]).sort(rr),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 x of l)x<f||x>p?v.push(x):m.push(x);c.outliers=v;const g=Vn(m),y=sr(m);c.whiskers={min:g||Vn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||sr([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(),i=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],s=[...r.map(a=>{let o=b(a,"outliers");return(o===null||o.length===0)&&(o=["&ndash;"]),[a[n],b(a,"whiskers","min")!==null?b(a,"whiskers","min").toLocaleString():"&ndash;",b(a,"quartiles","q_25")!==null?b(a,"quartiles","q_25").toLocaleString():"&ndash;",b(a,"quartiles","q_50")!==null?b(a,"quartiles","q_50").toLocaleString():"&ndash;",b(a,"quartiles","q_75")!==null?b(a,"quartiles","q_75").toLocaleString():"&ndash;",b(a,"whiskers","max")!==null?b(a,"whiskers","max").toLocaleString():"&ndash;",b(a,"quartiles","q_75")!==null&&b(a,"quartiles","q_25")!==null?(b(a,"quartiles","q_75")-b(a,"quartiles","q_25")).toLocaleString():"&ndash;",o.map(l=>l.toLocaleString()).join(",")]})];return super.formatTable({headers:i,cells:s})}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const r=eg.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Ua().range(i).domain(this.allDataGroups)}},UR=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(),s=b(n,"bullet","performanceAreaTitles"),a=["Title","Group","Value","Target","Percentage","Performance"],o=[...t.map(l=>[l.title,l[r],l.value===null?"&ndash;":l.value,b(l,"marker")===null?"&ndash;":l.marker,b(l,"marker")===null?"&ndash;":`${Math.floor(l[i]/l.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(l)]])];return super.formatTable({headers:a,cells:o})}},BR=class extends hn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ke(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ke(n)&&!Ke(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(),n=["Country ID","Country Name","Value"],r=[...t.map(i=>[i.id===null?"&ndash;":i.id,i.name,i.value])];return super.formatTable({headers:n,cells:r})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=$g(this.getDisplayData(),t)}},HR=class extends hn{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));su(n,r);const i=this.getHierarchyLevel(),s=b(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&&b(n,0,"children")?b(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}),b(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Jt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent","Value"],r=[];return t.forEach(i=>{let s=i.value?i.value:0;i.children&&(s+=this.getChildrenDatums(i.children,i.name,r,0)),r.push(["&ndash;",i.name,s])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}},VR=class extends hn{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,s=["Group","Value"],a=[...t.map(o=>[o[r],o[i]===null?"&ndash;":o[i].toLocaleString()])];return super.formatTable({headers:s,cells:a})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},FR=class extends hn{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,i=["Group","Value"],s=[...t.map(a=>[a[r],a.value===null?"&ndash;":a.value.toLocaleString()])];return super.formatTable({headers:i,cells:s})}},zR=class extends Mr{constructor(t){super(t),this.axisFlavor=Ws.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==et.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==et.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==et.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==et.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=ze(this.getDisplayData(),r=>r.value),n=Ye().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(Ke(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(Ke(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(Ke(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]=An(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(An(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ke(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(),i=[n.label,r.label,"Value"],s=[...t.map(a=>[a[n.identifier]===null?"&ndash;":a[n.identifier],a[r.identifier]===null?"&ndash;":a[r.identifier].toLocaleString(),a.value])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!Ke(n);let i=b(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=fc().domain(s).range(o);const l=b(this.getOptions(),"color");this._colorScale=$g(this.getDisplayData(),l)}},GR=class extends Mr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData(),i=[It(t,"bins.rangeLabel")||"Range",...r.map(a=>It(a,`0.${n}`))],s=[...It(r,0).map((a,o)=>[`${It(a,"data.x0")} – ${It(a,"data.x1")}`,...r.map(l=>It(l[o],`data.${It(l[o],n)}`))])];return super.formatTable({headers:i,cells:s})}},jR=class extends hn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,s=b(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=b(n,"meter","proportional");let a=[],o=[],l;if(s===null){l=100;const c=t[0];a=["Group","Value",...i?["Status"]:[]],o=[[c[r],c.value,...i?[i]:[]]]}else l=b(s,"total")||this.getMaximumDomain(t),a=["Group","Value","Percentage of total"],o=[...t.map(u=>[u[r],u.value,(u.value/l*100).toFixed(2)+" %"])];return super.formatTable({headers:a,cells:o})}},WR=class extends Mr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),s=b(n,"0","data").map(l=>l[r]),a=["Group",...s],o=[...n.map(l=>[l.name,...s.map((c,u)=>b(l,"data",u,i)!==null?b(l,"data",u,i).toLocaleString():"&ndash;")])];return super.formatTable({headers:a,cells:o})}},qR=class extends hn{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])})}},YR=class extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Group","Value"],r=[];return t.forEach(i=>{Array.isArray(i.children)?i.children.forEach(s=>{r.push([s.name,i.name,s.value])}):b(i.name)!==null&&b(i.value)&&r.push(["–",i.name,i.value])}),super.formatTable({headers:n,cells:r})}},ZR=class extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,a=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],o=[...t.map(l=>[l[i],l[s],l[r]])];return super.formatTable({headers:a,cells:o})}};var XR=/\s/;function KR(e){for(var t=e.length;t--&&XR.test(e.charAt(t)););return t}var QR=/^\s+/;function JR(e){return e&&e.slice(0,KR(e)+1).replace(QR,"")}var Rg=NaN,tL=/^[-+]0x[0-9a-f]+$/i,eL=/^0b[01]+$/i,nL=/^0o[0-7]+$/i,rL=parseInt;function Ts(e){if(typeof e=="number")return e;if(eo(e))return Rg;if(Ue(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ue(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=JR(e);var n=eL.test(e);return n||nL.test(e)?rL(e.slice(2),n?2:8):tL.test(e)?Rg:+e}var iL=function(){return Ze.Date.now()};const uu=iL;var sL="Expected a function",aL=Math.max,oL=Math.min;function bo(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(sL);t=Ts(t)||0,Ue(n)&&(u=!!n.leading,d="maxWait"in n,s=d?aL(Ts(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(S){var O=r,I=i;return r=i=void 0,c=S,a=e.apply(I,O),a}function p(S){return c=S,o=setTimeout(g,t),u?f(S):a}function v(S){var O=S-l,I=S-c,U=t-O;return d?oL(U,s-I):U}function m(S){var O=S-l,I=S-c;return l===void 0||O>=t||O<0||d&&I>=s}function g(){var S=uu();if(m(S))return y(S);o=setTimeout(g,v(S))}function y(S){return o=void 0,h&&r?f(S):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function w(){return o===void 0?a:y(uu())}function _(){var S=uu(),O=m(S);if(r=arguments,i=this,l=S,O){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(g,t),f(l)}return o===void 0&&(o=setTimeout(g,t)),a}return _.cancel=x,_.flush=w,_}function lL(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 cL=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function kn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Eo(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function uL(e){const t=Eo(e,"border-left-width"),n=Eo(e,"border-right-width");return e.clientWidth+t+n}function hL(e){const t=Eo(e,"border-top-width"),n=Eo(e,"border-bottom-width");return e.clientHeight+t+n}function Lg(e,t={}){const n=t.width||uL(e),r=t.height||hL(e);return{width:n,height:r}}function dL(){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 Ce=16384;function fL(e){(e.width>Ce||e.height>Ce)&&(e.width>Ce&&e.height>Ce?e.width>e.height?(e.height*=Ce/e.width,e.width=Ce):(e.width*=Ce/e.height,e.height=Ce):e.width>Ce?(e.height*=Ce/e.width,e.width=Ce):(e.width*=Ce/e.height,e.height=Ce))}function _o(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 pL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function mL(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),pL(i)}const be=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||be(n,t)};function gL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function vL(e){return kn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function yL(e,t,n){const r=`.${e}:${t}`,i=n.cssText?gL(n):vL(n);return document.createTextNode(`${r}{${i}}`)}function Dg(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=cL();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(yL(s,n,r)),t.appendChild(a)}function xL(e,t){Dg(e,t,":before"),Dg(e,t,":after")}const kg="application/font-woff",Ig="image/jpeg",bL={woff:kg,woff2:kg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ig,jpeg:Ig,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function EL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function hu(e){const t=EL(e).toLowerCase();return bL[t]||""}function _L(e){return e.split(/,/)[1]}function du(e){return e.search(/^(data:)/)!==-1}function Ng(e,t){return`data:${t};base64,${e}`}async function Pg(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 wL(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 pu(e,t,n){const r=wL(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 Pg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),_L(o)));i=Ng(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 SL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_o(t)}async function TL(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 _o(o)}const n=e.poster,r=hu(n),i=await pu(n,r,t);return _o(i)}async function OL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await wo(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function ML(e,t){return be(e,HTMLCanvasElement)?SL(e):be(e,HTMLVideoElement)?TL(e,t):be(e,HTMLIFrameElement)?OL(e):e.cloneNode(!1)}const CL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function AL(e,t,n){var r,i;let s=[];return CL(e)&&e.assignedNodes?s=kn(e.assignedNodes()):be(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=kn(e.contentDocument.body.childNodes):s=kn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||be(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>wo(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function $L(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):kn(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`),be(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 RL(e,t){be(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),be(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function LL(e,t){if(be(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function DL(e,t){return be(t,Element)&&($L(e,t),xL(e,t),RL(e,t),LL(e,t)),t}async function kL(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 wo(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 wo(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>ML(r,t)).then(r=>AL(e,r,t)).then(r=>DL(e,r)).then(r=>kL(r,t))}const Ug=/url\((['"]?)([^'"]+?)\1\)/g,IL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,NL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function PL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function UL(e){const t=[];return e.replace(Ug,(n,r,i)=>(t.push(i),n)),t.filter(n=>!du(n))}async function BL(e,t,n,r,i){try{const s=n?lL(t,n):t,a=hu(t);let o;if(i){const l=await i(s);o=Ng(l,a)}else o=await pu(s,a,r);return e.replace(PL(t),`$1${o}$3`)}catch{}return e}function HL(e,{preferredFontFormat:t}){return t?e.replace(NL,n=>{for(;;){const[r,,i]=IL.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Bg(e){return e.search(Ug)!==-1}async function Hg(e,t,n){if(!Bg(e))return e;const r=HL(e,n);return UL(r).reduce((i,s)=>i.then(a=>BL(a,s,t,n)),Promise.resolve(r))}async function So(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Hg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function VL(e,t){await So("background",e,t)||await So("background-image",e,t),await So("mask",e,t)||await So("mask-image",e,t)}async function FL(e,t){const n=be(e,HTMLImageElement);if(!(n&&!du(e.src))&&!(be(e,SVGImageElement)&&!du(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await pu(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 zL(e,t){const n=kn(e.childNodes).map(r=>Vg(r,t));await Promise.all(n).then(()=>e)}async function Vg(e,t){be(e,Element)&&(await VL(e,t),await FL(e,t),await zL(e,t))}function GL(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 Fg={};async function zg(e){let t=Fg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Fg[e]=t,t}async function Gg(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),Pg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function jg(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 jL(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{kn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=zg(l).then(u=>Gg(u,t)).then(u=>jg(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=>Gg(o,t)).then(o=>jg(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{kn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function WL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Bg(t.style.getPropertyValue("src")))}async function qL(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=kn(e.ownerDocument.styleSheets),r=await jL(n,t);return WL(r)}async function YL(e,t){const n=await qL(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Hg(r.cssText,i,t)}))).join(`
3
+ `)}async function ZL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await YL(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 XL(e,t={}){const{width:n,height:r}=Lg(e,t),i=await wo(e,t,!0);return await ZL(i,t),await Vg(i,t),GL(i,t),await mL(i,n,r)}async function Wg(e,t={}){const{width:n,height:r}=Lg(e,t),i=await XL(e,t),s=await _o(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||dL(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||fL(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 KL(e,t={}){return(await Wg(e,t)).toDataURL()}async function QL(e,t={}){return(await Wg(e,t)).toDataURL("image/jpeg",t.quality||1)}class In{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const JL="DONT_STYLE_ME_css_styles_verifier";let k=class uh extends In{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:b(t.node(),"width","baseVal","value"),height:b(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}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=b(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${xe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",JL),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(`${xe}--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),QL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=b(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),KL(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=b(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)})}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}=uh.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(uh.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=bo(()=>{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)}},mu=class F0 extends In{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:F0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function qg(e){const t=tD(Yg(e),360);return Yn(t,[0,10])||Yn(t,[350,0])?{textAnchor:mn.START,dominantBaseline:gn.MIDDLE}:Yn(t,[10,80])?{textAnchor:mn.START,dominantBaseline:gn.HANGING}:Yn(t,[80,100])?{textAnchor:mn.MIDDLE,dominantBaseline:gn.HANGING}:Yn(t,[100,170])?{textAnchor:mn.END,dominantBaseline:gn.HANGING}:Yn(t,[170,190])?{textAnchor:mn.END,dominantBaseline:gn.MIDDLE}:Yn(t,[190,260])?{textAnchor:mn.END,dominantBaseline:gn.BASELINE}:Yn(t,[260,280])?{textAnchor:mn.MIDDLE,dominantBaseline:gn.BASELINE}:{textAnchor:mn.START,dominantBaseline:gn.BASELINE}}function tD(e,t){return(e%t+t)%t}function Yn(e,[t,n]){return e>=t&&e<=n}function Yg(e){return e*(180/Math.PI)}function Yt(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 eD(e,t){return t*Math.sin(e-Math.PI/2)}function Zg(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 nD(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 rD(e){return e.depth}function iD(e,t){return t-1-e.height}function Xg(e,t){return e.sourceLinks.length?e.depth:t-1}function To(e){return function(){return e}}function Kg(e,t){return Oo(e.source,t.source)||e.index-t.index}function Qg(e,t){return Oo(e.target,t.target)||e.index-t.index}function Oo(e,t){return e.y0-t.y0}function vu(e){return e.value}function sD(e){return e.index}function aD(e){return e.nodes}function oD(e){return e.links}function Jg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function tv({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 lD(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=sD,l=Xg,c,u,d=aD,h=oD,f=6;function p(){const E={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(E),m(E),g(E),y(E),_(E),tv(E),E}p.update=function(E){return tv(E),E},p.nodeId=function(E){return arguments.length?(o=typeof E=="function"?E:To(E),p):o},p.nodeAlign=function(E){return arguments.length?(l=typeof E=="function"?E:To(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:To(E),p):d},p.links=function(E){return arguments.length?(h=typeof E=="function"?E:To(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:B}){for(const[P,N]of E.entries())N.index=P,N.sourceLinks=[],N.targetLinks=[];const H=new Map(E.map((P,N)=>[o(P,N,E),P]));for(const[P,N]of B.entries()){N.index=P;let{source:Z,target:q}=N;typeof Z!="object"&&(Z=N.source=Jg(H,Z)),typeof q!="object"&&(q=N.target=Jg(H,q)),Z.sourceLinks.push(N),q.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:P,targetLinks:N}of E)P.sort(u),N.sort(u)}function m({nodes:E}){for(const B of E)B.value=B.fixedValue===void 0?Math.max(gu(B.sourceLinks,vu),gu(B.targetLinks,vu)):B.fixedValue}function g({nodes:E}){const B=E.length;let H=new Set(E),P=new Set,N=0;for(;H.size;){for(const Z of H){Z.depth=N;for(const{target:q}of Z.sourceLinks)P.add(q)}if(++N>B)throw new Error("circular link");H=P,P=new Set}}function y({nodes:E}){const B=E.length;let H=new Set(E),P=new Set,N=0;for(;H.size;){for(const Z of H){Z.height=N;for(const{source:q}of Z.targetLinks)P.add(q)}if(++N>B)throw new Error("circular link");H=P,P=new Set}}function x({nodes:E}){const B=Zg(E,N=>N.depth)+1,H=(n-e-i)/(B-1),P=new Array(B);for(const N of E){const Z=Math.max(0,Math.min(B-1,Math.floor(l.call(null,N,B))));N.layer=Z,N.x0=e+Z*H,N.x1=N.x0+i,P[Z]?P[Z].push(N):P[Z]=[N]}if(c)for(const N of P)N.sort(c);return P}function w(E){const B=nD(E,H=>(r-t-(H.length-1)*a)/gu(H,vu));for(const H of E){let P=t;for(const N of H){N.y0=P,N.y1=P+N.value*B,P=N.y1+a;for(const Z of N.sourceLinks)Z.width=Z.value*B}P=(r-P+a)/(H.length+1);for(let N=0;N<H.length;++N){const Z=H[N];Z.y0+=P*(N+1),Z.y1+=P*(N+1)}V(H)}}function _(E){const B=x(E);a=Math.min(s,(r-t)/(Zg(B,H=>H.length)-1)),w(B);for(let H=0;H<f;++H){const P=Math.pow(.99,H),N=Math.max(1-P,(H+1)/f);O(B,P,N),S(B,P,N)}}function S(E,B,H){for(let P=1,N=E.length;P<N;++P){const Z=E[P];for(const q of Z){let it=0,nt=0;for(const{source:J,value:pt}of q.targetLinks){let at=pt*(q.layer-J.layer);it+=M(J,q)*at,nt+=at}if(!(nt>0))continue;let Y=(it/nt-q.y0)*B;q.y0+=Y,q.y1+=Y,A(q)}c===void 0&&Z.sort(Oo),I(Z,H)}}function O(E,B,H){for(let P=E.length,N=P-2;N>=0;--N){const Z=E[N];for(const q of Z){let it=0,nt=0;for(const{target:J,value:pt}of q.sourceLinks){let at=pt*(J.layer-q.layer);it+=R(q,J)*at,nt+=at}if(!(nt>0))continue;let Y=(it/nt-q.y0)*B;q.y0+=Y,q.y1+=Y,A(q)}c===void 0&&Z.sort(Oo),I(Z,H)}}function I(E,B){const H=E.length>>1,P=E[H];L(E,P.y0-a,H-1,B),U(E,P.y1+a,H+1,B),L(E,r,E.length-1,B),U(E,t,0,B)}function U(E,B,H,P){for(;H<E.length;++H){const N=E[H],Z=(B-N.y0)*P;Z>1e-6&&(N.y0+=Z,N.y1+=Z),B=N.y1+a}}function L(E,B,H,P){for(;H>=0;--H){const N=E[H],Z=(N.y1-B)*P;Z>1e-6&&(N.y0-=Z,N.y1-=Z),B=N.y0-a}}function A({sourceLinks:E,targetLinks:B}){if(u===void 0){for(const{source:{sourceLinks:H}}of B)H.sort(Qg);for(const{target:{targetLinks:H}}of E)H.sort(Kg)}}function V(E){if(u===void 0)for(const{sourceLinks:B,targetLinks:H}of E)B.sort(Qg),H.sort(Kg)}function M(E,B){let H=E.y0-(E.sourceLinks.length-1)*a/2;for(const{target:P,width:N}of E.sourceLinks){if(P===B)break;H+=N+a}for(const{source:P,width:N}of B.targetLinks){if(P===E)break;H-=N}return H}function R(E,B){let H=B.y0-(B.targetLinks.length-1)*a/2;for(const{source:P,width:N}of B.targetLinks){if(P===E)break;H+=N+a}for(const{target:P,width:N}of E.sourceLinks){if(P===B)break;H-=N}return H}return p}var yu=Math.PI,xu=2*yu,Cr=1e-6,cD=xu-Cr;function bu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ev(){return new bu}bu.prototype=ev.prototype={constructor:bu,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),g=Math.sqrt(d),y=i*Math.tan((yu-Math.acos((p+d-v)/(2*m*g)))/2),x=y/g,w=y/m;Math.abs(x-1)>Cr&&(this._+="L"+(e+x*c)+","+(t+x*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%xu+xu),d>cD?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>=yu)+","+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 nv(e){return function(){return e}}function uD(e){return e[0]}function hD(e){return e[1]}var dD=Array.prototype.slice;function fD(e){return e.source}function pD(e){return e.target}function mD(e){var t=fD,n=pD,r=uD,i=hD,s=null;function a(){var o,l=dD.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=ev()),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:nv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:nv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function gD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function vD(){return mD(gD)}function yD(e){return[e.source.x1,e.y0]}function xD(e){return[e.target.x0,e.y1]}function bD(){return vD().source(yD).target(xD)}function rv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ED(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 _D={value:function(){}};function iv(){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 Mo(n)}function Mo(e){this._=e}function wD(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}})}Mo.prototype=iv.prototype={constructor:Mo,on:function(e,t){var n=this._,r=wD(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=SD(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]=sv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=sv(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 Mo(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 SD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function sv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=_D,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const TD=ED(Object.freeze(Object.defineProperty({__proto__:null,dispatch:iv},Symbol.toStringTag,{value:"Module"}))).dispatch,Eu=Math.PI/180,OD={archimedean:ov,rectangular:PD},Os=64,Co=2048;var MD=function(){var e=[256,256],t=CD,n=AD,r=$D,i=av,s=av,a=RD,o=LD,l=ov,c=[],u=1/0,d=TD("word","end"),h=null,f=Math.random,p={},v=BD;p.canvas=function(y){return arguments.length?(v=Zn(y),p):v},p.start=function(){var y=m(v()),x=UD((e[0]>>5)*e[1]),w=null,_=c.length,S=-1,O=[],I=c.map(function(L,A){return L.text=t.call(this,L,A),L.font=n.call(this,L,A),L.style=i.call(this,L,A),L.weight=s.call(this,L,A),L.rotate=a.call(this,L,A),L.size=~~r.call(this,L,A),L.padding=o.call(this,L,A),L}).sort(function(L,A){return A.size-L.size});return h&&clearInterval(h),h=setInterval(U,0),U(),p;function U(){for(var L=Date.now();Date.now()-L<u&&++S<_&&h;){var A=I[S];A.x=e[0]*(f()+.5)>>1,A.y=e[1]*(f()+.5)>>1,DD(y,A,I,S),A.hasText&&g(x,A,w)&&(O.push(A),d.call("word",p,A),w?ID(w,A):w=[{x:A.x+A.x0,y:A.y+A.y0},{x:A.x+A.x1,y:A.y+A.y1}],A.x-=e[0]>>1,A.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,O,w))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function m(y){const x=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const w=Math.sqrt(x.getImageData(0,0,1,1).data.length>>2);return y.width=(Os<<5)/w,y.height=Co/w,x.fillStyle=x.strokeStyle="red",{context:x,ratio:w}}function g(y,x,w){e[0],e[1];for(var _=x.x,S=x.y,O=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),U=f()<.5?1:-1,L=-U,A,V,M;(A=I(L+=U))&&(V=~~A[0],M=~~A[1],!(Math.min(Math.abs(V),Math.abs(M))>=O));)if(x.x=_+V,x.y=S+M,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!w||ND(x,w))&&!kD(x,y,e[0])){for(var R=x.sprite,E=x.width>>5,B=e[0]>>5,H=x.x-(E<<4),P=H&127,N=32-P,Z=x.y1-x.y0,q=(x.y+x.y0)*B+(H>>5),it,nt=0;nt<Z;nt++){it=0;for(var Y=0;Y<=E;Y++)y[q+Y]|=it<<N|(Y<E?(it=R[nt*E+Y])>>>P:0);q+=B}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=Zn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=Zn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=Zn(y),p):s},p.rotate=function(y){return arguments.length?(a=Zn(y),p):a},p.text=function(y){return arguments.length?(t=Zn(y),p):t},p.spiral=function(y){return arguments.length?(l=OD[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=Zn(y),p):r},p.padding=function(y){return arguments.length?(o=Zn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function CD(e){return e.text}function AD(){return"serif"}function av(){return"normal"}function $D(e){return Math.sqrt(e.value)}function RD(){return(~~(random()*6)-3)*30}function LD(){return 1}function DD(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Os<<5)/s,Co/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 A=i.measureText(t.text),V=-Math.floor(A.width/2);let M=(A.width+1)*s,R=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Eu),d=Math.cos(t.rotate*Eu),h=M*d,f=M*u,p=R*d,v=R*u;M=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,R=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else M=M+31>>5<<5;if(R>l&&(l=R),a+M>=Os<<5&&(a=0,o+=l,l=0),o+R>=Co)break;i.translate((a+(M>>1))/s,(o+(R>>1))/s),t.rotate&&i.rotate(t.rotate*Eu),i.fillText(t.text,V,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,V,0)),i.restore(),t.width=M,t.height=R,t.xoff=a,t.yoff=o,t.x1=M>>1,t.y1=R>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=M}for(var m=i.getImageData(0,0,(Os<<5)/s,Co/s).data,g=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,x=y>>5,w=t.y1-t.y0,_=0;_<w*x;_++)g[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,O=-1,I=0;I<w;I++){for(var _=0;_<y;_++){var U=x*I+(_>>5),L=m[(o+I)*(Os<<5)+(a+_)<<2]?1<<31-_%32:0;g[U]|=L,S|=L}S?O=I:(t.y0++,w--,I--,o++)}t.y1=t.y0+O,t.sprite=g.slice(0,(t.y1-t.y0)*x)}}}function kD(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 ID(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 ND(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 ov(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function PD(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 UD(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function BD(){return document.createElement("canvas")}function Zn(e){return typeof e=="function"?e:function(){return e}}const HD=rv(MD);function VD(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function FD(e){return function(t){return e==null?void 0:e[t]}}var zD={À:"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"},GD=FD(zD);const jD=GD;var WD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qD="\\u0300-\\u036f",YD="\\ufe20-\\ufe2f",ZD="\\u20d0-\\u20ff",XD=qD+YD+ZD,KD="["+XD+"]",QD=RegExp(KD,"g");function JD(e){return e=ys(e),e&&e.replace(WD,jD).replace(QD,"")}var tk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ek(e){return e.match(tk)||[]}var nk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function rk(e){return nk.test(e)}var lv="\\ud800-\\udfff",ik="\\u0300-\\u036f",sk="\\ufe20-\\ufe2f",ak="\\u20d0-\\u20ff",ok=ik+sk+ak,cv="\\u2700-\\u27bf",uv="a-z\\xdf-\\xf6\\xf8-\\xff",lk="\\xac\\xb1\\xd7\\xf7",ck="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uk="\\u2000-\\u206f",hk=" \\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",hv="A-Z\\xc0-\\xd6\\xd8-\\xde",dk="\\ufe0e\\ufe0f",dv=lk+ck+uk+hk,fv="['’]",pv="["+dv+"]",fk="["+ok+"]",mv="\\d+",pk="["+cv+"]",gv="["+uv+"]",vv="[^"+lv+dv+mv+cv+uv+hv+"]",mk="\\ud83c[\\udffb-\\udfff]",gk="(?:"+fk+"|"+mk+")",vk="[^"+lv+"]",yv="(?:\\ud83c[\\udde6-\\uddff]){2}",xv="[\\ud800-\\udbff][\\udc00-\\udfff]",di="["+hv+"]",yk="\\u200d",bv="(?:"+gv+"|"+vv+")",xk="(?:"+di+"|"+vv+")",Ev="(?:"+fv+"(?:d|ll|m|re|s|t|ve))?",_v="(?:"+fv+"(?:D|LL|M|RE|S|T|VE))?",wv=gk+"?",Sv="["+dk+"]?",bk="(?:"+yk+"(?:"+[vk,yv,xv].join("|")+")"+Sv+wv+")*",Ek="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_k="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wk=Sv+wv+bk,Sk="(?:"+[pk,yv,xv].join("|")+")"+wk,Tk=RegExp([di+"?"+gv+"+"+Ev+"(?="+[pv,di,"$"].join("|")+")",xk+"+"+_v+"(?="+[pv,di+bv,"$"].join("|")+")",di+"?"+bv+"+"+Ev,di+"+"+_v,_k,Ek,mv,Sk].join("|"),"g");function Ok(e){return e.match(Tk)||[]}function Mk(e,t,n){return e=ys(e),t=n?void 0:t,t===void 0?rk(e)?Ok(e):ek(e):e.match(t)||[]}var Ck="['’]",Ak=RegExp(Ck,"g");function Tv(e){return function(t){return VD(Mk(JD(t).replace(Ak,"")),e,"")}}function $k(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Ov(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ts(n),n=n===n?n:0),t!==void 0&&(t=Ts(t),t=t===t?t:0),$k(Ts(e),t,n)}function Rk(e,t){var n=-1,r=Er(e)?Array(e.length):[];return cu(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function Lk(e,t){var n=re(e)?Zp:Rk;return n(e,mo(t))}var Dk=1/0;function kk(e,t){return co(Lk(e,t),Dk)}function Mv(e,t){return po(e,t)}var Ik=Tv(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const fi=Ik;function Nk(e,t){var n;return cu(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function Pk(e,t,n){var r=re(e)?zm:Nk;return n&&sm(e,t,n)&&(t=void 0),r(e,mo(t))}let Et=class{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=b(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=b(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${xe}--${i}--${this.type}`,!0),r&&r.classed(`${xe}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${xe}--${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.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:Cv,setPrototypeOf:Av,isFrozen:Uk,getPrototypeOf:Bk,getOwnPropertyDescriptor:$v}=Object;let{freeze:me,seal:tn,create:Rv}=Object,{apply:_u,construct:wu}=typeof Reflect<"u"&&Reflect;me||(me=function(e){return e}),tn||(tn=function(e){return e}),_u||(_u=function(e,t,n){return e.apply(t,n)}),wu||(wu=function(e,t){return new e(...t)});const Ao=He(Array.prototype.forEach),Lv=He(Array.prototype.pop),Ms=He(Array.prototype.push),$o=He(String.prototype.toLowerCase),Su=He(String.prototype.toString),Hk=He(String.prototype.match),Cs=He(String.prototype.replace),Vk=He(String.prototype.indexOf),Fk=He(String.prototype.trim),Ae=He(RegExp.prototype.test),As=zk(TypeError);function He(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 _u(e,t,r)}}function zk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return wu(e,n)}}function mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$o;Av&&Av(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(Uk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function pi(e){const t=Rv(null);for(const[n,r]of Cv(e))$v(e,n)!==void 0&&(t[n]=r);return t}function Ro(e,t){for(;e!==null;){const r=$v(e,t);if(r){if(r.get)return He(r.get);if(typeof r.value=="function")return He(r.value)}e=Bk(e)}function n(r){return console.warn("fallback value for",r),null}return n}const Dv=me(["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"]),Tu=me(["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"]),Ou=me(["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"]),Gk=me(["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"]),Mu=me(["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"]),jk=me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kv=me(["#text"]),Iv=me(["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","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","xmlns","slot"]),Cu=me(["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"]),Nv=me(["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"]),Lo=me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wk=tn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qk=tn(/<%[\w\W]*|[\w\W]*%>/gm),Yk=tn(/\${[\w\W]*}/gm),Zk=tn(/^data-[\-\w.\u00B7-\uFFFF]/),Xk=tn(/^aria-[\-\w]+$/),Pv=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Kk=tn(/^(?:\w+script|data):/i),Qk=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Uv=tn(/^html$/i);var Bv=Object.freeze({__proto__:null,MUSTACHE_EXPR:Wk,ERB_EXPR:qk,TMPLIT_EXPR:Yk,DATA_ATTR:Zk,ARIA_ATTR:Xk,IS_ALLOWED_URI:Pv,IS_SCRIPT_OR_DATA:Kk,ATTR_WHITESPACE:Qk,DOCTYPE_NAME:Uv});const Jk=function(){return typeof window>"u"?null:window},tI=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 Hv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jk();const t=C=>Hv(C);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)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=Ro(p,"cloneNode"),m=Ro(p,"nextSibling"),g=Ro(p,"childNodes"),y=Ro(p,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let x,w="";const{implementation:_,createNodeIterator:S,createDocumentFragment:O,getElementsByTagName:I}=n,{importNode:U}=r;let L={};t.isSupported=typeof Cv=="function"&&typeof y=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:V,TMPLIT_EXPR:M,DATA_ATTR:R,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:H}=Bv;let{IS_ALLOWED_URI:P}=Bv,N=null;const Z=mt({},[...Dv,...Tu,...Ou,...Mu,...kv]);let q=null;const it=mt({},[...Iv,...Cu,...Nv,...Lo]);let nt=Object.seal(Rv(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}})),Y=null,J=null,pt=!0,at=!0,Ot=!1,X=!0,tt=!1,ut=!1,G=!1,Rt=!1,xt=!1,Ht=!1,Vt=!1,st=!0,Lt=!1;const Ve="user-content-";let we=!0,$r=!1,pn={},Jn=null;const Go=mt({},["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 Is=null;const Ns=mt({},["audio","video","img","source","image","track"]);let Pn=null;const jo=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rr="http://www.w3.org/1998/Math/MathML",Lr="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let tr=Le,Ps=!1,Us=null;const sh=mt({},[Rr,Lr,Le],Su);let Un=null;const ah=["application/xhtml+xml","text/html"],oh="text/html";let Zt=null,Bn=null;const er=n.createElement("form"),bi=function(C){return C instanceof RegExp||C instanceof Function},Dr=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bn&&Bn===C)){if((!C||typeof C!="object")&&(C={}),C=pi(C),Un=ah.indexOf(C.PARSER_MEDIA_TYPE)===-1?Un=oh:Un=C.PARSER_MEDIA_TYPE,Zt=Un==="application/xhtml+xml"?Su:$o,N="ALLOWED_TAGS"in C?mt({},C.ALLOWED_TAGS,Zt):Z,q="ALLOWED_ATTR"in C?mt({},C.ALLOWED_ATTR,Zt):it,Us="ALLOWED_NAMESPACES"in C?mt({},C.ALLOWED_NAMESPACES,Su):sh,Pn="ADD_URI_SAFE_ATTR"in C?mt(pi(jo),C.ADD_URI_SAFE_ATTR,Zt):jo,Is="ADD_DATA_URI_TAGS"in C?mt(pi(Ns),C.ADD_DATA_URI_TAGS,Zt):Ns,Jn="FORBID_CONTENTS"in C?mt({},C.FORBID_CONTENTS,Zt):Go,Y="FORBID_TAGS"in C?mt({},C.FORBID_TAGS,Zt):{},J="FORBID_ATTR"in C?mt({},C.FORBID_ATTR,Zt):{},pn="USE_PROFILES"in C?C.USE_PROFILES:!1,pt=C.ALLOW_ARIA_ATTR!==!1,at=C.ALLOW_DATA_ATTR!==!1,Ot=C.ALLOW_UNKNOWN_PROTOCOLS||!1,X=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,tt=C.SAFE_FOR_TEMPLATES||!1,ut=C.WHOLE_DOCUMENT||!1,xt=C.RETURN_DOM||!1,Ht=C.RETURN_DOM_FRAGMENT||!1,Vt=C.RETURN_TRUSTED_TYPE||!1,Rt=C.FORCE_BODY||!1,st=C.SANITIZE_DOM!==!1,Lt=C.SANITIZE_NAMED_PROPS||!1,we=C.KEEP_CONTENT!==!1,$r=C.IN_PLACE||!1,P=C.ALLOWED_URI_REGEXP||Pv,tr=C.NAMESPACE||Le,nt=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&bi(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&bi(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),tt&&(at=!1),Ht&&(xt=!0),pn&&(N=mt({},[...kv]),q=[],pn.html===!0&&(mt(N,Dv),mt(q,Iv)),pn.svg===!0&&(mt(N,Tu),mt(q,Cu),mt(q,Lo)),pn.svgFilters===!0&&(mt(N,Ou),mt(q,Cu),mt(q,Lo)),pn.mathMl===!0&&(mt(N,Mu),mt(q,Nv),mt(q,Lo))),C.ADD_TAGS&&(N===Z&&(N=pi(N)),mt(N,C.ADD_TAGS,Zt)),C.ADD_ATTR&&(q===it&&(q=pi(q)),mt(q,C.ADD_ATTR,Zt)),C.ADD_URI_SAFE_ATTR&&mt(Pn,C.ADD_URI_SAFE_ATTR,Zt),C.FORBID_CONTENTS&&(Jn===Go&&(Jn=pi(Jn)),mt(Jn,C.FORBID_CONTENTS,Zt)),we&&(N["#text"]=!0),ut&&mt(N,["html","head","body"]),N.table&&(mt(N,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=C.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else x===void 0&&(x=tI(f,i)),x!==null&&typeof w=="string"&&(w=x.createHTML(""));me&&me(C),Bn=C}},Bs=mt({},["mi","mo","mn","ms","mtext"]),Wo=mt({},["foreignobject","desc","title","annotation-xml"]),qo=mt({},["title","style","font","a","script"]),Ei=mt({},Tu);mt(Ei,Ou),mt(Ei,Gk);const _i=mt({},Mu);mt(_i,jk);const Yo=function(C){let j=y(C);(!j||!j.tagName)&&(j={namespaceURI:tr,tagName:"template"});const F=$o(C.tagName),dt=$o(j.tagName);return Us[C.namespaceURI]?C.namespaceURI===Lr?j.namespaceURI===Le?F==="svg":j.namespaceURI===Rr?F==="svg"&&(dt==="annotation-xml"||Bs[dt]):!!Ei[F]:C.namespaceURI===Rr?j.namespaceURI===Le?F==="math":j.namespaceURI===Lr?F==="math"&&Wo[dt]:!!_i[F]:C.namespaceURI===Le?j.namespaceURI===Lr&&!Wo[dt]||j.namespaceURI===Rr&&!Bs[dt]?!1:!_i[F]&&(qo[F]||!Ei[F]):!!(Un==="application/xhtml+xml"&&Us[C.namespaceURI]):!1},nr=function(C){Ms(t.removed,{element:C});try{C.parentNode.removeChild(C)}catch{C.remove()}},Hs=function(C,j){try{Ms(t.removed,{attribute:j.getAttributeNode(C),from:j})}catch{Ms(t.removed,{attribute:null,from:j})}if(j.removeAttribute(C),C==="is"&&!q[C])if(xt||Ht)try{nr(j)}catch{}else try{j.setAttribute(C,"")}catch{}},Vs=function(C){let j=null,F=null;if(Rt)C="<remove></remove>"+C;else{const gt=Hk(C,/^[\r\n\t ]+/);F=gt&&gt[0]}Un==="application/xhtml+xml"&&tr===Le&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const dt=x?x.createHTML(C):C;if(tr===Le)try{j=new h().parseFromString(dt,Un)}catch{}if(!j||!j.documentElement){j=_.createDocument(tr,"template",null);try{j.documentElement.innerHTML=Ps?w:dt}catch{}}const yt=j.body||j.documentElement;return C&&F&&yt.insertBefore(n.createTextNode(F),yt.childNodes[0]||null),tr===Le?I.call(j,ut?"html":"body")[0]:ut?j.documentElement:yt},Zo=function(C){return S.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},lh=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Xo=function(C){return typeof o=="function"&&C instanceof o},nn=function(C,j,F){L[C]&&Ao(L[C],dt=>{dt.call(t,j,F,Bn)})},$=function(C){let j=null;if(nn("beforeSanitizeElements",C,null),lh(C))return nr(C),!0;const F=Zt(C.nodeName);if(nn("uponSanitizeElement",C,{tagName:F,allowedTags:N}),C.hasChildNodes()&&!Xo(C.firstElementChild)&&Ae(/<[/\w]/g,C.innerHTML)&&Ae(/<[/\w]/g,C.textContent))return nr(C),!0;if(!N[F]||Y[F]){if(!Y[F]&&K(F)&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,F)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(F)))return!1;if(we&&!Jn[F]){const dt=y(C)||C.parentNode,yt=g(C)||C.childNodes;if(yt&&dt){const gt=yt.length;for(let Xt=gt-1;Xt>=0;--Xt)dt.insertBefore(v(yt[Xt],!0),m(C))}}return nr(C),!0}return C instanceof l&&!Yo(C)||(F==="noscript"||F==="noembed"||F==="noframes")&&Ae(/<\/no(script|embed|frames)/i,C.innerHTML)?(nr(C),!0):(tt&&C.nodeType===3&&(j=C.textContent,Ao([A,V,M],dt=>{j=Cs(j,dt," ")}),C.textContent!==j&&(Ms(t.removed,{element:C.cloneNode()}),C.textContent=j)),nn("afterSanitizeElements",C,null),!1)},W=function(C,j,F){if(st&&(j==="id"||j==="name")&&(F in n||F in er))return!1;if(!(at&&!J[j]&&Ae(R,j))&&!(pt&&Ae(E,j))){if(!q[j]||J[j]){if(!(K(C)&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,C)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(C))&&(nt.attributeNameCheck instanceof RegExp&&Ae(nt.attributeNameCheck,j)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(j))||j==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Ae(nt.tagNameCheck,F)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(F))))return!1}else if(!Pn[j]&&!Ae(P,Cs(F,H,""))&&!((j==="src"||j==="xlink:href"||j==="href")&&C!=="script"&&Vk(F,"data:")===0&&Is[C])&&!(Ot&&!Ae(B,Cs(F,H,"")))&&F)return!1}return!0},K=function(C){return C.indexOf("-")>0},ct=function(C){nn("beforeSanitizeAttributes",C,null);const{attributes:j}=C;if(!j)return;const F={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q};let dt=j.length;for(;dt--;){const yt=j[dt],{name:gt,namespaceURI:Xt,value:de}=yt,De=Zt(gt);let Gt=gt==="value"?de:Fk(de);if(F.attrName=De,F.attrValue=Gt,F.keepAttr=!0,F.forceKeepAttr=void 0,nn("uponSanitizeAttribute",C,F),Gt=F.attrValue,F.forceKeepAttr||(Hs(gt,C),!F.keepAttr))continue;if(!X&&Ae(/\/>/i,Gt)){Hs(gt,C);continue}tt&&Ao([A,V,M],zV=>{Gt=Cs(Gt,zV," ")});const V0=Zt(C.nodeName);if(W(V0,De,Gt)){if(Lt&&(De==="id"||De==="name")&&(Hs(gt,C),Gt=Ve+Gt),x&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Xt)switch(f.getAttributeType(V0,De)){case"TrustedHTML":{Gt=x.createHTML(Gt);break}case"TrustedScriptURL":{Gt=x.createScriptURL(Gt);break}}try{Xt?C.setAttributeNS(Xt,gt,Gt):C.setAttribute(gt,Gt),Lv(t.removed)}catch{}}}nn("afterSanitizeAttributes",C,null)},_t=function C(j){let F=null;const dt=Zo(j);for(nn("beforeSanitizeShadowDOM",j,null);F=dt.nextNode();)nn("uponSanitizeShadowNode",F,null),!$(F)&&(F.content instanceof s&&C(F.content),ct(F));nn("afterSanitizeShadowDOM",j,null)};return t.sanitize=function(C){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,dt=null,yt=null,gt=null;if(Ps=!C,Ps&&(C="<!-->"),typeof C!="string"&&!Xo(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw As("dirty is not a string, aborting")}else throw As("toString is not a function");if(!t.isSupported)return C;if(G||Dr(j),t.removed=[],typeof C=="string"&&($r=!1),$r){if(C.nodeName){const De=Zt(C.nodeName);if(!N[De]||Y[De])throw As("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)F=Vs("<!---->"),dt=F.ownerDocument.importNode(C,!0),dt.nodeType===1&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?F=dt:F.appendChild(dt);else{if(!xt&&!tt&&!ut&&C.indexOf("<")===-1)return x&&Vt?x.createHTML(C):C;if(F=Vs(C),!F)return xt?null:Vt?w:""}F&&Rt&&nr(F.firstChild);const Xt=Zo($r?C:F);for(;yt=Xt.nextNode();)$(yt)||(yt.content instanceof s&&_t(yt.content),ct(yt));if($r)return C;if(xt){if(Ht)for(gt=O.call(F.ownerDocument);F.firstChild;)gt.appendChild(F.firstChild);else gt=F;return(q.shadowroot||q.shadowrootmode)&&(gt=U.call(r,gt,!0)),gt}let de=ut?F.outerHTML:F.innerHTML;return ut&&N["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Ae(Uv,F.ownerDocument.doctype.name)&&(de="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
4
+ `+de),tt&&Ao([A,V,M],De=>{de=Cs(de,De," ")}),x&&Vt?x.createHTML(de):de},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dr(C),G=!0},t.clearConfig=function(){Bn=null,G=!1},t.isValidAttribute=function(C,j,F){Bn||Dr({});const dt=Zt(C),yt=Zt(j);return W(dt,yt,F)},t.addHook=function(C,j){typeof j=="function"&&(L[C]=L[C]||[],Ms(L[C],j))},t.removeHook=function(C){if(L[C])return Lv(L[C])},t.removeHooks=function(C){L[C]&&(L[C]=[])},t.removeAllHooks=function(){L={}},t}var Au=Hv();const Do=e=>Au.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),eI=e=>Au.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),dn=e=>Au.sanitize(e,{ALLOWED_TAGS:[]}),Vv=class z0 extends Et{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-${this.services.domUtils.getChartID()} toolbar`);if(b(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("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
7
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${dn(l.id)}`)}" aria-label="${dn(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
  ${eI(l.iconSVG.content)}
10
10
  </svg>
11
- </button>`).each(function(l,c){D(this).select("svg").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("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=>b(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.text)}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=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;a.type===jt.CUSTOM?(b(a,"id")===null&&(a.id=`toolbar-button-${G0.buttonID++}`),b(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):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?b(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(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
+ </button>`).each(function(l,c){D(this).select("svg").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("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=>b(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.text)}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=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;a.type===jt.CUSTOM?(b(a,"id")===null&&(a.id=`toolbar-button-${z0.buttonID++}`),b(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):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?b(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(){return{id:"toolbar-overflow-menu",title:"More options",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:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData();let i;switch(t){case jt.ZOOM_IN:n&&(i={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case jt.ZOOM_OUT:n&&(i={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case jt.RESET_ZOOM:n&&(i={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case jt.MAKE_FULLSCREEN:i={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case jt.SHOW_AS_DATATABLE:i={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case jt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case jt.EXPORT_PNG:i={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case jt.EXPORT_JPG:i={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return i}getControlIconByType(t){switch(t){case jt.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"/>
13
+ <circle cx="16" cy="24" r="2"></circle>`},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData();let i;switch(t){case jt.ZOOM_IN:n&&(i={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case jt.ZOOM_OUT:n&&(i={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case jt.RESET_ZOOM:n&&(i={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case jt.MAKE_FULLSCREEN:i={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case jt.SHOW_AS_DATATABLE:i={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case jt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case jt.EXPORT_PNG:i={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case jt.EXPORT_JPG:i={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return i}getControlIconByType(t){switch(t){case jt.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
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 jt.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 jt.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 jt.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 jt.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 jt.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 jt.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 jt.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)}}};Vv.buttonID=0;let ko=Vv;const Fv=class z0 extends Et{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=z0.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=b(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=>b(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=k.getHTMLElementSize(n.node()),s=this.configs.direction===kt.ROW||this.configs.direction===kt.ROW_REVERSE,a=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${xe}--${a}--layout-row`,this.configs.direction===kt.ROW).classed(`${xe}--${a}--layout-row-reverse`,this.configs.direction===kt.ROW_REVERSE).classed(`${xe}--${a}--layout-column`,this.configs.direction===kt.COLUMN).classed(`${xe}--${a}--layout-column-reverse`,this.configs.direction===kt.COLUMN_REVERSE).classed(`${xe}--${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=b(c,"renderType")===rt.SVG;u.setParent(h?k.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const f=b(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=b(c,"growth"),d=b(c,"renderType")===rt.SVG?k.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):k.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=>b(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=>{b(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())})}};Fv.instanceID=Math.floor(Math.random()*99999999999);let $e=Fv;class Nn extends Et{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||rg.default.size}px`).style("height",`${this.configs.size||rg.default.size}px`).attr("opacity",0)}}var nI={prefix:"bx",selectorTabbable:`
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 jt.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 jt.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 jt.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 jt.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 jt.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 jt.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)}}};Vv.buttonID=0;let ko=Vv;const Fv=class G0 extends Et{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=G0.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=b(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=>b(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=k.getHTMLElementSize(n.node()),s=this.configs.direction===kt.ROW||this.configs.direction===kt.ROW_REVERSE,a=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${xe}--${a}--layout-row`,this.configs.direction===kt.ROW).classed(`${xe}--${a}--layout-row-reverse`,this.configs.direction===kt.ROW_REVERSE).classed(`${xe}--${a}--layout-column`,this.configs.direction===kt.COLUMN).classed(`${xe}--${a}--layout-column-reverse`,this.configs.direction===kt.COLUMN_REVERSE).classed(`${xe}--${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=b(c,"renderType")===rt.SVG;u.setParent(h?k.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const f=b(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=b(c,"growth"),d=b(c,"renderType")===rt.SVG?k.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):k.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=>b(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=>{b(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())})}};Fv.instanceID=Math.floor(Math.random()*99999999999);let $e=Fv;class Nn extends Et{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||rg.default.size}px`).style("height",`${this.configs.size||rg.default.size}px`).attr("opacity",0)}}var nI={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,9 +22,9 @@
22
22
  button:not([disabled]),select:not([disabled]),
23
23
  textarea:not([disabled]),
24
24
  iframe, object, embed, *[tabindex], *[contenteditable=true]
25
- `},$u=nI;function Gv(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&&Gv(e.prototype,t),n&&Gv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sI(e){return cI(e)||lI(e)||oI(e)||aI()}function aI(){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 oI(e,t){if(e){if(typeof e=="string")return Ru(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 Ru(e,t)}}function lI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cI(e){if(Array.isArray(e))return Ru(e)}function Ru(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,sI(zv(n))):t.push(n),t},[])}function uI(){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(){iI(this,r)}return rI(r)}())}function Lu(e){"@babel/helpers - typeof";return Lu=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},Lu(e)}function hI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jv(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 dI(e,t,n){return t&&jv(e.prototype,t),n&&jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fI(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&&Du(e,t)}function Du(e,t){return Du=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Du(e,t)}function pI(e){var t=gI();return function(){var n=Io(e),r;if(t){var i=Io(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return mI(this,r)}}function mI(e,t){if(t&&(Lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wv(e)}function Wv(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 Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Io(e)}function vI(e){var t=function(n){fI(i,n);var r=pI(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(hI(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,Wv(a)),a}return dI(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 ku(e){"@babel/helpers - typeof";return ku=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},ku(e)}function yI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qv(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 xI(e,t,n){return t&&qv(e.prototype,t),n&&qv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function No(){return typeof Reflect<"u"&&Reflect.get?No=Reflect.get:No=function(e,t,n){var r=bI(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},No.apply(this,arguments)}function bI(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=mi(e),e!==null););return e}function EI(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&&Iu(e,t)}function Iu(e,t){return Iu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Iu(e,t)}function _I(e){var t=OI();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 wI(this,r)}}function wI(e,t){if(t&&(ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SI(e)}function SI(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 mi(e){return mi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mi(e)}function TI(e){var t=function(n){EI(i,n);var r=_I(i);function i(){var s;yI(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 xI(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)}),No(mi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function $s(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 Nu(e){"@babel/helpers - typeof";return Nu=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},Nu(e)}function MI(e){return RI(e)||$I(e)||AI(e)||CI()}function CI(){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 AI(e,t){if(e){if(typeof e=="string")return Pu(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 Pu(e,t)}}function $I(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RI(e){if(Array.isArray(e))return Pu(e)}function Pu(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 LI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yv(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 DI(e,t,n){return t&&Yv(e.prototype,t),n&&Yv(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&&Uu(e,t)}function Uu(e,t){return Uu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Uu(e,t)}function II(e){var t=UI();return function(){var n=Po(e),r;if(t){var i=Po(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return NI(this,r)}}function NI(e,t){if(t&&(Nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PI(e)}function PI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UI(){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 Po(e){return Po=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(e)}function BI(e){var t=function(n){kI(i,n);var r=II(i);function i(){return LI(this,i),r.apply(this,arguments)}return DI(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(x){return x[0].toUpperCase()+x.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 g=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));g.canceled=!0,d(g)}}else{var y=[c,u].filter(Boolean);this._changeState.apply(this,MI(y).concat([function(){v.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function Bu(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 Zv(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 Hu(e){"@babel/helpers - typeof";return Hu=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},Hu(e)}function HI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xv(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 VI(e,t,n){return t&&Xv(e.prototype,t),n&&Xv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FI(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&&Vu(e,t)}function Vu(e,t){return Vu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Vu(e,t)}function GI(e){var t=WI();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 zI(this,r)}}function zI(e,t){if(t&&(Hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jI(e)}function jI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WI(){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 qI(e){var t=function(n){FI(i,n);var r=GI(i);function i(){return HI(this,i),r.apply(this,arguments)}return VI(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Zv(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Zv(s),a)}}]),i}(e);return t}var YI=[BI,qI];const ZI=YI;function XI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kv=function(){};process.env.NODE_ENV!=="production"&&(Kv=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 KI=Kv;const QI=XI(KI);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 JI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qv(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 tN(e,t,n){return t&&Qv(e.prototype,t),n&&Qv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eN(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&&Gu(e,t)}function Gu(e,t){return Gu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Gu(e,t)}function nN(e){var t=sN();return function(){var n=Bo(e),r;if(t){var i=Bo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rN(this,r)}}function rN(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 iN(e)}function iN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sN(){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 Bo(e){return Bo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Bo(e)}function aN(e){var t=function(n){eN(i,n);var r=nN(i);function i(){return JI(this,i),r.apply(this,arguments)}return tN(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 $s(a,u,function(d){var h=Bu(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 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 oN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jv(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 lN(e,t,n){return t&&Jv(e.prototype,t),n&&Jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cN(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 uN(e){var t=fN();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 hN(this,r)}}function hN(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 dN(e)}function dN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fN(){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)}var pN=function(e){cN(n,e);var t=uN(n);function n(r,i){var s;return oN(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!Bu(a,l)})&&s.element.querySelector($u.selectorTabbable).focus()},s._hookCloseActions(),s}return lN(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($u.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&QI(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($s(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($s(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage($s(this.element,"click",function(i){var s=Bu(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($s(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=$u.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}(uI(vI,aN,ZI,TI));const mN=pN;class Vo extends Et{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()),mN.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(),r=b(n,"style","prefix"),i=this.model.getTabularDataArray();return`
25
+ `},$u=nI;function zv(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&&zv(e.prototype,t),n&&zv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sI(e){return cI(e)||lI(e)||oI(e)||aI()}function aI(){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 oI(e,t){if(e){if(typeof e=="string")return Ru(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 Ru(e,t)}}function lI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cI(e){if(Array.isArray(e))return Ru(e)}function Ru(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 Gv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,sI(Gv(n))):t.push(n),t},[])}function uI(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gv(t).reduce(function(r,i){return i(r)},function(){function r(){iI(this,r)}return rI(r)}())}function Lu(e){"@babel/helpers - typeof";return Lu=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},Lu(e)}function hI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jv(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 dI(e,t,n){return t&&jv(e.prototype,t),n&&jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fI(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&&Du(e,t)}function Du(e,t){return Du=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Du(e,t)}function pI(e){var t=gI();return function(){var n=Io(e),r;if(t){var i=Io(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return mI(this,r)}}function mI(e,t){if(t&&(Lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wv(e)}function Wv(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 Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Io(e)}function vI(e){var t=function(n){fI(i,n);var r=pI(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(hI(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,Wv(a)),a}return dI(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 ku(e){"@babel/helpers - typeof";return ku=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},ku(e)}function yI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qv(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 xI(e,t,n){return t&&qv(e.prototype,t),n&&qv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function No(){return typeof Reflect<"u"&&Reflect.get?No=Reflect.get:No=function(e,t,n){var r=bI(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},No.apply(this,arguments)}function bI(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=mi(e),e!==null););return e}function EI(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&&Iu(e,t)}function Iu(e,t){return Iu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Iu(e,t)}function _I(e){var t=TI();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 wI(this,r)}}function wI(e,t){if(t&&(ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SI(e)}function SI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TI(){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 OI(e){var t=function(n){EI(i,n);var r=_I(i);function i(){var s;yI(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 xI(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)}),No(mi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function $s(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 Nu(e){"@babel/helpers - typeof";return Nu=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},Nu(e)}function MI(e){return RI(e)||$I(e)||AI(e)||CI()}function CI(){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 AI(e,t){if(e){if(typeof e=="string")return Pu(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 Pu(e,t)}}function $I(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RI(e){if(Array.isArray(e))return Pu(e)}function Pu(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 LI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yv(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 DI(e,t,n){return t&&Yv(e.prototype,t),n&&Yv(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&&Uu(e,t)}function Uu(e,t){return Uu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Uu(e,t)}function II(e){var t=UI();return function(){var n=Po(e),r;if(t){var i=Po(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return NI(this,r)}}function NI(e,t){if(t&&(Nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PI(e)}function PI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UI(){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 Po(e){return Po=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(e)}function BI(e){var t=function(n){kI(i,n);var r=II(i);function i(){return LI(this,i),r.apply(this,arguments)}return DI(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(x){return x[0].toUpperCase()+x.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 g=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));g.canceled=!0,d(g)}}else{var y=[c,u].filter(Boolean);this._changeState.apply(this,MI(y).concat([function(){v.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function Bu(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 Zv(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 Hu(e){"@babel/helpers - typeof";return Hu=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},Hu(e)}function HI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xv(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 VI(e,t,n){return t&&Xv(e.prototype,t),n&&Xv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FI(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&&Vu(e,t)}function Vu(e,t){return Vu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Vu(e,t)}function zI(e){var t=WI();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 GI(this,r)}}function GI(e,t){if(t&&(Hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jI(e)}function jI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WI(){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 qI(e){var t=function(n){FI(i,n);var r=zI(i);function i(){return HI(this,i),r.apply(this,arguments)}return VI(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Zv(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Zv(s),a)}}]),i}(e);return t}var YI=[BI,qI];const ZI=YI;function XI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kv=function(){};process.env.NODE_ENV!=="production"&&(Kv=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 KI=Kv;const QI=XI(KI);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 JI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qv(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 tN(e,t,n){return t&&Qv(e.prototype,t),n&&Qv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eN(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 nN(e){var t=sN();return function(){var n=Bo(e),r;if(t){var i=Bo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rN(this,r)}}function rN(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 iN(e)}function iN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sN(){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 Bo(e){return Bo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Bo(e)}function aN(e){var t=function(n){eN(i,n);var r=nN(i);function i(){return JI(this,i),r.apply(this,arguments)}return tN(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 $s(a,u,function(d){var h=Bu(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 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 oN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jv(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 lN(e,t,n){return t&&Jv(e.prototype,t),n&&Jv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cN(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 uN(e){var t=fN();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 hN(this,r)}}function hN(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 dN(e)}function dN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fN(){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)}var pN=function(e){cN(n,e);var t=uN(n);function n(r,i){var s;return oN(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!Bu(a,l)})&&s.element.querySelector($u.selectorTabbable).focus()},s._hookCloseActions(),s}return lN(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($u.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&QI(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($s(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($s(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage($s(this.element,"click",function(i){var s=Bu(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($s(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=$u.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}(uI(vI,aN,ZI,OI));const mN=pN;class Vo extends Et{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()),mN.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(),r=b(n,"style","prefix"),i=this.model.getTabularDataArray();return`
28
28
  <div class="cds--modal-container cds--modal-container">
29
29
  <div class="cds--modal-header cds--modal-header">
30
30
  <p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="${t}__modal-title">Tabular representation</p>
@@ -60,7 +60,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
60
60
  <div class="${xe}--${r}-modal-footer-spacer"></div>
61
61
  <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
62
62
  </div>
63
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=k.appendOrSelect(r,`div.${xe}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Rs extends Et{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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=>dn(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=k.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 k.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 Wu extends Et{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Wt.items.status,l=a.some(y=>y.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Kt.CENTER).classed("right-aligned",i===Kt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ft.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,y=>y.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===Wt.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Wt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",ft.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:y})=>y===Wt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[ot.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Wt.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Wt.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 g=b(n,"legend","additionalItems");if(g&&a.length){const y=this,x=u.selectAll("div.additional-item").data(g);x.exit().remove();const w=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(T,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(T){const I=D(this);!_||_!=T.type?(_=T.type,S=1):S++,y.addAdditionalItem(I,T,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}=Wt.area;if(n.type===Jt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Jt.RADIUS){const{iconData:a,fill:o,stroke:l}=Wt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ft.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===Jt.LINE){const a=Wt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ft.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===Jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Wt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Jt.SIZE){const{iconData:a,fill:o,stroke:l}=Wt.size;t.attr("fill","none").attr("role",ft.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===Jt.QUARTILE){const{iconData:a}=Wt.quartile;t.selectAll("rect").attr("role",ft.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===Jt.ZOOM){const{iconData:a,color:o}=b(Wt,"zoom"),l=t.attr("role",ft.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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),s=b(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!==Fe.NONE?a.html(function(o){const l=dn(o.name);return l.length>i&&l.length!==s?ws(l,r,s):l}):a.html(o=>dn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),s=b(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!==Fe.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!==Fe.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!==Fe.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 t0 extends Et{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=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.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 gN extends t0{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}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=k.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,se;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(se||(se={}));var e0=(gi={},gi[se.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[se.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[se.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[se.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),n0=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Fo=function(){function e(t){t===void 0&&(t={}),this.positions=e0,this.positions=Object.assign({},e0,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,g=m/p;return{placement:l,weight:g}});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:n0.innerHeight,width:n0.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 Fo;class qu extends Et{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.positionService=new Fo,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>${Do(i.detail.content)}</p></div>`:a=Do(this.getTooltipHTML(o));const l=k.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${Do(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${Do(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.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{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)}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)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return r!==Fe.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=ws(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ws(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>
63
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=k.appendOrSelect(r,`div.${xe}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Rs extends Et{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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=>dn(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=k.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 k.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 Wu extends Et{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Wt.items.status,l=a.some(y=>y.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Kt.CENTER).classed("right-aligned",i===Kt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ft.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,y=>y.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===Wt.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Wt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",ft.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:y})=>y===Wt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[ot.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Wt.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Wt.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 g=b(n,"legend","additionalItems");if(g&&a.length){const y=this,x=u.selectAll("div.additional-item").data(g);x.exit().remove();const w=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(O,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(O){const I=D(this);!_||_!=O.type?(_=O.type,S=1):S++,y.addAdditionalItem(I,O,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}=Wt.area;if(n.type===Jt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Jt.RADIUS){const{iconData:a,fill:o,stroke:l}=Wt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ft.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===Jt.LINE){const a=Wt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ft.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===Jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Wt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Jt.SIZE){const{iconData:a,fill:o,stroke:l}=Wt.size;t.attr("fill","none").attr("role",ft.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===Jt.QUARTILE){const{iconData:a}=Wt.quartile;t.selectAll("rect").attr("role",ft.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===Jt.ZOOM){const{iconData:a,color:o}=b(Wt,"zoom"),l=t.attr("role",ft.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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),s=b(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!==Fe.NONE?a.html(function(o){const l=dn(o.name);return l.length>i&&l.length!==s?ws(l,r,s):l}):a.html(o=>dn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),s=b(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!==Fe.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!==Fe.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!==Fe.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 t0 extends Et{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=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.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 gN extends t0{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}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=k.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,se;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(se||(se={}));var e0=(gi={},gi[se.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[se.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[se.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[se.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),n0=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Fo=function(){function e(t){t===void 0&&(t={}),this.positions=e0,this.positions=Object.assign({},e0,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,g=m/p;return{placement:l,weight:g}});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:n0.innerHeight,width:n0.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 Fo;class qu extends Et{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.positionService=new Fo,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>${Do(i.detail.content)}</p></div>`:a=Do(this.getTooltipHTML(o));const l=k.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${Do(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${Do(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.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{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)}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)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return r!==Fe.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=ws(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ws(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
64
  <div class="datapoint-tooltip${n.bold?" bold":""}">
65
65
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
66
66
  <div class="label">
@@ -69,19 +69,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
69
69
  </div>
70
70
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
71
71
  </div>
72
- </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return hi(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return hi(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=k.appendOrSelect(i,`div.${xe}--${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)}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=this.tooltip.node(),i=this.getOptions(),s=b(i,"zoomBar","top","enabled");let a=b(t,"detail","mousePosition");if(!a)a=ar(b(t,"detail","event"),n);else{const h=b(i,"zoomBar","top","type"),f=Me.height[h];s&&(a[1]+=f+Me.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=se.LEFT:a[0]/o<.1?c=se.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[se.RIGHT,se.LEFT,se.TOP,se.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=T$;c===se.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}const r0=class Ko extends Et{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=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===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 T="0,"+S.toString();const I=Math.floor(l/Ko.DASH_LENGTH),U=I*Ko.DASH_LENGTH;for(let L=0;L<I;L++)T+=","+Ko.DASH_LENGTH;T+=","+(l-U),I%2===1&&(T+=",0"),T+=","+S.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},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))},g=(_,S)=>{const T=_p().range([0,o]).domain(p);let I=[T.invert(_),T.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 y;const x=_=>{const S=_.selection;S!==null&&(g(S[0],S[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Pd().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",x),s.call(y));const w=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const S=this.services.domUtils.getHolder(),T=ar(s.node(),S)[0];let I=T-o*w/2;I<0&&(I=0);let U=T+o*w/2;U>o&&(U=o),g(I,U)}})}}};r0.DASH_LENGTH=4;let vN=r0;class yN extends Et{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=Pd(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=b(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=Me.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Me.spacerHeight).attr("opacity",1).attr("fill","none"),s===rn.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===rn.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),v=h.getMainXScaleType();if(f&&v===et.TIME){let m=this.services.zoom.getZoomBarData();if(Ke(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const g=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,g);const y=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(y&&y[0].valueOf()===x[0].valueOf()&&y[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:lt([],x),zoomDomain:x?lt([],x):g},{skipUpdate:!0}):x===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],g)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(g),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ge(m,S=>S.value));const w=this.model.get("zoomDomain");if(s===rn.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,T=a.highlightEndMapsTo,I=a.color,U=a.labelMapsTo;a.data.forEach((L,A)=>{k.appendOrSelect(d,`rect.highlight-${A}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[S])).attr("width",this.xScale(L[T])-this.xScale(L[S])).style("fill",I&&I.scale[L[U]]?I.scale[L[U]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[L[U]]?I.scale[L[U]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(w,c,l);const _=k.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(T=>this.xScale(T));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=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=Me.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=Me.handleWidth,s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=Me.height[s],o=-i/2,l=Me.handleBarWidth,c=s===rn.GRAPH_VIEW?Me.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===rn.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",G.TOP,"type"),r=Me.height[n],i=this.getComponentContainer().select("svg.zoom-container");k.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=(g,y,x)=>w=>s.getValueFromScale(g,y,x,w),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",G.TOP,"type"),p=Me.height[f],v=Mc().x(g=>d(g)).y0(p).y1(g=>p-h(g)),m=k.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=An(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=b(this.model.getOptions(),"zoomBar",G.TOP,"type"),a=Me.height[s],o=ss()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",G.TOP,"type")===rn.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 xN extends Et{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Fo}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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===G.LEFT||c===G.RIGHT?(f=u,h=l.services.cartesianScales.getMainXScale()):(h=u,f=l.services.cartesianScales.getMainYScale());const p=d===et.LABELS,[v,m]=h.range(),[g,y]=f.range(),{cartesianScales:x}=l.services,w=x.getOrientation(),_=L=>x.getDomainValue(L),S=L=>x.getRangeValue(L),[T,I]=Dn(_,S,w),U=D(this);c===G.TOP||c===G.BOTTOM?(U.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",g).attr("x1",({datum:L})=>T(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>T(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),U.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-T(L)).attr("width",Math.abs(g-y)).classed("rotate",!0)):(U.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),U.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();if(this.services.cartesianScales.getScaleTypeByPosition(r)===et.TIME){const s=[G.LEFT,G.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=b(i,"timeScale"),u=lu(l.ticks(),b(c,"timeInterval"));return ou(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${xe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=ar(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(dn(`${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,[se.RIGHT,se.LEFT,se.TOP,se.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=b(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 bN extends Et{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Fo,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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,g=m.getOrientation(),y=T=>m.getDomainValue(T),x=T=>m.getRangeValue(T),[w,_]=Dn(y,x,g),S=D(this);c===G.TOP||c===G.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,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:T,...I})=>w(I[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:I,...U})=>Math.max(w(U[I])-w(U[T]),0)).style("stroke",({color:T,labelMapsTo:I,...U})=>T&&T.scale[U[I]]?T.scale[U[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:I,...U})=>T&&T.scale[U[I]]?T.scale[U[I]]:null):S.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(f-h,0)).attr("y",({highlightEndMapsTo:T,...I})=>_(I[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:I,...U})=>Math.max(_(U[T])-_(U[I]),0)).style("stroke",({color:T,labelMapsTo:I,...U})=>T&&T.scale[U[I]]?T.scale[U[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:I,...U})=>T&&T.scale[U[I]]?T.scale[U[I]]:null)})}}class i0 extends qu{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:r.tooltip.groupLabel,value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[ot.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:[ot.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:It(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class EN extends Et{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}=k.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Qe.minNodePadding;s.alluvial.nodePadding>Qe.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=Xg;c===Kt.LEFT?u=rD:c===Kt.RIGHT&&(u=iD);const d=lD().nodeId(m=>m.name).nodeWidth(Qe.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(m=>Object.assign({},m)),links:a.map(m=>Object.assign({},m))}),this.graph.nodes=this.graph.nodes.filter(m=>m.value!==0);const h={};this.graph.nodes.forEach(m=>{const g=m.x0;m.category&&(h[g]=m==null?void 0:m.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",m=>`translate(${m}, 0)`).append("text").attr("id",(m,g)=>this.services.domUtils.generateElementIDString(`alluvial-category-${g}`)).style("font-size","14px").text(m=>h[m]?h[m]:"").attr("y",20).attr("x",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-category-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0});let w=0;return m+w>=x&&(w=-x+4),w});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const m=b(this.getOptions(),"color","scale");m&&f.enter().append("linearGradient").attr("id",g=>`${this.gradient_id}-link-${g.index}`).attr("gradientUnits","userSpaceOnUse").call(g=>g.append("stop").attr("offset","0%").attr("stop-color",y=>m[y.source.name])).call(g=>g.append("stop").attr("offset","100%").attr("stop-color",y=>m[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",bD()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:m.source.index,originalClassName:"link"})).style("stroke",m=>o?`url(#${this.gradient_id}-link-${m.index})`:this.model.getFillColor(m.source.name)).attr("stroke-width",m=>Math.max(1,m.width)).style("stroke-opacity",Qe.opacity.default).attr("aria-label",m=>`${m.source.name} → ${m.target.name} (${m.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-${m.index}`)).classed("node-group",!0).attr("transform",m=>`translate(${m.x0}, ${m.y0})`);p.append("rect").classed("node",!0).attr("height",m=>m.y1-m.y0).attr("width",m=>m.x1-m.x0).attr("fill","black");const v=p.append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${m.index}`));v.append("text").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${m.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(m=>`${m.name} (${m.value})`).attr("aria-label",m=>`${m.name} (${m.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0});return x+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0}),w=(m.y1-m.y0)/2-9;let _=m.x1-m.x0;return m.x1>=x?_=_-(x+16):_+=4,`translate(${_}, ${w})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=bo((i,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(D(i).lower(),a.style("stroke-opacity",Qe.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),Qe.opacity.selected):Qe.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=D(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=bo((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",Qe.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(),Qe.opacity.selected):Qe.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=_s(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=_s(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=_s(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Qe.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=_s(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`
72
+ </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return hi(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return hi(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=k.appendOrSelect(i,`div.${xe}--${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)}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=this.tooltip.node(),i=this.getOptions(),s=b(i,"zoomBar","top","enabled");let a=b(t,"detail","mousePosition");if(!a)a=ar(b(t,"detail","event"),n);else{const h=b(i,"zoomBar","top","type"),f=Me.height[h];s&&(a[1]+=f+Me.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=se.LEFT:a[0]/o<.1?c=se.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[se.RIGHT,se.LEFT,se.TOP,se.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=O$;c===se.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}const r0=class Ko extends Et{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=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===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 O="0,"+S.toString();const I=Math.floor(l/Ko.DASH_LENGTH),U=I*Ko.DASH_LENGTH;for(let L=0;L<I;L++)O+=","+Ko.DASH_LENGTH;O+=","+(l-U),I%2===1&&(O+=",0"),O+=","+S.toString(),O+=","+l.toString(),f.attr("stroke-dasharray",O)},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))},g=(_,S)=>{const O=_p().range([0,o]).domain(p);let I=[O.invert(_),O.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 y;const x=_=>{const S=_.selection;S!==null&&(g(S[0],S[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Pd().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",x),s.call(y));const w=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const S=this.services.domUtils.getHolder(),O=ar(s.node(),S)[0];let I=O-o*w/2;I<0&&(I=0);let U=O+o*w/2;U>o&&(U=o),g(I,U)}})}}};r0.DASH_LENGTH=4;let vN=r0;class yN extends Et{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=Pd(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=b(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=b(this.getOptions(),"zoomBar",z.TOP,"type"),a=b(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Me.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Me.spacerHeight).attr("opacity",1).attr("fill","none"),s===rn.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===rn.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),v=h.getMainXScaleType();if(f&&v===et.TIME){let m=this.services.zoom.getZoomBarData();if(Ke(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const g=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,g);const y=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(y&&y[0].valueOf()===x[0].valueOf()&&y[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:lt([],x),zoomDomain:x?lt([],x):g},{skipUpdate:!0}):x===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],g)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(g),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(ze(m,S=>S.value));const w=this.model.get("zoomDomain");if(s===rn.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,O=a.highlightEndMapsTo,I=a.color,U=a.labelMapsTo;a.data.forEach((L,A)=>{k.appendOrSelect(d,`rect.highlight-${A}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[S])).attr("width",this.xScale(L[O])-this.xScale(L[S])).style("fill",I&&I.scale[L[U]]?I.scale[L[U]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[L[U]]?I.scale[L[U]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(w,c,l);const _=k.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(O=>this.xScale(O));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=b(this.getOptions(),"zoomBar",z.TOP,"type"),a=Me.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=Me.handleWidth,s=b(this.getOptions(),"zoomBar",z.TOP,"type"),a=Me.height[s],o=-i/2,l=Me.handleBarWidth,c=s===rn.GRAPH_VIEW?Me.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===rn.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",z.TOP,"type"),r=Me.height[n],i=this.getComponentContainer().select("svg.zoom-container");k.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=(g,y,x)=>w=>s.getValueFromScale(g,y,x,w),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",z.TOP,"type"),p=Me.height[f],v=Mc().x(g=>d(g)).y0(p).y1(g=>p-h(g)),m=k.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=An(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=b(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Me.height[s],o=ss()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",z.TOP,"type")===rn.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 xN extends Et{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Fo}render(t=!1){const n=b(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(),[g,y]=f.range(),{cartesianScales:x}=l.services,w=x.getOrientation(),_=L=>x.getDomainValue(L),S=L=>x.getRangeValue(L),[O,I]=Dn(_,S,w),U=D(this);c===z.TOP||c===z.BOTTOM?(U.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",g).attr("x1",({datum:L})=>O(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>O(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),U.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-O(L)).attr("width",Math.abs(g-y)).classed("rotate",!0)):(U.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),U.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(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();if(this.services.cartesianScales.getScaleTypeByPosition(r)===et.TIME){const s=[z.LEFT,z.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=b(i,"timeScale"),u=lu(l.ticks(),b(c,"timeInterval"));return ou(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${xe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=ar(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(dn(`${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,[se.RIGHT,se.LEFT,se.TOP,se.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=b(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 bN extends Et{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Fo,this.highlightStrokeWidth=1}render(t=!1){const n=b(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,g=m.getOrientation(),y=O=>m.getDomainValue(O),x=O=>m.getRangeValue(O),[w,_]=Dn(y,x,g),S=D(this);c===z.TOP||c===z.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(O=>l.services.transitions.setupTransition({transition:O,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:O,...I})=>w(I[O])).attr("width",({highlightStartMapsTo:O,highlightEndMapsTo:I,...U})=>Math.max(w(U[I])-w(U[O]),0)).style("stroke",({color:O,labelMapsTo:I,...U})=>O&&O.scale[U[I]]?O.scale[U[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:O,labelMapsTo:I,...U})=>O&&O.scale[U[I]]?O.scale[U[I]]:null):S.selectAll("rect.highlight-bar").transition().call(O=>l.services.transitions.setupTransition({transition:O,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(f-h,0)).attr("y",({highlightEndMapsTo:O,...I})=>_(I[O])).attr("height",({highlightStartMapsTo:O,highlightEndMapsTo:I,...U})=>Math.max(_(U[O])-_(U[I]),0)).style("stroke",({color:O,labelMapsTo:I,...U})=>O&&O.scale[U[I]]?O.scale[U[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:O,labelMapsTo:I,...U})=>O&&O.scale[U[I]]?O.scale[U[I]]:null)})}}class i0 extends qu{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:r.tooltip.groupLabel,value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[ot.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:[ot.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:It(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class EN extends Et{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}=k.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Qe.minNodePadding;s.alluvial.nodePadding>Qe.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=Xg;c===Kt.LEFT?u=rD:c===Kt.RIGHT&&(u=iD);const d=lD().nodeId(m=>m.name).nodeWidth(Qe.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(m=>Object.assign({},m)),links:a.map(m=>Object.assign({},m))}),this.graph.nodes=this.graph.nodes.filter(m=>m.value!==0);const h={};this.graph.nodes.forEach(m=>{const g=m.x0;m.category&&(h[g]=m==null?void 0:m.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",m=>`translate(${m}, 0)`).append("text").attr("id",(m,g)=>this.services.domUtils.generateElementIDString(`alluvial-category-${g}`)).style("font-size","14px").text(m=>h[m]?h[m]:"").attr("y",20).attr("x",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-category-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0});let w=0;return m+w>=x&&(w=-x+4),w});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const m=b(this.getOptions(),"color","scale");m&&f.enter().append("linearGradient").attr("id",g=>`${this.gradient_id}-link-${g.index}`).attr("gradientUnits","userSpaceOnUse").call(g=>g.append("stop").attr("offset","0%").attr("stop-color",y=>m[y.source.name])).call(g=>g.append("stop").attr("offset","100%").attr("stop-color",y=>m[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",bD()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:m.source.index,originalClassName:"link"})).style("stroke",m=>o?`url(#${this.gradient_id}-link-${m.index})`:this.model.getFillColor(m.source.name)).attr("stroke-width",m=>Math.max(1,m.width)).style("stroke-opacity",Qe.opacity.default).attr("aria-label",m=>`${m.source.name} → ${m.target.name} (${m.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-${m.index}`)).classed("node-group",!0).attr("transform",m=>`translate(${m.x0}, ${m.y0})`);p.append("rect").classed("node",!0).attr("height",m=>m.y1-m.y0).attr("width",m=>m.x1-m.x0).attr("fill","black");const v=p.append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${m.index}`));v.append("text").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${m.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(m=>`${m.name} (${m.value})`).attr("aria-label",m=>`${m.name} (${m.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0});return x+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,g)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${g}`),{width:x}=k.getSVGElementSize(D(`text#${y}`),{useBBox:!0}),w=(m.y1-m.y0)/2-9;let _=m.x1-m.x0;return m.x1>=x?_=_-(x+16):_+=4,`translate(${_}, ${w})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=bo((i,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(D(i).lower(),a.style("stroke-opacity",Qe.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),Qe.opacity.selected):Qe.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=D(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(i,s){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=bo((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",Qe.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(),Qe.opacity.selected):Qe.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=_s(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=_s(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=_s(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Qe.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=_s(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`
73
73
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
74
74
  <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"/>
75
75
  <rect width="32" height="32"/>
76
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Re extends Et{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=ol(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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=Fh(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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(Ln(u).tx)-Number(Ln(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Ln(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Ln(o).tx;else if(o)l=+Ln(o).tx-+Ln(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Ln(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Ln(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=k.appendOrSelect(r,"svg.chart-grid-backdrop");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class s0 extends Et{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?$n.opacity.unselected:$n.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",$n.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=Mc().curve(this.services.curves.getD3Curve()).defined(_=>{const S=s.getRangeIdentifier();return _[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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)=>{b(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===ee.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=b(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 g=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(g.exit().attr("opacity",0).remove(),!l.length)return;if(m){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:l[0].name})}`).node();let S;if(_)S=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=b(this.model.getOptions(),"color","scale");if(T!==null){const I=Object.keys(T);S=T[I[0]]}}mu.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:mu.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,w=g.enter().append("path");m?w.merge(g).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:S}=_;return o(S)}):(w.attr("opacity",0).merge(g).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>x.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:$n.opacity.selected).attr("d",_=>{const{data:S}=_;return o(S)}),u&&w.attr("fill-opacity",$n.opacity.selected).style("stroke",_=>x.model.getStrokeColor(_.name)).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 Et{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?Rn.opacity.unselected:Rn.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",Rn.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]=Dn(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),g=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,p),data:v.map(y=>({[m]:y.data.sharedStackKey,[p]:y[p],[g]:y[1]})),hidden:!Pk(v,y=>y[0]!==y[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:[ot.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",ft.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 a0=5;function _N(e,t){return e>t-a0&&e<t+a0}class Xn extends Et{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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===ee.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>_N(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,g)=>{if(m.length===0)return m.push(g),m;const y=m[0].domainValue,x=Math.abs(u-g.domainValue),w=Math.abs(u-y);return x>w||(x<w?m=[g]:m.push(g)),m},[]);if(v.length>0){const m=v.map(w=>w.originalData).filter(w=>{const _=this.services.cartesianScales.getRangeIdentifier(w);return w[_]!=null}),g=v.map(w=>w.domainValue),y=f.filter(w=>{const _=this.services.cartesianScales.getDomainValue(w);return g.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Mv(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const x=v[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(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=ar(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=J$(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class fn extends Et{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(!(b(this.getOptions(),"points","enabled")||b(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]=Dn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Dn(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]=Dn(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)?[ot.FILL,ot.STROKE]:[ot.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",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[ot.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 o0 extends Et{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.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 G.LEFT:h=Fh;break;case G.BOTTOM:h=ol;break;case G.RIGHT:h=by;break;case G.TOP:h=xy;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const v=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),g=this.scaleType===et.TIME||m.scaleType===et.TIME,y=n===G.LEFT||n===G.RIGHT,x=this.model.get("zoomDomain");if(x&&g&&!y&&d.domain(x),!i){p.attr("aria-hidden",!0);return}const w=b(m,"scaleType"),_=b(r,"data","loading"),S=b(m,"ticks","number"),T=b(m,"ticks","values"),I=b(m,"truncation","type"),U=b(m,"truncation","threshold"),L=b(m,"truncation","numCharacter"),A=S!==null,V=b(r,"timeScale"),M=k.appendOrSelect(v,"g.tick"),R=k.appendOrSelect(M,"text").text("0"),E=k.getSVGElementSize(R.node(),{useBBox:!0}).height;M.remove();const B=this.scaleType||m.scaleType||et.LINEAR,H=h(d).tickSizeOuter(0);if(d.ticks){let Y;if(A?Y=S:(Y=jn.ticks.number,y&&(Y=this.getNumberOfFittingTicks(o,E,jn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),H.ticks(Y),g)if(!d.ticks(Y).length)H.tickValues([]);else{const J=b(r,"timeScale","addSpaceOnEdges"),pt=b(r,"axes",n,"domain"),at=d.copy();J&&!pt&&at.nice(Y);const Tt=at.ticks(Y);J&&Tt.length>2&&!pt&&(Tt.splice(Tt.length-1,1),Tt.splice(0,1)),H.tickValues(Tt)}}let P;const N=b(m,"ticks","formatter");if(g){const Y=lu(H.tickValues(),b(r,"timeScale","timeInterval"));N===null?P=(J,pt)=>ou(J,pt,H.tickValues(),Y,V):P=(J,pt)=>{const at=ou(J,pt,H.tickValues(),Y,V);return N(J,pt,at)}}else N===null?B===et.LINEAR&&(P=Y=>Y.toLocaleString()):P=N;H.tickFormat(P);const[Z,q]=this.services.cartesianScales.getScaleByPosition(n).domain();let it;if(T){if(g)T.forEach((Y,J)=>{Y.getTime===void 0&&(T[J]=new Date(Y))}),it=T.filter(Y=>{const J=Y.getTime();return J>=new Date(Z).getTime()&&J<=new Date(q).getTime()});else if(w===et.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();it=T.filter(J=>Y.includes(J))}else it=T.filter(Y=>Y>=Z&&Y<=q);H.tickValues(it)}switch(n){case G.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case G.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const nt=this.model.isDataEmpty();if(m.title){const Y=k.appendOrSelect(l,"text.axis-title").html(nt||_?"":dn(m.title)),J=b(m,"titleOrientation");let pt;switch(n){case G.LEFT:J===tl.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:J===tl.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:pt=k.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(g){const Y=lu(H.tickValues(),b(r,"timeScale","timeInterval")),J=V.showDayName,pt=p;t&&(p=p.transition().call(at=>this.services.transitions.setupTransition({transition:at,name:"axis-update",animate:t}))),p=p.call(H),pt.selectAll(".tick").data(H.tickValues(),d).order().select("text").style("font-weight",(at,Tt)=>Mg(at,Tt,H.tickValues(),Y,J)?"bold":"normal")}else!t||!f?p=p.call(H):p=p.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(H);if(v.call(H),n===G.BOTTOM||n===G.TOP){let Y=!1;const J=b(m,"ticks","rotation");if(J===zs.ALWAYS)Y=!0;else if(J===zs.NEVER)Y=!1;else if(!J||J===zs.AUTO)if(d.step)Y=v.selectAll("g.tick text").nodes().some(pt=>k.getSVGElementSize(pt,{useBBox:!0}).width>=d.step());else{Y=!1;const pt=v.append("text").text("A"),at=k.getSVGElementSize(pt.node(),{useBBox:!0}).width;let Tt;v.selectAll("g.tick").each(function(){const X=D(this),tt=parseFloat(b(Ln(this),"tx"));tt!==null&&Tt+X.text().length*at*.8>=tt&&(Y=!0),Tt=tt}),pt.remove()}Y?(A||(H.ticks(this.getNumberOfFittingTicks(a,E,jn.ticks.horizontalSpaceRatio)),v.call(H),p.call(H)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.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",Y=>Y),v.selectAll("g.tick").attr("aria-label",Y=>Y),I!==Fe.NONE&&w===et.LABELS&&!T){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const J=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(J);const pt=this;l.selectAll("g.tick text").data(Y).text(function(at){return at.length>U?(pt.truncation[n]=!0,ws(at,I,L)):at}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(at){return at.length>U?ws(at,I,L):at}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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 Tv(i,2,jn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class wN extends o0{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=k.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}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case G.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case G.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case G.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-jn.hover.rectanglePadding).attr("y",p).attr("width",u+jn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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===G.LEFT||n===G.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class Ee extends Et{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(G),i=b(this.getOptions(),"axes");r.forEach(a=>{i[G[a]]&&(n[G[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=G[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Ws.DEFAULT?new o0(this.model,this.services,l):new wN(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}=k.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=k.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===G.LEFT||l===G.RIGHT)&&(h+=5)),l){case G.TOP:s.top=d+h;break;case G.BOTTOM:s.bottom=d+h;break;case G.LEFT:s.left=u+h;break;case G.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 ge extends Et{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Qt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Qt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Qt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Qt.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===ee.VERTICAL&&this.drawYGrid(t),n===ee.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),r=0;this.drawRing(n,r,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=Ye().domain([0,1]).range(t),this.yScale=Ye().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");k.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(Pt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Pt.xOffset;c===Kt.CENTER?p=s/2:c===Kt.RIGHT&&(p=s-t-Pt.xOffset);const v=t+Pt.yOffset;f.attr("transform",`translate(${p}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Pt.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}=k.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=k.appendOrSelect(i,"defs").lower(),c=k.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=`
76
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Re extends Et{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=ol(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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=Fh(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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(Ln(u).tx)-Number(Ln(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Ln(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Ln(o).tx;else if(o)l=+Ln(o).tx-+Ln(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Ln(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=Ln(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=k.appendOrSelect(r,"svg.chart-grid-backdrop");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class s0 extends Et{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?$n.opacity.unselected:$n.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",$n.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=Mc().curve(this.services.curves.getD3Curve()).defined(_=>{const S=s.getRangeIdentifier();return _[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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)=>{b(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===ee.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=b(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 g=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(g.exit().attr("opacity",0).remove(),!l.length)return;if(m){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:l[0].name})}`).node();let S;if(_)S=getComputedStyle(_,null).getPropertyValue("stroke");else{const O=b(this.model.getOptions(),"color","scale");if(O!==null){const I=Object.keys(O);S=O[I[0]]}}mu.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:mu.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,w=g.enter().append("path");m?w.merge(g).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:S}=_;return o(S)}):(w.attr("opacity",0).merge(g).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>x.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:$n.opacity.selected).attr("d",_=>{const{data:S}=_;return o(S)}),u&&w.attr("fill-opacity",$n.opacity.selected).style("stroke",_=>x.model.getStrokeColor(_.name)).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 vi extends Et{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?Rn.opacity.unselected:Rn.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",Rn.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]=Dn(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),g=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,p),data:v.map(y=>({[m]:y.data.sharedStackKey,[p]:y[p],[g]:y[1]})),hidden:!Pk(v,y=>y[0]!==y[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:[ot.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",ft.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 a0=5;function _N(e,t){return e>t-a0&&e<t+a0}class Xn extends Et{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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===ee.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>_N(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,g)=>{if(m.length===0)return m.push(g),m;const y=m[0].domainValue,x=Math.abs(u-g.domainValue),w=Math.abs(u-y);return x>w||(x<w?m=[g]:m.push(g)),m},[]);if(v.length>0){const m=v.map(w=>w.originalData).filter(w=>{const _=this.services.cartesianScales.getRangeIdentifier(w);return w[_]!=null}),g=v.map(w=>w.domainValue),y=f.filter(w=>{const _=this.services.cartesianScales.getDomainValue(w);return g.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Mv(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const x=v[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=ar(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=J$(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class fn extends Et{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(!(b(this.getOptions(),"points","enabled")||b(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]=Dn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Dn(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]=Dn(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)?[ot.FILL,ot.STROKE]:[ot.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",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[ot.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 o0 extends Et{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=b(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===et.LABELS||this.scaleType===et.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Fh;break;case z.BOTTOM:h=ol;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=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const v=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),g=this.scaleType===et.TIME||m.scaleType===et.TIME,y=n===z.LEFT||n===z.RIGHT,x=this.model.get("zoomDomain");if(x&&g&&!y&&d.domain(x),!i){p.attr("aria-hidden",!0);return}const w=b(m,"scaleType"),_=b(r,"data","loading"),S=b(m,"ticks","number"),O=b(m,"ticks","values"),I=b(m,"truncation","type"),U=b(m,"truncation","threshold"),L=b(m,"truncation","numCharacter"),A=S!==null,V=b(r,"timeScale"),M=k.appendOrSelect(v,"g.tick"),R=k.appendOrSelect(M,"text").text("0"),E=k.getSVGElementSize(R.node(),{useBBox:!0}).height;M.remove();const B=this.scaleType||m.scaleType||et.LINEAR,H=h(d).tickSizeOuter(0);if(d.ticks){let Y;if(A?Y=S:(Y=jn.ticks.number,y&&(Y=this.getNumberOfFittingTicks(o,E,jn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),H.ticks(Y),g)if(!d.ticks(Y).length)H.tickValues([]);else{const J=b(r,"timeScale","addSpaceOnEdges"),pt=b(r,"axes",n,"domain"),at=d.copy();J&&!pt&&at.nice(Y);const Ot=at.ticks(Y);J&&Ot.length>2&&!pt&&(Ot.splice(Ot.length-1,1),Ot.splice(0,1)),H.tickValues(Ot)}}let P;const N=b(m,"ticks","formatter");if(g){const Y=lu(H.tickValues(),b(r,"timeScale","timeInterval"));N===null?P=(J,pt)=>ou(J,pt,H.tickValues(),Y,V):P=(J,pt)=>{const at=ou(J,pt,H.tickValues(),Y,V);return N(J,pt,at)}}else N===null?B===et.LINEAR&&(P=Y=>Y.toLocaleString()):P=N;H.tickFormat(P);const[Z,q]=this.services.cartesianScales.getScaleByPosition(n).domain();let it;if(O){if(g)O.forEach((Y,J)=>{Y.getTime===void 0&&(O[J]=new Date(Y))}),it=O.filter(Y=>{const J=Y.getTime();return J>=new Date(Z).getTime()&&J<=new Date(q).getTime()});else if(w===et.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();it=O.filter(J=>Y.includes(J))}else it=O.filter(Y=>Y>=Z&&Y<=q);H.tickValues(it)}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 nt=this.model.isDataEmpty();if(m.title){const Y=k.appendOrSelect(l,"text.axis-title").html(nt||_?"":dn(m.title)),J=b(m,"titleOrientation");let pt;switch(n){case z.LEFT:J===tl.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.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:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:J===tl.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.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=k.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(g){const Y=lu(H.tickValues(),b(r,"timeScale","timeInterval")),J=V.showDayName,pt=p;t&&(p=p.transition().call(at=>this.services.transitions.setupTransition({transition:at,name:"axis-update",animate:t}))),p=p.call(H),pt.selectAll(".tick").data(H.tickValues(),d).order().select("text").style("font-weight",(at,Ot)=>Mg(at,Ot,H.tickValues(),Y,J)?"bold":"normal")}else!t||!f?p=p.call(H):p=p.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(H);if(v.call(H),n===z.BOTTOM||n===z.TOP){let Y=!1;const J=b(m,"ticks","rotation");if(J===Gs.ALWAYS)Y=!0;else if(J===Gs.NEVER)Y=!1;else if(!J||J===Gs.AUTO)if(d.step)Y=v.selectAll("g.tick text").nodes().some(pt=>k.getSVGElementSize(pt,{useBBox:!0}).width>=d.step());else{Y=!1;const pt=v.append("text").text("A"),at=k.getSVGElementSize(pt.node(),{useBBox:!0}).width;let Ot;v.selectAll("g.tick").each(function(){const X=D(this),tt=parseFloat(b(Ln(this),"tx"));tt!==null&&Ot+X.text().length*at*.8>=tt&&(Y=!0),Ot=tt}),pt.remove()}Y?(A||(H.ticks(this.getNumberOfFittingTicks(a,E,jn.ticks.horizontalSpaceRatio)),v.call(H),p.call(H)),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",Y=>Y),v.selectAll("g.tick").attr("aria-label",Y=>Y),I!==Fe.NONE&&w===et.LABELS&&!O){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const J=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(J);const pt=this;l.selectAll("g.tick text").data(Y).text(function(at){return at.length>U?(pt.truncation[n]=!0,ws(at,I,L)):at}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(at){return at.length>U?ws(at,I,L):at}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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 Ov(i,2,jn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class wN extends o0{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=k.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}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-jn.hover.rectanglePadding).attr("y",p).attr("width",u+jn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class Ee extends Et{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=b(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===Ws.DEFAULT?new o0(this.model,this.services,l):new wN(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}=k.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=k.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 ge extends Et{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Qt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Qt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Qt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Qt.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===ee.VERTICAL&&this.drawYGrid(t),n===ee.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),r=0;this.drawRing(n,r,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=Ye().domain([0,1]).range(t),this.yScale=Ye().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");k.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(Pt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Pt.xOffset;c===Kt.CENTER?p=s/2:c===Kt.RIGHT&&(p=s-t-Pt.xOffset);const v=t+Pt.yOffset;f.attr("transform",`translate(${p}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Pt.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}=k.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=k.appendOrSelect(i,"defs").lower(),c=k.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
77
  <stop class="${n}" offset="${a}"></stop>
78
78
  <stop class="${r}" offset="${a+.2}"></stop>
79
79
  <stop class="${n}" offset="${a+2*.2}"></stop>
80
- `;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 SN extends Et{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===ee.VERTICAL,[g,y]=Dn(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),v),x=Math.floor((m?h:f)/s.length),w=Math.min(x/2,16),_=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(_);S.exit().remove();const T=S.enter().append("g").attr("class","box-group"),I=S.merge(T);T.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Be.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i]),M=V,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.quartiles.q_25);return pe({x0:V,x1:M,y0:R,y1:E},v)}),T.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Be.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i]),M=V,R=p.getRangeValue(A.whiskers.max),E=p.getRangeValue(A.quartiles.q_75);return pe({x0:V,x1:M,y0:R,y1:E},v)}),T.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"box"})).attr("fill-opacity",Be.box.opacity.default).attr("stroke-width",Be.strokeWidth.default).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[i]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(Math[m?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),E=R+Math.abs(p.getRangeValue(A.quartiles.q_75)-p.getRangeValue(A.quartiles.q_25));return pe({x0:V,x1:M,y0:R,y1:E},v)}),T.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.whiskers.max);return pe({x0:V,x1:M,y0:R,y1:E},v)}),T.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Be.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/4,M=V+w/2,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.whiskers.min);return pe({x0:V,x1:M,y0:R,y1:E},v)}),T.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(A.quartiles.q_50);return pe({x0:V,x1:M,y0:R,y1:R},v)}),T.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Be.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/4,M=V+w/2,R=p.getRangeValue(A.whiskers.max),E=p.getRangeValue(A.whiskers.max);return pe({x0:V,x1:M,y0:R,y1:E},v)});const U=I.selectAll("circle.outlier").data(A=>A.outliers.map(V=>({min:A.whiskers.min,max:A.whiskers.max,[i]:A[i],value:V})));U.exit().remove();const L=U.enter().append("circle");U.merge(L).attr("r",Be.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Be.circle.opacity.default).attr("cx",g).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:t})).attr("cy",y),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",Be.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[ot.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",Be.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",Be.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[ot.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",Be.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 Et{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=dg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.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 ON extends fn{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=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Ge(s):[1,1];return Ye().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]=Dn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ft.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:[ot.FILL,ot.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=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class TN extends Et{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(g=>{g.ranges?g.ranges.forEach((y,x)=>{y!=null&&y<u&&v.push({datum:g,value:y,order:x+1})}):v.push({datum:g,order:1})});const m=k.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,g=>`${g[r]}-${g.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",g=>`range-box order-${g.order}`).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-range-box-update-enter",animate:t})).attr("d",g=>{let y,x,w,_;return g.order===1?(y=this.services.cartesianScales.getDomainValue(g.datum)-16/2,x=y+16,w=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(g.datum)-16/2,x=y+16,w=this.services.cartesianScales.getRangeValue(g.value),_=c),pe({x0:y,x1:x,y0:w,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=k.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:[ot.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const g=this.services.cartesianScales.getDomainValue(m)-4,y=g+8,x=this.services.cartesianScales.getRangeValue(0)+1,w=this.services.cartesianScales.getRangeValue(m);return pe({x0:g,x1:y,y0:x,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const v=k.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>b(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 g=this.services.cartesianScales.getDomainValue(m)-12,y=g+24,x=this.services.cartesianScales.getRangeValue(m.marker);return pe({x0:g,x1:y,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let v=[];s.filter(g=>b(g,"marker")!==null).forEach(g=>{const y=g.marker,x=g[o];v=v.concat([{datum:g,value:y*.25,barValue:x},{datum:g,value:y*.5,barValue:x},{datum:g,value:y*.75,barValue:x}])});const m=k.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",g=>`quartile ${g.value<=g.barValue?"over-bar":""}`).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:g,value:y})=>{let x=4;g.ranges&&g.ranges.indexOf(y)!==-1&&(x=8);const w=this.services.cartesianScales.getDomainValue(g)-x/2,_=w+x,S=this.services.cartesianScales.getRangeValue(y);return pe({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();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=b(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:a[r]})},{label:"Value",value:a[i]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[i]/a.marker*100)}%`},{label:"Performance",value:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}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 MN(e){return e}function CN(e){if(e==null)return MN;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 AN(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function $N(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return l0(e,n)})}:l0(e,t)}function l0(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Yu(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 Yu(e,t){var n=CN(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&&AN(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 RN(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 LN(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 DN(e){return Yu(e,kN.apply(this,arguments))}function kN(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 LN(Yu(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(g){n[g<0?~g:g].length<2&&c.push(g)})})}),c=RN(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 Xn{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===ee.VERTICAL?n:r),f=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(It(m,"data.x0"))<=h&&parseFloat(It(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Mv(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),g=parseFloat(It(m,"data.x0")),y=parseFloat(It(m,"data.x1")),x=this.model.getActiveDataGroupNames(),w=x.reverse().map(_=>({label:_,value:It(m,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(w.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:It(s,"bins.rangeLabel")||"Range",value:`${g} – ${y}`},...w,...b(s,"tooltip","showTotal")===!0?[{label:It(s,"tooltip.totalLabel")||"Total",value:x.reduce((S,T)=>S+parseFloat(It(m,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=d((g+y)/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 Go extends Xn{formatTooltipData(t){return t.reverse()}}const NN=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Bd();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},PN={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},UN={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},BN={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"},HN={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},VN={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},FN={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class c0 extends Wu{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}=k.getSVGElementSize(i,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Wt.color.barWidth&&!a){const o=b(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}=k.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}=k.getSVGElementSize(r,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const c=!Ke(s),u=Ag(this.model.getDisplayData()),d=!(i<=Wt.color.barWidth),h=d?Wt.color.barWidth:i,f=k.appendOrSelect(r,"g.legend"),p=k.appendOrSelect(f,"g.legend-axis");if(l){const T=k.appendOrSelect(r,"g.legend-title");k.appendOrSelect(T,"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 g=v==="diverge"?17:11;if(c)m=s;else for(let T=1;T<g+1;T++)m.push(a===js.LINEAR?`stop-color-${v}-${o}-${T}`:`fill-${v}-${o}-${T}`);const y=Oe(u[0],u[1]),x=$x(y,3),w=Ye().domain(u).range([0,h]),_=ol(w).tickSize(0).tickValues(x);let S;switch(a){case js.LINEAR:this.drawLinear(m,f,h);break;case js.QUANTIZE:S=this.drawQuantize(m,v,c,f,h),w.range([S,h]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Wt.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);k.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),k.appendOrSelect(n,"rect").attr("width",r).attr("height",Wt.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 k.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",Wt.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 GN extends Rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=i.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=k.appendOrSelect(i,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter");a=d!==null?d({datasetsTotal:r,total:i}):`${r} ${s} used (${u} ${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=k.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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),o=a!==null?a(i):`${r} ${s} total`,l=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof c!="string"?c-ie.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(d=>d),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=ie.status.indicatorSize/2,o=k.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${i-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=k.appendOrSelect(n,"text.meter-title"),i=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=ie.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+r.attr("x")+r.node().getComputedTextLength()+a).attr("y",r.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=k.appendOrSelect(this.parent,"tspan"),i=ie.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());k.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=b(this.getOptions(),"meter","proportional"),r=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const i=k.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=k.getSVGElementSize(i,{useBBox:!0}).width;return r-s-ie.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),s=ie.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=k.appendOrSelect(this.parent,"g.status-indicator").node(),l=k.getSVGElementSize(o,{useBBox:!0}).width+ie.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case Gs.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 Gs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Gs.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 Zu extends Et{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=k.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=b(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 zN extends Et{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:li.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}=k.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=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=Zi({children:s}).sum(p=>p.value).sort((p,v)=>v.value-p.value),d=z_().size([r,i]).padding(p=>p.depth>=1?li.padding.children+3:li.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:[ot.FILL,ot.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).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",li.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,oi),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))}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",li.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,oi)})}getZoomIcon(){return`
80
+ `;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 SN extends Et{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===ee.VERTICAL,[g,y]=Dn(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),v),x=Math.floor((m?h:f)/s.length),w=Math.min(x/2,16),_=this.model.getBoxplotData(),S=n.selectAll(".box-group").data(_);S.exit().remove();const O=S.enter().append("g").attr("class","box-group"),I=S.merge(O);O.append("path").merge(S.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Be.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i]),M=V,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.quartiles.q_25);return pe({x0:V,x1:M,y0:R,y1:E},v)}),O.append("path").merge(S.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Be.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i]),M=V,R=p.getRangeValue(A.whiskers.max),E=p.getRangeValue(A.quartiles.q_75);return pe({x0:V,x1:M,y0:R,y1:E},v)}),O.append("path").merge(S.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"box"})).attr("fill-opacity",Be.box.opacity.default).attr("stroke-width",Be.strokeWidth.default).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[i]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(Math[m?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),E=R+Math.abs(p.getRangeValue(A.quartiles.q_75)-p.getRangeValue(A.quartiles.q_25));return pe({x0:V,x1:M,y0:R,y1:E},v)}),O.append("path").merge(S.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.whiskers.max);return pe({x0:V,x1:M,y0:R,y1:E},v)}),O.append("path").merge(S.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Be.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/4,M=V+w/2,R=p.getRangeValue(A.whiskers.min),E=p.getRangeValue(A.whiskers.min);return pe({x0:V,x1:M,y0:R,y1:E},v)}),O.append("path").merge(S.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/2,M=V+w,R=p.getRangeValue(A.quartiles.q_50);return pe({x0:V,x1:M,y0:R,y1:R},v)}),O.append("path").merge(S.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Be.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:t})).attr("d",A=>{const V=p.getDomainValue(A[i])-w/4,M=V+w/2,R=p.getRangeValue(A.whiskers.max),E=p.getRangeValue(A.whiskers.max);return pe({x0:V,x1:M,y0:R,y1:E},v)});const U=I.selectAll("circle.outlier").data(A=>A.outliers.map(V=>({min:A.whiskers.min,max:A.whiskers.max,[i]:A[i],value:V})));U.exit().remove();const L=U.enter().append("circle");U.merge(L).attr("r",Be.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Be.circle.opacity.default).attr("cx",g).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:t})).attr("cy",y),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",Be.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[ot.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",Be.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",Be.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[ot.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",Be.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 yi extends Et{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=dg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.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 TN extends fn{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=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?ze(s):[1,1];return Ye().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]=Dn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ft.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:[ot.FILL,ot.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=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class ON extends Et{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(g=>{g.ranges?g.ranges.forEach((y,x)=>{y!=null&&y<u&&v.push({datum:g,value:y,order:x+1})}):v.push({datum:g,order:1})});const m=k.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,g=>`${g[r]}-${g.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",g=>`range-box order-${g.order}`).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-range-box-update-enter",animate:t})).attr("d",g=>{let y,x,w,_;return g.order===1?(y=this.services.cartesianScales.getDomainValue(g.datum)-16/2,x=y+16,w=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(g.datum)-16/2,x=y+16,w=this.services.cartesianScales.getRangeValue(g.value),_=c),pe({x0:y,x1:x,y0:w,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=k.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:[ot.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const g=this.services.cartesianScales.getDomainValue(m)-4,y=g+8,x=this.services.cartesianScales.getRangeValue(0)+1,w=this.services.cartesianScales.getRangeValue(m);return pe({x0:g,x1:y,y0:x,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const v=k.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>b(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 g=this.services.cartesianScales.getDomainValue(m)-12,y=g+24,x=this.services.cartesianScales.getRangeValue(m.marker);return pe({x0:g,x1:y,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let v=[];s.filter(g=>b(g,"marker")!==null).forEach(g=>{const y=g.marker,x=g[o];v=v.concat([{datum:g,value:y*.25,barValue:x},{datum:g,value:y*.5,barValue:x},{datum:g,value:y*.75,barValue:x}])});const m=k.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",g=>`quartile ${g.value<=g.barValue?"over-bar":""}`).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:g,value:y})=>{let x=4;g.ranges&&g.ranges.indexOf(y)!==-1&&(x=8);const w=this.services.cartesianScales.getDomainValue(g)-x/2,_=w+x,S=this.services.cartesianScales.getRangeValue(y);return pe({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();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=b(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:a[r]})},{label:"Value",value:a[i]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[i]/a.marker*100)}%`},{label:"Performance",value:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}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 MN(e){return e}function CN(e){if(e==null)return MN;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 AN(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function $N(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return l0(e,n)})}:l0(e,t)}function l0(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Yu(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 Yu(e,t){var n=CN(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&&AN(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 RN(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 LN(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 DN(e){return Yu(e,kN.apply(this,arguments))}function kN(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 LN(Yu(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(g){n[g<0?~g:g].length<2&&c.push(g)})})}),c=RN(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 Xn{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===ee.VERTICAL?n:r),f=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(It(m,"data.x0"))<=h&&parseFloat(It(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Mv(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),g=parseFloat(It(m,"data.x0")),y=parseFloat(It(m,"data.x1")),x=this.model.getActiveDataGroupNames(),w=x.reverse().map(_=>({label:_,value:It(m,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(w.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:It(s,"bins.rangeLabel")||"Range",value:`${g} – ${y}`},...w,...b(s,"tooltip","showTotal")===!0?[{label:It(s,"tooltip.totalLabel")||"Total",value:x.reduce((S,O)=>S+parseFloat(It(m,`data.${O}`)),0)}]:[]]}),f.attr("opacity",1);const _=d((g+y)/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 Xn{formatTooltipData(t){return t.reverse()}}const NN=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Bd();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},PN={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},UN={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},BN={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"},HN={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},VN={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},FN={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class c0 extends Wu{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}=k.getSVGElementSize(i,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Wt.color.barWidth&&!a){const o=b(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}=k.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}=k.getSVGElementSize(r,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const c=!Ke(s),u=Ag(this.model.getDisplayData()),d=!(i<=Wt.color.barWidth),h=d?Wt.color.barWidth:i,f=k.appendOrSelect(r,"g.legend"),p=k.appendOrSelect(f,"g.legend-axis");if(l){const O=k.appendOrSelect(r,"g.legend-title");k.appendOrSelect(O,"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 g=v==="diverge"?17:11;if(c)m=s;else for(let O=1;O<g+1;O++)m.push(a===js.LINEAR?`stop-color-${v}-${o}-${O}`:`fill-${v}-${o}-${O}`);const y=Te(u[0],u[1]),x=$x(y,3),w=Ye().domain(u).range([0,h]),_=ol(w).tickSize(0).tickValues(x);let S;switch(a){case js.LINEAR:this.drawLinear(m,f,h);break;case js.QUANTIZE:S=this.drawQuantize(m,v,c,f,h),w.range([S,h]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Wt.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);k.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),k.appendOrSelect(n,"rect").attr("width",r).attr("height",Wt.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 k.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",Wt.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 zN extends Rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=i.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=k.appendOrSelect(i,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter");a=d!==null?d({datasetsTotal:r,total:i}):`${r} ${s} used (${u} ${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=k.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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),o=a!==null?a(i):`${r} ${s} total`,l=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof c!="string"?c-ie.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(d=>d),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=ie.status.indicatorSize/2,o=k.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${i-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=k.appendOrSelect(n,"text.meter-title"),i=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=ie.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+r.attr("x")+r.node().getComputedTextLength()+a).attr("y",r.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=k.appendOrSelect(this.parent,"tspan"),i=ie.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());k.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=b(this.getOptions(),"meter","proportional"),r=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const i=k.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=k.getSVGElementSize(i,{useBBox:!0}).width;return r-s-ie.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),s=ie.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=k.appendOrSelect(this.parent,"g.status-indicator").node(),l=k.getSVGElementSize(o,{useBBox:!0}).width+ie.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case zs.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 zs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case zs.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 Zu extends Et{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=k.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=b(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 GN extends Et{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:li.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}=k.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=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=Zi({children:s}).sum(p=>p.value).sort((p,v)=>v.value-p.value),d=G_().size([r,i]).padding(p=>p.depth>=1?li.padding.children+3:li.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:[ot.FILL,ot.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).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",li.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,oi),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))}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",li.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,oi)})}getZoomIcon(){return`
81
81
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
82
82
  <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"/>
83
83
  <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"/>
84
- </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=b(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:It(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=b(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,oi)}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,oi),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 jN(e,t){const n=Di(this._current,e);return r=>(this._current=n(r),t(this._current))}class u0 extends Et{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Pt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(T=>T[a]>0),l=this.computeRadius();this.arc=is().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=is().innerRadius(this.getInnerRadius()).outerRadius(l+Pt.hoverArc.outerRadiusOffset);const c=VS().value(T=>T[a]).sort(b(i,"pie","sortFunction")).padAngle(Pt.padAngle)(o),u=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,T=>T.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",T=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:T.data[s],originalClassName:"slice"})).style("fill",T=>n.model.getFillColor(T.data[s])).attr("d",this.arc).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${iu(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return jN.bind(this)(T,n.arc)});const d=i.pie.labels.enabled,h=d?c.filter(T=>T.data[a]>0):[],f=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(h,T=>T.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),v=[];p.merge(f).style("text-anchor","middle").text(T=>i.pie.labels.formatter?i.pie.labels.formatter({...T,percentageValue:iu(T.data[a],o,a,!0)}):iu(T.data[a],o,a)+"%").datum(function(T){const I=l+7,U=(T.endAngle-T.startAngle)/2+T.startAngle,L=U/Math.PI*180,A=this.getComputedTextLength();return T.textOffsetX=A/2,T.textOffsetY=L>90&&L<270?10:0,T.xPosition=(T.textOffsetX+I)*Math.sin(U),T.yPosition=(T.textOffsetY+I)*-Math.cos(U),T}).attr("transform",function(T,I){const U=h.length,L=(T.endAngle-T.startAngle)*(180/Math.PI);if(I>=U-2&&L<Pt.callout.minSliceDegree){let A,V;return T.index===U-1?(A=T.xPosition+Pt.callout.offsetX+Pt.callout.textMargin+T.textOffsetX,V=T.yPosition-Pt.callout.offsetY,T.direction=Fs.RIGHT,v.push(T)):(A=T.xPosition-Pt.callout.offsetX-T.textOffsetX-Pt.callout.textMargin,V=T.yPosition-Pt.callout.offsetY,T.direction=Fs.LEFT,v.push(T)),`translate(${A}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(v);const m=b(i,"donut")?"donut":"pie",g=b(i,m,"alignment"),{width:y}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),x=d?Pt.xOffset:0,w=d?Pt.yOffset:0;let _=l+x;g===Kt.CENTER?_=y/2:g===Kt.RIGHT&&(_=y-l-Pt.xOffset);let S=l+w;v.length>0&&(S+=Pt.yOffsetCallout),r.attr("x",_+7).attr("y",S),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.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",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===Fs.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Pt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Pt.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);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);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(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}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Pt.radiusOffset:i}}class WN extends u0{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=k.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=b(i,"donut","center","label");k.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!==""&&k.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=b(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=md:s=Oe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const h0="4,10 8,6 12,10",d0="12,6 8,10 4,6";class qN extends Et{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 Tv(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 b(t,"gauge","type")===Nr.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(b(n,"gauge","deltaArrow","direction")){case Jo.UP:return h0;case Jo.DOWN:return d0;default:return t>0?h0:d0}}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),k.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:[ot.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",g=>g),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=b(r,"gauge","alignment"),{width:v}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;p===Kt.CENTER?m=v/2:p===Kt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===Nr.FULL&&!s?d=l(a):r===Nr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),v=b(n,"gauge","numberFormatter"),m=p.selectAll("text.gauge-value-number").data([i]);m.enter().append("text").attr("class","gauge-value-number").merge(m).style("font-size",`${f}px`).attr("text-anchor","middle").text(T=>v(T));const{width:g}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,x=u?"%":"",w=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",g/2).text(x),{width:_,height:S}=k.getSVGElementSize(w,{useBBox:!0});w.attr("y",`-${S/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?b(r,"gauge","deltaFontSize"):()=>0,o=i?b(r,"gauge","numberFormatter"):()=>null,l=b(r,"gauge","deltaArrow","size"),c=b(r,"gauge","numberSpacing"),u=b(r,"gauge","showPercentageSymbol"),d=k.appendOrSelect(n,"g.gauge-numbers"),h=k.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=k.appendOrSelect(h,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),m=b(r,"gauge","deltaArrow","enabled"),g=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&m?[i]:[]);g.enter().append("svg").merge(g).attr("class","gauge-delta-arrow").attr("x",-l(s)-v/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=D(this);k.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=b(r,"gauge","status");k.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),g.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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=b(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===Nr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class f0 extends Zu{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=bs(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",ft.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()===ee.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:[ot.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).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.getValueThroughAxisPosition(v,0),g=this.services.cartesianScales.getRangeValue(u),y=this.services.cartesianScales.getDomainValue(u)-h/2,x=y+h;if(!this.isOutsideZoomedDomain(y,x))return pe({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.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=b(t,"bars","width"),r=b(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 YN extends Et{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)}, ${Vn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Vn(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(""),b(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=>v.index===-1||v.value===null?`url(#${f})`:this.model.getFillColor(Number(v.value))).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=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==Ti.OFF&&(t===Ti.AUTO&&ng.minCellDividerDimension<=this.xBandwidth&&ng.minCellDividerDimension<=this.yBandwidth||t===Ti.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=It(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const f=_s(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||"Total",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 ZN extends Et{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=>It(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(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:[ot.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=It(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()===ee.VERTICAL?m+=1:m-=1),pe({x0:f,x1:p,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0);const o=parseFloat(It(s,"data.x0")),l=parseFloat(It(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:It(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:s[n]})},{label:u,value:It(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.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 fn{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]?Rn.weight.unselected:Rn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Rn.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?Rn.opacity.unselected:Rn.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",Rn.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]=Dn(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:[ot.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===ee.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 KN extends Et{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)-ie.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ie.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=b(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;b(i,"meter","proportional")===null?u=100:u=b(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=Ye().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=b(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?ie.height.proportional:ie.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?ie.height.proportional:ie.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",x=>x.x).attr("y",0).attr("height",()=>f||(s?ie.height.proportional:ie.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:x[c],originalClassName:v})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?d(u):x.width).style("fill",x=>n.model.getFillColor(x[c])).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),p.exit().remove();const m=b(i,"meter","peak");let g=m;m!==null&&(m>u?g=u:m<a[0].value&&(g=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(g==null?[]:[g]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?ie.height.proportional:ie.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>d(x)).attr("x2",x=>d(x)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(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 QN extends Et{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=kk(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}=b(n,"radar","axes"),s=b(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}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:v,xAxisRectHeight:m}=Sr;this.uniqueKeys=Array.from(new Set(s.map(M=>M[u]))),this.uniqueGroups=Array.from(new Set(s.map(M=>M[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const g=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-g)/2;if(y<=0)return;const x=Qi().domain(this.fullDataNormalized.map(M=>M[u])).range([0,2*Math.PI].map(M=>M-Math.PI/2)),w=Vn(this.fullDataNormalized.map(M=>M[d])),_=Ye().domain([w>=0?0:w,sr(this.fullDataNormalized.map(M=>M[d]))]).range([v,y]).nice(p),S=_.ticks(p),T=M=>this.model.getFillColor(M),I=zS().angle(M=>x(M[u])+Math.PI/2).radius(M=>_(M[d])).curve(Ip),U=this.uniqueKeys.map(M=>{const R=this.getLabelDimensions(M).width,E=eD(x(M),y);return R+E}),L={x:sr(U)+h,y:i/2},A=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(S,M=>M),V=M=>this.uniqueKeys.map(R=>({[u]:R,[d]:M}));A.join(M=>M.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",E=>I(V(E)))),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",E=>I(V(E)))),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_exit",animate:t})).attr("d",E=>I(V(E))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,M=>M).join(M=>M.append("line").attr("opacity",0).attr("class",R=>`x-axis-${fi(R)}`).attr("stroke-dasharray","0").attr("x1",R=>Yt(x(R),0,L).x).attr("y1",R=>Yt(x(R),0,L).y).attr("x2",R=>Yt(x(R),0,L).x).attr("y2",R=>Yt(x(R),0,L).y).call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",E=>Yt(x(E),_.range()[0],L).x).attr("y1",E=>Yt(x(E),_.range()[0],L).y).attr("x2",E=>Yt(x(E),_.range()[1],L).x).attr("y2",E=>Yt(x(E),_.range()[1],L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",E=>Yt(x(E),_.range()[0],L).x).attr("y1",E=>Yt(x(E),_.range()[0],L).y).attr("x2",E=>Yt(x(E),_.range()[1],L).x).attr("y2",E=>Yt(x(E),_.range()[1],L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(M=>M.append("text").text(R=>R).attr("opacity",0).attr("x",R=>Yt(x(R),_.range()[1]+h,L).x).attr("y",R=>Yt(x(R),_.range()[1]+h,L).y).style("text-anchor",R=>qg(x(R)).textAnchor).style("dominant-baseline",R=>qg(x(R)).dominantBaseline).call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",E=>Yt(x(E),_.range()[1]+h,L).x).attr("y",E=>Yt(x(E),_.range()[1]+h,L).y).end().finally(()=>{const E=b(o,"radar","alignment"),B=this.getAlignmentXOffset(E,n,this.getParent());n.attr("x",B)})),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,M=>M.name).join(M=>M.append("path").attr("class",R=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:R.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",R=>R.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",R=>T(R.name)).style("fill-opacity",Sr.opacity.selected).style("stroke",R=>T(R.name)).call(R=>{const E=R.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_enter",animate:t}));t&&E.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),E.attr("opacity",1).attr("d",B=>I(B.data))}),M=>(M.attr("class",R=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:R.name,originalClassName:"blob"})).style("fill",R=>T(R.name)).style("stroke",R=>T(R.name)),M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",E=>I(E.data))),M),M=>M.call(R=>{const E=R.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_exit",animate:t}));t&&E.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),E.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(M=>b(M,d)!==null)).join(M=>M.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",R=>R[c]),M=>M,M=>M.remove()).attr("class",M=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:M[l],originalClassName:fi(M[u])})).attr("cx",M=>Yt(x(M[u]),_(M[d]),L).x).attr("cy",M=>Yt(x(M[u]),_(M[d]),L).y).attr("r",0).attr("opacity",0).style("fill",M=>T(M[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(M=>M.append("rect"),M=>M,M=>M.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",M=>`rotate(${Yg(x(M))}, ${L.x}, ${L.y})`),k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Ge(S)).join(M=>M.append("text").attr("opacity",0).text(R=>R).attr("x",R=>Yt(-Math.PI/2,_(R),L).x+f).attr("y",R=>Yt(-Math.PI/2,_(R),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_update",animate:t})).text(E=>E).attr("opacity",1).attr("x",E=>Yt(-Math.PI/2,_(E),L).x+f).attr("y",E=>Yt(-Math.PI/2,_(E),L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Kt.CENTER?a=Math.floor((s-i.width)/2):t===Kt.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}}=b(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-${fi(i)}`),o=t.parent.selectAll(`.dots circle.${fi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(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]),class:t.model.getColorClassName({classNameTypes:[ot.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-${fi(i)}`),o=t.parent.selectAll(`.dots circle.${fi(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 p0 extends Zu{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:[ot.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).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 g=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,g)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-p);if(m!==0&&m<2&&(d>0&&a===ee.VERTICAL||d<0&&a===ee.HORIZONTAL?v=p-2:v=p+2),!this.isOutsideZoomedDomain(h,f))return pe({x0:h,x1:f,y0:p,y1:v},a)}).attr("opacity",1).attr("role",ft.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 JN extends ge{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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=k.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=k.appendOrSelect(t,"svg.chart-skeleton.DAII"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class m0 extends Et{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=>b(s,0,i)!==n.datum().name?$n.opacity.unselected:$n.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",$n.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=b(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=>b(f,0,s));this.areaGenerator=Mc().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=>b(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:b(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(b(f,0,s))).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>b(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",$n.opacity.selected).attr("d",this.areaGenerator)}}class g0 extends Zu{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=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let 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()===ee.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===ee.VERTICAL?v+=1:v-=1)}return pe({x0:h,x1:f,y0:p,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,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(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=b(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 v0 extends fn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!b(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=>b(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ft.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),g=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,[g]: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 tP extends Et{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}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(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=Zi({name:o,children:a}),f=10,p=r/6,v=S=>{const T=h.descendants().reverse(),I=h.links();let U=h,L=h;h.eachBefore(P=>{P.x<U.x&&(U=P),P.x>L.x&&(L=P)});const A=L.x-U.x,V=n.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,U.x,r,A].join(" ")),M=_.selectAll("g").data(T,P=>P.id),R=this,E=M.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",P=>P.depth!==0&&P.children&&P.children.length>0?"clickable":null).on("mouseover",function(P,N){R.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:P,element:D(this),datum:N})}).on("click",function(P,N){N.depth!==0&&(N.children=N.children?null:N._children,v(N)),R.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:P,element:D(this),datum:N})}).on("mouseout",function(P,N){R.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:P,element:D(this),datum:N})});E.append("circle").attr("r",2.5).attr("class",P=>P._children?"parent":"child").attr("stroke-width",10),E.append("text").attr("dy","0.31em").attr("x",P=>P._children?-xi:xi).attr("text-anchor",P=>P._children?"end":"start").text(P=>P.data.name).clone(!0).attr("class","text-stroke").lower(),M.merge(E).transition(V).attr("transform",P=>`translate(${P.y},${P.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),M.exit().transition(V).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const B=w.selectAll("path").data(I,P=>P.target.id),H=B.enter().append("path").attr("d",()=>{const P={x:S.x0,y:S.y0};return x({source:P,target:P})});B.merge(H).transition(V).attr("d",x),B.exit().transition(V).remove().attr("d",()=>{const P={x:S.x,y:S.y};return x({source:P,target:P})}),h.eachBefore(P=>{P.x0=P.x,P.y0=P.y})},m=h.descendants(),g=m[m.length-1].depth,y=b(s,"tree","type")===Qo.DENDROGRAM?h_().size([i,r-u-g*xi-l]):Q_().nodeSize([f,p]).size([i,r-u-g*xi-l]),x=XS().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,T)=>{S.id=T,S._children=S.children}),y(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 eP="#000000",nP="#ffffff",rP="#fcf4d6",iP="#fddc69",sP="#f1c21b",aP="#d2a106",oP="#b28600",lP="#8e6a00",cP="#684e00",uP="#483700",hP="#302400",dP="#1c1500",fP={10:rP,20:iP,30:sP,40:aP,50:oP,60:lP,70:cP,80:uP,90:hP,100:dP},pP="#fff2e8",mP="#ffd9be",gP="#ffb784",vP="#ff832b",yP="#eb6200",xP="#ba4e00",bP="#8a3800",EP="#5e2900",_P="#3e1a00",wP="#231000",SP={10:pP,20:mP,30:gP,40:vP,50:yP,60:xP,70:bP,80:EP,90:_P,100:wP},OP="#fff1f1",TP="#ffd7d9",MP="#ffb3b8",CP="#ff8389",AP="#fa4d56",$P="#da1e28",RP="#a2191f",LP="#750e13",DP="#520408",kP="#2d0709",IP={10:OP,20:TP,30:MP,40:CP,50:AP,60:$P,70:RP,80:LP,90:DP,100:kP},NP="#fff0f7",PP="#ffd6e8",UP="#ffafd2",BP="#ff7eb6",HP="#ee5396",VP="#d02670",FP="#9f1853",GP="#740937",zP="#510224",jP="#2a0a18",WP={10:NP,20:PP,30:UP,40:BP,50:HP,60:VP,70:FP,80:GP,90:zP,100:jP},qP="#f6f2ff",YP="#e8daff",ZP="#d4bbff",XP="#be95ff",KP="#a56eff",QP="#8a3ffc",JP="#6929c4",tU="#491d8b",eU="#31135e",nU="#1c0f30",rU={10:qP,20:YP,30:ZP,40:XP,50:KP,60:QP,70:JP,80:tU,90:eU,100:nU},iU="#edf5ff",sU="#d0e2ff",aU="#a6c8ff",oU="#78a9ff",lU="#4589ff",cU="#0f62fe",uU="#0043ce",hU="#002d9c",dU="#001d6c",fU="#001141",pU={10:iU,20:sU,30:aU,40:oU,50:lU,60:cU,70:uU,80:hU,90:dU,100:fU},mU="#e5f6ff",gU="#bae6ff",vU="#82cfff",yU="#33b1ff",xU="#1192e8",bU="#0072c3",EU="#00539a",_U="#003a6d",wU="#012749",SU="#061727",OU={10:mU,20:gU,30:vU,40:yU,50:xU,60:bU,70:EU,80:_U,90:wU,100:SU},TU="#d9fbfb",MU="#9ef0f0",CU="#3ddbd9",AU="#08bdba",$U="#009d9a",RU="#007d79",LU="#005d5d",DU="#004144",kU="#022b30",IU="#081a1c",NU={10:TU,20:MU,30:CU,40:AU,50:$U,60:RU,70:LU,80:DU,90:kU,100:IU},PU="#defbe6",UU="#a7f0ba",BU="#6fdc8c",HU="#42be65",VU="#24a148",FU="#198038",GU="#0e6027",zU="#044317",jU="#022d0d",WU="#071908",qU={10:PU,20:UU,30:BU,40:HU,50:VU,60:FU,70:GU,80:zU,90:jU,100:WU},YU="#f2f4f8",ZU="#dde1e6",XU="#c1c7cd",KU="#a2a9b0",QU="#878d96",JU="#697077",tB="#4d5358",eB="#343a3f",nB="#21272a",rB="#121619",iB={10:YU,20:ZU,30:XU,40:KU,50:QU,60:JU,70:tB,80:eB,90:nB,100:rB},sB="#f4f4f4",aB="#e0e0e0",oB="#c6c6c6",lB="#a8a8a8",cB="#8d8d8d",uB="#6f6f6f",hB="#525252",dB="#393939",fB="#262626",pB="#161616",mB={10:sB,20:aB,30:oB,40:lB,50:cB,60:uB,70:hB,80:dB,90:fB,100:pB},gB="#f7f3f2",vB="#e5e0df",yB="#cac5c4",xB="#ada8a8",bB="#8f8b8b",EB="#726e6e",_B="#565151",wB="#3c3838",SB="#272525",OB="#171414",TB={10:gB,20:vB,30:yB,40:xB,50:bB,60:EB,70:_B,80:wB,90:SB,100:OB},y0={black:{100:eP},blue:pU,coolGray:iB,cyan:OU,gray:mB,green:qU,magenta:WP,orange:SP,purple:rU,red:IP,teal:NU,warmGray:TB,white:{0:nP},yellow:fP};const MB=e=>{if(!e)return null;for(const t of Object.keys(y0)){const n=y0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},x0=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=yn(t);let r;if(n&&(r=MB(n?n.hex():null)),r==null){const i=gl(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let CB=0;class AB extends Et{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=b(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Zi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=rw().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",()=>CB++).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:[ot.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)}),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=gl(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",x0).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",x0),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);return l&&(s=l),yn(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)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}class $B extends Et{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}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=HD().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=k.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(p,g=>`${g[c]}-${g.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",g=>`${g.size}px`).text(function(g){return g.text}).attr("class",g=>n.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:g[c],originalClassName:`word ${g.size>32?"light":""}`})).style("fill",g=>n.model.getFillColor(g[c],g.text,g)).attr("text-anchor","middle").transition().call(g=>n.services.transitions.setupTransition({transition:g,name:"wordcloud-text-update-enter",animate:t})).attr("transform",g=>`translate(${g.x}, ${g.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=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ge(i):[1,1];return Ye().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=bo(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.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[ot.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 RB extends Et{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=b(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=DN(s,Object.values(l)),u=$N(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=PE().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=k.appendOrSelect(t,"defs");k.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=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case vn.geoEqualEarth:t=n_();break;case vn.geoAlbers:t=ZE();break;case vn.geoConicEqualArea:t=Nf();break;case vn.geoConicEquidistant:t=t_();break;case vn.geoEquirectangular:t=QE();break;case vn.geoMercator:t=XE();break;case vn.geoNaturalEarth1:t=r_();break;default:throw new Error("Projection is not supported.")}return t}}class LB extends RB{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(kr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.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(kr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(kr.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(kr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.HIDE,{event:r,hoveredElement:s})})}}function b0(e){var t=e==null?0:e.length;return t?co(e,1):[]}class DB extends In{zoomIn(t,n,r){let i,s,a;const o=r||oi;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=k.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||oi;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class kB extends In{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 IB extends In{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 NB extends In{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(b(ig,n,"duration")||ig.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ls(e,t){const n=St(e),r=St(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function PB(e,t){const n=St(e),r=St(t);return n.getFullYear()-r.getFullYear()}function UB(e,t){const n=St(e),r=St(t),i=Ls(n,r),s=Math.abs(PB(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Ls(n,r)===-i,o=i*(s-+a);return o===0?0:o}function Xu(e,t){const n=St(e);if(isNaN(t))return Je(e,NaN);if(!t)return n;const r=n.getDate(),i=Je(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 E0(e,t){return Xu(e,t*12)}function BB(e,t){return E0(e,-t)}function HB(e,t){const n=St(e),r=St(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function VB(e){const t=St(e);return t.setHours(23,59,59,999),t}function FB(e){const t=St(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function GB(e){const t=St(e);return+VB(t)==+FB(t)}function zB(e,t){const n=St(e),r=St(t),i=Ls(n,r),s=Math.abs(HB(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=Ls(n,r)===-i;GB(St(e))&&s===1&&Ls(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function jB(e,t){return Xu(e,-t)}function WB(e,t){const n=St(e),r=St(t),i=_0(n,r),s=Math.abs(yg(n,r));n.setDate(n.getDate()-i*s);const a=+(_0(n,r)===-i),o=i*(s-a);return o===0?0:o}function _0(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 w0(e,t){const n=St(e);return isNaN(t)?Je(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function qB(e,t){return w0(e,-t)}function Ku(e,t){return St(e).getTime()-St(t).getTime()}function Qu(e){return e?Math[e]:Math.trunc}function YB(e,t,n){const r=Ku(e,t)/mg;return Qu(n==null?void 0:n.roundingMethod)(r)}function Ju(e,t){const n=+St(e);return Je(e,n+t)}function S0(e,t){return Ju(e,t*mg)}function ZB(e,t){return S0(e,-t)}function O0(e,t,n){const r=Ku(e,t)/pg;return Qu(n==null?void 0:n.roundingMethod)(r)}function th(e,t){return Ju(e,t*pg)}function T0(e,t){return th(e,-t)}function M0(e,t,n){const r=Ku(e,t)/1e3;return Qu(n==null?void 0:n.roundingMethod)(r)}function eh(e,t){return Ju(e,t*1e3)}function C0(e,t){return eh(e,-t)}class XB extends In{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=b(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=b(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 b(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===G.BOTTOM||t===G.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(G).map(t=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=ee.VERTICAL:this.orientation=ee.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=b(s,"axes");((t=a[G.LEFT])!=null&&t.correspondingDatasets&&a[G.RIGHT]||(n=a[G.RIGHT])!=null&&n.correspondingDatasets&&a[G.LEFT]||(r=a[G.TOP])!=null&&r.correspondingDatasets&&a[G.BOTTOM]||(i=a[G.BOTTOM])!=null&&i.correspondingDatasets&&a[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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=b(s,"axes")[r],{mapsTo:o}=a,l=b(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=b(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===et.TIME){const s=b(r,"timeScale","addSpaceOnEdges");return KB(n,s)}else return QB(n,jn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.LEFT)===null&&b(n,G.RIGHT)!==null||b(n,G.RIGHT,"main")===!0||r&&b(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.BOTTOM)===null&&b(n,G.TOP)!==null||b(n,G.TOP,"main")===!0||r&&b(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),s=b(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=b(n,"axes",t),i=b(n,"bounds"),{includeZero:s}=r,a=b(r,"scaleType")||et.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:g}=this.model.getBinConfigurations();return[0,sr(g,y=>y.length)]}else if(r.limitDomainToBins){const{bins:g}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:g});return[y[0].split(":")[0],y[y.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=jn.ratio;if(r.domain)return a===et.LABELS?r.domain:(a===et.TIME&&(r.domain=r.domain.map(g=>g.getTime===void 0?new Date(g):g)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===et.LABELS)return bs(o.map(g=>g[c]));let p,v;const m=this.model.getDataGroupNames();if(a===et.LABELS_RATIO)return o.map(g=>`${g[h]}/${g[f]}`);if(a===et.TIME)v=o.map(g=>+new Date(g[c]));else if(i&&n.axes)v=[],o.forEach(g=>{v.push(g[c]),g[i.upperBoundMapsTo]&&v.push(g[i.upperBoundMapsTo]),g[i.lowerBoundMapsTo]&&v.push(g[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:g}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:m}),x=o.filter(_=>!m.includes(_[g])),w=[];y.forEach(_=>{const{...S}=_;let T=0,I=0;Object.values(S).forEach(U=>{isNaN(U)||(U<0?I+=U:T+=U)}),w.push([I,T])}),v=[...b0(w),...x.map(_=>_[c])]}else v=[],o.forEach(g=>{const y=g[c];Array.isArray(y)&&y.length===2?(v.push(y[0]),v.push(y[1])):(l&&v.push(Math.max(g[c],g[l])),v.push(y))});return a!==et.TIME&&a!==et.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(g=>{const y=b(g,"value");y!==null&&v.push(y)}),p=Ge(v),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||et.LINEAR;this.scaleTypes[t]=i;let s;return i===et.TIME?s=_p():i===et.LOG?s=rp().base(r.base||10):i===et.LABELS||i===et.LABELS_RATIO?s=Qi():s=Ye(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=b(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=b(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 KB(e,t){const n=new Date(e[0]),r=new Date(e[1]);return UB(r,n)>1?[BB(n,t),E0(r,t)]:zB(r,n)>1?[jB(n,t),Xu(r,t)]:WB(r,n)>1?[qB(n,t),w0(r,t)]:YB(r,n)>1?[ZB(n,t),S0(r,t)]:O0(r,n)>30?[T0(n,t*30),th(r,t*30)]:O0(r,n)>1?[T0(n,t),th(r,t)]:M0(r,n)>15?[C0(n,t*15),eh(r,t*15)]:M0(r,n)>1?[C0(n,t),eh(r,t)]:[n,r]}function QB([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]}class JB extends In{constructor(){super(...arguments),this.curveTypes={curveLinear:Ya,curveLinearClosed:Ip,curveBasis:KS,curveBasisClosed:QS,curveBasisOpen:JS,curveBundle:tO,curveCardinal:eO,curveCardinalClosed:nO,curveCardinalOpen:rO,curveCatmullRom:iO,curveCatmullRomClosed:sO,curveCatmullRomOpen:aO,curveMonotoneX:oO,curveMonotoneY:lO,curveNatural:cO,curveStep:uO,curveStepAfter:dO,curveStepBefore:hO}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class tH extends In{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===G.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=b(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,Ge(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 b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=b(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=Me.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=b(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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function eH(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 nH(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:eH(e,t,n)}var rH="\\ud800-\\udfff",iH="\\u0300-\\u036f",sH="\\ufe20-\\ufe2f",aH="\\u20d0-\\u20ff",oH=iH+sH+aH,lH="\\ufe0e\\ufe0f",cH="\\u200d",uH=RegExp("["+cH+rH+oH+lH+"]");function A0(e){return uH.test(e)}function hH(e){return e.split("")}var $0="\\ud800-\\udfff",dH="\\u0300-\\u036f",fH="\\ufe20-\\ufe2f",pH="\\u20d0-\\u20ff",mH=dH+fH+pH,gH="\\ufe0e\\ufe0f",vH="["+$0+"]",nh="["+mH+"]",rh="\\ud83c[\\udffb-\\udfff]",yH="(?:"+nh+"|"+rh+")",R0="[^"+$0+"]",L0="(?:\\ud83c[\\udde6-\\uddff]){2}",D0="[\\ud800-\\udbff][\\udc00-\\udfff]",xH="\\u200d",k0=yH+"?",I0="["+gH+"]?",bH="(?:"+xH+"(?:"+[R0,L0,D0].join("|")+")"+I0+k0+")*",EH=I0+k0+bH,_H="(?:"+[R0+nh+"?",nh,L0,D0,vH].join("|")+")",wH=RegExp(rh+"(?="+rh+")|"+_H+EH,"g");function SH(e){return e.match(wH)||[]}function OH(e){return A0(e)?SH(e):hH(e)}function TH(e){return function(t){t=ys(t);var n=A0(t)?OH(t):void 0,r=n?n[0]:t.charAt(0),i=n?nH(n,1).join(""):t.slice(1);return r[e]()+i}}var MH=TH("toUpperCase");const CH=MH;function AH(e){return CH(ys(e).toLowerCase())}var $H=Ov(function(e,t,n){return t=t.toLowerCase(),e+(n?AH(t):t)});const RH=$H;class en{constructor(t,n){this.components=[],this.services={canvasZoom:DB,domUtils:k,events:kB,files:IB,gradientUtils:mu,transitions:NB},this.model=new hn(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=!!b(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=b(r,"toolbar","enabled"),s={id:"legend",components:[new Wu(this.model,this.services)],growth:ht.PREFERRED},a=b(r,"canvasZoom","enabled");a&&a===!0&&t.push(new gN(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Rs(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new $e(this.model,this.services,[l,...i?[c]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:b(n,"graphFrameRenderType")||rt.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=kt.COLUMN;if(h){const g=b(r,"legend","position");g==="left"?(f=kt.ROW,r.legend.orientation||(r.legend.orientation=Oi.VERTICAL)):g==="right"?(f=kt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Oi.VERTICAL)):g==="bottom"&&(f=kt.COLUMN_REVERSE)}const p={id:"spacer",components:[new Nn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new $e(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const g={id:"spacer",components:[new Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(g)}return m.push(v),[new qu(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,m,{direction:kt.COLUMN})]}}class _e extends en{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:XB,curves:JB,zoom:tH}),this.model=new Mr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",G.TOP,"enabled"),s=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===et.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Rs(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},f={id:"header",components:[new $e(this.model,this.services,[d,...s?[h]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},p={id:"legend",components:[new Wu(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new t0(this.model,this.services),new vN(this.model,this.services)),t.push(new xN(this.model,this.services)),t.push(new bN(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let g=kt.COLUMN;if(m){const S=b(this.model.getOptions(),"legend","position");S===Si.LEFT?(g=kt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Oi.VERTICAL)):S===Si.RIGHT?(g=kt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Oi.VERTICAL)):S===Si.BOTTOM&&(g=kt.COLUMN_REVERSE)}const y={id:"spacer",components:[new Nn(this.model,this.services)],growth:ht.PREFERRED},x={id:"full-frame",components:[new $e(this.model,this.services,[...m?[p]:[],...m?[y]:[],v],{direction:g})],growth:ht.STRETCH},w={id:"zoom-bar",components:[new yN(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},_=[];if(u||s){_.push(f);const S={id:"spacer",components:[new Nn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};_.push(S)}return l&&_.push(w),_.push(x),[new i0(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,_,{direction:kt.COLUMN})]}}class LH extends en{constructor(t,n){super(t,n),this.model=new NR(this.services),this.model.setOptions(Ft(Dt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class DH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(An(Dt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new vi(this.model,this.services),new s0(this.model,this.services),new fn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class kH extends _e{constructor(t,n){super(t,n),this.model=new PR(this.services),this.model.setOptions(Ft(Dt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new SN(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class IH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new ON(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class NH extends _e{constructor(t,n){super(t,n),this.model=new UR(this.services),this.model.setOptions(Ft(Dt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new TN(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class PH extends en{constructor(t,n){super(t,n),this.model=new BR(this.services),this.model.setOptions(Ft(Dt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Rs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new $e(this.model,this.services,[a,...i?[o]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new c0(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=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=kt.COLUMN_REVERSE,f={id:"spacer",components:[new Nn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new $e(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 Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new qu(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,v,{direction:kt.COLUMN})]}getComponents(){const t=[new LB(this.model,this.services)];return this.getChartComponents(t)}}class UH extends en{constructor(t,n){super(t,n),this.model=new HR(this.services),this.model.setOptions(Ft(Dt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new zN(this.model,this.services)];return this.getChartComponents(t)}}const N0={[ke.LINE]:[vi,fn],[ke.SCATTER]:[fn],[ke.AREA]:[s0,vi,fn],[ke.STACKED_AREA]:[m0,vi,v0,Go],[ke.SIMPLE_BAR]:[p0],[ke.GROUPED_BAR]:[f0,yi],[ke.STACKED_BAR]:[g0,Go]};class BH extends _e{constructor(t,n){super(t,n);const r=Ft(Dt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ke.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(N0).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=`${RH(i.type)}Chart`;return a=lt({},Dt[l],this.model.getOptions(),i.options),i.type===ke.STACKED_AREA&&(o=!0),N0[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 b0(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ke.STACKED_BAR||i.type===ke.STACKED_AREA),r=[new Ee(this.model,this.services),new Re(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID}),...n?[]:[new Xn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class P0 extends en{constructor(t,n,r=!1){super(t,n),this.model=new VR(this.services),!r&&(this.model.setOptions(Ft(Dt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new u0(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.PIE})];return this.getChartComponents(t)}}class HH extends P0{constructor(t,n){super(t,n,!0),this.model.setOptions(Ft(Dt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new WN(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.DONUT})];return this.getChartComponents(t)}}class VH extends en{constructor(t,n){super(t,n),this.model=new FR(this.services),this.model.setOptions(Ft(Dt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class FH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new f0(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class GH extends _e{constructor(t,n){super(t,n),this.model=new GR(this.services),this.model.setOptions(Ft(Dt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(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 Rs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new $e(this.model,this.services,[a,...i?[o]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new c0(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=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=kt.COLUMN_REVERSE,f={id:"spacer",components:[new Nn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new $e(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 Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new i0(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,v,{direction:kt.COLUMN})]}getComponents(){const t=[new Ee(this.model,this.services),new YN(this.model,this.services)];return this.getAxisChartComponents(t)}}class zH extends _e{constructor(t,n){super(t,n),this.model=new zR(this.services),this.model.setOptions(Ft(Dt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new IN(this.model,this.services),new ZN(this.model,this.services)];return this.getAxisChartComponents(t)}}class jH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new vi(this.model,this.services),new fn(this.model,this.services,{handleThresholds:!0}),new JN(this.model,this.services),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class WH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new XN(this.model,this.services),new fn(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class qH extends en{constructor(t,n){var r;super(t,n),this.model=new jR(this.services);const i=(r=n.options.meter)!=null&&r.proportional?lt(An(Dt.proportionalMeterChart),n.options):lt(An(Dt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new GN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Nn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new KN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new $e(this.model,this.services,t,{direction:kt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class YH extends en{constructor(t,n){super(t,n),this.model=new WR(this.services),this.model.setOptions(Ft(Dt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new QN(this.model,this.services)];return this.getChartComponents(t)}}class ZH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new fn(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class XH extends en{constructor(t,n){super(t,n),this.model=new qR(this.services),this.model.setOptions(Ft(Dt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new tP(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class KH extends en{constructor(t,n){super(t,n),this.model=new YR(this.services),this.model.setOptions(Ft(Dt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new AB(this.model,this.services)];return this.getChartComponents(t)}}class QH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new p0(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class JH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Go(this.model,this.services),new m0(this.model,this.services),new vi(this.model,this.services,{stacked:!0}),new v0(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class tV extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Go(this.model,this.services),new g0(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ}),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class eV extends en{constructor(t,n){super(t,n),this.model=new ZR(this.services),this.model.setOptions(Ft(Dt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new $B(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.PIE})];return this.getChartComponents(t)}}var ih={exports:{}},Ds={};/**
84
+ </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=b(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:It(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=b(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,oi)}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,oi),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 jN(e,t){const n=Di(this._current,e);return r=>(this._current=n(r),t(this._current))}class u0 extends Et{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Pt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(O=>O[a]>0),l=this.computeRadius();this.arc=is().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=is().innerRadius(this.getInnerRadius()).outerRadius(l+Pt.hoverArc.outerRadiusOffset);const c=VS().value(O=>O[a]).sort(b(i,"pie","sortFunction")).padAngle(Pt.padAngle)(o),u=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,O=>O.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",O=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:O.data[s],originalClassName:"slice"})).style("fill",O=>n.model.getFillColor(O.data[s])).attr("d",this.arc).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",O=>`${O[a]}, ${iu(O.data[a],o,a)+"%"}`).attrTween("d",function(O){return jN.bind(this)(O,n.arc)});const d=i.pie.labels.enabled,h=d?c.filter(O=>O.data[a]>0):[],f=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(h,O=>O.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),v=[];p.merge(f).style("text-anchor","middle").text(O=>i.pie.labels.formatter?i.pie.labels.formatter({...O,percentageValue:iu(O.data[a],o,a,!0)}):iu(O.data[a],o,a)+"%").datum(function(O){const I=l+7,U=(O.endAngle-O.startAngle)/2+O.startAngle,L=U/Math.PI*180,A=this.getComputedTextLength();return O.textOffsetX=A/2,O.textOffsetY=L>90&&L<270?10:0,O.xPosition=(O.textOffsetX+I)*Math.sin(U),O.yPosition=(O.textOffsetY+I)*-Math.cos(U),O}).attr("transform",function(O,I){const U=h.length,L=(O.endAngle-O.startAngle)*(180/Math.PI);if(I>=U-2&&L<Pt.callout.minSliceDegree){let A,V;return O.index===U-1?(A=O.xPosition+Pt.callout.offsetX+Pt.callout.textMargin+O.textOffsetX,V=O.yPosition-Pt.callout.offsetY,O.direction=Fs.RIGHT,v.push(O)):(A=O.xPosition-Pt.callout.offsetX-O.textOffsetX-Pt.callout.textMargin,V=O.yPosition-Pt.callout.offsetY,O.direction=Fs.LEFT,v.push(O)),`translate(${A}, ${V})`}return`translate(${O.xPosition}, ${O.yPosition})`}),this.renderCallouts(v);const m=b(i,"donut")?"donut":"pie",g=b(i,m,"alignment"),{width:y}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),x=d?Pt.xOffset:0,w=d?Pt.yOffset:0;let _=l+x;g===Kt.CENTER?_=y/2:g===Kt.RIGHT&&(_=y-l-Pt.xOffset);let S=l+w;v.length>0&&(S+=Pt.yOffsetCallout),r.attr("x",_+7).attr("y",S),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.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",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===Fs.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Pt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Pt.callout.offsetX,y:o-Pt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Pt.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);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);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(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}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Pt.radiusOffset:i}}class WN extends u0{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=k.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=b(i,"donut","center","label");k.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!==""&&k.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=b(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=md:s=Te;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const h0="4,10 8,6 12,10",d0="12,6 8,10 4,6";class qN extends Et{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 Ov(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 b(t,"gauge","type")===Nr.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(b(n,"gauge","deltaArrow","direction")){case Jo.UP:return h0;case Jo.DOWN:return d0;default:return t>0?h0:d0}}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),k.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:[ot.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",g=>g),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=b(r,"gauge","alignment"),{width:v}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;p===Kt.CENTER?m=v/2:p===Kt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===Nr.FULL&&!s?d=l(a):r===Nr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),v=b(n,"gauge","numberFormatter"),m=p.selectAll("text.gauge-value-number").data([i]);m.enter().append("text").attr("class","gauge-value-number").merge(m).style("font-size",`${f}px`).attr("text-anchor","middle").text(O=>v(O));const{width:g}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,x=u?"%":"",w=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",g/2).text(x),{width:_,height:S}=k.getSVGElementSize(w,{useBBox:!0});w.attr("y",`-${S/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?b(r,"gauge","deltaFontSize"):()=>0,o=i?b(r,"gauge","numberFormatter"):()=>null,l=b(r,"gauge","deltaArrow","size"),c=b(r,"gauge","numberSpacing"),u=b(r,"gauge","showPercentageSymbol"),d=k.appendOrSelect(n,"g.gauge-numbers"),h=k.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=k.appendOrSelect(h,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),m=b(r,"gauge","deltaArrow","enabled"),g=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&m?[i]:[]);g.enter().append("svg").merge(g).attr("class","gauge-delta-arrow").attr("x",-l(s)-v/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=D(this);k.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=b(r,"gauge","status");k.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),g.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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=b(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===Nr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class f0 extends Zu{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=bs(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",ft.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()===ee.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:[ot.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).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.getValueThroughAxisPosition(v,0),g=this.services.cartesianScales.getRangeValue(u),y=this.services.cartesianScales.getDomainValue(u)-h/2,x=y+h;if(!this.isOutsideZoomedDomain(y,x))return pe({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.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=b(t,"bars","width"),r=b(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 YN extends Et{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)}, ${Vn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Vn(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(""),b(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=>v.index===-1||v.value===null?`url(#${f})`:this.model.getFillColor(Number(v.value))).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=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==Oi.OFF&&(t===Oi.AUTO&&ng.minCellDividerDimension<=this.xBandwidth&&ng.minCellDividerDimension<=this.yBandwidth||t===Oi.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=It(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const f=_s(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||"Total",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 ZN extends Et{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=>It(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(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:[ot.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=It(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()===ee.VERTICAL?m+=1:m-=1),pe({x0:f,x1:p,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0);const o=parseFloat(It(s,"data.x0")),l=parseFloat(It(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:It(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:s[n]})},{label:u,value:It(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.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 fn{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]?Rn.weight.unselected:Rn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Rn.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?Rn.opacity.unselected:Rn.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",Rn.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]=Dn(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:[ot.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===ee.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 KN extends Et{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)-ie.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ie.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=b(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;b(i,"meter","proportional")===null?u=100:u=b(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=Ye().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=b(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?ie.height.proportional:ie.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?ie.height.proportional:ie.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",x=>x.x).attr("y",0).attr("height",()=>f||(s?ie.height.proportional:ie.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:x[c],originalClassName:v})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?d(u):x.width).style("fill",x=>n.model.getFillColor(x[c])).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),p.exit().remove();const m=b(i,"meter","peak");let g=m;m!==null&&(m>u?g=u:m<a[0].value&&(g=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(g==null?[]:[g]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?ie.height.proportional:ie.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>d(x)).attr("x2",x=>d(x)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(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 QN extends Et{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=kk(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}=b(n,"radar","axes"),s=b(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(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}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:v,xAxisRectHeight:m}=Sr;this.uniqueKeys=Array.from(new Set(s.map(M=>M[u]))),this.uniqueGroups=Array.from(new Set(s.map(M=>M[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const g=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-g)/2;if(y<=0)return;const x=Qi().domain(this.fullDataNormalized.map(M=>M[u])).range([0,2*Math.PI].map(M=>M-Math.PI/2)),w=Vn(this.fullDataNormalized.map(M=>M[d])),_=Ye().domain([w>=0?0:w,sr(this.fullDataNormalized.map(M=>M[d]))]).range([v,y]).nice(p),S=_.ticks(p),O=M=>this.model.getFillColor(M),I=GS().angle(M=>x(M[u])+Math.PI/2).radius(M=>_(M[d])).curve(Ip),U=this.uniqueKeys.map(M=>{const R=this.getLabelDimensions(M).width,E=eD(x(M),y);return R+E}),L={x:sr(U)+h,y:i/2},A=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(S,M=>M),V=M=>this.uniqueKeys.map(R=>({[u]:R,[d]:M}));A.join(M=>M.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",E=>I(V(E)))),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",E=>I(V(E)))),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_axes_exit",animate:t})).attr("d",E=>I(V(E))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,M=>M).join(M=>M.append("line").attr("opacity",0).attr("class",R=>`x-axis-${fi(R)}`).attr("stroke-dasharray","0").attr("x1",R=>Yt(x(R),0,L).x).attr("y1",R=>Yt(x(R),0,L).y).attr("x2",R=>Yt(x(R),0,L).x).attr("y2",R=>Yt(x(R),0,L).y).call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",E=>Yt(x(E),_.range()[0],L).x).attr("y1",E=>Yt(x(E),_.range()[0],L).y).attr("x2",E=>Yt(x(E),_.range()[1],L).x).attr("y2",E=>Yt(x(E),_.range()[1],L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",E=>Yt(x(E),_.range()[0],L).x).attr("y1",E=>Yt(x(E),_.range()[0],L).y).attr("x2",E=>Yt(x(E),_.range()[1],L).x).attr("y2",E=>Yt(x(E),_.range()[1],L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(M=>M.append("text").text(R=>R).attr("opacity",0).attr("x",R=>Yt(x(R),_.range()[1]+h,L).x).attr("y",R=>Yt(x(R),_.range()[1]+h,L).y).style("text-anchor",R=>qg(x(R)).textAnchor).style("dominant-baseline",R=>qg(x(R)).dominantBaseline).call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",E=>Yt(x(E),_.range()[1]+h,L).x).attr("y",E=>Yt(x(E),_.range()[1]+h,L).y).end().finally(()=>{const E=b(o,"radar","alignment"),B=this.getAlignmentXOffset(E,n,this.getParent());n.attr("x",B)})),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,M=>M.name).join(M=>M.append("path").attr("class",R=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:R.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",R=>R.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",R=>O(R.name)).style("fill-opacity",Sr.opacity.selected).style("stroke",R=>O(R.name)).call(R=>{const E=R.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_enter",animate:t}));t&&E.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),E.attr("opacity",1).attr("d",B=>I(B.data))}),M=>(M.attr("class",R=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:R.name,originalClassName:"blob"})).style("fill",R=>O(R.name)).style("stroke",R=>O(R.name)),M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",E=>I(E.data))),M),M=>M.call(R=>{const E=R.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"radar_blobs_exit",animate:t}));t&&E.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),E.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(M=>b(M,d)!==null)).join(M=>M.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",R=>R[c]),M=>M,M=>M.remove()).attr("class",M=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:M[l],originalClassName:fi(M[u])})).attr("cx",M=>Yt(x(M[u]),_(M[d]),L).x).attr("cy",M=>Yt(x(M[u]),_(M[d]),L).y).attr("r",0).attr("opacity",0).style("fill",M=>O(M[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(M=>M.append("rect"),M=>M,M=>M.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",M=>`rotate(${Yg(x(M))}, ${L.x}, ${L.y})`),k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(ze(S)).join(M=>M.append("text").attr("opacity",0).text(R=>R).attr("x",R=>Yt(-Math.PI/2,_(R),L).x+f).attr("y",R=>Yt(-Math.PI/2,_(R),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_update",animate:t})).text(E=>E).attr("opacity",1).attr("x",E=>Yt(-Math.PI/2,_(E),L).x+f).attr("y",E=>Yt(-Math.PI/2,_(E),L).y)),M=>M.call(R=>R.transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Kt.CENTER?a=Math.floor((s-i.width)/2):t===Kt.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}}=b(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-${fi(i)}`),o=t.parent.selectAll(`.dots circle.${fi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(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(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]),class:t.model.getColorClassName({classNameTypes:[ot.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-${fi(i)}`),o=t.parent.selectAll(`.dots circle.${fi(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 p0 extends Zu{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:[ot.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).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 g=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,g)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-p);if(m!==0&&m<2&&(d>0&&a===ee.VERTICAL||d<0&&a===ee.HORIZONTAL?v=p-2:v=p+2),!this.isOutsideZoomedDomain(h,f))return pe({x0:h,x1:f,y0:p,y1:v},a)}).attr("opacity",1).attr("role",ft.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 JN extends ge{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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=k.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=k.appendOrSelect(t,"svg.chart-skeleton.DAII"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class m0 extends Et{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=>b(s,0,i)!==n.datum().name?$n.opacity.unselected:$n.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",$n.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=b(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=>b(f,0,s));this.areaGenerator=Mc().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=>b(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:b(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(b(f,0,s))).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>b(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",$n.opacity.selected).attr("d",this.areaGenerator)}}class g0 extends Zu{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=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let 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()===ee.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===ee.VERTICAL?v+=1:v-=1)}return pe({x0:h,x1:f,y0:p,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,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(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=b(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 v0 extends fn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!b(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=>b(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ft.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),g=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,[g]: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 tP extends Et{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}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(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=Zi({name:o,children:a}),f=10,p=r/6,v=S=>{const O=h.descendants().reverse(),I=h.links();let U=h,L=h;h.eachBefore(P=>{P.x<U.x&&(U=P),P.x>L.x&&(L=P)});const A=L.x-U.x,V=n.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,U.x,r,A].join(" ")),M=_.selectAll("g").data(O,P=>P.id),R=this,E=M.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",P=>P.depth!==0&&P.children&&P.children.length>0?"clickable":null).on("mouseover",function(P,N){R.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:P,element:D(this),datum:N})}).on("click",function(P,N){N.depth!==0&&(N.children=N.children?null:N._children,v(N)),R.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:P,element:D(this),datum:N})}).on("mouseout",function(P,N){R.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:P,element:D(this),datum:N})});E.append("circle").attr("r",2.5).attr("class",P=>P._children?"parent":"child").attr("stroke-width",10),E.append("text").attr("dy","0.31em").attr("x",P=>P._children?-xi:xi).attr("text-anchor",P=>P._children?"end":"start").text(P=>P.data.name).clone(!0).attr("class","text-stroke").lower(),M.merge(E).transition(V).attr("transform",P=>`translate(${P.y},${P.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),M.exit().transition(V).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const B=w.selectAll("path").data(I,P=>P.target.id),H=B.enter().append("path").attr("d",()=>{const P={x:S.x0,y:S.y0};return x({source:P,target:P})});B.merge(H).transition(V).attr("d",x),B.exit().transition(V).remove().attr("d",()=>{const P={x:S.x,y:S.y};return x({source:P,target:P})}),h.eachBefore(P=>{P.x0=P.x,P.y0=P.y})},m=h.descendants(),g=m[m.length-1].depth,y=b(s,"tree","type")===Qo.DENDROGRAM?h_().size([i,r-u-g*xi-l]):Q_().nodeSize([f,p]).size([i,r-u-g*xi-l]),x=XS().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,O)=>{S.id=O,S._children=S.children}),y(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 eP="#000000",nP="#ffffff",rP="#fcf4d6",iP="#fddc69",sP="#f1c21b",aP="#d2a106",oP="#b28600",lP="#8e6a00",cP="#684e00",uP="#483700",hP="#302400",dP="#1c1500",fP={10:rP,20:iP,30:sP,40:aP,50:oP,60:lP,70:cP,80:uP,90:hP,100:dP},pP="#fff2e8",mP="#ffd9be",gP="#ffb784",vP="#ff832b",yP="#eb6200",xP="#ba4e00",bP="#8a3800",EP="#5e2900",_P="#3e1a00",wP="#231000",SP={10:pP,20:mP,30:gP,40:vP,50:yP,60:xP,70:bP,80:EP,90:_P,100:wP},TP="#fff1f1",OP="#ffd7d9",MP="#ffb3b8",CP="#ff8389",AP="#fa4d56",$P="#da1e28",RP="#a2191f",LP="#750e13",DP="#520408",kP="#2d0709",IP={10:TP,20:OP,30:MP,40:CP,50:AP,60:$P,70:RP,80:LP,90:DP,100:kP},NP="#fff0f7",PP="#ffd6e8",UP="#ffafd2",BP="#ff7eb6",HP="#ee5396",VP="#d02670",FP="#9f1853",zP="#740937",GP="#510224",jP="#2a0a18",WP={10:NP,20:PP,30:UP,40:BP,50:HP,60:VP,70:FP,80:zP,90:GP,100:jP},qP="#f6f2ff",YP="#e8daff",ZP="#d4bbff",XP="#be95ff",KP="#a56eff",QP="#8a3ffc",JP="#6929c4",tU="#491d8b",eU="#31135e",nU="#1c0f30",rU={10:qP,20:YP,30:ZP,40:XP,50:KP,60:QP,70:JP,80:tU,90:eU,100:nU},iU="#edf5ff",sU="#d0e2ff",aU="#a6c8ff",oU="#78a9ff",lU="#4589ff",cU="#0f62fe",uU="#0043ce",hU="#002d9c",dU="#001d6c",fU="#001141",pU={10:iU,20:sU,30:aU,40:oU,50:lU,60:cU,70:uU,80:hU,90:dU,100:fU},mU="#e5f6ff",gU="#bae6ff",vU="#82cfff",yU="#33b1ff",xU="#1192e8",bU="#0072c3",EU="#00539a",_U="#003a6d",wU="#012749",SU="#061727",TU={10:mU,20:gU,30:vU,40:yU,50:xU,60:bU,70:EU,80:_U,90:wU,100:SU},OU="#d9fbfb",MU="#9ef0f0",CU="#3ddbd9",AU="#08bdba",$U="#009d9a",RU="#007d79",LU="#005d5d",DU="#004144",kU="#022b30",IU="#081a1c",NU={10:OU,20:MU,30:CU,40:AU,50:$U,60:RU,70:LU,80:DU,90:kU,100:IU},PU="#defbe6",UU="#a7f0ba",BU="#6fdc8c",HU="#42be65",VU="#24a148",FU="#198038",zU="#0e6027",GU="#044317",jU="#022d0d",WU="#071908",qU={10:PU,20:UU,30:BU,40:HU,50:VU,60:FU,70:zU,80:GU,90:jU,100:WU},YU="#f2f4f8",ZU="#dde1e6",XU="#c1c7cd",KU="#a2a9b0",QU="#878d96",JU="#697077",tB="#4d5358",eB="#343a3f",nB="#21272a",rB="#121619",iB={10:YU,20:ZU,30:XU,40:KU,50:QU,60:JU,70:tB,80:eB,90:nB,100:rB},sB="#f4f4f4",aB="#e0e0e0",oB="#c6c6c6",lB="#a8a8a8",cB="#8d8d8d",uB="#6f6f6f",hB="#525252",dB="#393939",fB="#262626",pB="#161616",mB={10:sB,20:aB,30:oB,40:lB,50:cB,60:uB,70:hB,80:dB,90:fB,100:pB},gB="#f7f3f2",vB="#e5e0df",yB="#cac5c4",xB="#ada8a8",bB="#8f8b8b",EB="#726e6e",_B="#565151",wB="#3c3838",SB="#272525",TB="#171414",OB={10:gB,20:vB,30:yB,40:xB,50:bB,60:EB,70:_B,80:wB,90:SB,100:TB},y0={black:{100:eP},blue:pU,coolGray:iB,cyan:TU,gray:mB,green:qU,magenta:WP,orange:SP,purple:rU,red:IP,teal:NU,warmGray:OB,white:{0:nP},yellow:fP};const MB=e=>{if(!e)return null;for(const t of Object.keys(y0)){const n=y0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},x0=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=yn(t);let r;if(n&&(r=MB(n?n.hex():null)),r==null){const i=gl(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let CB=0;class AB extends Et{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=b(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Zi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=rw().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",()=>CB++).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:[ot.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)}),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=gl(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",x0).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",x0),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);return l&&(s=l),yn(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)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}class $B extends Et{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}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=HD().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=k.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(p,g=>`${g[c]}-${g.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",g=>`${g.size}px`).text(function(g){return g.text}).attr("class",g=>n.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:g[c],originalClassName:`word ${g.size>32?"light":""}`})).style("fill",g=>n.model.getFillColor(g[c],g.text,g)).attr("text-anchor","middle").transition().call(g=>n.services.transitions.setupTransition({transition:g,name:"wordcloud-text-update-enter",animate:t})).attr("transform",g=>`translate(${g.x}, ${g.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=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?ze(i):[1,1];return Ye().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=bo(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.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[ot.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 RB extends Et{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=b(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=DN(s,Object.values(l)),u=$N(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=PE().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=k.appendOrSelect(t,"defs");k.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=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case vn.geoEqualEarth:t=n_();break;case vn.geoAlbers:t=ZE();break;case vn.geoConicEqualArea:t=Nf();break;case vn.geoConicEquidistant:t=t_();break;case vn.geoEquirectangular:t=QE();break;case vn.geoMercator:t=XE();break;case vn.geoNaturalEarth1:t=r_();break;default:throw new Error("Projection is not supported.")}return t}}class LB extends RB{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(kr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.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(kr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(kr.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(kr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wi.HIDE,{event:r,hoveredElement:s})})}}function b0(e){var t=e==null?0:e.length;return t?co(e,1):[]}function E0(e,t){const n=St(e);return isNaN(t)?Je(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Xu(e,t){const n=St(e);if(isNaN(t))return Je(e,NaN);if(!t)return n;const r=n.getDate(),i=Je(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 Ku(e,t){const n=+St(e);return Je(e,n+t)}function _0(e,t){return Ku(e,t*mg)}function Qu(e,t){return Ku(e,t*pg)}function Ju(e,t){return Ku(e,t*1e3)}function w0(e,t){return Xu(e,t*12)}function Ls(e,t){const n=St(e),r=St(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function DB(e,t){const n=St(e),r=St(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function kB(e,t){const n=St(e),r=St(t);return n.getFullYear()-r.getFullYear()}function IB(e,t){const n=St(e),r=St(t),i=S0(n,r),s=Math.abs(xg(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 th(e,t){return St(e).getTime()-St(t).getTime()}function eh(e){return e?Math[e]:Math.trunc}function NB(e,t,n){const r=th(e,t)/mg;return eh(n==null?void 0:n.roundingMethod)(r)}function T0(e,t,n){const r=th(e,t)/pg;return eh(n==null?void 0:n.roundingMethod)(r)}function PB(e){const t=St(e);return t.setHours(23,59,59,999),t}function UB(e){const t=St(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function BB(e){const t=St(e);return+PB(t)==+UB(t)}function HB(e,t){const n=St(e),r=St(t),i=Ls(n,r),s=Math.abs(DB(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=Ls(n,r)===-i;BB(St(e))&&s===1&&Ls(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function O0(e,t,n){const r=th(e,t)/1e3;return eh(n==null?void 0:n.roundingMethod)(r)}function VB(e,t){const n=St(e),r=St(t),i=Ls(n,r),s=Math.abs(kB(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Ls(n,r)===-i,o=i*(s-+a);return o===0?0:o}function FB(e,t){return E0(e,-t)}function zB(e,t){return Xu(e,-t)}function GB(e,t){return _0(e,-t)}function M0(e,t){return Qu(e,-t)}function C0(e,t){return Ju(e,-t)}function jB(e,t){return w0(e,-t)}class WB extends In{zoomIn(t,n,r){let i,s,a;const o=r||oi;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=k.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||oi;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class qB extends In{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 YB extends In{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 ZB extends In{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(b(ig,n,"duration")||ig.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class XB extends In{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=b(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=b(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 b(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=ee.VERTICAL:this.orientation=ee.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=b(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=b(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=b(s,"axes")[r],{mapsTo:o}=a,l=b(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=b(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===et.TIME){const s=b(r,"timeScale","addSpaceOnEdges");return KB(n,s)}else return QB(n,jn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,z.LEFT)===null&&b(n,z.RIGHT)!==null||b(n,z.RIGHT,"main")===!0||r&&b(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,z.BOTTOM)===null&&b(n,z.TOP)!==null||b(n,z.TOP,"main")===!0||r&&b(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=b(r,"axes",t.primary),s=b(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=b(n,"axes",t),i=b(n,"bounds"),{includeZero:s}=r,a=b(r,"scaleType")||et.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:g}=this.model.getBinConfigurations();return[0,sr(g,y=>y.length)]}else if(r.limitDomainToBins){const{bins:g}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:g});return[y[0].split(":")[0],y[y.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=jn.ratio;if(r.domain)return a===et.LABELS?r.domain:(a===et.TIME&&(r.domain=r.domain.map(g=>g.getTime===void 0?new Date(g):g)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===et.LABELS)return bs(o.map(g=>g[c]));let p,v;const m=this.model.getDataGroupNames();if(a===et.LABELS_RATIO)return o.map(g=>`${g[h]}/${g[f]}`);if(a===et.TIME)v=o.map(g=>+new Date(g[c]));else if(i&&n.axes)v=[],o.forEach(g=>{v.push(g[c]),g[i.upperBoundMapsTo]&&v.push(g[i.upperBoundMapsTo]),g[i.lowerBoundMapsTo]&&v.push(g[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:g}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:m}),x=o.filter(_=>!m.includes(_[g])),w=[];y.forEach(_=>{const{...S}=_;let O=0,I=0;Object.values(S).forEach(U=>{isNaN(U)||(U<0?I+=U:O+=U)}),w.push([I,O])}),v=[...b0(w),...x.map(_=>_[c])]}else v=[],o.forEach(g=>{const y=g[c];Array.isArray(y)&&y.length===2?(v.push(y[0]),v.push(y[1])):(l&&v.push(Math.max(g[c],g[l])),v.push(y))});return a!==et.TIME&&a!==et.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(g=>{const y=b(g,"value");y!==null&&v.push(y)}),p=ze(v),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||et.LINEAR;this.scaleTypes[t]=i;let s;return i===et.TIME?s=_p():i===et.LOG?s=rp().base(r.base||10):i===et.LABELS||i===et.LABELS_RATIO?s=Qi():s=Ye(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=b(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=b(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 KB(e,t){const n=new Date(e[0]),r=new Date(e[1]);return VB(r,n)>1?[jB(n,t),w0(r,t)]:HB(r,n)>1?[zB(n,t),Xu(r,t)]:IB(r,n)>1?[FB(n,t),E0(r,t)]:NB(r,n)>1?[GB(n,t),_0(r,t)]:T0(r,n)>30?[M0(n,t*30),Qu(r,t*30)]:T0(r,n)>1?[M0(n,t),Qu(r,t)]:O0(r,n)>15?[C0(n,t*15),Ju(r,t*15)]:O0(r,n)>1?[C0(n,t),Ju(r,t)]:[n,r]}function QB([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]}class JB extends In{constructor(){super(...arguments),this.curveTypes={curveLinear:Ya,curveLinearClosed:Ip,curveBasis:KS,curveBasisClosed:QS,curveBasisOpen:JS,curveBundle:tT,curveCardinal:eT,curveCardinalClosed:nT,curveCardinalOpen:rT,curveCatmullRom:iT,curveCatmullRomClosed:sT,curveCatmullRomOpen:aT,curveMonotoneX:oT,curveMonotoneY:lT,curveNatural:cT,curveStep:uT,curveStepAfter:dT,curveStepBefore:hT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class tH extends In{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(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=b(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,ze(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 b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=b(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=Me.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=b(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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function eH(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 nH(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:eH(e,t,n)}var rH="\\ud800-\\udfff",iH="\\u0300-\\u036f",sH="\\ufe20-\\ufe2f",aH="\\u20d0-\\u20ff",oH=iH+sH+aH,lH="\\ufe0e\\ufe0f",cH="\\u200d",uH=RegExp("["+cH+rH+oH+lH+"]");function A0(e){return uH.test(e)}function hH(e){return e.split("")}var $0="\\ud800-\\udfff",dH="\\u0300-\\u036f",fH="\\ufe20-\\ufe2f",pH="\\u20d0-\\u20ff",mH=dH+fH+pH,gH="\\ufe0e\\ufe0f",vH="["+$0+"]",nh="["+mH+"]",rh="\\ud83c[\\udffb-\\udfff]",yH="(?:"+nh+"|"+rh+")",R0="[^"+$0+"]",L0="(?:\\ud83c[\\udde6-\\uddff]){2}",D0="[\\ud800-\\udbff][\\udc00-\\udfff]",xH="\\u200d",k0=yH+"?",I0="["+gH+"]?",bH="(?:"+xH+"(?:"+[R0,L0,D0].join("|")+")"+I0+k0+")*",EH=I0+k0+bH,_H="(?:"+[R0+nh+"?",nh,L0,D0,vH].join("|")+")",wH=RegExp(rh+"(?="+rh+")|"+_H+EH,"g");function SH(e){return e.match(wH)||[]}function TH(e){return A0(e)?SH(e):hH(e)}function OH(e){return function(t){t=ys(t);var n=A0(t)?TH(t):void 0,r=n?n[0]:t.charAt(0),i=n?nH(n,1).join(""):t.slice(1);return r[e]()+i}}var MH=OH("toUpperCase");const CH=MH;function AH(e){return CH(ys(e).toLowerCase())}var $H=Tv(function(e,t,n){return t=t.toLowerCase(),e+(n?AH(t):t)});const RH=$H;class en{constructor(t,n){this.components=[],this.services={canvasZoom:WB,domUtils:k,events:qB,files:YB,gradientUtils:mu,transitions:ZB},this.model=new hn(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=!!b(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=b(r,"toolbar","enabled"),s={id:"legend",components:[new Wu(this.model,this.services)],growth:ht.PREFERRED},a=b(r,"canvasZoom","enabled");a&&a===!0&&t.push(new gN(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Rs(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new $e(this.model,this.services,[l,...i?[c]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:b(n,"graphFrameRenderType")||rt.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=kt.COLUMN;if(h){const g=b(r,"legend","position");g==="left"?(f=kt.ROW,r.legend.orientation||(r.legend.orientation=Ti.VERTICAL)):g==="right"?(f=kt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Ti.VERTICAL)):g==="bottom"&&(f=kt.COLUMN_REVERSE)}const p={id:"spacer",components:[new Nn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new $e(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const g={id:"spacer",components:[new Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(g)}return m.push(v),[new qu(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,m,{direction:kt.COLUMN})]}}class _e extends en{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:XB,curves:JB,zoom:tH}),this.model=new Mr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",z.TOP,"enabled"),s=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(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 Rs(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},f={id:"header",components:[new $e(this.model,this.services,[d,...s?[h]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},p={id:"legend",components:[new Wu(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new t0(this.model,this.services),new vN(this.model,this.services)),t.push(new xN(this.model,this.services)),t.push(new bN(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let g=kt.COLUMN;if(m){const S=b(this.model.getOptions(),"legend","position");S===Si.LEFT?(g=kt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Ti.VERTICAL)):S===Si.RIGHT?(g=kt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Ti.VERTICAL)):S===Si.BOTTOM&&(g=kt.COLUMN_REVERSE)}const y={id:"spacer",components:[new Nn(this.model,this.services)],growth:ht.PREFERRED},x={id:"full-frame",components:[new $e(this.model,this.services,[...m?[p]:[],...m?[y]:[],v],{direction:g})],growth:ht.STRETCH},w={id:"zoom-bar",components:[new yN(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},_=[];if(u||s){_.push(f);const S={id:"spacer",components:[new Nn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};_.push(S)}return l&&_.push(w),_.push(x),[new i0(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,_,{direction:kt.COLUMN})]}}class LH extends en{constructor(t,n){super(t,n),this.model=new NR(this.services),this.model.setOptions(Ft(Dt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class DH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(An(Dt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new vi(this.model,this.services),new s0(this.model,this.services),new fn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class kH extends _e{constructor(t,n){super(t,n),this.model=new PR(this.services),this.model.setOptions(Ft(Dt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new SN(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class IH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new TN(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class NH extends _e{constructor(t,n){super(t,n),this.model=new UR(this.services),this.model.setOptions(Ft(Dt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new ON(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class PH extends en{constructor(t,n){super(t,n),this.model=new BR(this.services),this.model.setOptions(Ft(Dt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Rs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new $e(this.model,this.services,[a,...i?[o]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new c0(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=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=kt.COLUMN_REVERSE,f={id:"spacer",components:[new Nn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new $e(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 Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new qu(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,v,{direction:kt.COLUMN})]}getComponents(){const t=[new LB(this.model,this.services)];return this.getChartComponents(t)}}class UH extends en{constructor(t,n){super(t,n),this.model=new HR(this.services),this.model.setOptions(Ft(Dt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new GN(this.model,this.services)];return this.getChartComponents(t)}}const N0={[ke.LINE]:[vi,fn],[ke.SCATTER]:[fn],[ke.AREA]:[s0,vi,fn],[ke.STACKED_AREA]:[m0,vi,v0,zo],[ke.SIMPLE_BAR]:[p0],[ke.GROUPED_BAR]:[f0,yi],[ke.STACKED_BAR]:[g0,zo]};class BH extends _e{constructor(t,n){super(t,n);const r=Ft(Dt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ke.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(N0).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=`${RH(i.type)}Chart`;return a=lt({},Dt[l],this.model.getOptions(),i.options),i.type===ke.STACKED_AREA&&(o=!0),N0[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 b0(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ke.STACKED_BAR||i.type===ke.STACKED_AREA),r=[new Ee(this.model,this.services),new Re(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID}),...n?[]:[new Xn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class P0 extends en{constructor(t,n,r=!1){super(t,n),this.model=new VR(this.services),!r&&(this.model.setOptions(Ft(Dt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new u0(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.PIE})];return this.getChartComponents(t)}}class HH extends P0{constructor(t,n){super(t,n,!0),this.model.setOptions(Ft(Dt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new WN(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.DONUT})];return this.getChartComponents(t)}}class VH extends en{constructor(t,n){super(t,n),this.model=new FR(this.services),this.model.setOptions(Ft(Dt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class FH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new f0(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class zH extends _e{constructor(t,n){super(t,n),this.model=new zR(this.services),this.model.setOptions(Ft(Dt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(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 Rs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new $e(this.model,this.services,[a,...i?[o]:[]],{direction:kt.ROW,alignItems:Ir.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new c0(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=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=kt.COLUMN_REVERSE,f={id:"spacer",components:[new Nn(this.model,this.services,{size:15})],growth:ht.PREFERRED},p={id:"full-frame",components:[new $e(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 Nn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(p),[new i0(this.model,this.services),new Vo(this.model,this.services),new $e(this.model,this.services,v,{direction:kt.COLUMN})]}getComponents(){const t=[new Ee(this.model,this.services),new YN(this.model,this.services)];return this.getAxisChartComponents(t)}}class GH extends _e{constructor(t,n){super(t,n),this.model=new GR(this.services),this.model.setOptions(Ft(Dt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new IN(this.model,this.services),new ZN(this.model,this.services)];return this.getAxisChartComponents(t)}}class jH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new vi(this.model,this.services),new fn(this.model,this.services,{handleThresholds:!0}),new JN(this.model,this.services),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class WH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new XN(this.model,this.services),new fn(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class qH extends en{constructor(t,n){var r;super(t,n),this.model=new jR(this.services);const i=(r=n.options.meter)!=null&&r.proportional?lt(An(Dt.proportionalMeterChart),n.options):lt(An(Dt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new zN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Nn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new KN(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new $e(this.model,this.services,t,{direction:kt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class YH extends en{constructor(t,n){super(t,n),this.model=new WR(this.services),this.model.setOptions(Ft(Dt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new QN(this.model,this.services)];return this.getChartComponents(t)}}class ZH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new Xn(this.model,this.services),new fn(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class XH extends en{constructor(t,n){super(t,n),this.model=new qR(this.services),this.model.setOptions(Ft(Dt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new tP(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class KH extends en{constructor(t,n){super(t,n),this.model=new YR(this.services),this.model.setOptions(Ft(Dt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new AB(this.model,this.services)];return this.getChartComponents(t)}}class QH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new p0(this.model,this.services),new yi(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class JH extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new zo(this.model,this.services),new m0(this.model,this.services),new vi(this.model,this.services,{stacked:!0}),new v0(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ge(this.model,this.services,{skeleton:Qt.GRID})];return this.getAxisChartComponents(t)}}class tV extends _e{constructor(t,n){super(t,n),this.model.setOptions(Ft(Dt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ee(this.model,this.services),new Re(this.model,this.services),new zo(this.model,this.services),new g0(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.VERT_OR_HORIZ}),new yi(this.model,this.services)];return this.getAxisChartComponents(t)}}class eV extends en{constructor(t,n){super(t,n),this.model=new ZR(this.services),this.model.setOptions(Ft(Dt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new $B(this.model,this.services),new ge(this.model,this.services,{skeleton:Qt.PIE})];return this.getChartComponents(t)}}var ih={exports:{}},Ds={};/**
85
85
  * @license React
86
86
  * react-jsx-runtime.development.js
87
87
  *
@@ -89,11 +89,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
89
89
  *
90
90
  * This source code is licensed under the MIT license found in the
91
91
  * LICENSE file in the root directory of this source tree.
92
- */var U0;function nV(){return U0||(U0=1,process.env.NODE_ENV!=="production"&&function(){var e=ae,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($){if($===null||typeof $!="object")return null;var W=p&&$[p]||$[v];return typeof W=="function"?W:null}var g=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y($){{for(var W=arguments.length,K=new Array(W>1?W-1:0),ct=1;ct<W;ct++)K[ct-1]=arguments[ct];x("error",$,K)}}function x($,W,K){{var ct=g.ReactDebugCurrentFrame,_t=ct.getStackAddendum();_t!==""&&(W+="%s",K=K.concat([_t]));var C=K.map(function(j){return String(j)});C.unshift("Warning: "+W),Function.prototype.apply.call(console[$],console,C)}}var w=!1,_=!1,S=!1,T=!1,I=!1,U;U=Symbol.for("react.module.reference");function L($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===s||I||$===i||$===c||$===u||T||$===f||w||_||S||typeof $=="object"&&$!==null&&($.$$typeof===h||$.$$typeof===d||$.$$typeof===a||$.$$typeof===o||$.$$typeof===l||$.$$typeof===U||$.getModuleId!==void 0))}function A($,W,K){var ct=$.displayName;if(ct)return ct;var _t=W.displayName||W.name||"";return _t!==""?K+"("+_t+")":K}function V($){return $.displayName||"Context"}function M($){if($==null)return null;if(typeof $.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){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 $=="object")switch($.$$typeof){case o:var W=$;return V(W)+".Consumer";case a:var K=$;return V(K._context)+".Provider";case l:return A($,$.render,"ForwardRef");case d:var ct=$.displayName||null;return ct!==null?ct:M($.type)||"Memo";case h:{var _t=$,C=_t._payload,j=_t._init;try{return M(j(C))}catch{return null}}}return null}var R=Object.assign,E=0,B,H,P,N,Z,q,it;function nt(){}nt.__reactDisabledLog=!0;function Y(){{if(E===0){B=console.log,H=console.info,P=console.warn,N=console.error,Z=console.group,q=console.groupCollapsed,it=console.groupEnd;var $={configurable:!0,enumerable:!0,value:nt,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}E++}}function J(){{if(E--,E===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},$,{value:B}),info:R({},$,{value:H}),warn:R({},$,{value:P}),error:R({},$,{value:N}),group:R({},$,{value:Z}),groupCollapsed:R({},$,{value:q}),groupEnd:R({},$,{value:it})})}E<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pt=g.ReactCurrentDispatcher,at;function Tt($,W,K){{if(at===void 0)try{throw Error()}catch(_t){var ct=_t.stack.trim().match(/\n( *(at )?)/);at=ct&&ct[1]||""}return`
93
- `+at+$}}var X=!1,tt;{var ut=typeof WeakMap=="function"?WeakMap:Map;tt=new ut}function z($,W){if(!$||X)return"";{var K=tt.get($);if(K!==void 0)return K}var ct;X=!0;var _t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=pt.current,pt.current=null,Y();try{if(W){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(zt){ct=zt}Reflect.construct($,[],j)}else{try{j.call()}catch(zt){ct=zt}$.call(j.prototype)}}else{try{throw Error()}catch(zt){ct=zt}$()}}catch(zt){if(zt&&ct&&typeof zt.stack=="string"){for(var F=zt.stack.split(`
92
+ */var U0;function nV(){return U0||(U0=1,process.env.NODE_ENV!=="production"&&function(){var e=ae,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($){if($===null||typeof $!="object")return null;var W=p&&$[p]||$[v];return typeof W=="function"?W:null}var g=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y($){{for(var W=arguments.length,K=new Array(W>1?W-1:0),ct=1;ct<W;ct++)K[ct-1]=arguments[ct];x("error",$,K)}}function x($,W,K){{var ct=g.ReactDebugCurrentFrame,_t=ct.getStackAddendum();_t!==""&&(W+="%s",K=K.concat([_t]));var C=K.map(function(j){return String(j)});C.unshift("Warning: "+W),Function.prototype.apply.call(console[$],console,C)}}var w=!1,_=!1,S=!1,O=!1,I=!1,U;U=Symbol.for("react.module.reference");function L($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===s||I||$===i||$===c||$===u||O||$===f||w||_||S||typeof $=="object"&&$!==null&&($.$$typeof===h||$.$$typeof===d||$.$$typeof===a||$.$$typeof===o||$.$$typeof===l||$.$$typeof===U||$.getModuleId!==void 0))}function A($,W,K){var ct=$.displayName;if(ct)return ct;var _t=W.displayName||W.name||"";return _t!==""?K+"("+_t+")":K}function V($){return $.displayName||"Context"}function M($){if($==null)return null;if(typeof $.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){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 $=="object")switch($.$$typeof){case o:var W=$;return V(W)+".Consumer";case a:var K=$;return V(K._context)+".Provider";case l:return A($,$.render,"ForwardRef");case d:var ct=$.displayName||null;return ct!==null?ct:M($.type)||"Memo";case h:{var _t=$,C=_t._payload,j=_t._init;try{return M(j(C))}catch{return null}}}return null}var R=Object.assign,E=0,B,H,P,N,Z,q,it;function nt(){}nt.__reactDisabledLog=!0;function Y(){{if(E===0){B=console.log,H=console.info,P=console.warn,N=console.error,Z=console.group,q=console.groupCollapsed,it=console.groupEnd;var $={configurable:!0,enumerable:!0,value:nt,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}E++}}function J(){{if(E--,E===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},$,{value:B}),info:R({},$,{value:H}),warn:R({},$,{value:P}),error:R({},$,{value:N}),group:R({},$,{value:Z}),groupCollapsed:R({},$,{value:q}),groupEnd:R({},$,{value:it})})}E<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pt=g.ReactCurrentDispatcher,at;function Ot($,W,K){{if(at===void 0)try{throw Error()}catch(_t){var ct=_t.stack.trim().match(/\n( *(at )?)/);at=ct&&ct[1]||""}return`
93
+ `+at+$}}var X=!1,tt;{var ut=typeof WeakMap=="function"?WeakMap:Map;tt=new ut}function G($,W){if(!$||X)return"";{var K=tt.get($);if(K!==void 0)return K}var ct;X=!0;var _t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=pt.current,pt.current=null,Y();try{if(W){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(Gt){ct=Gt}Reflect.construct($,[],j)}else{try{j.call()}catch(Gt){ct=Gt}$.call(j.prototype)}}else{try{throw Error()}catch(Gt){ct=Gt}$()}}catch(Gt){if(Gt&&ct&&typeof Gt.stack=="string"){for(var F=Gt.stack.split(`
94
94
  `),dt=ct.stack.split(`
95
95
  `),yt=F.length-1,gt=dt.length-1;yt>=1&&gt>=0&&F[yt]!==dt[gt];)gt--;for(;yt>=1&&gt>=0;yt--,gt--)if(F[yt]!==dt[gt]){if(yt!==1||gt!==1)do if(yt--,gt--,gt<0||F[yt]!==dt[gt]){var Xt=`
96
- `+F[yt].replace(" at new "," at ");return $.displayName&&Xt.includes("<anonymous>")&&(Xt=Xt.replace("<anonymous>",$.displayName)),typeof $=="function"&&tt.set($,Xt),Xt}while(yt>=1&&gt>=0);break}}}finally{X=!1,pt.current=C,J(),Error.prepareStackTrace=_t}var de=$?$.displayName||$.name:"",De=de?Tt(de):"";return typeof $=="function"&&tt.set($,De),De}function Rt($,W,K){return z($,!1)}function xt($){var W=$.prototype;return!!(W&&W.isReactComponent)}function Ht($,W,K){if($==null)return"";if(typeof $=="function")return z($,xt($));if(typeof $=="string")return Tt($);switch($){case c:return Tt("Suspense");case u:return Tt("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return Rt($.render);case d:return Ht($.type,W,K);case h:{var ct=$,_t=ct._payload,C=ct._init;try{return Ht(C(_t),W,K)}catch{}}}return""}var Vt=Object.prototype.hasOwnProperty,st={},Lt=g.ReactDebugCurrentFrame;function Ve($){if($){var W=$._owner,K=Ht($.type,$._source,W?W.type:null);Lt.setExtraStackFrame(K)}else Lt.setExtraStackFrame(null)}function we($,W,K,ct,_t){{var C=Function.call.bind(Vt);for(var j in $)if(C($,j)){var F=void 0;try{if(typeof $[j]!="function"){var dt=Error((ct||"React class")+": "+K+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw dt.name="Invariant Violation",dt}F=$[j](W,j,ct,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(yt){F=yt}F&&!(F instanceof Error)&&(Ve(_t),y("%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).",ct||"React class",K,j,typeof F),Ve(null)),F instanceof Error&&!(F.message in st)&&(st[F.message]=!0,Ve(_t),y("Failed %s type: %s",K,F.message),Ve(null))}}}var $r=Array.isArray;function pn($){return $r($)}function Jn($){{var W=typeof Symbol=="function"&&Symbol.toStringTag,K=W&&$[Symbol.toStringTag]||$.constructor.name||"Object";return K}}function zo($){try{return Is($),!1}catch{return!0}}function Is($){return""+$}function Ns($){if(zo($))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jn($)),Is($)}var Pn=g.ReactCurrentOwner,jo={key:!0,ref:!0,__self:!0,__source:!0},Rr,Lr,Le;Le={};function tr($){if(Vt.call($,"ref")){var W=Object.getOwnPropertyDescriptor($,"ref").get;if(W&&W.isReactWarning)return!1}return $.ref!==void 0}function Ps($){if(Vt.call($,"key")){var W=Object.getOwnPropertyDescriptor($,"key").get;if(W&&W.isReactWarning)return!1}return $.key!==void 0}function Us($,W){if(typeof $.ref=="string"&&Pn.current&&W&&Pn.current.stateNode!==W){var K=M(Pn.current.type);Le[K]||(y('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',M(Pn.current.type),$.ref),Le[K]=!0)}}function sh($,W){{var K=function(){Rr||(Rr=!0,y("%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($,"key",{get:K,configurable:!0})}}function Un($,W){{var K=function(){Lr||(Lr=!0,y("%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($,"ref",{get:K,configurable:!0})}}var ah=function($,W,K,ct,_t,C,j){var F={$$typeof:t,type:$,key:W,ref:K,props:j,_owner:C};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ct}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_t}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function oh($,W,K,ct,_t){{var C,j={},F=null,dt=null;K!==void 0&&(Ns(K),F=""+K),Ps(W)&&(Ns(W.key),F=""+W.key),tr(W)&&(dt=W.ref,Us(W,_t));for(C in W)Vt.call(W,C)&&!jo.hasOwnProperty(C)&&(j[C]=W[C]);if($&&$.defaultProps){var yt=$.defaultProps;for(C in yt)j[C]===void 0&&(j[C]=yt[C])}if(F||dt){var gt=typeof $=="function"?$.displayName||$.name||"Unknown":$;F&&sh(j,gt),dt&&Un(j,gt)}return ah($,F,dt,_t,ct,Pn.current,j)}}var Zt=g.ReactCurrentOwner,Bn=g.ReactDebugCurrentFrame;function er($){if($){var W=$._owner,K=Ht($.type,$._source,W?W.type:null);Bn.setExtraStackFrame(K)}else Bn.setExtraStackFrame(null)}var bi;bi=!1;function Dr($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Bs(){{if(Zt.current){var $=M(Zt.current.type);if($)return`
96
+ `+F[yt].replace(" at new "," at ");return $.displayName&&Xt.includes("<anonymous>")&&(Xt=Xt.replace("<anonymous>",$.displayName)),typeof $=="function"&&tt.set($,Xt),Xt}while(yt>=1&&gt>=0);break}}}finally{X=!1,pt.current=C,J(),Error.prepareStackTrace=_t}var de=$?$.displayName||$.name:"",De=de?Ot(de):"";return typeof $=="function"&&tt.set($,De),De}function Rt($,W,K){return G($,!1)}function xt($){var W=$.prototype;return!!(W&&W.isReactComponent)}function Ht($,W,K){if($==null)return"";if(typeof $=="function")return G($,xt($));if(typeof $=="string")return Ot($);switch($){case c:return Ot("Suspense");case u:return Ot("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return Rt($.render);case d:return Ht($.type,W,K);case h:{var ct=$,_t=ct._payload,C=ct._init;try{return Ht(C(_t),W,K)}catch{}}}return""}var Vt=Object.prototype.hasOwnProperty,st={},Lt=g.ReactDebugCurrentFrame;function Ve($){if($){var W=$._owner,K=Ht($.type,$._source,W?W.type:null);Lt.setExtraStackFrame(K)}else Lt.setExtraStackFrame(null)}function we($,W,K,ct,_t){{var C=Function.call.bind(Vt);for(var j in $)if(C($,j)){var F=void 0;try{if(typeof $[j]!="function"){var dt=Error((ct||"React class")+": "+K+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw dt.name="Invariant Violation",dt}F=$[j](W,j,ct,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(yt){F=yt}F&&!(F instanceof Error)&&(Ve(_t),y("%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).",ct||"React class",K,j,typeof F),Ve(null)),F instanceof Error&&!(F.message in st)&&(st[F.message]=!0,Ve(_t),y("Failed %s type: %s",K,F.message),Ve(null))}}}var $r=Array.isArray;function pn($){return $r($)}function Jn($){{var W=typeof Symbol=="function"&&Symbol.toStringTag,K=W&&$[Symbol.toStringTag]||$.constructor.name||"Object";return K}}function Go($){try{return Is($),!1}catch{return!0}}function Is($){return""+$}function Ns($){if(Go($))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jn($)),Is($)}var Pn=g.ReactCurrentOwner,jo={key:!0,ref:!0,__self:!0,__source:!0},Rr,Lr,Le;Le={};function tr($){if(Vt.call($,"ref")){var W=Object.getOwnPropertyDescriptor($,"ref").get;if(W&&W.isReactWarning)return!1}return $.ref!==void 0}function Ps($){if(Vt.call($,"key")){var W=Object.getOwnPropertyDescriptor($,"key").get;if(W&&W.isReactWarning)return!1}return $.key!==void 0}function Us($,W){if(typeof $.ref=="string"&&Pn.current&&W&&Pn.current.stateNode!==W){var K=M(Pn.current.type);Le[K]||(y('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',M(Pn.current.type),$.ref),Le[K]=!0)}}function sh($,W){{var K=function(){Rr||(Rr=!0,y("%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($,"key",{get:K,configurable:!0})}}function Un($,W){{var K=function(){Lr||(Lr=!0,y("%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($,"ref",{get:K,configurable:!0})}}var ah=function($,W,K,ct,_t,C,j){var F={$$typeof:t,type:$,key:W,ref:K,props:j,_owner:C};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ct}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_t}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function oh($,W,K,ct,_t){{var C,j={},F=null,dt=null;K!==void 0&&(Ns(K),F=""+K),Ps(W)&&(Ns(W.key),F=""+W.key),tr(W)&&(dt=W.ref,Us(W,_t));for(C in W)Vt.call(W,C)&&!jo.hasOwnProperty(C)&&(j[C]=W[C]);if($&&$.defaultProps){var yt=$.defaultProps;for(C in yt)j[C]===void 0&&(j[C]=yt[C])}if(F||dt){var gt=typeof $=="function"?$.displayName||$.name||"Unknown":$;F&&sh(j,gt),dt&&Un(j,gt)}return ah($,F,dt,_t,ct,Pn.current,j)}}var Zt=g.ReactCurrentOwner,Bn=g.ReactDebugCurrentFrame;function er($){if($){var W=$._owner,K=Ht($.type,$._source,W?W.type:null);Bn.setExtraStackFrame(K)}else Bn.setExtraStackFrame(null)}var bi;bi=!1;function Dr($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Bs(){{if(Zt.current){var $=M(Zt.current.type);if($)return`
97
97
 
98
98
  Check the render method of \``+$+"`."}return""}}function Wo($){{if($!==void 0){var W=$.fileName.replace(/^.*[\\\/]/,""),K=$.lineNumber;return`
99
99
 
@@ -107,9 +107,9 @@ Check the top-level render call using <`+K+">.")}return W}}function _i($,W){{if(
107
107
  *
108
108
  * This source code is licensed under the MIT license found in the
109
109
  * LICENSE file in the root directory of this source tree.
110
- */var B0;function rV(){if(B0)return ks;B0=1;var e=ae,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 ks.Fragment=n,ks.jsx=a,ks.jsxs=a,ks}process.env.NODE_ENV==="production"?ih.exports=rV():ih.exports=nV();var Gt=ih.exports;class Bt extends ae.PureComponent{constructor(){super(...arguments);ch(this,"chart");ch(this,"chartRef",ae.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 Gt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class iV extends Bt{createChart(t,n,r){return new LH(t,{data:n,options:r})}}class sV extends Bt{createChart(t,n,r){return new DH(t,{data:n,options:r})}}class aV extends Bt{createChart(t,n,r){return new kH(t,{data:n,options:r})}}class oV extends Bt{createChart(t,n,r){return new IH(t,{data:n,options:r})}}class lV extends Bt{createChart(t,n,r){return new NH(t,{data:n,options:r})}}class cV extends Bt{createChart(t,n,r){return new PH(t,{data:n,options:r})}}class uV extends Bt{createChart(t,n,r){return new UH(t,{data:n,options:r})}}class hV extends Bt{createChart(t,n,r){return new BH(t,{data:n,options:r})}}class dV extends Bt{createChart(t,n,r){return new HH(t,{data:n,options:r})}}class fV extends Bt{createChart(t,n,r){return new VH(t,{data:n,options:r})}}class pV extends Bt{createChart(t,n,r){return new FH(t,{data:n,options:r})}}class mV extends Bt{createChart(t,n,r){return new GH(t,{data:n,options:r})}}class gV extends Bt{createChart(t,n,r){return new zH(t,{data:n,options:r})}}class vV extends Bt{createChart(t,n,r){return new jH(t,{data:n,options:r})}}class yV extends Bt{createChart(t,n,r){return new WH(t,{data:n,options:r})}}class xV extends Bt{createChart(t,n,r){return new qH(t,{data:n,options:r})}}class bV extends Bt{createChart(t,n,r){return new P0(t,{data:n,options:r})}}class EV extends Bt{createChart(t,n,r){return new YH(t,{data:n,options:r})}}class _V extends Bt{createChart(t,n,r){return new ZH(t,{data:n,options:r})}}class wV extends Bt{createChart(t,n,r){return new QH(t,{data:n,options:r})}}class SV extends Bt{createChart(t,n,r){return new JH(t,{data:n,options:r})}}class OV extends Bt{createChart(t,n,r){return new tV(t,{data:n,options:r})}}class TV extends Bt{createChart(t,n,r){return new XH(t,{data:n,options:r})}}class MV extends Bt{createChart(t,n,r){return new KH(t,{data:n,options:r})}}class CV extends Bt{createChart(t,n,r){return new eV(t,{data:n,options:r})}}var H0={exports:{}};/*!
110
+ */var B0;function rV(){if(B0)return ks;B0=1;var e=ae,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 ks.Fragment=n,ks.jsx=a,ks.jsxs=a,ks}process.env.NODE_ENV==="production"?ih.exports=rV():ih.exports=nV();var zt=ih.exports;class Bt extends ae.PureComponent{constructor(){super(...arguments);ch(this,"chart");ch(this,"chartRef",ae.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 zt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class iV extends Bt{createChart(t,n,r){return new LH(t,{data:n,options:r})}}class sV extends Bt{createChart(t,n,r){return new DH(t,{data:n,options:r})}}class aV extends Bt{createChart(t,n,r){return new kH(t,{data:n,options:r})}}class oV extends Bt{createChart(t,n,r){return new IH(t,{data:n,options:r})}}class lV extends Bt{createChart(t,n,r){return new NH(t,{data:n,options:r})}}class cV extends Bt{createChart(t,n,r){return new PH(t,{data:n,options:r})}}class uV extends Bt{createChart(t,n,r){return new UH(t,{data:n,options:r})}}class hV extends Bt{createChart(t,n,r){return new BH(t,{data:n,options:r})}}class dV extends Bt{createChart(t,n,r){return new HH(t,{data:n,options:r})}}class fV extends Bt{createChart(t,n,r){return new VH(t,{data:n,options:r})}}class pV extends Bt{createChart(t,n,r){return new FH(t,{data:n,options:r})}}class mV extends Bt{createChart(t,n,r){return new zH(t,{data:n,options:r})}}class gV extends Bt{createChart(t,n,r){return new GH(t,{data:n,options:r})}}class vV extends Bt{createChart(t,n,r){return new jH(t,{data:n,options:r})}}class yV extends Bt{createChart(t,n,r){return new WH(t,{data:n,options:r})}}class xV extends Bt{createChart(t,n,r){return new qH(t,{data:n,options:r})}}class bV extends Bt{createChart(t,n,r){return new P0(t,{data:n,options:r})}}class EV extends Bt{createChart(t,n,r){return new YH(t,{data:n,options:r})}}class _V extends Bt{createChart(t,n,r){return new ZH(t,{data:n,options:r})}}class wV extends Bt{createChart(t,n,r){return new QH(t,{data:n,options:r})}}class SV extends Bt{createChart(t,n,r){return new JH(t,{data:n,options:r})}}class TV extends Bt{createChart(t,n,r){return new tV(t,{data:n,options:r})}}class OV extends Bt{createChart(t,n,r){return new XH(t,{data:n,options:r})}}class MV extends Bt{createChart(t,n,r){return new KH(t,{data:n,options:r})}}class CV extends Bt{createChart(t,n,r){return new eV(t,{data:n,options:r})}}var H0={exports:{}};/*!
111
111
  Copyright (c) 2018 Jed Watson.
112
112
  Licensed under the MIT License (MIT), see
113
113
  http://jedwatson.github.io/classnames
114
- */(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})()})(H0);var AV=H0.exports;const Kn=rv(AV),Qn="cds",$V=({tag:e="div",children:t,color:n,href:r,position:i="static",stacked:s,...a})=>{const o=r?"a":a.onClick?"button":e,l=`${Qn}--cc--card-node`,c=Kn(l,{[`${l}--stacked`]:s,[`${l}--${o}`]:o,[a.className]:a.className});return Gt.jsx(o,{className:c,style:{borderColor:n,position:i},tabIndex:0,...a,children:t})},RV=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Qn}--cc--card-node`,i=Kn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Gt.jsx("div",{className:i,...n,children:e})},LV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Gt.jsx("label",{className:r,...t,children:e})},DV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Gt.jsx("div",{className:r,...t,children:e})},kV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Gt.jsx("div",{className:r,...t,children:e})},IV=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Qn}--cc--edge`,c=Kn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=NN(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Gt.jsxs("g",{className:c,...o,children:[Gt.jsx("path",{d:u,className:`${l}__container`}),Gt.jsx("path",{d:u,className:`${l}__outer`}),Gt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Ar=({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=`${Qn}--cc--marker`,h=Kn(d,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return Gt.jsx("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:Gt.jsx("path",{d:t,style:{fill:e}})})},NV=e=>Gt.jsx(Ar,{d:PN.d,...e}),PV=e=>Gt.jsx(Ar,{d:UN.d,...e}),UV=e=>Gt.jsx(Ar,{d:BN.d,...e}),BV=e=>Gt.jsx(Ar,{d:HN.d,...e}),HV=e=>Gt.jsx(Ar,{d:VN.d,...e}),VV=e=>Gt.jsx(Ar,{d:FN.d,...e}),FV=({shape:e="circle",tag:t="div",title:n="Title",subtitle:r,description:i,renderIcon:s,href:a,size:o=48,stacked:l,position:c="fixed",bodyPosition:u="absolute",...d})=>{const h=a?"a":d.onClick?"button":t,f=`${Qn}--cc--shape-node`,p=Kn(f,{[`${f}--stacked`]:l,[`${f}--${e}`]:e,[`${f}--${h}`]:h,[d.className]:d.className}),v=n?Gt.jsx("div",{className:`${f}__title`,children:n}):null,m=r?Gt.jsx("div",{className:`${f}__subtitle`,children:r}):null,g=i?Gt.jsx("div",{className:`${f}__description`,children:i}):null;return Gt.jsxs(h,{className:p,style:{height:o,width:o,position:c},tabIndex:0,...d,children:[Gt.jsx("div",{className:`${f}__icon`,children:s}),Gt.jsxs("div",{className:`${f}__body`,style:{position:u},children:[v,m,g]})]})};Q.AlluvialChart=iV,Q.AreaChart=sV,Q.ArrowLeftMarker=NV,Q.ArrowRightMarker=PV,Q.BoxplotChart=aV,Q.BubbleChart=oV,Q.BulletChart=lV,Q.CardNode=$V,Q.CardNodeColumn=RV,Q.CardNodeLabel=LV,Q.CardNodeSubtitle=DV,Q.CardNodeTitle=kV,Q.CircleMarker=UV,Q.CirclePackChart=uV,Q.ComboChart=hV,Q.DiamondMarker=BV,Q.DonutChart=dV,Q.Edge=IV,Q.ExperimentalChoroplethChart=cV,Q.GaugeChart=fV,Q.GroupedBarChart=pV,Q.HeatmapChart=mV,Q.HistogramChart=gV,Q.LineChart=vV,Q.LollipopChart=yV,Q.Marker=Ar,Q.MeterChart=xV,Q.PieChart=bV,Q.RadarChart=EV,Q.ScatterChart=_V,Q.ShapeNode=FV,Q.SimpleBarChart=wV,Q.SquareMarker=HV,Q.StackedAreaChart=SV,Q.StackedBarChart=OV,Q.TeeMarker=VV,Q.TreeChart=TV,Q.TreemapChart=MV,Q.WordCloudChart=CV,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
114
+ */(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})()})(H0);var AV=H0.exports;const Kn=rv(AV),Qn="cds",$V=({tag:e="div",children:t,color:n,href:r,position:i="static",stacked:s,...a})=>{const o=r?"a":a.onClick?"button":e,l=`${Qn}--cc--card-node`,c=Kn(l,{[`${l}--stacked`]:s,[`${l}--${o}`]:o,[a.className]:a.className});return zt.jsx(o,{className:c,style:{borderColor:n,position:i},tabIndex:0,...a,children:t})},RV=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Qn}--cc--card-node`,i=Kn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return zt.jsx("div",{className:i,...n,children:e})},LV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return zt.jsx("label",{className:r,...t,children:e})},DV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return zt.jsx("div",{className:r,...t,children:e})},kV=({children:e,...t})=>{const n=`${Qn}--cc--card-node`,r=Kn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return zt.jsx("div",{className:r,...t,children:e})},IV=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Qn}--cc--edge`,c=Kn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=NN(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return zt.jsxs("g",{className:c,...o,children:[zt.jsx("path",{d:u,className:`${l}__container`}),zt.jsx("path",{d:u,className:`${l}__outer`}),zt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Ar=({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=`${Qn}--cc--marker`,h=Kn(d,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return zt.jsx("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:zt.jsx("path",{d:t,style:{fill:e}})})},NV=e=>zt.jsx(Ar,{d:PN.d,...e}),PV=e=>zt.jsx(Ar,{d:UN.d,...e}),UV=e=>zt.jsx(Ar,{d:BN.d,...e}),BV=e=>zt.jsx(Ar,{d:HN.d,...e}),HV=e=>zt.jsx(Ar,{d:VN.d,...e}),VV=e=>zt.jsx(Ar,{d:FN.d,...e}),FV=({shape:e="circle",tag:t="div",title:n="Title",subtitle:r,description:i,renderIcon:s,href:a,size:o=48,stacked:l,position:c="fixed",bodyPosition:u="absolute",...d})=>{const h=a?"a":d.onClick?"button":t,f=`${Qn}--cc--shape-node`,p=Kn(f,{[`${f}--stacked`]:l,[`${f}--${e}`]:e,[`${f}--${h}`]:h,[d.className]:d.className}),v=n?zt.jsx("div",{className:`${f}__title`,children:n}):null,m=r?zt.jsx("div",{className:`${f}__subtitle`,children:r}):null,g=i?zt.jsx("div",{className:`${f}__description`,children:i}):null;return zt.jsxs(h,{className:p,style:{height:o,width:o,position:c},tabIndex:0,...d,children:[zt.jsx("div",{className:`${f}__icon`,children:s}),zt.jsxs("div",{className:`${f}__body`,style:{position:u},children:[v,m,g]})]})};Q.AlluvialChart=iV,Q.AreaChart=sV,Q.ArrowLeftMarker=NV,Q.ArrowRightMarker=PV,Q.BoxplotChart=aV,Q.BubbleChart=oV,Q.BulletChart=lV,Q.CardNode=$V,Q.CardNodeColumn=RV,Q.CardNodeLabel=LV,Q.CardNodeSubtitle=DV,Q.CardNodeTitle=kV,Q.CircleMarker=UV,Q.CirclePackChart=uV,Q.ComboChart=hV,Q.DiamondMarker=BV,Q.DonutChart=dV,Q.Edge=IV,Q.ExperimentalChoroplethChart=cV,Q.GaugeChart=fV,Q.GroupedBarChart=pV,Q.HeatmapChart=mV,Q.HistogramChart=gV,Q.LineChart=vV,Q.LollipopChart=yV,Q.Marker=Ar,Q.MeterChart=xV,Q.PieChart=bV,Q.RadarChart=EV,Q.ScatterChart=_V,Q.ShapeNode=FV,Q.SimpleBarChart=wV,Q.SquareMarker=HV,Q.StackedAreaChart=SV,Q.StackedBarChart=TV,Q.TeeMarker=VV,Q.TreeChart=OV,Q.TreemapChart=MV,Q.WordCloudChart=CV,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
115
115
  //# sourceMappingURL=index.js.map